code
stringlengths
22
1.05M
apis
listlengths
1
3.31k
extract_api
stringlengths
75
3.25M
import os as _os import shutil as _shutil import re as _re from apodeixi.testing_framework.a6i_skeleton_test import ApodeixiSkeletonTest from apodeixi.util.a6i_error ...
[ "apodeixi.util.a6i_error.FunctionalTrace", "apodeixi.knowledge_base.kb_environment.KB_Environment_Config", "apodeixi.knowledge_base.knowledge_base_store.KnowledgeBaseStore", "apodeixi.util.path_utils.PathUtils", "apodeixi.util.yaml_utils.YAML_Utils", "apodeixi.knowledge_base.shutil_kb_store.Shutil_KBStore...
[((4220, 4322), 'apodeixi.knowledge_base.shutil_kb_store.Shutil_KBStore_Impl', 'Shutil_KBStore_Impl', ([], {'parent_trace': 'my_trace', 'kb_rootdir': 'self._kb_rootdir', 'clientURL': 'self._clientURL'}), '(parent_trace=my_trace, kb_rootdir=self._kb_rootdir,\n clientURL=self._clientURL)\n', (4239, 4322), False, 'from...
from __future__ import print_function import numpy import collections from typing import Mapping, Union, Sequence, MutableSequence, Tuple, Any from typing import Optional, Callable, TypeVar, Iterable, List, cast InitialState = Union[MutableSequence[complex], int, numpy.ndarray] # This should be Anything subscriptable...
[ "numpy.array", "numpy.zeros", "typing.TypeVar" ]
[((382, 394), 'typing.TypeVar', 'TypeVar', (['"""T"""'], {}), "('T')\n", (389, 394), False, 'from typing import Optional, Callable, TypeVar, Iterable, List, cast\n'), ((5447, 5500), 'numpy.zeros', 'numpy.zeros', (['(2 ** n, 2 ** n)'], {'dtype': 'numpy.complex128'}), '((2 ** n, 2 ** n), dtype=numpy.complex128)\n', (5458...
""" Functions related to finding and reading files. Checking files exist, finding their absolute paths, decrypting and reading encrypted files when needed. """ import os import subprocess import tempfile import warnings from contextlib import ExitStack, contextmanager from pathlib import Path from ruamel.yaml import Y...
[ "subprocess.check_call", "os.path.splitext", "ruamel.yaml.scanner.ScannerError", "ruamel.yaml.YAML", "os.getcwd", "os.path.isfile", "os.path.dirname", "os.path.basename", "contextlib.ExitStack", "tempfile.NamedTemporaryFile", "warnings.warn" ]
[((377, 404), 'ruamel.yaml.YAML', 'YAML', ([], {'typ': '"""safe"""', 'pure': '(True)'}), "(typ='safe', pure=True)\n", (381, 404), False, 'from ruamel.yaml import YAML\n'), ((4404, 4439), 'os.path.basename', 'os.path.basename', (['original_filepath'], {}), '(original_filepath)\n', (4420, 4439), False, 'import os\n'), ((...
# (C) Copyright 2021 <NAME> # # Stack analysis classes and routines. import elftools.dwarf.callframe as callframe import arduino_dbg.binutils as binutils from arduino_dbg.term import MsgLevel import arduino_dbg.term as term DEBUGGER_METHODS = [ "__vector_17", # AVR timer interrupt "TC4_Handler", ...
[ "arduino_dbg.binutils.demangle", "arduino_dbg.binutils.pc_to_source_line", "arduino_dbg.term.fmt_registers" ]
[((3128, 3175), 'arduino_dbg.binutils.pc_to_source_line', 'binutils.pc_to_source_line', (['elf_name', 'self.addr'], {}), '(elf_name, self.addr)\n', (3154, 3175), True, 'import arduino_dbg.binutils as binutils\n'), ((2831, 2859), 'arduino_dbg.binutils.demangle', 'binutils.demangle', (['self.name'], {}), '(self.name)\n',...
from django.shortcuts import render, redirect from .models import District, Region, Ministry from .forms import DistrictForm, RegionForm, MinistryForm def load_Region(request): district_id = request.GET.get('district') print('....................') print(district_id) Region = Region.objects.filter(dist...
[ "django.shortcuts.render", "django.shortcuts.redirect" ]
[((416, 492), 'django.shortcuts.render', 'render', (['request', '"""administration/Region_dropdown_list_options.html"""', 'context'], {}), "(request, 'administration/Region_dropdown_list_options.html', context)\n", (422, 492), False, 'from django.shortcuts import render, redirect\n'), ((703, 773), 'django.shortcuts.ren...
from clang.cindex import TranslationUnit from tests.cindex.util import get_cursor def test_comment(): files = [('fake.c', """ /// Aaa. int test1; /// Bbb. /// x void test2(void); void f() { } """)] # make a comment-aware TU tu = TranslationUnit.from_source('fake.c', ['-std=c99'], unsaved_files=files, ...
[ "tests.cindex.util.get_cursor", "clang.cindex.TranslationUnit.from_source" ]
[((245, 394), 'clang.cindex.TranslationUnit.from_source', 'TranslationUnit.from_source', (['"""fake.c"""', "['-std=c99']"], {'unsaved_files': 'files', 'options': 'TranslationUnit.PARSE_INCLUDE_BRIEF_COMMENTS_IN_CODE_COMPLETION'}), "('fake.c', ['-std=c99'], unsaved_files=files,\n options=TranslationUnit.PARSE_INCLUDE...
from __future__ import print_function import argparse import os # from torchvision.datasets import ImageFolder import myDataset import networks import numpy as np import torch import torch.backends.cudnn as cudnn import torch.nn as nn import torch.optim as optim import torchvision.transforms as transforms from PIL imp...
[ "torch.nn.CrossEntropyLoss", "torch.nn.L1Loss", "torch.max", "torch.cuda.is_available", "torch.sum", "os.path.exists", "argparse.ArgumentParser", "networks.init_weights", "numpy.random.seed", "torchvision.transforms.ToTensor", "torch.autograd.Variable", "torchvision.transforms.RandomHorizontal...
[((530, 585), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""PyTorch NI vs CG"""'}), "(description='PyTorch NI vs CG')\n", (553, 585), False, 'import argparse\n'), ((2585, 2610), 'numpy.random.seed', 'np.random.seed', (['args.seed'], {}), '(args.seed)\n', (2599, 2610), True, 'import nump...
import os import numpy as np from numpy.lib.stride_tricks import as_strided import nibabel as nib def nib_load(file_name): proxy = nib.load(file_name) data = proxy.get_data().astype('float32') proxy.uncache() return data def crop(x, ksize, stride=3): shape = (np.array(x.shape[:3]) - ksize)/stride ...
[ "nibabel.load", "os.path.join", "numpy.lib.stride_tricks.as_strided", "numpy.array", "numpy.pad" ]
[((765, 801), 'os.path.join', 'os.path.join', (['root', 'subj', "(name + '_')"], {}), "(root, subj, name + '_')\n", (777, 801), False, 'import os\n'), ((945, 1006), 'numpy.pad', 'np.pad', (['x0', '((0, 0), (0, 0), (0, 1), (0, 0))'], {'mode': '"""constant"""'}), "(x0, ((0, 0), (0, 0), (0, 1), (0, 0)), mode='constant')\n...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import rospy from std_msgs.msg import String from std_msgs.msg import Int8 import switcher_api class RBANode: """ Robot Behaviour Adaptation Node Class It is supposed to react on the deecision of the Image Based Classification Node by runni...
[ "rospy.logwarn", "rospy.init_node", "rospy.get_param", "switcher_api.start_process", "rospy.set_param", "switcher_api.stop_process", "rospy.spin", "rospy.get_name", "rospy.Subscriber" ]
[((2719, 2750), 'rospy.init_node', 'rospy.init_node', (['"""ecs_rba_node"""'], {}), "('ecs_rba_node')\n", (2734, 2750), False, 'import rospy\n'), ((2780, 2792), 'rospy.spin', 'rospy.spin', ([], {}), '()\n', (2790, 2792), False, 'import rospy\n'), ((594, 680), 'rospy.Subscriber', 'rospy.Subscriber', (["self.settings['de...
from typing import Optional, Union import discord async def get_dm(user: Optional[Union[int, discord.Member]], ctx=None): if isinstance(user, int): user = ctx.bot.get_user(user) return user.dm_channel if user.dm_channel else await user.create_dm() def get_user(user: Union[int, discord.Member], ctx=...
[ "discord.utils.get" ]
[((515, 558), 'discord.utils.get', 'discord.utils.get', (['ctx.guild.roles'], {'id': 'role'}), '(ctx.guild.roles, id=role)\n', (532, 558), False, 'import discord\n')]
"""Module providing machine and buffer classes for simprod simulations The module provides definitions for for class `Machine` and `Storage`. Example ------- TODO Notes ----- TODO Attributes ---------- TODO """ # Generic imports from enum import Enum import random # SimPy related imports from simpy import Even...
[ "simpy.Event", "simpy.Store", "interruptions.UnscheduledMaintenance", "random.gauss", "interruptions.ScheduledMaintenance" ]
[((2511, 2531), 'simpy.Event', 'Event', (['sim.simpy_env'], {}), '(sim.simpy_env)\n', (2516, 2531), False, 'from simpy import Event, Store\n'), ((2565, 2585), 'simpy.Event', 'Event', (['sim.simpy_env'], {}), '(sim.simpy_env)\n', (2570, 2585), False, 'from simpy import Event, Store\n'), ((36722, 36776), 'simpy.Store', '...
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright Kitware Inc. # # Licensed under the Apache License, Version 2.0 ( the "License" ); # you may not use this file except in compliance with the License. # You may obtain a copy of ...
[ "geojson.FeatureCollection", "girder.plugins.minerva.utility.dataset_utility.jsonArrayHead", "shapely.geometry.shape", "geojson.GeometryCollection", "cStringIO.StringIO", "girder.utility.assetstore_utilities.getAssetstoreAdapter", "girder.utility.config.getConfig", "girder.api.describe.Description", ...
[((13103, 13173), 'girder.api.rest.loadmodel', 'loadmodel', ([], {'map': "{'userId': 'user'}", 'model': '"""user"""', 'level': 'AccessType.READ'}), "(map={'userId': 'user'}, model='user', level=AccessType.READ)\n", (13112, 13173), False, 'from girder.api.rest import Resource, loadmodel, RestException, GirderException\n...
# Turn image to animated gif using 3 animation modes: "explode" "melt" "diffuse" import PIL.Image as Image import numpy as np #------------------input parameterss--------------------------------------------------------------- InputImage="Input.jpg" # Input image patg OutputGifName="Out.gif" # Output gif file ...
[ "numpy.random.randint", "PIL.Image.open", "numpy.random.rand", "PIL.Image.fromarray" ]
[((703, 725), 'PIL.Image.open', 'Image.open', (['InputImage'], {}), '(InputImage)\n', (713, 725), True, 'import PIL.Image as Image\n'), ((1128, 1148), 'numpy.random.randint', 'np.random.randint', (['w'], {}), '(w)\n', (1145, 1148), True, 'import numpy as np\n'), ((1166, 1186), 'numpy.random.randint', 'np.random.randint...
# Copyright (c) 2018-2020 ISciences, LLC. # All rights reserved. # # WSIM is 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 app...
[ "os.path.join" ]
[((912, 944), 'os.path.join', 'os.path.join', (['source_dir', 'subdir'], {}), '(source_dir, subdir)\n', (924, 944), False, 'import os\n'), ((3898, 3943), 'os.path.join', 'os.path.join', (['source_dir', 'subdir', 'basins_file'], {}), '(source_dir, subdir, basins_file)\n', (3910, 3943), False, 'import os\n'), ((3959, 400...
# -*- coding: utf-8 -*- from setuptools import setup, find_packages from file_sort.fs_main import __doc__ as fs_doc from file_sort.fs_main import __version__ as fs_version README_FILE = open("README.rst", "rt").read() VERSION = fs_version DOC = fs_doc def read_requirements(req_filename): reqs = [] with ope...
[ "setuptools.find_packages" ]
[((922, 951), 'setuptools.find_packages', 'find_packages', ([], {'exclude': '"""test"""'}), "(exclude='test')\n", (935, 951), False, 'from setuptools import setup, find_packages\n')]
from datetime import datetime from project import db from project.common.model import Model class Subscriber(Model): __tablename__ = "subscribers" id = db.Column(db.Integer, primary_key=True, autoincrement=True) hash = db.Column(db.String(255), unique=True, nullable=False, index=True) email = db.Co...
[ "project.db.String", "project.db.Column" ]
[((165, 224), 'project.db.Column', 'db.Column', (['db.Integer'], {'primary_key': '(True)', 'autoincrement': '(True)'}), '(db.Integer, primary_key=True, autoincrement=True)\n', (174, 224), False, 'from project import db\n'), ((566, 640), 'project.db.Column', 'db.Column', (['db.DateTime'], {'nullable': '(True)', 'default...
#<NAME> #Snake Game movement practice #7/26/2020 import turtle import time import random delay = 0.1 # Set up screen window = turtle.Screen() window.title("Snake") window.bgcolor("black") window.setup(width= 600, height= 600) window.tracer(0) # Snake head head = turtle.Turtle() head.shape("square") head.color("whi...
[ "turtle.Screen", "random.randint", "turtle.Turtle", "time.sleep" ]
[((130, 145), 'turtle.Screen', 'turtle.Screen', ([], {}), '()\n', (143, 145), False, 'import turtle\n'), ((268, 283), 'turtle.Turtle', 'turtle.Turtle', ([], {}), '()\n', (281, 283), False, 'import turtle\n'), ((412, 427), 'turtle.Turtle', 'turtle.Turtle', ([], {}), '()\n', (425, 427), False, 'import turtle\n'), ((2478,...
import time import locale import pyttsx3 from PyQt5.QtCore import QThread from utils import formattime class TTSHandler(QThread): def __init__(self): QThread.__init__(self) lang = locale.getlocale()[0][0:2] self.engine = pyttsx3.init() voices = self.engine.getProperty('voices') ...
[ "PyQt5.QtCore.QThread.__init__", "pyttsx3.init", "time.sleep", "utils.formattime", "locale.getlocale" ]
[((166, 188), 'PyQt5.QtCore.QThread.__init__', 'QThread.__init__', (['self'], {}), '(self)\n', (182, 188), False, 'from PyQt5.QtCore import QThread\n'), ((253, 267), 'pyttsx3.init', 'pyttsx3.init', ([], {}), '()\n', (265, 267), False, 'import pyttsx3\n'), ((204, 222), 'locale.getlocale', 'locale.getlocale', ([], {}), '...
from pygments.style import Style from hiss.themes.tomorrow import Tomorrow def test_wow_what_a_stupid_test(): assert isinstance(Tomorrow(), Style)
[ "hiss.themes.tomorrow.Tomorrow" ]
[((135, 145), 'hiss.themes.tomorrow.Tomorrow', 'Tomorrow', ([], {}), '()\n', (143, 145), False, 'from hiss.themes.tomorrow import Tomorrow\n')]
import random from discord.ext import commands import discord from cogs.menus import Menus def get_role(guild): return discord.utils.get(guild.roles, name='Giveaway') async def get_entrants(guild, remove=True): role = get_role(guild) entrants = [] for m in guild.members: if role in m.roles...
[ "discord.ext.commands.has_permissions", "random.sample", "random.choice", "discord.utils.get", "discord.ext.commands.group", "discord.ext.commands.has_role" ]
[((127, 174), 'discord.utils.get', 'discord.utils.get', (['guild.roles'], {'name': '"""Giveaway"""'}), "(guild.roles, name='Giveaway')\n", (144, 174), False, 'import discord\n'), ((739, 782), 'discord.ext.commands.group', 'commands.group', ([], {'invoke_without_command': '(True)'}), '(invoke_without_command=True)\n', (...
"""Bounds module for functions related to coordinate bounds.""" import collections from typing import Dict, List, Optional, Tuple import cf_xarray as cfxr # noqa: F401 import numpy as np import xarray as xr from typing_extensions import Literal, get_args from xcdat.logger import setup_custom_logger logger = setup_c...
[ "numpy.insert", "numpy.clip", "typing_extensions.get_args", "xarray.register_dataset_accessor", "numpy.append", "numpy.array", "xarray.DataArray", "xcdat.logger.setup_custom_logger" ]
[((313, 340), 'xcdat.logger.setup_custom_logger', 'setup_custom_logger', (['"""root"""'], {}), "('root')\n", (332, 340), False, 'from xcdat.logger import setup_custom_logger\n'), ((509, 524), 'typing_extensions.get_args', 'get_args', (['Coord'], {}), '(Coord)\n', (517, 524), False, 'from typing_extensions import Litera...
from msspec.read.txt import read_txt def write_txt(mz, i, path): """Write a spectrum to file. Args: mz (iterable): m/z ratios, i (iterable): Intensities. path (str): Target path. """ with open(path, w) as f: for _m, _i in zip(mz, i): f.write("{}\t{}".format(...
[ "msspec.read.txt.read_txt" ]
[((421, 445), 'msspec.read.txt.read_txt', 'read_txt', (['"""spectrum.txt"""'], {}), "('spectrum.txt')\n", (429, 445), False, 'from msspec.read.txt import read_txt\n')]
from catconfig import CatConfig, ValidationError import json import pytest def test_get(): c = CatConfig(data={ 'foo': { 'bar': 'test' }, 'cat': [ { 'name': 'tom', 'age': 114514 }, { 'name': 'Je...
[ "pytest.mark.parametrize", "catconfig.CatConfig", "pytest.raises", "catconfig.ValidationError" ]
[((666, 819), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""type,path"""', "[('json', 'tests/assests/test.json'), ('toml', 'tests/assests/test.toml'),\n ('yaml', 'tests/assests/test.yaml')]"], {}), "('type,path', [('json', 'tests/assests/test.json'),\n ('toml', 'tests/assests/test.toml'), ('yaml', '...
from aws_cdk import core from aws_cdk import aws_lambda as Lambda from aws_cdk import aws_apigateway as Apigateway from aws_cdk import aws_iam as Iam from aws_cdk import aws_dynamodb as Dynamo # from aws_cdk import aws_appsync as Appsync class AwsCdkPythonStack(core.Stack): def __init__(self, scope: core.Constru...
[ "aws_cdk.aws_apigateway.LambdaIntegration", "aws_cdk.aws_lambda.Code.asset", "aws_cdk.aws_apigateway.CfnAuthorizer", "aws_cdk.aws_apigateway.RestApi", "aws_cdk.aws_dynamodb.Attribute", "aws_cdk.aws_iam.ServicePrincipal" ]
[((2023, 2217), 'aws_cdk.aws_apigateway.RestApi', 'Apigateway.RestApi', (['self', '"""api_events"""'], {'description': '"""REST API for Python events"""', 'deploy_options': "{'method_options': {'/*/*': {'throttling_rate_limit': 10,\n 'throttling_burst_limit': 5}}}"}), "(self, 'api_events', description=\n 'REST AP...
import json #La clave es el lexema (lo que lee del programa) y el valor es el token #ejemplo lexema: = ; toquen: operador asignacion #aqui en el token en vez de que se repita lo mismo a parte podria ir una descripcion #ejemplo 'ari': 'ari / condicional if' #Faltan varias fijense en la tablita y agregenlas porfaa rese...
[ "json.dump" ]
[((6131, 6163), 'json.dump', 'json.dump', (['estructura', 'json_file'], {}), '(estructura, json_file)\n', (6140, 6163), False, 'import json\n')]
# Copyright (c) 2014 <NAME>. All rights reserved. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # ...
[ "mock.patch.object", "cinder.volume.drivers.netapp.eseries.iscsi.NetAppEseriesISCSIDriver", "cinder.tests.volume.drivers.netapp.fakes.create_configuration_eseries", "mock.Mock" ]
[((1920, 2022), 'mock.patch.object', 'mock.patch.object', (['es_iscsi.NetAppEseriesISCSIDriver', '"""_check_mode_get_or_register_storage_system"""'], {}), "(es_iscsi.NetAppEseriesISCSIDriver,\n '_check_mode_get_or_register_storage_system')\n", (1937, 2022), False, 'import mock\n'), ((1233, 1276), 'cinder.volume.driv...
# Copyright 2018 Tensorforce Team. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
[ "tensorflow.math.pow", "tensorflow.shape", "tensorflow.control_dependencies", "tensorflow.debugging.assert_equal", "tensorflow.debugging.assert_less_equal", "tensorforce.util.fmap", "tensorflow.concat", "tensorforce.util.no_operation", "tensorflow.math.equal", "tensorflow.maximum", "tensorflow.m...
[((4810, 4823), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (4821, 4823), False, 'from collections import OrderedDict\n'), ((6222, 6265), 'tensorflow.minimum', 'tf.minimum', ([], {'x': 'self.buffer_index', 'y': 'capacity'}), '(x=self.buffer_index, y=capacity)\n', (6232, 6265), True, 'import tensorflow a...
# A simple simulator for SHA+XRAM from mmio import mmiodev, NOP, RD, WR import sha as SHAFunc def as_chars(s, n): b = [] for i in xrange(n): byte = s & 0xff s >>= 8 b.append(byte) return [chr(i) for i in b] def to_num(s, n): num = 0 for i in xrange(n): num |= (ord(s...
[ "mmio.mmiodev.__init__", "sha.new" ]
[((491, 513), 'mmio.mmiodev.__init__', 'mmiodev.__init__', (['self'], {}), '(self)\n', (507, 513), False, 'from mmio import mmiodev, NOP, RD, WR\n'), ((879, 892), 'sha.new', 'SHAFunc.new', ([], {}), '()\n', (890, 892), True, 'import sha as SHAFunc\n')]
from tkinter import * import Img as img root = Tk() # Define min and max window size root.minsize(1100, 650) root.maxsize(1920, 1080) root.title('Dog Breed') root.geometry("1920x1080") # Define background image bg = PhotoImage(file="images/bg.png") # Create label main_label = Label(root, image=bg) second_label = Labe...
[ "Img.upload_image" ]
[((1496, 1514), 'Img.upload_image', 'img.upload_image', ([], {}), '()\n', (1512, 1514), True, 'import Img as img\n')]
import cvarda.ext as cvarda def test_mnv_common_end(): mnv_table = cvarda.MNVTable() seq_table = cvarda.SequenceTable() index = seq_table.insert("") mnv_table.insert("chr1", 1, 4, 1, 1, index, 1) mnv_table.insert("chr1", 2, 4, 1, 1, index, 2) assert mnv_table.diagnostics() == \ {'ch...
[ "cvarda.ext.SequenceTable", "cvarda.ext.MNVTable" ]
[((73, 90), 'cvarda.ext.MNVTable', 'cvarda.MNVTable', ([], {}), '()\n', (88, 90), True, 'import cvarda.ext as cvarda\n'), ((107, 129), 'cvarda.ext.SequenceTable', 'cvarda.SequenceTable', ([], {}), '()\n', (127, 129), True, 'import cvarda.ext as cvarda\n')]
#@+leo-ver=5-thin #@+node:ekr.20181009072707.1: * @file ../../run_travis_unit_tests.py # -*- coding: utf-8 -*- import os import sys import unittest from leo.core import leoBridge load_dir = os.path.abspath(os.path.dirname(__file__)) test_dir = os.path.join(load_dir, 'leo', 'test') path = os.path.join(test_dir, 'unitTe...
[ "os.path.exists", "unittest.makeSuite", "leo.core.leoBridge.controller", "os.path.join", "os.path.dirname", "sys.exit", "unittest.TextTestRunner" ]
[((245, 282), 'os.path.join', 'os.path.join', (['load_dir', '"""leo"""', '"""test"""'], {}), "(load_dir, 'leo', 'test')\n", (257, 282), False, 'import os\n'), ((290, 328), 'os.path.join', 'os.path.join', (['test_dir', '"""unitTest.leo"""'], {}), "(test_dir, 'unitTest.leo')\n", (302, 328), False, 'import os\n'), ((336, ...
import numpy as np from scipy.io import loadmat from utils.dataset import load_label_files, load_labels, load_weights from data_loader.util import load_challenge_data import torch import torch.nn.functional as F class ChallengeMetric(): def __init__(self, input_directory, alphas): # challengeMetric init...
[ "data_loader.util.load_challenge_data", "numpy.all", "utils.dataset.load_label_files", "numpy.nansum", "torch.load", "scipy.io.loadmat", "numpy.any", "numpy.ix_", "numpy.array", "numpy.zeros", "numpy.nanmean", "numpy.isnan", "utils.dataset.load_weights", "numpy.sum", "numpy.shape", "ut...
[((8954, 8981), 'utils.dataset.load_label_files', 'load_label_files', (['label_dir'], {}), '(label_dir)\n', (8970, 8981), False, 'from utils.dataset import load_label_files, load_labels, load_weights\n'), ((9054, 9112), 'utils.dataset.load_labels', 'load_labels', (['label_files', 'normal_class', 'equivalent_classes'], ...
import logging import json import azure.functions as func def main(req: func.HttpRequest) -> func.HttpResponse: logging.info('Python HTTP trigger function processed a request.') try: req_body = req.get_json() request_as_text = json.dumps(req_body, default=lambda o: o.__dict__) ...
[ "azure.functions.HttpResponse", "json.dumps", "logging.info", "logging.exception" ]
[((124, 189), 'logging.info', 'logging.info', (['"""Python HTTP trigger function processed a request."""'], {}), "('Python HTTP trigger function processed a request.')\n", (136, 189), False, 'import logging\n'), ((536, 565), 'azure.functions.HttpResponse', 'func.HttpResponse', (['f"""Success"""'], {}), "(f'Success')\n"...
import os import shutil import subprocess import sys import time MMT_HOME = os.path.abspath(os.path.join(__file__, os.pardir, os.pardir, os.pardir, os.pardir, os.pardir)) sys.path.insert(0, MMT_HOME) os.environ['LD_LIBRARY_PATH'] = os.path.join(MMT_HOME, 'build', 'lib') os.environ['LC_ALL'] = 'en_US.UTF-8' os.envir...
[ "os.path.getsize", "sys.path.insert", "cli.cluster.MMTApi", "subprocess.Popen", "sys.stderr.flush", "os.path.join", "os.path.splitext", "time.sleep", "sys.stderr.write", "shutil.rmtree", "os.walk" ]
[((175, 203), 'sys.path.insert', 'sys.path.insert', (['(0)', 'MMT_HOME'], {}), '(0, MMT_HOME)\n', (190, 203), False, 'import sys\n'), ((236, 274), 'os.path.join', 'os.path.join', (['MMT_HOME', '"""build"""', '"""lib"""'], {}), "(MMT_HOME, 'build', 'lib')\n", (248, 274), False, 'import os\n'), ((425, 442), 'cli.cluster....
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys from setuptools import setup PROJECT = 'pypinksign' VERSION = '0.3' URL = 'http://github.com/bandoche/PyPinkSign' AUTHOR = '<NAME>' AUTHOR_EMAIL = '<EMAIL>' DESC = "Basic NPKI module." LONG_DESC = "See https://github.com/bandoche/PyPinkSign" # read_file('READ...
[ "setuptools.setup" ]
[((402, 1159), 'setuptools.setup', 'setup', ([], {'name': 'PROJECT', 'version': 'VERSION', 'description': 'DESC', 'long_description': 'LONG_DESC', 'author': 'AUTHOR', 'author_email': 'AUTHOR_EMAIL', 'url': 'URL', 'license': '"""MIT"""', 'packages': "['pypinksign']", 'include_package_data': '(True)', 'zip_safe': '(False...
from dataclasses import dataclass, field from typing import List, Optional @dataclass class XType: class Meta: name = "x_Type" value: Optional[int] = field( default=None, metadata={ "required": True, } ) a: Optional[str] = field( default=None, ...
[ "dataclasses.field" ]
[((169, 217), 'dataclasses.field', 'field', ([], {'default': 'None', 'metadata': "{'required': True}"}), "(default=None, metadata={'required': True})\n", (174, 217), False, 'from dataclasses import dataclass, field\n'), ((286, 406), 'dataclasses.field', 'field', ([], {'default': 'None', 'metadata': "{'type': 'Attribute...
"""""" # Standard library modules. import atexit import logging # Third party modules. import serial # Local modules. # Globals and constants variables. CR = bytearray(b"\x0d") LF = bytearray(b"\x0a") ETX = bytearray(b"\x03") ENQ = bytearray(b"\x05") ACK = bytearray(b"\x06") NAK = bytearray(b"\x15"...
[ "logging.getLogger", "logging.debug", "serial.Serial", "atexit.register" ]
[((783, 915), 'serial.Serial', 'serial.Serial', ([], {'baudrate': 'baudrate', 'bytesize': 'serial.EIGHTBITS', 'parity': 'serial.PARITY_NONE', 'stopbits': 'serial.STOPBITS_ONE', 'timeout': '(1)'}), '(baudrate=baudrate, bytesize=serial.EIGHTBITS, parity=serial.\n PARITY_NONE, stopbits=serial.STOPBITS_ONE, timeout=1)\n...
from app.tests.utilities import selenium_utility class SelectTracks(selenium_utility.SeleniumUtility): _first_playlist = '//li[@data-toggle="collapse"][1]' _track = '(//li[contains(@class, "track")])[1]' _next_btn = '//button[@id="next-btn"]' def __init__(self, driver): self.driver = driver ...
[ "selenium.webdriver.common.action_chains.ActionChains" ]
[((452, 472), 'selenium.webdriver.common.action_chains.ActionChains', 'ActionChains', (['driver'], {}), '(driver)\n', (464, 472), False, 'from selenium.webdriver.common.action_chains import ActionChains\n')]
# coding=utf8 import numpy as np class LabelSpreading: def __init__(self, alpha=0.2, max_iter=30, tol=1e-3): """ :param alpha: clamping factor between (0,1) :param max_iter: maximum number of iterations :param tol: convergence tolerance """ self.alpha = alpha ...
[ "numpy.abs", "numpy.power", "numpy.where", "numpy.argmax", "numpy.any", "numpy.diag", "numpy.sum", "numpy.dot" ]
[((1043, 1060), 'numpy.sum', 'np.sum', (['w'], {'axis': '(1)'}), '(w, axis=1)\n', (1049, 1060), True, 'import numpy as np\n'), ((1091, 1115), 'numpy.power', 'np.power', (['d', '(-1 / 2.0)', 'd'], {}), '(d, -1 / 2.0, d)\n', (1099, 1115), True, 'import numpy as np\n'), ((1127, 1137), 'numpy.diag', 'np.diag', (['d'], {}),...
import os import pathlib import time challenge_name = "forensics-001" output_file = "output.jpg" print("") source_pic = input("Please enter the file path for the picture to be altered: ") print("") output_path = os.path.join(str(pathlib.Path.home()), challenge_name, output_file) print("") change_output_path = input("...
[ "os.path.dirname", "os.path.exists", "pathlib.Path.home", "time.sleep" ]
[((437, 463), 'os.path.exists', 'os.path.exists', (['source_pic'], {}), '(source_pic)\n', (451, 463), False, 'import os\n'), ((231, 250), 'pathlib.Path.home', 'pathlib.Path.home', ([], {}), '()\n', (248, 250), False, 'import pathlib\n'), ((1439, 1452), 'time.sleep', 'time.sleep', (['(5)'], {}), '(5)\n', (1449, 1452), F...
#!/usr/bin/env python from matplotlib import pyplot as P import numpy as N from load import ROOT as R import gna.constructors as C import pytest @pytest.mark.parametrize('edges', [N.linspace(0.0, 10.0, 11), N.geomspace(0.1, 1000.0, 5)]) def test_histedges_v01(edges): centers = 0.5*(edges[1:]+edges[:-1]) width...
[ "gna.constructors.Histogram", "numpy.geomspace", "load.ROOT.HistEdges", "numpy.linspace", "numpy.arange" ]
[((363, 387), 'numpy.arange', 'N.arange', (['(edges.size - 1)'], {}), '(edges.size - 1)\n', (371, 387), True, 'import numpy as N\n'), ((398, 422), 'gna.constructors.Histogram', 'C.Histogram', (['edges', 'data'], {}), '(edges, data)\n', (409, 422), True, 'import gna.constructors as C\n'), ((433, 446), 'load.ROOT.HistEdg...
import os, sys import random from proton.gametime import GameTime, ProtonSingleton from proton.component import Component from proton.protonmath.vector2 import Vector2 from proton.splines import CatmullRomSpline class PirateShipController(Component): def __init__(self, gameobject_): super(PirateShipCont...
[ "proton.protonmath.vector2.Vector2", "proton.splines.CatmullRomSpline", "random.randint", "proton.gametime.ProtonSingleton" ]
[((666, 684), 'proton.protonmath.vector2.Vector2', 'Vector2', (['(1000)', '(400)'], {}), '(1000, 400)\n', (673, 684), False, 'from proton.protonmath.vector2 import Vector2\n'), ((1220, 1310), 'proton.splines.CatmullRomSpline', 'CatmullRomSpline', (['[v0, v1, v2, v3, v4, v5, v6, v7, v8]', 'PirateShipController.onfinish'...
# 15/05/2020, <NAME>, Edinburgh # Tidying up codes that plot rho/Paulin-Henriksson stats # by having some of the functions in here. import numpy as np from scipy.stats import binned_statistic_2d from astropy.io import fits import time import glob def interpolate2D(X, Y, grid): #(It's linear) ...
[ "numpy.sqrt", "astropy.io.fits.open", "numpy.cov", "scipy.stats.binned_statistic_2d", "glob.glob", "numpy.average", "numpy.interp", "numpy.std", "time.time", "numpy.intersect1d", "numpy.ones_like", "numpy.logical_and", "numpy.append", "numpy.sum", "numpy.zeros", "numpy.random.randint",...
[((1190, 1221), 'numpy.intersect1d', 'np.intersect1d', (['idx_ra', 'idx_dec'], {}), '(idx_ra, idx_dec)\n', (1204, 1221), True, 'import numpy as np\n'), ((1431, 1498), 'scipy.stats.binned_statistic_2d', 'binned_statistic_2d', (['Y', 'X', '(Q * w)'], {'statistic': '"""sum"""', 'bins': 'num_XY_bins'}), "(Y, X, Q * w, stat...
import numpy as np import lsst.afw.table as afwTable import lsst.pex.config as pexConfig import lsst.pipe.base as pipeBase import lsst.geom as geom import lsst.sphgeom as sphgeom from lsst.meas.base.forcedPhotCcd import ForcedPhotCcdTask, ForcedPhotCcdConfig from .forcedPhotDia import DiaReferencesTask __all__ = ("...
[ "lsst.pex.config.Field", "lsst.meas.base.forcedPhotCcd.ForcedPhotCcdTask.ConfigClass.setDefaults", "lsst.pipe.base.ArgumentParser", "lsst.geom.Point2D", "lsst.pipe.base.TaskError" ]
[((440, 539), 'lsst.pex.config.Field', 'pexConfig.Field', ([], {'dtype': 'bool', 'default': '(True)', 'doc': '"""Skip getting references if they do not exist?"""'}), "(dtype=bool, default=True, doc=\n 'Skip getting references if they do not exist?')\n", (455, 539), True, 'import lsst.pex.config as pexConfig\n'), ((5...
import argparse import pickle class CandidateRetrieval(object): def __init__(self, index_path): self.index_path = index_path self.inverted_index = pickle.load(open(self.index_path, 'rb')) print("finish loading") def search(self, query): return self.inverted_index.get(query, []) if __name__ == "_...
[ "argparse.ArgumentParser" ]
[((344, 369), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (367, 369), False, 'import argparse\n')]
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # File : basic_utils.py # Author : <NAME>, <NAME> # Email : <EMAIL>, <EMAIL> # Date : 09.08.2019 # Last Modified Date: 15.08.2019 # Last Modified By : Chi Han, Jiayuan Mao # # This file is part of the VCML codebase # Distri...
[ "numpy.array", "sys.getsizeof" ]
[((2502, 2520), 'sys.getsizeof', 'sys.getsizeof', (['obj'], {}), '(obj)\n', (2515, 2520), False, 'import sys\n'), ((634, 650), 'numpy.array', 'np.array', (['values'], {}), '(values)\n', (642, 650), True, 'import numpy as np\n')]
import asyncio class SimpleCondition: def __init__(self): self.rawCondition = asyncio.Condition() async def awaitCondition(self, predicate): with (await self.rawCondition): satisfied = False while not satisfied: satisfied = await self.rawCondit...
[ "asyncio.Condition" ]
[((95, 114), 'asyncio.Condition', 'asyncio.Condition', ([], {}), '()\n', (112, 114), False, 'import asyncio\n')]
""" OpenSwap main public messaging """ import time from html import escape try: # python 3.6 + from secrets import token_bytes except ImportError: from os import urandom as token_bytes from electroncash.i18n import _ from electroncash.address import Address import electroncash.web as web from PyQt5.QtCo...
[ "electroncash.openswap.OpenSwapMessage", "electroncash.util.print_stderr", "electroncash.util.print_error", "os.urandom", "electroncash.openswap.PacketOffer.make", "electroncash.address.Address.from_pubkey", "electroncash.bchmessage.ChanMessageWatcher", "electroncash.i18n._", "time.time", "html.es...
[((1296, 1334), 'electroncash.bchmessage.Channel.from_name', 'bchmessage.Channel.from_name', (['channame'], {}), '(channame)\n', (1324, 1334), False, 'from electroncash import bchmessage\n'), ((1379, 1426), 'electroncash.bchmessage.ChanMessageWatcher', 'bchmessage.ChanMessageWatcher', (['network', 'channel'], {}), '(ne...
import gym import pybulletgym from gym import Wrapper,spaces from torch.optim import Adam from nn_builder.pytorch.NN import NN import torch.nn.functional as F import random import numpy as np from stable_baselines3 import SAC import torch from torch import nn class DIAYN_Skill_Wrapper(Wrapper): def __init__(self, ...
[ "torch.nn.functional.softmax", "torch.nn.CrossEntropyLoss", "numpy.log", "torch.Tensor", "gym.spaces.Box", "numpy.array", "nn_builder.pytorch.NN.NN", "gym.Wrapper.__init__", "random.randint" ]
[((346, 373), 'gym.Wrapper.__init__', 'Wrapper.__init__', (['self', 'env'], {}), '(self, env)\n', (362, 373), False, 'from gym import Wrapper, spaces\n'), ((577, 735), 'nn_builder.pytorch.NN.NN', 'NN', ([], {'input_dim': 'self.state_size', 'layers_info': '[self.hidden_size, self.hidden_size, self.num_skills]', 'hidden_...
from unittest import TestCase import unittest from equadratures import * import numpy as np from copy import deepcopy def model(x): return x[0]**2 + x[1]**3 - x[0]*x[1]**2 class TestF(TestCase): def test_tensor_grid_with_nans(self): # Without Nans! param = Parameter(distribution='uniform', lo...
[ "unittest.main", "numpy.testing.assert_almost_equal", "numpy.asarray", "copy.deepcopy" ]
[((1472, 1487), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1485, 1487), False, 'import unittest\n'), ((718, 739), 'copy.deepcopy', 'deepcopy', (['model_evals'], {}), '(model_evals)\n', (726, 739), False, 'from copy import deepcopy\n'), ((772, 797), 'numpy.asarray', 'np.asarray', (['[1, 3, 9, 13]'], {}), '([1,...
#!/usr/bin/env python # coding: UTF-8 import os import re import csv class CassandraCsv(object): filename = "" clean_filename = "" output_dir = "" create_subfolder = False def __validate(self, vls): if not os.path.isdir(vls['output_dir']): return (False,"You must set an outpu...
[ "csv.writer", "os.path.join", "os.path.isdir", "os.mkdir", "re.sub" ]
[((713, 744), 're.sub', 're.sub', (['"""\\\\.csv$"""', '""""""', 'filename'], {}), "('\\\\.csv$', '', filename)\n", (719, 744), False, 'import re\n'), ((238, 270), 'os.path.isdir', 'os.path.isdir', (["vls['output_dir']"], {}), "(vls['output_dir'])\n", (251, 270), False, 'import os\n'), ((1656, 1696), 'os.path.join', 'o...
from sklearn.cluster import DBSCAN import math def custom_metric(q, p, space_eps, time_eps): dist = 0 for i in range(2): dist += (q[i] - p[i])**2 spatial_dist = math.sqrt(dist) time_dist = math.sqrt((q[2]-p[2])**2) if time_dist/time_eps <= 1 and spatial_dist/space_eps <= 1 and p[3] != q[3...
[ "math.sqrt", "sklearn.cluster.DBSCAN" ]
[((182, 197), 'math.sqrt', 'math.sqrt', (['dist'], {}), '(dist)\n', (191, 197), False, 'import math\n'), ((215, 244), 'math.sqrt', 'math.sqrt', (['((q[2] - p[2]) ** 2)'], {}), '((q[2] - p[2]) ** 2)\n', (224, 244), False, 'import math\n'), ((491, 585), 'sklearn.cluster.DBSCAN', 'DBSCAN', ([], {'eps': '(1)', 'min_samples...
""" Invoke tasks to help with pytest development and release process. """ import invoke from . import generate, vendoring ns = invoke.Collection( generate, vendoring )
[ "invoke.Collection" ]
[((131, 169), 'invoke.Collection', 'invoke.Collection', (['generate', 'vendoring'], {}), '(generate, vendoring)\n', (148, 169), False, 'import invoke\n')]
#!/usr/bin/env python3 import datetime import argparse from copy import deepcopy def main(args, awsattack_main): session = awsattack_main.get_active_session() print = awsattack_main.print fetch_data = awsattack_main.fetch_data get_regions = awsattack_main.get_regions config_regions = get_re...
[ "copy.deepcopy" ]
[((810, 834), 'copy.deepcopy', 'deepcopy', (['session.Config'], {}), '(session.Config)\n', (818, 834), False, 'from copy import deepcopy\n'), ((1176, 1209), 'copy.deepcopy', 'deepcopy', (["session.Config['Rules']"], {}), "(session.Config['Rules'])\n", (1184, 1209), False, 'from copy import deepcopy\n')]
from flask import Flask import config import routes from params import PI_BASE_URL app = Flask( getattr(config, 'PI_PROJECT_NAME', 'PlugIT-Project'), static_folder='media', static_url_path='{}media'.format(PI_BASE_URL) ) def load_actions(act_mod, mail_callback=None): """Initialize routes of the fl...
[ "routes.load_routes" ]
[((546, 593), 'routes.load_routes', 'routes.load_routes', (['app', 'act_mod', 'mail_callback'], {}), '(app, act_mod, mail_callback)\n', (564, 593), False, 'import routes\n')]
#!/usr/bin/env python3 # coding: utf8 """ Day 2: Inventory Management System part 1 https://adventofcode.com/2018/day/2 """ from collections import Counter def main(): with open('day02input.txt') as f: t2 = 0 t3 = 0 for line in f: counter = Counter(line) if 2 in ...
[ "collections.Counter" ]
[((286, 299), 'collections.Counter', 'Counter', (['line'], {}), '(line)\n', (293, 299), False, 'from collections import Counter\n')]
import json import socket # Create a TCP/IP socket sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # Connect the socket to the port where the server is listening server_address = ('localhost', 8008) sock.connect(server_address) # Create the data and load it into json data = { 'cmd': 'test', 'data': ['foo'...
[ "json.dumps", "socket.socket" ]
[((59, 108), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_STREAM'], {}), '(socket.AF_INET, socket.SOCK_STREAM)\n', (72, 108), False, 'import socket\n'), ((338, 354), 'json.dumps', 'json.dumps', (['data'], {}), '(data)\n', (348, 354), False, 'import json\n')]
#!/usr/bin/env python3 from src.splits import Trim_split, Vapoursynth_split def select_split_class(parameters, index, begin, end): if (parameters.splitting_method == "ffmpeg_trim"): return Trim_split(parameters, index, begin, end) elif (parameters.splitting_method == "Vapoursynth"): return Vapoursynth_split(pa...
[ "src.splits.Vapoursynth_split", "src.splits.Trim_split" ]
[((195, 236), 'src.splits.Trim_split', 'Trim_split', (['parameters', 'index', 'begin', 'end'], {}), '(parameters, index, begin, end)\n', (205, 236), False, 'from src.splits import Trim_split, Vapoursynth_split\n'), ((300, 348), 'src.splits.Vapoursynth_split', 'Vapoursynth_split', (['parameters', 'index', 'begin', 'end'...
import unittest from rdkit import Chem from reinvent_chemistry.library_design import BondMaker, AttachmentPoints from reaction_filters.reaction_filter_enum import ReactionFiltersEnum from reaction_filters.reaction_filter import ReactionFilter from running_modes.configurations import ReactionFilterConfiguration from t...
[ "reinvent_chemistry.library_design.AttachmentPoints", "running_modes.configurations.ReactionFilterConfiguration", "reaction_filters.reaction_filter.ReactionFilter", "reinvent_chemistry.library_design.BondMaker", "reaction_filters.reaction_filter_enum.ReactionFiltersEnum" ]
[((570, 581), 'reinvent_chemistry.library_design.BondMaker', 'BondMaker', ([], {}), '()\n', (579, 581), False, 'from reinvent_chemistry.library_design import BondMaker, AttachmentPoints\n'), ((616, 634), 'reinvent_chemistry.library_design.AttachmentPoints', 'AttachmentPoints', ([], {}), '()\n', (632, 634), False, 'from...
#coding:utf-8 from tornado import ( gen, ioloop, log, web ) from tornado.httpserver import HTTPServer from .handlers import _AsyncBase, _Base, _ThreadPoolBase, _MessageQueueBase from swift_rpc.log import get_logger class RPCServer(object): def __init__(self,config): self.config = config ...
[ "tornado.log.logging.getLogger", "tornado.ioloop.IOLoop.current", "tornado.gen.Return", "tornado.web.Application", "tornado.log.logging.config.dictConfig" ]
[((365, 412), 'tornado.log.logging.getLogger', 'log.logging.getLogger', (["('transmit.%s' % __name__)"], {}), "('transmit.%s' % __name__)\n", (386, 412), False, 'from tornado import gen, ioloop, log, web\n'), ((421, 468), 'tornado.log.logging.config.dictConfig', 'log.logging.config.dictConfig', (['config.LOGCONFIG'], {...
# https://github.com/hplgit/web4sciapps/blob/master/doc/src/web4sa/src-web4sa/apps/flask_apps/vib1/model.py from wtforms import Form, TextField, SelectField, validators class AddAnotherStep(Form): addStep = SelectField(u'Add another step?', choices=[('y', 'yes'), ...
[ "wtforms.validators.required", "wtforms.SelectField" ]
[((216, 304), 'wtforms.SelectField', 'SelectField', (['u"""Add another step?"""'], {'choices': "[('y', 'yes'), ('n', 'no, produce file')]"}), "(u'Add another step?', choices=[('y', 'yes'), ('n',\n 'no, produce file')])\n", (227, 304), False, 'from wtforms import Form, TextField, SelectField, validators\n'), ((470, 6...
# Open a scene import harfang as hg hg.InputInit() hg.WindowSystemInit() res_x, res_y = 1280, 720 win = hg.RenderInit('PBR Scene', res_x, res_y, hg.RF_VSync | hg.RF_MSAA4X) # pipeline = hg.CreateForwardPipeline() res = hg.PipelineResources() hg.AddAssetsFolder("resources_compiled") # load scene scene = hg.Scene()...
[ "harfang.Deg", "harfang.DestroyWindow", "harfang.UpdateWindow", "harfang.IntRect", "harfang.CreateForwardPipeline", "harfang.ReadKeyboard", "harfang.PipelineResources", "harfang.WindowSystemInit", "harfang.Scene", "harfang.AddAssetsFolder", "harfang.Frame", "harfang.RenderShutdown", "harfang...
[((38, 52), 'harfang.InputInit', 'hg.InputInit', ([], {}), '()\n', (50, 52), True, 'import harfang as hg\n'), ((53, 74), 'harfang.WindowSystemInit', 'hg.WindowSystemInit', ([], {}), '()\n', (72, 74), True, 'import harfang as hg\n'), ((107, 175), 'harfang.RenderInit', 'hg.RenderInit', (['"""PBR Scene"""', 'res_x', 'res_...
""" Created on 30 Jul 2017 @author: jdrumgoole """ import socket import sys from datetime import datetime from enum import Enum import pymongo from pymongoimport.canonical_path import Canonical_Path class Restart_State(Enum): undefined = 0 start = 1 inprogress = 2 finish = 3 class Restarter(objec...
[ "pymongoimport.canonical_path.Canonical_Path", "socket.gethostname", "datetime.datetime.utcnow" ]
[((1711, 1741), 'pymongoimport.canonical_path.Canonical_Path', 'Canonical_Path', (['input_filename'], {}), '(input_filename)\n', (1725, 1741), False, 'from pymongoimport.canonical_path import Canonical_Path\n'), ((1805, 1825), 'socket.gethostname', 'socket.gethostname', ([], {}), '()\n', (1823, 1825), False, 'import so...
import matplotlib.pyplot as plt from matplotlib.image import imread lena = imread('../dataset/lena.png') plt.imshow(lena) plt.savefig('1_4z.png')
[ "matplotlib.pyplot.imshow", "matplotlib.image.imread", "matplotlib.pyplot.savefig" ]
[((76, 105), 'matplotlib.image.imread', 'imread', (['"""../dataset/lena.png"""'], {}), "('../dataset/lena.png')\n", (82, 105), False, 'from matplotlib.image import imread\n'), ((106, 122), 'matplotlib.pyplot.imshow', 'plt.imshow', (['lena'], {}), '(lena)\n', (116, 122), True, 'import matplotlib.pyplot as plt\n'), ((124...
import os import marvelous def get_api(): """ Load the Marvel API wrapper :return: :class:`marvelous.sessions.Session` """ public_key = os.environ['MAPI_PUBLIC_KEY'] private_key = os.environ['MAPI_PRIVATE_KEY'] marvel_api = marvelous.api(public_key, private_key) return marvel_api # w...
[ "marvelous.api" ]
[((255, 293), 'marvelous.api', 'marvelous.api', (['public_key', 'private_key'], {}), '(public_key, private_key)\n', (268, 293), False, 'import marvelous\n')]
# -*- coding: utf-8 -*- __author__ = 'ffuentes' from django.core.exceptions import ValidationError from django.utils.translation import gettext_lazy as _ from apps.noclook.models import NodeType, NodeHandle def validate_nodetype(value, type): nh = NodeHandle.objects.get(handle_id=value) if nh.node_type != t...
[ "apps.noclook.models.NodeHandle.objects.get", "django.utils.translation.gettext_lazy" ]
[((255, 294), 'apps.noclook.models.NodeHandle.objects.get', 'NodeHandle.objects.get', ([], {'handle_id': 'value'}), '(handle_id=value)\n', (277, 294), False, 'from apps.noclook.models import NodeType, NodeHandle\n'), ((368, 432), 'django.utils.translation.gettext_lazy', '_', (['"""This field requires a %(type) but a %(...
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ## Created by: <NAME> ## ECE Department, Rutgers University ## Email: <EMAIL> ## Copyright (c) 2017 ## ## This source code is licensed under the MIT-style license found in the ## LICENSE file in the root directory of this source tree ##+++++++...
[ "numpy.abs", "numpy.allclose", "numpy.fmax", "torch.LongTensor", "torch.Tensor", "nose.runmodule", "torch.cuda.DoubleTensor", "encoding.functions.NonMaxSuppression", "torch.ByteTensor", "torch.autograd.gradcheck" ]
[((620, 663), 'numpy.allclose', 'np.allclose', (['npa', 'npb'], {'rtol': 'rtol', 'atol': 'atol'}), '(npa, npb, rtol=rtol, atol=atol)\n', (631, 663), True, 'import numpy as np\n'), ((1197, 1263), 'torch.autograd.gradcheck', 'gradcheck', (['encoding.functions.aggregate', 'input'], {'eps': 'EPS', 'atol': 'ATOL'}), '(encod...
import csv # Documentation # https://docs.python.org/3.7/library/csv.html # csv.reader already splits the list data so daae[0] works out of the box. def readcsv(filepath): ''' Read file in filepath, return all rows as a list type. Call function: ```readcsv('data/file0.csv')``` ''' with open(file...
[ "csv.reader" ]
[((380, 426), 'csv.reader', 'csv.reader', (['data'], {'delimiter': '""","""', 'quotechar': '"""|"""'}), "(data, delimiter=',', quotechar='|')\n", (390, 426), False, 'import csv\n')]
from django.db import models from django.db.models.signals import post_save from django.dispatch import receiver from django.contrib.auth.models import User #from photo.models import Photo class Paymentmethod(models.Model): code = models.CharField(max_length=10, null=True, blank=True, default="") method = mode...
[ "django.db.models.OneToOneField", "django.db.models.DateField", "django.db.models.TextField", "django.db.models.IntegerField", "django.db.models.ManyToManyField", "django.db.models.BooleanField", "django.db.models.PositiveIntegerField", "django.dispatch.receiver", "django.db.models.DecimalField", ...
[((2646, 2678), 'django.dispatch.receiver', 'receiver', (['post_save'], {'sender': 'User'}), '(post_save, sender=User)\n', (2654, 2678), False, 'from django.dispatch import receiver\n'), ((236, 302), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(10)', 'null': '(True)', 'blank': '(True)', 'defa...
# python 3.7.2 import datetime import random from flask import Flask, make_response, jsonify, request app = Flask(__name__) def generate_fake_timeseries(fr, to, interval=60000, create=4): """Makes some fake timeseries (value, clock) to send back for rendering a chart in our examples below.""" fr_timestamp = int(da...
[ "flask.Flask", "datetime.datetime.strptime", "flask.request.get_json", "flask.make_response", "random.random", "random.randint", "flask.jsonify" ]
[((108, 123), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (113, 123), False, 'from flask import Flask, make_response, jsonify, request\n'), ((1704, 1723), 'flask.make_response', 'make_response', (['"""ok"""'], {}), "('ok')\n", (1717, 1723), False, 'from flask import Flask, make_response, jsonify, reques...
from openwater.split import split_time_series import numpy as np def test_create_split_windows(): grp = { 'DummyModel':{ 'inputs':np.zeros((1,1,10000)) } } BREAKS = [ [100,1000,5000], [0,100,1000,5000], [100,1000,5000,10000], [0,100,1000,5000,1...
[ "numpy.zeros", "openwater.split.split_time_series" ]
[((846, 878), 'openwater.split.split_time_series', 'split_time_series', (['grp', '(11)', 'None'], {}), '(grp, 11, None)\n', (863, 878), False, 'from openwater.split import split_time_series\n'), ((377, 411), 'openwater.split.split_time_series', 'split_time_series', (['grp', '(10)', 'breaks'], {}), '(grp, 10, breaks)\n'...
""" clean_data.py Clean up raw *.csv files """ # Imports import numpy as np import pandas as pd combine_file = r'../data/nfl_combine_1987_2020.csv' df_raw_combine = pd.read_csv(combine_file) df_raw_combine.head() draft_file = r'../data/espn_draft_history_2000_2021_cleaned.csv' df_raw_draft = pd.read_csv(draft_fil...
[ "pandas.read_csv" ]
[((169, 194), 'pandas.read_csv', 'pd.read_csv', (['combine_file'], {}), '(combine_file)\n', (180, 194), True, 'import pandas as pd\n'), ((299, 322), 'pandas.read_csv', 'pd.read_csv', (['draft_file'], {}), '(draft_file)\n', (310, 322), True, 'import pandas as pd\n')]
from server.models.postgis.mapping_issues import MappingIssueCategory from server.models.postgis.task import TaskMappingIssue, TaskHistory, Task from server.models.postgis.user import User from server.models.postgis.project import Project from server.models.postgis.statuses import TaskStatus from server.models.dtos.map...
[ "server.models.postgis.task.Task.get_all_tasks", "server.models.postgis.mapping_issues.MappingIssueCategory.get_by_id", "server.services.stats_service.StatsService.get_user_contributions", "server.models.postgis.mapping_issues.MappingIssueCategory.create_from_dto", "numpy.zeros", "copy.deepcopy", "serve...
[((789, 832), 'server.models.postgis.mapping_issues.MappingIssueCategory.get_by_id', 'MappingIssueCategory.get_by_id', (['category_id'], {}), '(category_id)\n', (819, 832), False, 'from server.models.postgis.mapping_issues import MappingIssueCategory\n'), ((1387, 1437), 'server.models.postgis.mapping_issues.MappingIssu...
#!/usr/bin/env python3 '''A reference implementation of Bloom filter-based Iris-Code indexing.''' __author__ = "<NAME>" __copyright__ = "Copyright (C) 2017 Hochschule Darmstadt" __license__ = "License Agreement provided by Hochschule Darmstadt(https://github.com/dasec/bloom-filter-iris-indexing/blob/master/hda-license...
[ "numpy.mean", "copy.deepcopy", "argparse.ArgumentParser", "timeit.default_timer", "math.log", "numpy.array", "numpy.std", "operator.itemgetter" ]
[((547, 624), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Bloom filter-based Iris-Code indexing."""'}), "(description='Bloom filter-based Iris-Code indexing.')\n", (570, 624), False, 'import argparse\n'), ((11022, 11029), 'timeit.default_timer', 'timer', ([], {}), '()\n', (11027, 1102...
#!/usr/bin/python3 import sys import requests import json import subprocess import csv import os import hashlib from datetime import datetime import configparser from random import randint import collections import time def getDigest(input): print(input) block_size = 65536 sha256 = hashlib.sha256() sh...
[ "hashlib.sha256", "requests.post", "configparser.ConfigParser", "subprocess.Popen", "json.dumps", "time.sleep", "requests.get", "datetime.datetime.now", "csv.reader", "time.time" ]
[((4986, 5013), 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {}), '()\n', (5011, 5013), False, 'import configparser\n'), ((297, 313), 'hashlib.sha256', 'hashlib.sha256', ([], {}), '()\n', (311, 313), False, 'import hashlib\n'), ((5682, 5693), 'time.time', 'time.time', ([], {}), '()\n', (5691, 5693), F...
# -*- coding: utf-8 -*- #_____________________________________________________________________________ # # This file is part of BridgeDB, a Tor bridge distribution system. # # :authors: <NAME> 0xA3ADB67A2CDB8B35 <<EMAIL>> # please also see AUTHORS file # :copyright: (c) 2013-2017, Isis Lovecruft # ...
[ "bridgedb.distribute.IDistribute.namesAndDescriptions", "bridgedb.distribute.IDistribute.providedBy", "bridgedb.distribute.Distributor" ]
[((920, 954), 'bridgedb.distribute.IDistribute.namesAndDescriptions', 'IDistribute.namesAndDescriptions', ([], {}), '()\n', (952, 954), False, 'from bridgedb.distribute import IDistribute\n'), ((963, 998), 'bridgedb.distribute.IDistribute.providedBy', 'IDistribute.providedBy', (['Distributor'], {}), '(Distributor)\n', ...
# coding: utf-8 import sys import os import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D __all__ = ['Ackley','Sphere','Rosenbrock','Beale','GoldsteinPrice','Booth', 'BukinN6','Matyas','LeviN13','ThreeHumpCamel','Easom','Eggholder', 'McCormick','Schaffer...
[ "numpy.sqrt", "numpy.array", "numpy.sin", "numpy.arange", "matplotlib.pyplot.close", "numpy.exp", "os.path.isdir", "os.mkdir", "numpy.meshgrid", "numpy.random.normal", "numpy.tile", "matplotlib.pyplot.savefig", "numpy.floor", "numpy.square", "numpy.cos", "mpl_toolkits.mplot3d.Axes3D", ...
[((1464, 1497), 'numpy.array', 'np.array', (['([0] * self.variable_num)'], {}), '([0] * self.variable_num)\n', (1472, 1497), True, 'import numpy as np\n'), ((1528, 1561), 'numpy.array', 'np.array', (['([0] * self.variable_num)'], {}), '([0] * self.variable_num)\n', (1536, 1561), True, 'import numpy as np\n'), ((1592, 1...
import json import wml_utils as wmlu import numpy as np import os import cv2 as cv import sys import random from iotoolkit.labelme_toolkit import get_labels_and_bboxes def get_files(dir_path, sub_dir_name): img_dir = os.path.join(dir_path, sub_dir_name,'images') label_dir = os.path.join(dir_path, sub_dir_name...
[ "wml_utils.recurse_get_filepath_in_dir", "img_utils.imread", "numpy.array", "matplotlib.pyplot.imshow", "os.path.exists", "numpy.reshape", "object_detection_tools.visualization.draw_bboxes_and_maskv2", "numpy.max", "numpy.stack", "numpy.min", "sys.stdout.flush", "numpy.maximum", "wml_utils.h...
[((223, 269), 'os.path.join', 'os.path.join', (['dir_path', 'sub_dir_name', '"""images"""'], {}), "(dir_path, sub_dir_name, 'images')\n", (235, 269), False, 'import os\n'), ((285, 341), 'os.path.join', 'os.path.join', (['dir_path', 'sub_dir_name', '"""v2.0"""', '"""polygons"""'], {}), "(dir_path, sub_dir_name, 'v2.0', ...
# -*- coding: utf-8 -*- """ """ from __future__ import unicode_literals from __future__ import print_function from __future__ import absolute_import import os from flask import request from quantifiedcode.settings import backend, settings from ...utils.api import ArgumentError, get_pagination_args from ...models...
[ "quantifiedcode.settings.settings.get", "quantifiedcode.settings.backend.get", "quantifiedcode.settings.backend.filter" ]
[((1018, 1148), 'quantifiedcode.settings.backend.get', 'backend.get', (['Task', "{'project.pk': request.project.pk, 'pk': task_id}"], {'only': 'self.export_fields', 'include': "('project',)", 'raw': '(True)'}), "(Task, {'project.pk': request.project.pk, 'pk': task_id}, only=\n self.export_fields, include=('project',...
import cv2 import numpy as np import matplotlib.pyplot as plt img1 = cv2.imread('gain2.jpg',0) #logo.jpg img2 = cv2.imread('bee4.jpg',0) #image.jpg sift = cv2.xfeatures2d.SIFT_create() kp1, ds1 = sift.detectAndCompute(img1,None) kp2, ds2 = sift.detectAndCompute(img2,None) #img2 = cv2.drawKeypoints(img2, kp2, None) ...
[ "matplotlib.pyplot.imshow", "cv2.FlannBasedMatcher", "cv2.xfeatures2d.SIFT_create", "cv2.drawMatches", "cv2.imread", "matplotlib.pyplot.show" ]
[((70, 96), 'cv2.imread', 'cv2.imread', (['"""gain2.jpg"""', '(0)'], {}), "('gain2.jpg', 0)\n", (80, 96), False, 'import cv2\n'), ((113, 138), 'cv2.imread', 'cv2.imread', (['"""bee4.jpg"""', '(0)'], {}), "('bee4.jpg', 0)\n", (123, 138), False, 'import cv2\n'), ((157, 186), 'cv2.xfeatures2d.SIFT_create', 'cv2.xfeatures2...
import requests import time from requests.adapters import HTTPAdapter from requests.exceptions import ConnectionError import pandas as pd import sqlite3 from pgs_harmonizer.harmonize import reversecomplement class VariationResult: """Class to parse the 'mapping 'information from ENSEMBL Variation""" def __ini...
[ "pgs_harmonizer.harmonize.reversecomplement", "sqlite3.connect", "requests.adapters.HTTPAdapter", "requests.Session" ]
[((4242, 4268), 'requests.adapters.HTTPAdapter', 'HTTPAdapter', ([], {'max_retries': '(3)'}), '(max_retries=3)\n', (4253, 4268), False, 'from requests.adapters import HTTPAdapter\n'), ((4331, 4349), 'requests.Session', 'requests.Session', ([], {}), '()\n', (4347, 4349), False, 'import requests\n'), ((6313, 6349), 'sqli...
from click.testing import CliRunner from ledgeroni.cli import cli def test_balance(): "Tests the balance command without any options" runner = CliRunner() result = runner.invoke(cli, [ '-f', 'tests/sample_data/index.ledger', '--price-db', 'tests/sample_data/prices_db', 'balance']) asse...
[ "click.testing.CliRunner" ]
[((153, 164), 'click.testing.CliRunner', 'CliRunner', ([], {}), '()\n', (162, 164), False, 'from click.testing import CliRunner\n'), ((431, 442), 'click.testing.CliRunner', 'CliRunner', ([], {}), '()\n', (440, 442), False, 'from click.testing import CliRunner\n'), ((777, 788), 'click.testing.CliRunner', 'CliRunner', ([...
# -*- coding: utf-8 -*- # Generated by Django 1.10.4 on 2017-03-09 15:51 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('story', '0018_notification_read'), ] operations = [ migrations.AddField( ...
[ "django.db.models.DateTimeField" ]
[((407, 457), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'auto_now_add': '(True)', 'null': '(True)'}), '(auto_now_add=True, null=True)\n', (427, 457), False, 'from django.db import migrations, models\n')]
from cm4.flask_rest_api.app import app if __name__ == "__main__": app.run(debug=True, threaded=True, host='127.0.0.1')
[ "cm4.flask_rest_api.app.app.run" ]
[((71, 123), 'cm4.flask_rest_api.app.app.run', 'app.run', ([], {'debug': '(True)', 'threaded': '(True)', 'host': '"""127.0.0.1"""'}), "(debug=True, threaded=True, host='127.0.0.1')\n", (78, 123), False, 'from cm4.flask_rest_api.app import app\n')]
from main import BaseHandler from google.appengine.ext import ndb import time class DeleteCommentHandler(BaseHandler): """Comment deletion handler""" def get(self): if self.user: comment_id = self.request.get("comment") key = ndb.Key('Comment', int(comment_id)) com...
[ "time.sleep" ]
[((1224, 1239), 'time.sleep', 'time.sleep', (['(0.1)'], {}), '(0.1)\n', (1234, 1239), False, 'import time\n')]
import gym import random import torch import numpy as np from collections import deque import matplotlib.pyplot as plt #%matplotlib inline from unityagents import UnityEnvironment import numpy as np import argparse import sys env = UnityEnvironment(file_name="Banana_Windows_x86_64/Banana.exe") # get the default brai...
[ "numpy.mean", "collections.deque", "argparse.ArgumentParser", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "dqn_agent.Agent", "unityagents.UnityEnvironment", "matplotlib.pyplot.figure", "sys.exit", "matplotlib.pyplot.show" ]
[((234, 296), 'unityagents.UnityEnvironment', 'UnityEnvironment', ([], {'file_name': '"""Banana_Windows_x86_64/Banana.exe"""'}), "(file_name='Banana_Windows_x86_64/Banana.exe')\n", (250, 296), False, 'from unityagents import UnityEnvironment\n'), ((1451, 1468), 'collections.deque', 'deque', ([], {'maxlen': '(100)'}), '...
from .model import Block, Transaction, TxInput, TxOutput, OutputCondition from .mempool import Mempool # Tailimport of Wallet to prevent Circular import Problems from .mining import Miningmanager from collections import namedtuple class Genesisblock(Block): def is_valid(self, *args,**kwargs): return True ...
[ "collections.namedtuple", "sqlite3.connect" ]
[((1879, 1921), 'collections.namedtuple', 'namedtuple', (['"""Maxblock"""', '"""blockheight hash"""'], {}), "('Maxblock', 'blockheight hash')\n", (1889, 1921), False, 'from collections import namedtuple\n'), ((541, 598), 'sqlite3.connect', 'sqlite3.connect', (['"""blockchain.db"""'], {'check_same_thread': '(False)'}), ...
from os import pardir from os.path import join DEBUG = True FREEZER_DESTINATION = join(pardir, 'build')
[ "os.path.join" ]
[((84, 105), 'os.path.join', 'join', (['pardir', '"""build"""'], {}), "(pardir, 'build')\n", (88, 105), False, 'from os.path import join\n')]
from io import StringIO from collections import OrderedDict import numpy as np import scipy.linalg as sl import pandas as pd import pytest import matmodlab2 as mml runid = 'simulation_output' def compare_dataframes(frame1, frame2, tol=1.0e-12): head1 = frame1.keys() head2 = frame2.keys() passed = True ...
[ "numpy.allclose", "matmodlab2.MaterialPointSimulator", "pandas.read_csv", "pytest.mark.skip", "numpy.log", "matmodlab2.ElasticMaterial", "pytest.mark.parametrize" ]
[((668, 686), 'pytest.mark.skip', 'pytest.mark.skip', ([], {}), '()\n', (684, 686), False, 'import pytest\n'), ((708, 768), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""stretch"""', '[1.5, 1.001, 0.999, 0.5]'], {}), "('stretch', [1.5, 1.001, 0.999, 0.5])\n", (731, 768), False, 'import pytest\n'), ((770, ...
"""Git specific support and addon.""" import argparse import os import pickle import shlex import subprocess from collections import namedtuple, UserDict from pathspec import PathSpec from pkgcore.ebuild import cpv from pkgcore.ebuild.atom import MalformedAtom from pkgcore.ebuild.atom import atom as atom_cls from pkg...
[ "pkgcore.repository.multiplex.tree", "snakeoil.strings.pluralism", "collections.namedtuple", "pickle.dump", "snakeoil.process.find_binary", "pathspec.PathSpec.from_lines", "shlex.split", "subprocess.Popen", "snakeoil.cli.exceptions.UserException", "pkgcore.ebuild.atom.atom", "pickle.load", "pk...
[((1046, 1138), 'snakeoil.demandload.demand_compile_regexp', 'demand_compile_regexp', (['"""ebuild_ADM_regex"""', 'f"""^(?P<status>[ADM])\\\\t{_ebuild_path_regex}$"""'], {}), "('ebuild_ADM_regex',\n f'^(?P<status>[ADM])\\\\t{_ebuild_path_regex}$')\n", (1067, 1138), False, 'from snakeoil.demandload import demand_comp...
"""Calendar PDF generation""" import os from dataclasses import dataclass from typing import Optional, List from reportlab.lib import colors from reportlab.pdfgen import canvas from reportlab.pdfbase.pdfmetrics import stringWidth from reportlab.pdfbase import pdfmetrics from reportlab.pdfbase.ttfonts import TTFont ...
[ "os.listdir", "os.path.join", "os.path.splitext", "reportlab.pdfbase.pdfmetrics.getAscentDescent", "os.path.realpath", "reportlab.pdfbase.pdfmetrics.stringWidth" ]
[((446, 481), 'os.path.join', 'os.path.join', (['current_path', '"""fonts"""'], {}), "(current_path, 'fonts')\n", (458, 481), False, 'import os\n'), ((504, 527), 'os.listdir', 'os.listdir', (['font_folder'], {}), '(font_folder)\n', (514, 527), False, 'import os\n'), ((18098, 18132), 'reportlab.pdfbase.pdfmetrics.string...
import numpy as np import scipy.linalg from numpy.linalg import cond, norm from scipy.linalg import toeplitz from scipy.linalg import solve_triangular import time import pandas as pd import matplotlib.pyplot as plt import seaborn as sns sns.set_style('darkgrid') PI = np.pi CRED = '\033[91m' CGREEN = '\033[32m' CEND = ...
[ "numpy.linalg.cond", "seaborn.set_style", "numpy.linalg.norm", "numpy.arange", "matplotlib.pyplot.plot", "matplotlib.pyplot.close", "numpy.matmul", "scipy.linalg.solve_triangular", "numpy.unravel_index", "pandas.DataFrame", "numpy.tri", "numpy.abs", "numpy.eye", "matplotlib.pyplot.savefig"...
[((237, 262), 'seaborn.set_style', 'sns.set_style', (['"""darkgrid"""'], {}), "('darkgrid')\n", (250, 262), True, 'import seaborn as sns\n'), ((13615, 13641), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(8, 8)'}), '(figsize=(8, 8))\n', (13625, 13641), True, 'import matplotlib.pyplot as plt\n'), ((13641,...
import pandas as pd import seaborn as sns from datetime import datetime import matplotlib.patches as patches from ..common import log from ..util.completion import completion_idx_has_data def completion_plot(completion, modalities, start, end, freq, ax=None, cmap=None, x_tick_mult=24, x_tick_fmt="%y-%m-%d %H:%M",...
[ "pandas.Timestamp", "pandas.Timedelta", "matplotlib.patches.Rectangle", "datetime.datetime.strptime" ]
[((1577, 1595), 'pandas.Timedelta', 'pd.Timedelta', (['freq'], {}), '(freq)\n', (1589, 1595), True, 'import pandas as pd\n'), ((2983, 3092), 'matplotlib.patches.Rectangle', 'patches.Rectangle', (['(e_start, 0)', '(e_end - e_start)', 'N_y'], {'linewidth': '(0.5)', 'edgecolor': '"""k"""', 'alpha': '(0.25)', 'zorder': '(9...
"""Tests for the assorted models.""" # Copyright 2015-2016 Capstone Team G # # 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 requi...
[ "logging.basicConfig", "lintable_db.models.Report", "random.choice", "peewee.SqliteDatabase", "lintable_db.models.Repo", "uuid.uuid4", "playhouse.test_utils.test_database", "datetime.datetime.now", "lintable_db.models.User", "lintable_db.database.DatabaseHandler", "lintable_db.models.User.get", ...
[((1099, 1125), 'peewee.SqliteDatabase', 'SqliteDatabase', (['""":memory:"""'], {}), "(':memory:')\n", (1113, 1125), False, 'from peewee import SqliteDatabase\n'), ((1167, 1237), 'logging.basicConfig', 'logging.basicConfig', ([], {'filename': '"""./model_tests.log"""', 'level': 'logging.DEBUG'}), "(filename='./model_te...
from pathlib import Path current_dir = Path(__file__).parent.absolute() import torch import torch.nn as nn from einops.layers.torch import Rearrange # [2021-06-30] TD: Somehow I get segfault if I import pl_bolts *after* torchvision from pl_bolts.datamodules import CIFAR10DataModule from torchvision import transforms,...
[ "src.utils.autoaug.CIFAR10Policy", "einops.layers.torch.Rearrange", "src.utils.tuples.to_2tuple", "pathlib.Path", "torchvision.transforms.RandomHorizontalFlip", "torchvision.transforms.Grayscale", "torchvision.transforms.RandomCrop", "torchvision.transforms.Normalize", "torchvision.transforms.Resize...
[((606, 729), 'torchvision.transforms.Normalize', 'transforms.Normalize', ([], {'mean': '[(x / 255.0) for x in [125.3, 123.0, 113.9]]', 'std': '[(x / 255.0) for x in [63.0, 62.1, 66.7]]'}), '(mean=[(x / 255.0) for x in [125.3, 123.0, 113.9]], std\n =[(x / 255.0) for x in [63.0, 62.1, 66.7]])\n', (626, 729), False, '...
from pdf2image import convert_from_path def pdfToImage(pdf): ''' (string) -> null this function takes in a path to a pdf and converts the pdf intp an image (type jpeg). ''' # convert pages into images pages = convert_from_path(pdf) # save the pages in jpeg format for page in page...
[ "pdf2image.convert_from_path" ]
[((240, 262), 'pdf2image.convert_from_path', 'convert_from_path', (['pdf'], {}), '(pdf)\n', (257, 262), False, 'from pdf2image import convert_from_path\n')]
#!usr/bin/env python import os def convert_all(directory, inputExt, outputExt, dpi=300): allFiles = os.listdir(directory) inputFiles = [x for x in allFiles if x.endswith(inputExt)] outputFiles = [os.path.splitext(x)[0] + '.' +outputExt for x in inputFiles] for i, o in zip(inputFiles, outputFiles): ...
[ "os.listdir", "os.path.splitext" ]
[((106, 127), 'os.listdir', 'os.listdir', (['directory'], {}), '(directory)\n', (116, 127), False, 'import os\n'), ((210, 229), 'os.path.splitext', 'os.path.splitext', (['x'], {}), '(x)\n', (226, 229), False, 'import os\n')]
"""siunit - A module to support dimensioned arithmetic using the SI system. Dimensioned numbers are instances of siunit.Dn(). Arithmetic between Dn's with incompatible units raises TypeError. Arithmetic between Dn's with compatible units produces a result with appropriate units. For example, :: >>> m=Dn('3kg') ...
[ "numpy.array", "math.sqrt" ]
[((30602, 30619), 'math.sqrt', 'math_sqrt', (['self.n'], {}), '(self.n)\n', (30611, 30619), True, 'from math import sqrt as math_sqrt\n'), ((25248, 25258), 'numpy.array', 'array', (['num'], {}), '(num)\n', (25253, 25258), False, 'from numpy import array\n')]
"""Splits the time dimension into an reftime and a leadtime so that multiple files can be concatenated more easily""" import sys from netCDF4 import Dataset, num2date, date2num for f in sys.argv[1:]: dataset = Dataset(f, 'a') # rename record dimension to reftime dataset.renameDimension('record', 'reftime...
[ "netCDF4.date2num", "netCDF4.Dataset", "netCDF4.num2date" ]
[((216, 231), 'netCDF4.Dataset', 'Dataset', (['f', '"""a"""'], {}), "(f, 'a')\n", (223, 231), False, 'from netCDF4 import Dataset, num2date, date2num\n'), ((800, 859), 'netCDF4.num2date', 'num2date', (['time[:]'], {'units': 'time.units', 'calendar': 'time.calendar'}), '(time[:], units=time.units, calendar=time.calendar...
""" This module has functions which syncs problems data in database with data in OJ_data """ import os FILE_PATH = os.path.abspath(__file__) BASE_DIR = os.path.dirname(os.path.dirname(FILE_PATH)) import sys if BASE_DIR not in sys.path: sys.path.append(BASE_DIR) import json def add_prob(prob_path, contest=None): pc...
[ "os.environ.setdefault", "django.setup", "os.listdir", "os.path.join", "main.models.Problem.objects.get_or_create", "main.models.Contest.objects.get_or_create", "os.path.dirname", "os.path.basename", "os.path.abspath", "sys.path.append" ]
[((116, 141), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (131, 141), False, 'import os\n'), ((1790, 1817), 'os.path.basename', 'os.path.basename', (['FILE_PATH'], {}), '(FILE_PATH)\n', (1806, 1817), False, 'import os\n'), ((1970, 2015), 'os.path.join', 'os.path.join', (['BASE_DIR', '"""OJ...