code stringlengths 20 1.04M | apis list | extract_api stringlengths 75 9.94M |
|---|---|---|
import numpy as np
import os
import paddle.fluid as fluid
from net import wide_deep
import logging
import paddle
import args
import utils
import time
logging.basicConfig(format='%(asctime)s - %(levelname)s - %(message)s')
logger = logging.getLogger("fluid")
logger.setLevel(logging.INFO)
def train(args, train_data_pat... | [
"paddle.fluid.Executor",
"paddle.fluid.CUDAPlace",
"paddle.fluid.default_main_program",
"args.parse_args",
"net.wide_deep",
"logging.basicConfig",
"paddle.fluid.default_startup_program",
"time.time",
"numpy.array",
"paddle.fluid.CPUPlace",
"paddle.fluid.optimizer.AdagradOptimizer",
"paddle.flu... | [((151, 222), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s - %(levelname)s - %(message)s"""'}), "(format='%(asctime)s - %(levelname)s - %(message)s')\n", (170, 222), False, 'import logging\n'), ((232, 258), 'logging.getLogger', 'logging.getLogger', (['"""fluid"""'], {}), "('fluid')\n", ... |
"""Tests for nb_clean.check_notebook."""
import nbformat
import pytest
import nb_clean
@pytest.mark.parametrize(
"notebook,is_clean",
[
# pylint: disable=no-member
(pytest.lazy_fixture("clean_notebook"), True), # type: ignore
(pytest.lazy_fixture("dirty_notebook"), False), # type: ... | [
"pytest.mark.parametrize",
"pytest.lazy_fixture",
"nb_clean.check_notebook"
] | [((609, 669), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""remove_empty_cells"""', '[True, False]'], {}), "('remove_empty_cells', [True, False])\n", (632, 669), False, 'import pytest\n'), ((1076, 1140), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""preserve_cell_metadata"""', '[True, False]... |
#script to check open graph tags
#include libs
import sys
sys.path.insert(0, '..')
from include import *
today = date.today()
def og(hash, code):
module = 'check og'
pattern = '*og:*'
value = '0'
if Helpers.matchText(code, pattern):
value = '1'
check_evaluations_result(hash, module, v... | [
"sys.path.insert"
] | [((60, 84), 'sys.path.insert', 'sys.path.insert', (['(0)', '""".."""'], {}), "(0, '..')\n", (75, 84), False, 'import sys\n')] |
# Generated by Django 3.1.1 on 2020-09-14 21:56
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('places', '0008_auto_20200915_0048'),
]
operations = [
migrations.AlterField(
model_name='image',
name='position',
... | [
"django.db.models.PositiveIntegerField"
] | [((336, 397), 'django.db.models.PositiveIntegerField', 'models.PositiveIntegerField', ([], {'blank': '(True)', 'default': '(0)', 'null': '(True)'}), '(blank=True, default=0, null=True)\n', (363, 397), False, 'from django.db import migrations, models\n')] |
import pytest, subprocess
from pathlib import Path, PosixPath
import context
from src.file_renamer import *
from create_fhs import create_fhs
FILE_SYSTEM = FileSystem(Path("test/fhs.txt").read_text().strip().split("\n"), is_pure=True)
def test_parse_new_names():
new_names_ok = [ # path -> new_name
"#0... | [
"subprocess.run",
"pytest.raises",
"create_fhs.create_fhs",
"pathlib.Path"
] | [((5748, 5760), 'create_fhs.create_fhs', 'create_fhs', ([], {}), '()\n', (5758, 5760), False, 'from create_fhs import create_fhs\n'), ((8988, 9029), 'subprocess.run', 'subprocess.run', (["['rm', '-rf', 'test/FHS']"], {}), "(['rm', '-rf', 'test/FHS'])\n", (9002, 9029), False, 'import pytest, subprocess\n'), ((9058, 9070... |
from core.util.sum import sum_array
class LowMedianWeightedInsertion:
def __init__(self):
self.array = []
self.__result = None
def lwm(self, array):
self.array = array
self.__insertion_sort()
# calcolo il valore di controllo
sum_tot = sum_array(self.array)/2... | [
"core.util.sum.sum_array"
] | [((297, 318), 'core.util.sum.sum_array', 'sum_array', (['self.array'], {}), '(self.array)\n', (306, 318), False, 'from core.util.sum import sum_array\n')] |
# -*- coding: utf-8 -*-
# !/bin/env python
from setuptools import setup, find_packages
setup(
name='optimizedGPS',
version='1.0.0',
description='An optimized GPS using the Operation Research theory for optimizing the path of several drivers.'
'It includes a package for extracting data (see... | [
"setuptools.find_packages"
] | [((651, 666), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (664, 666), False, 'from setuptools import setup, find_packages\n')] |
import re
from collections import namedtuple
from six import string_types
from conans.errors import ConanException, InvalidNameException
from conans.model.version import Version
def _split_pair(pair, split_char):
if not pair or pair == split_char:
return None, None
if split_char not in pair:
... | [
"conans.errors.ConanException",
"collections.namedtuple",
"conans.errors.InvalidNameException",
"conans.model.version.Version",
"re.compile"
] | [((5854, 5924), 'collections.namedtuple', 'namedtuple', (['"""ConanFileReference"""', '"""name version user channel revision"""'], {}), "('ConanFileReference', 'name version user channel revision')\n", (5864, 5924), False, 'from collections import namedtuple\n'), ((10175, 10224), 'collections.namedtuple', 'namedtuple',... |
from rest_framework import views
from rest_framework.response import Response
from rest_framework import status
from .serializers import Serializer
from .textProcessing import text_cleaned
from django.shortcuts import render
class API (views.APIView):
def post(self, request):
input = request.data
d... | [
"rest_framework.response.Response"
] | [((442, 494), 'rest_framework.response.Response', 'Response', (['serializer.data'], {'status': 'status.HTTP_200_OK'}), '(serializer.data, status=status.HTTP_200_OK)\n', (450, 494), False, 'from rest_framework.response import Response\n'), ((528, 591), 'rest_framework.response.Response', 'Response', (['serializer.errors... |
#!/usr/bin/python
# Copyright 2016 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Module for testing ecc functions using extended commands."""
import binascii
import hashlib
import os
import struct
import subcmd
im... | [
"utils.cursor_back",
"utils.hex_dump",
"os.urandom",
"struct.pack"
] | [((4074, 4096), 'os.urandom', 'os.urandom', (['seed_bytes'], {}), '(seed_bytes)\n', (4084, 4096), False, 'import os\n'), ((1255, 1275), 'struct.pack', 'struct.pack', (['""">H"""', '(0)'], {}), "('>H', 0)\n", (1266, 1275), False, 'import struct\n'), ((1319, 1348), 'struct.pack', 'struct.pack', (['""">H"""', 'digest_len'... |
import six
import pytest
# noinspection PyProtectedMember
from benchmarkai import _emit_to_fifo, _emit_to_stdout, FifoNotCreatedInTimeError
if six.PY2:
import mock
else:
from unittest import mock
@pytest.mark.parametrize("param", [[1, 2], "string", None, {"set"}, 1, 1.5])
def test_wrong_types(param):
wi... | [
"benchmarkai._emit_to_fifo",
"json.dumps",
"benchmarkai._emit_to_stdout",
"unittest.mock.patch",
"pytest.raises",
"pytest.mark.parametrize"
] | [((209, 284), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""param"""', "[[1, 2], 'string', None, {'set'}, 1, 1.5]"], {}), "('param', [[1, 2], 'string', None, {'set'}, 1, 1.5])\n", (232, 284), False, 'import pytest\n'), ((628, 653), 'json.dumps', 'json.dumps', (['metric_object'], {}), '(metric_object)\n', ... |
#!/usr/bin/env python
"""This utility creates a synonym table from The Plant List data.
Allows expansion of a names list to a larger list including those names and all
synonyms. The merge action allows merging to a canonical list of names (not
necessarily TPL accepted names, although that is the default).
See the us... | [
"codecs.open",
"optparse.OptionParser",
"logging.basicConfig",
"os.path.realpath",
"codecs.getwriter",
"sys.exit",
"logging.getLogger"
] | [((702, 758), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(levelname)s: %(message)s"""'}), "(format='%(levelname)s: %(message)s')\n", (721, 758), False, 'import logging\n'), ((772, 803), 'logging.getLogger', 'logging.getLogger', (['"""tpl_logger"""'], {}), "('tpl_logger')\n", (789, 803), False, '... |
# main.py -- put your code here!
from time import sleep
from lib.servo import servo1, servo2, stop_servos_before_finishing
turn_left = True
# This will stop the servos if anything goes wrong
with stop_servos_before_finishing():
# Loop forever
while True:
# To turn we have to run the serv... | [
"lib.servo.stop_servos_before_finishing",
"time.sleep"
] | [((207, 237), 'lib.servo.stop_servos_before_finishing', 'stop_servos_before_finishing', ([], {}), '()\n', (235, 237), False, 'from lib.servo import servo1, servo2, stop_servos_before_finishing\n'), ((896, 906), 'time.sleep', 'sleep', (['(0.1)'], {}), '(0.1)\n', (901, 906), False, 'from time import sleep\n'), ((951, 961... |
from conans.client.runner import ConanRunner
class TestRunner(object):
"""Wraps Conan runner and allows to redirect all the ouput to an StrinIO passed
in the __init__ method"""
def __init__(self, output):
self._output = output
self.runner = ConanRunner()
def __call__(self, command, o... | [
"conans.client.runner.ConanRunner"
] | [((272, 285), 'conans.client.runner.ConanRunner', 'ConanRunner', ([], {}), '()\n', (283, 285), False, 'from conans.client.runner import ConanRunner\n')] |
import requests
from string import ascii_letters, digits
class rpaste:
def __init__(self):
self.content = ""
self.password = ""
self.title = ""
self.language = "none"
self.url = ""
self.api_url = ""
self.slug = ""
def set_content(self, content):
... | [
"requests.post"
] | [((1625, 1664), 'requests.post', 'requests.post', (['paste_create_url', 'params'], {}), '(paste_create_url, params)\n', (1638, 1664), False, 'import requests\n'), ((2398, 2433), 'requests.post', 'requests.post', (['self.api_url', 'params'], {}), '(self.api_url, params)\n', (2411, 2433), False, 'import requests\n')] |
import psycopg2 as pg
from spyware_server_common.config import get_config
from spyware_server_common.utils import hashStr
def create_access (cursor, username, password) :
sql_statement = 'INSERT INTO access (username, password) VALUES (%s, %s);'
try :
cursor.execute(sql_statement, (username, pass... | [
"spyware_server_common.config.get_config",
"spyware_server_common.utils.hashStr",
"psycopg2.connect"
] | [((993, 1019), 'psycopg2.connect', 'pg.connect', ([], {}), "(**config['db'])\n", (1003, 1019), True, 'import psycopg2 as pg\n'), ((875, 887), 'spyware_server_common.config.get_config', 'get_config', ([], {}), '()\n', (885, 887), False, 'from spyware_server_common.config import get_config\n'), ((908, 925), 'spyware_serv... |
import sys
from airflow import settings
from airflow.models import TaskInstance
from datadog import ThreadStats
from airflow_metrics.airflow_metrics.datadog_logger import DatadogStatsLogger
from airflow_metrics.utils.fn_utils import once
from airflow_metrics.utils.hook_utils import HookManager
@once
def patch_stats... | [
"airflow_metrics.airflow_metrics.datadog_logger.DatadogStatsLogger",
"airflow_metrics.utils.hook_utils.HookManager"
] | [((1008, 1028), 'airflow_metrics.airflow_metrics.datadog_logger.DatadogStatsLogger', 'DatadogStatsLogger', ([], {}), '()\n', (1026, 1028), False, 'from airflow_metrics.airflow_metrics.datadog_logger import DatadogStatsLogger\n'), ((550, 592), 'airflow_metrics.utils.hook_utils.HookManager', 'HookManager', (['TaskInstanc... |
# _*_ coding: utf-8 _*_
"""
-------------------------------------------------
File Name: embedding_lookup.py
Description :
Author : ericdoug
date:2021/3/20
-------------------------------------------------
Change Activity:
2021/3/20: created
-------------------------------------------------
""... | [
"tensorflow.nn.embedding_lookup"
] | [((961, 1015), 'tensorflow.nn.embedding_lookup', 'tf.nn.embedding_lookup', ([], {'params': 'self.embedding', 'ids': 'idx'}), '(params=self.embedding, ids=idx)\n', (983, 1015), True, 'import tensorflow as tf\n')] |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2016-12-20 16:45
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('camps', '0008_delete_day'),
]
operations = [
migrations.Rena... | [
"django.db.migrations.RenameField",
"datetime.datetime"
] | [((305, 383), 'django.db.migrations.RenameField', 'migrations.RenameField', ([], {'model_name': '"""camp"""', 'old_name': '"""end"""', 'new_name': '"""camp_end"""'}), "(model_name='camp', old_name='end', new_name='camp_end')\n", (327, 383), False, 'from django.db import migrations, models\n'), ((440, 527), 'django.db.m... |
import unittest
from support import lib,ffi
from qcgc_test import QCGCTest
class HugeBlockTableTestCase(QCGCTest):
def test_create_destroy(self):
for i in range(lib.QCGC_HBTABLE_BUCKETS):
self.assertNotEqual(ffi.NULL, lib.qcgc_hbtable.bucket[i])
def test_add(self):
o = lib._qcgc_al... | [
"unittest.main",
"support.lib.qcgc_hbtable_sweep",
"support.lib.bucket",
"support.lib.qcgc_hbtable_is_marked",
"support.lib.qcgc_hbtable_mark",
"support.lib._qcgc_allocate_large"
] | [((1754, 1769), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1767, 1769), False, 'import unittest\n'), ((308, 373), 'support.lib._qcgc_allocate_large', 'lib._qcgc_allocate_large', (['(2 ** lib.QCGC_LARGE_ALLOC_THRESHOLD_EXP)'], {}), '(2 ** lib.QCGC_LARGE_ALLOC_THRESHOLD_EXP)\n', (332, 373), False, 'from support... |
import re
from magma import *
class FPGA(Part):
"""An FPGA"""
def __init__(self, name='', board=None):
Part.__init__(self, name, board)
self.gpios = []
self.peripherals = []
self.parts = []
def place(self, peripheral):
self.peripherals.append(peripheral)
... | [
"re.findall"
] | [((481, 519), 're.findall', 're.findall', (['"""(.*)\\\\[(\\\\d+)\\\\]"""', 'p.name'], {}), "('(.*)\\\\[(\\\\d+)\\\\]', p.name)\n", (491, 519), False, 'import re\n'), ((918, 956), 're.findall', 're.findall', (['"""(.*)\\\\[(\\\\d+)\\\\]"""', 'p.name'], {}), "('(.*)\\\\[(\\\\d+)\\\\]', p.name)\n", (928, 956), False, 'im... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2019 The FATE 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/lic... | [
"numpy.random.uniform",
"numpy.array",
"fate_arch.session.computing_session.parallelize",
"numpy.vstack"
] | [((1601, 1678), 'fate_arch.session.computing_session.parallelize', 'session.parallelize', (['self._mask'], {'include_key': '(False)', 'partition': 'self._partition'}), '(self._mask, include_key=False, partition=self._partition)\n', (1620, 1678), True, 'from fate_arch.session import computing_session as session\n'), ((1... |
#!/usr/bin/env python3
"""Replay actions for a given logfile and verify final object pose.
The log file is a JSON file as produced by
`rrc_simulation.TriFingerPlatform.store_action_log()` which contains the
initial state, a list of all applied actions and the final state of the object.
The simulation is initialised a... | [
"rrc_simulation.tasks.move_cube.Pose.from_json",
"argparse.ArgumentParser",
"rrc_simulation.trifinger_platform.TriFingerPlatform",
"pickle.load",
"rrc_simulation.tasks.move_cube.evaluate_state",
"numpy.testing.assert_array_almost_equal",
"sys.exit"
] | [((969, 1072), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '__doc__', 'formatter_class': 'argparse.RawDescriptionHelpFormatter'}), '(description=__doc__, formatter_class=argparse.\n RawDescriptionHelpFormatter)\n', (992, 1072), False, 'import argparse\n'), ((1931, 1974), 'rrc_simulatio... |
#!/usr/bin/env python
#
# Copyright 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | [
"os.path.dirname",
"os.path.join"
] | [((1291, 1333), 'os.path.join', 'os.path.join', (['_TEMPLATES_DIR', '"""forms.html"""'], {}), "(_TEMPLATES_DIR, 'forms.html')\n", (1303, 1333), False, 'import os\n'), ((1354, 1398), 'os.path.join', 'os.path.join', (['_TEMPLATES_DIR', '"""methods.html"""'], {}), "(_TEMPLATES_DIR, 'methods.html')\n", (1366, 1398), False,... |
import torch, os
import numpy as np
import scipy.stats
import matplotlib
matplotlib.use('Agg')
from torch.utils.data import DataLoader
from torch.optim import lr_scheduler
import random, sys, pickle
import argparse
from meta import Meta
from dataloader import dataloader as dl
import utility as util
from ... | [
"meta.Meta",
"numpy.random.seed",
"utility.checkpoint",
"dataloader.dataloader.StereoMSIDatasetLoader",
"argparse.ArgumentParser",
"errors.find_psnr",
"torch.manual_seed",
"torch.cuda.manual_seed",
"torch.cuda.manual_seed_all",
"matplotlib.use",
"random.seed",
"numpy.mean",
"torch.clamp",
... | [((76, 97), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (90, 97), False, 'import matplotlib\n'), ((632, 652), 'torch.device', 'torch.device', (['"""cuda"""'], {}), "('cuda')\n", (644, 652), False, 'import torch, os\n'), ((857, 878), 'utility.checkpoint', 'util.checkpoint', (['args'], {}), '(ar... |
from django.conf.urls import url, include
from drf_yasg import openapi
from drf_yasg.views import get_schema_view
from rest_framework import permissions, authentication
from environments.views import SDKIdentitiesDeprecated, SDKTraitsDeprecated, SDKIdentities, SDKTraits
from features.views import SDKFeatureStates
from... | [
"environments.views.SDKTraits.as_view",
"django.conf.urls.include",
"drf_yasg.openapi.License",
"features.views.SDKFeatureStates.as_view",
"environments.views.SDKIdentitiesDeprecated.as_view",
"environments.views.SDKTraitsDeprecated.as_view",
"drf_yasg.openapi.Contact",
"segments.views.SDKSegments.as_... | [((840, 869), 'django.conf.urls.include', 'include', (['"""organisations.urls"""'], {}), "('organisations.urls')\n", (847, 869), False, 'from django.conf.urls import url, include\n'), ((895, 919), 'django.conf.urls.include', 'include', (['"""projects.urls"""'], {}), "('projects.urls')\n", (902, 919), False, 'from djang... |
# Copyright 2019 TerraPower, 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 writi... | [
"math.sqrt",
"math.fabs",
"armi.utils.rotateXY",
"armi.utils.hexagon.numRingsToHoldNumCells",
"armi.runLog.warning",
"armi.utils.hexagon.numPositionsInRing",
"itertools.count",
"math.sin",
"armi.reactor.grids.hexGridFromPitch",
"math.cos",
"armi.reactor.grids.AXIAL_CHARS.index",
"armi.reactor.... | [((2788, 2802), 'math.sqrt', 'math.sqrt', (['(3.0)'], {}), '(3.0)\n', (2797, 2802), False, 'import math\n'), ((12229, 12262), 'armi.reactor.grids.ringPosFromRingLabel', 'grids.ringPosFromRingLabel', (['label'], {}), '(label)\n', (12255, 12262), False, 'from armi.reactor import grids\n'), ((15079, 15179), 'math.sqrt', '... |
import factory
import pytest
from comments.serializers import (CommentSerializer, CommentChildSerializer)
from comments.tests.factories import CommentFactory
# The serializer.data property is only valid if you have a saved instance to serializer.
# Either call serializer.save() or use serializer.validated_data to acc... | [
"comments.serializers.CommentChildSerializer",
"factory.build",
"comments.serializers.CommentSerializer"
] | [((732, 781), 'factory.build', 'factory.build', (['dict'], {'FACTORY_CLASS': 'CommentFactory'}), '(dict, FACTORY_CLASS=CommentFactory)\n', (745, 781), False, 'import factory\n'), ((1027, 1063), 'comments.serializers.CommentSerializer', 'CommentSerializer', ([], {'data': 'comment_data'}), '(data=comment_data)\n', (1044,... |
#!/usr/bin/env python
#
# <EMAIL>
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
#
""" global variables """
import os
impo... | [
"functest.utils.constants.CONST.__getattribute__",
"click.echo",
"functest.utils.functest_utils.execute_command",
"pkg_resources.resource_filename",
"functest.utils.functest_vacation.main"
] | [((634, 674), 'functest.utils.constants.CONST.__getattribute__', 'CONST.__getattribute__', (['"""INSTALLER_TYPE"""'], {}), "('INSTALLER_TYPE')\n", (656, 674), False, 'from functest.utils.constants import CONST\n'), ((688, 729), 'functest.utils.constants.CONST.__getattribute__', 'CONST.__getattribute__', (['"""DEPLOY_SC... |
import numpy as np
import torch
import torch.nn as nn
from torch.nn.modules.loss import MSELoss
from torch.optim import RMSprop, Adam
from tensorboardX import SummaryWriter
import os
class DeepQNetwork:
def __init__(self,
n_actions,
n_features,
lr=0.0... | [
"numpy.sum",
"numpy.argmax",
"numpy.arange",
"torch.nn.modules.loss.MSELoss",
"os.path.exists",
"torch.Tensor",
"numpy.random.choice",
"torch.nn.Linear",
"torch.zeros_like",
"torch.nn.Conv2d",
"numpy.hstack",
"numpy.min",
"torch.nn.BatchNorm2d",
"torch.nn.MaxPool2d",
"torch.sum",
"nump... | [((1412, 1465), 'numpy.zeros', 'np.zeros', (['(self.memory_size, self.n_features * 2 + 2)'], {}), '((self.memory_size, self.n_features * 2 + 2))\n', (1420, 1465), True, 'import numpy as np\n'), ((4680, 4689), 'torch.nn.modules.loss.MSELoss', 'MSELoss', ([], {}), '()\n', (4687, 4689), False, 'from torch.nn.modules.loss ... |
# Generated by Django 3.2.5 on 2021-07-26 07:06
import cloudinary.models
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('neighbor_app', '0014_auto_20210726_1003'),
]
operations = [
migrations.AddField(
model_name='business',... | [
"django.db.models.CharField"
] | [((624, 679), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'max_length': '(144)', 'null': '(True)'}), '(blank=True, max_length=144, null=True)\n', (640, 679), False, 'from django.db import migrations, models\n'), ((813, 868), 'django.db.models.CharField', 'models.CharField', ([], {'blank':... |
import torch
import train_utils.train_eval_utils as utils
import time
import os
import datetime
from my_dataset import VOC2012DataSet
from train_utils.group_by_aspect_ratio import GroupedBatchSampler, create_aspect_ratio_groups
from src.ssd_model import SSD300, Backbone
import transform
import torch.multiprocessing as ... | [
"src.ssd_model.SSD300",
"torch.optim.lr_scheduler.StepLR",
"argparse.ArgumentParser",
"torch.utils.data.RandomSampler",
"train_utils.train_eval_utils.evaluate",
"torch.device",
"train_utils.group_by_aspect_ratio.GroupedBatchSampler",
"transform.Normalization",
"transform.ColorJitter",
"torch.utils... | [((362, 381), 'torch.device', 'torch.device', (['"""cpu"""'], {}), "('cpu')\n", (374, 381), False, 'import torch\n'), ((505, 543), 'src.ssd_model.Backbone', 'Backbone', ([], {'pretrain_path': 'pre_train_path'}), '(pretrain_path=pre_train_path)\n', (513, 543), False, 'from src.ssd_model import SSD300, Backbone\n'), ((55... |
#!/usr/bin/env python
#
# Author: <NAME>
# License: BSD 2-clause
# Last Change: Fri May 28, 2021 at 03:36 AM +0200
import re
from pathlib import Path
from copy import deepcopy
from pyUTM.common import jp_depop_true as jp_depop
from pyUTM.io import (
PcadNaiveReader, WirelistNaiveReader,
write_to_csv
)
from ... | [
"copy.deepcopy",
"UT_Aux_mapping.helpers.ppp_label",
"UT_Aux_mapping.helpers.parse_net_jp",
"UT_Aux_mapping.tabular.boldmath",
"UT_Aux_mapping.helpers.ppp_sort",
"pathlib.Path",
"UT_Aux_mapping.tabular.makecell",
"UT_Aux_mapping.helpers.ppp_netname_regulator",
"re.search"
] | [((3649, 3688), 'copy.deepcopy', 'deepcopy', (["output_spec['C-TOP-MAG-TRUE']"], {}), "(output_spec['C-TOP-MAG-TRUE'])\n", (3657, 3688), False, 'from copy import deepcopy\n'), ((3722, 3763), 'copy.deepcopy', 'deepcopy', (["output_spec['C-BOT-MAG-MIRROR']"], {}), "(output_spec['C-BOT-MAG-MIRROR'])\n", (3730, 3763), Fals... |
# Copyright 2019 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
import pytest
from pants.backend.python import target_types_rules
from pants.backend.python.lint.isort.rules import IsortFieldSet, IsortRequest
from pa... | [
"pants.core.util_rules.source_files.rules",
"pants.backend.python.lint.isort.rules.rules",
"pants.core.util_rules.source_files.SourceFilesRequest",
"pants.backend.python.lint.isort.rules.IsortFieldSet.create",
"pants.engine.addresses.Address",
"pants.backend.python.lint.isort.rules.IsortRequest",
"pants... | [((5446, 5562), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""path,extra_args"""', "(('.isort.cfg', []), ('custom.ini', ['--isort-config=custom.ini']))"], {}), "('path,extra_args', (('.isort.cfg', []), (\n 'custom.ini', ['--isort-config=custom.ini'])))\n", (5469, 5562), False, 'import pytest\n'), ((318... |
# created by <NAME> <EMAIL>
import os
import logging
from abc import ABC, abstractmethod
import attr
import pandas as pd
import numpy as np
import gcsfs
from BuildingControlsSimulator.DataClients.DataStates import CHANNELS
from BuildingControlsSimulator.DataClients.DataDestination import (
DataDestination,
)
fro... | [
"BuildingControlsSimulator.DataClients.DataSpec.convert_spec",
"attr.s",
"attr.ib",
"os.environ.get",
"gcsfs.GCSFileSystem",
"logging.getLogger"
] | [((409, 436), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (426, 436), False, 'import logging\n'), ((515, 541), 'logging.getLogger', 'logging.getLogger', (['"""gcsfs"""'], {}), "('gcsfs')\n", (532, 541), False, 'import logging\n'), ((581, 601), 'attr.s', 'attr.s', ([], {'kw_only': '(Tru... |
"""
Add and remove elements
"""
import time
from selenium.webdriver.common.by import By
from OOP_the_internet_herokuapp.src.page.base_page import BasePage
class AddRemove(BasePage):
ADD_BTN = (By.XPATH, '//*[@id="content"]/div/button')
DEL_CLASS = (By.CLASS_NAME, 'added-manually')
DEL_1_BTN = (By.CSS_SEL... | [
"time.sleep"
] | [((1108, 1123), 'time.sleep', 'time.sleep', (['(0.5)'], {}), '(0.5)\n', (1118, 1123), False, 'import time\n'), ((1158, 1173), 'time.sleep', 'time.sleep', (['(0.5)'], {}), '(0.5)\n', (1168, 1173), False, 'import time\n'), ((1208, 1223), 'time.sleep', 'time.sleep', (['(0.5)'], {}), '(0.5)\n', (1218, 1223), False, 'import... |
import os
import time
import ConfigParser
import re
import json
from genshi.template import TemplateLoader
from jobs import summarize_jobs
from cluster_summary import get_cpu_slots
import jobview_rrd
initialized = False
loader = TemplateLoader('templates', auto_reload=True)
cp = None
def check_initialized(environ)... | [
"jobs.summarize_jobs",
"json.dumps",
"jobview_rrd.graph_rrd",
"ConfigParser.ConfigParser",
"genshi.template.TemplateLoader",
"cluster_summary.get_cpu_slots",
"re.compile"
] | [((233, 278), 'genshi.template.TemplateLoader', 'TemplateLoader', (['"""templates"""'], {'auto_reload': '(True)'}), "('templates', auto_reload=True)\n", (247, 278), False, 'from genshi.template import TemplateLoader\n'), ((1283, 1327), 're.compile', 're.compile', (['"""^/+jobs_graph/?([a-zA-Z]+)?/?$"""'], {}), "('^/+jo... |
import re
import os
import sys
import logging
from scrub.tools.parsers import translate_results
WARNING_LEVEL = 'Low'
ID_PREFIX = 'gcc'
def parse_warnings(raw_input_file, parsed_output_file):
"""This function parses the raw GCC compiler warnings into the SCRUB format.
Inputs:
- raw_input_file: Absol... | [
"os.getcwd",
"logging.info",
"scrub.tools.parsers.translate_results.create_warning",
"scrub.tools.parsers.translate_results.create_scrub_output_file"
] | [((588, 604), 'logging.info', 'logging.info', (['""""""'], {}), "('')\n", (600, 604), False, 'import logging\n'), ((609, 645), 'logging.info', 'logging.info', (['"""\tParsing results..."""'], {}), "('\\tParsing results...')\n", (621, 645), False, 'import logging\n'), ((650, 769), 'logging.info', 'logging.info', (['"""\... |
from scrappy.driver.worker import Worker
from scrappy.core.commands import Die
import time
def create(size, headless=True):
return list([Worker(headless) for _ in range(size)])
def start_all(pool):
"""Starts all workers in a pool
Arguments:
pool Pool -- Pool of workers
"""
for worker in... | [
"scrappy.driver.worker.Worker"
] | [((143, 159), 'scrappy.driver.worker.Worker', 'Worker', (['headless'], {}), '(headless)\n', (149, 159), False, 'from scrappy.driver.worker import Worker\n')] |
import cv2
import os
cam = cv2.VideoCapture(0)
cam.set(3,640)
cam.set(4,480)
face_detector = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
face_id = input('\n enter user id end press <return>==> ')
print("\n [INFO] initializing face capture. Look the camera and wait ...")
count=0
while (True):
ret,... | [
"cv2.cvtColor",
"cv2.waitKey",
"cv2.imshow",
"cv2.VideoCapture",
"cv2.rectangle",
"cv2.CascadeClassifier",
"cv2.destroyAllWindows"
] | [((28, 47), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (44, 47), False, 'import cv2\n'), ((94, 154), 'cv2.CascadeClassifier', 'cv2.CascadeClassifier', (['"""haarcascade_frontalface_default.xml"""'], {}), "('haarcascade_frontalface_default.xml')\n", (115, 154), False, 'import cv2\n'), ((832, 855), '... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import io
import json
import logging
import uuid
from collections import deque, defaultdict
import typing
from typing import List, Text, Dict, Optional, Tuple, Any, Dequ... | [
"uuid.uuid4",
"rasa_core.utils.generate_id",
"logging.getLogger",
"json.dumps",
"collections.defaultdict",
"rasa_core.events.ActionExecuted",
"io.open",
"rasa_core.conversation.Dialogue",
"collections.deque"
] | [((596, 623), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (613, 623), False, 'import logging\n'), ((5760, 5787), 'rasa_core.conversation.Dialogue', 'Dialogue', (['sender_id', 'events'], {}), '(sender_id, events)\n', (5768, 5787), False, 'from rasa_core.conversation import Dialogue\n'),... |
from django.contrib import admin
from .models import CustomUser,Client, Echeance, Order, OrderDetails,Provider,Product,Options,Invoices
# Register your models here.
admin.site.register(CustomUser)
admin.site.register(Provider)
admin.site.register(Product)
admin.site.register(Options)
admin.site.register(Invoices)
ad... | [
"django.contrib.admin.site.register"
] | [((168, 199), 'django.contrib.admin.site.register', 'admin.site.register', (['CustomUser'], {}), '(CustomUser)\n', (187, 199), False, 'from django.contrib import admin\n'), ((200, 229), 'django.contrib.admin.site.register', 'admin.site.register', (['Provider'], {}), '(Provider)\n', (219, 229), False, 'from django.contr... |
# -*- coding: utf-8 -*-
import logging
import os
import string
import sys
from time import sleep
from shlex import quote as shell_quote
from socket import gethostname
from subprocess import check_output, CalledProcessError, Popen, PIPE
from random import shuffle, uniform
from functools import partial
from configobj im... | [
"random.shuffle",
"configobj.ConfigObj",
"shlex.quote",
"os.path.join",
"os.path.abspath",
"os.path.dirname",
"os.path.exists",
"socket.gethostname",
"os.access",
"subprocess.Popen",
"foolscrate.git.Git",
"time.sleep",
"tempfile.NamedTemporaryFile",
"random.uniform",
"filelock.FileLock",... | [((1704, 1735), 'logging.getLogger', 'logging.getLogger', (['"""Repository"""'], {}), "('Repository')\n", (1721, 1735), False, 'import logging\n'), ((9367, 9395), 'logging.getLogger', 'logging.getLogger', (['"""SyncAll"""'], {}), "('SyncAll')\n", (9384, 9395), False, 'import logging\n'), ((1148, 1181), 'filelock.FileLo... |
import cv2
import numpy as np
from matplotlib import pyplot as plt
import os
file = '2016-07-25_221513'
frameno = '150'
extension = '.jpg'
readpath = '/Users/icunitz/Desktop/bat_detection/frames/' + file + '/frame' + frameno + extension
img = cv2.imread(readpath, 0)
# f = np.fft.fft2(img)
# fshift = np.fft.fftshift(f... | [
"matplotlib.pyplot.title",
"numpy.fft.ifftshift",
"matplotlib.pyplot.subplot",
"cv2.magnitude",
"matplotlib.pyplot.show",
"cv2.idft",
"matplotlib.pyplot.close",
"matplotlib.pyplot.imshow",
"numpy.zeros",
"matplotlib.pyplot.yticks",
"numpy.float32",
"cv2.imread",
"matplotlib.pyplot.figure",
... | [((245, 268), 'cv2.imread', 'cv2.imread', (['readpath', '(0)'], {}), '(readpath, 0)\n', (255, 268), False, 'import cv2\n'), ((447, 467), 'numpy.fft.fftshift', 'np.fft.fftshift', (['dft'], {}), '(dft)\n', (462, 467), True, 'import numpy as np\n'), ((1572, 1607), 'numpy.zeros', 'np.zeros', (['(rows, cols, 2)', 'np.uint8'... |
import subprocess
pl = subprocess.Popen(["cmd", "/c","echo Hello Python"], stdout=subprocess.PIPE).communicate()[0]
print(pl)
print(pl.decode('utf-8')) | [
"subprocess.Popen"
] | [((24, 100), 'subprocess.Popen', 'subprocess.Popen', (["['cmd', '/c', 'echo Hello Python']"], {'stdout': 'subprocess.PIPE'}), "(['cmd', '/c', 'echo Hello Python'], stdout=subprocess.PIPE)\n", (40, 100), False, 'import subprocess\n')] |
import sys
input = sys.stdin.read().strip()
width = 25
height = 6
layer_size = width * height
layers = [input[chunk:chunk+layer_size] for chunk in range(0,len(input),layer_size)]
# Find layer with fewest 0 digits
fewest_0 = sorted(layers, key = lambda l: l.count('0'))[0]
print('Part 1: {}'.format(fewest_0.count('1'... | [
"sys.stdin.read"
] | [((20, 36), 'sys.stdin.read', 'sys.stdin.read', ([], {}), '()\n', (34, 36), False, 'import sys\n')] |
"""Utilities for command line interface"""
import logging
import re
import sys
from dataclasses import dataclass
from functools import reduce
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
import click
from click_help_colors import HelpColorsGroup
from overrides import overrides
from rich i... | [
"rich.style.Style",
"rich.text.Text",
"click.UsageError",
"logging.getLogger",
"re.sub",
"sys.exit"
] | [((737, 764), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (754, 764), False, 'import logging\n'), ((8568, 8577), 'rich.text.Text', 'Text', (['typ'], {}), '(typ)\n', (8572, 8577), False, 'from rich.text import Text\n'), ((7821, 7844), 'rich.text.Text', 'Text', (['typ'], {'style': '"""bl... |
import numpy as np
import tensorflow as tf
import gym
from gym.spaces import Box, Discrete
from collections import deque
import time
class Memory:
"""
Buffer to store visited transitions
"""
def __init__(self, size):
"""
Class (replay) memory constructor
- size is t... | [
"tensorflow.image.rgb_to_grayscale",
"argparse.ArgumentParser",
"tensorflow.clip_by_value",
"numpy.argmax",
"tensorflow.reshape",
"tensorflow.global_variables",
"numpy.random.randint",
"tensorflow.assign",
"numpy.mean",
"tensorflow.reduce_max",
"collections.deque",
"tensorflow.variable_scope",... | [((11469, 11494), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (11492, 11494), False, 'import argparse\n'), ((577, 622), 'numpy.zeros', 'np.zeros', (['[size, 84, 84, 4]'], {'dtype': 'np.float32'}), '([size, 84, 84, 4], dtype=np.float32)\n', (585, 622), True, 'import numpy as np\n'), ((645, 67... |
#!/usr/bin/python3
import pymongo
import os
import json
PORT=27017
client = pymongo.MongoClient("localhost", PORT)
db = client.cuckoo_db
collection = db.malware_results
SCRIPTS_DIR = os.path.dirname(os.path.realpath(__file__))
MAIN_DIR = os.path.join(SCRIPTS_DIR, "..")
def add_js(js):
return collection.insert_o... | [
"pymongo.MongoClient",
"os.path.realpath",
"os.path.join"
] | [((78, 116), 'pymongo.MongoClient', 'pymongo.MongoClient', (['"""localhost"""', 'PORT'], {}), "('localhost', PORT)\n", (97, 116), False, 'import pymongo\n'), ((241, 272), 'os.path.join', 'os.path.join', (['SCRIPTS_DIR', '""".."""'], {}), "(SCRIPTS_DIR, '..')\n", (253, 272), False, 'import os\n'), ((202, 228), 'os.path.... |
# Copyright 2008-2009 WebDriver committers
# Copyright 2008-2009 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | [
"selenium.remote.remote_connection.RemoteConnection.__init__",
"socket.socket",
"time.sleep",
"logging.info",
"logging.getLogger"
] | [((1113, 1163), 'logging.getLogger', 'logging.getLogger', (['"""webdriver.ExtensionConnection"""'], {}), "('webdriver.ExtensionConnection')\n", (1130, 1163), False, 'import logging\n'), ((1343, 1417), 'selenium.remote.remote_connection.RemoteConnection.__init__', 'RemoteConnection.__init__', (['self', "('http://localho... |
"""
IO related functions
"""
import json
import pickle as pkl
def load_pkl(path):
"""
Load pickle file
:param path: file path
:return:
"""
with open(path, 'rb') as f:
tr_x, tr_y, te_x, te_y = pkl.load(f)
tr_y = tr_y.ravel().astype('int32')
te_y = te_y.ravel().astype('in... | [
"json.dump",
"pickle.load",
"json.load"
] | [((226, 237), 'pickle.load', 'pkl.load', (['f'], {}), '(f)\n', (234, 237), True, 'import pickle as pkl\n'), ((518, 561), 'json.dump', 'json.dump', (['obj', 'f'], {'indent': '(4)', 'sort_keys': '(True)'}), '(obj, f, indent=4, sort_keys=True)\n', (527, 561), False, 'import json\n'), ((700, 712), 'json.load', 'json.load',... |
import numpy as np
import theano.tensor as T
from pymanopt import Problem
from pymanopt.solvers import TrustRegions
from pymanopt.manifolds import Euclidean, Product
if __name__ == "__main__":
# Generate random data
X = np.random.randn(3, 100)
Y = X[0:1, :] - 2*X[1:2, :] + np.random.randn(1, 100) + 5
... | [
"numpy.random.randn",
"pymanopt.manifolds.Euclidean",
"numpy.ones",
"pymanopt.Problem",
"pymanopt.solvers.TrustRegions",
"theano.tensor.matrix"
] | [((231, 254), 'numpy.random.randn', 'np.random.randn', (['(3)', '(100)'], {}), '(3, 100)\n', (246, 254), True, 'import numpy as np\n'), ((372, 382), 'theano.tensor.matrix', 'T.matrix', ([], {}), '()\n', (380, 382), True, 'import theano.tensor as T\n'), ((391, 401), 'theano.tensor.matrix', 'T.matrix', ([], {}), '()\n', ... |
#!/usr/bin/env python
"""This module has tests for the pvl lang functions."""
# Copyright 2019, <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... | [
"pvl.token.Token",
"pvl.decoder.PVLDecoder",
"pvl.grammar.PVLGrammar"
] | [((1249, 1271), 'pvl.token.Token', 'Token', (['"""/* comment */"""'], {}), "('/* comment */')\n", (1254, 1271), False, 'from pvl.token import Token\n'), ((1325, 1348), 'pvl.token.Token', 'Token', (['"""not comment */"""'], {}), "('not comment */')\n", (1330, 1348), False, 'from pvl.token import Token\n'), ((1632, 1650)... |
from __future__ import print_function
import os
import re
import sys
import shlex
import pkg_resources
from glob import glob
from setuptools import setup, Extension
from setuptools.command.test import test as TestCommand
sources = (glob("src/*.cpp") +
["libmc/_client.pyx"])
include_dirs = ["include"]
COMP... | [
"pkg_resources.get_distribution",
"setuptools.Extension",
"os.path.join",
"pkg_resources.require",
"shlex.split",
"setuptools.command.test.test.finalize_options",
"glob.glob",
"re.search",
"setuptools.command.test.test.initialize_options",
"sys.exit"
] | [((234, 251), 'glob.glob', 'glob', (['"""src/*.cpp"""'], {}), "('src/*.cpp')\n", (238, 251), False, 'from glob import glob\n'), ((511, 545), 'pkg_resources.require', 'pkg_resources.require', (['requirement'], {}), '(requirement)\n', (532, 545), False, 'import pkg_resources\n'), ((1432, 1505), 're.search', 're.search', ... |
import re
import unittest
from regularize.flag import FlagSet
from regularize.expression import Pattern
class TestFlagSet(unittest.TestCase):
def test_case_insensitive(self):
pass
def test_equality_without_pattern(self):
flags = FlagSet()
other_flags = FlagSet()
self.assertEq... | [
"regularize.flag.FlagSet"
] | [((257, 266), 'regularize.flag.FlagSet', 'FlagSet', ([], {}), '()\n', (264, 266), False, 'from regularize.flag import FlagSet\n'), ((289, 298), 'regularize.flag.FlagSet', 'FlagSet', ([], {}), '()\n', (296, 298), False, 'from regularize.flag import FlagSet\n'), ((389, 398), 'regularize.flag.FlagSet', 'FlagSet', ([], {})... |
from modules.multi_dimensional_rnn import MultiDimensionalRNN
from modules.multi_dimensional_rnn import MultiDimensionalRNNBase
import util.tensor_flipping
import torch
import torch.nn.functional as F
import torch.nn
import torch.nn as nn
from modules.state_update_block import StateUpdateBlock
from modules.multi_dimens... | [
"torch.nn.functional.dropout",
"modules.multi_dimensional_lstm_parameters.MultiDirectionalMultiDimensionalLSTMParametersCreatorParallelWithSeparateInputConvolution",
"modules.multi_dimensional_lstm_parameters.MultiDirectionalMultiDimensionalLSTMParametersCreatorFullyParallel",
"modules.mdlstm_examples_packing... | [((18954, 18988), 'modules.multi_dimensional_rnn.MultiDimensionalRNNBase.use_cuda', 'MultiDimensionalRNNBase.use_cuda', ([], {}), '()\n', (18986, 18988), False, 'from modules.multi_dimensional_rnn import MultiDimensionalRNNBase\n'), ((19704, 19753), 'torch.nn.functional.pad', 'torch.nn.functional.pad', (['mask', 'p2d',... |
#!/usr/bin/env python3
#
# options.py
"""
Command line options.
.. versionadded:: 0.4.0
"""
#
# Copyright © 2020-2021 <NAME> <<EMAIL>>
#
# 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 ... | [
"typing.cast",
"click.decorators._param_memo",
"click.option",
"inspect.signature",
"typing.TypeVar",
"inspect.cleandoc"
] | [((3615, 3650), 'typing.TypeVar', 'TypeVar', (['"""_A"""'], {'bound': 'click.Argument'}), "('_A', bound=click.Argument)\n", (3622, 3650), False, 'from typing import Any, Callable, Iterable, List, Optional, Tuple, TypeVar, cast\n'), ((3656, 3690), 'typing.TypeVar', 'TypeVar', (['"""_C"""'], {'bound': 'click.Command'}), ... |
import gc
import logging
import os
import time
from typing import List, Union
import anndata
import numpy
import numpy as np
import pandas as pd
import scanpy
import tiledb
from anndata._core.views import ArrayView
from scipy import sparse
from scipy.sparse import coo_matrix, csr_matrix
from backend.wmg.data.extract ... | [
"tiledb.open",
"anndata.read_h5ad",
"backend.wmg.data.validation.validate_corpus_load",
"backend.wmg.data.rankit.rankit",
"logging.basicConfig",
"scipy.sparse.issparse",
"numpy.zeros",
"backend.wmg.data.extract.included_assay_ontologies.keys",
"time.time",
"scanpy.pp.filter_cells",
"gc.collect",... | [((619, 646), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (636, 646), False, 'import logging\n'), ((647, 686), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (666, 686), False, 'import logging\n'), ((3012, 3040), 'anndata.read_h... |
import logging
import queue
import threading
import time
logging.basicConfig(
level=logging.DEBUG,
format='%(threadName)s: %(message)s'
)
def worker1(queue):
logging.debug("start")
queue.put(100)
time.sleep(5)
queue.put(200)
logging.debug("end")
def worker2(queue):
logging.debug("s... | [
"queue.join",
"threading.Thread",
"logging.debug",
"logging.basicConfig",
"queue.get",
"time.sleep",
"queue.put",
"queue.task_done",
"queue.Queue"
] | [((59, 137), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG', 'format': '"""%(threadName)s: %(message)s"""'}), "(level=logging.DEBUG, format='%(threadName)s: %(message)s')\n", (78, 137), False, 'import logging\n'), ((174, 196), 'logging.debug', 'logging.debug', (['"""start"""'], {}), "('sta... |
import numpy as np
import pandas as pd
from sklearn.metrics.regression import mean_squared_error
from sklearn.metrics import make_scorer
from sklearn.model_selection import KFold
from mlens.visualization import corrmat
from utils.io_utils import save_csv, pickle_file, FITTED_MODEL_PATH, REPORT_PATH, REPORT_FORMAT, \
... | [
"pandas.DataFrame",
"utils.io_utils.tag_filename_with_datetime",
"pandas.DataFrame.from_dict",
"numpy.subtract",
"numpy.log",
"sklearn.model_selection.KFold",
"utils.io_utils.save_csv",
"sklearn.metrics.make_scorer",
"utils.io_utils.pickle_file"
] | [((590, 643), 'sklearn.metrics.make_scorer', 'make_scorer', (['log_rmse_scorer'], {'greater_is_better': '(False)'}), '(log_rmse_scorer, greater_is_better=False)\n', (601, 643), False, 'from sklearn.metrics import make_scorer\n'), ((542, 569), 'numpy.subtract', 'np.subtract', (['y_true', 'y_pred'], {}), '(y_true, y_pred... |
import numpy as np
import pandas as pd
from matplotlib.pyplot import xticks
import dataprep.eda as eda
broadband = pd.read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2021/2021-05-11/broadband.csv')
broadband.columns=['ST', 'COUNTY_ID', 'COUNTY_NAME', 'AVAILABILITY', 'USAGE']
eda.c... | [
"pandas.read_csv",
"dataprep.eda.plot_correlation",
"dataprep.eda.plot",
"plotly.express.scatter",
"pandas.to_numeric",
"dataprep.eda.create_report"
] | [((117, 245), 'pandas.read_csv', 'pd.read_csv', (['"""https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2021/2021-05-11/broadband.csv"""'], {}), "(\n 'https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2021/2021-05-11/broadband.csv'\n )\n", (128, 245), True, 'import ... |
# Library storing basic image processing methods
# Import needed packages
import numpy as np
import cv2
def translate(image, x, y):
M = np.float32([[1, 0, x], [0, 1, y]])
shifted = cv2.warpAffine(image, M, (image.shape[1], image.shape[0]))
return shifted
def rotate(image, angle, center = None, scale =1.0):
(h, ... | [
"numpy.float32",
"cv2.warpAffine",
"cv2.flip",
"cv2.getRotationMatrix2D",
"cv2.resize"
] | [((140, 174), 'numpy.float32', 'np.float32', (['[[1, 0, x], [0, 1, y]]'], {}), '([[1, 0, x], [0, 1, y]])\n', (150, 174), True, 'import numpy as np\n'), ((186, 244), 'cv2.warpAffine', 'cv2.warpAffine', (['image', 'M', '(image.shape[1], image.shape[0])'], {}), '(image, M, (image.shape[1], image.shape[0]))\n', (200, 244),... |
from datetime import date
from math import floor
from typing import Set, List
class Student:
# Type annotations can be used to give better warning messages and prevent
# errors from happening.
# We could use 'set' as the annotation, but 'Set' allows to restrict the
# type inside the set.
def __ini... | [
"datetime.date.today",
"datetime.date",
"math.floor"
] | [((1135, 1151), 'datetime.date', 'date', (['(2010)', '(4)', '(5)'], {}), '(2010, 4, 5)\n', (1139, 1151), False, 'from datetime import date\n'), ((1463, 1479), 'datetime.date', 'date', (['(2010)', '(7)', '(8)'], {}), '(2010, 7, 8)\n', (1467, 1479), False, 'from datetime import date\n'), ((974, 999), 'math.floor', 'floor... |
"""Strongly Connected Components Package"""
from collections import deque
from collections import defaultdict
from collections.abc import Iterable, Mapping
from typing import Optional
class Tracker():
def __init__(self):
self.current_source: Optional[str] = None
self.sccs_by_leader: Mapping[str,... | [
"collections.defaultdict",
"collections.deque"
] | [((1825, 1842), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (1836, 1842), False, 'from collections import defaultdict\n'), ((334, 351), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (345, 351), False, 'from collections import defaultdict\n'), ((389, 396), 'collections.d... |
#!/usr/bin/env python
# Platform.py
#
# Copyright (C) 2013 <NAME>, <NAME>
#
# This code is distributed under the BSD license, a copy of which is
# included in the root directory of this package.
#
# Test platform for new Dials wrapper implementations.
from __future__ import absolute_import, division, print_funct... | [
"xia2.Wrappers.Dials.DialsSpotfinder.DialsSpotfinder"
] | [((628, 645), 'xia2.Wrappers.Dials.DialsSpotfinder.DialsSpotfinder', 'DialsSpotfinder', ([], {}), '()\n', (643, 645), False, 'from xia2.Wrappers.Dials.DialsSpotfinder import DialsSpotfinder\n')] |
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
"distutils.dist.Distribution",
"os.system",
"glob.glob",
"shutil.copytree",
"os.path.join",
"sys.exit"
] | [((3285, 3296), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (3293, 3296), False, 'import sys\n'), ((1785, 1804), 'distutils.dist.Distribution', 'dist.Distribution', ([], {}), '()\n', (1802, 1804), False, 'from distutils import dist\n'), ((2011, 2022), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (2019, 2022), Fa... |
"""
In England the currency is made up of pound, £, and pence, p, and there are eight coins in general circulation:
1p, 2p, 5p, 10p, 20p, 50p, £1 (100p) and £2 (200p).
It is possible to make £2 in the following way:
1×£1 + 1×50p + 2×20p + 1×5p + 1×2p + 3×1p
How many different ways can £2... | [
"numpy.array"
] | [((389, 430), 'numpy.array', 'np.array', (['[1, 2, 5, 10, 20, 50, 100, 200]'], {}), '([1, 2, 5, 10, 20, 50, 100, 200])\n', (397, 430), True, 'import numpy as np\n')] |
from francis import *
import tensorflow.contrib.graph_editor as ge
from tensorflow.python.platform import flags
FLAGS = flags.FLAGS
flags.DEFINE_float('meta_lr', 1e-3, 'Meta update learning rate')
flags.DEFINE_float('update_lr', 2e-3, 'Inner update learning rate')
flags.DEFINE_integer('n_update_steps', 5, 'Number of... | [
"tensorflow.contrib.graph_editor.sgv",
"tensorflow.python.platform.flags.DEFINE_integer",
"tensorflow.python.platform.flags.DEFINE_float",
"tensorflow.contrib.graph_editor.connect"
] | [((135, 200), 'tensorflow.python.platform.flags.DEFINE_float', 'flags.DEFINE_float', (['"""meta_lr"""', '(0.001)', '"""Meta update learning rate"""'], {}), "('meta_lr', 0.001, 'Meta update learning rate')\n", (153, 200), False, 'from tensorflow.python.platform import flags\n'), ((200, 268), 'tensorflow.python.platform.... |
""" Core classes for tasks and jobs (groups of tasks) """
import os
from datetime import datetime
import time
import threading
import subprocess
import json
import paramiko
import logging
from croniter import croniter
from copy import deepcopy
from dag import DAG
from .components import Scheduler, JobState, StrictJS... | [
"copy.deepcopy",
"threading.Timer",
"paramiko.SSHClient",
"logging.warn",
"os.environ.copy",
"json.dumps",
"threading.Lock",
"datetime.datetime.utcnow",
"paramiko.AutoAddPolicy",
"os.tmpfile",
"paramiko.SSHConfig",
"os.path.expanduser",
"croniter.croniter",
"logging.getLogger"
] | [((379, 407), 'logging.getLogger', 'logging.getLogger', (['"""dagobah"""'], {}), "('dagobah')\n", (396, 407), False, 'import logging\n'), ((10585, 10601), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (10599, 10601), False, 'import threading\n'), ((16007, 16024), 'datetime.datetime.utcnow', 'datetime.utcnow', (... |
# Generated by Django 4.0.1 on 2022-03-08 15:37
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('Assets', '0002_alter_assetlist_cname_alter_assetlist_middle_ware_and_more')... | [
"django.db.models.FileField",
"django.db.models.TextField",
"django.db.models.CharField",
"django.db.models.ForeignKey",
"django.db.models.BooleanField",
"django.db.models.AutoField",
"django.db.models.IntegerField",
"django.db.models.GenericIPAddressField",
"django.db.models.DateField"
] | [((460, 550), 'django.db.models.AutoField', 'models.AutoField', ([], {'db_column': '"""id"""', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""序号"""'}), "(db_column='id', primary_key=True, serialize=False,\n verbose_name='序号')\n", (476, 550), False, 'from django.db import migrations, models\n'),... |
# coding: utf8
from __future__ import unicode_literals
import pytest
from spacy.lang.en import English
from spacy.tokens import Doc
def test_issue3468():
"""Test that sentence boundaries are set correctly so Doc.is_sentenced can
be restored after serialization."""
nlp = English()
nlp.add_pipe(nlp.cre... | [
"spacy.lang.en.English",
"spacy.tokens.Doc"
] | [((286, 295), 'spacy.lang.en.English', 'English', ([], {}), '()\n', (293, 295), False, 'from spacy.lang.en import English\n'), ((516, 530), 'spacy.tokens.Doc', 'Doc', (['nlp.vocab'], {}), '(nlp.vocab)\n', (519, 530), False, 'from spacy.tokens import Doc\n')] |
"""
Adjusting
---------
Adjusting motion account for agents desire to move and rotate towards their
desired goal.
"""
import numba
import numpy as np
from numba import f8, void, typeof
from numba.types import boolean
from crowddynamics.simulation.agents import agent_type_circular, \
agent_type_three_circle
from cr... | [
"numba.typeof",
"crowddynamics.core.vector2D.wrap_to_pi",
"numba.f8"
] | [((1725, 1751), 'numba.f8', 'f8', (['f8', 'f8', 'f8', 'f8', 'f8', 'f8'], {}), '(f8, f8, f8, f8, f8, f8)\n', (1727, 1751), False, 'from numba import f8, void, typeof\n'), ((4026, 4057), 'numba.typeof', 'typeof', (['agent_type_three_circle'], {}), '(agent_type_three_circle)\n', (4032, 4057), False, 'from numba import f8,... |
"""Common contants are defined here."""
from enum import Enum
from os import environ as env
from os import path
__all__ = ["Config"]
class Config(Enum):
"""Default viper configuration."""
db_url = env.get("VIPER_DB_URL", "viperdb.sqlite3")
max_workers = int(env.get("VIPER_MAX_WORKERS", 0))
modules_... | [
"os.environ.get"
] | [((210, 252), 'os.environ.get', 'env.get', (['"""VIPER_DB_URL"""', '"""viperdb.sqlite3"""'], {}), "('VIPER_DB_URL', 'viperdb.sqlite3')\n", (217, 252), True, 'from os import environ as env\n'), ((275, 306), 'os.environ.get', 'env.get', (['"""VIPER_MAX_WORKERS"""', '(0)'], {}), "('VIPER_MAX_WORKERS', 0)\n", (282, 306), T... |
#!python
import os
import sys
import datetime
sys.path.append(os.path.join(os.path.dirname(__file__), '../..'))
import util
def test_send_response():
str = '{"aaa": "bbb"}'
#util.send_response('text', str)
#util.send_response('html', str)
#util.send_response('binary', str)
obj = {
'key1': 'abc',
'... | [
"os.path.dirname",
"util.send_response"
] | [((337, 368), 'util.send_response', 'util.send_response', (['"""json"""', 'obj'], {}), "('json', obj)\n", (355, 368), False, 'import util\n'), ((77, 102), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (92, 102), False, 'import os\n')] |
"""
This file contains all the unit tests for our framework's data helpers.
"""
from collections import OrderedDict
# noinspection PyProtectedMember
from builder.data_helper import is_object, is_array, is_string, is_integer, is_number, is_boolean, _parse_path, \
find_value
test_dict = {
'n1': 'v1',
'n2': ... | [
"builder.data_helper.find_value",
"builder.data_helper.is_array",
"builder.data_helper.is_integer",
"builder.data_helper.is_string",
"builder.data_helper.is_boolean",
"builder.data_helper.is_object",
"builder.data_helper.is_number",
"collections.OrderedDict",
"builder.data_helper._parse_path"
] | [((534, 557), 'builder.data_helper.find_value', 'find_value', (['"""value"""', '""""""'], {}), "('value', '')\n", (544, 557), False, 'from builder.data_helper import is_object, is_array, is_string, is_integer, is_number, is_boolean, _parse_path, find_value\n'), ((584, 611), 'builder.data_helper.find_value', 'find_value... |
import os, json
codes = ["EUde", "EUes", "EUfr", "EUit", "EUnl", "EUru", "JPja", "EUen", "USes"]
script_dir = os.path.dirname(__file__)
with open("lang_dict_EUen.json") as f:
lang_dict = json.load(f)
for code in codes:
rel_path = f"leanny.github.io/data/Languages/lang_dict_{code}.json"
abs_file_path = os... | [
"json.dump",
"os.path.dirname",
"json.load",
"os.path.join"
] | [((111, 136), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (126, 136), False, 'import os, json\n'), ((193, 205), 'json.load', 'json.load', (['f'], {}), '(f)\n', (202, 205), False, 'import os, json\n'), ((318, 352), 'os.path.join', 'os.path.join', (['script_dir', 'rel_path'], {}), '(script_d... |
#from tkinter import *
from tkinter import Tk, Label, Frame, BOTTOM, LEFT, Button #base class for tkinter
from wakeonlan import BROADCAST_IP, send_magic_packet
root = Tk()
topFrame = Frame(root) # creates a blank rectangle frame
topFrame.pack() #.pack method places the item in the main window
bottomFrame = Frame(root... | [
"tkinter.Button",
"wakeonlan.send_magic_packet",
"tkinter.Label",
"tkinter.Tk",
"tkinter.Frame"
] | [((168, 172), 'tkinter.Tk', 'Tk', ([], {}), '()\n', (170, 172), False, 'from tkinter import Tk, Label, Frame, BOTTOM, LEFT, Button\n'), ((185, 196), 'tkinter.Frame', 'Frame', (['root'], {}), '(root)\n', (190, 196), False, 'from tkinter import Tk, Label, Frame, BOTTOM, LEFT, Button\n'), ((310, 321), 'tkinter.Frame', 'Fr... |
# -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# https://doc.scrapy.org/en/latest/topics/items.html
import scrapy
from scrapy.contrib.loader.processor import TakeFirst
class HouseItem(scrapy.Item):
# define the fields for your item here like:
# name = scrapy... | [
"scrapy.contrib.loader.processor.TakeFirst"
] | [((371, 382), 'scrapy.contrib.loader.processor.TakeFirst', 'TakeFirst', ([], {}), '()\n', (380, 382), False, 'from scrapy.contrib.loader.processor import TakeFirst\n'), ((424, 435), 'scrapy.contrib.loader.processor.TakeFirst', 'TakeFirst', ([], {}), '()\n', (433, 435), False, 'from scrapy.contrib.loader.processor impor... |
#
# Copyright (c) 2021 Airbyte, Inc., all rights reserved.
#
from unittest.mock import mock_open, patch
import pytest
from octavia_cli.apply import diff_helpers
def test_compute_checksum(mocker):
with patch("builtins.open", mock_open(read_data=b"data")) as mock_file:
digest = diff_helpers.compute_checks... | [
"octavia_cli.apply.diff_helpers.compute_diff",
"octavia_cli.apply.diff_helpers.display_diff_line",
"octavia_cli.apply.diff_helpers.exclude_secrets_from_diff",
"unittest.mock.mock_open",
"octavia_cli.apply.diff_helpers.compute_checksum",
"octavia_cli.apply.diff_helpers.click.style.assert_called_with",
"p... | [((493, 616), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""obj, expected_output"""', "[(diff_helpers.SECRET_MASK, True), ('not secret', False), ({}, False)]"], {}), "('obj, expected_output', [(diff_helpers.SECRET_MASK,\n True), ('not secret', False), ({}, False)])\n", (516, 616), False, 'import pytest... |
"""
Copyright 2020 The OneFlow 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 required by applicable law or agr... | [
"unittest.main",
"oneflow.tensor_scatter_nd_update",
"numpy.zeros",
"numpy.ones"
] | [((3767, 3777), 'numpy.ones', 'np.ones', (['(8)'], {}), '(8)\n', (3774, 3777), True, 'import numpy as np\n'), ((3799, 3810), 'numpy.ones', 'np.ones', (['(16)'], {}), '(16)\n', (3806, 3810), True, 'import numpy as np\n'), ((3844, 3855), 'numpy.zeros', 'np.zeros', (['(8)'], {}), '(8)\n', (3852, 3855), True, 'import numpy... |
from pymongo import MongoClient
import numpy as np
db = MongoClient().rainfall_sz
TRAIN_DATA_PATH = "E:/CIKM2017_train/train.txt"
TEST_DATA_PATH = "E:/CIKM2017_train/testA.txt"
def create_idx_train():
for t in range(15):
for h in range(4):
print("create indext for t{}h{}".format(t, h))
... | [
"pymongo.MongoClient",
"numpy.asarray"
] | [((57, 70), 'pymongo.MongoClient', 'MongoClient', ([], {}), '()\n', (68, 70), False, 'from pymongo import MongoClient\n'), ((2067, 2081), 'numpy.asarray', 'np.asarray', (['xs'], {}), '(xs)\n', (2077, 2081), True, 'import numpy as np\n'), ((2527, 2541), 'numpy.asarray', 'np.asarray', (['xs'], {}), '(xs)\n', (2537, 2541)... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Holds the application logic."""
from typing import Any, Dict, Iterable, List, Optional, Tuple, Union
from dash import Dash
from dash.dash_table.Format import Format, Scheme
import dash_bootstrap_components as dbc
import plotly.graph_objects as go
import os
import pand... | [
"werkzeug.exceptions.NotFound",
"dash.dash_table.Format.Format",
"dash.Dash",
"proseco.dashboard.model.get_summary",
"proseco.utility.io.get_user_temp_dir",
"proseco.dashboard.model.load_scenario",
"flask.send_from_directory",
"os.path.join",
"proseco.dashboard.model.load_result"
] | [((4214, 4313), 'dash.Dash', 'Dash', (['__name__'], {'suppress_callback_exceptions': '(True)', 'external_stylesheets': '[dbc.themes.BOOTSTRAP]'}), '(__name__, suppress_callback_exceptions=True, external_stylesheets=[dbc\n .themes.BOOTSTRAP])\n', (4218, 4313), False, 'from dash import Dash\n'), ((858, 886), 'proseco.... |
import click
from ovos_skills_manager import OVOSSkillsManager
APPSTORE_OPTIONS = ["ovos", "mycroft", "pling", "andlo", "neon", "all"]
def enable(appstore: str):
osm = OVOSSkillsManager()
original = osm.get_active_appstores()
click.echo("Currently active appstores: " + ", ".join(original))
if appstor... | [
"ovos_skills_manager.OVOSSkillsManager",
"click.echo"
] | [((175, 194), 'ovos_skills_manager.OVOSSkillsManager', 'OVOSSkillsManager', ([], {}), '()\n', (192, 194), False, 'from ovos_skills_manager import OVOSSkillsManager\n'), ((823, 863), 'click.echo', 'click.echo', (['"""No new appstores to enable"""'], {}), "('No new appstores to enable')\n", (833, 863), False, 'import cli... |
from menus.models import Menu
from products.models import Product, Category
def get_dashboard_data_summary(user):
if user.is_superuser:
menus = Menu.objects.all()
products = Product.objects.all()
categories = Category.objects.all()
else:
menus = Menu.objects.filter(restaurant__... | [
"products.models.Product.objects.filter",
"menus.models.Menu.objects.filter",
"products.models.Product.objects.all",
"products.models.Category.objects.all",
"menus.models.Menu.objects.all",
"products.models.Category.objects.filter"
] | [((158, 176), 'menus.models.Menu.objects.all', 'Menu.objects.all', ([], {}), '()\n', (174, 176), False, 'from menus.models import Menu\n'), ((196, 217), 'products.models.Product.objects.all', 'Product.objects.all', ([], {}), '()\n', (215, 217), False, 'from products.models import Product, Category\n'), ((239, 261), 'pr... |
# -*- coding: utf-8 -*-
#####################################
# @author [<NAME>]
# @email [<EMAIL>]
# @github https://github.com/Rexyyj
# @date 2021-08-19 08:46:18
# @desc
####################################
from pathlib import Path
from sros2 import _utilities
from cryptography import x509
from cryptography.hazma... | [
"smt_artifact.managers.dir_manager.Dir_Manager",
"cryptography.x509.NameAttribute",
"smt_artifact.managers.governance_manager.Governance_Manager",
"smt_artifact.managers.permission_manager.Permission_Manager",
"pathlib.Path.cwd",
"cryptography.hazmat.backends.default_backend"
] | [((2419, 2450), 'smt_artifact.managers.dir_manager.Dir_Manager', 'Dir_Manager', (['self.key', 'self.cer'], {}), '(self.key, self.cer)\n', (2430, 2450), False, 'from smt_artifact.managers.dir_manager import Dir_Manager\n'), ((2484, 2522), 'smt_artifact.managers.governance_manager.Governance_Manager', 'Governance_Manager... |
"""Integration tests for DNSPod"""
from unittest import TestCase
import pytest
from lexicon.tests.providers.integration_tests import IntegrationTests
from lexicon.providers.dnspod import Provider
# Hook into testing framework by inheriting unittest.TestCase and reuse
# the tests which *each and every* implementation... | [
"pytest.mark.skip",
"pytest.fixture",
"pytest.skip"
] | [((713, 767), 'pytest.mark.skip', 'pytest.mark.skip', ([], {'reason': '"""new test, missing recording"""'}), "(reason='new test, missing recording')\n", (729, 767), False, 'import pytest\n'), ((881, 935), 'pytest.mark.skip', 'pytest.mark.skip', ([], {'reason': '"""new test, missing recording"""'}), "(reason='new test, ... |
import pandas as pd
import networkx as nx
import numpy as np
import time
from itertools import permutations, combinations
from scipy.linalg import eigh
import matplotlib.pyplot as plt
import random
import matplotlib as mpl
import sys
mpl.rcParams['xtick.labelsize'] = 13
mpl.rcParams['ytick.labelsize'] = 13
mpl.rcPara... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"pandas.read_csv",
"random.shuffle",
"matplotlib.pyplot.legend",
"time.time",
"itertools.combinations",
"matplotlib.pyplot.figure",
"numpy.mean",
"networkx.Graph",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.... | [((420, 460), 'pandas.read_csv', 'pd.read_csv', (['"""M_251189.CSV"""'], {'header': 'None'}), "('M_251189.CSV', header=None)\n", (431, 460), True, 'import pandas as pd\n'), ((694, 704), 'networkx.Graph', 'nx.Graph', ([], {}), '()\n', (702, 704), True, 'import networkx as nx\n'), ((1357, 1370), 'numpy.mean', 'np.mean', ... |
# Generated by Django 3.0.5 on 2020-04-15 21:32
import django.contrib.gis.db.models.fields
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
n... | [
"django.db.models.CharField",
"django.db.models.DateTimeField",
"django.db.models.ForeignKey",
"django.db.models.SlugField"
] | [((385, 436), 'django.db.models.SlugField', 'models.SlugField', ([], {'primary_key': '(True)', 'serialize': '(False)'}), '(primary_key=True, serialize=False)\n', (401, 436), False, 'from django.db import migrations, models\n'), ((570, 637), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(300)', ... |
from summary import summary
from pyimagesearch.centroidtracker import CentroidTracker
import cv2
# from xlwt import Workbook
from xlutils.copy import copy
# from openpyxl import load_workbook
# import xlsxwriter
import xlrd
# import openpyxl
import numpy as np
import datetime
video_path = "crowd_Video.mp4"... | [
"xlutils.copy.copy",
"cv2.circle",
"cv2.putText",
"numpy.save",
"cv2.waitKey",
"xlrd.open_workbook",
"cv2.dnn.blobFromImage",
"cv2.imshow",
"summary.summary",
"pyimagesearch.centroidtracker.CentroidTracker",
"datetime.date.today",
"cv2.VideoCapture",
"cv2.rectangle",
"numpy.array",
"cv2.... | [((408, 443), 'xlrd.open_workbook', 'xlrd.open_workbook', (['"""Data_base.xls"""'], {}), "('Data_base.xls')\n", (426, 443), False, 'import xlrd\n'), ((491, 506), 'xlutils.copy.copy', 'copy', (['Data_base'], {}), '(Data_base)\n', (495, 506), False, 'from xlutils.copy import copy\n'), ((642, 659), 'pyimagesearch.centroid... |
import re
import click
from pathlib import Path
@click.command()
@click.option('--marker-file')
@click.option('--content-file')
def parse(marker_file: str, content_file: str):
lines = Path(marker_file).read_text()
marker_items = re.findall(r'\d{2}:\d{2}(?=\.)', lines)
with open(content_file) as content:
... | [
"pathlib.Path",
"re.findall",
"click.option",
"click.command"
] | [((50, 65), 'click.command', 'click.command', ([], {}), '()\n', (63, 65), False, 'import click\n'), ((67, 96), 'click.option', 'click.option', (['"""--marker-file"""'], {}), "('--marker-file')\n", (79, 96), False, 'import click\n'), ((98, 128), 'click.option', 'click.option', (['"""--content-file"""'], {}), "('--conten... |
import weakref
import subprocess
import os
import warnings
import atexit
from ._cycler import Cycler
from ._boolean import Boolean
from ..weaklist import WeakList
from .. import mpi
from .. import disk
from ..disk import TempFile
from ..globevars import _DIRECTORY_
from ..exceptions import EverestException
class Task... | [
"atexit.register",
"subprocess.Popen",
"os.makedirs",
"subprocess.call",
"weakref.ref",
"os.path.join"
] | [((1551, 1567), 'weakref.ref', 'weakref.ref', (['obj'], {}), '(obj)\n', (1562, 1567), False, 'import weakref\n'), ((2494, 2526), 'os.makedirs', 'os.makedirs', (['logs'], {'exist_ok': '(True)'}), '(logs, exist_ok=True)\n', (2505, 2526), False, 'import os\n'), ((2551, 2591), 'os.path.join', 'os.path.join', (['logs', "(se... |
import unittest
from malcolm.core import Process, call_with_params
from malcolm.modules.builtin.controllers import ClientComms
class TestClientComms(unittest.TestCase):
def setUp(self):
self.process = Process("proc")
self.o = call_with_params(ClientComms, self.process, (),
... | [
"malcolm.core.call_with_params",
"malcolm.core.Process"
] | [((217, 232), 'malcolm.core.Process', 'Process', (['"""proc"""'], {}), "('proc')\n", (224, 232), False, 'from malcolm.core import Process, call_with_params\n'), ((250, 308), 'malcolm.core.call_with_params', 'call_with_params', (['ClientComms', 'self.process', '()'], {'mri': '"""mri"""'}), "(ClientComms, self.process, (... |
# Generated by Django 3.0.7 on 2020-09-26 22:45
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('publiapp_api', '0010_auto_20200925_0300'),
]
operations = [
migrations.CreateM... | [
"django.db.models.ForeignKey",
"django.db.models.DateTimeField",
"django.db.models.CharField",
"django.db.models.AutoField"
] | [((1795, 1923), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'default': '(685)', 'on_delete': 'django.db.models.deletion.CASCADE', 'related_name': '"""ubigeo"""', 'to': '"""publiapp_api.Ubigeo"""'}), "(default=685, on_delete=django.db.models.deletion.CASCADE,\n related_name='ubigeo', to='publiapp_api.Ub... |
import os
import json
import argparse
import numpy
import torch
import seaborn
import soundfile
import matplotlib
from pytorch_lightning import Trainer, loggers
from image2reverb.model import Image2Reverb
from image2reverb.dataset import Image2ReverbDataset
from matplotlib import pyplot
def main():
parser = argpa... | [
"json.dump",
"pytorch_lightning.Trainer",
"image2reverb.dataset.Image2ReverbDataset",
"argparse.ArgumentParser",
"torch.utils.data.DataLoader",
"os.path.isdir",
"os.makedirs",
"torch.load",
"matplotlib.pyplot.figure",
"seaborn.boxplot",
"torch.cuda.is_available",
"numpy.array",
"image2reverb... | [((315, 340), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (338, 340), False, 'import argparse\n'), ((1911, 1936), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (1934, 1936), False, 'import torch\n'), ((1952, 2011), 'image2reverb.dataset.Image2ReverbDataset', 'Image2... |
import json
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--original_json', default='/media/data/santhosh/vqa/data/data_prepro_oracle_old.json', help='path to original json file containing image lists')
parser.add_argument('--save_path', default='/media/data/santhosh/vqa/data/image_map_old_ne... | [
"argparse.ArgumentParser"
] | [((38, 63), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (61, 63), False, 'import argparse\n')] |
import numpy as np
import numba
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.utils.validation import check_is_fitted
import scipy.linalg
import scipy.stats
import scipy.sparse
from .utils import (
flatten,
validate_homogeneous_token_types,
)
from .coo_utils import sum_coo_entries
... | [
"numpy.float32",
"numpy.asarray",
"numba.njit",
"sklearn.utils.validation.check_is_fitted",
"numpy.where",
"numpy.int32"
] | [((520, 542), 'numba.njit', 'numba.njit', ([], {'nogil': '(True)'}), '(nogil=True)\n', (530, 542), False, 'import numba\n'), ((4366, 4388), 'numba.njit', 'numba.njit', ([], {'nogil': '(True)'}), '(nogil=True)\n', (4376, 4388), False, 'import numba\n'), ((4291, 4313), 'numpy.asarray', 'np.asarray', (['result_row'], {}),... |
from django.utils import timezone
def checa_aluno(usuario):
return usuario.tipo == 'A'
def checa_professor(usuario):
return usuario.tipo == 'P'
def checa_nao_coordenador(usuario):
return checa_aluno(usuario) or checa_professor(usuario)
def get_semestre_atual():
hoje = timezone.now()
ano = hoje.y... | [
"django.utils.timezone.now"
] | [((289, 303), 'django.utils.timezone.now', 'timezone.now', ([], {}), '()\n', (301, 303), False, 'from django.utils import timezone\n')] |
import torch
import torch.nn as nn
import torch.nn.functional as F
from rlpyt.models.conv2d import Conv2dModel
from rlpyt.models.mlp import MlpModel
from rlpyt.utils.tensor import infer_leading_dims, restore_leading_dims
def weight_init(m):
"""Custom weight init for Conv2D and Linear layers."""
if isinstance(... | [
"torch.tanh",
"rlpyt.utils.tensor.restore_leading_dims",
"rlpyt.models.conv2d.Conv2dModel",
"torch.nn.LayerNorm",
"rlpyt.models.mlp.MlpModel",
"torch.nn.Linear",
"torch.nn.init.calculate_gain",
"rlpyt.utils.tensor.infer_leading_dims",
"torch.nn.init.orthogonal_"
] | [((343, 377), 'torch.nn.init.orthogonal_', 'nn.init.orthogonal_', (['m.weight.data'], {}), '(m.weight.data)\n', (362, 377), True, 'import torch.nn as nn\n'), ((1739, 1907), 'rlpyt.models.conv2d.Conv2dModel', 'Conv2dModel', ([], {'in_channels': 'c', 'channels': '(channels or [32, 32, 32, 32])', 'kernel_sizes': '(kernel_... |
"""Knee data set.
This file contains a class for interacting with kneeGRASP data sets. It is intended
for use as a data loader interface for PyTorch. It treats each slice as a separate
sample. When the __getitem__ function is invoked via dataset[index], it retrieves
the slice at index from the dataset folder and retur... | [
"h5py.File",
"numpy.copy",
"numpy.array",
"os.path.join",
"os.listdir"
] | [((1130, 1159), 'os.path.join', 'os.path.join', (['root_dir', 'split'], {}), '(root_dir, split)\n', (1142, 1159), False, 'import os\n'), ((2590, 2646), 'os.path.join', 'os.path.join', (['self.directory', 'self.file_list[file_index]'], {}), '(self.directory, self.file_list[file_index])\n', (2602, 2646), False, 'import o... |
import sys
import os
sys.path.append(os.path.dirname(os.path.dirname(os.getcwd())))
import torch
from training_structures.Simple_Late_Fusion import train, test
from fusions.common_fusions import Concat
sys.path.append('/home/pliang/multibench/MultiBench/datasets/imdb')
from get_data_robust import get_dataloader, get_... | [
"sys.path.append",
"get_data_robust.get_dataloader",
"torch.nn.BCEWithLogitsLoss",
"fusions.common_fusions.Concat",
"os.getcwd",
"robustness.all_in_one.general_train",
"unimodals.common_models.Linear",
"unimodals.common_models.MaxOut_MLP",
"robustness.all_in_one.general_test",
"get_data_robust.get... | [((204, 271), 'sys.path.append', 'sys.path.append', (['"""/home/pliang/multibench/MultiBench/datasets/imdb"""'], {}), "('/home/pliang/multibench/MultiBench/datasets/imdb')\n", (219, 271), False, 'import sys\n'), ((491, 554), 'get_data_robust.get_dataloader', 'get_dataloader', (['"""../../../video/multimodal_imdb.hdf5""... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.