code stringlengths 20 1.04M | apis list | extract_api stringlengths 75 9.94M |
|---|---|---|
"""
LsRunSystemdGenerator - command ``ls -lan /run/systemd/generator``
==================================================================
The ``ls -lan /run/systemd/generator`` command provides information for only
the ``/run/systemd/generator`` directory.
Sample input is shown in the Examples. See ``FileListing`` cl... | [
"insights.parser"
] | [((1536, 1574), 'insights.parser', 'parser', (['Specs.ls_run_systemd_generator'], {}), '(Specs.ls_run_systemd_generator)\n', (1542, 1574), False, 'from insights import parser, CommandParser, FileListing\n')] |
# Copyright (c) 2020 PaddlePaddle 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 applic... | [
"numpy.random.seed",
"pgl.utils.data.sampler.Sampler",
"collections.namedtuple",
"pgl.utils.data.sampler.StreamSampler",
"warnings.warn",
"paddle.reader.buffered",
"pgl.utils.mp_reader.multiprocess_reader",
"numpy.random.shuffle"
] | [((887, 935), 'collections.namedtuple', 'namedtuple', (['"""WorkerInfo"""', "['num_workers', 'fid']"], {}), "('WorkerInfo', ['num_workers', 'fid'])\n", (897, 935), False, 'from collections import namedtuple\n'), ((4571, 4587), 'numpy.random.seed', 'np.random.seed', ([], {}), '()\n', (4585, 4587), True, 'import numpy as... |
import numpy as np
from math import *
from random import uniform
def deriv(f, x):
fprime = np.diff(f)/np.diff(x)
return fprime
def avg(matrix):
return np.sum(matrix, axis = 0)/len(matrix)
def sdev(matrix): # std dev of G
lst = np.asarray(matrix)
return np.absolute(avg(lst**2)-... | [
"numpy.asarray",
"numpy.diff",
"numpy.sum",
"random.uniform"
] | [((265, 283), 'numpy.asarray', 'np.asarray', (['matrix'], {}), '(matrix)\n', (275, 283), True, 'import numpy as np\n'), ((99, 109), 'numpy.diff', 'np.diff', (['f'], {}), '(f)\n', (106, 109), True, 'import numpy as np\n'), ((110, 120), 'numpy.diff', 'np.diff', (['x'], {}), '(x)\n', (117, 120), True, 'import numpy as np\... |
import uuid
from fastapi import Request
from fastapi.responses import JSONResponse
class ExternalError(Exception):
def __init__(self):
self.status = 500
self.message = 'An error occurred in the integration API'
class ResourceAlreadySynced(Exception):
def __init__(self, resource: str):
... | [
"fastapi.responses.JSONResponse"
] | [((659, 751), 'fastapi.responses.JSONResponse', 'JSONResponse', ([], {'status_code': 'exc.status', 'content': "{'message': exc.message, 'success': False}"}), "(status_code=exc.status, content={'message': exc.message,\n 'success': False})\n", (671, 751), False, 'from fastapi.responses import JSONResponse\n'), ((893, ... |
import unittest
from electrum_firo.dash_tx import TxOutPoint
from electrum_firo.protx import ProTxMN
class ProTxTestCase(unittest.TestCase):
def test_protxmn(self):
mn_dict = {
'alias': 'default',
'bls_privk': '<KEY>'
'<KEY>',
'collateral': {
... | [
"electrum_firo.protx.ProTxMN.from_dict",
"electrum_firo.dash_tx.TxOutPoint"
] | [((1059, 1085), 'electrum_firo.protx.ProTxMN.from_dict', 'ProTxMN.from_dict', (['mn_dict'], {}), '(mn_dict)\n', (1076, 1085), False, 'from electrum_firo.protx import ProTxMN\n'), ((1392, 1420), 'electrum_firo.dash_tx.TxOutPoint', 'TxOutPoint', (["(b'\\x00' * 32)", '(-1)'], {}), "(b'\\x00' * 32, -1)\n", (1402, 1420), Fa... |
import os
import threading
import pytest
from ddtrace.profiling import _periodic
from ddtrace.profiling import _service
if os.getenv("DD_PROFILE_TEST_GEVENT", False):
import gevent
class Event(object):
"""
We can't use gevent Events here[0], nor can we use native threading
events (b... | [
"ddtrace.profiling._periodic.PeriodicRealThread",
"ddtrace.profiling._periodic.PeriodicService",
"pytest.raises",
"gevent.sleep",
"os.getenv"
] | [((127, 169), 'os.getenv', 'os.getenv', (['"""DD_PROFILE_TEST_GEVENT"""', '(False)'], {}), "('DD_PROFILE_TEST_GEVENT', False)\n", (136, 169), False, 'import os\n'), ((1136, 1212), 'ddtrace.profiling._periodic.PeriodicRealThread', '_periodic.PeriodicRealThread', (['(0.001)', '_run_periodic'], {'on_shutdown': '_on_shutdo... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, division, absolute_import
from datetime import timedelta, datetime
import pytest
from builtins import * # pylint: disable=unused-import, redefined-builtin
from flexget.manager import Session
from flexget.plugins.internal.api_tvmaze import APITVMaze, T... | [
"datetime.datetime.strftime",
"flexget.plugins.internal.api_tvmaze.APITVMaze.series_lookup",
"flexget.manager.Session",
"datetime.timedelta",
"datetime.datetime.now",
"pytest.mark.xfail"
] | [((20434, 20500), 'pytest.mark.xfail', 'pytest.mark.xfail', ([], {'reason': '"""VCR attempts to compare str to unicode"""'}), "(reason='VCR attempts to compare str to unicode')\n", (20451, 20500), False, 'import pytest\n'), ((18409, 18471), 'datetime.datetime.strftime', 'datetime.strftime', (["entry['tvmaze_episode_air... |
from scratch_py import manager
import os
import random
import time
# Start Pygame
game = manager.GameManager(800, 800, os.getcwd())
game.change_title("Tank Shooter Game")
# Background
game.change_background_image("background1.png")
# Tank
tank = game.new_sprite('tank.png', 20)
tank.go_to(0, -250)
tank_rotation = 5
t... | [
"os.getcwd",
"random.randint",
"time.sleep"
] | [((2469, 2482), 'time.sleep', 'time.sleep', (['(3)'], {}), '(3)\n', (2479, 2482), False, 'import time\n'), ((120, 131), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (129, 131), False, 'import os\n'), ((441, 466), 'random.randint', 'random.randint', (['(-300)', '(300)'], {}), '(-300, 300)\n', (455, 466), False, 'import r... |
# Author: <NAME> <<EMAIL>>
#
# License: Apache Software License 2.0
"""Preprocessing pipeline for incoming data."""
import logging
import warnings
from typing import Union
import pandas as pd
from nannyml.exceptions import InvalidArgumentsException, InvalidReferenceDataException, MissingMetadataException
from n... | [
"nannyml.exceptions.InvalidReferenceDataException",
"nannyml.exceptions.InvalidArgumentsException",
"nannyml.exceptions.MissingMetadataException",
"warnings.warn",
"logging.getLogger"
] | [((464, 491), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (481, 491), False, 'import logging\n'), ((1507, 1857), 'nannyml.exceptions.MissingMetadataException', 'MissingMetadataException', (['f"""metadata is still missing values for {missing_properties}.\nPlease rectify by renaming colu... |
import sys
import math
from PIL import Image
def rgb_to_lightness(rgb):
return (rgb[0] + rgb[1] + rgb[2]) / 3
def get_average_light(image, top_left, bottom_right):
result = 0
total = 0
for x in range(top_left[0], bottom_right[0]):
for y in range(top_left[1], bottom_right[1]):
resu... | [
"math.floor",
"PIL.Image.open"
] | [((988, 1011), 'PIL.Image.open', 'Image.open', (['sys.argv[1]'], {}), '(sys.argv[1])\n', (998, 1011), False, 'from PIL import Image\n'), ((1029, 1067), 'math.floor', 'math.floor', (['(image.size[1] / BLOCK_SIZE)'], {}), '(image.size[1] / BLOCK_SIZE)\n', (1039, 1067), False, 'import math\n'), ((1094, 1132), 'math.floor'... |
#!/usr/bin/env python3
#
# Copyright (c) Greenplum Inc 2009. All Rights Reserved.
#
"""
This file defines the interface that can be used to
fetch and update system configuration information,
as well as the data object returned by the
"""
import os
from gppylib.gplog import *
from gppylib.utils import checkNot... | [
"tempfile.NamedTemporaryFile",
"gppylib.utils.checkNotNone"
] | [((591, 617), 'gppylib.utils.checkNotNone', 'checkNotNone', (['"""path"""', 'path'], {}), "('path', path)\n", (603, 617), False, 'from gppylib.utils import checkNotNone\n'), ((708, 744), 'tempfile.NamedTemporaryFile', 'NamedTemporaryFile', (['"""w"""'], {'delete': '(True)'}), "('w', delete=True)\n", (726, 744), False, ... |
import os
import tempfile
try:
import importlib.resources as pkg_resources
except ImportError:
# Try backported to PY<37 `importlib_resources`.
import importlib_resources as pkg_resources
from . import jars
import jpype
import jpype.imports
from jpype.types import *
from jpype import JProxy, JImplements, J... | [
"copy.deepcopy",
"jpype.JProxy",
"tempfile.TemporaryDirectory",
"jpype.JImplements",
"org.optaplanner.optapy.PythonWrapperGenerator.getPythonObjectId",
"jpype.JImplementationFor",
"copy.copy",
"jpype.JArray",
"importlib_resources.read_text",
"jpype.startJVM",
"os.path.join",
"importlib_resourc... | [((395, 424), 'tempfile.TemporaryDirectory', 'tempfile.TemporaryDirectory', ([], {}), '()\n', (422, 424), False, 'import tempfile\n'), ((819, 854), 'jpype.startJVM', 'jpype.startJVM', ([], {'classpath': 'classpath'}), '(classpath=classpath)\n', (833, 854), False, 'import jpype\n'), ((1345, 1378), 'jpype.JImplements', '... |
import FWCore.ParameterSet.Config as cms
from PhysicsTools.PatAlgos.tools.helpers import getPatAlgosToolsTask
process = cms.Process("bphAnalysis")
patAlgosToolsTask = getPatAlgosToolsTask(process)
#process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) )
process.maxEvents = cms.untracked.PSet( input... | [
"FWCore.ParameterSet.Config.string",
"FWCore.ParameterSet.Config.untracked.int32",
"FWCore.ParameterSet.Config.untracked.vstring",
"Configuration.AlCa.GlobalTag.GlobalTag",
"FWCore.ParameterSet.Config.untracked.bool",
"FWCore.ParameterSet.Config.Process",
"PhysicsTools.PatAlgos.tools.helpers.getPatAlgos... | [((121, 147), 'FWCore.ParameterSet.Config.Process', 'cms.Process', (['"""bphAnalysis"""'], {}), "('bphAnalysis')\n", (132, 147), True, 'import FWCore.ParameterSet.Config as cms\n'), ((169, 198), 'PhysicsTools.PatAlgos.tools.helpers.getPatAlgosToolsTask', 'getPatAlgosToolsTask', (['process'], {}), '(process)\n', (189, 1... |
import io
from six import StringIO
from tests.utils import DummyTransport, assert_nodes_equal, load_xml
from zeep.wsdl import wsdl
def test_serialize():
wsdl_content = StringIO("""
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="http://tests.python-zeep.org/tns"
... | [
"tests.utils.assert_nodes_equal",
"zeep.wsdl.wsdl.Document",
"tests.utils.DummyTransport",
"tests.utils.load_xml",
"io.open"
] | [((1263, 1296), 'zeep.wsdl.wsdl.Document', 'wsdl.Document', (['wsdl_content', 'None'], {}), '(wsdl_content, None)\n', (1276, 1296), False, 'from zeep.wsdl import wsdl\n'), ((1987, 2035), 'tests.utils.assert_nodes_equal', 'assert_nodes_equal', (['expected', 'serialized.content'], {}), '(expected, serialized.content)\n',... |
import uvicorn
from fastapi import FastAPI
from variables import WeatherVariables
import numpy
import pickle
import pandas as pd
import onnxruntime as rt
# Create app object
app = FastAPI()
# Load model scalar
pickle_in = open("artifacts/model-scaler.pkl", "rb")
scaler = pickle.load(pickle_in)
# Load the model
sess... | [
"onnxruntime.InferenceSession",
"pickle.load",
"numpy.array",
"fastapi.FastAPI"
] | [((182, 191), 'fastapi.FastAPI', 'FastAPI', ([], {}), '()\n', (189, 191), False, 'from fastapi import FastAPI\n'), ((275, 297), 'pickle.load', 'pickle.load', (['pickle_in'], {}), '(pickle_in)\n', (286, 297), False, 'import pickle\n'), ((323, 364), 'onnxruntime.InferenceSession', 'rt.InferenceSession', (['"""artifacts/s... |
# -*- coding:utf-8 -*-
"""
Author:
<NAME>,<EMAIL>
"""
from collections import OrderedDict, namedtuple, defaultdict
from itertools import chain
from copy import copy
from tensorflow.keras.initializers import RandomNormal
from tensorflow.keras.layers import Embedding, Input, Flatten
from tensorflow.keras.regulari... | [
"tensorflow.keras.regularizers.l2",
"copy.copy",
"collections.defaultdict",
"tensorflow.keras.initializers.RandomNormal",
"collections.namedtuple",
"tensorflow.keras.layers.Input",
"collections.OrderedDict",
"tensorflow.keras.layers.Flatten"
] | [((529, 656), 'collections.namedtuple', 'namedtuple', (['"""SparseFeat"""', "['name', 'vocabulary_size', 'embedding_dim', 'use_hash', 'dtype',\n 'embedding_name', 'group_name']"], {}), "('SparseFeat', ['name', 'vocabulary_size', 'embedding_dim',\n 'use_hash', 'dtype', 'embedding_name', 'group_name'])\n", (539, 65... |
import numpy as np
import scipy as sp
from sklearn.metrics.classification import _check_targets, type_of_target
def pac_metric(y_true, y_pred):
return _pac_score(y_true.cpu().numpy(), y_pred.cpu().numpy()) * 100
def _pac_score(solution, prediction):
"""
Probabilistic Accuracy based on log_loss metric.
... | [
"numpy.sum",
"numpy.log",
"numpy.ravel",
"numpy.argmax",
"numpy.isfinite",
"sklearn.metrics.classification.type_of_target",
"numpy.max",
"numpy.exp",
"scipy.maximum"
] | [((5209, 5233), 'sklearn.metrics.classification.type_of_target', 'type_of_target', (['solution'], {}), '(solution)\n', (5223, 5233), False, 'from sklearn.metrics.classification import _check_targets, type_of_target\n'), ((1013, 1031), 'numpy.ravel', 'np.ravel', (['solution'], {}), '(solution)\n', (1021, 1031), True, 'i... |
from django.contrib import admin
from project.forms import ProjectAdminForm, ProjectUserMembershipAdminForm
from project.models import (
Project, ProjectCategory, ProjectFundingSource, ProjectSystemAllocation, ProjectUserMembership
)
from project.openldap import (update_openldap_project, update_openldap_project_me... | [
"project.openldap.update_openldap_project",
"django.contrib.admin.register",
"project.openldap.update_openldap_project_membership"
] | [((333, 364), 'django.contrib.admin.register', 'admin.register', (['ProjectCategory'], {}), '(ProjectCategory)\n', (347, 364), False, 'from django.contrib import admin\n'), ((443, 479), 'django.contrib.admin.register', 'admin.register', (['ProjectFundingSource'], {}), '(ProjectFundingSource)\n', (457, 479), False, 'fro... |
"""
블로그 데이터 스크래핑.
"""
from naver import NaverBlogCrawler, NaverPostCrawler
from tistory import TistoryBlogCrawler, TistoryPostCrawler
from enum import Enum
import time
import random
class SupportPlatform(Enum):
"""
지원되는 플랫폼에 대한 enum 리스트
"""
Naver = 0
Tistory = 1
def __str__(self):
ret... | [
"tistory.TistoryPostCrawler.read_post",
"naver.NaverBlogCrawler.read_list_in_category",
"naver.NaverPostCrawler.read_post",
"random.random",
"tistory.TistoryBlogCrawler.read_list_in_category"
] | [((1759, 1834), 'naver.NaverBlogCrawler.read_list_in_category', 'NaverBlogCrawler.read_list_in_category', (['blog_id', 'category_id', 'include_child'], {}), '(blog_id, category_id, include_child)\n', (1797, 1834), False, 'from naver import NaverBlogCrawler, NaverPostCrawler\n'), ((2228, 2272), 'naver.NaverPostCrawler.r... |
#!/usr/bin/python
from __future__ import unicode_literals
# https://stackoverflow.com/questions/19475955/using-django-models-in-external-python-script
from django.core.management.base import BaseCommand, CommandError
import sys
import commands
import datetime
from provision.models import Cluster
from qrba import sett... | [
"datetime.datetime.utcnow",
"commands.getstatusoutput",
"provision.models.Cluster.objects.filter"
] | [((488, 514), 'datetime.datetime.utcnow', 'datetime.datetime.utcnow', ([], {}), '()\n', (512, 514), False, 'import datetime\n'), ((604, 667), 'provision.models.Cluster.objects.filter', 'Cluster.objects.filter', ([], {'name': "settings.QUMULO_devcluster['name']"}), "(name=settings.QUMULO_devcluster['name'])\n", (626, 66... |
from brownie import chain
from rich.console import Console
from config.badger_config import digg_config
from .SnapshotManager import SnapshotManager
console = Console()
# Rebase constants pulled directly from `UFragmentsPolicy.sol`.
# 15 minute rebase window at 8pm UTC everyday.
REBASE_WINDOW_OFFSET_SEC = digg_confi... | [
"rich.console.Console",
"brownie.chain.time",
"brownie.chain.mine",
"brownie.chain.sleep"
] | [((161, 170), 'rich.console.Console', 'Console', ([], {}), '()\n', (168, 170), False, 'from rich.console import Console\n'), ((1861, 1901), 'brownie.chain.sleep', 'chain.sleep', (['(shift_secs - reportDelaySec)'], {}), '(shift_secs - reportDelaySec)\n', (1872, 1901), False, 'from brownie import chain\n'), ((2233, 2260)... |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | [
"unittest.main",
"io.StringIO",
"pyspark.SparkConf",
"tempfile.gettempdir",
"pyspark.sql.SparkSession.builder.master",
"xmlrunner.XMLTestRunner",
"os.listdir"
] | [((3653, 3702), 'unittest.main', 'unittest.main', ([], {'testRunner': 'testRunner', 'verbosity': '(2)'}), '(testRunner=testRunner, verbosity=2)\n', (3666, 3702), False, 'import unittest\n'), ((1894, 1915), 'tempfile.gettempdir', 'tempfile.gettempdir', ([], {}), '()\n', (1913, 1915), False, 'import tempfile\n'), ((3532,... |
from flask import request, jsonify, g, url_for
from flask_restplus import abort, Resource, fields, Namespace, marshal_with
from flask_restplus import marshal
from sqlalchemy import desc
from app.models.address import Address
from app.utils.utilities import auth
from instance.config import Config
address_api = Namespa... | [
"flask.request.args.get",
"flask_restplus.marshal_with",
"flask_restplus.abort",
"flask_restplus.marshal",
"app.models.address.Address.query.filter_by",
"flask.url_for",
"flask_restplus.fields.DateTime",
"flask_restplus.fields.String",
"app.models.address.Address.address_line_1.ilike",
"sqlalchemy... | [((313, 380), 'flask_restplus.Namespace', 'Namespace', (['"""addresses"""'], {'description': '"""An address creation namespace"""'}), "('addresses', description='An address creation namespace')\n", (322, 380), False, 'from flask_restplus import abort, Resource, fields, Namespace, marshal_with\n'), ((4552, 4580), 'flask... |
## HAYSTACKR
# Generate clean http network traffic for labs by downloading a list of websites
# <NAME>, github.com/bgreenba/, @secintsight
#deps: pip install requests argparse bs4
import requests, argparse, sys, time, urllib
from bs4 import BeautifulSoup
def getopts(argv):
parser = argparse.ArgumentP... | [
"argparse.ArgumentParser",
"time.sleep",
"requests.get",
"bs4.BeautifulSoup",
"argparse.FileType"
] | [((302, 527), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""haystackr"""', 'epilog': '"""This script simply generates web requests to a provided list of URLs. It will also request all references resources with a \'src\' attribute (eg; img, script)"""'}), '(description=\'haystackr\', epi... |
import os
import numpy as np
from tqdm import tqdm
import cv2
import glob
from utils import *
from constants import *
from models.model_bce import ModelBCE
from models.model_salgan import ModelSALGAN
import pdb
def test(path_to_images, path_output_maps, model_to_test=None):
list_img_files = [k.split('/')[-1].split... | [
"models.model_bce.ModelBCE",
"tqdm.tqdm",
"os.path.join"
] | [((430, 450), 'tqdm.tqdm', 'tqdm', (['list_img_files'], {}), '(list_img_files)\n', (434, 450), False, 'from tqdm import tqdm\n'), ((796, 857), 'models.model_bce.ModelBCE', 'ModelBCE', (['INPUT_SIZE[0]', 'INPUT_SIZE[1]', '(10)', '(0.05)', '(1e-05)', '(0.99)'], {}), '(INPUT_SIZE[0], INPUT_SIZE[1], 10, 0.05, 1e-05, 0.99)\... |
import pytest
import numpy as np
import pickle
from pathlib import Path
from bertopic import BERTopic
from explainlp.explainlp import ClearSearch
from explainlp.clearsify import Clearsifier
from explainlp.clearformer import Clearformer
def read_pickle(file_path):
with open(file_path, "rb") as f:
return pi... | [
"explainlp.clearsify.Clearsifier",
"pytest.fixture",
"numpy.zeros",
"numpy.isnan",
"numpy.hstack",
"explainlp.clearformer.Clearformer",
"pathlib.Path",
"pickle.load",
"numpy.array",
"numpy.random.rand",
"explainlp.explainlp.ClearSearch",
"numpy.all"
] | [((336, 367), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (350, 367), False, 'import pytest\n'), ((437, 468), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (451, 468), False, 'import pytest\n'), ((558, 589), 'pytest.fixture'... |
import asyncio
async def add(x, y):
r = x + y
return r
async def bad_call(a, b, c, d):
a_b = await add(a, b)
await asyncio.sleep(1)
c_d = await add(c, d)
print(a_b * c_d)
if __name__ == "__main__":
loop = asyncio.get_event_loop()
loop.run_until_complete(bad_call(1,... | [
"asyncio.get_event_loop",
"asyncio.sleep"
] | [((255, 279), 'asyncio.get_event_loop', 'asyncio.get_event_loop', ([], {}), '()\n', (277, 279), False, 'import asyncio\n'), ((145, 161), 'asyncio.sleep', 'asyncio.sleep', (['(1)'], {}), '(1)\n', (158, 161), False, 'import asyncio\n')] |
#!/usr/bin/env python
import argparse
import datetime
import logging
import os
import statistics
import sys
from collections import defaultdict
from concurrent.futures import ThreadPoolExecutor, as_completed
from functools import partial
from multiprocessing.pool import ThreadPool
import math
from eviltransform import... | [
"functools.partial",
"tqdm.tqdm",
"logging.exception",
"statistics.median",
"argparse.ArgumentParser",
"logging.basicConfig",
"multiprocessing.pool.ThreadPool",
"os.path.realpath",
"collections.defaultdict",
"logging.info",
"math.isclose",
"datetime.datetime.now",
"concurrent.futures.as_comp... | [((6692, 6710), 'tqdm.tqdm', 'tqdm', ([], {'disable': '(True)'}), '(disable=True)\n', (6696, 6710), False, 'from tqdm import tqdm\n'), ((7427, 7472), 'logging.info', 'logging.info', (['f"""Hotels were saved to {path}."""'], {}), "(f'Hotels were saved to {path}.')\n", (7439, 7472), False, 'import logging\n'), ((7511, 75... |
# hand generated from propsys.h
## PROPENUMTYPE, used with IPropertyEnumType
PET_DISCRETEVALUE = 0
PET_RANGEDVALUE = 1
PET_DEFAULTVALUE = 2
PET_ENDRANGE = 3
PDTF_DEFAULT = 0
PDTF_MULTIPLEVALUES = 0x1
PDTF_ISINNATE = 0x2
PDTF_ISGROUP = 0x4
PDTF_CANGROUPBY = 0x8
PDTF_CANSTACKBY = 0x10
PDTF_ISTREEPROPERTY ... | [
"pywintypes.IID"
] | [((3419, 3464), 'pywintypes.IID', 'IID', (['"""{64440490-4C8B-11D1-8B70-080036B11A03}"""'], {}), "('{64440490-4C8B-11D1-8B70-080036B11A03}')\n", (3422, 3464), False, 'from pywintypes import IID\n'), ((3496, 3541), 'pywintypes.IID', 'IID', (['"""{64440490-4C8B-11D1-8B70-080036B11A03}"""'], {}), "('{64440490-4C8B-11D1-8B... |
#!../testenv/bin/python3
import pretty_midi
import midi
import numpy as np
from keras.models import Model
from keras.layers import Dense, Input, Lambda, Concatenate, LSTM
from keras.optimizers import Adam
from keras import backend as K
import tensorflow as tf
#import tensorflow_probability as tfp # for tf version 2... | [
"tensorflow.convert_to_tensor",
"keras.optimizers.Adam",
"tensorflow.keras.callbacks.ModelCheckpoint",
"tensorflow.keras.losses.BinaryCrossentropy",
"tensorflow.test.is_gpu_available"
] | [((1825, 1962), 'tensorflow.keras.callbacks.ModelCheckpoint', 'tf.keras.callbacks.ModelCheckpoint', ([], {'filepath': 'checkpoint_path', 'verbose': '(1)', 'save_weights_only': '(True)', 'callbacks': '[cp_callback]', 'save_freq': '(1)'}), '(filepath=checkpoint_path, verbose=1,\n save_weights_only=True, callbacks=[cp_... |
# Copyright 2016 MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | [
"datetime.datetime.utcnow",
"motor.motor_asyncio.AsyncIOMotorGridFSBucket",
"datetime.timedelta",
"mimetypes.guess_type"
] | [((6224, 6281), 'motor.motor_asyncio.AsyncIOMotorGridFSBucket', 'AsyncIOMotorGridFSBucket', (['self._database', 'root_collection'], {}), '(self._database, root_collection)\n', (6248, 6281), False, 'from motor.motor_asyncio import AsyncIOMotorDatabase, AsyncIOMotorGridFSBucket\n'), ((8698, 8724), 'mimetypes.guess_type',... |
from unittest import mock
import pytest
from django.shortcuts import resolve_url
from django.apps import apps
from django.conf import settings
from rest_framework import status
from rest_framework_simplejwt.tokens import RefreshToken
from tests.conftest import CustomClient
from tests.schemas.auth_schemas import toke... | [
"django.apps.apps.get_model",
"tests.conftest.CustomClient",
"django.shortcuts.resolve_url"
] | [((694, 746), 'django.apps.apps.get_model', 'apps.get_model', (['"""distribution"""', '"""DistributionCenter"""'], {}), "('distribution', 'DistributionCenter')\n", (708, 746), False, 'from django.apps import apps\n'), ((762, 804), 'django.apps.apps.get_model', 'apps.get_model', (['"""shipping"""', '"""ShippingItem"""']... |
""" BigGAN: The Authorized Unofficial PyTorch release
Code by <NAME> and <NAME>
This code is an unofficial reimplementation of
"Large-Scale GAN Training for High Fidelity Natural Image Synthesis,"
by <NAME>, <NAME>, and <NAME> (arXiv 1809.11096).
Let's go.
"""
import os
import functools
import mat... | [
"os.mkdir",
"utils.seed_rng",
"utils.prepare_z_y",
"torch.no_grad",
"utils.load_weights",
"sync_batchnorm.patch_replication_callback",
"torch.nn.parallel.data_parallel",
"utils.prepare_parser",
"utils.prepare_x_y",
"utils.progress",
"utils.prepare_root",
"functools.partial",
"tqdm.tqdm",
"... | [((3232, 3281), 'numpy.save', 'np.save', (['activation_filename', 'intermed_activation'], {}), '(activation_filename, intermed_activation)\n', (3239, 3281), True, 'import numpy as np\n'), ((4086, 4119), 'utils.update_config_roots', 'utils.update_config_roots', (['config'], {}), '(config)\n', (4111, 4119), False, 'impor... |
import random
import re
import time
from typing import Any, List, Optional, Tuple
import urwid
from zulipterminal.config.keys import commands_for_random_tips, is_command_key
from zulipterminal.config.symbols import (
APPLICATION_TITLE_BAR_LINE, LIST_TITLE_BAR_LINE,
)
from zulipterminal.helper import WSL, asynch
f... | [
"urwid.Text",
"urwid.Divider",
"zulipterminal.ui_tools.views.RightColumnView",
"urwid.LineBox",
"zulipterminal.config.keys.commands_for_random_tips",
"zulipterminal.ui_tools.views.LeftColumnView",
"random.choice",
"urwid.Columns",
"time.sleep",
"zulipterminal.config.keys.is_command_key",
"zulipt... | [((981, 995), 'zulipterminal.ui_tools.boxes.WriteBox', 'WriteBox', (['self'], {}), '(self)\n', (989, 995), False, 'from zulipterminal.ui_tools.boxes import SearchBox, WriteBox\n'), ((1022, 1048), 'zulipterminal.ui_tools.boxes.SearchBox', 'SearchBox', (['self.controller'], {}), '(self.controller)\n', (1031, 1048), False... |
# Copyright 2013 Google Inc. 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 a... | [
"unittest.main",
"pytype.pytd.parse.node.SetCheckPreconditions",
"itertools.permutations",
"pytype.pytd.parse.node.Node"
] | [((799, 818), 'pytype.pytd.parse.node.Node', 'node.Node', (['"""a"""', '"""b"""'], {}), "('a', 'b')\n", (808, 818), False, 'from pytype.pytd.parse import node\n'), ((905, 924), 'pytype.pytd.parse.node.Node', 'node.Node', (['"""x"""', '"""y"""'], {}), "('x', 'y')\n", (914, 924), False, 'from pytype.pytd.parse import nod... |
"""
This module is for contrast computation and operation on contrast to
obtain fixed effect results.
Author: <NAME>, <NAME>, 2016
"""
from warnings import warn
import numpy as np
import scipy.stats as sps
from .utils import z_score
DEF_TINY = 1e-50
DEF_DOFMAX = 1e10
def compute_contrast(labels, regression_resu... | [
"numpy.minimum",
"numpy.maximum",
"numpy.sum",
"numpy.asarray",
"numpy.zeros",
"scipy.linalg.sqrtm",
"numpy.dot",
"warnings.warn",
"numpy.all"
] | [((1154, 1173), 'numpy.asarray', 'np.asarray', (['con_val'], {}), '(con_val)\n', (1164, 1173), True, 'import numpy as np\n'), ((1630, 1656), 'numpy.zeros', 'np.zeros', (['(1, labels.size)'], {}), '((1, labels.size))\n', (1638, 1656), True, 'import numpy as np\n'), ((1672, 1693), 'numpy.zeros', 'np.zeros', (['labels.siz... |
# GiveMeOne by <NAME>
# Licensed under the WTFPL
import sys
sys.dont_write_bytecode = True
from flask import Flask, render_template, redirect, request
from engines import google, ddg, ytdl, wiki
import configinit
import datetime
import textwrap
import requests
import pymongo
import json
import re
import os
app = Fla... | [
"pymongo.MongoClient",
"json.dump",
"json.load",
"engines.ytdl.searchyoutube",
"flask.redirect",
"flask.request.headers.get",
"engines.google.searchimages",
"engines.wiki.searchwikipedia",
"engines.wiki.searcharchwiki",
"flask.Flask",
"os.path.exists",
"engines.wiki.searchdict",
"engines.goo... | [((317, 332), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (322, 332), False, 'from flask import Flask, render_template, redirect, request\n'), ((916, 938), 'configinit.getConfig', 'configinit.getConfig', ([], {}), '()\n', (936, 938), False, 'import configinit\n'), ((1399, 1411), 'json.load', 'json.load'... |
import os
import json
from os.path import join, dirname
from watson_developer_cloud import SpeechToTextV1
import subprocess
video_file = os.path.join(
os.path.dirname(__file__),
'resources',
'test.mp4')
command = "ffmpeg -i "+video_file+" -ab 160k -ac 2 -ar 44100 -vn ./resources/audio.wav"
subprocess.cal... | [
"watson_developer_cloud.SpeechToTextV1",
"subprocess.call",
"json.dumps",
"os.path.dirname"
] | [((306, 342), 'subprocess.call', 'subprocess.call', (['command'], {'shell': '(True)'}), '(command, shell=True)\n', (321, 342), False, 'import subprocess\n'), ((361, 484), 'watson_developer_cloud.SpeechToTextV1', 'SpeechToTextV1', ([], {'username': '"""22ccdf7d-47bb-<PASSWORD>-<PASSWORD>"""', 'password': '"""<PASSWORD>"... |
from ignite.contrib.handlers import (
CosineAnnealingScheduler,
create_lr_scheduler_with_warmup,
)
from ignite.engine import Engine
from torch.optim import Optimizer
from config_schema import ConfigSchema
from handlers.lr_reduction_early_stopping import LRReductionEarlyStopping
def get_lr_scheduler(
conf... | [
"ignite.contrib.handlers.create_lr_scheduler_with_warmup",
"ignite.contrib.handlers.CosineAnnealingScheduler",
"handlers.lr_reduction_early_stopping.LRReductionEarlyStopping"
] | [((602, 722), 'ignite.contrib.handlers.CosineAnnealingScheduler', 'CosineAnnealingScheduler', (['optimizer', '"""lr"""', 'config.learning_rate', '(0.001 * config.learning_rate)'], {'cycle_size': '(length + 1)'}), "(optimizer, 'lr', config.learning_rate, 0.001 *\n config.learning_rate, cycle_size=length + 1)\n", (626... |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import pickle
import os
import traceback
import math
from sklearn.metrics import mean_squared_error
from pyFTS.partitioners import Grid, Entropy, Util as pUtil
from fts2image import FuzzyImageCNN
from hyperopt import fmin, tpe, hp, STATUS_OK, Tri... | [
"traceback.print_exc",
"hyperopt.space_eval",
"os.getcwd",
"hyperopt.hp.choice",
"hyperopt.fmin",
"pyFTS.partitioners.Grid.GridPartitioner",
"numpy.arange",
"hyperopt.Trials",
"fts2image.FuzzyImageCNN.FuzzyImageCNN",
"sklearn.metrics.mean_squared_error"
] | [((4135, 4143), 'hyperopt.Trials', 'Trials', ([], {}), '()\n', (4141, 4143), False, 'from hyperopt import fmin, tpe, hp, STATUS_OK, Trials\n'), ((4151, 4225), 'hyperopt.fmin', 'fmin', (['cnn_objective', 'space'], {'algo': 'tpe.suggest', 'max_evals': '(500)', 'trials': 'trials'}), '(cnn_objective, space, algo=tpe.sugges... |
import logging
import spacy
import time
import uuid
from tqdm import tqdm
from typing import Tuple, Mapping, Iterable
from emissor.persistence.persistence import ScenarioController
from emissor.processing.api import SignalProcessor
from emissor.representation.annotation import AnnotationType, Token, NER
from emissor.r... | [
"tqdm.tqdm",
"uuid.uuid4",
"emissor.representation.annotation.AnnotationType.TOKEN.name.lower",
"emissor.representation.annotation.NER.for_string",
"emissor.representation.annotation.AnnotationType.NER.name.lower",
"time.time",
"spacy.load",
"emissor.representation.annotation.Token.for_string",
"log... | [((449, 476), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (466, 476), False, 'import logging\n'), ((565, 593), 'spacy.load', 'spacy.load', (['"""en_core_web_sm"""'], {}), "('en_core_web_sm')\n", (575, 593), False, 'import spacy\n'), ((1006, 1024), 'tqdm.tqdm', 'tqdm', (['text_signals']... |
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
import pathlib
from platforms import base
class Platform(base.Platform):
@property
def root(self):
r... | [
"pathlib.Path.home"
] | [((339, 358), 'pathlib.Path.home', 'pathlib.Path.home', ([], {}), '()\n', (356, 358), False, 'import pathlib\n'), ((452, 471), 'pathlib.Path.home', 'pathlib.Path.home', ([], {}), '()\n', (469, 471), False, 'import pathlib\n')] |
# Generated by Django 2.2.10 on 2020-05-03 22:19
from django.db import migrations, models
import django_countries.fields
class Migration(migrations.Migration):
dependencies = [
('ranking', '0037_account_last_activity'),
]
operations = [
migrations.AlterField(
model_name='acc... | [
"django.db.models.DateTimeField",
"django.db.models.IntegerField"
] | [((591, 663), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'blank': '(True)', 'db_index': '(True)', 'default': 'None', 'null': '(True)'}), '(blank=True, db_index=True, default=None, null=True)\n', (611, 663), False, 'from django.db import migrations, models\n'), ((790, 835), 'django.db.models.Integer... |
# -*-coding:utf-8-*-
from flask import request
from apps.core.flask.login_manager import osr_login_required
from apps.configs.sys_config import METHOD_WARNING
from apps.core.blueprint import api
from apps.core.flask.permission import permission_required
from apps.core.flask.response import response_format
from apps.mod... | [
"apps.modules.post.process.user_post.post_issue",
"apps.core.flask.response.response_format",
"apps.core.flask.permission.permission_required",
"flask.request.argget.all",
"apps.modules.post.process.user_post.post_restore",
"apps.core.blueprint.api.route",
"apps.modules.post.process.user_post.post_delet... | [((419, 486), 'apps.core.blueprint.api.route', 'api.route', (['"""/user/post"""'], {'methods': "['POST', 'PUT', 'PATCH', 'DELETE']"}), "('/user/post', methods=['POST', 'PUT', 'PATCH', 'DELETE'])\n", (428, 486), False, 'from apps.core.blueprint import api\n'), ((508, 546), 'apps.core.flask.permission.permission_required... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 1999-2018 Alibaba Group Holding Ltd.
#
# 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-... | [
"mars.tensor.expressions.merge.stack",
"mars.tensor.expressions.datasource.ones",
"mars.tests.core.calc_shape",
"mars.tensor.expressions.merge.concatenate"
] | [((908, 941), 'mars.tensor.expressions.datasource.ones', 'ones', (['(10, 20, 30)'], {'chunk_size': '(10)'}), '((10, 20, 30), chunk_size=10)\n', (912, 941), False, 'from mars.tensor.expressions.datasource import ones\n'), ((954, 987), 'mars.tensor.expressions.datasource.ones', 'ones', (['(20, 20, 30)'], {'chunk_size': '... |
# -*- coding: utf-8 -*-
# @Author: ZwEin
# @Date: 2016-11-08 14:50:34
# @Last Modified by: ZwEin
# @Last Modified time: 2016-11-13 15:32:04
import unittest
import groundtruth
from digExtractor.extractor_processor import ExtractorProcessor
from digHeightExtractor.height_extractor import HeightExtractor
class Test... | [
"unittest.main",
"digExtractor.extractor_processor.ExtractorProcessor",
"groundtruth.load_groundtruth",
"digHeightExtractor.height_extractor.HeightExtractor"
] | [((1246, 1261), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1259, 1261), False, 'import unittest\n'), ((413, 443), 'groundtruth.load_groundtruth', 'groundtruth.load_groundtruth', ([], {}), '()\n', (441, 443), False, 'import groundtruth\n'), ((540, 557), 'digHeightExtractor.height_extractor.HeightExtractor', 'H... |
from oscar.core.loading import is_model_registered
from . import abstract_models
__all__ = []
if not is_model_registered('stores', 'StoreAddress'):
class StoreAddress(abstract_models.StoreAddress):
pass
__all__.append('StoreAddress')
if not is_model_registered('stores', 'StoreGroup'):
class S... | [
"oscar.core.loading.is_model_registered"
] | [((105, 150), 'oscar.core.loading.is_model_registered', 'is_model_registered', (['"""stores"""', '"""StoreAddress"""'], {}), "('stores', 'StoreAddress')\n", (124, 150), False, 'from oscar.core.loading import is_model_registered\n'), ((264, 307), 'oscar.core.loading.is_model_registered', 'is_model_registered', (['"""sto... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Oct 26 12:22:12 2019
@author: haniaadamczyk
"""
from calendarData import CalendarData as calData
from calendarFormat import CalendarFormat as calFormat
from visualisation import Visualisation as vis
import datetime as dt
import pandas as pd
class Pers... | [
"pandas.DataFrame",
"calendarFormat.CalendarFormat.produce_distribution_of_time_total_string",
"visualisation.Visualisation",
"calendarData.CalendarData",
"calendarFormat.CalendarFormat.produce_distribution_of_time",
"calendarFormat.CalendarFormat.produce_distribution_of_time_total",
"datetime.datetime.... | [((506, 528), 'calendarData.CalendarData', 'calData', (['tCalendar_ids'], {}), '(tCalendar_ids)\n', (513, 528), True, 'from calendarData import CalendarData as calData\n'), ((559, 586), 'calendarFormat.CalendarFormat', 'calFormat', (['tCalendar_ids[0]'], {}), '(tCalendar_ids[0])\n', (568, 586), True, 'from calendarForm... |
from __future__ import print_function
import os
import unittest
from numpy import allclose
import pyNastran
from pyNastran.converters.fast.fgrid_reader import FGridReader
PKG_PATH = pyNastran.__path__[0]
TEST_PATH = os.path.join(PKG_PATH, 'converters', 'fast')
class TestFast(unittest.TestCase):
def test_fgrid_i... | [
"unittest.main",
"pyNastran.converters.fast.fgrid_reader.FGridReader",
"os.path.join",
"time.time"
] | [((218, 262), 'os.path.join', 'os.path.join', (['PKG_PATH', '"""converters"""', '"""fast"""'], {}), "(PKG_PATH, 'converters', 'fast')\n", (230, 262), False, 'import os\n'), ((869, 880), 'time.time', 'time.time', ([], {}), '()\n', (878, 880), False, 'import time\n'), ((885, 900), 'unittest.main', 'unittest.main', ([], {... |
from typing import Dict, List
import json
class RoleQuestion:
def __init__(self, name: str, skills: Dict[str, str]):
self.name = name
self.skills = skills
class Family:
def __init__(self, name: str, roles: List[RoleQuestion]):
self.name = name
self.roles = roles
def skill_d... | [
"json.dumps"
] | [((540, 558), 'json.dumps', 'json.dumps', (['skills'], {}), '(skills)\n', (550, 558), False, 'import json\n')] |
from datetime import datetime, timedelta
import cache_requests
from lxml import html
import punters_client
import pymongo
import pytest
import racing_data
import redis
import requests
import tzlocal
@pytest.fixture(scope='session', params=[datetime(2016, 2, 1), tzlocal.get_localzone().localize(datetime(2016, 2, 1))]... | [
"pymongo.MongoClient",
"tzlocal.get_localzone",
"cache_requests.Session",
"requests.Session",
"pytest.fixture",
"datetime.datetime.now",
"datetime.datetime",
"datetime.timedelta",
"racing_data.Provider",
"punters_client.Scraper",
"redis.fromurl"
] | [((370, 401), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (384, 401), False, 'import pytest\n'), ((471, 502), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (485, 502), False, 'import pytest\n'), ((601, 632), 'pytest.fixture'... |
"""
Nitime: Time-series analysis for neuroscience
The module has several sub-modules:
- ``timeseries``: contains the constructors for time and time-series objects
- ``algorithms``: Algorithms. This sub-module depends only on scipy,numpy and
matplotlib. Contains various algorithms.
- ``utils``: Utility function... | [
"numpy.testing.Tester"
] | [((1102, 1110), 'numpy.testing.Tester', 'Tester', ([], {}), '()\n', (1108, 1110), False, 'from numpy.testing import Tester\n'), ((1124, 1132), 'numpy.testing.Tester', 'Tester', ([], {}), '()\n', (1130, 1132), False, 'from numpy.testing import Tester\n')] |
from django.contrib.auth import get_user_model
from django.test import TestCase
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Ingredient, Recipe, Tag
from recipe.serializers import RecipeDetailSerializer, RecipeSerializer
RECIPES_UR... | [
"core.models.Recipe.objects.filter",
"core.models.Tag.objects.create",
"core.models.Recipe.objects.all",
"core.models.Recipe.objects.create",
"recipe.serializers.RecipeDetailSerializer",
"core.models.Recipe.objects.get",
"django.contrib.auth.get_user_model",
"django.urls.reverse",
"core.models.Ingre... | [((324, 353), 'django.urls.reverse', 'reverse', (['"""recipe:recipe-list"""'], {}), "('recipe:recipe-list')\n", (331, 353), False, 'from django.urls import reverse\n'), ((440, 489), 'django.urls.reverse', 'reverse', (['"""recipe:recipe-detail"""'], {'args': '[recipe_id]'}), "('recipe:recipe-detail', args=[recipe_id])\n... |
# -*- coding: utf-8 -*-
"""
Run EDA on a specified dataset. EDA code is written by <NAME> and <NAME>:
https://github.com/jasonwei20/eda_nlp/blob/master/code/eda.py
@author: Jay
"""
import glob
import json
import os
import shutil
import time
import random
from eda import *
start = time.time()
... | [
"json.load",
"shutil.make_archive",
"os.rename",
"json.dumps",
"time.time",
"glob.glob",
"shutil.copyfile",
"shutil.copytree"
] | [((308, 319), 'time.time', 'time.time', ([], {}), '()\n', (317, 319), False, 'import time\n'), ((1823, 1853), 'shutil.copytree', 'shutil.copytree', (['INPUT', 'OUTPUT'], {}), '(INPUT, OUTPUT)\n', (1838, 1853), False, 'import shutil\n'), ((2070, 2112), 'shutil.make_archive', 'shutil.make_archive', (['OUTPUT', '"""zip"""... |
from clearml import StorageManager
from argparse import Namespace
import pytorch_lightning as pl
import torch
import torch.nn.functional as F
from torch.utils import data
from data.dataset import get_dataset_deblur
from loggers.loggers import ImageLogger
from model.mimo_unet_modules.mimo_unet import MIMOUnet
from mod... | [
"torch.mean",
"argparse.Namespace",
"torch.stack",
"torch.utils.data.DataLoader",
"torch.optim.lr_scheduler.ReduceLROnPlateau",
"torch.nn.functional.l1_loss",
"torch.randn",
"torch.cat",
"loggers.loggers.ImageLogger",
"data.dataset.get_dataset_deblur",
"clearml.StorageManager.get_local_copy",
... | [((663, 767), 'model.blurrer_lightning_module.RealisticBlurrerModule.load_from_checkpoint', 'RealisticBlurrerModule.load_from_checkpoint', (['model_checkpoint'], {'loaded_from_checkpoint': '(True)'}), '(model_checkpoint,\n loaded_from_checkpoint=True, **kwargs)\n', (706, 767), False, 'from model.blurrer_lightning_mo... |
import numpy as np
import pandas
from sklearn.preprocessing import MinMaxScaler, StandardScaler, Binarizer
# handle the missing values
data = pandas.DataFrame([[4.0, 45.0, 984.0], [np.NAN, np.NAN, 5.0], [94.0, 23.0, 55.0]])
# print original data
print(data)
# fill the missing values with the constant 0.1
print(data.... | [
"pandas.DataFrame",
"sklearn.preprocessing.Binarizer",
"sklearn.preprocessing.MinMaxScaler",
"sklearn.preprocessing.StandardScaler"
] | [((143, 229), 'pandas.DataFrame', 'pandas.DataFrame', (['[[4.0, 45.0, 984.0], [np.NAN, np.NAN, 5.0], [94.0, 23.0, 55.0]]'], {}), '([[4.0, 45.0, 984.0], [np.NAN, np.NAN, 5.0], [94.0, 23.0, \n 55.0]])\n', (159, 229), False, 'import pandas\n'), ((437, 514), 'pandas.DataFrame', 'pandas.DataFrame', (['[[58.0, 1.0, 43.0],... |
# -*- coding: utf-8 -*-
"""
Created on Wed May 20 16:35:34 2020
@author: jeanb
"""
import os
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
sns.set()
import tensorflow as tf
from tensorflow import keras
from keras.preprocessing.image import load_img
from k... | [
"matplotlib.pyplot.title",
"keras.preprocessing.image.ImageDataGenerator",
"seaborn.heatmap",
"tensorflow.keras.layers.MaxPooling2D",
"numpy.argmax",
"tensorflow.keras.layers.Dense",
"sklearn.model_selection.train_test_split",
"matplotlib.pyplot.figure",
"numpy.random.randint",
"numpy.arange",
"... | [((200, 209), 'seaborn.set', 'sns.set', ([], {}), '()\n', (207, 209), True, 'import seaborn as sns\n'), ((4085, 4188), 'sklearn.model_selection.train_test_split', 'train_test_split', (['X_train_full', 'y_train_full'], {'test_size': '(0.2)', 'random_state': '(42)', 'stratify': 'y_train_full'}), '(X_train_full, y_train_f... |
from typing import List
from yawast.reporting.enums import Vulnerabilities
from yawast.scanner.plugins.http import response_scanner
from yawast.scanner.plugins.result import Result
from yawast.shared import network
def check_cve_2019_5418(url: str) -> List[Result]:
# this only applies to controllers, so skip the... | [
"yawast.scanner.plugins.http.response_scanner.check_response",
"yawast.shared.network.http_build_raw_request",
"yawast.shared.network.http_get",
"yawast.scanner.plugins.result.Result"
] | [((448, 535), 'yawast.shared.network.http_get', 'network.http_get', (['url', '(False)', "{'Accept': '../../../../../../../../../etc/passwd{{'}"], {}), "(url, False, {'Accept':\n '../../../../../../../../../etc/passwd{{'})\n", (464, 535), False, 'from yawast.shared import network\n'), ((576, 619), 'yawast.shared.netw... |
import math
import numpy
import chainer
from chainer.backends import cuda
from chainer import distribution
from chainer.functions.array import broadcast
from chainer.functions.array import expand_dims
from chainer.functions.array import repeat
from chainer.functions.math import erf
from chainer.functions.math import ... | [
"chainer.functions.array.expand_dims.expand_dims",
"chainer.functions.math.exponential.log",
"chainer.utils.argument.parse_kwargs",
"chainer.functions.math.exponential.exp",
"chainer.backends.cuda.cupy.random.standard_normal",
"chainer.functions.array.broadcast.broadcast_to",
"numpy.random.standard_norm... | [((4861, 4901), 'chainer.distribution.register_kl', 'distribution.register_kl', (['Normal', 'Normal'], {}), '(Normal, Normal)\n', (4885, 4901), False, 'from chainer import distribution\n'), ((428, 458), 'math.log', 'math.log', (['(2 * math.pi * math.e)'], {}), '(2 * math.pi * math.e)\n', (436, 458), False, 'import math... |
import torch
from mmaction.apis import init_recognizer, inference_recognizer
device = 'cpu'
device = torch.device(device)
model = init_recognizer("myconfig_full.py", device=device)
res = inference_recognizer(model, 'demo/demo.mp4')
print(res)
| [
"mmaction.apis.inference_recognizer",
"mmaction.apis.init_recognizer",
"torch.device"
] | [((102, 122), 'torch.device', 'torch.device', (['device'], {}), '(device)\n', (114, 122), False, 'import torch\n'), ((132, 182), 'mmaction.apis.init_recognizer', 'init_recognizer', (['"""myconfig_full.py"""'], {'device': 'device'}), "('myconfig_full.py', device=device)\n", (147, 182), False, 'from mmaction.apis import ... |
#!/usr/bin/env python
# coding: utf-8
from numpy import pi
from ams.structures import get_base_class, get_namedtuple_from_dict
RPY = get_namedtuple_from_dict("CONST", {
"PI2": 2.0 * pi
})
template = {
"roll": 0.0,
"pitch": 0.0,
"yaw": 0.0,
}
schema = {
"roll": {
"type": "number",
... | [
"ams.structures.get_base_class",
"ams.structures.get_namedtuple_from_dict"
] | [((135, 187), 'ams.structures.get_namedtuple_from_dict', 'get_namedtuple_from_dict', (['"""CONST"""', "{'PI2': 2.0 * pi}"], {}), "('CONST', {'PI2': 2.0 * pi})\n", (159, 187), False, 'from ams.structures import get_base_class, get_namedtuple_from_dict\n'), ((712, 744), 'ams.structures.get_base_class', 'get_base_class', ... |
from youversion.bible import Bible
import os
import json
import time
import random
import re
HEADER = """
---
title: "{0}"
date: {1}
book: {2}
draft: false
---
"""
template = """
## {0}
{1}
**Related verses**: {2}. See [notes](https://my.bible.com/notes/{3})
"""
has_data = True
index = 1
USERNAME = os.getenv("B... | [
"os.makedirs",
"youversion.bible.Bible",
"os.path.exists",
"re.sub",
"os.getenv"
] | [((308, 335), 'os.getenv', 'os.getenv', (['"""BIBLE_USERNAME"""'], {}), "('BIBLE_USERNAME')\n", (317, 335), False, 'import os\n'), ((347, 374), 'os.getenv', 'os.getenv', (['"""BIBLE_PASSWORD"""'], {}), "('BIBLE_PASSWORD')\n", (356, 374), False, 'import os\n'), ((380, 405), 'youversion.bible.Bible', 'Bible', (['USERNAME... |
import sys
import os
import random
import datetime
x = sys.version_info
print('{}.{}.{}'.format(*x))
print(sys.platform)
print(os.name)
# print(os.getenv('PATH'))
print(os.getcwd())
random1 = os.urandom(12)
random2 = os.urandom(12).hex()
print(random1)
print(random2)
random3 = random.randint(5, 2000... | [
"random.randint",
"os.getcwd",
"random.shuffle",
"datetime.datetime.now",
"os.urandom"
] | [((206, 220), 'os.urandom', 'os.urandom', (['(12)'], {}), '(12)\n', (216, 220), False, 'import os\n'), ((298, 321), 'random.randint', 'random.randint', (['(5)', '(2000)'], {}), '(5, 2000)\n', (312, 321), False, 'import random\n'), ((372, 389), 'random.shuffle', 'random.shuffle', (['L'], {}), '(L)\n', (386, 389), False,... |
import logging
import os
from olive.ui.devicehub import DeviceHubView as _DeviceHubView
from ..base import QWidgetViewBase
__all__ = ["DeviceHubView"]
logger = logging.getLogger(__name__)
class DeviceHubView(_DeviceHubView, QWidgetViewBase):
def __init__(self):
path = os.path.join(os.path.... | [
"os.path.dirname",
"logging.getLogger"
] | [((171, 198), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (188, 198), False, 'import logging\n'), ((312, 337), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (327, 337), False, 'import os\n')] |
from glossary import generate_csv
in_path = 'content/'
csv_file = 'content/glossary.csv'
generate_csv(in_path, csv_file)
| [
"glossary.generate_csv"
] | [((91, 122), 'glossary.generate_csv', 'generate_csv', (['in_path', 'csv_file'], {}), '(in_path, csv_file)\n', (103, 122), False, 'from glossary import generate_csv\n')] |
from setuptools import setup, find_packages
setup(name='cktgen',
version='0.1',
description='Generate collateral for detailed router',
url='ALIGN-analoglayout/ALIGN.git',
author='<NAME>',
author_email='<EMAIL>',
license='MIT',
packages=find_packages(),
setup_requires=["p... | [
"setuptools.find_packages"
] | [((279, 294), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (292, 294), False, 'from setuptools import setup, find_packages\n')] |
#!/usr/bin/env python
#################################################
""" test_queue.py
# # Test for Queue(FIFO) Implementation
# Tests:
# - Capacity, size.
# - Push, Pop, Peek.
"""
#################################################
# ### Author: <NAME>
# ### Date: 02/06/2020
# ### Last Edit: 02/06/2020... | [
"random.randint",
"queue.Queue",
"queue.ListQueue"
] | [((668, 680), 'queue.Queue', 'que.Queue', (['(7)'], {}), '(7)\n', (677, 680), True, 'import queue as que\n'), ((972, 988), 'queue.ListQueue', 'que.ListQueue', (['(7)'], {}), '(7)\n', (985, 988), True, 'import queue as que\n'), ((715, 730), 'random.randint', 'randint', (['(1)', '(100)'], {}), '(1, 100)\n', (722, 730), F... |
import os
from sqlalchemy import create_engine
from fund.module import Base
import pocket48
import setting
# 初始化数据库
print("建立数据库表格...")
engine = create_engine(setting.db_link())
Base.metadata.create_all(engine)
print("完成!")
# 建立PK配置和缓存的文件夹
print("建立PK配置文件和缓存文件...")
if not os.path.exists(setting.read_config('pk', 'c... | [
"setting.db_link",
"fund.module.Base.metadata.create_all",
"setting.read_config"
] | [((181, 213), 'fund.module.Base.metadata.create_all', 'Base.metadata.create_all', (['engine'], {}), '(engine)\n', (205, 213), False, 'from fund.module import Base\n'), ((162, 179), 'setting.db_link', 'setting.db_link', ([], {}), '()\n', (177, 179), False, 'import setting\n'), ((571, 612), 'setting.read_config', 'settin... |
from jumpscale import j
JSBASE = j.application.jsbase_get_class()
class NginxFactory(JSBASE):
def __init__(self):
self.__jslocation__ = "j.sal.nginx"
JSBASE.__init__(self)
def get(self, path="/etc/nginx"):
# TODO: *2 let work on path
return Nginx()
class Nginx(JSBASE):
... | [
"jumpscale.j.application.jsbase_get_class",
"jumpscale.j.data.serializer.serializers.getSerializerType",
"jumpscale.j.tools.path.get",
"jumpscale.j.data.serializer.json.loads"
] | [((34, 66), 'jumpscale.j.application.jsbase_get_class', 'j.application.jsbase_get_class', ([], {}), '()\n', (64, 66), False, 'from jumpscale import j\n'), ((609, 661), 'jumpscale.j.data.serializer.serializers.getSerializerType', 'j.data.serializer.serializers.getSerializerType', (['"""j"""'], {}), "('j')\n", (656, 661)... |
# Copyright (C) 2015-2016 Hewlett Packard Enterprise Development LP
#
# 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 ... | [
"opsrest.utils.userutils.check_method_permission",
"json.loads",
"hashlib.sha1",
"opsrest.utils.auditlogutils.audit_log_user_msg",
"opsrest.exceptions.ParameterNotAllowed",
"json.dumps",
"opsrest.get.get_resource",
"tornado.log.app_log.debug",
"opsrest.exceptions.TransactionFailed",
"traceback.for... | [((3391, 3422), 'userauth.get_request_user', 'userauth.get_request_user', (['self'], {}), '(self)\n', (3416, 3422), False, 'import userauth\n'), ((4512, 4526), 'hashlib.sha1', 'hashlib.sha1', ([], {}), '()\n', (4524, 4526), False, 'import hashlib\n'), ((8159, 8175), 'tornado.gen.Return', 'gen.Return', (['(True)'], {}),... |
import socket
import threading
class Pipe(threading.Thread):
def __init__(self, conn):
threading.Thread.__init__(self)
self.conn = conn
self.queue = []
def run(self):
while True:
message = self.conn.recv(1000)
if not message:
brea... | [
"threading.Thread.__init__",
"socket.socket"
] | [((452, 501), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_STREAM'], {}), '(socket.AF_INET, socket.SOCK_STREAM)\n', (465, 501), False, 'import socket\n'), ((100, 131), 'threading.Thread.__init__', 'threading.Thread.__init__', (['self'], {}), '(self)\n', (125, 131), False, 'import threading\n')] |
from .plugin import TrezorCompatiblePlugin, TrezorCompatibleKeyStore
DEV_TREZOR1 = (0x534c, 0x0001)
DEV_TREZOR2 = (0x1209, 0x53c1)
DEV_TREZOR2_BL = (0x1209, 0x53c0)
DEVICE_IDS = [
DEV_TREZOR1,
DEV_TREZOR2,
DEV_TREZOR2_BL
]
class TrezorKeyStore(TrezorCompatibleKeyStore):
hw_type = 'trezor'
device = 'B... | [
"trezorlib.transport_bridge.BridgeTransport",
"trezorlib.transport_hid.HidTransport"
] | [((1278, 1298), 'trezorlib.transport_hid.HidTransport', 'HidTransport', (['device'], {}), '(device)\n', (1290, 1298), False, 'from trezorlib.transport_hid import HidTransport\n'), ((1413, 1431), 'trezorlib.transport_bridge.BridgeTransport', 'BridgeTransport', (['d'], {}), '(d)\n', (1428, 1431), False, 'from trezorlib.t... |
import openmc
from openmc.source import Source
from openmc.stats import Box
class InputSet(object):
def __init__(self):
self.settings = openmc.Settings()
self.materials = openmc.Materials()
self.geometry = openmc.Geometry()
self.tallies = None
self.plots = None
def exp... | [
"openmc.Material",
"openmc.ZCylinder",
"openmc.RectLattice",
"openmc.Macroscopic",
"openmc.ZPlane",
"openmc.Cell",
"openmc.Geometry",
"openmc.Universe",
"openmc.YPlane",
"openmc.stats.Box",
"openmc.Plot",
"openmc.Settings",
"openmc.XPlane",
"openmc.Materials"
] | [((150, 167), 'openmc.Settings', 'openmc.Settings', ([], {}), '()\n', (165, 167), False, 'import openmc\n'), ((193, 211), 'openmc.Materials', 'openmc.Materials', ([], {}), '()\n', (209, 211), False, 'import openmc\n'), ((236, 253), 'openmc.Geometry', 'openmc.Geometry', ([], {}), '()\n', (251, 253), False, 'import openm... |
# Auto generated configuration file
# using:
# Revision: 1.19
# Source: /local/reps/CMSSW/CMSSW/Configuration/Applications/python/ConfigBuilder.py,v
# with command line options: Configuration/GenProduction/python/HIG-RunIISummer15GS-01168-fragment.py --filein file:HIG-RunIIWinter15wmLHE-01035ND.root --fileout file:HIG-... | [
"FWCore.ParameterSet.Config.untracked.int32",
"FWCore.ParameterSet.Config.double",
"FWCore.ParameterSet.Config.untracked.vstring",
"FWCore.ParameterSet.Config.untracked.double",
"Configuration.AlCa.GlobalTag.GlobalTag",
"FWCore.ParameterSet.Config.untracked.string",
"FWCore.ParameterSet.Config.untracked... | [((749, 767), 'FWCore.ParameterSet.Config.Process', 'cms.Process', (['"""GEN"""'], {}), "('GEN')\n", (760, 767), True, 'import FWCore.ParameterSet.Config as cms\n'), ((2088, 2108), 'FWCore.ParameterSet.Config.untracked.PSet', 'cms.untracked.PSet', ([], {}), '()\n', (2106, 2108), True, 'import FWCore.ParameterSet.Config... |
# Copyright 2018-2021 The glTF-Blender-IO authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | [
"mathutils.Matrix.Translation",
"mathutils.Quaternion",
"io_scene_gltf2.io.com.gltf2_io.Node",
"mathutils.Matrix.Identity",
"io_scene_gltf2.blender.exp.gltf2_blender_gather_mesh.gather_mesh",
"io_scene_gltf2.blender.com.gltf2_blender_math.round_if_near",
"mathutils.Matrix",
"math.radians",
"mathutil... | [((5476, 5561), 'io_scene_gltf2.io.exp.gltf2_io_user_extensions.export_user_extensions', 'export_user_extensions', (['"""gather_node_hook"""', 'export_settings', 'node', 'blender_object'], {}), "('gather_node_hook', export_settings, node,\n blender_object)\n", (5498, 5561), False, 'from io_scene_gltf2.io.exp.gltf2_i... |
from django.core.management.base import BaseCommand
from fb_github.models import Repository
class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument('from_repo', type=str)
parser.add_argument('to_repo', type=str)
def handle(self, *args, **options):
from_repo_l... | [
"fb_github.models.Repository.objects.get"
] | [((464, 530), 'fb_github.models.Repository.objects.get', 'Repository.objects.get', ([], {'login': 'from_repo_login', 'name': 'from_repo_name'}), '(login=from_repo_login, name=from_repo_name)\n', (486, 530), False, 'from fb_github.models import Repository\n'), ((549, 611), 'fb_github.models.Repository.objects.get', 'Rep... |
from SCons.Script import Import
from os.path import join
Import("env")
board = env.BoardConfig()
env.Append(
ASFLAGS = ["-x", "assembler-with-cpp"],
CCFLAGS=[
# CPU flags
"-march=rv32emac",
"-mabi=ilp32e",
"-mcmodel=medany",
"-msmall-data-limit=8",
# Default... | [
"SCons.Script.Import"
] | [((58, 71), 'SCons.Script.Import', 'Import', (['"""env"""'], {}), "('env')\n", (64, 71), False, 'from SCons.Script import Import\n')] |
from fastapi import APIRouter
from .endpoints import trading, prices, sso, sisensesso
router = APIRouter()
# Commenting out routes
# router.include_router(trading.router, tags=["Trading Signals"])
# router.include_router(prices.router, tags=["Prices"])
router.include_router(sso.router, tags=["sso"])
router.include_r... | [
"fastapi.APIRouter"
] | [((96, 107), 'fastapi.APIRouter', 'APIRouter', ([], {}), '()\n', (105, 107), False, 'from fastapi import APIRouter\n')] |
import importlib
class NotSet:
pass
class ImportModule:
def __init__(self, path_to_class):
self.class_name = path_to_class.split('.')[-1]
self.path_to_module = path_to_class[:(len(self.class_name) + 1) * -1]
def get_class(self):
"""Methods attempt to import class from module and... | [
"importlib.import_module"
] | [((388, 432), 'importlib.import_module', 'importlib.import_module', (['self.path_to_module'], {}), '(self.path_to_module)\n', (411, 432), False, 'import importlib\n')] |
# Copyright 2020 Aristotle University of Thessaloniki
#
# 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 ... | [
"numpy.mean",
"numpy.array",
"numpy.arange"
] | [((12863, 12909), 'numpy.mean', 'np.mean', (['[box.confidence for box in self.data]'], {}), '([box.confidence for box in self.data])\n', (12870, 12909), True, 'import numpy as np\n'), ((16445, 16491), 'numpy.mean', 'np.mean', (['[box.confidence for box in self.data]'], {}), '([box.confidence for box in self.data])\n', ... |
#
#
# Copyright (C) 2012, 2014 Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of condition... | [
"qa_error.Error",
"qa_config.GetMasterNode",
"functools.partial",
"qa_utils.GetCommandOutput",
"ganeti.query.JOB_FIELDS.keys",
"qa_utils.AssertCommand",
"ganeti.utils.retry.RetryAgain",
"re.findall",
"qa_job_utils.GetJobStatuses",
"ganeti.utils.retry.Retry"
] | [((3212, 3237), 'qa_config.GetMasterNode', 'qa_config.GetMasterNode', ([], {}), '()\n', (3235, 3237), False, 'import qa_config\n'), ((3373, 3468), 'qa_utils.GetCommandOutput', 'GetCommandOutput', (['master.primary', "('gnt-debug delay --submit %s 2>&1' % SECOND_COMMAND_DELAY)"], {}), "(master.primary, 'gnt-debug delay ... |
import os
import skimage
from skimage.filters import gaussian
from skimage import io
from skimage.transform import resize,rotate
from skimage.filters import gaussian
from imgaug import augmenters as iaa
import numpy as np
import random
class data_generator():
def __init__(self,data_dir, back_dir,
... | [
"numpy.sum",
"numpy.abs",
"numpy.invert",
"numpy.ones",
"skimage.transform.resize",
"numpy.arange",
"numpy.linalg.norm",
"skimage.transform.rotate",
"random.gauss",
"os.path.join",
"imgaug.augmenters.GaussianBlur",
"numpy.zeros_like",
"numpy.copy",
"numpy.random.shuffle",
"skimage.io.imr... | [((842, 862), 'os.listdir', 'os.listdir', (['back_dir'], {}), '(back_dir)\n', (852, 862), False, 'import os\n'), ((883, 903), 'os.listdir', 'os.listdir', (['data_dir'], {}), '(data_dir)\n', (893, 903), False, 'import os\n'), ((2651, 2691), 'skimage.io.imread', 'io.imread', (["(self.back_dir + '/' + back_fn)"], {}), "(s... |
# Load packages
import h5py
import numpy as np
import csv
import os
import sys
# Read in data
cellFace_data = np.loadtxt('cellFace.txt', dtype='i', skiprows=1)
cellType_data = np.loadtxt('cellType.txt', dtype='i', skiprows=1)
faceBC_data = np.loadtxt('faceBC.txt', dtype='i', skiprows=1)
faceCell_data = np.loadtxt('f... | [
"os.path.splitext",
"h5py.File",
"numpy.loadtxt"
] | [((113, 162), 'numpy.loadtxt', 'np.loadtxt', (['"""cellFace.txt"""'], {'dtype': '"""i"""', 'skiprows': '(1)'}), "('cellFace.txt', dtype='i', skiprows=1)\n", (123, 162), True, 'import numpy as np\n'), ((179, 228), 'numpy.loadtxt', 'np.loadtxt', (['"""cellType.txt"""'], {'dtype': '"""i"""', 'skiprows': '(1)'}), "('cellTy... |
# (C) Datadog, Inc. 2010-2017
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
"""Pgbouncer check
Collects metrics from the pgbouncer database.
"""
# stdlib
import urlparse
# 3p
import psycopg2 as pg
import psycopg2.extras as pgextras
# project
from checks import AgentCheck, CheckExcepti... | [
"checks.CheckException",
"urlparse.urlparse",
"checks.AgentCheck.__init__",
"psycopg2.connect"
] | [((2955, 3023), 'checks.AgentCheck.__init__', 'AgentCheck.__init__', (['self', 'name', 'init_config', 'agentConfig', 'instances'], {}), '(self, name, init_config, agentConfig, instances)\n', (2974, 3023), False, 'from checks import AgentCheck, CheckException\n'), ((7697, 7728), 'urlparse.urlparse', 'urlparse.urlparse',... |
# --------------------------------------------------------
# Deep Feature Flow
# Copyright (c) 2017 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by <NAME>
# --------------------------------------------------------
"""
Proposal Target Operator selects foreground and background roi and ... | [
"numpy.log",
"mxnet.operator.register",
"numpy.argsort",
"mxnet.nd.smooth_l1",
"numpy.arange",
"numpy.reshape",
"mxnet.nd.array",
"mxnet.nd.sum",
"mxnet.nd.SoftmaxActivation"
] | [((2238, 2278), 'mxnet.operator.register', 'mx.operator.register', (['"""BoxAnnotatorOHEM"""'], {}), "('BoxAnnotatorOHEM')\n", (2258, 2278), True, 'import mxnet as mx\n'), ((1319, 1363), 'numpy.reshape', 'np.reshape', (['per_roi_loss_cls'], {'newshape': '(-1,)'}), '(per_roi_loss_cls, newshape=(-1,))\n', (1329, 1363), T... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from facebook import *
import humanRandom
def main(username,password):
""" Opens FacebookClient and posts random status """
fb = FacebookClient(username,password)
humanRandom.searchEngineWaitTime()
print("brithdays...")
fb.happy_birthdays()
... | [
"humanRandom.searchEngineWaitTime"
] | [((233, 267), 'humanRandom.searchEngineWaitTime', 'humanRandom.searchEngineWaitTime', ([], {}), '()\n', (265, 267), False, 'import humanRandom\n')] |
# security, authentication and authorization
from typing import Optional
from fastapi import Depends, FastAPI
from fastapi.security import OAuth2PasswordBearer
from pydantic import BaseModel
app = FastAPI()
oauth2_scheme = OAuth2PasswordBearer(tokenUrl='token')
class User(BaseModel):
username: str
email: O... | [
"fastapi.Depends",
"fastapi.security.OAuth2PasswordBearer",
"fastapi.FastAPI"
] | [((200, 209), 'fastapi.FastAPI', 'FastAPI', ([], {}), '()\n', (207, 209), False, 'from fastapi import Depends, FastAPI\n'), ((226, 264), 'fastapi.security.OAuth2PasswordBearer', 'OAuth2PasswordBearer', ([], {'tokenUrl': '"""token"""'}), "(tokenUrl='token')\n", (246, 264), False, 'from fastapi.security import OAuth2Pass... |
#!/usr/bin/env python
import rospy
from duckietown_msgs.msg import Twist2DStamped, BoolStamped
class SimpleStopControllerNode:
def __init__(self):
self.name = 'simple_stop_controller_node'
rospy.loginfo('[%s] started', self.name)
self.sub_close = rospy.Subscriber("~too_close", BoolStamped, s... | [
"rospy.Subscriber",
"rospy.Publisher",
"rospy.loginfo",
"rospy.init_node",
"rospy.spin",
"duckietown_msgs.msg.Twist2DStamped"
] | [((647, 693), 'rospy.init_node', 'rospy.init_node', (['"""simple_stop_controller_node"""'], {}), "('simple_stop_controller_node')\n", (662, 693), False, 'import rospy\n'), ((736, 748), 'rospy.spin', 'rospy.spin', ([], {}), '()\n', (746, 748), False, 'import rospy\n'), ((209, 249), 'rospy.loginfo', 'rospy.loginfo', (['"... |
import numpy as np
from helper_class1.data_reader import DataReader
from helper_class1.hyper_parameters import HyperParameters
from helper_class1.neural_net import NeuralNet
from matplotlib import pyplot as plt
file_name = '../../../ai-edu/A-基础教程/A2-神经网络基本原理简明教程/data/ch04.npz'
data_reader = DataReader(file_na... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"helper_class1.data_reader.DataReader",
"helper_class1.hyper_parameters.HyperParameters",
"helper_class1.neural_net.NeuralNet",
"numpy.linspace",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel"
] | [((302, 323), 'helper_class1.data_reader.DataReader', 'DataReader', (['file_name'], {}), '(file_name)\n', (312, 323), False, 'from helper_class1.data_reader import DataReader\n'), ((408, 495), 'helper_class1.hyper_parameters.HyperParameters', 'HyperParameters', (['(1)', '(1)'], {'eta': 'eta', 'max_epoch': 'max_epoch', ... |
import unittest
import numpy as np
import matplotlib.pyplot as plt
from thimbles.utils.piecewise_polynomial import PiecewisePolynomial
from thimbles.utils import partitioning
from thimbles.modeling.modeling import parameter
from thimbles.modeling.modeling import Model, DataRootedModelTree, DataModelNetwork
from thimbl... | [
"unittest.main",
"thimbles.modeling.modeling.DataRootedModelTree",
"numpy.asarray",
"numpy.ones",
"thimbles.utils.piecewise_polynomial.PiecewisePolynomial",
"numpy.linspace",
"numpy.random.normal",
"thimbles.modeling.modeling.parameter",
"thimbles.modeling.modeling.DataModelNetwork"
] | [((703, 723), 'thimbles.modeling.modeling.parameter', 'parameter', ([], {'free': '(True)'}), '(free=True)\n', (712, 723), False, 'from thimbles.modeling.modeling import parameter\n'), ((867, 887), 'thimbles.modeling.modeling.parameter', 'parameter', ([], {'free': '(True)'}), '(free=True)\n', (876, 887), False, 'from th... |
# -*- coding: utf-8 -*-
# Copyright 2014-2016 OpenMarket Ltd
# Copyright 2019 The Matrix.org Foundation C.I.C.
#
# 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/li... | [
"synapse.util.caches.descriptors.cachedInlineCallbacks",
"twisted.internet.defer.succeed",
"synapse.util.caches.descriptors.cached",
"synapse.api.errors.StoreError",
"canonicaljson.json.loads",
"canonicaljson.json.dumps",
"twisted.internet.defer.returnValue",
"collections.namedtuple",
"logging.getLo... | [((1335, 1362), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1352, 1362), False, 'import logging\n'), ((1376, 1455), 'collections.namedtuple', 'collections.namedtuple', (['"""OpsLevel"""', "('ban_level', 'kick_level', 'redact_level')"], {}), "('OpsLevel', ('ban_level', 'kick_level', 'r... |
import os
from vgazer.command import RunCommand
from vgazer.exceptions import CommandError
from vgazer.exceptions import InstallError
from vgazer.platform import GetAr
from vgazer.platform import GetCc
from vgazer.platform import GetInstallPrefix
from vgazer.store.temp import StoreTemp
from vgazer.work... | [
"vgazer.platform.GetInstallPrefix",
"vgazer.command.RunCommand",
"vgazer.working_dir.WorkingDir",
"vgazer.exceptions.InstallError",
"vgazer.platform.GetAr",
"os.path.exists",
"vgazer.platform.GetCc",
"vgazer.store.temp.StoreTemp",
"os.path.join"
] | [((438, 468), 'vgazer.platform.GetInstallPrefix', 'GetInstallPrefix', (['platformData'], {}), '(platformData)\n', (454, 468), False, 'from vgazer.platform import GetInstallPrefix\n'), ((478, 507), 'vgazer.platform.GetAr', 'GetAr', (["platformData['target']"], {}), "(platformData['target'])\n", (483, 507), False, 'from ... |
#!/usr/bin/env python
#
# Curriculum Module Run Script
# - Run once per run of the module by a user
# - Run inside job submission. So in an allocation.
# - onramp_run_params.cfg file is available in current working directory
#
import os
import sys
import time
from subprocess import call
from configobj import ConfigObj... | [
"configobj.ConfigObj",
"time.sleep",
"subprocess.call",
"os.chdir",
"sys.exit"
] | [((559, 579), 'configobj.ConfigObj', 'ConfigObj', (['conf_file'], {}), '(conf_file)\n', (568, 579), False, 'from configobj import ConfigObj\n'), ((602, 617), 'os.chdir', 'os.chdir', (['"""src"""'], {}), "('src')\n", (610, 617), False, 'import os\n'), ((618, 704), 'subprocess.call', 'call', (["['mpirun', '-np', config['... |
import argparse
import sys
import logging
import traceback
import wexpect.console_reader as console_reader
import wexpect.wexpect_util as wexpect_util
logger = logging.getLogger('wexpect')
logger.info('Hello')
def main():
try:
parser = argparse.ArgumentParser(description='Wexpect: executable automation ... | [
"argparse.ArgumentParser",
"logging.getLogger",
"wexpect.wexpect_util.join_args",
"traceback.format_exc",
"sys.exit",
"wexpect.wexpect_util.str2bool"
] | [((163, 191), 'logging.getLogger', 'logging.getLogger', (['"""wexpect"""'], {}), "('wexpect')\n", (180, 191), False, 'import logging\n'), ((252, 339), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Wexpect: executable automation for Windows."""'}), "(description=\n 'Wexpect: executabl... |
# Generated by Django 2.1.3 on 2018-11-12 14:56
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import grandchallenge.core.validators
class Migration(migrations.Migration):
dependencies = [("evaluation", "0017_extra_result_cols")]
operations = [
migrations.AddFi... | [
"django.db.models.CharField"
] | [((417, 578), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'help_text': '"""The jsonpath for the field in metrics.json that contains the error of the score, eg: dice.std"""', 'max_length': '(255)'}), "(blank=True, help_text=\n 'The jsonpath for the field in metrics.json that contains th... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import io
import os
from os.path import join
import os.path
import shutil
import sys
from collections import defaultdict
from setuptools import Extension
from setuptools.dep_util import newer_group
import numpy
from extension_helpers import import_file... | [
"sys.platform.startswith",
"io.StringIO",
"setuptools.Extension",
"os.unlink",
"ctypes.sizeof",
"os.path.dirname",
"extension_helpers.write_if_different",
"os.path.exists",
"extension_helpers.get_compiler",
"collections.defaultdict",
"os.environ.get",
"setuptools.dep_util.newer_group",
"nump... | [((394, 419), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (409, 419), False, 'import os\n'), ((1663, 1676), 'io.StringIO', 'io.StringIO', ([], {}), '()\n', (1674, 1676), False, 'import io\n'), ((3237, 3250), 'io.StringIO', 'io.StringIO', ([], {}), '()\n', (3248, 3250), False, 'import io\n'... |
# Copyright (c) 2020 NVIDIA Corporation. All rights reserved.
# This work is licensed under the NVIDIA Source Code License - Non-commercial. Full
# text can be found in LICENSE.md
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision
import copy
from fcn.config import cfg
from networks.... | [
"networks.embedding.EmbeddingLoss",
"torch.nn.init.xavier_normal_",
"torch.cat",
"torch.nn.init.constant_",
"torch.nn.functional.normalize"
] | [((1666, 1755), 'networks.embedding.EmbeddingLoss', 'EmbeddingLoss', (['alpha', 'delta', 'lambda_intra', 'lambda_inter', 'self.metric', 'self.normalize'], {}), '(alpha, delta, lambda_intra, lambda_inter, self.metric, self.\n normalize)\n', (1679, 1755), False, 'from networks.embedding import EmbeddingLoss\n'), ((478... |
# -*- coding: utf-8 -*-
from django.contrib import admin
from ..models import Clipboard, File, Folder, FolderPermission, ThumbnailOption
from ..settings import FILER_IMAGE_MODEL
from ..utils.loader import load_model
from .clipboardadmin import ClipboardAdmin
from .fileadmin import FileAdmin
from .folderadmin import F... | [
"django.contrib.admin.site.register"
] | [((507, 547), 'django.contrib.admin.site.register', 'admin.site.register', (['Folder', 'FolderAdmin'], {}), '(Folder, FolderAdmin)\n', (526, 547), False, 'from django.contrib import admin\n'), ((548, 584), 'django.contrib.admin.site.register', 'admin.site.register', (['File', 'FileAdmin'], {}), '(File, FileAdmin)\n', (... |
#! /usr/bin/env python
import cv2
import numpy as np
import time
import math
class Plot:
def __init__(self, w=640, h=480, y_limit=[-60, 60], ros_rate=10):
self.w = w
self.h = h
self.y_limit = y_limit
self.step = h/(self.y_limit[1]-y_limit[0])
self.ros_rate = ros_rate
... | [
"cv2.line",
"cv2.putText",
"numpy.zeros",
"cv2.rectangle",
"numpy.interp"
] | [((336, 375), 'numpy.zeros', 'np.zeros', (['(self.h, self.w, 3)', 'np.uint8'], {}), '((self.h, self.w, 3), np.uint8)\n', (344, 375), True, 'import numpy as np\n'), ((1237, 1310), 'cv2.rectangle', 'cv2.rectangle', (['self.plot', '(0, 0)', '(self.w, self.h)', '(0, 0, 0)', 'cv2.FILLED'], {}), '(self.plot, (0, 0), (self.w,... |
# Copyright 2017 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 required by applica... | [
"tensorflow.python.platform.test.main",
"tensorflow.contrib.py2tf.impl.api.convert",
"tensorflow.contrib.py2tf.impl.api.to_graph",
"tensorflow.contrib.py2tf.utils.fake_tf",
"tensorflow.python.framework.constant_op.constant",
"tensorflow.contrib.py2tf.impl.api.convert_inline",
"tensorflow.contrib.py2tf.p... | [((1118, 1133), 'tensorflow.contrib.py2tf.utils.fake_tf', 'utils.fake_tf', ([], {}), '()\n', (1131, 1133), False, 'from tensorflow.contrib.py2tf import utils\n'), ((5555, 5566), 'tensorflow.python.platform.test.main', 'test.main', ([], {}), '()\n', (5564, 5566), False, 'from tensorflow.python.platform import test\n'), ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.