code
stringlengths
22
1.05M
apis
listlengths
1
3.31k
extract_api
stringlengths
75
3.25M
import unittest import os import numpy as np from constants import ( del_test_dir, gen_test_dir, get_output_mode, solution_domain_setup, CHEM_DICT_REACT, SOL_PRIM_IN_REACT, TEST_DIR, ) from perform.constants import REAL_TYPE from perform.system_solver import SystemSolver from perform.input...
[ "numpy.repeat", "perform.input_funcs.read_restart_file", "constants.del_test_dir", "perform.solution.solution_interior.SolutionInterior", "os.path.join", "constants.gen_test_dir", "constants.get_output_mode", "perform.time_integrator.implicit_integrator.BDF", "constants.solution_domain_setup", "pe...
[((670, 687), 'constants.get_output_mode', 'get_output_mode', ([], {}), '()\n', (685, 687), False, 'from constants import del_test_dir, gen_test_dir, get_output_mode, solution_domain_setup, CHEM_DICT_REACT, SOL_PRIM_IN_REACT, TEST_DIR\n'), ((773, 810), 'perform.gas_model.calorically_perfect_gas.CaloricallyPerfectGas', ...
#!/usr/bin/env python '''Assert HDF5 input is non-zero. Print to stderr if not. For example, find . -iname '*.hdf5' -exec h5zero.py {} + ''' from __future__ import print_function import argparse import sys import h5py from dautil.IO.h5 import h5assert_nonzero __version__ = '0.1' def main(args): for filenam...
[ "dautil.IO.h5.h5assert_nonzero", "argparse.ArgumentParser", "h5py.File" ]
[((566, 635), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Assert HDF5 input is non-zero."""'}), "(description='Assert HDF5 input is non-zero.')\n", (589, 635), False, 'import argparse\n'), ((350, 374), 'h5py.File', 'h5py.File', (['filename', '"""r"""'], {}), "(filename, 'r')\n", (359,...
#User function Template for python3 class Solution: def calculateSpan(self,a,n): Span = [0 for i in range(n)] stack = [0] #span value of first day is always 1. Span[0] = 1 for i in range(1, n): #we pop elements from the stack till price at top of stack is less th...
[ "io.StringIO", "sys.stdin.read" ]
[((1076, 1089), 'io.StringIO', 'io.StringIO', ([], {}), '()\n', (1087, 1089), False, 'import io\n'), ((993, 1009), 'sys.stdin.read', 'sys.stdin.read', ([], {}), '()\n', (1007, 1009), False, 'import sys\n')]
#!python # -*- coding: utf-8 -*- """Unit testing for scriptorium""" import os import tempfile import shutil import textwrap import unittest import scriptorium class TestScriptorium(unittest.TestCase): @classmethod def setUpClass(cls): """Set up unit tests for scriptorium""" TestScriptorium.templa...
[ "os.path.expanduser", "textwrap.dedent", "os.path.exists", "scriptorium.find_template", "scriptorium.install_template", "os.path.join", "os.getcwd", "os.chdir", "scriptorium.CONFIG.copy", "scriptorium.to_pdf", "scriptorium.read_config", "tempfile.mkdtemp", "scriptorium.paper_root", "shutil...
[((2750, 2765), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2763, 2765), False, 'import unittest\n'), ((329, 347), 'tempfile.mkdtemp', 'tempfile.mkdtemp', ([], {}), '()\n', (345, 347), False, 'import tempfile\n'), ((382, 400), 'tempfile.mkdtemp', 'tempfile.mkdtemp', ([], {}), '()\n', (398, 400), False, 'import...
"""Test the module SMOTE ENN.""" # Authors: <NAME> <<EMAIL>> # <NAME> # License: MIT import pytest import numpy as np from sklearn.utils.testing import assert_allclose, assert_array_equal from imblearn.combine import SMOTEENN from imblearn.under_sampling import EditedNearestNeighbours from imblearn.over_sam...
[ "sklearn.utils.testing.assert_array_equal", "imblearn.under_sampling.EditedNearestNeighbours", "imblearn.over_sampling.SMOTE", "imblearn.combine.SMOTEENN", "numpy.array", "pytest.mark.parametrize", "pytest.raises", "sklearn.utils.testing.assert_allclose" ]
[((357, 935), 'numpy.array', 'np.array', (['[[0.11622591, -0.0317206], [0.77481731, 0.60935141], [1.25192108, -\n 0.22367336], [0.53366841, -0.30312976], [1.52091956, -0.49283504], [-\n 0.28162401, -2.10400981], [0.83680821, 1.72827342], [0.3084254, \n 0.33299982], [0.70472253, -0.73309052], [0.28893132, -0.38...
# Generated by Django 3.0.7 on 2020-09-22 05:14 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('listings', '0001_initial'), ] operations = [ migrations.RemoveField( model_name='post', name='author', ), ]
[ "django.db.migrations.RemoveField" ]
[((217, 273), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""post"""', 'name': '"""author"""'}), "(model_name='post', name='author')\n", (239, 273), False, 'from django.db import migrations\n')]
import logging import os import traceback from typing import List from workflower.adapters.sqlalchemy.setup import Session from workflower.adapters.sqlalchemy.unit_of_work import SqlAlchemyUnitOfWork from workflower.application.event.commands import CreateEventCommand from workflower.application.workflow.commands impo...
[ "logging.getLogger", "traceback.format_exc", "workflower.application.workflow.commands.ActivateWorkflowCommand", "workflower.adapters.sqlalchemy.unit_of_work.SqlAlchemyUnitOfWork", "workflower.application.workflow.commands.LoadWorkflowFromYamlFileCommand", "os.path.join", "workflower.adapters.sqlalchemy...
[((491, 529), 'logging.getLogger', 'logging.getLogger', (['"""workflower.loader"""'], {}), "('workflower.loader')\n", (508, 529), False, 'import logging\n'), ((999, 1008), 'workflower.adapters.sqlalchemy.setup.Session', 'Session', ([], {}), '()\n', (1006, 1008), False, 'from workflower.adapters.sqlalchemy.setup import ...
#!/usr/bin/env python # -*- encoding: utf-8 -*- from __future__ import absolute_import, unicode_literals import io import os import re from setuptools import find_packages, setup here = os.path.abspath(os.path.dirname(__file__)) PROJECT_MODULE = 'dragonite' PROJECT = 'dragonite' AUTHOR = '<NAME>' EMAIL = '<EMAIL>'...
[ "os.path.dirname", "setuptools.find_packages", "os.path.join", "io.open" ]
[((1575, 1607), 'os.path.join', 'os.path.join', (['here', '"""README.rst"""'], {}), "(here, 'README.rst')\n", (1587, 1607), False, 'import os\n'), ((1709, 1747), 'os.path.join', 'os.path.join', (['here', '"""requirements.txt"""'], {}), "(here, 'requirements.txt')\n", (1721, 1747), False, 'import os\n'), ((205, 230), 'o...
# django imports from django import forms from django.conf import settings from django.core.cache import cache from django.template.loader import render_to_string # portlets imports from portlets.models import Portlet # lfs imports from lfs.page.models import Page class PagesPortlet(Portlet): """Portlet to disp...
[ "django.core.cache.cache.set", "lfs.page.models.Page.objects.filter", "django.template.loader.render_to_string", "django.core.cache.cache.get" ]
[((656, 676), 'django.core.cache.cache.get', 'cache.get', (['cache_key'], {}), '(cache_key)\n', (665, 676), False, 'from django.core.cache import cache\n'), ((843, 955), 'django.template.loader.render_to_string', 'render_to_string', (['"""lfs/portlets/pages.html"""'], {'request': 'request', 'context': "{'title': self.t...
from django.contrib import admin from django.db import models from django.utils.translation import gettext as _ from .models import (MilitaryRank, Platoon, ServiseID, Unit, OfficialPosition, Company, Education, Creed, Nationality, Command) from osoba.widgets import CustomDatePickerInput class Ser...
[ "django.contrib.admin.site.register", "django.utils.translation.gettext" ]
[((1846, 1874), 'django.contrib.admin.site.register', 'admin.site.register', (['Company'], {}), '(Company)\n', (1865, 1874), False, 'from django.contrib import admin\n'), ((1875, 1908), 'django.contrib.admin.site.register', 'admin.site.register', (['MilitaryRank'], {}), '(MilitaryRank)\n', (1894, 1908), False, 'from dj...
import sys, os, glob from skimage import io from skimage import viewer import registration as reg from skimage import data def display(): pass if __name__ == "__main__": # ------------------Create input ndarray------------------------ inputDir = '../data/test/' imageFiles = glob.glob(os.path.join(inp...
[ "registration.overlay_pics", "skimage.io.ImageCollection", "os.path.join", "registration.reg", "skimage.viewer.show", "registration.registration", "skimage.data.coins", "skimage.viewer.CollectionViewer" ]
[((564, 581), 'registration.reg', 'reg.reg', (['src', 'dst'], {}), '(src, dst)\n', (571, 581), True, 'import registration as reg\n'), ((672, 695), 'registration.registration', 'reg.registration', (['stack'], {}), '(stack)\n', (688, 695), True, 'import registration as reg\n'), ((849, 861), 'skimage.data.coins', 'data.co...
""" Numpy's `split` can split a multidimensional array into non-overlapping sub-arrays. However, this is not a memory-efficient way of dealing with non-overlapping partitions of an array because it effectively doubles memory usage. This module provides an iterable generator that produces tuples of slices, each of whic...
[ "itertools.product" ]
[((1903, 1927), 'itertools.product', 'product', (['*startRangesGen'], {}), '(*startRangesGen)\n', (1910, 1927), False, 'from itertools import product\n')]
# ColorPaint.py import pygame # setup import random pygame.init() screen = pygame.display.set_mode([800, 600]) pygame.display.set_caption('Click and drag to draw, using up to 3 mouse buttons') keepGoing = True ORANGE = (255,255,0) # RGB color triplets for 3 mousebutton colors GREEN = (0,25...
[ "pygame.draw.circle", "pygame.mouse.get_pressed", "pygame.init", "pygame.quit", "pygame.event.get", "pygame.display.set_mode", "pygame.mouse.get_pos", "pygame.display.set_caption", "pygame.display.update" ]
[((78, 91), 'pygame.init', 'pygame.init', ([], {}), '()\n', (89, 91), False, 'import pygame\n'), ((101, 136), 'pygame.display.set_mode', 'pygame.display.set_mode', (['[800, 600]'], {}), '([800, 600])\n', (124, 136), False, 'import pygame\n'), ((137, 223), 'pygame.display.set_caption', 'pygame.display.set_caption', (['"...
import datetime import unittest from accounts.models import AccountDetails from categories.models import Category from django.contrib.auth.models import User from django.test import Client from django.test import TestCase from django.urls import reverse from events.models import Comment from events.models import E...
[ "accounts.models.AccountDetails.objects.create", "events.models.Invite.objects.create", "categories.models.Category.objects.create", "events.models.Comment.objects.create", "events.models.Event.objects.create", "events.models.Comment.objects.first", "django.urls.reverse", "django.contrib.auth.models.U...
[((3234, 3242), 'django.test.Client', 'Client', ([], {}), '()\n', (3240, 3242), False, 'from django.test import Client\n'), ((507, 515), 'django.test.Client', 'Client', ([], {}), '()\n', (513, 515), False, 'from django.test import Client\n'), ((602, 703), 'categories.models.Category.objects.create', 'Category.objects.c...
# -*- coding: utf-8 -*- """ @inproceedings{DBLP:conf/cvpr/SunLCS19, author = {<NAME> and <NAME> and Tat{-}<NAME> and <NAME>}, title = {Meta-Transfer Learning for Few-Shot Learning}, booktitle = {{IEEE} Conference on Computer Vision and Pattern Recognition, {CVPR...
[ "torch.nn.functional.linear", "core.utils.accuracy", "torch.nn.CrossEntropyLoss", "torch.nn.init.kaiming_normal_", "torch.autograd.grad", "torch.nn.functional.cross_entropy", "torch.nn.ParameterList", "torch.zeros", "torch.ones" ]
[((1130, 1148), 'torch.nn.ParameterList', 'nn.ParameterList', ([], {}), '()\n', (1146, 1148), False, 'from torch import digamma, nn\n'), ((1228, 1269), 'torch.nn.init.kaiming_normal_', 'torch.nn.init.kaiming_normal_', (['self.fc1_w'], {}), '(self.fc1_w)\n', (1257, 1269), False, 'import torch\n'), ((1582, 1613), 'torch....
# coding=utf-8 from OTLMOW.OTLModel.BaseClasses.OTLAttribuut import OTLAttribuut from OTLMOW.OTLModel.Classes.DwarseMarkeringToegang import DwarseMarkeringToegang from OTLMOW.OTLModel.Datatypes.KlDwarseMarkeringVerschuindCode import KlDwarseMarkeringVerschuindCode from OTLMOW.OTLModel.Datatypes.KlDwarseMarkeringVerschu...
[ "OTLMOW.OTLModel.BaseClasses.OTLAttribuut.OTLAttribuut" ]
[((1049, 1364), 'OTLMOW.OTLModel.BaseClasses.OTLAttribuut.OTLAttribuut', 'OTLAttribuut', ([], {'field': 'KwantWrdInVierkanteMeter', 'naam': '"""basisoppervlakte"""', 'label': '"""oppervlakte"""', 'objectUri': '"""https://wegenenverkeer.data.vlaanderen.be/ns/onderdeel#DwarseMarkeringVerschuind.basisoppervlakte"""', 'def...
#!/usr/bin/env python3 """ Copyright 2018 Couchbase, Inc Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed ...
[ "argparse.ArgumentParser", "re.compile", "sys.stderr.flush", "requests.get", "re.finditer", "time.time" ]
[((2443, 2468), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (2466, 2468), False, 'import argparse\n'), ((5095, 5106), 'time.time', 'time.time', ([], {}), '()\n', (5104, 5106), False, 'import time\n'), ((5926, 5944), 'sys.stderr.flush', 'sys.stderr.flush', ([], {}), '()\n', (5942, 5944), Fals...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('projects', '0003_auto_20150123_1148'), ] operations = [ migrations.AlterField( model_name='project', ...
[ "django.db.models.CharField" ]
[((368, 493), 'django.db.models.CharField', 'models.CharField', ([], {'default': "b'auth'", 'max_length': '(20)', 'choices': "[(b'true', b'true'), (b'auth', b'auth'), (b'false', b'false')]"}), "(default=b'auth', max_length=20, choices=[(b'true', b'true'\n ), (b'auth', b'auth'), (b'false', b'false')])\n", (384, 493),...
""" nginterface.py: NovaGenesis Interface """ __author__ = "<NAME>" __copyright__ = "Copyright 2016, CogRIoT Project" __credits__ = "<NAME>" __license__ = "MIT" __maintainer__ = "<NAME>" __email__ = "<EMAIL>" import sys import zmq import threading from bzrlib.plugins.launchpad.lp_api_lite import json sys.path.appen...
[ "bzrlib.plugins.launchpad.lp_api_lite.json.dumps", "sys.path.append", "threading.Thread", "utils.logmsgs.logger.Logger", "zmq.Context" ]
[((306, 331), 'sys.path.append', 'sys.path.append', (['"""../../"""'], {}), "('../../')\n", (321, 331), False, 'import sys\n'), ((1050, 1065), 'utils.logmsgs.logger.Logger', 'logger.Logger', ([], {}), '()\n', (1063, 1065), False, 'from utils.logmsgs import logger\n'), ((1180, 1193), 'zmq.Context', 'zmq.Context', ([], {...
# # This source file is part of the EdgeDB open source project. # # Copyright 2016-present MagicStack Inc. and the EdgeDB authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http...
[ "edgedb.connect", "edgedb.async_connect", "socket.socket" ]
[((964, 1013), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_STREAM'], {}), '(socket.AF_INET, socket.SOCK_STREAM)\n', (977, 1013), False, 'import socket\n'), ((2349, 2376), 'edgedb.connect', 'edgedb.connect', ([], {}), '(**conn_args)\n', (2363, 2376), False, 'import edgedb\n'), ((2597, 2624), 'edge...
#!/usr/bin/env python3 """pdoc's CLI interface and helper functions.""" import argparse import ast import importlib import inspect import os import os.path as path import json import re import sys import warnings from contextlib import contextmanager from functools import lru_cache from http.server import BaseHTTPRequ...
[ "pdoc.tpl_lookup.directories.insert", "http.server.HTTPServer", "argparse.Namespace", "sys.exit", "sys.path.append", "pdoc.html", "pdoc._URL_PACKAGE_SUFFIX.lstrip", "importlib.invalidate_caches", "argparse.ArgumentParser", "textwrap.indent", "os.path.lexists", "os.path.isdir", "os.unlink", ...
[((432, 621), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Automatically generate API docs for Python modules."""', 'epilog': '"""Further documentation is available at <https://pdoc3.github.io/pdoc/doc>."""'}), "(description=\n 'Automatically generate API docs for Python modules.', ...
# =========================================================================== # # DATA EXPLORER # # =========================================================================== # # =========================================================================== # ...
[ "textwrap.dedent", "dash_core_components.Graph", "sklearn.datasets.make_regression", "pandas.read_csv", "dash_html_components.A", "dash_core_components.Tab", "ml_studio.utils.visual.NamedDropdown", "sklearn.datasets.fetch_california_housing", "dash_html_components.Img", "warnings.warn", "sys.pat...
[((2556, 2584), 'sys.path.append', 'sys.path.append', (['"""ml_studio"""'], {}), "('ml_studio')\n", (2571, 2584), False, 'import sys\n'), ((2585, 2626), 'sys.path.append', 'sys.path.append', (['"""ml_studio/utils/visual"""'], {}), "('ml_studio/utils/visual')\n", (2600, 2626), False, 'import sys\n'), ((3826, 3880), 'das...
# # Copyright (c) 2013 <NAME>, Inc. All rights reserved. # from setuptools import setup, find_packages setup( name='alarm_process_connectivity', version='0.1dev', packages=find_packages(), entry_points = { 'contrail.analytics.alarms': [ 'ObjectCollectorInfo = alarm_process_connecti...
[ "setuptools.find_packages" ]
[((186, 201), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (199, 201), False, 'from setuptools import setup, find_packages\n')]
""" Base class for fenpei job; this should be considered abstract. Your custom job(s) should inherit from this job and extend the relevant methods, such as:: * is_prepared * is_complete * prepare * start * result * summary """ from re import match from sys import stdout from bardeen.system import mkdirp from time i...
[ "os.path.join", "re.match", "sys.stdout.write", "os.remove", "os.path.isdir", "shutil.rmtree", "time.time", "bardeen.system.mkdirp" ]
[((1400, 1435), 're.match', 'match', (['"""^\\\\w[/\\\\w\\\\.\\\\+_-]*$"""', 'name'], {}), "('^\\\\w[/\\\\w\\\\.\\\\+_-]*$', name)\n", (1405, 1435), False, 'from re import match\n'), ((1660, 1697), 're.match', 'match', (['"""^\\\\w[\\\\w\\\\._-]*$"""', 'batch_name'], {}), "('^\\\\w[\\\\w\\\\._-]*$', batch_name)\n", (16...
""" This file is part of nucypher. nucypher is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. nucypher is distributed in the hope that it wil...
[ "twisted.internet.threads.deferToThread", "pytest.fail", "functools.partial", "nucypher.network.middleware.RestMiddleware", "maya.now" ]
[((995, 1109), 'functools.partial', 'partial', (['make_federated_ursulas'], {'ursula_config': 'ursula_federated_test_config', 'quantity': '(1)', 'know_each_other': '(False)'}), '(make_federated_ursulas, ursula_config=ursula_federated_test_config,\n quantity=1, know_each_other=False)\n', (1002, 1109), False, 'from fu...
import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.utils.rnn import pad_packed_sequence import pdb import math torch.manual_seed(1) class GRUAudio(nn.Module): def __init__(self, num_features, hidden_dim, num_layers, dropout_rate, num_labels, batch_size, bidirectional=False): ...
[ "torch.max", "math.sqrt", "torch.nn.BatchNorm1d", "torch.cuda.is_available", "torch.ByteTensor", "torch.nn.functional.softmax", "torch.nn.GRU", "torch.nn.MaxPool1d", "torch.tanh", "torch.mean", "torch.unsqueeze", "torch.nn.LSTM", "torch.matmul", "torch.nn.utils.rnn.pad_packed_sequence", ...
[((141, 161), 'torch.manual_seed', 'torch.manual_seed', (['(1)'], {}), '(1)\n', (158, 161), False, 'import torch\n'), ((1322, 1411), 'torch.randn', 'torch.randn', (['(self.num_layers * self.num_directions)', 'self.batch_size', 'self.hidden_dim'], {}), '(self.num_layers * self.num_directions, self.batch_size, self.\n ...
# Copyright 2021 TileDB Inc. # Licensed under the MIT License. import numpy as np import pytest from tiledb.cf.netcdf_engine._utils import get_netcdf_metadata, get_unpacked_dtype netCDF4 = pytest.importorskip("netCDF4") @pytest.mark.parametrize( "input_dtype,scale_factor,add_offset,output_dtype", ( ...
[ "tiledb.cf.netcdf_engine._utils.get_unpacked_dtype", "numpy.float64", "numpy.int32", "pytest.mark.parametrize", "numpy.array", "pytest.importorskip", "tiledb.cf.netcdf_engine._utils.get_netcdf_metadata", "pytest.raises", "numpy.float32", "pytest.warns" ]
[((191, 221), 'pytest.importorskip', 'pytest.importorskip', (['"""netCDF4"""'], {}), "('netCDF4')\n", (210, 221), False, 'import pytest\n'), ((2153, 2202), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""value"""', "(('',), (1, 2))"], {}), "('value', (('',), (1, 2)))\n", (2176, 2202), False, 'import pytest\...
#!/usr/bin/env python import os import numpy as np import html from bs4 import BeautifulSoup import bibtexparser from bibtexparser.bparser import BibTexParser from bibtexparser.customization import convert_to_unicode import eyed3 from tokenizer import MyTokenizer # acronyms to spell out acronyms = [ 'LES', ...
[ "os.makedirs", "tokenizer.MyTokenizer", "os.path.join", "html.unescape", "os.path.split", "bibtexparser.bparser.BibTexParser", "os.path.isfile", "gtts.gTTS", "eyed3.load", "sys.exit", "bibtexparser.load" ]
[((558, 620), 'os.path.join', 'os.path.join', (["os.environ['HOME']", '"""Music"""', '"""Article Abstracts"""'], {}), "(os.environ['HOME'], 'Music', 'Article Abstracts')\n", (570, 620), False, 'import os\n'), ((693, 726), 'bibtexparser.bparser.BibTexParser', 'BibTexParser', ([], {'common_strings': '(True)'}), '(common_...
"""This module contains the views exposed to the user.""" from django.http import HttpResponse from rest_framework.decorators import api_view from rest_framework.request import Request from api.view_handlers import ( handle_get_trained_city_model, handle_persist_sight_image, handle_add_new_city, handle_...
[ "django.http.HttpResponse", "rest_framework.decorators.api_view", "api.view_handlers.handle_get_supported_cities" ]
[((411, 428), 'rest_framework.decorators.api_view', 'api_view', (["['GET']"], {}), "(['GET'])\n", (419, 428), False, 'from rest_framework.decorators import api_view\n'), ((926, 943), 'rest_framework.decorators.api_view', 'api_view', (["['GET']"], {}), "(['GET'])\n", (934, 943), False, 'from rest_framework.decorators im...
import os import pytest from dsplot.errors import InputException from dsplot.tree import BinaryTree def test_binary_tree(): tree = BinaryTree(nodes=[5, 4, 8, 11, None, 13, 4, 7, 2, None, None, 5, 1]) assert tree.root.val == 5 assert tree.root.right.left.val == 13 assert tree.root.right.right.left.v...
[ "os.listdir", "dsplot.tree.BinaryTree", "pytest.raises" ]
[((139, 207), 'dsplot.tree.BinaryTree', 'BinaryTree', ([], {'nodes': '[5, 4, 8, 11, None, 13, 4, 7, 2, None, None, 5, 1]'}), '(nodes=[5, 4, 8, 11, None, 13, 4, 7, 2, None, None, 5, 1])\n', (149, 207), False, 'from dsplot.tree import BinaryTree\n'), ((586, 615), 'os.listdir', 'os.listdir', (['"""tests/test_data"""'], {}...
import sys sys.path.insert(1,"../../") import h2o from tests import pyunit_utils from h2o.estimators.gbm import H2OGradientBoostingEstimator from h2o.utils.model_utils import reset_model_threshold def test_reset_threshold(): """ Test the model threshold can be reset. Performance metric should be recalc...
[ "h2o.get_model", "sys.path.insert", "tests.pyunit_utils.locate", "h2o.utils.model_utils.reset_model_threshold", "h2o.estimators.gbm.H2OGradientBoostingEstimator", "tests.pyunit_utils.standalone_test" ]
[((11, 39), 'sys.path.insert', 'sys.path.insert', (['(1)', '"""../../"""'], {}), "(1, '../../')\n", (26, 39), False, 'import sys\n'), ((1197, 1246), 'h2o.estimators.gbm.H2OGradientBoostingEstimator', 'H2OGradientBoostingEstimator', ([], {'seed': '(1234)', 'ntrees': '(5)'}), '(seed=1234, ntrees=5)\n', (1225, 1246), Fals...
#!/usr/bin/python import argparse import csv import sys ''' This script takes a CSV file with a mandatory header and a sql tablename and converts the data in the csv file into an SQL INSERT statement. ''' def parse_arguments(): # initialize argumentparser and arguments parser = argparse.ArgumentParser(descri...
[ "argparse.FileType", "csv.reader", "argparse.ArgumentParser", "sys.stdout.write" ]
[((290, 402), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Takes a csv file and a tablename and creates an SQL insert statement"""'}), "(description=\n 'Takes a csv file and a tablename and creates an SQL insert statement')\n", (313, 402), False, 'import argparse\n'), ((940, 1002), ...
from flask import Flask from flask import render_template app = Flask(__name__) @app.route('/') def hello_world(): return render_template('index.html') @app.route('/index') def index(): return render_template('index.html') @app.route('/contact') def contact(): return render_template('contact.html') @a...
[ "flask.render_template", "flask.Flask" ]
[((65, 80), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (70, 80), False, 'from flask import Flask\n'), ((129, 158), 'flask.render_template', 'render_template', (['"""index.html"""'], {}), "('index.html')\n", (144, 158), False, 'from flask import render_template\n'), ((205, 234), 'flask.render_template',...
from django.db import models from django_countries.fields import CountryField from django.db.models.deletion import CASCADE class Author(models.Model): name = models.CharField(max_length=60) nationality = CountryField() class Book(models.Model): name = models.CharField(max_length=60) description = m...
[ "django.db.models.DateField", "django.db.models.TextField", "django_countries.fields.CountryField", "django.db.models.ForeignKey", "django.db.models.CharField" ]
[((165, 196), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(60)'}), '(max_length=60)\n', (181, 196), False, 'from django.db import models\n'), ((215, 229), 'django_countries.fields.CountryField', 'CountryField', ([], {}), '()\n', (227, 229), False, 'from django_countries.fields import CountryF...
from ..utils import pad_left, try_parse_int from datetime import timedelta from typing import Dict, List TIME_PARTS: List[str] = [ "D", "H", "M", "S" ] FIXED_INTERVALS: Dict[str, timedelta] = { "WEEK": timedelta(weeks=1), "DAY": timedelta(days=1), "HOUR": timedelta(hours=1) } def parse_interval(value: str...
[ "datetime.timedelta" ]
[((207, 225), 'datetime.timedelta', 'timedelta', ([], {'weeks': '(1)'}), '(weeks=1)\n', (216, 225), False, 'from datetime import timedelta\n'), ((238, 255), 'datetime.timedelta', 'timedelta', ([], {'days': '(1)'}), '(days=1)\n', (247, 255), False, 'from datetime import timedelta\n'), ((269, 287), 'datetime.timedelta', ...
#* #* Copyright (C) 2017-2019 Alibaba Group Holding Limited #* #* 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 ...
[ "os.path.exists", "os.makedirs", "argparse.ArgumentParser", "os.path.join", "os.path.splitext", "os.path.realpath", "os.path.basename", "os.system" ]
[((679, 743), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Generate conformanc tests"""'}), "(description='Generate conformanc tests')\n", (702, 743), False, 'import argparse\n'), ((1170, 1244), 'os.system', 'os.system', (['"""cp ../include/onnx_*.td -r . | cp ../include/*.algorithm -r...
import pytest import sqlalchemy as sa class ThreeLevelDeepOneToOne(object): @pytest.fixture def Catalog(self, Base, Category): class Catalog(Base): __tablename__ = 'catalog' id = sa.Column('_id', sa.Integer, primary_key=True) category = sa.orm.relationship( ...
[ "sqlalchemy.orm.relationship", "sqlalchemy.ForeignKey", "sqlalchemy.Column" ]
[((222, 268), 'sqlalchemy.Column', 'sa.Column', (['"""_id"""', 'sa.Integer'], {'primary_key': '(True)'}), "('_id', sa.Integer, primary_key=True)\n", (231, 268), True, 'import sqlalchemy as sa\n'), ((292, 355), 'sqlalchemy.orm.relationship', 'sa.orm.relationship', (['Category'], {'uselist': '(False)', 'backref': '"""cat...
# 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...
[ "gbpservice.nfp.core.log.getLogger", "httplib.HTTPConnection.__init__", "socket.socket", "zlib.compress", "oslo_serialization.jsonutils.dumps", "httplib2.Http", "six.moves.urllib.parse.urlunsplit", "zlib.decompress" ]
[((792, 823), 'gbpservice.nfp.core.log.getLogger', 'nfp_logging.getLogger', (['__name__'], {}), '(__name__)\n', (813, 823), True, 'from gbpservice.nfp.core import log as nfp_logging\n'), ((1134, 1191), 'httplib.HTTPConnection.__init__', 'httplib.HTTPConnection.__init__', (['self', 'host', 'port', 'strict'], {}), '(self...
'''Robot sim with a nicer display.''' from sim_framework import * from math import radians import tkinter BACKGROUND_COLOR = 'grey60' ENTITY_COLOR = 'RoyalBlue1' OBSTACLE_COLOR = 'black' ENTITY_TAG = 'entity' class TKWorld(World): '''A world that will display via tkinter instead of ascii.''' def __init__(self...
[ "tkinter.Canvas", "tkinter.Tk", "math.radians" ]
[((3303, 3315), 'tkinter.Tk', 'tkinter.Tk', ([], {}), '()\n', (3313, 3315), False, 'import tkinter\n'), ((3591, 3601), 'math.radians', 'radians', (['(0)'], {}), '(0)\n', (3598, 3601), False, 'from math import radians\n'), ((868, 982), 'tkinter.Canvas', 'tkinter.Canvas', (['self.root'], {'bg': 'BACKGROUND_COLOR', 'heigh...
""" Here all the blog's urls routes will be mapped """ from django.urls import path from django.conf.urls import include, url from . import views app_name = 'core' urlpatterns = [ # path('', views.home, name='home-page'), url(r'^api/', include('apps.core.api.urls', namespace='api')), ]
[ "django.conf.urls.include" ]
[((246, 292), 'django.conf.urls.include', 'include', (['"""apps.core.api.urls"""'], {'namespace': '"""api"""'}), "('apps.core.api.urls', namespace='api')\n", (253, 292), False, 'from django.conf.urls import include, url\n')]
from env import MsnDiscrete, MaplessNaviEnv from robot_utils import * from robot_utils.log import msn_debug from robot_utils.scene import * from env import * from collections import Counter MAX_FORCE = 10. TARGET_VELOCITY = 5. MULTIPLY = 2.0 def keyboard_control(): global MAX_FORCE global TARGET_VELOCITY ...
[ "env.MsnDiscrete" ]
[((1315, 1353), 'env.MsnDiscrete', 'MsnDiscrete', ([], {'render': '(True)', 'laser_num': '(18)'}), '(render=True, laser_num=18)\n', (1326, 1353), False, 'from env import MsnDiscrete, MaplessNaviEnv\n')]
#!/usr/bin/env python # -*- coding:utf-8 -*- """================================================================= @Project : Algorithm_YuweiYin/LeetCode-All-Solution/Python3 @File : LC-1728-Cat-and-Mouse-II.py @Author : [YuweiYin](https://github.com/YuweiYin) @Date : 2022-05-10 ==================================...
[ "time.process_time", "collections.deque" ]
[((11395, 11414), 'time.process_time', 'time.process_time', ([], {}), '()\n', (11412, 11414), False, 'import time\n'), ((11482, 11501), 'time.process_time', 'time.process_time', ([], {}), '()\n', (11499, 11501), False, 'import time\n'), ((6084, 6103), 'collections.deque', 'collections.deque', ([], {}), '()\n', (6101, 6...
from django.urls import path from . import views urlpatterns = [ path('checkout/', views.checkout), path('orders/', views.OrdersList.as_view()), ]
[ "django.urls.path" ]
[((71, 104), 'django.urls.path', 'path', (['"""checkout/"""', 'views.checkout'], {}), "('checkout/', views.checkout)\n", (75, 104), False, 'from django.urls import path\n')]
# # Copyright (c) 2019 <NAME> # # Licensed under MIT License (MIT) # # 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 # ...
[ "PyQt5.QtWidgets.QWidget", "PyQt5.QtWidgets.QGridLayout", "PyQt5.QtWidgets.QScrollArea.__init__" ]
[((1653, 1679), 'PyQt5.QtWidgets.QScrollArea.__init__', 'QScrollArea.__init__', (['self'], {}), '(self)\n', (1673, 1679), False, 'from PyQt5.QtWidgets import QScrollArea, QWidget, QGridLayout\n'), ((1866, 1875), 'PyQt5.QtWidgets.QWidget', 'QWidget', ([], {}), '()\n', (1873, 1875), False, 'from PyQt5.QtWidgets import QS...
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import json import os import random import time import uuid import pyrax from pyrax.autoscale import AutoScaleClient from pyrax.autoscale import AutoScalePolicy from pyrax.autoscale import AutoScaleWebhook from pyrax.autoscale import Sca...
[ "pyrax.exceptions.AuthenticationFailed", "pyrax.utils.random_unicode", "random.choice", "pyrax.utils.add_method", "json.dumps", "time.sleep", "uuid.uuid4", "pyrax.utils.DotDict", "pyrax.utils.random_ascii", "random.randint" ]
[((5825, 5847), 'pyrax.utils.random_unicode', 'utils.random_unicode', ([], {}), '()\n', (5845, 5847), True, 'import pyrax.utils as utils\n'), ((12783, 12805), 'pyrax.utils.random_unicode', 'utils.random_unicode', ([], {}), '()\n', (12803, 12805), True, 'import pyrax.utils as utils\n'), ((6150, 6172), 'pyrax.utils.rando...
#! /usr/bin/env python3 ## Copyright 2018 <NAME> <<EMAIL>> ## Copyright 2016 <NAME> <<EMAIL>> ## ## 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/LIC...
[ "os.path.realpath", "os.path.join", "sys.exit" ]
[((763, 789), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (779, 789), False, 'import os\n'), ((1726, 1737), 'sys.exit', 'sys.exit', (['(2)'], {}), '(2)\n', (1734, 1737), False, 'import sys\n'), ((806, 845), 'os.path.join', 'os.path.join', (['scriptdir', '"""template.lua"""'], {}), "(scri...
import unittest from geometry.point import Point class TestPoint(unittest.TestCase): def get_points(self): return [ Point(0, 0), Point(1, 1), Point(0, 1), Point(-1, 1), Point(-1, 0), Point(-1, -1), Point(1, -1) ]...
[ "unittest.main", "geometry.point.Point" ]
[((772, 787), 'unittest.main', 'unittest.main', ([], {}), '()\n', (785, 787), False, 'import unittest\n'), ((144, 155), 'geometry.point.Point', 'Point', (['(0)', '(0)'], {}), '(0, 0)\n', (149, 155), False, 'from geometry.point import Point\n'), ((169, 180), 'geometry.point.Point', 'Point', (['(1)', '(1)'], {}), '(1, 1)...
import yaml import os, errno import json def load_config(path): config = None with open(path, 'r') as config_file: config = yaml.load(config_file) return config def createSensorConfigs(topicSensors): sensors = [] count = 0 for i in range(topicSensors['nb']): config = {} ...
[ "json.dump", "yaml.load", "os.makedirs" ]
[((141, 163), 'yaml.load', 'yaml.load', (['config_file'], {}), '(config_file)\n', (150, 163), False, 'import yaml\n'), ((1154, 1176), 'os.makedirs', 'os.makedirs', (['"""sensors"""'], {}), "('sensors')\n", (1165, 1176), False, 'import os, errno\n'), ((1902, 1924), 'os.makedirs', 'os.makedirs', (['"""sensors"""'], {}), ...
from .backend import Backend from .circuitbyqiskit import CircuitByQiskit from .circuitbyprojectq import CircuitByProjectq from .circuitbycirq import CircuitByCirq from .circuitbyqulacs import CircuitByQulacs # from .circuitbytket import CircuitByTket from .circuitbytensor import CircuitByTensor from .circuitbyq...
[ "warnings.filterwarnings" ]
[((363, 396), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (386, 396), False, 'import warnings\n')]
from statistics import mean from collections import defaultdict from cloudpredictionframework.anomaly_detection.algorithms.base_algorithm import BaseAlgorithm class HybridAlgorithm(BaseAlgorithm): def __init__(self, filters: [BaseAlgorithm], min_confidence=0.8): super().__init__() self._filters...
[ "statistics.mean", "collections.defaultdict" ]
[((1033, 1118), 'statistics.mean', 'mean', (['[(1 if i == self.states.overutil_anomaly else 0) for i in combined_states]'], {}), '([(1 if i == self.states.overutil_anomaly else 0) for i in combined_states]\n )\n', (1037, 1118), False, 'from statistics import mean\n'), ((425, 448), 'collections.defaultdict', 'default...
# vim:ts=4 sw=4 expandtab softtabstop=4 from jsonmerge.exceptions import HeadInstanceError, \ BaseInstanceError, \ SchemaError import jsonschema import re class Strategy(object): """Base class for merge strategies. """ def merge(self, walk,...
[ "jsonmerge.exceptions.BaseInstanceError", "jsonmerge.exceptions.SchemaError", "jsonmerge.exceptions.HeadInstanceError", "re.search" ]
[((4894, 4966), 'jsonmerge.exceptions.HeadInstanceError', 'HeadInstanceError', (['"""Head for an \'append\' merge strategy is not an array"""'], {}), '("Head for an \'append\' merge strategy is not an array")\n', (4911, 4966), False, 'from jsonmerge.exceptions import HeadInstanceError, BaseInstanceError, SchemaError\n'...
# -*- coding: utf-8 -*- __version__ = '$Id: 024580a7ff506aa3cbda6d46122b84b1603a6c05 $' from pywikibot import family # Omegawiki, the Ultimate online dictionary class Family(family.Family): def __init__(self): family.Family.__init__(self) self.name = 'omegawiki' self.langs['omegawiki']...
[ "pywikibot.family.Family.__init__" ]
[((228, 256), 'pywikibot.family.Family.__init__', 'family.Family.__init__', (['self'], {}), '(self)\n', (250, 256), False, 'from pywikibot import family\n')]
import os import sys import shutil import glob import time import multiprocessing as mp if len(sys.argv)!=4: print("Usage: ") print("python extract_features_WORLD.py <path_to_wav_dir> <path_to_feat_dir> <sampling rate>") sys.exit(1) # top currently directory current_dir = os.getcwd() # input audio direct...
[ "os.path.exists", "os.listdir", "os.path.join", "multiprocessing.cpu_count", "os.getcwd", "os.path.isfile", "os.path.isdir", "os.mkdir", "os.path.basename", "sys.exit", "os.system", "time.time" ]
[((287, 298), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (296, 298), False, 'import os\n'), ((465, 509), 'os.path.join', 'os.path.join', (['current_dir', '"""tools/bin/WORLD"""'], {}), "(current_dir, 'tools/bin/WORLD')\n", (477, 509), False, 'import os\n'), ((518, 566), 'os.path.join', 'os.path.join', (['current_dir',...
from session.abstract_class import PysparkPro class DslAdaptor(object): pysparkpro = PysparkPro() select = 'SELECT' insert = 'INSERT' delete = 'DELETE' update = 'UPDATE' alert = 'ALERT' create_table = 'CREATETABLE' drop_table = 'DROPTABLE' create_index = 'CREATEINDEX' drop_inde...
[ "session.abstract_class.PysparkPro" ]
[((91, 103), 'session.abstract_class.PysparkPro', 'PysparkPro', ([], {}), '()\n', (101, 103), False, 'from session.abstract_class import PysparkPro\n')]
import socket def connect(server, port): # open a connection to vulnserver s = socket.socket (socket.AF_INET, socket.SOCK_STREAM) s.connect ((server, port)) return s def read_until(s, delim=b':'): buf = b'' while not buf.endswith(delim): buf += s.recv(1) return buf def overflo...
[ "socket.socket" ]
[((88, 137), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_STREAM'], {}), '(socket.AF_INET, socket.SOCK_STREAM)\n', (101, 137), False, 'import socket\n')]
#!/usr/bin/env python """html in standard nbconvert format """ from ipypublish.html.create_tpl import create_tpl from ipypublish.html.standard import content from ipypublish.html.standard import content_tagging from ipypublish.html.standard import document from ipypublish.html.standard import inout_prompt from ipypubl...
[ "ipypublish.html.create_tpl.create_tpl" ]
[((439, 577), 'ipypublish.html.create_tpl.create_tpl', 'create_tpl', (['[document.tpl_dict, content.tpl_dict, content_tagging.tpl_dict, mathjax.\n tpl_dict, widgets.tpl_dict, inout_prompt.tpl_dict]'], {}), '([document.tpl_dict, content.tpl_dict, content_tagging.tpl_dict,\n mathjax.tpl_dict, widgets.tpl_dict, inou...
from logging import raiseExceptions from typing import List from fastapi import APIRouter,Depends,HTTPException, Response,status from sqlalchemy.orm.session import Session from .. database import get_db from .. import models,schemas ,oauth2 router=APIRouter( prefix='/posts', tags=['Post'] ) @router.get('/'...
[ "fastapi.HTTPException", "fastapi.APIRouter", "fastapi.Response", "fastapi.Depends" ]
[((251, 292), 'fastapi.APIRouter', 'APIRouter', ([], {'prefix': '"""/posts"""', 'tags': "['Post']"}), "(prefix='/posts', tags=['Post'])\n", (260, 292), False, 'from fastapi import APIRouter, Depends, HTTPException, Response, status\n'), ((385, 400), 'fastapi.Depends', 'Depends', (['get_db'], {}), '(get_db)\n', (392, 40...
import nose.tools import unittest import os import json import pandas as pd import numpy as np import mia from mia.io_tools import * from ..test_utils import get_file_path class IOTests(unittest.TestCase): @classmethod def setupClass(cls): cls._output_files = [] @classmethod def teardownCla...
[ "numpy.ones", "os.path.join", "os.path.isfile", "numpy.zeros", "json.load", "os.remove" ]
[((380, 397), 'os.path.isfile', 'os.path.isfile', (['f'], {}), '(f)\n', (394, 397), False, 'import os\n'), ((683, 713), 'os.path.join', 'os.path.join', (['img_directory', 'p'], {}), '(img_directory, p)\n', (695, 713), False, 'import os\n'), ((1233, 1263), 'os.path.join', 'os.path.join', (['img_directory', 'p'], {}), '(...
# Vax-Man, a re-implementation of Pacman, in Python, with PyGame. # Forked from: https://github.com/hbokmann/Pacman # Edited by <NAME> (2021) # Video link: https://youtu.be/ZrqZEC6DvMc import time import pygame # Ghosts multiply themselves every thirty seconds. GHOST_MULTIPLICATION_TIME_GAP = 30 # Thirty-two times...
[ "pygame.init", "pygame.quit", "pygame.font.Font", "pygame.display.set_mode", "pygame.display.flip", "pygame.display.set_icon", "pygame.font.init", "pygame.image.load", "pygame.mixer.music.load", "pygame.sprite.spritecollide", "pygame.Surface", "pygame.draw.ellipse", "pygame.time.Clock", "p...
[((531, 573), 'pygame.image.load', 'pygame.image.load', (['"""images/Vaxman_Big.png"""'], {}), "('images/Vaxman_Big.png')\n", (548, 573), False, 'import pygame\n'), ((574, 610), 'pygame.display.set_icon', 'pygame.display.set_icon', (['Vaxman_icon'], {}), '(Vaxman_icon)\n', (597, 610), False, 'import pygame\n'), ((817, ...
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import numpy as np from maro.rl import AbstractStateShaper class ECRStateShaper(AbstractStateShaper): def __init__(self, *, look_back, max_ports_downstream, port_attributes, vessel_attributes): super().__init__() self._look_...
[ "numpy.concatenate" ]
[((1172, 1220), 'numpy.concatenate', 'np.concatenate', (['(port_features, vessel_features)'], {}), '((port_features, vessel_features))\n', (1186, 1220), True, 'import numpy as np\n')]
from os import listdir from os.path import join, isfile import json from random import randint ######################################### ## START of part that students may change from code_completion_baseline import Code_Completion_Baseline training_dir = "./../../programs_800/" query_dir = "./../../programs_200/" m...
[ "os.path.join", "os.listdir", "code_completion_baseline.Code_Completion_Baseline", "random.randint" ]
[((2010, 2036), 'code_completion_baseline.Code_Completion_Baseline', 'Code_Completion_Baseline', ([], {}), '()\n', (2034, 2036), False, 'from code_completion_baseline import Code_Completion_Baseline\n'), ((1316, 1341), 'random.randint', 'randint', (['(1)', 'max_hole_size'], {}), '(1, max_hole_size)\n', (1323, 1341), Fa...
from flask import Flask, render_template from config import configs from .extensions import login_manager, db from .account import account from .frontend import frontend from webapp.session import RedisSessionInterface def create_app(config_name): app = Flask(__name__) app.config.from_object(configs[config_n...
[ "flask.render_template", "redis.Redis", "flask.Flask" ]
[((261, 276), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (266, 276), False, 'from flask import Flask, render_template\n'), ((740, 765), 'redis.Redis', 'Redis', (['host', 'port', 'db_num'], {}), '(host, port, db_num)\n', (745, 765), False, 'from redis import Redis\n'), ((1049, 1083), 'flask.render_templ...
import pytest from pydent.models import Plan def test_plan_constructor(fake_session): g = fake_session.Plan.new() assert g.name is not None print(g.plan_associations) assert g.operations is None assert g.wires == [] g = Plan(name="MyPlan", status="running") assert g.name == "MyPlan" ...
[ "pytest.fixture", "pydent.models.Plan" ]
[((979, 1011), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""function"""'}), "(scope='function')\n", (993, 1011), False, 'import pytest\n'), ((248, 285), 'pydent.models.Plan', 'Plan', ([], {'name': '"""MyPlan"""', 'status': '"""running"""'}), "(name='MyPlan', status='running')\n", (252, 285), False, 'from pyde...
# -*- coding: utf-8 -*- # Generated by Django 1.11.27 on 2020-06-08 22:10 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('gymkhana', '0006_form_available'), ] operations = [ migrations.RemoveField...
[ "django.db.migrations.RemoveField", "django.db.models.CharField" ]
[((298, 360), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""form_available"""', 'name': '"""id"""'}), "(model_name='form_available', name='id')\n", (320, 360), False, 'from django.db import migrations, models\n'), ((510, 597), 'django.db.models.CharField', 'models.CharField', ([]...
import os import pygame import random trigger = False x = 0 y = 0 height = 720 width = 1280 linelength = 50 lineAmt = 20 displace = 10 xpos = [random.randrange(-200,1280) for i in range(0, lineAmt + 2)] xpos1 = [(xpos[i]+displace) for i in range(0, lineAmt + 2)] xr = 360 yr = 240 def setup(screen, etc): global trigg...
[ "pygame.draw.line", "random.randrange" ]
[((144, 172), 'random.randrange', 'random.randrange', (['(-200)', '(1280)'], {}), '(-200, 1280)\n', (160, 172), False, 'import random\n'), ((1580, 1677), 'pygame.draw.line', 'pygame.draw.line', (['screen', 'shadowColor', '(xpos1[k], y + displace)', '(x, y + displace)', 'linewidth'], {}), '(screen, shadowColor, (xpos1[k...
# (C) Copyright 2010-2020 Enthought, Inc., Austin, TX # All rights reserved. import unittest import sys import os from unittest import mock from click.testing import CliRunner import force_wfmanager.gui.run from force_wfmanager.tests.dummy_classes.dummy_wfmanager import \ DummyWfManager from force_wfmanager.ve...
[ "unittest.mock.Mock", "click.testing.CliRunner", "os.path.isfile", "force_wfmanager.tests.dummy_classes.dummy_wfmanager.DummyWfManager", "unittest.mock.patch", "os.remove" ]
[((408, 447), 'unittest.mock.Mock', 'mock.Mock', ([], {'spec': 'force_wfmanager.gui.run'}), '(spec=force_wfmanager.gui.run)\n', (417, 447), False, 'from unittest import mock\n'), ((584, 595), 'click.testing.CliRunner', 'CliRunner', ([], {}), '()\n', (593, 595), False, 'from click.testing import CliRunner\n'), ((755, 79...
from cadastrarJogador import cadastra_jogador from cadastrarMonstros import cadastra_monstro from atualizaJogador import atualiza from combate import combate_iniciado while True: print('Bem vindo ao RPG selecione a opção desenjada') print('[0] - Cadastrar Novo Jogador\n[1] - Atualizar Jogador\n[2] - Cadastrar N...
[ "combate.combate_iniciado", "cadastrarJogador.cadastra_jogador", "atualizaJogador.atualiza", "cadastrarMonstros.cadastra_monstro" ]
[((460, 478), 'cadastrarJogador.cadastra_jogador', 'cadastra_jogador', ([], {}), '()\n', (476, 478), False, 'from cadastrarJogador import cadastra_jogador\n'), ((504, 522), 'cadastrarMonstros.cadastra_monstro', 'cadastra_monstro', ([], {}), '()\n', (520, 522), False, 'from cadastrarMonstros import cadastra_monstro\n'),...
""" Custom user model for deployments. """ import urllib import hashlib import base64 import random from authtools.models import AbstractEmailUser from django.db import models from django.utils.translation import ugettext_lazy as _ from django.db.models.signals import post_save from .managers import DeployUserManage...
[ "plugin_manager.accounts.model_managers.DeployUserActiveManager", "django.utils.translation.ugettext_lazy", "random.choice", "django.db.models.ForeignKey", "django.db.models.signals.post_save.connect", "random.getrandbits", "django.db.models.CharField" ]
[((4300, 4353), 'django.db.models.signals.post_save.connect', 'post_save.connect', (['generate_APIKey'], {'sender': 'DeployUser'}), '(generate_APIKey, sender=DeployUser)\n', (4317, 4353), False, 'from django.db.models.signals import post_save\n'), ((1603, 1628), 'plugin_manager.accounts.model_managers.DeployUserActiveM...
import tensorflow as tf from tensorflow.contrib import slim def head(endpoints, embedding_dim, is_training, weights_regularizer=None): predict_var = 0 input = endpoints['model_output'] endpoints['head_output'] = slim.fully_connected( input, 1024, normalizer_fn=slim.batch_norm, normalizer_pa...
[ "tensorflow.contrib.slim.fully_connected", "tensorflow.nn.l2_normalize", "tensorflow.orthogonal_initializer" ]
[((225, 486), 'tensorflow.contrib.slim.fully_connected', 'slim.fully_connected', (['input', '(1024)'], {'normalizer_fn': 'slim.batch_norm', 'normalizer_params': "{'decay': 0.9, 'epsilon': 1e-05, 'scale': True, 'is_training': is_training,\n 'updates_collections': tf.GraphKeys.UPDATE_OPS}", 'weights_regularizer': 'wei...
from topbeat import BaseTest import os import shutil import time """ Contains tests for base config """ class Test(BaseTest): def test_invalid_config(self): """ Checks stop when input and topbeat defined """ shutil.copy("./config/topbeat-input-invalid.yml", os...
[ "os.path.join", "time.sleep" ]
[((904, 917), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (914, 917), False, 'import time\n'), ((318, 363), 'os.path.join', 'os.path.join', (['self.working_dir', '"""invalid.yml"""'], {}), "(self.working_dir, 'invalid.yml')\n", (330, 363), False, 'import os\n'), ((765, 814), 'os.path.join', 'os.path.join', (['s...
# -*- coding: utf-8 -*- import asyncio import enum import json import logging import random import time import uuid from typing import * import aiohttp import tornado.websocket import api.base import blivedm.blivedm as blivedm import config import models.avatar import models.translate import models.log logger = logg...
[ "logging.getLogger", "blivedm.blivedm.GuardBuyMessage", "json.loads", "blivedm.blivedm.GiftMessage", "json.dumps", "uuid.uuid4", "aiohttp.ClientTimeout", "config.get_config", "blivedm.blivedm.DanmakuMessage", "blivedm.blivedm.SuperChatMessage", "asyncio.get_event_loop", "time.time", "random....
[((316, 343), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (333, 343), False, 'import logging\n'), ((585, 616), 'aiohttp.ClientTimeout', 'aiohttp.ClientTimeout', ([], {'total': '(10)'}), '(total=10)\n', (606, 616), False, 'import aiohttp\n'), ((3341, 3379), 'json.dumps', 'json.dumps', (...
import argparse import os import sys import time import torch import torch.nn.functional as F import torchvision import models, lib cfg = lib.config.BaseConfig() cfg.parse() print('Preparing model') gen_model = cfg.gen_function( upsample=cfg.upsample, map_size=cfg.map_size, out_dim=cfg.out_dim) disc_model...
[ "lib.train.BaseGANTrainer", "lib.config.BaseConfig", "torch.nn.DataParallel", "lib.train.DelayLBSTrainer" ]
[((139, 162), 'lib.config.BaseConfig', 'lib.config.BaseConfig', ([], {}), '()\n', (160, 162), False, 'import models, lib\n'), ((433, 465), 'torch.nn.DataParallel', 'torch.nn.DataParallel', (['gen_model'], {}), '(gen_model)\n', (454, 465), False, 'import torch\n'), ((483, 516), 'torch.nn.DataParallel', 'torch.nn.DataPar...
from flask_restful import Resource from server.platform_properties import PLATFORM_PROPERTIES from server.resources.models.platform_properties import PlatformPropertiesSchema from server.resources.decorators import marshal_response class Platform(Resource): @marshal_response(PlatformPropertiesSchema()) def ge...
[ "server.resources.models.platform_properties.PlatformPropertiesSchema" ]
[((282, 308), 'server.resources.models.platform_properties.PlatformPropertiesSchema', 'PlatformPropertiesSchema', ([], {}), '()\n', (306, 308), False, 'from server.resources.models.platform_properties import PlatformPropertiesSchema\n'), ((344, 370), 'server.resources.models.platform_properties.PlatformPropertiesSchema...
# -*- coding: utf-8 -*- # # Copyright (C) 2020 <NAME>. # # Invenio-Flow is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """Useful decorators.""" from celery import shared_task from .api import Task def task(*args, **kwargs): "...
[ "celery.shared_task" ]
[((426, 454), 'celery.shared_task', 'shared_task', (['*args'], {}), '(*args, **kwargs)\n', (437, 454), False, 'from celery import shared_task\n')]
import sys import os import matplotlib.pylab as plt import numpy as np import mpl_toolkits.mplot3d.axes3d as p3 import seaborn as sea import torch from TorchProteinLibrary import FullAtomModel if __name__=='__main__': # p2c = FullAtomModel.PDB2Coords.PDB2CoordsBiopython() p2c = FullAtomModel.PDB2CoordsUnorde...
[ "TorchProteinLibrary.FullAtomModel.PDB2CoordsUnordered", "matplotlib.pylab.show", "matplotlib.pylab.figure" ]
[((290, 325), 'TorchProteinLibrary.FullAtomModel.PDB2CoordsUnordered', 'FullAtomModel.PDB2CoordsUnordered', ([], {}), '()\n', (323, 325), False, 'from TorchProteinLibrary import FullAtomModel\n'), ((575, 587), 'matplotlib.pylab.figure', 'plt.figure', ([], {}), '()\n', (585, 587), True, 'import matplotlib.pylab as plt\n...
""" Copyright (c) Facebook, Inc. and its affiliates. """ import logging import queue from multiprocessing import Queue, Process import sys import os from mc_memory_nodes import InstSegNode, PropSegNode from heuristic_perception import all_nearby_objects from shapes import get_bounds VISION_DIR = os.path.dirname(os.pa...
[ "build_utils.blocks_list_to_npy", "heuristic_perception.all_nearby_objects", "mc_memory_nodes.InstSegNode.create", "os.path.join", "shapes.get_bounds", "os.path.realpath", "semseg_models.SemSegWrapper", "multiprocessing.Queue", "sys.path.append" ]
[((361, 392), 'os.path.join', 'os.path.join', (['VISION_DIR', '"""../"""'], {}), "(VISION_DIR, '../')\n", (373, 392), False, 'import os\n'), ((406, 456), 'os.path.join', 'os.path.join', (['VISION_DIR', '"""semantic_segmentation/"""'], {}), "(VISION_DIR, 'semantic_segmentation/')\n", (418, 456), False, 'import os\n'), (...
""" Pure-Python implementation of a Python 2-like str object for Python 3. """ from numbers import Integral from past.utils import PY2, with_metaclass if PY2: from collections import Iterable else: from collections.abc import Iterable _builtin_bytes = bytes class BaseOldStr(type): def __instancecheck_...
[ "past.utils.with_metaclass" ]
[((725, 767), 'past.utils.with_metaclass', 'with_metaclass', (['BaseOldStr', '_builtin_bytes'], {}), '(BaseOldStr, _builtin_bytes)\n', (739, 767), False, 'from past.utils import PY2, with_metaclass\n')]
#!/usr/bin/env python # -*- coding: utf-8 -*- from datetime import datetime from sqlalchemy.event import listen from app.factory import db class BaseModel(db.Model): """ Base model with `created_at` and `updated_at` fields """ __abstract__ = True fields_to_serialize = [] created_at = db.Col...
[ "sqlalchemy.event.listen", "app.factory.db.Column", "app.factory.db.session.delete", "datetime.datetime.now", "app.factory.db.session.add", "app.factory.db.session.commit" ]
[((1157, 1207), 'sqlalchemy.event.listen', 'listen', (['BaseModel', '"""before_update"""', 'set_updated_at'], {}), "(BaseModel, 'before_update', set_updated_at)\n", (1163, 1207), False, 'from sqlalchemy.event import listen\n'), ((314, 377), 'app.factory.db.Column', 'db.Column', (['db.DateTime'], {'nullable': '(False)',...
""" Raw HTML widget. Adapted/copied from https://github.com/makukha/cmsplugin-raw-html """ from cms.plugin_base import CMSPluginBase from cms.plugin_pool import plugin_pool from django.template import Template from django.utils.safestring import mark_safe from .models import RawHtmlModel, CMSMember from django.utils....
[ "django.utils.translation.ugettext", "django.template.Template", "cms.plugin_pool.plugin_pool.register_plugin" ]
[((707, 749), 'cms.plugin_pool.plugin_pool.register_plugin', 'plugin_pool.register_plugin', (['RawHtmlPlugin'], {}), '(RawHtmlPlugin)\n', (734, 749), False, 'from cms.plugin_pool import plugin_pool\n'), ((1324, 1365), 'cms.plugin_pool.plugin_pool.register_plugin', 'plugin_pool.register_plugin', (['MemberPlugin'], {}), ...
from unittest import TestCase, mock import pytest from requests import Response import aftership class TrackingTestCase(TestCase): def setUp(self): self.slug = "4px" self.tracking_number = "HH19260817" self.tracking_id = "k5lh7dy7vvqeck71p5loe011" @pytest.mark.vcr() def test_cre...
[ "aftership.tracking.get_tracking", "aftership.tracking.retrack", "aftership.tracking.update_tracking", "aftership.tracking.create_tracking", "pytest.mark.vcr", "aftership.tracking.get_last_checkpoint", "aftership.tracking.list_trackings" ]
[((286, 303), 'pytest.mark.vcr', 'pytest.mark.vcr', ([], {}), '()\n', (301, 303), False, 'import pytest\n'), ((493, 510), 'pytest.mark.vcr', 'pytest.mark.vcr', ([], {}), '()\n', (508, 510), False, 'import pytest\n'), ((822, 839), 'pytest.mark.vcr', 'pytest.mark.vcr', ([], {}), '()\n', (837, 839), False, 'import pytest\...
from __future__ import division import numpy as np __all__ = ['subtract_CAR', 'subtract_common_median_reference'] def subtract_CAR(X, b_size=16): """ Compute and subtract common average reference in 16 channel blocks. """ channels, time_points = X.shape s = channels // b_size r = ...
[ "numpy.nanmean", "numpy.nanmedian" ]
[((431, 469), 'numpy.nanmean', 'np.nanmean', (['X_1'], {'axis': '(1)', 'keepdims': '(True)'}), '(X_1, axis=1, keepdims=True)\n', (441, 469), True, 'import numpy as np\n'), ((1105, 1154), 'numpy.nanmedian', 'np.nanmedian', (['X'], {'axis': 'channel_axis', 'keepdims': '(True)'}), '(X, axis=channel_axis, keepdims=True)\n'...
################################################################################################################ # Author: <NAME> # <EMAIL> ################################################################################################################ import numpy as np import os from utils import * from tqdm import t...
[ "argparse.ArgumentParser", "torch.topk", "torch.norm", "torch.sum", "torch.cuda.empty_cache", "torch.gather", "torch.cat" ]
[((3698, 3723), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (3721, 3723), False, 'import argparse\n'), ((1157, 1188), 'torch.norm', 'torch.norm', (['queryMats', '(2)'], {'dim': '(1)'}), '(queryMats, 2, dim=1)\n', (1167, 1188), False, 'import torch\n'), ((2779, 2806), 'torch.cat', 'torch.cat'...
from matekasse import create_app, db from matekasse.models import User, Transaction import sqlite3 import argparse parser = argparse.ArgumentParser(allow_abbrev=False) parser.add_argument("-p", "--path", action='store', type=str, required=True, help="Path to fnordcredit database") inp = parser.parse_args() app = cre...
[ "matekasse.create_app", "sqlite3.connect", "argparse.ArgumentParser", "matekasse.models.User", "matekasse.db.session.add", "matekasse.db.session.commit" ]
[((125, 168), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'allow_abbrev': '(False)'}), '(allow_abbrev=False)\n', (148, 168), False, 'import argparse\n'), ((317, 329), 'matekasse.create_app', 'create_app', ([], {}), '()\n', (327, 329), False, 'from matekasse import create_app, db\n'), ((382, 407), 'sqlit...
from oauthlib.oauth2 import InvalidClientError, MissingTokenError import pytest from test import configure_mendeley, cassette def test_should_get_authenticated_session(): mendeley = configure_mendeley() auth = mendeley.start_client_credentials_flow() with cassette('fixtures/auth/client_credentials/get_a...
[ "test.configure_mendeley", "pytest.raises", "test.cassette" ]
[((189, 209), 'test.configure_mendeley', 'configure_mendeley', ([], {}), '()\n', (207, 209), False, 'from test import configure_mendeley, cassette\n'), ((568, 588), 'test.configure_mendeley', 'configure_mendeley', ([], {}), '()\n', (586, 588), False, 'from test import configure_mendeley, cassette\n'), ((272, 347), 'tes...
__all__ = [ 'generate_client_id', 'get_album_art', 'get_transcoder', 'transcode_to_mp3', ] import os import shutil import subprocess from base64 import b64encode from binascii import unhexlify from hashlib import md5 import audio_metadata # The id is found by: getting md5sum of audio, base64 encode md5sum, remo...
[ "hashlib.md5", "base64.b64encode", "subprocess.run", "shutil.which", "audio_metadata.load", "binascii.unhexlify" ]
[((427, 452), 'audio_metadata.load', 'audio_metadata.load', (['song'], {}), '(song)\n', (446, 452), False, 'import audio_metadata\n'), ((523, 553), 'binascii.unhexlify', 'unhexlify', (['song.streaminfo.md5'], {}), '(song.streaminfo.md5)\n', (532, 553), False, 'from binascii import unhexlify\n'), ((567, 572), 'hashlib.m...
#!/usr/local/bin/python3 import sys,os,string,glob,subprocess from setuptools import setup,Extension from setuptools.command.build_ext import build_ext from setuptools.command.install import install import numpy long_description = """\ This module uses the RRG ...
[ "setuptools.setup" ]
[((727, 1177), 'setuptools.setup', 'setup', ([], {'name': '"""pyRRG"""', 'version': 'version', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'description': '"""pyRRG module"""', 'license': '"""MIT"""', 'packages': 'packages', 'package_dir': 'package_dir', 'package_data': 'package_data', 'scripts': "['scrip...
from concurrent.futures import ThreadPoolExecutor import time from PySide2.QtCore import QCoreApplication thread_pool=None def init_thread_pool(): global thread_pool thread_pool=ThreadPoolExecutor() def deinit_thread_pool(): global thread_pool thread_pool.shutdown() def submit_task(function,*args,*...
[ "PySide2.QtCore.QCoreApplication.processEvents", "concurrent.futures.ThreadPoolExecutor", "time.sleep" ]
[((189, 209), 'concurrent.futures.ThreadPoolExecutor', 'ThreadPoolExecutor', ([], {}), '()\n', (207, 209), False, 'from concurrent.futures import ThreadPoolExecutor\n'), ((616, 648), 'PySide2.QtCore.QCoreApplication.processEvents', 'QCoreApplication.processEvents', ([], {}), '()\n', (646, 648), False, 'from PySide2.QtC...
from __future__ import division from __future__ import print_function from __future__ import absolute_import from __future__ import unicode_literals import json import numpy as np import scipy.sparse as sparse import defenses import upper_bounds class NumpyEncoder(json.JSONEncoder): def default(self, obj): ...
[ "numpy.clip", "numpy.sqrt", "numpy.array", "numpy.linalg.norm", "numpy.cov", "defenses.compute_dists_under_Q", "numpy.mean", "numpy.reshape", "numpy.where", "numpy.max", "numpy.random.seed", "numpy.concatenate", "numpy.min", "scipy.sparse.csr_matrix", "numpy.tile", "numpy.eye", "nump...
[((833, 870), 'numpy.zeros', 'np.zeros', (['(num_classes, num_features)'], {}), '((num_classes, num_features))\n', (841, 870), True, 'import numpy as np\n'), ((1122, 1150), 'numpy.linalg.norm', 'np.linalg.norm', (['centroid_vec'], {}), '(centroid_vec)\n', (1136, 1150), True, 'import numpy as np\n'), ((1170, 1203), 'num...
""" Server module Quandl API limits: Authenticated users have a limit of 300 calls per 10 seconds, 2,000 calls per 10 minutes and a limit of 50,000 calls per day. """ import urllib import logging from twisted.internet import reactor from twisted.web.client import Agent, readBody from . import settings from . import...
[ "logging.getLogger", "twisted.internet.reactor.stop", "twisted.web.client.Agent", "twisted.internet.reactor.run", "twisted.web.client.readBody" ]
[((341, 389), 'logging.getLogger', 'logging.getLogger', (["(settings.LOG_NAME + '.server')"], {}), "(settings.LOG_NAME + '.server')\n", (358, 389), False, 'import logging\n'), ((903, 917), 'twisted.web.client.Agent', 'Agent', (['reactor'], {}), '(reactor)\n', (908, 917), False, 'from twisted.web.client import Agent, re...
import pytest import logging import ipaddress import json import re import time from tests.common.dualtor.dual_tor_mock import * from tests.common.helpers.assertions import pytest_assert as pt_assert from tests.common.dualtor.dual_tor_utils import rand_selected_interface, verify_upstream_traffic, get_crm_nexthop_counte...
[ "logging.getLogger", "json.loads", "tests.common.utilities.compare_crm_facts", "pytest.mark.topology", "json.dumps", "time.sleep", "re.sub", "pytest.mark.usefixtures", "pytest.fixture", "tests.common.config_reload.config_reload", "re.search" ]
[((627, 654), 'logging.getLogger', 'logging.getLogger', (['__file__'], {}), '(__file__)\n', (644, 654), False, 'import logging\n'), ((1290, 1334), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""', 'autouse': '(True)'}), "(scope='module', autouse=True)\n", (1304, 1334), False, 'import pytest\n'), ((675,...
''' Classes from the 'SplitKit' framework. ''' try: from rubicon.objc import ObjCClass except ValueError: def ObjCClass(name): return None def _Class(name): try: return ObjCClass(name) except NameError: return None PodsDummy_SplitKit = _Class('PodsDummy_SplitKit') Instan...
[ "rubicon.objc.ObjCClass" ]
[((200, 215), 'rubicon.objc.ObjCClass', 'ObjCClass', (['name'], {}), '(name)\n', (209, 215), False, 'from rubicon.objc import ObjCClass\n')]
"""Module controling search and replace tab.""" import logging from wiki_music.constants import GUI_HEADERS from wiki_music.gui_lib import BaseGui, CheckableListModel from wiki_music.gui_lib.qt_importer import QMessageBox, QPushButton, QIcon, QStyle __all__ = ["Replacer"] log = logging.getLogger(__name__) log.debug(...
[ "logging.getLogger", "wiki_music.gui_lib.qt_importer.QMessageBox", "wiki_music.gui_lib.CheckableListModel" ]
[((282, 309), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (299, 309), False, 'import logging\n'), ((641, 661), 'wiki_music.gui_lib.CheckableListModel', 'CheckableListModel', ([], {}), '()\n', (659, 661), False, 'from wiki_music.gui_lib import BaseGui, CheckableListModel\n'), ((2960, 31...
#%% [markdown] # # We will load EEG data from the lab and attemp to build a classifier that distinguishes between learners and non-learners #%% import mne import numpy as np import os.path import glob import re import pandas as pd # try to enable cuda support to speed up filtering, make sure the MNE_USE_C...
[ "mne.cuda.init_cuda", "pandas.read_csv", "mne.find_events", "mne.Epochs", "numpy.array", "mne.io.read_raw_edf" ]
[((361, 381), 'mne.cuda.init_cuda', 'mne.cuda.init_cuda', ([], {}), '()\n', (379, 381), False, 'import mne\n'), ((591, 635), 'mne.io.read_raw_edf', 'mne.io.read_raw_edf', (['data_path'], {'preload': '(True)'}), '(data_path, preload=True)\n', (610, 635), False, 'import mne\n'), ((913, 936), 'pandas.read_csv', 'pd.read_c...
import numpy as np import pandas as pd import matplotlib.pyplot as plt from scipy import integrate, optimize from scipy.signal import savgol_filter from dane import population as popu dias_restar = 4 # Los últimos días de información que no se tienen en cuenta dias_pred = 31 # Días sobre los cuáles se hará la predic...
[ "scipy.optimize.curve_fit", "pandas.to_timedelta", "pandas.read_csv", "matplotlib.pyplot.ylabel", "scipy.integrate.odeint", "dane.population", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "numpy.array", "pandas.date_range", "pandas.DataFrame", "pandas.to_datetime", "matplotlib.pyplo...
[((631, 774), 'pandas.read_csv', 'pd.read_csv', (['"""https://www.datos.gov.co/api/views/gt2j-8ykr/rows.csv?accessType=DOWNLOAD"""'], {'sep': '""","""', 'encoding': '"""utf-8"""', 'low_memory': '(False)'}), "(\n 'https://www.datos.gov.co/api/views/gt2j-8ykr/rows.csv?accessType=DOWNLOAD'\n , sep=',', encoding='utf...
#!/usr/bin/env python # coding: utf-8 # In[7]: import os write_to_csv_file = 'million_song_subset.csv' csv_file_read = open(write_to_csv_file,'r') csv_file_write = open(write_to_csv_file,'a') while True: next_line = csv_file_read.readline() if not next_line: break csv_file_size = os.pat...
[ "os.path.getsize" ]
[((314, 348), 'os.path.getsize', 'os.path.getsize', (['write_to_csv_file'], {}), '(write_to_csv_file)\n', (329, 348), False, 'import os\n')]
# Copyright (c) 2013, Regents of the University of California # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # Redistributions of source code must retain the above copyright notice, this # list o...
[ "matplotlib.pyplot.savefig", "os.makedirs", "matplotlib.use", "os.path.dirname", "os.path.isdir", "matplotlib.rc" ]
[((1618, 1628), 'matplotlib.use', 'use', (['"""Agg"""'], {}), "('Agg')\n", (1621, 1628), False, 'from matplotlib import use, rc\n'), ((1731, 1752), 'os.path.dirname', 'os.path.dirname', (['path'], {}), '(path)\n', (1746, 1752), False, 'import os\n'), ((2290, 2317), 'matplotlib.rc', 'rc', (['"""legend"""'], {'fontsize':...
from flask_wtf import FlaskForm from wtforms import validators from wtforms.fields import * class login_form(FlaskForm): email = EmailField('Email Address', [ validators.DataRequired(), ]) password = PasswordField('Password', [ validators.DataRequired(), validators.length(min=6, m...
[ "wtforms.validators.length", "wtforms.validators.DataRequired", "wtforms.validators.EqualTo" ]
[((173, 198), 'wtforms.validators.DataRequired', 'validators.DataRequired', ([], {}), '()\n', (196, 198), False, 'from wtforms import validators\n'), ((259, 284), 'wtforms.validators.DataRequired', 'validators.DataRequired', ([], {}), '()\n', (282, 284), False, 'from wtforms import validators\n'), ((294, 326), 'wtforms...
import os import firebase_admin from firebase_admin import credentials, messaging from django.conf import settings from utils import common, constants logger = common.get_system_logger() cred = credentials.Certificate(os.path.join( settings.BASE_DIR, 'data', 'sales-yang-firebase-adminsdk-2ga7e-17745491...
[ "utils.constants.INFO_FIREBASE_SEND_MESSAGE.format", "firebase_admin.initialize_app", "utils.common.get_system_logger", "os.path.join", "account.models.Notification.add_by_topic", "firebase_admin.messaging.send_multicast", "firebase_admin.messaging.MulticastMessage", "utils.constants.INFO_FIREBASE_NO_...
[((163, 189), 'utils.common.get_system_logger', 'common.get_system_logger', ([], {}), '()\n', (187, 189), False, 'from utils import common, constants\n'), ((332, 378), 'firebase_admin.initialize_app', 'firebase_admin.initialize_app', ([], {'credential': 'cred'}), '(credential=cred)\n', (361, 378), False, 'import fireba...
# Copyright 2019 The Keras Tuner Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
[ "six.moves.zip_longest", "numpy.nanmean", "tensorflow.nest.flatten" ]
[((3473, 3545), 'six.moves.zip_longest', 'six.moves.zip_longest', (['*[h[metric] for h in histories]'], {'fillvalue': 'np.nan'}), '(*[h[metric] for h in histories], fillvalue=np.nan)\n', (3494, 3545), False, 'import six\n'), ((1924, 1949), 'tensorflow.nest.flatten', 'tf.nest.flatten', (['fit_args'], {}), '(fit_args)\n'...
from flask import Flask, render_template, flash, abort, redirect, url_for, request import os import common import json import numbers import urllib.parse import pandas as pd from datetime import datetime from math import log10, floor base_dir = '/home/nick/Data/_ensembles' app = Flask(__name__) app.config['ENV'] = 'de...
[ "flask.render_template", "flask.Flask", "os.listdir", "flask.flash", "flask.request.form.get", "os.path.isdir", "os.mkdir", "common.categorical_vars", "flask.abort", "common.load_file_config", "os.path.isfile", "common.binary_vars", "common.numeric_vars", "os.path.join", "flask.url_for",...
[((281, 296), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (286, 296), False, 'from flask import Flask, render_template, flash, abort, redirect, url_for, request\n'), ((551, 616), 'os.path.join', 'os.path.join', (['base_dir', '"""outlier-predictions-2020_01_03-11_15_41"""'], {}), "(base_dir, 'outlier-pre...