code
stringlengths
22
1.05M
apis
listlengths
1
3.31k
extract_api
stringlengths
75
3.25M
from django.contrib import admin from django.urls import path, include from project import views urlpatterns = [ path('admin/', admin.site.urls), path('', views.Home, name='home'), path('login/', views.loginuser, name='loginuser'), path('signup/', views.signupuser, name='signupuser'), path('loguot/...
[ "django.urls.path", "django.urls.include" ]
[((118, 149), 'django.urls.path', 'path', (['"""admin/"""', 'admin.site.urls'], {}), "('admin/', admin.site.urls)\n", (122, 149), False, 'from django.urls import path, include\n'), ((155, 188), 'django.urls.path', 'path', (['""""""', 'views.Home'], {'name': '"""home"""'}), "('', views.Home, name='home')\n", (159, 188),...
""" Copyright Snap Inc. 2021. This sample code is made available by Snap Inc. for informational purposes only. No license, whether implied or otherwise, is granted in or to such code (including any rights to copy, modify, publish, distribute and/or commercialize such code), unless you have entered into a separate agree...
[ "torch.load", "os.path.join", "torch.nn.DataParallel", "models.stylegan2.model.cuda", "models.stylegan2.model.Generator", "torch.nn.parallel.DistributedDataParallel" ]
[((1608, 1701), 'models.stylegan2.model.Generator', 'model.Generator', ([], {'size': 'opt.style_gan_size', 'style_dim': 'opt.latent_dimension', 'n_mlp': 'opt.n_mlp'}), '(size=opt.style_gan_size, style_dim=opt.latent_dimension,\n n_mlp=opt.n_mlp)\n', (1623, 1701), False, 'from models.stylegan2 import model\n'), ((207...
from models.buckcol import BuckCol_UnitBox from kaa.experi_init import * from kaa.timer import Timer def test_box_BuckCol(): num_steps = 4 model = BuckCol_UnitBox() experi_input = dict(model=model, strat=None, label=f"BuckCol Box Reachable Set", ...
[ "kaa.timer.Timer.generate_stats", "models.buckcol.BuckCol_UnitBox" ]
[((158, 175), 'models.buckcol.BuckCol_UnitBox', 'BuckCol_UnitBox', ([], {}), '()\n', (173, 175), False, 'from models.buckcol import BuckCol_UnitBox\n'), ((455, 477), 'kaa.timer.Timer.generate_stats', 'Timer.generate_stats', ([], {}), '()\n', (475, 477), False, 'from kaa.timer import Timer\n'), ((545, 562), 'models.buck...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import json import warnings import pulumi import pulumi.runtime from typing import Union from .. import utilities, tables class GetSub...
[ "pulumi.InvokeOptions", "pulumi.runtime.invoke" ]
[((4400, 4422), 'pulumi.InvokeOptions', 'pulumi.InvokeOptions', ([], {}), '()\n', (4420, 4422), False, 'import pulumi\n'), ((4513, 4592), 'pulumi.runtime.invoke', 'pulumi.runtime.invoke', (['"""azure:network/getSubnet:getSubnet"""', '__args__'], {'opts': 'opts'}), "('azure:network/getSubnet:getSubnet', __args__, opts=o...
# local imports import xmatters import config # python3 package imports import logging import base64 import json from logging.handlers import RotatingFileHandler import urllib.parse import datetime import csv # main process def main() -> object: """ 1. Query for all events where a form property is set to...
[ "logging.getLogger", "datetime.datetime.utcnow", "json.dumps", "csv.writer", "datetime.date.today", "logging.handlers.RotatingFileHandler", "xmatters.xMattersCollection", "xmatters.xMattersPerson", "xmatters.xMattersEvent", "xmatters.xMattersAPI", "xmatters.TimeCalc" ]
[((970, 996), 'datetime.datetime.utcnow', 'datetime.datetime.utcnow', ([], {}), '()\n', (994, 996), False, 'import datetime\n'), ((10804, 10831), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (10821, 10831), False, 'import logging\n'), ((10866, 10885), 'xmatters.TimeCalc', 'xmatters.Time...
# Generated by Django 3.1.7 on 2021-04-08 19:01 from django.db import migrations from django.contrib.postgres.operations import CreateExtension class Migration(migrations.Migration): dependencies = [ ] operations = [ CreateExtension(name='unaccent'), ]
[ "django.contrib.postgres.operations.CreateExtension" ]
[((241, 273), 'django.contrib.postgres.operations.CreateExtension', 'CreateExtension', ([], {'name': '"""unaccent"""'}), "(name='unaccent')\n", (256, 273), False, 'from django.contrib.postgres.operations import CreateExtension\n')]
#!/usr/bin/env python """Mixin class to be used in tests for DB implementations.""" import abc import random from grr.server.grr_response_server import db from grr.server.grr_response_server import db_clients_test from grr.server.grr_response_server import db_events_test from grr.server.grr_response_server import db_...
[ "random.choice", "grr.server.grr_response_server.db.DatabaseValidationWrapper" ]
[((1631, 1667), 'grr.server.grr_response_server.db.DatabaseValidationWrapper', 'db.DatabaseValidationWrapper', (['db_obj'], {}), '(db_obj)\n', (1659, 1667), False, 'from grr.server.grr_response_server import db\n'), ((2260, 2293), 'random.choice', 'random.choice', (['"""0123456789abcdef"""'], {}), "('0123456789abcdef')...
import random from ananas import PineappleBot, ConfigurationError, hourly, reply def make_gram(word_array): return " ".join(word_array) class NGramTextModel(): def __init__(self, n, lines): self.n = n self.gram_dictionary = dict() self.build_from_lines(lines) def build_from_lines(...
[ "ananas.hourly", "ananas.ConfigurationError" ]
[((1967, 1975), 'ananas.hourly', 'hourly', ([], {}), '()\n', (1973, 1975), False, 'from ananas import PineappleBot, ConfigurationError, hourly, reply\n'), ((1448, 1499), 'ananas.ConfigurationError', 'ConfigurationError', (['"""MarkovBot requires a \'corpus\'"""'], {}), '("MarkovBot requires a \'corpus\'")\n', (1466, 14...
from io import StringIO import pytest from panel.widgets import __file__ as wfile, FileDownload, Progress def test_progress_bounds(): progress = Progress() progress.max = 200 assert progress.param.value.bounds == (-1, 200) progress.value = 120 assert progress.value == 120 def test_file_downloa...
[ "io.StringIO", "pytest.raises", "panel.widgets.Progress", "panel.widgets.FileDownload" ]
[((153, 163), 'panel.widgets.Progress', 'Progress', ([], {}), '()\n', (161, 163), False, 'from panel.widgets import __file__ as wfile, FileDownload, Progress\n'), ((351, 365), 'panel.widgets.FileDownload', 'FileDownload', ([], {}), '()\n', (363, 365), False, 'from panel.widgets import __file__ as wfile, FileDownload, P...
import pytest from user.user import User from utils.op_utils import * import os @pytest.fixture def example_user(): new_user = User(ID = 1234, name='Mark', location={'country': 'ES', 'region':'Granada'}, email='<EMAIL>') return new_user @pytest.fixture def example_user2(): new_user = User(ID = 6789, name=...
[ "os.path.dirname", "user.user.User" ]
[((132, 228), 'user.user.User', 'User', ([], {'ID': '(1234)', 'name': '"""Mark"""', 'location': "{'country': 'ES', 'region': 'Granada'}", 'email': '"""<EMAIL>"""'}), "(ID=1234, name='Mark', location={'country': 'ES', 'region': 'Granada'},\n email='<EMAIL>')\n", (136, 228), False, 'from user.user import User\n'), ((2...
import math import pygame from Boards import BoardsClass from tkinter import PhotoImage from extras import TowerButton from enemy import EnemyWave, Enemy from animation import Animation, ALL from tower import (Tower, RedTower, TowerArray, GreenTower, ...
[ "tower.TowerArray", "tower.RedTower", "tower.PurpleTower", "tower.OrangeTower", "math.sqrt", "math.log", "tower.Tower", "extras.TowerButton", "Boards.BoardsClass.GetBoard", "pygame.mixer.music.load", "pygame.mixer.music.play", "tkinter.PhotoImage", "tower.GreenTower", "enemy.EnemyWave", ...
[((2219, 2231), 'tower.TowerArray', 'TowerArray', ([], {}), '()\n', (2229, 2231), False, 'from tower import Tower, RedTower, TowerArray, GreenTower, OrangeTower, PurpleTower\n'), ((2724, 2746), 'Boards.BoardsClass.GetBoard', 'BoardsClass.GetBoard', ([], {}), '()\n', (2744, 2746), False, 'from Boards import BoardsClass\...
from cairio import client as ca print('------------------------------------------------') # Local key/value store for associating relatively short strings (<=80 characters) with arbitrary keys (strings or dicts) # Setting values (these should be short strings, <=80 characters) ca.setValue(key='some-key1', value='hel...
[ "cairio.client.loadText", "cairio.client.loadObject", "cairio.client.saveText", "cairio.client.saveFile", "cairio.client.getValue", "cairio.client.setValue", "cairio.client.realizeFile" ]
[((281, 326), 'cairio.client.setValue', 'ca.setValue', ([], {'key': '"""some-key1"""', 'value': '"""hello 1"""'}), "(key='some-key1', value='hello 1')\n", (292, 326), True, 'from cairio import client as ca\n'), ((419, 447), 'cairio.client.getValue', 'ca.getValue', ([], {'key': '"""some-key1"""'}), "(key='some-key1')\n"...
# coding=utf-8 # Copyright 2018 Google T5 Authors and HuggingFace Inc. team. # # 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 requ...
[ "transformers.T5Tokenizer.from_pretrained", "transformers.TFT5Model", "tensorflow.debugging.assert_near", "tensorflow.math.reduce_sum", "transformers.TFT5ForConditionalGeneration", "tensorflow.concat", "transformers.TFT5ForConditionalGeneration.from_pretrained", "transformers.is_tf_available", "unit...
[((991, 1008), 'transformers.is_tf_available', 'is_tf_available', ([], {}), '()\n', (1006, 1008), False, 'from transformers import T5Config, is_tf_available\n'), ((15010, 15077), 'unittest.skip', 'unittest.skip', ([], {'reason': '"""The inputs of the Main Layer are different."""'}), "(reason='The inputs of the Main Lay...
from direct.gui.DirectGui import * from panda3d.core import * from direct.directnotify import DirectNotifyGlobal from toontown.toonbase import ToontownGlobals from toontown.toonbase import TTLocalizer from direct.task import Task import FishBase import FishPicker class FishSellGUI(DirectFrame): notify = DirectNoti...
[ "direct.directnotify.DirectNotifyGlobal.directNotify.newCategory", "FishPicker.FishPicker" ]
[((310, 364), 'direct.directnotify.DirectNotifyGlobal.directNotify.newCategory', 'DirectNotifyGlobal.directNotify.newCategory', (['"""FishGui"""'], {}), "('FishGui')\n", (353, 364), False, 'from direct.directnotify import DirectNotifyGlobal\n'), ((776, 803), 'FishPicker.FishPicker', 'FishPicker.FishPicker', (['self'], ...
#Geometry optimization HF/6-31g* on water import os import sys from ..utils import * from ..addons import * import qcdb h2o = qcdb.set_molecule(''' O 0.000000000000 0.000000000000 -0.065638538099 H 0.000000000000 -0.757480611647 0.520865616174 H 0.000000000000 0.7574806...
[ "qcdb.get_variable", "qcdb.set_molecule", "qcdb.energy", "qcdb.set_options" ]
[((127, 366), 'qcdb.set_molecule', 'qcdb.set_molecule', (['"""\n O 0.000000000000 0.000000000000 -0.065638538099\n H 0.000000000000 -0.757480611647 0.520865616174\n H 0.000000000000 0.757480611647 0.520865616174\n """'], {}), '(\n """\n O 0.000000000...
from django.conf import settings from django.contrib.auth.management import create_permissions from django.contrib.auth.models import Permission from django.db import migrations from swapper import dependency, split def create_default_permissions(apps, schema_editor): for app_config in apps.get_app_configs(): ...
[ "django.contrib.auth.management.create_permissions", "django.db.migrations.RunPython", "swapper.split" ]
[((365, 419), 'django.contrib.auth.management.create_permissions', 'create_permissions', (['app_config'], {'apps': 'apps', 'verbosity': '(0)'}), '(app_config, apps=apps, verbosity=0)\n', (383, 419), False, 'from django.contrib.auth.management import create_permissions\n'), ((2097, 2192), 'django.db.migrations.RunPython...
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals range = getattr(__builtins__, 'xrange', range) # end of py2 compatability boilerplate import logging import numpy as np from matrixprofile impo...
[ "logging.getLogger", "matrixprofile.core.clean_nan_inf", "matrixprofile.core.apply_exclusion_zone", "numpy.sqrt", "numpy.argsort", "matrixprofile.core.distance_profile", "numpy.sort", "numpy.empty", "matrixprofile.core.fft_convolve", "matrixprofile.core.get_profile_length", "matrixprofile.core.t...
[((338, 365), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (355, 365), False, 'import logging\n'), ((2657, 2699), 'numpy.full', 'np.full', (['(num_dim, profile_length)', 'np.inf'], {}), '((num_dim, profile_length), np.inf)\n', (2664, 2699), True, 'import numpy as np\n'), ((2720, 2757), ...
""" Copyright 2019 Google LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software di...
[ "os.path.realpath", "logging.info", "argparse.ArgumentParser", "re.compile" ]
[((796, 839), 're.compile', 're.compile', (['"""\\\\[4\\\\] \\\\[M\\\\]: 0x.*00001010"""'], {}), "('\\\\[4\\\\] \\\\[M\\\\]: 0x.*00001010')\n", (806, 839), False, 'import re\n'), ((848, 867), 're.compile', 're.compile', (['"""ecall"""'], {}), "('ecall')\n", (858, 867), False, 'import re\n'), ((880, 1002), 're.compile',...
""" Provides access to entities via IDs (MIDs) and surface forms (aliases). Each entity is assigned an ID equivalent to the byte offset in the entity list file. A hashmap stores a mapping from MID to this offset. Additionally, another hashmap stores a mapping from surface form to this offset, along with a score. Match...
[ "logging.getLogger", "entity_linker.aaqu_entity_linker.KBEntity", "logging.basicConfig", "collections.OrderedDict", "array.array", "entity_linker.aaqu_util.normalize_entity_name", "os.path.isfile" ]
[((914, 941), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (931, 941), False, 'import logging\n'), ((942, 975), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': '"""INFO"""'}), "(level='INFO')\n", (961, 975), False, 'import logging\n'), ((1975, 2001), 'os.path.isfile', 'os.p...
from hashlib import ( md5, sha256, ) import logging try: from urllib import urlencode from urlparse import urlsplit, parse_qs, urlunsplit except ImportError: from urllib.parse import urlsplit, parse_qs, urlunsplit, urlencode from uuid import uuid4 from oidc_provider.lib.claims import StandardScopeC...
[ "logging.getLogger", "oidc_provider.settings.get", "urllib.parse.urlsplit", "urllib.parse.parse_qs", "oidc_provider.lib.utils.token.encode_id_token", "urllib.parse.urlencode", "oidc_provider.lib.utils.authorize.update_or_create_user_consent", "oidc_provider.lib.errors.RedirectUriError", "oidc_provid...
[((874, 901), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (891, 901), False, 'import logging\n'), ((5149, 5186), 'urllib.parse.urlsplit', 'urlsplit', (["self.params['redirect_uri']"], {}), "(self.params['redirect_uri'])\n", (5157, 5186), False, 'from urllib.parse import urlsplit, parse...
from social_auth.backends import PIPELINE from social_auth.utils import setting def save_status_to_session(request, auth, pipeline_index, *args, **kwargs): """Saves current social-auth status to session.""" next_entry = setting('SOCIAL_AUTH_PIPELINE_RESUME_ENTRY') if next_entry and next_entry in PIPELINE...
[ "social_auth.backends.PIPELINE.index", "social_auth.utils.setting" ]
[((230, 274), 'social_auth.utils.setting', 'setting', (['"""SOCIAL_AUTH_PIPELINE_RESUME_ENTRY"""'], {}), "('SOCIAL_AUTH_PIPELINE_RESUME_ENTRY')\n", (237, 274), False, 'from social_auth.utils import setting\n'), ((472, 535), 'social_auth.utils.setting', 'setting', (['"""SOCIAL_AUTH_PARTIAL_PIPELINE_KEY"""', '"""partial_...
# -*- coding: utf-8 -*- """ Created on Thu Aug 30 13:05:28 2018: 在版本3的基础上,根据pandas的join方法来求交集 根据从量表中筛选的样本,来获得符合要求的原始数据的路径 数据结构neuroimageDataPath//subject00001//files 也可以是任何的数据结构,只要给定subjName在哪里就行 总之,最后把file复制到其他地方(可以给每个subject限定某个符合条件file,比如以'.nii'结尾的file) input: # reference_file:需要复制的被试名字所在text文件(大表中的uid) ...
[ "pandas.read_csv", "multiprocessing.cpu_count", "pandas.read_excel", "sys.exit", "sys.path.append", "os.walk", "pandas.unique", "os.path.exists", "shutil.move", "pandas.DataFrame", "time.localtime", "os.path.dirname", "shutil.copy", "numpy.shape", "time.time", "pandas.Series", "numpy...
[((1610, 1720), 'sys.path.append', 'sys.path.append', (['"""D:\\\\My_Codes\\\\LC_Machine_Learning\\\\lc_rsfmri_tools\\\\lc_rsfmri_tools_python\\\\Utils"""'], {}), "(\n 'D:\\\\My_Codes\\\\LC_Machine_Learning\\\\lc_rsfmri_tools\\\\lc_rsfmri_tools_python\\\\Utils'\n )\n", (1625, 1720), False, 'import sys\n'), ((4899...
import asyncio async def handle(reader, writer): try: target_r, target_w = await asyncio.open_connection('127.0.0.1', 5201) except ConnectionRefusedError: print('远程计算机连接失败!') print('new connect!') task = [ tcp_reader_Tg(reader,writer,target_r,target_w), tcp_writer_Tg(re...
[ "asyncio.start_server", "asyncio.get_event_loop", "asyncio.open_connection", "asyncio.gather" ]
[((1785, 1809), 'asyncio.get_event_loop', 'asyncio.get_event_loop', ([], {}), '()\n', (1807, 1809), False, 'import asyncio\n'), ((1845, 1894), 'asyncio.start_server', 'asyncio.start_server', (['handle', 'ip', 'port'], {'loop': 'loop'}), '(handle, ip, port, loop=loop)\n', (1865, 1894), False, 'import asyncio\n'), ((367,...
"""Base Integration for Cortex XSOAR - Unit Tests file Pytest Unit Tests: all funcion names must start with "test_" More details: https://xsoar.pan.dev/docs/integrations/unit-testing MAKE SURE YOU REVIEW/REPLACE ALL THE COMMENTS MARKED AS "TODO" You must add at least a Unit Test function for every XSOAR command you...
[ "json.dumps", "VaronisDataSecurityPlatform.varonis_update_alert_status_command", "io.open", "VaronisDataSecurityPlatform.varonis_close_alert_command", "VaronisDataSecurityPlatform.Client", "VaronisDataSecurityPlatform.fetch_incidents", "VaronisDataSecurityPlatform.varonis_get_alerts_command", "Varonis...
[((987, 1049), 'VaronisDataSecurityPlatform.Client', 'Client', ([], {'base_url': '"""https://test.com"""', 'verify': '(False)', 'proxy': '(False)'}), "(base_url='https://test.com', verify=False, proxy=False)\n", (993, 1049), False, 'from VaronisDataSecurityPlatform import Client\n'), ((1739, 1779), 'VaronisDataSecurity...
import pygame import json class SpriteSheet: """ Class for managing sprite sheets and loading them in and getting the next frame """ def __init__(self, root_location: str, sprite_id: int): self.next_frame = 1 with open(f"{root_location}\\data.json", "r") as file: data = jso...
[ "json.load", "pygame.image.load", "pygame.Rect", "pygame.transform.scale" ]
[((317, 332), 'json.load', 'json.load', (['file'], {}), '(file)\n', (326, 332), False, 'import json\n'), ((2677, 2733), 'pygame.Rect', 'pygame.Rect', (['x', 'y', 'self.sprite_width', 'self.sprite_height'], {}), '(x, y, self.sprite_width, self.sprite_height)\n', (2688, 2733), False, 'import pygame\n'), ((1113, 1145), 'p...
from __future__ import absolute_import import os import subprocess from .exceptions import ( SolcError, ) from .utils.string import ( force_bytes, coerce_return_to_text, ) def get_solc_binary_path(): return os.environ.get('SOLC_BINARY', 'solc') @coerce_return_to_text def solc_wrapper(solc_binary=N...
[ "subprocess.Popen", "os.environ.get" ]
[((227, 264), 'os.environ.get', 'os.environ.get', (['"""SOLC_BINARY"""', '"""solc"""'], {}), "('SOLC_BINARY', 'solc')\n", (241, 264), False, 'import os\n'), ((3408, 3508), 'subprocess.Popen', 'subprocess.Popen', (['command'], {'stdin': 'subprocess.PIPE', 'stdout': 'subprocess.PIPE', 'stderr': 'subprocess.PIPE'}), '(com...
from setuptools import setup, find_packages with open('README.rst') as f: readme = f.read() with open('../../../VERSION') as f: ver = f.read() ver = ver.split('-')[0] + 'b1' setup( name='fjagepy', version=ver, description='Fjage Python Gateway', long_description=readme, author='<NAME>...
[ "setuptools.find_packages" ]
[((655, 695), 'setuptools.find_packages', 'find_packages', ([], {'exclude': "('tests', 'docs')"}), "(exclude=('tests', 'docs'))\n", (668, 695), False, 'from setuptools import setup, find_packages\n')]
from django.shortcuts import render_to_response, get_object_or_404 def page_detail(request, page_url, queryset): parts = page_url.split('/') parts.reverse() filter_params = {} field = 'slug' for slug in parts: filter_params[field] = slug field = 'parent__%s' % field page = get_...
[ "django.shortcuts.get_object_or_404", "django.shortcuts.render_to_response" ]
[((316, 360), 'django.shortcuts.get_object_or_404', 'get_object_or_404', (['queryset'], {}), '(queryset, **filter_params)\n', (333, 360), False, 'from django.shortcuts import render_to_response, get_object_or_404\n'), ((376, 437), 'django.shortcuts.render_to_response', 'render_to_response', (['"""pubcms/page_detail.htm...
from __future__ import print_function import torch import torch.optim as optim from data.data_loader import CreateDataLoader import tqdm import cv2 import yaml from schedulers import WarmRestart, LinearDecay import numpy as np from models.networks import get_nets from models.losses import get_loss from models.models i...
[ "logging.basicConfig", "numpy.mean", "cv2.setNumThreads", "models.networks.get_nets", "tensorboardX.SummaryWriter", "logging.debug", "torch.optim.lr_scheduler.ReduceLROnPlateau", "tqdm.tqdm", "yaml.load", "models.losses.get_loss", "schedulers.LinearDecay", "schedulers.WarmRestart", "data.dat...
[((391, 451), 'logging.basicConfig', 'logging.basicConfig', ([], {'filename': '"""res.log"""', 'level': 'logging.DEBUG'}), "(filename='res.log', level=logging.DEBUG)\n", (410, 451), False, 'import logging\n'), ((460, 485), 'tensorboardX.SummaryWriter', 'SummaryWriter', (['"""res_runs"""'], {}), "('res_runs')\n", (473, ...
import os import pytest import pathlib import json from anchore_engine.clients import skopeo_wrapper oci_manifest_digest = "2a8ca7db7332bc6c3b825a4540c33b47ad588947aa130f07b7493a863daa3ba3" # fake urlretrieve class class FakeUrlRetrieve: """ >>> fake = FakeUlrRetrieve(raises=TypeError) >>> fake(url, pa...
[ "os.path.exists", "anchore_engine.clients.skopeo_wrapper.get_digest_value", "os.listdir", "pathlib.Path", "json.dumps", "os.path.join", "anchore_engine.clients.skopeo_wrapper.fetch_oci_blobs", "anchore_engine.clients.skopeo_wrapper.ensure_no_nondistributable_media_types" ]
[((1237, 1254), 'json.dumps', 'json.dumps', (['index'], {}), '(index)\n', (1247, 1254), False, 'import json\n'), ((2276, 2324), 'anchore_engine.clients.skopeo_wrapper.fetch_oci_blobs', 'skopeo_wrapper.fetch_oci_blobs', (['blobs_dir', 'blobs'], {}), '(blobs_dir, blobs)\n', (2306, 2324), False, 'from anchore_engine.clien...
# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
[ "matplotlib.pyplot.draw", "jax.numpy.zeros", "jax.random.PRNGKey", "matplotlib.pyplot.show", "jax.scipy.stats.norm.logpdf", "jax.experimental.optimizers.momentum", "jax.random.normal", "jax.numpy.meshgrid", "jax.numpy.exp", "jax.api.grad", "matplotlib.pyplot.figure", "functools.partial", "ja...
[((2039, 2077), 'functools.partial', 'partial', (['jit'], {'static_argnums': '(0, 1, 2)'}), '(jit, static_argnums=(0, 1, 2))\n', (2046, 2077), False, 'from functools import partial\n'), ((1825, 1855), 'jax.random.split', 'random.split', (['rng', 'num_samples'], {}), '(rng, num_samples)\n', (1837, 1855), False, 'from ja...
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Virtual Observatory =================== This module contains various methods for querying the Virtual Observatory """ from astropy import config as _config class Conf(_config.ConfigNamespace): """ Configuration parameters for `astroquery.vo...
[ "astropy.config.ConfigItem" ]
[((354, 459), 'astropy.config.ConfigItem', '_config.ConfigItem', (['"""https://vao.stsci.edu/RegTAP/TapService.aspx"""', '"""Base URL of Registry TAP server"""'], {}), "('https://vao.stsci.edu/RegTAP/TapService.aspx',\n 'Base URL of Registry TAP server')\n", (372, 459), True, 'from astropy import config as _config\n...
#!/bin/sh ''''which python3.6 >/dev/null 2>&1 && exec python3.6 "$0" "$@" # ''' ''''which python3.5 >/dev/null 2>&1 && exec python3.5 "$0" "$@" # ''' ''''exec echo "Error: I can't find python3.[6|5] anywhere." # ''' from argh import ArghParser, arg, wrap_errors, expects_obj from connexion import FlaskApp import s...
[ "connexion.FlaskApp", "src.setup.logger", "argh.arg", "src.setup.routes", "argh.ArghParser", "src.setup.extensions", "src.setup.args", "argh.wrap_errors" ]
[((636, 702), 'argh.arg', 'arg', (['"""--dev"""'], {'default': '(False)', 'help': '"""Enable Flask development mode."""'}), "('--dev', default=False, help='Enable Flask development mode.')\n", (639, 702), False, 'from argh import ArghParser, arg, wrap_errors, expects_obj\n'), ((717, 783), 'argh.arg', 'arg', (['"""--con...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('Organizer', '0009_auto_20150428_2149'), ] operations = [ migrations.AlterField( model_name='course', ...
[ "django.db.models.ManyToManyField" ]
[((373, 452), 'django.db.models.ManyToManyField', 'models.ManyToManyField', ([], {'to': '"""Organizer.Certificate_Course_Structure"""', 'blank': '(True)'}), "(to='Organizer.Certificate_Course_Structure', blank=True)\n", (395, 452), False, 'from django.db import models, migrations\n'), ((617, 704), 'django.db.models.Man...
from __future__ import absolute_import import sys import copy import operator from functools import reduce from sqlbuilder.smartsql.compiler import compile from sqlbuilder.smartsql.constants import CONTEXT, PLACEHOLDER, MAX_PRECEDENCE from sqlbuilder.smartsql.exceptions import MaxLengthError from sqlbuilder.smartsql.py...
[ "sqlbuilder.smartsql.compiler.compile.when", "sqlbuilder.smartsql.utils.warn", "sqlbuilder.smartsql.utils.is_list", "sqlbuilder.smartsql.compiler.compile" ]
[((753, 773), 'sqlbuilder.smartsql.compiler.compile.when', 'compile.when', (['object'], {}), '(object)\n', (765, 773), False, 'from sqlbuilder.smartsql.compiler import compile\n'), ((980, 999), 'sqlbuilder.smartsql.compiler.compile.when', 'compile.when', (['slice'], {}), '(slice)\n', (992, 999), False, 'from sqlbuilder...
from typing import Dict, Iterator, Optional, Tuple, Union import enum import pathlib import time import warnings from ctypes import CDLL, c_int from wyzecam.api_models import WyzeAccount, WyzeCamera try: import av import av.video.frame except ImportError: av = None try: import cv2 except ImportError...
[ "wyzecam.tutk.tutk.iotc_connect_by_uid_parallel", "wyzecam.tutk.tutk.iotc_get_session_id", "wyzecam.tutk.tutk.load_library", "wyzecam.tutk.tutk_ioctl_mux.TutkIOCtrlMux", "time.sleep", "wyzecam.tutk.tutk_protocol.K10056SetResolvingBit", "wyzecam.tutk.tutk.av_recv_frame_data", "wyzecam.tutk.tutk.av_init...
[((3044, 3117), 'wyzecam.tutk.tutk.iotc_initialize', 'tutk.iotc_initialize', (['self.tutk_platform_lib'], {'udp_port': '(self.udp_port or 0)'}), '(self.tutk_platform_lib, udp_port=self.udp_port or 0)\n', (3064, 3117), False, 'from wyzecam.tutk import tutk\n'), ((3230, 3320), 'wyzecam.tutk.tutk.av_initialize', 'tutk.av_...
import torch import torch import numpy as np import torch from torch.autograd import Variable import os import argparse from datetime import datetime import torch.nn.functional as F def joint_loss(pred, mask): weit = 1 + 5*torch.abs(F.avg_pool2d(mask, kernel_size=31, stride=1, padding=15) - mask) wbce = F.bi...
[ "torch.sigmoid", "torch.stack", "torch.nn.functional.avg_pool2d", "torch.nn.functional.binary_cross_entropy_with_logits" ]
[((316, 380), 'torch.nn.functional.binary_cross_entropy_with_logits', 'F.binary_cross_entropy_with_logits', (['pred', 'mask'], {'reduction': '"""none"""'}), "(pred, mask, reduction='none')\n", (350, 380), True, 'import torch.nn.functional as F\n'), ((455, 474), 'torch.sigmoid', 'torch.sigmoid', (['pred'], {}), '(pred)\...
import sys from setuptools import setup, find_packages MAJOR = 0 MINOR = 1 MICRO = 0 ISRELEASED = False VERSION = "%d.%d.%d" % (MAJOR, MINOR, MICRO) QUALIFIER = "" DISTNAME = "xmovie" LICENSE = "MIT" AUTHOR = "<NAME>" AUTHOR_EMAIL = "<EMAIL>" URL = "https://github.com/jbusecke/xmovie" CLASSIFIERS = [ "Developme...
[ "setuptools.find_packages" ]
[((1369, 1384), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (1382, 1384), False, 'from setuptools import setup, find_packages\n')]
# vim: sw=4:ts=4:et # # all of the engines that do stuff need to coordinate with each other # to make sure they don't overwhelm the resources they use # see semaphores.txt import datetime import ipaddress import logging import multiprocessing import os import re import socket import sys import threading import time ...
[ "ipaddress.ip_address", "logging.debug", "socket.socket", "os.makedirs", "os.path.join", "threading.RLock", "time.sleep", "re.match", "datetime.datetime.now", "saq.error.report_exception", "os.path.isdir", "sys.exit", "threading.Thread", "logging.info", "logging.error" ]
[((2309, 2316), 'threading.RLock', 'RLock', ([], {}), '()\n', (2314, 2316), False, 'from threading import Thread, Semaphore, RLock\n'), ((11717, 11769), 'os.path.join', 'os.path.join', (['saq.DATA_DIR', "self.config['stats_dir']"], {}), "(saq.DATA_DIR, self.config['stats_dir'])\n", (11729, 11769), False, 'import os\n')...
from email.message import Message import pytest from pip._vendor.packaging.specifiers import SpecifierSet from pip._vendor.packaging.version import parse as parse_version from pip._vendor.pkg_resources import DistInfoDistribution from pip._internal.metadata.pkg_resources import ( Distribution as PkgResourcesDistr...
[ "email.message.Message", "pip._vendor.packaging.specifiers.SpecifierSet", "pip._vendor.packaging.version.parse", "pip._internal.utils.pkg_resources.DictMetadata", "pytest.raises" ]
[((680, 689), 'email.message.Message', 'Message', ([], {}), '()\n', (687, 689), False, 'from email.message import Message\n'), ((1695, 1730), 'pip._internal.utils.pkg_resources.DictMetadata', 'DictMetadata', (["{'METADATA': b'\\xff'}"], {}), "({'METADATA': b'\\xff'})\n", (1707, 1730), False, 'from pip._internal.utils.p...
from django.urls import path from django.views.decorators.cache import cache_page from . import views app_name = "oauth" urlpatterns = [ path(r'oauth/authorize', views.authorize), path(r'oauth/requireemail/<int:oauthid>.html', views.RequireEmailView.as_view(), name='require_email'), path(r'oauth/emailconf...
[ "django.urls.path" ]
[((143, 183), 'django.urls.path', 'path', (['"""oauth/authorize"""', 'views.authorize'], {}), "('oauth/authorize', views.authorize)\n", (147, 183), False, 'from django.urls import path\n'), ((298, 392), 'django.urls.path', 'path', (['"""oauth/emailconfirm/<int:id>/<sign>.html"""', 'views.emailconfirm'], {'name': '"""em...
import re from .marshal import default_marshal, Marshallers, ParseError, represented_scalar, unicode_escaped RE_COMMENT = re.compile(r"\s+#.*$") def yaml_lines(lines, text=None, indent=None, folded=None, keep=False, continuations=False): """ Args: lines (list): Lines to concatenate together ...
[ "re.compile" ]
[((125, 147), 're.compile', 're.compile', (['"""\\\\s+#.*$"""'], {}), "('\\\\s+#.*$')\n", (135, 147), False, 'import re\n')]
from typing import Tuple, Optional import torch from torch import dtype as torch_dtype from torch import nn from .functional import time_to_batch, batch_to_time class BlockWiseConv1d(nn.Conv1d): """ Block-wise 1D-Convolution as used in original NSynth [http://arxiv.org/abs/1704.01279]. """ def ...
[ "torch.nn.init.constant_", "torch.nn.init.xavier_uniform_", "torch.nn.ConstantPad1d", "torch.nn.Module", "torch.zeros", "torch.cat" ]
[((1458, 1482), 'torch.nn.ConstantPad1d', 'nn.ConstantPad1d', (['pad', '(0)'], {}), '(pad, 0)\n', (1474, 1482), False, 'from torch import nn\n'), ((1607, 1638), 'torch.nn.init.xavier_uniform_', 'nn.init.xavier_uniform_', (['weight'], {}), '(weight)\n', (1630, 1638), False, 'from torch import nn\n'), ((1659, 1687), 'tor...
import datetime from sqlalchemy import create_engine, ForeignKey from sqlalchemy import Column, Date, Integer, String, DateTime, func from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import relationship, backref engine = create_engine('sqlite:///test.db', echo=True) Base = declarative_base()...
[ "sqlalchemy.func.now", "sqlalchemy.DateTime", "sqlalchemy.orm.backref", "sqlalchemy.create_engine", "sqlalchemy.ForeignKey", "sqlalchemy.ext.declarative.declarative_base", "sqlalchemy.Column" ]
[((249, 294), 'sqlalchemy.create_engine', 'create_engine', (['"""sqlite:///test.db"""'], {'echo': '(True)'}), "('sqlite:///test.db', echo=True)\n", (262, 294), False, 'from sqlalchemy import create_engine, ForeignKey\n'), ((302, 320), 'sqlalchemy.ext.declarative.declarative_base', 'declarative_base', ([], {}), '()\n', ...
''' Author: <NAME> Created Date: 2021-06-20 Last Modified: 2021-06-29 content: ''' import os import os.path as osp from collections import OrderedDict from functools import reduce import mmcv import numpy as np from mmcv.utils import print_log from prettytable import PrettyTable from torch.utils.data import Dataset ...
[ "prettytable.PrettyTable", "os.path.isabs", "numpy.unique", "mmcv.utils.print_log", "mmseg.core.my_eval_metrics", "os.path.join", "mmcv.is_list_of", "numpy.round", "os.remove" ]
[((6447, 6596), 'mmseg.core.my_eval_metrics', 'my_eval_metrics', (['results', 'gt_seg_maps', 'num_classes', 'self.ignore_index', 'metric'], {'label_map': 'self.label_map', 'reduce_zero_label': 'self.reduce_zero_label'}), '(results, gt_seg_maps, num_classes, self.ignore_index,\n metric, label_map=self.label_map, redu...
import logging import os import re import sys from enum import Enum import click from Bio import SeqIO from Bio.Seq import Seq from tqdm import tqdm tqdm.pandas() import pandas as pd import numpy as np logger = logging.getLogger(__name__) sys.path.append("..") from utils.clustering_utils import ClusteringUtils cl...
[ "logging.getLogger", "os.path.exists", "logging.StreamHandler", "tqdm.tqdm.pandas", "pandas.read_csv", "click.option", "os.makedirs", "click.Path", "Bio.SeqIO.parse", "os.getpid", "Bio.SeqIO.write", "re.sub", "os.system", "click.command", "sys.path.append", "pandas.notna" ]
[((151, 164), 'tqdm.tqdm.pandas', 'tqdm.pandas', ([], {}), '()\n', (162, 164), False, 'from tqdm import tqdm\n'), ((214, 241), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (231, 241), False, 'import logging\n'), ((243, 264), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('....
# coding=UTF-8 """ Tests the representation of indexes in backup files. """ import lib SET_NAMES = [None] + lib.index_variations(63) INDEX_NAMES = ["normal"] + lib.index_variations(63) INDEX_PATHS = ["normal"] + lib.index_variations(14) def create_indexes(create_func): """ Invokes the given index creation functio...
[ "lib.index_variations" ]
[((111, 135), 'lib.index_variations', 'lib.index_variations', (['(63)'], {}), '(63)\n', (131, 135), False, 'import lib\n'), ((163, 187), 'lib.index_variations', 'lib.index_variations', (['(63)'], {}), '(63)\n', (183, 187), False, 'import lib\n'), ((215, 239), 'lib.index_variations', 'lib.index_variations', (['(14)'], {...
# -*- coding: utf-8 -*- """ Machine Learning Model Training and Dumping the Model as a joblib file. """ #import requests #response = requests.get('https://www.politifact.com/factchecks/list/?page=2&category=coronavirus') #response.text import pandas as pd from sklearn.model_selection import train_test_split from...
[ "matplotlib.pyplot.imshow", "sklearn.metrics.accuracy_score", "nltk.corpus.stopwords.words", "pandas.read_csv", "nltk.download", "sklearn.metrics.classification_report", "joblib.dump", "sklearn.linear_model.PassiveAggressiveClassifier", "matplotlib.pyplot.style.use", "seaborn.heatmap", "wordclou...
[((531, 564), 'pandas.read_csv', 'pd.read_csv', (['"""APIData2000-FB.csv"""'], {}), "('APIData2000-FB.csv')\n", (542, 564), True, 'import pandas as pd\n'), ((1629, 1655), 'nltk.download', 'nltk.download', (['"""stopwords"""'], {}), "('stopwords')\n", (1642, 1655), False, 'import nltk\n'), ((1723, 1746), 'matplotlib.pyp...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright (C) 2016-2018 <NAME>, SMBYC # Email: xcorredorl at ideam.gov.co # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version...
[ "numpy.nanpercentile", "dask.array.map_blocks", "numpy.argsort", "numpy.array", "numpy.nanmean", "numpy.nanmin", "numpy.stack", "numpy.nanmax", "numpy.nanstd", "numpy.full", "dask.array.empty", "numpy.nanprod", "numpy.isnan", "numpy.ma.cov", "numpy.median", "numpy.nanmedian", "numpy....
[((652, 699), 'dask.array.empty', 'da.empty', (['Image.wrapper_shape'], {'chunks': 'chunksize'}), '(Image.wrapper_shape, chunks=chunksize)\n', (660, 699), True, 'import dask.array as da\n'), ((7581, 7683), 'dask.array.map_blocks', 'da.map_blocks', (['calc', 'wrapper_array'], {'chunks': 'wrapper_array.chunks', 'chunksiz...
# ------------------------------------------------------------------------------ # Program: The LDAR Simulator (LDAR-Sim) # File: methods.deployment.GHGSat1 # Purpose: GHGSat1 company specific deployment classes and methods # # Copyright (C) 2018-2021 Intelligent Methane Monitoring and Management System...
[ "random.choice", "utils.generic_functions.geo_idx", "numpy.float16" ]
[((1445, 1468), 'numpy.float16', 'np.float16', (["site['lat']"], {}), "(site['lat'])\n", (1455, 1468), True, 'import numpy as np\n'), ((1484, 1507), 'numpy.float16', 'np.float16', (["site['lon']"], {}), "(site['lon'])\n", (1494, 1507), True, 'import numpy as np\n'), ((1522, 1571), 'utils.generic_functions.geo_idx', 'ge...
# ###################################################################################################################### # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # # ...
[ "tempfile.TemporaryDirectory", "aws_cdk.aws_lambda.LayerVersionProps", "sys.path.insert", "jsii.create", "aws_solutions.core.get_service_client", "pathlib.Path", "aws_cdk.aws_lambda.Code.from_inline", "aws_cdk.aws_lambda.Code.from_asset", "botocore.stub.Stubber", "pytest.fixture" ]
[((2311, 2356), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""', 'autouse': '(True)'}), "(scope='session', autouse=True)\n", (2325, 2356), False, 'import pytest\n'), ((4093, 4121), 'pytest.fixture', 'pytest.fixture', ([], {'autouse': '(True)'}), '(autouse=True)\n', (4107, 4121), False, 'import pytest...
# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
[ "tests.test_libs.helpers.patch_environ", "tests.test_libs.helpers.patch" ]
[((809, 836), 'tests.test_libs.helpers.patch_environ', 'helpers.patch_environ', (['self'], {}), '(self)\n', (830, 836), False, 'from tests.test_libs import helpers\n'), ((841, 1103), 'tests.test_libs.helpers.patch', 'helpers.patch', (['self', "[('js_minimizer', 'bot.minimizer.js_minimizer.JSMinimizer.minimize'), (\n ...
import asyncio import logging from pathlib import Path import sanic import sanic.response import sanic.router import signal import ujson as json import websockets from apsis import __version__ import apsis.lib.logging from . import api, control from . import DEFAULT_PORT from ..apsis import Apsis from ..jo...
[ "logging.getLogger", "signal.signal", "pathlib.Path", "ujson.dumps", "logging.Formatter", "signal.Signals", "asyncio.ensure_future", "asyncio.get_event_loop", "logging.info" ]
[((431, 458), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (448, 458), False, 'import logging\n'), ((672, 791), 'logging.Formatter', 'logging.Formatter', ([], {'fmt': '"""%(asctime)s.%(msecs)03d %(name)-24s [%(levelname)-7s] %(message)s"""', 'datefmt': '"""%H:%M:%S"""'}), "(fmt=\n '%...
import pytest from hyperloop.Python import magnetic_drag import numpy as np from openmdao.api import Group, Problem def create_problem(magdrag): root = Group() prob = Problem(root) prob.root.add('comp', magdrag) return prob class TestVac(object): def test_case1_vs_breakpoint(self): magd...
[ "hyperloop.Python.magnetic_drag.MagDrag", "numpy.isclose", "openmdao.api.Problem", "openmdao.api.Group" ]
[((158, 165), 'openmdao.api.Group', 'Group', ([], {}), '()\n', (163, 165), False, 'from openmdao.api import Group, Problem\n'), ((177, 190), 'openmdao.api.Problem', 'Problem', (['root'], {}), '(root)\n', (184, 190), False, 'from openmdao.api import Group, Problem\n'), ((326, 349), 'hyperloop.Python.magnetic_drag.MagDra...
import itertools import logging import os.path as osp import tempfile import numpy as np from mmcv.utils import print_log from terminaltables import AsciiTable from .builder import DATASETS from .coco import CocoDataset # DATASETS.register_module(name='LVISDataset', module=LVISDataset) # LVISDataset = LVISV05Datas...
[ "itertools.chain", "tempfile.TemporaryDirectory", "lvis.LVIS", "lvis.LVISEval", "numpy.mean", "mmcv.utils.print_log", "os.path.join", "numpy.array", "numpy.zeros", "lvis.LVISResults", "terminaltables.AsciiTable", "numpy.arange" ]
[((20183, 20197), 'lvis.LVIS', 'LVIS', (['ann_file'], {}), '(ann_file)\n', (20187, 20197), False, 'from lvis import LVIS\n'), ((24173, 24199), 'numpy.arange', 'np.arange', (['(0.5)', '(0.96)', '(0.05)'], {}), '(0.5, 0.96, 0.05)\n', (24182, 24199), True, 'import numpy as np\n'), ((23239, 23276), 'numpy.array', 'np.array...
"""Platform for retrieving meteorological data from Environment Canada.""" import datetime import re from env_canada import ECData import voluptuous as vol from homeassistant.components.weather import ( ATTR_CONDITION_CLEAR_NIGHT, ATTR_CONDITION_CLOUDY, ATTR_CONDITION_FOG, ATTR_CONDITION_HAIL, ATT...
[ "voluptuous.Inclusive", "datetime.datetime.strptime", "voluptuous.error.Invalid", "env_canada.ECData", "homeassistant.util.dt.now", "datetime.timedelta", "re.fullmatch", "voluptuous.Optional", "voluptuous.In" ]
[((1158, 1203), 're.fullmatch', 're.fullmatch', (['"""[A-Z]{2}/s0000\\\\d{3}"""', 'station'], {}), "('[A-Z]{2}/s0000\\\\d{3}', station)\n", (1170, 1203), False, 'import re\n'), ((1219, 1284), 'voluptuous.error.Invalid', 'vol.error.Invalid', (['"""Station ID must be of the form "XX/s0000###\\""""'], {}), '(\'Station ID ...
from pathlib import Path from click.testing import CliRunner import notary from notary import cli def test_add_license_no_preexisting(): runner = CliRunner() with runner.isolated_filesystem(): license_file = Path("LICENSE") assert not license_file.exists() result = runner.invoke(cli....
[ "click.testing.CliRunner", "pathlib.Path" ]
[((154, 165), 'click.testing.CliRunner', 'CliRunner', ([], {}), '()\n', (163, 165), False, 'from click.testing import CliRunner\n'), ((749, 760), 'click.testing.CliRunner', 'CliRunner', ([], {}), '()\n', (758, 760), False, 'from click.testing import CliRunner\n'), ((1666, 1677), 'click.testing.CliRunner', 'CliRunner', ...
"""activate module for the cli.""" import logging from subprocess import PIPE, Popen import click __cmdname__ = "activate_cmd" __rootcmd__ = True IOCAGE_ZFS_ACTIVE_PROPERTY = "org.freebsd.ioc:active" lgr = logging.getLogger('ioc_cli_activate') def get_zfs_pools(): """ Returns all the ZFS pools available o...
[ "logging.getLogger", "click.argument", "click.option", "subprocess.Popen", "click.command" ]
[((210, 247), 'logging.getLogger', 'logging.getLogger', (['"""ioc_cli_activate"""'], {}), "('ioc_cli_activate')\n", (227, 247), False, 'import logging\n'), ((3103, 3178), 'click.command', 'click.command', ([], {'name': '"""activate"""', 'help': '"""Set a zpool active for iocage usage."""'}), "(name='activate', help='Se...
# Copyright 2018 The Cirq Developers # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
[ "numpy.sqrt", "cirq.testing.random_unitary", "numpy.diag", "numpy.kron", "numpy.array", "cmath.exp", "numpy.zeros", "numpy.empty", "pytest.raises", "cirq.linalg.matrix_commutes", "cirq.testing.random_density_matrix", "cirq.slice_for_qubits_equal_to" ]
[((13289, 13315), 'numpy.array', 'np.array', (['[[0, 1], [1, 0]]'], {}), '([[0, 1], [1, 0]])\n', (13297, 13315), True, 'import numpy as np\n'), ((13324, 13357), 'numpy.array', 'np.array', (['[[0, -1.0j], [1.0j, 0]]'], {}), '([[0, -1.0j], [1.0j, 0]])\n', (13332, 13357), True, 'import numpy as np\n'), ((13362, 13389), 'n...
''' Monk being monitor Monk being the monitor of the class needs to have all the information about the class students. He is very busy with many tasks related to the same, so he asked his friend Mishki for her help in one task. She will be given heights of all the students present in the class and she needs to choose 2...
[ "collections.Counter" ]
[((1819, 1842), 'collections.Counter', 'Counter', (['sorted_heights'], {}), '(sorted_heights)\n', (1826, 1842), False, 'from collections import Counter\n')]
# coding: utf-8 """ Copyright 2017 Square, 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 la...
[ "six.iteritems" ]
[((4296, 4325), 'six.iteritems', 'iteritems', (['self.swagger_types'], {}), '(self.swagger_types)\n', (4305, 4325), False, 'from six import iteritems\n')]
from app.http.controllers.ControllerTest import ControllerTest from src.masonite.routes import Get, Match from src.masonite.testing import TestCase from src.masonite.exceptions import RouteNotFoundException class TestRouteProvider(TestCase): def setUp(self): super().setUp() self.buildOwnContaine...
[ "src.masonite.routes.Get", "src.masonite.routes.Match" ]
[((402, 435), 'src.masonite.routes.Get', 'Get', (['"""/view"""', 'ControllerTest.test'], {}), "('/view', ControllerTest.test)\n", (405, 435), False, 'from src.masonite.routes import Get, Match\n'), ((437, 471), 'src.masonite.routes.Get', 'Get', (['"""/view/"""', 'ControllerTest.test'], {}), "('/view/', ControllerTest.t...
''' 019 Um professor quer sortear um dos seus quatro alunos para apagar o quadro. Faça um programa que ajude ele, lendo o nome deles e escrevendo o nome escolhido''' import random escolhido = random.randint(1, 4) print(f'O professor escolheu o número {escolhido}') # mais complexo n1 = input('Digite um nome: ') n2 ...
[ "random.choice", "random.randint" ]
[((195, 215), 'random.randint', 'random.randint', (['(1)', '(4)'], {}), '(1, 4)\n', (209, 215), False, 'import random\n'), ((466, 486), 'random.choice', 'random.choice', (['lista'], {}), '(lista)\n', (479, 486), False, 'import random\n')]
# -*- coding: utf-8 -*- """ Semantic models for interpreting graphs. """ from typing import ( cast, Optional, Tuple, List, Dict, Set, Iterable, Mapping, Any) import re from collections import defaultdict import random from penman.exceptions import ModelError from penman.types import ( Variable, Role, ...
[ "re.match", "collections.defaultdict", "penman.exceptions.ModelError", "random.random", "typing.cast" ]
[((1977, 1994), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (1988, 1994), False, 'from collections import defaultdict\n'), ((2045, 2062), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (2056, 2062), False, 'from collections import defaultdict\n'), ((4565, 4587), 'typing....
import datetime from django.shortcuts import render from django.shortcuts import redirect from django.contrib.auth import authenticate from django.contrib.auth import login from django.utils import timezone from django.conf import settings from rest_framework import generics from . import forms from . import models f...
[ "django.shortcuts.render", "django.contrib.auth.authenticate", "django.contrib.auth.login", "django.utils.timezone.now", "django.shortcuts.redirect", "datetime.timedelta" ]
[((986, 1044), 'django.shortcuts.render', 'render', (['request', '"""tags/works.html"""', "{'extrapic': extrapic}"], {}), "(request, 'tags/works.html', {'extrapic': extrapic})\n", (992, 1044), False, 'from django.shortcuts import render\n'), ((1522, 1594), 'django.shortcuts.render', 'render', (['request', '"""tags/logi...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """plot.py Code to generate plots of pdp output (c) The James Hutton Institute 2018 Author: <NAME> Contact: <EMAIL> <NAME>, Information and Computing Sciences, James Hutton Institute, Errol Road, Invergowrie, Dundee, DD2 5DA, Scotland, UK The MIT License Copyright (c...
[ "pandas.read_csv", "plotly.offline.plot", "os.path.join", "plotly.graph_objs.Scatter", "plotly.graph_objs.Figure" ]
[((1941, 1969), 'pandas.read_csv', 'pd.read_csv', (['fname'], {'sep': '"""\t"""'}), "(fname, sep='\\t')\n", (1952, 1969), True, 'import pandas as pd\n'), ((1984, 2069), 'plotly.graph_objs.Scatter', 'go.Scatter', ([], {'x': 'data.nonunique', 'y': 'data.dist_mean', 'text': 'data.primer', 'mode': '"""markers"""'}), "(x=da...
#-*- coding:utf-8 -*- import torch from torchvision import transforms import cv2 from PIL import Image, ImageOps import numpy as np import pickle from torchvision.datasets import VisionDataset from torchvision.datasets.folder import default_loader,make_dataset,IMG_EXTENSIONS from pycocotools.coco import COCO import os ...
[ "torchvision.transforms.ToPILImage", "torch.LongTensor", "torchvision.transforms.ColorJitter", "numpy.array", "pycocotools.coco.COCO", "torchvision.transforms.ToTensor", "torchvision.datasets.folder.make_dataset", "pickle.load", "PIL.ImageOps.solarize", "torchvision.transforms.Normalize", "torch...
[((6391, 6433), 'torchvision.transforms.ColorJitter', 'transforms.ColorJitter', (['(0.4)', '(0.4)', '(0.2)', '(0.1)'], {}), '(0.4, 0.4, 0.2, 0.1)\n', (6413, 6433), False, 'from torchvision import transforms\n'), ((6450, 6525), 'torchvision.transforms.Normalize', 'transforms.Normalize', ([], {'mean': '[0.485, 0.456, 0.4...
import os import multiprocessing from timeit import default_timer as timer from definitions import ROOT_PATH from definitions import TRAIN_PATH from data.preprocessor import Options from data.loaders import load_and_clean_data from gensim.models.doc2vec import TaggedDocument from gensim.models import Doc2Vec from ...
[ "gensim.models.Doc2Vec", "timeit.default_timer", "sklearn.utils.shuffle", "os.path.join", "multiprocessing.cpu_count", "data.loaders.load_and_clean_data" ]
[((352, 379), 'multiprocessing.cpu_count', 'multiprocessing.cpu_count', ([], {}), '()\n', (377, 379), False, 'import multiprocessing\n'), ((1008, 1015), 'timeit.default_timer', 'timer', ([], {}), '()\n', (1013, 1015), True, 'from timeit import default_timer as timer\n'), ((2333, 2379), 'data.loaders.load_and_clean_data...
import re, json, glob, os.path, sys from bs4 import BeautifulSoup args = sys.argv html_dir = args[1] csv_file = args[2] html_files = glob.glob(html_dir + "*") csv_header = '"doc_id","category","text_id","text"' with open(csv_file, 'w') as w_csv: w_csv.writelines(csv_header + '\n') for html_file in html_files: ...
[ "glob.glob" ]
[((135, 160), 'glob.glob', 'glob.glob', (["(html_dir + '*')"], {}), "(html_dir + '*')\n", (144, 160), False, 'import re, json, glob, os.path, sys\n')]
# -*- coding: utf-8 -*- from django.db import models from datetime import datetime # Create your models here. class Clarification(models.Model): cid = models.IntegerField() asker = models.TextField() question = models.TextField() reply = models.TextField() time = models.DateTimeField(default=datet...
[ "django.db.models.TextField", "django.db.models.ForeignKey", "django.db.models.IntegerField", "datetime.datetime.now", "django.db.models.CharField" ]
[((157, 178), 'django.db.models.IntegerField', 'models.IntegerField', ([], {}), '()\n', (176, 178), False, 'from django.db import models\n'), ((191, 209), 'django.db.models.TextField', 'models.TextField', ([], {}), '()\n', (207, 209), False, 'from django.db import models\n'), ((225, 243), 'django.db.models.TextField', ...
from bs4 import BeautifulSoup as bs import requests as req from ebooklib import epub def nf_get(nov_name, hdr, book, t=0): usr_inp = str('https://novelfull.com' + '/' + nov_name + '.html') try: temp_src = req.get(usr_inp, headers = hdr) s1 = bs(temp_src.text, 'lxml') lastpage_get = s1.find('li', class_='last...
[ "bs4.BeautifulSoup", "requests.get" ]
[((212, 241), 'requests.get', 'req.get', (['usr_inp'], {'headers': 'hdr'}), '(usr_inp, headers=hdr)\n', (219, 241), True, 'import requests as req\n'), ((251, 276), 'bs4.BeautifulSoup', 'bs', (['temp_src.text', '"""lxml"""'], {}), "(temp_src.text, 'lxml')\n", (253, 276), True, 'from bs4 import BeautifulSoup as bs\n'), (...
from __future__ import absolute_import, print_function, division import numpy as np from numba import vectorize from numba import ocl, float64 from numba import unittest_support as unittest from numba import config from numba.ocl.testing import OCLTestCase sig = [float64(float64, float64)] target='ocl' class TestO...
[ "numba.unittest_support.main", "numba.vectorize", "numba.float64", "numba.ocl.to_device", "numpy.arange" ]
[((265, 290), 'numba.float64', 'float64', (['float64', 'float64'], {}), '(float64, float64)\n', (272, 290), False, 'from numba import ocl, float64\n'), ((802, 817), 'numba.unittest_support.main', 'unittest.main', ([], {}), '()\n', (815, 817), True, 'from numba import unittest_support as unittest\n'), ((406, 435), 'numb...
import logging from concurrent.futures import ThreadPoolExecutor import pytest from functools import partial from ocs_ci.framework.testlib import ManageTest, tier4 from ocs_ci.framework import config from ocs_ci.ocs import constants from ocs_ci.ocs.resources.pvc import get_all_pvcs, delete_pvcs from ocs_ci.ocs.resourc...
[ "logging.getLogger", "ocs_ci.ocs.resources.pod.get_fio_rw_iops", "tests.disruption_helpers.Disruptions", "pytest.mark.bugzilla", "ocs_ci.ocs.resources.pod.get_all_pods", "tests.helpers.wait_for_resource_state", "tests.helpers.verify_pv_mounted_on_node", "functools.partial", "ocs_ci.utility.utils.Tim...
[((807, 834), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (824, 834), False, 'import logging\n'), ((3017, 3033), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (3031, 3033), False, 'import pytest\n'), ((9024, 9056), 'tests.disruption_helpers.Disruptions', 'disruption_helpers.Dis...
""" Dynamically generate the NRT module """ from __future__ import print_function, absolute_import, division from numba.config import MACHINE_BITS from numba import cgutils, types from llvmlite import ir # Flag to enable debug print in NRT_incref and NRT_decref _debug_print = False _word_type = ir.IntType(MACHINE_B...
[ "llvmlite.ir.VoidType", "llvmlite.ir.LiteralStructType", "llvmlite.ir.Constant", "llvmlite.ir.FunctionType", "llvmlite.ir.IRBuilder", "numba.cgutils.gep", "llvmlite.ir.IntType", "numba.cgutils.get_null_value", "numba.cgutils.if_unlikely", "llvmlite.ir.Function", "numba.cgutils.unpack_tuple" ]
[((300, 324), 'llvmlite.ir.IntType', 'ir.IntType', (['MACHINE_BITS'], {}), '(MACHINE_BITS)\n', (310, 324), False, 'from llvmlite import ir\n'), ((395, 490), 'llvmlite.ir.LiteralStructType', 'ir.LiteralStructType', (['[_word_type, _pointer_type, _pointer_type, _pointer_type, _word_type]'], {}), '([_word_type, _pointer_t...
import numpy as np import pandas as pd from autots.tools.impute import FillNA from autots.tools.shaping import infer_frequency from autots.tools.seasonal import date_part from autots.tools.holiday import holiday_flag def create_regressor( df, forecast_length, frequency: str = "infer", holiday_countrie...
[ "autots.tools.impute.FillNA", "autots.tools.holiday.holiday_flag", "autots.tools.seasonal.date_part", "sklearn.decomposition.PCA", "sklearn.random_projection.GaussianRandomProjection", "sklearn.preprocessing.StandardScaler", "autots.tools.shaping.infer_frequency", "sklearn.cluster.FeatureAgglomeration...
[((8034, 8060), 'autots.tools.impute.FillNA', 'FillNA', (['df'], {'method': 'fill_na'}), '(df, method=fill_na)\n', (8040, 8060), False, 'from autots.tools.impute import FillNA\n'), ((2724, 2743), 'autots.tools.shaping.infer_frequency', 'infer_frequency', (['df'], {}), '(df)\n', (2739, 2743), False, 'from autots.tools.s...
#!/usr/bin/env python # coding: utf-8 # # Project: Azimuthal integration # https://github.com/silx-kit/pyFAI # # Copyright (C) 2015-2018 European Synchrotron Radiation Facility, Grenoble, France # # Principal author: <NAME> (<EMAIL>) # # Permission is hereby granted, free of charge, to any pe...
[ "logging.getLogger", "unittest.TestSuite", "unittest.TextTestRunner" ]
[((1608, 1635), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1625, 1635), False, 'import logging\n'), ((6766, 6786), 'unittest.TestSuite', 'unittest.TestSuite', ([], {}), '()\n', (6784, 6786), False, 'import unittest\n'), ((6949, 6974), 'unittest.TextTestRunner', 'unittest.TextTestRunn...
import unittest2 as unittest from mock import Mock, patch from requests.exceptions import RequestException from job_runner_worker.models import ( BaseRestModel, KillRequest, RequestClientError, RequestServerError, Run, retry_on_requests_error ) class ModuleTestCase(unittest.TestCase): ""...
[ "mock.patch", "job_runner_worker.models.retry_on_requests_error", "mock.Mock", "job_runner_worker.models.BaseRestModel", "job_runner_worker.models.BaseRestModel.get_list" ]
[((383, 421), 'mock.patch', 'patch', (['"""job_runner_worker.models.time"""'], {}), "('job_runner_worker.models.time')\n", (388, 421), False, 'from mock import Mock, patch\n'), ((932, 974), 'mock.patch', 'patch', (['"""job_runner_worker.models.HmacAuth"""'], {}), "('job_runner_worker.models.HmacAuth')\n", (937, 974), F...
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
[ "azure.cli.core.commands.CliCommandType" ]
[((853, 1011), 'azure.cli.core.commands.CliCommandType', 'CliCommandType', ([], {'operations_tmpl': '"""azext_codespaces.vendored_sdks.vsonline.operations.plan_operations#PlanOperations.{}"""', 'client_factory': 'cf_codespaces'}), "(operations_tmpl=\n 'azext_codespaces.vendored_sdks.vsonline.operations.plan_operatio...
""" Copyright 2019 <NAME> 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 distributed...
[ "numpy.tan", "datetime.datetime.strptime", "numpy.size", "pandas.DataFrame", "datetime.timedelta", "pandas.concat", "pandas.date_range" ]
[((1174, 1230), 'datetime.datetime.strptime', 'datetime.datetime.strptime', (['date_start', '"""%Y-%m-%dT%H:%M"""'], {}), "(date_start, '%Y-%m-%dT%H:%M')\n", (1200, 1230), False, 'import datetime\n'), ((1340, 1394), 'datetime.datetime.strptime', 'datetime.datetime.strptime', (['date_end', '"""%Y-%m-%dT%H:%M"""'], {}), ...
from tornado import web from tornado import httpserver import tornado.ioloop from tornado import options options.define('port',default=8000,type=int) options.define('list',default=[],type=str,multiple=True) # 类似与Django中的类试图一样 通过方法进行匹配 class IndexHandler(web.RequestHandler): def get(self,*args,**kwargs): ...
[ "tornado.options.parse_command_line", "tornado.httpserver.start", "tornado.httpserver.HTTPServer", "tornado.web.Application", "tornado.options.define", "tornado.httpserver.bind" ]
[((108, 154), 'tornado.options.define', 'options.define', (['"""port"""'], {'default': '(8000)', 'type': 'int'}), "('port', default=8000, type=int)\n", (122, 154), False, 'from tornado import options\n'), ((153, 212), 'tornado.options.define', 'options.define', (['"""list"""'], {'default': '[]', 'type': 'str', 'multipl...
#!/usr/bin/env python3 import sys import numpy as np from badgyal.policy_index import policy_index columns = 'abcdefgh' rows = '12345678' promotions = 'rbq' # N is encoded as normal move col_index = {columns[i] : i for i in range(len(columns))} row_index = {rows[i] : i for i in range(len(rows))} def index_to_positio...
[ "numpy.sum", "badgyal.policy_index.policy_index.index" ]
[((3307, 3328), 'badgyal.policy_index.policy_index.index', 'policy_index.index', (['m'], {}), '(m)\n', (3325, 3328), False, 'from badgyal.policy_index import policy_index\n'), ((3439, 3456), 'numpy.sum', 'np.sum', (['az_to_lc0'], {}), '(az_to_lc0)\n', (3445, 3456), True, 'import numpy as np\n')]
# Lint as: python3 # Copyright 2021 The TensorFlow Authors. 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 ...
[ "lingvo.jax.layers.normalizations.BatchNorm.Params", "jax.lax.conv_dimension_numbers", "jax.numpy.reshape", "lingvo.jax.layers.normalizations.LayerNorm.Params", "lingvo.jax.layers.stochastics.Dropout.Params", "jax.numpy.expand_dims", "lingvo.jax.layers.activations.Activation.Params", "lingvo.jax.layer...
[((5220, 5511), 'jax.lax.conv_general_dilated', 'jax.lax.conv_general_dilated', ([], {'lhs': 'inputs', 'rhs': 'theta.w', 'window_strides': 'p.filter_stride', 'padding': '[(pad_height_beg, pad_height_end), (pad_width_beg, pad_width_end)]', 'rhs_dilation': 'p.dilations', 'dimension_numbers': "('NHWC', 'HWIO', 'NHWC')", '...
# This code is based on ufoProcessor code, which is licensed as follows: # Copyright (c) 2017-2018 LettError and <NAME> # All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Softwar...
[ "logging.getLogger", "attr.s", "ufoLib2.objects.Glyph", "fontTools.varLib.models.normalizeLocation", "fontMath.mathFunctions.setRoundIntegerFunction", "fontTools.varLib.models.VariationModel", "fontMath.MathInfo", "fontMath.MathGlyph", "fontTools.designspaceLib.evaluateRule", "fontTools.varLib.mod...
[((1937, 1964), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1954, 1964), False, 'import logging\n'), ((2119, 2205), 'fontMath.mathFunctions.setRoundIntegerFunction', 'fontMath.mathFunctions.setRoundIntegerFunction', (['fontTools.misc.fixedTools.otRound'], {}), '(fontTools.misc.fixedTo...
# Generated by Django 2.0.8 on 2018-09-30 17:48 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('api', '0003_auto_20180930_1732'), ] operations = [ migrations.AlterField( model_name='playlist'...
[ "django.db.models.ManyToManyField", "django.db.models.ForeignKey" ]
[((366, 475), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'on_delete': 'django.db.models.deletion.CASCADE', 'related_name': '"""playlists"""', 'to': '"""api.Party"""'}), "(on_delete=django.db.models.deletion.CASCADE, related_name\n ='playlists', to='api.Party')\n", (383, 475), False, 'from django.db im...
# -*- coding: utf-8 -*- import subprocess import json import sys import necessaryFuncs as nf proc_out = subprocess.run(['i3-msg', '-t', 'get_workspaces'], stdout=subprocess.PIPE) wkList = json.loads(proc_out.stdout.decode('utf-8')) allWKNames = nf.getWKNames(wkList) currentWK = nf.getFocusedWK(wkList) currentProj =...
[ "necessaryFuncs.getWKNamesFromProj", "sys.exit", "necessaryFuncs.getWKNames", "subprocess.run", "subprocess.call", "necessaryFuncs.getFocusedWK", "necessaryFuncs.getProjectFromWKName" ]
[((105, 179), 'subprocess.run', 'subprocess.run', (["['i3-msg', '-t', 'get_workspaces']"], {'stdout': 'subprocess.PIPE'}), "(['i3-msg', '-t', 'get_workspaces'], stdout=subprocess.PIPE)\n", (119, 179), False, 'import subprocess\n'), ((247, 268), 'necessaryFuncs.getWKNames', 'nf.getWKNames', (['wkList'], {}), '(wkList)\n...
import cv2 import dlib import numpy as np # Path to shape predictor file PATH = 'shape_predictor_68_face_landmarks.dat' # Our landpoints' predictor and detector objects predictor = dlib.shape_predictor(PATH) detector = dlib.get_frontal_face_detector() # Reading our image img = cv2.imread('images/mr_robot.jpg') # D...
[ "dlib.shape_predictor", "cv2.imshow", "dlib.get_frontal_face_detector", "cv2.circle", "cv2.destroyAllWindows", "cv2.waitKey", "cv2.imread" ]
[((183, 209), 'dlib.shape_predictor', 'dlib.shape_predictor', (['PATH'], {}), '(PATH)\n', (203, 209), False, 'import dlib\n'), ((221, 253), 'dlib.get_frontal_face_detector', 'dlib.get_frontal_face_detector', ([], {}), '()\n', (251, 253), False, 'import dlib\n'), ((282, 315), 'cv2.imread', 'cv2.imread', (['"""images/mr_...
import torch import torch.nn as nn import torch.nn.functional as F from torch.distributions import Normal from torch.distributions.transforms import TanhTransform from rl_sandbox.constants import OBS_RMS, VALUE_RMS, CPU from rl_sandbox.model_architectures.utils import RunningMeanStd class ActorCritic(nn.Module): ...
[ "torch.ones", "torch.distributions.Normal", "torch.distributions.transforms.TanhTransform", "torch.exp", "torch.min", "torch.nn.functional.softplus", "torch.tensor", "rl_sandbox.model_architectures.utils.RunningMeanStd", "torch.nn.utils.rnn.pack_padded_sequence", "torch.no_grad", "torch.nn.utils...
[((423, 440), 'torch.device', 'torch.device', (['CPU'], {}), '(CPU)\n', (435, 440), False, 'import torch\n'), ((1158, 1197), 'torch.cat', 'torch.cat', (['(obs, extra_features)'], {'dim': '(1)'}), '((obs, extra_features), dim=1)\n', (1167, 1197), False, 'import torch\n'), ((2640, 2657), 'torch.device', 'torch.device', (...
import os train_src="../dynet_nmt/data/train.de-en.de.wmixerprep" train_tgt="../dynet_nmt/data/train.de-en.en.wmixerprep" dev_src="../dynet_nmt/data/valid.de-en.de" dev_tgt="../dynet_nmt/data/valid.de-en.en" test_src="../dynet_nmt/data/test.de-en.de" test_tgt="../dynet_nmt/data/test.de-en.en" for temp in [0.5]: j...
[ "os.system" ]
[((1230, 1275), 'os.system', 'os.system', (["('bash submit_job.sh %s' % job_file)"], {}), "('bash submit_job.sh %s' % job_file)\n", (1239, 1275), False, 'import os\n')]
from django.http import HttpRequest, HttpResponse, HttpResponseBadRequest from django.shortcuts import render, get_object_or_404 from . import forms from .models import Comment, Post, Tag def index_view(request: HttpRequest) -> HttpResponse: posts = Post.objects.order_by('-created_at').all() tags = Tag.objec...
[ "django.shortcuts.render", "django.shortcuts.get_object_or_404" ]
[((340, 401), 'django.shortcuts.render', 'render', (['request', '"""index.html"""', "{'posts': posts, 'tags': tags}"], {}), "(request, 'index.html', {'posts': posts, 'tags': tags})\n", (346, 401), False, 'from django.shortcuts import render, get_object_or_404\n'), ((505, 540), 'django.shortcuts.get_object_or_404', 'get...
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making GameAISDK available. This source code file is licensed under the GNU General Public License Version 3. For full details, please refer to the file "LICENSE.txt" which is provided as part of this source code package. Copyright...
[ "logging.getLogger", "os.path.exists", "logging.StreamHandler", "os.makedirs", "logging.Formatter", "os.environ.get", "logging.warning", "os.path.join", "cv2.waitKey", "os.getpid", "os.path.abspath", "sys.path.append", "logging.error" ]
[((1090, 1114), 'sys.path.append', 'sys.path.append', (['cur_dir'], {}), '(cur_dir)\n', (1105, 1114), False, 'import sys\n'), ((1063, 1088), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (1078, 1088), False, 'import os\n'), ((1392, 1403), 'os.getpid', 'os.getpid', ([], {}), '()\n', (1401, 14...
# MIT License # # Copyright (C) IBM Corporation 2018 # # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated # documentation files (the "Software"), to deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge...
[ "logging.getLogger", "art.utils.load_mnist", "art.classifiers.KerasClassifier", "keras.layers.Conv2D", "keras.layers.Flatten", "keras.layers.MaxPooling2D", "numpy.unique", "keras.models.Sequential", "keras.layers.Dense", "art.utils.master_seed", "keras.layers.Dropout", "unittest.main", "nump...
[((1522, 1553), 'logging.getLogger', 'logging.getLogger', (['"""testLogger"""'], {}), "('testLogger')\n", (1539, 1553), False, 'import logging\n'), ((7169, 7184), 'unittest.main', 'unittest.main', ([], {}), '()\n', (7182, 7184), False, 'import unittest\n'), ((1823, 1835), 'art.utils.load_mnist', 'load_mnist', ([], {}),...
#program to push an item on the heap, then pop and return the smallest item from the heap. import heapq heap = [] heapq.heappush(heap, ('V', 3)) heapq.heappush(heap, ('V', 2)) heapq.heappush(heap, ('V', 1)) print("Items in the heap:") for a in heap: print(a) print("----------------------") print("Using heappushpop pus...
[ "heapq.heappush", "heapq.heappushpop" ]
[((114, 144), 'heapq.heappush', 'heapq.heappush', (['heap', "('V', 3)"], {}), "(heap, ('V', 3))\n", (128, 144), False, 'import heapq\n'), ((145, 175), 'heapq.heappush', 'heapq.heappush', (['heap', "('V', 2)"], {}), "(heap, ('V', 2))\n", (159, 175), False, 'import heapq\n'), ((176, 206), 'heapq.heappush', 'heapq.heappus...
#!/usr/bin/env python3 # coding=utf-8 import sys import os import json from urllib.parse import urlencode from urllib.request import urlopen, Request, URLError, HTTPError from argparse import ArgumentParser BASE_URL = "https://api.nature.global" BASE_PATH = os.path.dirname(os.path.abspath(__file__)) TOKE...
[ "json.loads", "argparse.ArgumentParser", "urllib.parse.urlencode", "urllib.request.Request", "json.dumps", "os.path.join", "json.load", "sys.exit", "os.path.abspath", "urllib.request.urlopen" ]
[((334, 370), 'os.path.join', 'os.path.join', (['BASE_PATH', '"""token.txt"""'], {}), "(BASE_PATH, 'token.txt')\n", (346, 370), False, 'import os\n'), ((389, 431), 'os.path.join', 'os.path.join', (['BASE_PATH', '"""appliances.json"""'], {}), "(BASE_PATH, 'appliances.json')\n", (401, 431), False, 'import os\n'), ((706, ...
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import torch import torch.nn as nn import torch.nn.functional as F from callonce import printonce class SimpleSTModule(nn.Module): def __init__(self, spatial_type: str = 'avg', spatial...
[ "torch.nn.Dropout", "torch.nn.init.constant_", "torch.nn.AvgPool3d", "torch.nn.MaxPool3d", "torch.nn.AdaptiveMaxPool3d", "torch.nn.AdaptiveAvgPool3d", "torch.nn.functional.cross_entropy", "torch.nn.Linear", "torch.no_grad", "torch.nn.init.normal_" ]
[((2837, 2872), 'torch.nn.Linear', 'nn.Linear', (['in_channels', 'num_classes'], {}), '(in_channels, num_classes)\n', (2846, 2872), True, 'import torch.nn as nn\n'), ((2944, 2997), 'torch.nn.init.normal_', 'nn.init.normal_', (['self.fc_cls.weight', '(0)', 'self.init_std'], {}), '(self.fc_cls.weight, 0, self.init_std)\n...
# はじめてのNumPy # 参考 http://qiita.com/wellflat/items/284ecc4116208d155e01 # 2016/1/16 import numpy as np a = np.array([[1,2,3], [4,5,6], [7,8,9], [10,11,12]]) print(a) print(a.flags) # C_CONTIGUOUS : True ## データがメモリ上に連続しているか(C配列型) # F_CONTIGUOUS : False ## 同上(Fortran配列型) # OWNDATA : True ## 自分のデータかどうか、ビュー...
[ "numpy.array" ]
[((108, 165), 'numpy.array', 'np.array', (['[[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]]'], {}), '([[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]])\n', (116, 165), True, 'import numpy as np\n')]
from rest_framework.generics import RetrieveAPIView from rest_framework.permissions import IsAuthenticated from api.clusters.serializers import ClusterSerializer from db.models.clusters import Cluster class ClusterDetailView(RetrieveAPIView): """Get cluster details.""" queryset = Cluster.objects.all() pe...
[ "db.models.clusters.Cluster.load", "db.models.clusters.Cluster.objects.all" ]
[((292, 313), 'db.models.clusters.Cluster.objects.all', 'Cluster.objects.all', ([], {}), '()\n', (311, 313), False, 'from db.models.clusters import Cluster\n'), ((470, 484), 'db.models.clusters.Cluster.load', 'Cluster.load', ([], {}), '()\n', (482, 484), False, 'from db.models.clusters import Cluster\n')]
#!/usr/bin/env python3 from collections import defaultdict import arrow import requests GENERATION_URL = "https://sldcapi.pstcl.org/wsDataService.asmx/pbGenData2" DATE_URL = "https://sldcapi.pstcl.org/wsDataService.asmx/dynamicData" GENERATION_MAPPING = { "totalHydro": "hydro", "totalThermal": "coal", "...
[ "arrow.get", "arrow.now", "requests.Session" ]
[((564, 600), 'arrow.get', 'arrow.get', (['ts'], {'tzinfo': '"""Asia/Kolkata"""'}), "(ts, tzinfo='Asia/Kolkata')\n", (573, 600), False, 'import arrow\n'), ((1234, 1252), 'requests.Session', 'requests.Session', ([], {}), '()\n', (1250, 1252), False, 'import requests\n'), ((2284, 2302), 'requests.Session', 'requests.Sess...
from fastapi import FastAPI from fastapi.testclient import TestClient # By importing the app, its on_startup and on_shutdown hooks are called, # and we have access to its state. from server import app client = TestClient(app) def test_root(): response = client.get("/") assert response.status_code == 200 ...
[ "fastapi.testclient.TestClient" ]
[((212, 227), 'fastapi.testclient.TestClient', 'TestClient', (['app'], {}), '(app)\n', (222, 227), False, 'from fastapi.testclient import TestClient\n')]
from django.conf import settings from django.conf.urls import patterns, include, url # from django.conf.urls import include, url from handball.views import * from django.conf.urls.static import static from django.contrib import admin admin.autodiscover() urlpatterns = [ url(r'^grappelli/', include('grappelli.urls...
[ "django.conf.urls.include", "django.conf.urls.url", "django.contrib.admin.autodiscover" ]
[((234, 254), 'django.contrib.admin.autodiscover', 'admin.autodiscover', ([], {}), '()\n', (252, 254), False, 'from django.contrib import admin\n'), ((376, 392), 'django.conf.urls.url', 'url', (['"""^$"""', 'index'], {}), "('^$', index)\n", (379, 392), False, 'from django.conf.urls import patterns, include, url\n'), ((...
import numpy as np km2 = np.array([44410., 5712., 37123., 0., 25757.]) anos2 = np.array([2003, 1991, 1990, 2019, 2006]) idade = 2019 - anos2 km_media = km2 / idade
[ "numpy.array" ]
[((26, 76), 'numpy.array', 'np.array', (['[44410.0, 5712.0, 37123.0, 0.0, 25757.0]'], {}), '([44410.0, 5712.0, 37123.0, 0.0, 25757.0])\n', (34, 76), True, 'import numpy as np\n'), ((80, 120), 'numpy.array', 'np.array', (['[2003, 1991, 1990, 2019, 2006]'], {}), '([2003, 1991, 1990, 2019, 2006])\n', (88, 120), True, 'imp...