code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
"""
Copyright 2017 JetBrains, s.r.o
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 ... | [
"torch.nn.BatchNorm2d",
"torch.nn.Linear",
"torch.nn.Conv2d"
] | [((791, 841), 'torch.nn.Conv2d', 'nn.Conv2d', (['in_channels', 'out_channels', '(3)'], {'padding': '(1)'}), '(in_channels, out_channels, 3, padding=1)\n', (800, 841), True, 'import torch.nn as nn\n'), ((860, 888), 'torch.nn.BatchNorm2d', 'nn.BatchNorm2d', (['out_channels'], {}), '(out_channels)\n', (874, 888), True, 'i... |
import os
with os.scandir('images') as entries:
print("###############_start_###############")
for entry in entries:
# List all files in a directory using os.listdir
basepath = "images/" + entry.name
for entry1 in os.listdir( basepath):
if os.path.isfile(os.path.join(basepath, entry1)):
p... | [
"os.listdir",
"os.scandir",
"os.path.join"
] | [((16, 36), 'os.scandir', 'os.scandir', (['"""images"""'], {}), "('images')\n", (26, 36), False, 'import os\n'), ((231, 251), 'os.listdir', 'os.listdir', (['basepath'], {}), '(basepath)\n', (241, 251), False, 'import os\n'), ((278, 308), 'os.path.join', 'os.path.join', (['basepath', 'entry1'], {}), '(basepath, entry1)\... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from getter import getter
from CURE.CURE import CURELearner
import numpy as np
from matplotlib import pyplot as plt
from pathlib import Path
def lossplot(config: dict, save_path: str = None) -> None:
"""Plots the negative of the loss surface. One... | [
"matplotlib.pyplot.savefig",
"torch.nn.CrossEntropyLoss",
"CURE.CURE.CURELearner",
"getter.getter",
"pathlib.Path",
"numpy.ones",
"torch.nn.functional.normalize",
"numpy.linspace",
"matplotlib.pyplot.figure",
"torch.autograd.grad",
"matplotlib.pyplot.axes",
"matplotlib.pyplot.pause",
"torch.... | [((500, 547), 'getter.getter', 'getter', (["config['dataset']", "config['model_name']"], {}), "(config['dataset'], config['model_name'])\n", (506, 547), False, 'from getter import getter\n'), ((1978, 1999), 'torch.nn.CrossEntropyLoss', 'nn.CrossEntropyLoss', ([], {}), '()\n', (1997, 1999), True, 'import torch.nn as nn\... |
import datetime
import json
from nameko.events import EventDispatcher, event_handler
from simplebank.chassis import init_logger, init_statsd
class FeesService:
name = "fees_service"
statsd = init_statsd('simplebank-demo.fees', 'statsd')
logger = init_logger()
@event_handler("market_service", "order... | [
"nameko.events.event_handler",
"simplebank.chassis.init_logger",
"simplebank.chassis.init_statsd"
] | [((203, 248), 'simplebank.chassis.init_statsd', 'init_statsd', (['"""simplebank-demo.fees"""', '"""statsd"""'], {}), "('simplebank-demo.fees', 'statsd')\n", (214, 248), False, 'from simplebank.chassis import init_logger, init_statsd\n'), ((262, 275), 'simplebank.chassis.init_logger', 'init_logger', ([], {}), '()\n', (2... |
# coding=utf-8
from sqlalchemy.orm.exc import NoResultFound
from ultros_site.base_route import BaseRoute
from ultros_site.database.schema.product import Product
from ultros_site.decorators import check_admin, add_csrf, check_csrf
from ultros_site.message import Message
__author__ = "Momo"
class CreateProductRoute(B... | [
"ultros_site.database.schema.product.Product",
"ultros_site.message.Message"
] | [((2002, 2202), 'ultros_site.database.schema.product.Product', 'Product', ([], {'name': "params['product_name']", 'order': "params['product_order']", 'hidden': "(params['visibility'] == 'Hidden')", 'url_github': "params['github_url']", 'url_circleci': "params['circleci_url']", 'branches': '[]'}), "(name=params['product... |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: pogoprotos/networking/platform/requests/client_telemetry_request.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as ... | [
"google.protobuf.symbol_database.Default",
"google.protobuf.descriptor.FieldDescriptor"
] | [((537, 563), 'google.protobuf.symbol_database.Default', '_symbol_database.Default', ([], {}), '()\n', (561, 563), True, 'from google.protobuf import symbol_database as _symbol_database\n'), ((1661, 2010), 'google.protobuf.descriptor.FieldDescriptor', '_descriptor.FieldDescriptor', ([], {'name': '"""data_id"""', 'full_... |
import jieba.posseg as pseg
import jieba
import jieba.analyse
words = pseg.cut("他来到了网易杭研大厦", HMM=False)
for word, flag in words:
print('%s %s' % (word, flag))
testOne = jieba.cut('丰田太省了', HMM=False)
print("Default Mode: " + "/ ".join(testOne)) # 精确模式
testTwo = jieba.cut('丰田太省了', HMM=True)
print("Default Mode: " +... | [
"jieba.analyse.extract_tags",
"jieba.cut",
"jieba.posseg.cut"
] | [((70, 103), 'jieba.posseg.cut', 'pseg.cut', (['"""他来到了网易杭研大厦"""'], {'HMM': '(False)'}), "('他来到了网易杭研大厦', HMM=False)\n", (78, 103), True, 'import jieba.posseg as pseg\n'), ((174, 203), 'jieba.cut', 'jieba.cut', (['"""丰田太省了"""'], {'HMM': '(False)'}), "('丰田太省了', HMM=False)\n", (183, 203), False, 'import jieba\n'), ((267, ... |
"""
Author: @woosal1337
"""
import time
import rich
from rich import pretty
from rich.console import Console
from dotenv import load_dotenv
import os
console = Console()
load_dotenv()
import json
import spotipy
import lyricsgenius as lg
import time
from tr import translateit
translator = tra... | [
"os.getenv",
"spotipy.Spotify",
"tr.translateit",
"dotenv.load_dotenv",
"rich.console.Console",
"spotipy.SpotifyOAuth"
] | [((173, 182), 'rich.console.Console', 'Console', ([], {}), '()\n', (180, 182), False, 'from rich.console import Console\n'), ((186, 199), 'dotenv.load_dotenv', 'load_dotenv', ([], {}), '()\n', (197, 199), False, 'from dotenv import load_dotenv\n'), ((317, 330), 'tr.translateit', 'translateit', ([], {}), '()\n', (328, 3... |
import contextlib
import glob
import io
import json
import os
import re
import requests
import subprocess
import time
from dcicutils import ff_utils
from dcicutils.beanstalk_utils import get_beanstalk_real_url
from dcicutils.command_utils import yes_or_no
from dcicutils.env_utils import full_cgap_env_name
from dcicuti... | [
"requests.post",
"dcicutils.beanstalk_utils.get_beanstalk_real_url",
"re.compile",
"io.open",
"time.sleep",
"os.path.exists",
"dcicutils.misc_utils.url_path_join",
"dcicutils.env_utils.full_cgap_env_name",
"dcicutils.command_utils.yes_or_no",
"json.dumps",
"dcicutils.misc_utils.environ_bool",
... | [((1079, 1229), 're.compile', 're.compile', (['"""^(https?://localhost(:[0-9]+)?|https?://(fourfront-cgap|cgap-)[a-z0-9.-]*|https?://([a-z-]+[.])*cgap[.]hms[.]harvard[.]edu)/?$"""'], {}), "(\n '^(https?://localhost(:[0-9]+)?|https?://(fourfront-cgap|cgap-)[a-z0-9.-]*|https?://([a-z-]+[.])*cgap[.]hms[.]harvard[.]edu)... |
# coding: utf-8
from __future__ import absolute_import
from flask import json
from six import BytesIO
from swagger_server.models.account_create_update import AccountCreateUpdate # noqa: E501
from swagger_server.models.account_definition import AccountDefinition # noqa: E501
from swagger_server.models.account_defin... | [
"unittest.main",
"swagger_server.models.account_create_update.AccountCreateUpdate",
"flask.json.dumps"
] | [((4733, 4748), 'unittest.main', 'unittest.main', ([], {}), '()\n', (4746, 4748), False, 'import unittest\n'), ((917, 938), 'swagger_server.models.account_create_update.AccountCreateUpdate', 'AccountCreateUpdate', ([], {}), '()\n', (936, 938), False, 'from swagger_server.models.account_create_update import AccountCreat... |
import absl.app as app
import gym
import gym_sc2
def main(argv):
env = gym.make('SC2MoveToBeacon-bbueno5000-v0')
print(env.observation_space)
print(env.action_space)
Box(1, 64, 64)
Discrete(4095)
if __name__ == '__main__':
app.run(main)
| [
"gym.make",
"absl.app.run"
] | [((77, 118), 'gym.make', 'gym.make', (['"""SC2MoveToBeacon-bbueno5000-v0"""'], {}), "('SC2MoveToBeacon-bbueno5000-v0')\n", (85, 118), False, 'import gym\n'), ((251, 264), 'absl.app.run', 'app.run', (['main'], {}), '(main)\n', (258, 264), True, 'import absl.app as app\n')] |
# -*- python -*-
# This software was produced by NIST, an agency of the U.S. government,
# and by statute is not subject to copyright in the United States.
# Recipients of this software assume all responsibilities associated
# with its operation, modification and maintenance. However, to
# facilitate maintenance we as... | [
"ooflib.common.IO.xmlmenudump.loadFile"
] | [((1110, 1175), 'ooflib.common.IO.xmlmenudump.loadFile', 'xmlmenudump.loadFile', (['"""DISCUSSIONS/engine/reg/subproblemtype.xml"""'], {}), "('DISCUSSIONS/engine/reg/subproblemtype.xml')\n", (1130, 1175), False, 'from ooflib.common.IO import xmlmenudump\n')] |
"""
# Argo-specific Extras.
This example shows how we can provide extra options to the Argo runtime.
This example may only show a subset of all the available options. Check the Argo [template specification](https://github.com/argoproj/argo-workflows/blob/v3.0.4/docs/fields.md#template) and the different data structur... | [
"dagger.Task",
"dagger.runtime.cli.invoke"
] | [((1313, 1324), 'dagger.runtime.cli.invoke', 'invoke', (['dag'], {}), '(dag)\n', (1319, 1324), False, 'from dagger.runtime.cli import invoke\n'), ((569, 795), 'dagger.Task', 'Task', (['long_task'], {'runtime_options': "{'argo_container_overrides': {'resources': {'requests': {'cpu': '100m',\n 'memory': '60Mi'}}}, 'ar... |
#!/usr/bin/python
# encoding: utf-8
import torch
import albumentations as A
import torch.nn as nn
from torch.autograd import Variable
from torch.utils.data import Dataset
import collections
from PIL import Image, ImageFilter
import matplotlib.pyplot as plt
import math
import random
import numpy as np
import cv2
import... | [
"numpy.uint8",
"albumentations.MedianBlur",
"albumentations.Blur",
"torchvision.transforms.Grayscale",
"torch.from_numpy",
"numpy.array",
"torchvision.transforms.ColorJitter",
"tensorflow.load_op_library",
"tensorflow.placeholder",
"tensorflow.Session",
"numpy.asarray",
"data_gen.generate_rbox... | [((1965, 1998), 'numpy.asarray', 'np.asarray', (['img'], {'dtype': 'np.float32'}), '(img, dtype=np.float32)\n', (1975, 1998), True, 'import numpy as np\n'), ((2094, 2107), 'numpy.array', 'np.array', (['img'], {}), '(img)\n', (2102, 2107), True, 'import numpy as np\n'), ((2222, 2242), 'PIL.Image.fromarray', 'Image.froma... |
r"""PyWorker is a simple implementation of a worker-pool process.
Example:
from pyworker import PyWorker
from time import time
def some_task(item):
print(item)
task_items = []
for t in range(10 * 6):
task_items.append(t)
worker = PyWorker()
start = time()
# run the tasks
worker.run(some_task, task_items, ... | [
"threading.Thread",
"queue.Queue",
"time.sleep"
] | [((709, 722), 'queue.Queue', 'queue.Queue', ([], {}), '()\n', (720, 722), False, 'import queue\n'), ((996, 1046), 'threading.Thread', 'threading.Thread', ([], {'target': 'self.worker', 'args': '(task,)'}), '(target=self.worker, args=(task,))\n', (1012, 1046), False, 'import threading\n'), ((1332, 1340), 'time.sleep', '... |
import os
from tkinter import *
import tkinter.ttk as ttk
from tkinter import filedialog as fd
import rsa
import crypto
import logic
import dialog
window = Tk()
# Константы
FONT = 11
# Настройки сессии
session_frame = LabelFrame(window, text='Настройка сессии', font=f'Arial {FONT + 1}', bg='white')
from_label = Lab... | [
"rsa.generate_keys",
"dialog.show_add_key_dialog",
"logic.read_session_key",
"rsa.get_private_key",
"crypto.generate_session_key",
"os.path.exists",
"logic.change_color",
"logic.get_private_key_path",
"logic.get_signature_path",
"crypto.sign_file",
"crypto.encrypt_file",
"tkinter.ttk.Combobox"... | [((415, 505), 'tkinter.ttk.Combobox', 'ttk.Combobox', (['session_frame'], {'font': 'f"""Arial {FONT}"""', 'justify': '"""center"""', 'state': '"""readonly"""'}), "(session_frame, font=f'Arial {FONT}', justify='center', state=\n 'readonly')\n", (427, 505), True, 'import tkinter.ttk as ttk\n'), ((1028, 1118), 'tkinter... |
import pytest
from os.path import join
from EPPs.common import StepEPP
from tests.test_common import TestCommon, TestEPP, NamedMock
from unittest.mock import Mock, patch, PropertyMock
from scripts.convert_and_dispatch_genotypes import GenotypeConversion, UploadVcfToSamples
class TestGenotypeConversion(TestCommon):
... | [
"unittest.mock.Mock",
"os.path.join",
"tests.test_common.NamedMock",
"scripts.convert_and_dispatch_genotypes.UploadVcfToSamples",
"pytest.raises",
"unittest.mock.patch.object",
"unittest.mock.patch"
] | [((344, 407), 'os.path.join', 'join', (['TestCommon.assets', '"""genotype_32_SNPs_genome_600bp.fa.fai"""'], {}), "(TestCommon.assets, 'genotype_32_SNPs_genome_600bp.fa.fai')\n", (348, 407), False, 'from os.path import join\n'), ((1257, 1291), 'os.path.join', 'join', (['self.assets', '"""test_generate"""'], {}), "(self.... |
import vox
from vox import linty
from ..base_linter import BaseLinter
class Pyflakes(BaseLinter):
COMMAND = vox.FlagsBuilder().sugar(program="pyflakes")
DEPENDENCIES = ["pyflakes"]
FORMAT = linty.to_str.PYFLAKES
NAME = "pyflakes"
extract_errors = linty.from_str.pyflakes
| [
"vox.FlagsBuilder"
] | [((115, 133), 'vox.FlagsBuilder', 'vox.FlagsBuilder', ([], {}), '()\n', (131, 133), False, 'import vox\n')] |
from flask import Blueprint
bp = Blueprint("admin_bp", __name__)
from app.administrator import views
| [
"flask.Blueprint"
] | [((34, 65), 'flask.Blueprint', 'Blueprint', (['"""admin_bp"""', '__name__'], {}), "('admin_bp', __name__)\n", (43, 65), False, 'from flask import Blueprint\n')] |
import time
# from mufsim.errors import MufRuntimeError
from mufsim.insts.base import Instruction, instr
@instr("date")
class InstDate(Instruction):
def execute(self, fr):
when = time.localtime()
fr.data_push(int(when.tm_mday))
fr.data_push(int(when.tm_mon))
fr.data_push(int(when.... | [
"mufsim.insts.base.instr",
"time.localtime",
"time.strftime",
"time.time"
] | [((109, 122), 'mufsim.insts.base.instr', 'instr', (['"""date"""'], {}), "('date')\n", (114, 122), False, 'from mufsim.insts.base import Instruction, instr\n'), ((333, 346), 'mufsim.insts.base.instr', 'instr', (['"""time"""'], {}), "('time')\n", (338, 346), False, 'from mufsim.insts.base import Instruction, instr\n'), (... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.shortcuts import render
from django.http import HttpResponse, HttpResponseRedirect, JsonResponse
from django.views.decorators.csrf import csrf_exempt
import subprocess
import json
from .forms import UploadFileForm
from .models import WordWit... | [
"subprocess.check_output",
"json.dump",
"django.http.JsonResponse"
] | [((1449, 1615), 'subprocess.check_output', 'subprocess.check_output', (["[JAVA_PATH, ENCODING, CLASSPATH, JAR_PATH, POS_CLASS,\n '../backend-pos/sample-input.txt', OUTPUT_FILE_PATH + 'sample-input' +\n '.json']"], {}), "([JAVA_PATH, ENCODING, CLASSPATH, JAR_PATH,\n POS_CLASS, '../backend-pos/sample-input.txt',... |
import abc
import numpy as np
import xarray as xr
from .registry import register
class Regridder(object):
"""Generic regridder interface."""
__metaclass__ = abc.ABCMeta
def __init__(self, input_grid, output_grid, method=None, **kwargs):
self.input_grid = input_grid
self.output_gri... | [
"xesmf.Regridder",
"pyresample.geometry.SwathDefinition",
"pyresample.kd_tree.get_neighbour_info",
"numpy.zeros"
] | [((1591, 1667), 'xesmf.Regridder', 'xe.Regridder', (['self.input_grid', 'self.output_grid', 'self.method'], {}), '(self.input_grid, self.output_grid, self.method, **self._params)\n', (1603, 1667), True, 'import xesmf as xe\n'), ((2392, 2487), 'pyresample.geometry.SwathDefinition', 'geometry.SwathDefinition', ([], {'lon... |
import json
import copy
import logging
from ..core import Menu, Progress
from . import Setup, Repo, Security, Options, Safety
# The main menu. This is the first menu that appears when the tool is started,
# and it's the hub that everything else can be accessed through. It contains
# special options for saving and load... | [
"logging.getLogger",
"json.load",
"json.dump",
"copy.deepcopy"
] | [((671, 698), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (688, 698), False, 'import logging\n'), ((3871, 3899), 'json.dump', 'json.dump', (['conf', 'f'], {'indent': '(4)'}), '(conf, f, indent=4)\n', (3880, 3899), False, 'import json\n'), ((5103, 5115), 'json.load', 'json.load', (['f']... |
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render
from django.db import models
from api.interact import get_ip
from api.latest import latest
from api.account import pre_load
from api.config import config
def home(request):
if 'teamid' not in request.session:
return rende... | [
"django.shortcuts.render",
"api.account.pre_load",
"django.http.HttpResponseRedirect",
"api.latest.latest",
"api.interact.get_ip",
"api.config.config.comp_started"
] | [((543, 576), 'django.shortcuts.render', 'render', (['request', '"""challenge.html"""'], {}), "(request, 'challenge.html')\n", (549, 576), False, 'from django.shortcuts import render\n'), ((613, 647), 'django.shortcuts.render', 'render', (['request', '"""scoreboard.html"""'], {}), "(request, 'scoreboard.html')\n", (619... |
import random
import string
import factory
from models import Modal
class ModalFactory(factory.Factory):
class Meta:
model = Modal
title = factory.Sequence(lambda n: 'Modal%d' % n)
enabled = random.random < 0.3
is_bootstrapped = random.random < 0.3
| [
"factory.Sequence"
] | [((164, 205), 'factory.Sequence', 'factory.Sequence', (["(lambda n: 'Modal%d' % n)"], {}), "(lambda n: 'Modal%d' % n)\n", (180, 205), False, 'import factory\n')] |
from pyparsing import Suppress, Forward, Word, Group, ZeroOrMore, alphanums, oneOf, Literal
from z3 import Bool, is_app_of, Z3_OP_XOR, Z3_OP_UNINTERPRETED, is_const, is_not, AstRef, is_and, is_or, ExprRef
class AstRefKey:
def __init__(self, n):
self.n = n
def __hash__(self):
return self.n.has... | [
"z3.is_const",
"z3.is_app_of",
"pyparsing.Forward",
"pyparsing.Group",
"z3.is_not",
"z3.is_or",
"pyparsing.Word",
"pyparsing.oneOf",
"z3.is_and",
"pyparsing.Literal"
] | [((1046, 1055), 'pyparsing.Forward', 'Forward', ([], {}), '()\n', (1053, 1055), False, 'from pyparsing import Suppress, Forward, Word, Group, ZeroOrMore, alphanums, oneOf, Literal\n'), ((1075, 1099), 'pyparsing.Word', 'Word', (["(alphanums + '_~[]')"], {}), "(alphanums + '_~[]')\n", (1079, 1099), False, 'from pyparsing... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn import init
def init_weights(net, init_type='normal', gain=0.02):
def init_func(m):
classname = m.__class__.__name__
if hasattr(m, 'weight') and (classname.find('Conv') != -1 or classname.find('Linear') != -1):
... | [
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.Dropout",
"torch.nn.Sigmoid",
"torch.nn.init.constant_",
"torch.nn.init.kaiming_normal_",
"torch.nn.Conv2d",
"torch.nn.init.xavier_normal_",
"torch.nn.init.normal_",
"torch.nn.init.orthogonal_",
"torch.nn.MaxPool2d",
"torch.nn.ConvTranspose2d"... | [((2307, 2328), 'torch.nn.ReLU', 'nn.ReLU', ([], {'inplace': '(True)'}), '(inplace=True)\n', (2314, 2328), True, 'import torch.nn as nn\n'), ((3891, 3913), 'torch.cat', 'torch.cat', (['(x1, x2)', '(1)'], {}), '((x1, x2), 1)\n', (3900, 3913), False, 'import torch\n'), ((4158, 4206), 'torch.nn.MaxPool2d', 'nn.MaxPool2d',... |
#Copyright (C) 2011 by <NAME> and <NAME>
#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, dist... | [
"collections.Counter",
"mittab.apps.tab.forms.SchoolForm"
] | [((2283, 2313), 'collections.Counter', 'collections.Counter', (['deb_names'], {}), '(deb_names)\n', (2302, 2313), False, 'import collections\n'), ((3638, 3676), 'mittab.apps.tab.forms.SchoolForm', 'SchoolForm', ([], {'data': "{'name': school_name}"}), "(data={'name': school_name})\n", (3648, 3676), False, 'from mittab.... |
import os
from datetime import datetime
import disnake
from disnake import Intents
from disnake.ext import commands
from . import constants
class Bot(commands.Bot):
"""Something."""
def __init__(self) -> None:
intents = Intents.default()
intents.members = True
intents.presences = Fa... | [
"disnake.Game",
"datetime.datetime.utcnow",
"disnake.Intents.default"
] | [((241, 258), 'disnake.Intents.default', 'Intents.default', ([], {}), '()\n', (256, 258), False, 'from disnake import Intents\n'), ((417, 456), 'disnake.Game', 'disnake.Game', (['f"""{constants.PREFIX}help"""'], {}), "(f'{constants.PREFIX}help')\n", (429, 456), False, 'import disnake\n'), ((557, 574), 'datetime.datetim... |
from typing import Callable, Set, Union, Type
import kge.inputs.keys as Keys
from kge.core import events
# from kge.core.component_system import ComponentSystem
# from kge.ui.canvas_renderer import CanvasRenderer
from kge.core.system import System
from kge.utils.vector import Vector
from kge.ui.canvas import C... | [
"kge.utils.spatial_hash.Box",
"kge.utils.vector.Vector.Unit",
"kge.ui.canvas.Clear"
] | [((619, 632), 'kge.utils.vector.Vector.Unit', 'Vector.Unit', ([], {}), '()\n', (630, 632), False, 'from kge.utils.vector import Vector\n'), ((1358, 1392), 'kge.utils.spatial_hash.Box', 'Box', (['ev.position', 'self._searchSize'], {}), '(ev.position, self._searchSize)\n', (1361, 1392), False, 'from kge.utils.spatial_has... |
# -*- coding: utf-8 -*-
from __future__ import annotations
from io import BytesIO, TextIOWrapper
from tarfile import TarInfo
from typing import List, Tuple
import numpy as np
import pandas as pd
from ..base import FlexExtension
try:
from astropy.io import fits
from astropy.table import Table
except ImportEr... | [
"pandas.DataFrame.from_records",
"pandas.read_parquet",
"astropy.table.Table.from_pandas",
"pandas.read_csv",
"astropy.table.Table",
"astropy.io.fits.BinTableHDU",
"io.BytesIO",
"pandas.read_json"
] | [((842, 851), 'io.BytesIO', 'BytesIO', ([], {}), '()\n', (849, 851), False, 'from io import BytesIO, TextIOWrapper\n'), ((1613, 1631), 'pandas.read_parquet', 'pd.read_parquet', (['b'], {}), '(b)\n', (1628, 1631), True, 'import pandas as pd\n'), ((2244, 2283), 'pandas.DataFrame.from_records', 'pd.DataFrame.from_records'... |
import argparse
import numpy as np
def parse_args():
parser = argparse.ArgumentParser()
# environment
parser.add_argument('--domain_name', default='walker')
parser.add_argument('--task_name', default='walk')
parser.add_argument('--frame_stack', default=3, type=int)
parser.add_argument('--action_repeat', defaul... | [
"argparse.ArgumentParser"
] | [((65, 90), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (88, 90), False, 'import argparse\n')] |
import os
import numpy as np
import tensorflow as tf
from config import TRAINING_CONFIG
from core import GameConfig as Game
from core import Board
class PolicyValueNetwork:
def __init__(self, model_name=None):
with tf.variable_scope("Dataset"):
input_shape = Board().encoded_states().shape #... | [
"tensorflow.layers.flatten",
"tensorflow.transpose",
"tensorflow.contrib.layers.l2_regularizer",
"numpy.log",
"tensorflow.nn.softmax",
"tensorflow.log",
"os.path.exists",
"tensorflow.Session",
"tensorflow.placeholder",
"tensorflow.layers.conv2d",
"tensorflow.trainable_variables",
"tensorflow.t... | [((2581, 2593), 'tensorflow.Session', 'tf.Session', ([], {}), '()\n', (2591, 2593), True, 'import tensorflow as tf\n'), ((2615, 2631), 'tensorflow.train.Saver', 'tf.train.Saver', ([], {}), '()\n', (2629, 2631), True, 'import tensorflow as tf\n'), ((231, 259), 'tensorflow.variable_scope', 'tf.variable_scope', (['"""Data... |
import unittest
from compression_test import TestCompression
from reproducibility_test import ReproducibilityTest
from v_trace_test import VTraceTest
from worker_test import WorkerTest
from stats_test import TestStats
if __name__ == '__main__':
test_suite = unittest.TestSuite()
test_suite.addTest(unittest.mak... | [
"unittest.TestSuite",
"unittest.TextTestRunner",
"unittest.makeSuite"
] | [((264, 284), 'unittest.TestSuite', 'unittest.TestSuite', ([], {}), '()\n', (282, 284), False, 'import unittest\n'), ((586, 611), 'unittest.TextTestRunner', 'unittest.TextTestRunner', ([], {}), '()\n', (609, 611), False, 'import unittest\n'), ((308, 343), 'unittest.makeSuite', 'unittest.makeSuite', (['TestCompression']... |
"""
Atmosphere Spectral Response
============================
This class calculates the output flux of an astronomical object as a funtction
of the atmosphere spectral response.
"""
import os
import numpy as np
import pandas as pd
from scipy.interpolate import splev, splrep
class Atmosphere_Spectral_Response:
"... | [
"numpy.multiply",
"numpy.asarray",
"os.path.join",
"scipy.interpolate.splrep",
"scipy.interpolate.splev",
"pandas.read_excel"
] | [((392, 477), 'os.path.join', 'os.path.join', (['"""Atmosphere_Spectral_Response"""', '"""atmosphere_spectral_response.xlsx"""'], {}), "('Atmosphere_Spectral_Response',\n 'atmosphere_spectral_response.xlsx')\n", (404, 477), False, 'import os\n'), ((837, 872), 'numpy.asarray', 'np.asarray', (['atm_wavelength_interval... |
# -*- coding: utf-8 -*-
"""
Created on Wed Oct 7 17:35:28 2015
@author: oligschlager
"""
import pandas as pd
import seaborn as sns
import numpy as np
sns.set_style('white')
##############################################################################
#################### Creative Achievement Questionnaire ####... | [
"seaborn.set_style",
"pandas.Series"
] | [((155, 177), 'seaborn.set_style', 'sns.set_style', (['"""white"""'], {}), "('white')\n", (168, 177), True, 'import seaborn as sns\n'), ((22778, 22810), 'pandas.Series', 'pd.Series', (['"""NaN"""'], {'index': 'df.index'}), "('NaN', index=df.index)\n", (22787, 22810), True, 'import pandas as pd\n')] |
########################################################################
#
# Date:Sept 2009 Authors: <NAME>
#
# <EMAIL>
#
# The Scripps Research Institute (TSRI)
# Molecular Graphics Lab
# La Jolla, CA 92037, USA
#
# Copyright: <NAME> and TSRI
#
#####################################################... | [
"numpy.array"
] | [((1112, 1129), 'numpy.array', 'numpy.array', (['mats'], {}), '(mats)\n', (1123, 1129), False, 'import numpy\n')] |
from os import path
import json
from .._base import BaseFinder
class SublimeTextFinder(BaseFinder):
application_id = 'com.sublimetext.3'
sublime_application_path = path.expanduser('~/Library/Application Support/Sublime Text 3/Local')
def load_json_file(self, json_file):
json_data = None
... | [
"os.path.exists",
"os.path.splitext",
"os.path.join",
"os.path.basename",
"json.load",
"AppKit.NSWorkspace.sharedWorkspace",
"os.path.expanduser"
] | [((177, 246), 'os.path.expanduser', 'path.expanduser', (['"""~/Library/Application Support/Sublime Text 3/Local"""'], {}), "('~/Library/Application Support/Sublime Text 3/Local')\n", (192, 246), False, 'from os import path\n'), ((326, 348), 'os.path.exists', 'path.exists', (['json_file'], {}), '(json_file)\n', (337, 34... |
# Copyright Materialize, Inc. and contributors. All rights reserved.
#
# Use of this software is governed by the Business Source License
# included in the LICENSE file at the root of this repository.
#
# As of the Change Date specified in that file, in accordance with
# the Business Source License, use of this software... | [
"textwrap.dedent"
] | [((625, 1192), 'textwrap.dedent', 'dedent', (['"""\n > CREATE TABLE drop_index_table (f1 INTEGER, f2 INTEGER, f3 INTEGER);\n > INSERT INTO drop_index_table VALUES (1,1,1);\n > CREATE DEFAULT INDEX ON drop_index_table;\n > INSERT INTO drop_index_table VALUES (2... |
"""
projections
~~~~~~~~~~~
Some code to do with handling projections, and extracting settings. Was
originally mostly in the "comparator" module `geo_clip` but pulled out for
re-use.
"""
import logging
_logger = logging.getLogger(__name__)
try:
import geopandas as gpd
import shapely.ops
except Exception as ... | [
"logging.getLogger"
] | [((215, 242), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (232, 242), False, 'import logging\n')] |
import struct
import sys
from .padblanc8 import padblanc8
class EclBinWriter:
"""Base class for writing Eclipse binary file
Args:
binfile: File pointer for binary file opened for write
errfile: Optional file pointer for file opened for error messages. Default standard output.
No... | [
"struct.pack"
] | [((1258, 1286), 'struct.pack', 'struct.pack', (['self._iform', '(16)'], {}), '(self._iform, 16)\n', (1269, 1286), False, 'import struct\n'), ((1376, 1406), 'struct.pack', 'struct.pack', (['self._iform', 'nval'], {}), '(self._iform, nval)\n', (1387, 1406), False, 'import struct\n'), ((1497, 1525), 'struct.pack', 'struct... |
from .components.html.html import HTML
from .components.container.container import Container
from .components.navbar.navbar import Navbar
from .components.card.card import Card
from .components.row.row import Row
from .components.coloumn.coloumn import Coloumn
from .components.jumbotron.jumbotron import Jumbotron
from ... | [
"math.floor"
] | [((2110, 2131), 'math.floor', 'floor', (['(12 / col_count)'], {}), '(12 / col_count)\n', (2115, 2131), False, 'from math import floor\n')] |
import requests
import pytest
import mock
import tempfile
import os
from datetime import datetime
from obs.libs import bucket
from werkzeug.datastructures import FileStorage
from obs.api.app.controllers.api import storage
def fake_resource(access_key, secret_key):
resouce = mock.Mock()
resouce.Bucket.return_... | [
"mock.Mock",
"datetime.datetime",
"os.listdir"
] | [((282, 293), 'mock.Mock', 'mock.Mock', ([], {}), '()\n', (291, 293), False, 'import mock\n'), ((822, 833), 'mock.Mock', 'mock.Mock', ([], {}), '()\n', (831, 833), False, 'import mock\n'), ((876, 909), 'datetime.datetime', 'datetime', (['(2019)', '(9)', '(24)', '(1)', '(1)', '(0)', '(0)'], {}), '(2019, 9, 24, 1, 1, 0, ... |
# -*- coding: utf-8 -*-
# Learn more: https://github.com/kennethreitz/setup.py
from setuptools import setup, find_packages
with open('README.md') as f:
readme = f.read()
with open('LICENSE') as f:
license = f.read()
setup(
name='norutil',
version='0.0.2',
description='Prototype package for my ... | [
"setuptools.find_packages"
] | [((501, 541), 'setuptools.find_packages', 'find_packages', ([], {'exclude': "('tests', 'docs')"}), "(exclude=('tests', 'docs'))\n", (514, 541), False, 'from setuptools import setup, find_packages\n')] |
from .abs_factory import AbsFactory
from autos.chevyvolt import ChevyVolt
class ChevyFactory(AbsFactory):
def create_auto(self):
self.chevy = chevy = ChevyVolt()
chevy.name = '<NAME>'
return chevy
| [
"autos.chevyvolt.ChevyVolt"
] | [((170, 181), 'autos.chevyvolt.ChevyVolt', 'ChevyVolt', ([], {}), '()\n', (179, 181), False, 'from autos.chevyvolt import ChevyVolt\n')] |
# -*- coding: utf-8 -*-
# @Date : 2021/12/18 19:39
# @Author : WangYihao
# @File : functions.py
import os
import time
import adabound
import torch
from torch import nn, optim
from torch.utils.tensorboard import SummaryWriter
from torchvision import transforms
from openpyxl import load_workbook
from my_utils i... | [
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"os.path.join",
"torch.nn.Conv2d",
"torch.softmax",
"torch.sum",
"torch.save",
"torch.no_grad",
"time.localtime",
"time.time",
"torch.zeros"
] | [((1085, 1103), 'torch.zeros', 'torch.zeros', (['chans'], {}), '(chans)\n', (1096, 1103), False, 'import torch\n'), ((1275, 1301), 'torch.softmax', 'torch.softmax', (['sims'], {'dim': '(0)'}), '(sims, dim=0)\n', (1288, 1301), False, 'import torch\n'), ((1581, 1632), 'os.path.join', 'os.path.join', (['save_dir', 'f"""{a... |
from .road_list import *
import numpy as np
from litdrive.selfdriving.enums import ManeuverState
def fitPolysToPoly(list_p1d_u, list_p1d_v, list_hdg, list_x, list_y):
pspace=np.linspace(0.0, 1.0, 100)
pnts_x=list()
pnts_y=list()
if(len(list_p1d_v)!=len(list_p1d_u) or len(list_p1d_v)!=len(list_hdg) or ... | [
"numpy.polyfit",
"numpy.sin",
"numpy.linspace",
"numpy.cos",
"numpy.concatenate",
"numpy.poly1d"
] | [((180, 206), 'numpy.linspace', 'np.linspace', (['(0.0)', '(1.0)', '(100)'], {}), '(0.0, 1.0, 100)\n', (191, 206), True, 'import numpy as np\n'), ((848, 870), 'numpy.concatenate', 'np.concatenate', (['pnts_x'], {}), '(pnts_x)\n', (862, 870), True, 'import numpy as np\n'), ((882, 904), 'numpy.concatenate', 'np.concatena... |
import numpy as np
from wholeslidedata.annotation.structures import Point
from wholeslidedata.annotation.wholeslideannotation import WholeSlideAnnotation
from wholeslidedata.image.wholeslideimage import WholeSlideImage
from wholeslidedata.labels import Label
def non_max_suppression_fast(boxes, overlapThresh):
"""... | [
"wholeslidedata.annotation.wholeslideannotation.WholeSlideAnnotation",
"numpy.minimum",
"numpy.where",
"numpy.argsort",
"numpy.array",
"wholeslidedata.labels.Label",
"numpy.maximum",
"wholeslidedata.image.wholeslideimage.WholeSlideImage"
] | [((1044, 1058), 'numpy.argsort', 'np.argsort', (['y2'], {}), '(y2)\n', (1054, 1058), True, 'import numpy as np\n'), ((2459, 2509), 'numpy.array', 'np.array', (['[x - size, y - size, x + size, y + size]'], {}), '([x - size, y - size, x + size, y + size])\n', (2467, 2509), True, 'import numpy as np\n'), ((2712, 2755), 'w... |
"""
Functions to estimate observed ACA magnitudes
"""
import sys
import traceback
import logging
import collections
import scipy.stats
import scipy.special
import numpy as np
import numba
from astropy.table import Table, vstack
from Chandra.Time import DateTime
from cheta import fetch
from Quaternion import Quat
imp... | [
"logging.getLogger",
"numpy.char.rstrip",
"numpy.sqrt",
"astropy.table.Table",
"cxotime.CxoTime",
"numpy.array",
"numpy.nanmean",
"sys.exc_info",
"numpy.arctan2",
"numpy.isfinite",
"astropy.table.vstack",
"cheta.fetch.Msidset",
"numpy.arange",
"Quaternion.Quat",
"numpy.mean",
"numpy.wh... | [((624, 661), 'logging.getLogger', 'logging.getLogger', (['"""agasc.supplement"""'], {}), "('agasc.supplement')\n", (641, 661), False, 'import logging\n'), ((1619, 1655), 'collections.defaultdict', 'collections.defaultdict', (['(lambda : -1)'], {}), '(lambda : -1)\n', (1642, 1655), False, 'import collections\n'), ((563... |
import fileinput
contents = [x.strip() for x in fileinput.input()]
WIDTH = len(contents[0])
HEIGHT = len(contents)
def create_initial_map():
"""Return a map of (x, y) coordinates and a matching symbol from contents."""
seat_map = dict()
for y in range(HEIGHT):
for x in range(WIDTH):
... | [
"fileinput.input"
] | [((49, 66), 'fileinput.input', 'fileinput.input', ([], {}), '()\n', (64, 66), False, 'import fileinput\n')] |
# -*- coding:utf-8 -*-
import re
import logging
import os.path
import argparse
import json
import sys
from collections import OrderedDict, namedtuple
try:
from pip.utils import get_installed_distributions
except ImportError:
import pkg_resources
def get_installed_distributions():
return pkg_resourc... | [
"logging.getLogger",
"collections.OrderedDict",
"collections.namedtuple",
"logging.StreamHandler",
"argparse.ArgumentParser",
"re.compile",
"json.dumps",
"distlib.version.NormalizedVersion",
"tempfile.gettempdir",
"pip.utils.get_installed_distributions"
] | [((496, 523), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (513, 523), False, 'import logging\n'), ((534, 593), 'collections.namedtuple', 'namedtuple', (['"""Request"""', '"""name previous_version distribution"""'], {}), "('Request', 'name previous_version distribution')\n", (544, 593),... |
# Retipy - Retinal Image Processing on Python
# Copyright (C) 2017 <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 vers... | [
"retipy.math.derivative1_forward_h2",
"retipy.math.derivative1_centered_h1",
"retipy.math.derivative2_centered_h1"
] | [((910, 951), 'retipy.math.derivative1_forward_h2', 'math.derivative1_forward_h2', (['(0)', '[1, 2, 3]'], {}), '(0, [1, 2, 3])\n', (937, 951), False, 'from retipy import math\n'), ((1224, 1266), 'retipy.math.derivative1_centered_h1', 'math.derivative1_centered_h1', (['(1)', '[1, 2, 3]'], {}), '(1, [1, 2, 3])\n', (1252,... |
"""Conversion tool from EDF, EDF+, BDF to FIF."""
# Authors: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
#
# License: BSD (3-clause)
import calendar
import datetime
import os
import re
import numpy as np
from ...utils import verbose, logger, warn
from ..utils import _blk_read_lims
from ..base import BaseRaw, _chec... | [
"numpy.uint8",
"numpy.fromfile",
"scipy.interpolate.interp1d",
"numpy.argsort",
"numpy.array",
"numpy.arange",
"datetime.datetime",
"numpy.atleast_2d",
"numpy.where",
"numpy.max",
"numpy.linspace",
"numpy.concatenate",
"numpy.min",
"os.path.splitext",
"re.findall",
"numpy.intersect1d",... | [((22757, 22779), 're.findall', 're.findall', (['pat', 'annot'], {}), '(pat, annot)\n', (22767, 22779), False, 'import re\n'), ((22944, 22969), 're.findall', 're.findall', (['pat', 'annotmap'], {}), '(pat, annotmap)\n', (22954, 22969), False, 'import re\n'), ((23125, 23146), 'numpy.zeros', 'np.zeros', (['data_length'],... |
import sys
sys.path.append('..')
import torch as th
import torch.nn as nn
import geoopt as gt
from util.hyperop import *
class hyperRNN(nn.Module):
def __init__(self, input_size, hidden_size, d_ball, default_dtype=th.float64):
super(hyperRNN, self).__init__()
self.input_size = inp... | [
"geoopt.PoincareBall",
"torch.stack",
"geoopt.ManifoldTensor",
"sys.path.append",
"torch.zeros"
] | [((11, 32), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (26, 32), False, 'import sys\n'), ((1192, 1285), 'torch.zeros', 'th.zeros', (['(batch_size, hidden_size, d_ball)'], {'dtype': 'self.default_dtype', 'device': 'cuda_device'}), '((batch_size, hidden_size, d_ball), dtype=self.default_dtype,\... |
from fastapi import FastAPI
from typing import List
from fastapi import FastAPI, UploadFile, File
import numpy as np
from starlette.requests import Request
import io
from PIL import Image
import base64
import cv2
app = FastAPI()
@app.post("/predict")
async def analyse(image_file_read: bytes = File(...)):
file = ba... | [
"fastapi.FastAPI",
"base64.b64encode",
"base64.b64decode",
"cv2.imdecode",
"numpy.frombuffer",
"fastapi.File"
] | [((219, 228), 'fastapi.FastAPI', 'FastAPI', ([], {}), '()\n', (226, 228), False, 'from fastapi import FastAPI, UploadFile, File\n'), ((295, 304), 'fastapi.File', 'File', (['...'], {}), '(...)\n', (299, 304), False, 'from fastapi import FastAPI, UploadFile, File\n'), ((318, 351), 'base64.b64encode', 'base64.b64encode', ... |
import time
from gdx import gdx #the gdx function calls are from a gdx.py file inside the gdx folder.
gdx = gdx.gdx()
gdx.open_usb()
gdx.select_sensors()
gdx.start()
num = 1000
count = 0
begin = time.time()
while count < num:
measurements = gdx.listOfListsReadValues() #returns a list of measurements from the sens... | [
"gdx.gdx.listOfListsReadValues",
"gdx.gdx.start",
"gdx.gdx.close",
"gdx.gdx.select_sensors",
"gdx.gdx.stop",
"gdx.gdx.open_usb",
"time.time",
"gdx.gdx.gdx"
] | [((108, 117), 'gdx.gdx.gdx', 'gdx.gdx', ([], {}), '()\n', (115, 117), False, 'from gdx import gdx\n'), ((119, 133), 'gdx.gdx.open_usb', 'gdx.open_usb', ([], {}), '()\n', (131, 133), False, 'from gdx import gdx\n'), ((134, 154), 'gdx.gdx.select_sensors', 'gdx.select_sensors', ([], {}), '()\n', (152, 154), False, 'from g... |
# modules we'll need
import numpy as np
import os
import glob
import pandas as pd
from subprocess import call
from librosa import load, stft
# config
INPUT_DIR = "/mnt/d/datasets/Looking-to-Listen_small/all_wavs/"
INPUT_DIR_VISUAL = "/mnt/d/datasets/Looking-to-Listen_small/all_vector/"
OUTPUT_DIR = "/mnt/d/datasets/Lo... | [
"os.path.exists",
"numpy.savez",
"os.makedirs",
"os.path.join",
"numpy.max",
"numpy.random.randint",
"subprocess.call",
"numpy.concatenate",
"os.path.basename",
"librosa.stft",
"librosa.load"
] | [((774, 806), 'os.path.join', 'os.path.join', (['directory', '"""*.wav"""'], {}), "(directory, '*.wav')\n", (786, 806), False, 'import os\n'), ((886, 912), 'os.path.exists', 'os.path.exists', (['OUTPUT_DIR'], {}), '(OUTPUT_DIR)\n', (900, 912), False, 'import os\n'), ((922, 945), 'os.makedirs', 'os.makedirs', (['OUTPUT_... |
from threading import Lock
from typing import Dict, Set, Union
from zemberek.core.turkish.phonetic_attribute import PhoneticAttribute
class AttributeToSurfaceCache:
def __init__(self):
self.attribute_map: Dict[int, str] = {}
self.lock = Lock()
def add_surface(self, attributes: Set[PhoneticA... | [
"threading.Lock"
] | [((261, 267), 'threading.Lock', 'Lock', ([], {}), '()\n', (265, 267), False, 'from threading import Lock\n')] |
__author__ = "<NAME>"
__copyright__ = "Copyright 2007, The Databox Project"
__email__ = "<EMAIL>"
import lib as databox
import urllib3
import os
import json
from flask import Flask
import ssl
store= os.environ['DATABOX_STORE_ENDPOINT']
print('Store ' + store)
hostname = os.environ['DATABOX_LOCAL_NAME']
dpem = open(... | [
"json.loads",
"flask.Flask",
"lib.waitForStoreStatus",
"os.path.abspath",
"lib.getRootCatalog"
] | [((372, 388), 'json.loads', 'json.loads', (['dpem'], {}), '(dpem)\n', (382, 388), False, 'import json\n'), ((641, 689), 'lib.waitForStoreStatus', 'databox.waitForStoreStatus', (['store', '"""active"""', '(100)'], {}), "(store, 'active', 100)\n", (667, 689), True, 'import lib as databox\n'), ((725, 749), 'lib.getRootCat... |
'''
Expose selection of query methods.
'''
from asreview.query_strategies import max_sampling, random_sampling
from asreview.query_strategies import uncertainty_sampling, rand_max_sampling
from asreview.utils import _unsafe_dict_update
def get_query_strategy(settings):
"""Function to get the query method"""
... | [
"asreview.utils._unsafe_dict_update"
] | [((601, 671), 'asreview.utils._unsafe_dict_update', '_unsafe_dict_update', (["settings['query_kwargs']", "settings['query_param']"], {}), "(settings['query_kwargs'], settings['query_param'])\n", (620, 671), False, 'from asreview.utils import _unsafe_dict_update\n')] |
"""
XHTML Degrader Middleware.
When sending contents with the XHTML media type, application/xhtml+xml, this
module checks to ensure that the user agent (web browser) is capable of
rendering it. If not, it changes the media type to text/html and makes the
contents more "HTML-friendly" (as per the XHTML 1.0 HTML Compat... | [
"re.compile"
] | [((375, 414), 're.compile', 're.compile', (['"""application\\\\/xhtml\\\\+xml"""'], {}), "('application\\\\/xhtml\\\\+xml')\n", (385, 414), False, 'import re\n'), ((436, 464), 're.compile', 're.compile', (['"""(?<=\\\\S)\\\\/\\\\>"""'], {}), "('(?<=\\\\S)\\\\/\\\\>')\n", (446, 464), False, 'import re\n'), ((493, 521), ... |
import urllib3
import lxml.etree as ET
class webCollector:
def __init__(self):
self._http = urllib3.PoolManager()
def listToSingle(function):
"""
This function helps to threat a list as it was a single object.
Designed to be used as a decorator.
"""
def listHan... | [
"urllib3.PoolManager",
"lxml.etree.HTML"
] | [((106, 127), 'urllib3.PoolManager', 'urllib3.PoolManager', ([], {}), '()\n', (125, 127), False, 'import urllib3\n'), ((1769, 1782), 'lxml.etree.HTML', 'ET.HTML', (['page'], {}), '(page)\n', (1776, 1782), True, 'import lxml.etree as ET\n'), ((973, 987), 'lxml.etree.HTML', 'ET.HTML', (['etree'], {}), '(etree)\n', (980, ... |
import wysdom
from jetavator.schema_registry.vault_object_types.ColumnType import ColumnType
class Column(wysdom.UserObject):
_type: str = wysdom.UserProperty(str, name="type")
@property
def type(self) -> ColumnType:
return ColumnType(self._type)
| [
"jetavator.schema_registry.vault_object_types.ColumnType.ColumnType",
"wysdom.UserProperty"
] | [((147, 184), 'wysdom.UserProperty', 'wysdom.UserProperty', (['str'], {'name': '"""type"""'}), "(str, name='type')\n", (166, 184), False, 'import wysdom\n'), ((249, 271), 'jetavator.schema_registry.vault_object_types.ColumnType.ColumnType', 'ColumnType', (['self._type'], {}), '(self._type)\n', (259, 271), False, 'from ... |
from math import ceil
import warnings
from collections import namedtuple
import numpy as np
from .basis import conv_basis, delta_stim, boxcar_stim, make_nonlinear_raised_cosine
__all__ = ['Design', 'Covariate']
class Design:
covariates = {}
bias = False
def __init__(self, experiment):
self.exp... | [
"numpy.histogram",
"math.ceil",
"numpy.ones",
"numpy.isnan",
"numpy.concatenate",
"warnings.warn",
"numpy.isinf",
"numpy.arange"
] | [((6575, 6600), 'math.ceil', 'ceil', (['(duration / binwidth)'], {}), '(duration / binwidth)\n', (6579, 6600), False, 'from math import ceil\n'), ((3665, 3715), 'numpy.concatenate', 'np.concatenate', (['[trial[label] for trial in trials]'], {}), '([trial[label] for trial in trials])\n', (3679, 3715), True, 'import nump... |
import urllib.request
from urllib.error import HTTPError, URLError
import bs4 as bs
import json, time, random, os
from socket import timeout
def update_json(data):
global j_data, tag_name
j_data[tag_name].append(data)
def call_back(myurl, num):
toremove = dict.fromkeys((ord(c) for c in u'\xa0\n\t'))
#... | [
"bs4.BeautifulSoup",
"time.time",
"json.dump"
] | [((975, 1009), 'bs4.BeautifulSoup', 'bs.BeautifulSoup', (['html_doc', '"""lxml"""'], {}), "(html_doc, 'lxml')\n", (991, 1009), True, 'import bs4 as bs\n'), ((3278, 3314), 'json.dump', 'json.dump', (['j_data', 'outfile'], {'indent': '(2)'}), '(j_data, outfile, indent=2)\n', (3287, 3314), False, 'import json, time, rando... |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | [
"alembic.op.get_bind",
"sqlalchemy.orm.lazyload",
"alembic.util.msg",
"sqlalchemy.MetaData",
"sqlalchemy.String",
"sqlalchemy.Enum",
"sqlalchemy.false",
"sqlalchemy.Column"
] | [((1005, 1018), 'sqlalchemy.MetaData', 'sa.MetaData', ([], {}), '()\n', (1016, 1018), True, 'import sqlalchemy as sa\n'), ((1202, 1230), 'sqlalchemy.Column', 'sa.Column', (['"""svi"""', 'sa.Boolean'], {}), "('svi', sa.Boolean)\n", (1211, 1230), True, 'import sqlalchemy as sa\n'), ((1048, 1061), 'sqlalchemy.String', 'sa... |
from collections import namedtuple
from typing import List, Tuple
import torch
from wiki_search.dataset import Dataset, Document
from wiki_search.core.bert_ranking import BertRanking
SearchResult = namedtuple('SearchResult', ['score', 'document'])
class Engine(object):
def __init__(self, dataset: Dataset, ran... | [
"collections.namedtuple",
"wiki_search.core.bert_ranking.BertRanking",
"torch.unsqueeze",
"torch.stack",
"torch.nonzero",
"torch.squeeze",
"torch.all"
] | [((202, 251), 'collections.namedtuple', 'namedtuple', (['"""SearchResult"""', "['score', 'document']"], {}), "('SearchResult', ['score', 'document'])\n", (212, 251), False, 'from collections import namedtuple\n'), ((400, 413), 'wiki_search.core.bert_ranking.BertRanking', 'BertRanking', ([], {}), '()\n', (411, 413), Fal... |
import uuid
from django.db import models
from django.contrib.auth.models import User
class Language(models.Model):
name = models.CharField(max_length = 32)
code = models.CharField(max_length = 8, default='')
active = models.BooleanField(default = True)
def __str__(self):
return 'Language: {0}.... | [
"django.db.models.DateField",
"django.db.models.ForeignKey",
"django.db.models.IntegerField",
"django.db.models.ManyToManyField",
"django.db.models.BooleanField",
"django.db.models.CharField",
"django.db.models.URLField",
"django.db.models.UUIDField"
] | [((127, 158), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(32)'}), '(max_length=32)\n', (143, 158), False, 'from django.db import models\n'), ((172, 214), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(8)', 'default': '""""""'}), "(max_length=8, default='')\n", (188, ... |
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
from projects.models import Project
# @python_2_unicode_compatible
# class LineFollowerStage(models.Model):
# order = models.PositiveSmallIntegerField(verbose_name=_("... | [
"django.utils.translation.ugettext_lazy"
] | [((1609, 1640), 'django.utils.translation.ugettext_lazy', '_', (['"""Line Follower Junior Stage"""'], {}), "('Line Follower Junior Stage')\n", (1610, 1640), True, 'from django.utils.translation import ugettext_lazy as _\n'), ((1671, 1703), 'django.utils.translation.ugettext_lazy', '_', (['"""Line Follower Junior Stages... |
#!/usr/bin/env python3
# std
from pathlib import Path
import unittest
# 3rd
import numpy as np
# ours
from clusterking.util.testing import MyTestCase
from clusterking.data.dwe import DataWithErrors
class TestDataWithErrors(MyTestCase):
def setUp(self):
dpath = Path(__file__).parent / "data" / "test.sql... | [
"numpy.identity",
"numpy.eye",
"numpy.sqrt",
"numpy.ones",
"pathlib.Path",
"numpy.count_nonzero",
"numpy.zeros",
"clusterking.data.dwe.DataWithErrors",
"unittest.main"
] | [((4666, 4681), 'unittest.main', 'unittest.main', ([], {}), '()\n', (4679, 4681), False, 'import unittest\n'), ((394, 415), 'clusterking.data.dwe.DataWithErrors', 'DataWithErrors', (['dpath'], {}), '(dpath)\n', (408, 415), False, 'from clusterking.data.dwe import DataWithErrors\n'), ((928, 944), 'numpy.zeros', 'np.zero... |
# -*- coding: utf-8 -*-
#
# This class was auto-generated from the API references found at
# https://epayments-api.developer-ingenico.com/s2sapi/v1/
#
from ingenico.connect.sdk.domain.definitions.card import Card
from ingenico.connect.sdk.domain.payout.definitions.abstract_payout_method_specific_input import AbstractPa... | [
"ingenico.connect.sdk.domain.payout.definitions.payout_recipient.PayoutRecipient",
"ingenico.connect.sdk.domain.definitions.card.Card"
] | [((2917, 2923), 'ingenico.connect.sdk.domain.definitions.card.Card', 'Card', ([], {}), '()\n', (2921, 2923), False, 'from ingenico.connect.sdk.domain.definitions.card import Card\n'), ((3324, 3341), 'ingenico.connect.sdk.domain.payout.definitions.payout_recipient.PayoutRecipient', 'PayoutRecipient', ([], {}), '()\n', (... |
# Developed by Redjumpman for Redbot
from discord.ext import commands
from random import choice as randchoice
class Fortune:
"""Fortune Cookie Commands."""
def __init__(self, bot):
self.bot = bot
self.fortune = ["He who laughs at himself never runs out of things to laugh at.",
... | [
"random.choice",
"discord.ext.commands.command"
] | [((675, 727), 'discord.ext.commands.command', 'commands.command', ([], {'name': '"""fortune"""', 'aliases': "['cookie']"}), "(name='fortune', aliases=['cookie'])\n", (691, 727), False, 'from discord.ext import commands\n'), ((887, 911), 'random.choice', 'randchoice', (['self.fortune'], {}), '(self.fortune)\n', (897, 91... |
import click
import svdtools
@click.group()
@click.version_option(svdtools.__version__, prog_name="svdtools")
def svdtools_cli():
pass
@click.command()
@click.argument("yaml-file")
def patch(yaml_file):
"""Patches an SVD file as specified by a YAML file"""
svdtools.patch.main(yaml_file)
@click.comman... | [
"click.argument",
"click.group",
"click.option",
"svdtools.interrupts.main",
"svdtools.mmap.main",
"click.version_option",
"svdtools.makedeps.main",
"click.command",
"svdtools.patch.main"
] | [((33, 46), 'click.group', 'click.group', ([], {}), '()\n', (44, 46), False, 'import click\n'), ((48, 112), 'click.version_option', 'click.version_option', (['svdtools.__version__'], {'prog_name': '"""svdtools"""'}), "(svdtools.__version__, prog_name='svdtools')\n", (68, 112), False, 'import click\n'), ((145, 160), 'cl... |
import os
import numpy as np
import cv2
import matplotlib.pyplot as plt
import matplotlib.animation as animation
try:
from urllib.request import urlopen
from urllib.error import HTTPError
except ImportError:
from urllib2 import urlopen, HTTPError
from load_inningdata import get_inning, get_p... | [
"os.path.exists",
"cv2.vconcat",
"xmlio.writer.writer",
"urllib2.urlopen",
"xmlio.parser.parse",
"os.makedirs",
"visualize.Pitch.batter_info",
"visualize.Pitch.course",
"xmlio.parser.parse_path",
"os.path.join",
"cv2.imshow",
"load_games.get_games",
"numpy.zeros",
"visualize.Pitch.pitcher_... | [((2403, 2415), 'urllib2.urlopen', 'urlopen', (['url'], {}), '(url)\n', (2410, 2415), False, 'from urllib2 import urlopen, HTTPError\n'), ((2475, 2490), 'xmlio.parser.parse', 'parse', (['data_str'], {}), '(data_str)\n', (2480, 2490), False, 'from xmlio.parser import parse, parse_path\n'), ((2655, 2675), 'os.path.exists... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import pandas as pd
import numpy as np
import scipy
import collections
import itertools
import json
from bokeh.transform import linear_cmap, transform
from bokeh.palettes import Set3, Viridis256
from bokeh.models import (
LinearColorMapper,
ColumnDataSource,
Ho... | [
"bokeh.transform.transform",
"scipy.cluster.hierarchy.leaves_list",
"bokeh.models.BasicTicker",
"data.natural_earth",
"bokeh.models.BoxSelectTool",
"bokeh.plotting.figure",
"numpy.reshape",
"bokeh.models.LinearColorMapper",
"numpy.linspace",
"scipy.stats.zscore",
"bokeh.models.ColumnDataSource",... | [((698, 724), 'numpy.linspace', 'np.linspace', (['start', 'end', 'n'], {}), '(start, end, n)\n', (709, 724), True, 'import matplotlib, numpy as np\n'), ((736, 807), 'matplotlib.colors.LinearSegmentedColormap.from_list', 'matplotlib.colors.LinearSegmentedColormap.from_list', (['"""customcmap"""', 'cmap'], {}), "('custom... |
import asyncio
import cv2
import numpy as np
from numpysocket import NumpySocket
THREADS = 3
frames = [None] * THREADS
async def send(sen, ack, i):
global frames
await sen.send_numpy(frames[i])
ack.receive_ack()
async def main():
global frames
# host_ip = '172.27.3.3'
# host_ip = '172.27.3... | [
"numpy.array_split",
"numpysocket.NumpySocket",
"cv2.VideoCapture",
"cv2.cvtColor"
] | [((362, 381), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (378, 381), False, 'import cv2\n'), ((443, 456), 'numpysocket.NumpySocket', 'NumpySocket', ([], {}), '()\n', (454, 456), False, 'from numpysocket import NumpySocket\n'), ((598, 611), 'numpysocket.NumpySocket', 'NumpySocket', ([], {}), '()\n',... |
import heapq
from collections import Counter
from typing import List
def top_k_frequent_bucket_sort(nums: List[int], k: int) -> List[int]:
"""Given a list of numbers, return the the top k most frequent numbers.
Solved using buckets sort approach.
Example:
nums: [1, 1, 1, 2, 2, 3], k=2
ou... | [
"collections.Counter",
"heapq.heappush",
"heapq.heappop"
] | [((961, 974), 'collections.Counter', 'Counter', (['nums'], {}), '(nums)\n', (968, 974), False, 'from collections import Counter\n'), ((2061, 2074), 'collections.Counter', 'Counter', (['nums'], {}), '(nums)\n', (2068, 2074), False, 'from collections import Counter\n'), ((2191, 2229), 'heapq.heappush', 'heapq.heappush', ... |
from pathlib import Path
# This needs to be in a separate module for easy mocking during tests
CORE_CONFIG_PATH = Path.home() / ".config" / "yeahyeah"
| [
"pathlib.Path.home"
] | [((115, 126), 'pathlib.Path.home', 'Path.home', ([], {}), '()\n', (124, 126), False, 'from pathlib import Path\n')] |
# pip install pycocotools opencv-python opencv-contrib-python
# wget https://github.com/opencv/opencv_extra/raw/master/testdata/cv/ximgproc/model.yml.gz
import os
import copy
import time
import argparse
import contextlib
import multiprocessing
import numpy as np
import cv2
import cv2.ximgproc
import matplotlib.patc... | [
"pycocotools.cocoeval.COCOeval",
"numpy.array",
"copy.deepcopy",
"matplotlib.pyplot.imshow",
"os.path.exists",
"cv2.ximgproc.createStructuredEdgeDetection",
"argparse.ArgumentParser",
"numpy.asarray",
"pycocotools.coco.COCO",
"matplotlib.pyplot.close",
"matplotlib.pyplot.axis",
"cv2.ximgproc.s... | [((547, 559), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (557, 559), True, 'import matplotlib.pyplot as plt\n'), ((564, 579), 'matplotlib.pyplot.imshow', 'plt.imshow', (['img'], {}), '(img)\n', (574, 579), True, 'import matplotlib.pyplot as plt\n'), ((584, 599), 'matplotlib.pyplot.axis', 'plt.axis', ([... |
import time
class tTabela:
def __init__(self):
self.dados = []
def load_from_file(self,filename):
f = open(filename,"r")
for line in f:
dado_lido = line.split()
dado_lido.append(int(dado_lido[4]))
self.dados.append(dado_lido)
f.close(... | [
"time.time"
] | [((668, 679), 'time.time', 'time.time', ([], {}), '()\n', (677, 679), False, 'import time\n'), ((1487, 1498), 'time.time', 'time.time', ([], {}), '()\n', (1496, 1498), False, 'import time\n'), ((2720, 2731), 'time.time', 'time.time', ([], {}), '()\n', (2729, 2731), False, 'import time\n'), ((2846, 2857), 'time.time', '... |
"""
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distri... | [
"os.path.realpath",
"gwells.codes.CodeFixture"
] | [((1570, 1595), 'gwells.codes.CodeFixture', 'CodeFixture', (['fixture_path'], {}), '(fixture_path)\n', (1581, 1595), False, 'from gwells.codes import CodeFixture\n'), ((2006, 2031), 'gwells.codes.CodeFixture', 'CodeFixture', (['fixture_path'], {}), '(fixture_path)\n', (2017, 2031), False, 'from gwells.codes import Code... |
# --------------------------------------------------------------------#
# --------------------------------------------------------------------#
# ---------- Made by <NAME> @ircam on 11/2015
# ---------- Analyse audio and return soudn features
# ---------- to us this don't forget to include these lines before your scrip... | [
"eaSDIF.Entity",
"fileio.sdif.FSdifLoadFile.FSdifLoadFile",
"six.moves.range",
"conversions.lin2db",
"eaSDIF.Frame",
"numpy.array",
"numpy.zeros",
"pandas.DataFrame",
"numpy.loadtxt",
"eaSDIF.Vector"
] | [((4218, 4233), 'eaSDIF.Entity', 'eaSDIF.Entity', ([], {}), '()\n', (4231, 4233), False, 'import eaSDIF\n'), ((4414, 4429), 'eaSDIF.Vector', 'eaSDIF.Vector', ([], {}), '()\n', (4427, 4429), False, 'import eaSDIF\n'), ((4442, 4456), 'eaSDIF.Frame', 'eaSDIF.Frame', ([], {}), '()\n', (4454, 4456), False, 'import eaSDIF\n'... |
# -*- coding: utf-8 -*-
# Copyright 2017-2019 ControlScan, Inc.
#
# This file is part of Cyphon Engine.
#
# Cyphon Engine 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, version 3 of the License.
#
# Cyphon En... | [
"django.utils.translation.ugettext_lazy",
"cyphon.fieldsets.QueryFieldset",
"django.db.models.IntegerField",
"utils.dateutils.dateutils.convert_time_to_seconds",
"engines.queries.EngineQuery",
"json.dumps",
"django.db.models.ManyToManyField",
"django.db.models.BooleanField",
"django.utils.timezone.n... | [((3992, 4044), 'django.db.models.ManyToManyField', 'models.ManyToManyField', (['Distillery'], {'related_name': '"""+"""'}), "(Distillery, related_name='+')\n", (4014, 4044), False, 'from django.db import models\n'), ((4124, 4145), 'django.db.models.IntegerField', 'models.IntegerField', ([], {}), '()\n', (4143, 4145), ... |
from django.shortcuts import render, get_object_or_404
from django.views.decorators.http import require_http_methods, require_POST, require_GET
from django.views.generic.edit import UpdateView
from django.urls import reverse, reverse_lazy
from django.http import HttpResponseRedirect
from django.contrib.auth.models impo... | [
"django.shortcuts.render",
"django.urls.reverse",
"django.shortcuts.get_object_or_404",
"django.urls.reverse_lazy"
] | [((605, 653), 'django.shortcuts.render', 'render', (['request', '"""bookmarks/index.html"""', 'context'], {}), "(request, 'bookmarks/index.html', context)\n", (611, 653), False, 'from django.shortcuts import render, get_object_or_404\n'), ((1133, 1154), 'django.urls.reverse_lazy', 'reverse_lazy', (['"""index"""'], {}),... |
#!/usr/bin/env python
# encoding: utf-8
"""
response
"""
import numpy as np
import scipy as sp
from scipy import signal, interpolate
import pandas as pd
import warnings
from .utils import (get_proper_interval,
double_gamma_with_d,
get_time_to_peak_from_timecourse,
... | [
"scipy.signal.convolve",
"numpy.sqrt",
"scipy.interpolate.interp1d",
"numpy.array",
"numpy.sin",
"numpy.arange",
"pandas.MultiIndex.from_product",
"numpy.diff",
"numpy.max",
"numpy.linspace",
"numpy.vstack",
"pandas.DataFrame",
"warnings.warn",
"numpy.eye",
"numpy.ones",
"numpy.cos",
... | [((921, 941), 'numpy.eye', 'np.eye', (['n_regressors'], {}), '(n_regressors)\n', (927, 941), True, 'import numpy as np\n'), ((954, 983), 'numpy.vstack', 'np.vstack', (['(basis, basis[-1])'], {}), '((basis, basis[-1]))\n', (963, 983), True, 'import numpy as np\n'), ((1007, 1077), 'numpy.linspace', 'np.linspace', (['inte... |
# -*- coding: utf-8 -*-
import serial
#
# There are two type of frame for the VEdirect protocol: text frame and hex frame.
#
# Text frame are leaded by two bytes: 0x0D, 0X0A ("\r\n"), end by keyword
# 'Checksum\t\0x??'. This makes the receiver very easy to find the end of the
# the frame if processed by stream. But i... | [
"serial.Serial"
] | [((3911, 3960), 'serial.Serial', 'serial.Serial', (['serialport', '(19200)'], {'timeout': 'timeout'}), '(serialport, 19200, timeout=timeout)\n', (3924, 3960), False, 'import serial\n')] |
"""
Utilities for building programs from assembly source files for simulated and physical hardware.
"""
import re
from assembly.exception import AssemblyException
from assembly.instruction import Instruction
def apply_macros(macro_dictionary, program_string):
"""
Apply macros to the source code.
:param... | [
"assembly.instruction.Instruction.from_string",
"re.match",
"assembly.exception.AssemblyException",
"re.sub",
"re.findall"
] | [((1360, 1397), 're.findall', 're.findall', (['"""<(.*?)>"""', 'program_string'], {}), "('<(.*?)>', program_string)\n", (1370, 1397), False, 'import re\n'), ((1521, 1557), 're.sub', 're.sub', (['"""<.*>"""', '"""<>"""', 'program_string'], {}), "('<.*>', '<>', program_string)\n", (1527, 1557), False, 'import re\n'), ((5... |
import os
import sys
from app import logger
def validate_and_crash(variable, message):
if not variable:
logger.error(message)
sys.exit(message)
logger.info('Reading environment variables...')
STORE_HEIGHT = int(os.getenv('STORE_HEIGHT', 10))
STORE_WIDTH = int(os.getenv('STORE_WIDTH', 6))
CUST... | [
"app.logger.info",
"sys.exit",
"os.getenv",
"app.logger.error"
] | [((169, 216), 'app.logger.info', 'logger.info', (['"""Reading environment variables..."""'], {}), "('Reading environment variables...')\n", (180, 216), False, 'from app import logger\n'), ((415, 464), 'os.getenv', 'os.getenv', (['"""CUSTOMERS_LIST_FILE"""', '"""customers.csv"""'], {}), "('CUSTOMERS_LIST_FILE', 'custome... |
import pytest
pytest.register_assert_rewrite('test.tutils')
| [
"pytest.register_assert_rewrite"
] | [((15, 60), 'pytest.register_assert_rewrite', 'pytest.register_assert_rewrite', (['"""test.tutils"""'], {}), "('test.tutils')\n", (45, 60), False, 'import pytest\n')] |
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.gridlayout import GridLayout
from kivy.uix.button import Button
from kivy.uix.label import Label
from kivy.uix.textinput import TextInput
from MetricSingle import *
class MetricSingleInputWidget( GridLayout ):
def __init__( self, metr... | [
"kivy.uix.button.Button",
"kivy.uix.label.Label",
"kivy.uix.boxlayout.BoxLayout",
"kivy.uix.textinput.TextInput"
] | [((752, 799), 'kivy.uix.boxlayout.BoxLayout', 'BoxLayout', ([], {'orientation': '"""horizontal"""', 'spacing': '(30)'}), "(orientation='horizontal', spacing=30)\n", (761, 799), False, 'from kivy.uix.boxlayout import BoxLayout\n'), ((863, 891), 'kivy.uix.label.Label', 'Label', ([], {'text': 'self.metric_name'}), '(text=... |
from program import Program
from prints import *
from getpass import getpass
from time import sleep
from os import urandom
from base64 import b64encode
passwlocker=Program()
import sys
#This is the in Terminal version of the program use gui.py for graphical version
def showcreds(username):
userobject=passwlocker.users... | [
"os.urandom",
"time.sleep",
"getpass.getpass",
"program.Program"
] | [((164, 173), 'program.Program', 'Program', ([], {}), '()\n', (171, 173), False, 'from program import Program\n'), ((1715, 1739), 'getpass.getpass', 'getpass', (['"""New Password:"""'], {}), "('New Password:')\n", (1722, 1739), False, 'from getpass import getpass\n'), ((1937, 1945), 'time.sleep', 'sleep', (['(1)'], {})... |
# DO NOT EDIT THIS FILE MANUALLY
# THIS FILE IS AUTO-GENERATED
# MANUAL CHANGES WILL BE DISCARDED
# PLEASE READ GARUDA DOCS
from garuda_dir.garuda_pb2 import ContentType, Void # NOQA
from garuda_dir.django_contrib_contenttypes_crud import ( # NOQA
read_contenttype,
delete_contenttype,
create_contenttype,
... | [
"garuda_dir.django_contrib_contenttypes_crud.read_contenttypes_filter",
"garuda_dir.django_contrib_contenttypes_crud.read_contenttype",
"garuda_dir.django_contrib_contenttypes_crud.delete_contenttype",
"garuda_dir.garuda_pb2.Void",
"garuda_dir.django_contrib_contenttypes_crud.update_contenttype"
] | [((1062, 1088), 'garuda_dir.django_contrib_contenttypes_crud.read_contenttypes_filter', 'read_contenttypes_filter', ([], {}), '()\n', (1086, 1088), False, 'from garuda_dir.django_contrib_contenttypes_crud import read_contenttype, delete_contenttype, create_contenttype, update_contenttype, read_contenttypes_filter\n'), ... |
from cornice.resource import resource, view
from cornice import Service
from cornice.validators import colander_body_validator
from pyramid.httpexceptions import HTTPNotFound, HTTPBadRequest
from pyramid.security import Everyone
from pyramid.request import Request
import sqlalchemy
import datetime
from naki.model impor... | [
"naki.model.DBSession.add",
"pyramid.httpexceptions.HTTPNotFound",
"cornice.resource.resource",
"naki.model.Container",
"naki.model.DBSession.query",
"naki.model.DBSession.flush",
"uuid.uuid4",
"naki.model.ContainerItem",
"naki.model.DBSession.delete",
"pyramid.request.Request.blank",
"naki.lib.... | [((634, 790), 'cornice.resource.resource', 'resource', ([], {'path': '"""/api/v1/view/{view_id}/container/{container_id}"""', 'collection_path': '"""/api/v1/view/{view_id}/containers"""', 'cors_policy': 'NAKI_CORS_POLICY'}), "(path='/api/v1/view/{view_id}/container/{container_id}',\n collection_path='/api/v1/view/{v... |
import numpy as np
from matplotlib import pyplot as plt
import sys
sys.path.append('../')
import sintel_io as sio
# Test and display some real data
folder_name='alley_1'
frame_no = 1 #smaller than 10
DEPTHFILE = '/cluster/scratch/takmaza/CVL/MPI-Sintel-complete/training/depth/'+folder_name+'/frame_000'+str(frame_no)+'... | [
"sys.path.append",
"sintel_io.depth_read",
"sintel_io.cam_read"
] | [((67, 89), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (82, 89), False, 'import sys\n'), ((461, 486), 'sintel_io.depth_read', 'sio.depth_read', (['DEPTHFILE'], {}), '(DEPTHFILE)\n', (475, 486), True, 'import sintel_io as sio\n'), ((493, 514), 'sintel_io.cam_read', 'sio.cam_read', (['CAMFILE... |
from flask import g, current_app, jsonify
from sqlalchemy import asc, desc, func
from apps.interface.models.interfaceapimsg import InterfaceApiMsg
from apps.interface.models.interfacecase import InterfaceCase
from apps.interface.models.interfacemodule import InterfaceModule
from apps.interface.models.interfaceproject ... | [
"apps.interface.models.interfaceproject.InterfaceProject.query.filter_by",
"apps.interface.models.interfacemodule.InterfaceModule.num.label",
"apps.interface.models.interfaceapimsg.InterfaceApiMsg.query.filter",
"sqlalchemy.desc",
"flask.jsonify",
"sqlalchemy.func.count",
"library.api.db.db.session.add"... | [((1335, 1393), 'library.api.transfer.transfer2json', 'transfer2json', (['"""?id|!name|!projectid|!num|!weight|!status"""'], {}), "('?id|!name|!projectid|!num|!weight|!status')\n", (1348, 1393), False, 'from library.api.transfer import transfer2json\n'), ((2812, 2870), 'library.api.transfer.transfer2json', 'transfer2js... |
from http.server import BaseHTTPRequestHandler
import json
import logging
import os
import urllib.parse
import pymongo
class RequestHandler(BaseHTTPRequestHandler):
mongo_database = None
def _db_connection(self):
if self.mongo_database is None:
mongo_srv = os.environ.get(
... | [
"pymongo.MongoClient",
"json.loads",
"json.dumps",
"os.environ.get"
] | [((831, 852), 'json.loads', 'json.loads', (['post_data'], {}), '(post_data)\n', (841, 852), False, 'import json\n'), ((288, 345), 'os.environ.get', 'os.environ.get', (['"""MONGO_SRV"""', '"""mongodb://localhost:27017/"""'], {}), "('MONGO_SRV', 'mongodb://localhost:27017/')\n", (302, 345), False, 'import os\n'), ((390, ... |
import numpy as np
import torch
import torch.utils.data as data
import torch.nn.functional as F
import os
import cv2
import math
import random
import json
import csv
import pickle
import os.path as osp
from glob import glob
import raft3d.projective_ops as pops
from . import frame_utils
from .augmentation import RGB... | [
"cv2.imwrite",
"torch.manual_seed",
"numpy.ones",
"torch.utils.data.get_worker_info",
"os.path.join",
"torch.from_numpy",
"random.seed",
"numpy.array",
"numpy.random.seed",
"csv.reader",
"numpy.random.uniform",
"numpy.concatenate",
"numpy.pad",
"cv2.imread",
"torch.cat"
] | [((1925, 1982), 'numpy.pad', 'np.pad', (['disp1', '((KITTIEval.crop, 0), (0, 0))'], {'mode': '"""edge"""'}), "(disp1, ((KITTIEval.crop, 0), (0, 0)), mode='edge')\n", (1931, 1982), True, 'import numpy as np\n'), ((1996, 2053), 'numpy.pad', 'np.pad', (['disp2', '((KITTIEval.crop, 0), (0, 0))'], {'mode': '"""edge"""'}), "... |
# Copyright (c) 2020, <NAME>, Honda Research Institute Europe GmbH, and
# Technical University of Darmstadt.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code mus... | [
"os.path.exists",
"os.path.isdir",
"os.makedirs"
] | [((1957, 1976), 'os.path.exists', 'osp.exists', (['log_dir'], {}), '(log_dir)\n', (1967, 1976), True, 'import os.path as osp\n'), ((1986, 2006), 'os.makedirs', 'os.makedirs', (['log_dir'], {}), '(log_dir)\n', (1997, 2006), False, 'import os\n'), ((2032, 2050), 'os.path.isdir', 'osp.isdir', (['log_dir'], {}), '(log_dir)... |
from argparse import ArgumentParser
from typing import List, Optional
from litespeed.helpers import render, serve
from litespeed.mail import Mail
from litespeed.server import App, RequestHandler, WebServer
route = App.route
add_websocket = App.add_websocket
register_error_page = App.register_error_page
__all__ = ['Ma... | [
"litespeed.server.App.route",
"argparse.ArgumentParser"
] | [((3332, 3348), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (3346, 3348), False, 'from argparse import ArgumentParser\n'), ((4812, 4823), 'litespeed.server.App.route', 'App.route', ([], {}), '()\n', (4821, 4823), False, 'from litespeed.server import App, RequestHandler, WebServer\n')] |
# -*- coding: utf-8 -*-
import os.path
import platform
import sys
import shutil
import time
def eqfn(name1, name2):
return os.path.normcase(name1) == os.path.normcase(name2)
def delete_dir_try_hard(path, hardness=5):
# Deleting the folder on Windows is not so easy task
# http://bugs.python.org/issue1549... | [
"ctypes.windll.kernel32.GetDriveTypeW",
"ctypes.windll.kernel32.GetFileAttributesW",
"ctypes.windll.kernel32.GetLogicalDrives",
"time.sleep",
"platform.system",
"shutil.rmtree"
] | [((1954, 1988), 'ctypes.windll.kernel32.GetLogicalDrives', 'windll.kernel32.GetLogicalDrives', ([], {}), '()\n', (1986, 1988), False, 'from ctypes import windll\n'), ((581, 607), 'shutil.rmtree', 'shutil.rmtree', (['path', '(False)'], {}), '(path, False)\n', (594, 607), False, 'import shutil\n'), ((646, 663), 'platform... |