code stringlengths 20 1.04M | apis list | extract_api stringlengths 75 9.94M |
|---|---|---|
import os
import pytest
# No CLI test due to sc-show
@pytest.mark.eda
@pytest.mark.quick
def test_py(setup_example_test):
setup_example_test('fibone')
import fibone
fibone.main()
assert os.path.isfile('build/mkFibOne/job0/export/0/outputs/mkFibOne.gds')
| [
"fibone.main",
"os.path.isfile"
] | [((181, 194), 'fibone.main', 'fibone.main', ([], {}), '()\n', (192, 194), False, 'import fibone\n'), ((207, 274), 'os.path.isfile', 'os.path.isfile', (['"""build/mkFibOne/job0/export/0/outputs/mkFibOne.gds"""'], {}), "('build/mkFibOne/job0/export/0/outputs/mkFibOne.gds')\n", (221, 274), False, 'import os\n')] |
from setuptools import setup
from setuptools.command.develop import develop
setup(name='retroprime',
py_modules=['retroprime']) | [
"setuptools.setup"
] | [((78, 129), 'setuptools.setup', 'setup', ([], {'name': '"""retroprime"""', 'py_modules': "['retroprime']"}), "(name='retroprime', py_modules=['retroprime'])\n", (83, 129), False, 'from setuptools import setup\n')] |
# import the necessary packages
from tensorflow.keras.models import load_model
from image_classification.data import DataDispatcher
from image_classification.utils import config
from image_classification.layers import Mish
import numpy as np
import argparse
# construct an argument parser to parse the command line argu... | [
"tensorflow.keras.models.load_model",
"image_classification.data.DataDispatcher",
"numpy.ceil",
"argparse.ArgumentParser",
"numpy.round"
] | [((331, 356), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (354, 356), False, 'import argparse\n'), ((491, 507), 'image_classification.data.DataDispatcher', 'DataDispatcher', ([], {}), '()\n', (505, 507), False, 'from image_classification.data import DataDispatcher\n'), ((563, 621), 'tensorfl... |
import folium
from pathlib import Path
from sportgems import parse_fit_data, find_fastest_section
# desired fastest sections to parse, note larges must come first in
# order to be able to render the smaller sections on top of the larger ones
sections = [5000, 3000, 2000, 1000]
colors = ["yellow", "blue", "green", "red... | [
"folium.PolyLine",
"pathlib.Path",
"sportgems.find_fastest_section",
"folium.Map"
] | [((658, 696), 'folium.PolyLine', 'folium.PolyLine', (['coords'], {'color': '"""black"""'}), "(coords, color='black')\n", (673, 696), False, 'import folium\n'), ((707, 768), 'folium.Map', 'folium.Map', ([], {'location': 'fit_data.coordinates[300]', 'zoom_start': '(15)'}), '(location=fit_data.coordinates[300], zoom_start... |
from flask import Flask, render_template, abort
from fauxsnow import ResortModel, ForecastAPILoader, ForecastModel
app = Flask(__name__)
view_count = 0
@app.route("/")
def welcome():
resort_model = ResortModel()
resorts = resort_model.get_all_resorts()
return render_template("welcome.html", resorts=res... | [
"flask.Flask",
"fauxsnow.ForecastModel",
"flask.abort",
"fauxsnow.ForecastAPILoader",
"fauxsnow.ResortModel",
"flask.render_template"
] | [((122, 137), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (127, 137), False, 'from flask import Flask, render_template, abort\n'), ((207, 220), 'fauxsnow.ResortModel', 'ResortModel', ([], {}), '()\n', (218, 220), False, 'from fauxsnow import ResortModel, ForecastAPILoader, ForecastModel\n'), ((277, 325)... |
from PyQt5.QtCore import Qt, QSize
from PyQt5.QtWidgets import QToolButton
from PyQt5 import QtGui
import filedockstylesheet as style
class FolderButton(QToolButton):
def __init__(self, folderNumber, layoutPosition, path, clicked, parent=None):
super(FolderButton, self).__init__(parent)
self.... | [
"PyQt5.QtGui.QIcon",
"PyQt5.QtCore.QSize"
] | [((621, 634), 'PyQt5.QtCore.QSize', 'QSize', (['(50)', '(50)'], {}), '(50, 50)\n', (626, 634), False, 'from PyQt5.QtCore import Qt, QSize\n'), ((656, 692), 'PyQt5.QtGui.QIcon', 'QtGui.QIcon', (['"""assets/folderIcon.png"""'], {}), "('assets/folderIcon.png')\n", (667, 692), False, 'from PyQt5 import QtGui\n')] |
import random
from typing import TypeVar, MutableSequence
T = TypeVar('T')
def sample_items_inplace(items: MutableSequence[T], sample_size: int, item_limit: int = None):
"""Moves sampled elements to the end of items list.
When sample size is equal to the size of the items list it
shuffles items in-place... | [
"typing.TypeVar",
"random.randrange"
] | [((63, 75), 'typing.TypeVar', 'TypeVar', (['"""T"""'], {}), "('T')\n", (70, 75), False, 'from typing import TypeVar, MutableSequence\n'), ((772, 804), 'random.randrange', 'random.randrange', (['(item_limit - i)'], {}), '(item_limit - i)\n', (788, 804), False, 'import random\n')] |
import re
def capture(input: str, regex: str, pattern_flags: int = 0, groupnum: int = 1, fail_gently: bool = False) -> str:
pattern = re.compile(regex, pattern_flags)
match = pattern.search(input)
if match is None:
if not fail_gently:
raise Warning(f'Attempt to match {regex} on {input}... | [
"re.compile"
] | [((140, 172), 're.compile', 're.compile', (['regex', 'pattern_flags'], {}), '(regex, pattern_flags)\n', (150, 172), False, 'import re\n')] |
# -*- coding: utf-8 -*-
import io
import re
import demjson3
import pandas as pd
import requests
from zvt.api.utils import china_stock_code_to_id
from zvt.contract.api import df_to_db
from zvt.contract.recorder import Recorder
from zvt.domain import EtfStock, Etf
from zvt.recorders.consts import DEFAULT_SH_ETF_LIST_H... | [
"pandas.DataFrame",
"pandas.read_html",
"io.BytesIO",
"zvt.utils.time_utils.now_pd_timestamp",
"zvt.contract.api.df_to_db",
"zvt.api.utils.china_stock_code_to_id",
"demjson3.decode",
"requests.get",
"re.search",
"pandas.concat"
] | [((772, 825), 'requests.get', 'requests.get', (['url'], {'headers': 'DEFAULT_SH_ETF_LIST_HEADER'}), '(url, headers=DEFAULT_SH_ETF_LIST_HEADER)\n', (784, 825), False, 'import requests\n'), ((850, 880), 'demjson3.decode', 'demjson3.decode', (['response.text'], {}), '(response.text)\n', (865, 880), False, 'import demjson3... |
# Copyright (c) 2020, <NAME>, Honda Research Institute Europe GmbH, and
# Technical University of Darmstadt.
# 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 mus... | [
"torch.mean",
"pyrado.PathErr",
"pyrado.utils.argparser.get_argparser",
"numpy.argsort",
"pyrado.ValueErr",
"torch.std",
"torch.max",
"pyrado.utils.experiments.load_rollouts_from_dir",
"tabulate.tabulate",
"pyrado.logger.experiment.ask_for_experiment",
"os.path.join",
"os.listdir"
] | [((2432, 2462), 'pyrado.utils.experiments.load_rollouts_from_dir', 'load_rollouts_from_dir', (['ex_dir'], {}), '(ex_dir)\n', (2454, 2462), False, 'from pyrado.utils.experiments import load_rollouts_from_dir\n'), ((2548, 2566), 'os.listdir', 'os.listdir', (['ex_dir'], {}), '(ex_dir)\n', (2558, 2566), False, 'import os\n... |
import sys
if __name__ == '__main__':
N = int(sys.stdin.readline())
rating = [int(sys.stdin.readline()) for i in range(N)]
candies = [1] * N
for i in range(N - 1):
if rating[i + 1] > rating[i]:
candies[i + 1] = candies[i] + 1
for i in reversed(range(N - 1)):
if rating... | [
"sys.stdin.readline"
] | [((51, 71), 'sys.stdin.readline', 'sys.stdin.readline', ([], {}), '()\n', (69, 71), False, 'import sys\n'), ((91, 111), 'sys.stdin.readline', 'sys.stdin.readline', ([], {}), '()\n', (109, 111), False, 'import sys\n')] |
import numpy as np
def one_step_lookahead(environment, state, V, discount_factor):
"""
Helper function to calculate a state-value function.
:param environment: Initialized OpenAI gym environment object.
:param state: Agent's state to consider (integer).
:param V: The value to use as an estimator.... | [
"numpy.abs",
"numpy.argmax",
"numpy.zeros",
"numpy.ones",
"numpy.max",
"numpy.eye"
] | [((502, 526), 'numpy.zeros', 'np.zeros', (['environment.nA'], {}), '(environment.nA)\n', (510, 526), True, 'import numpy as np\n'), ((1553, 1577), 'numpy.zeros', 'np.zeros', (['environment.nS'], {}), '(environment.nS)\n', (1561, 1577), True, 'import numpy as np\n'), ((5437, 5461), 'numpy.zeros', 'np.zeros', (['environm... |
# BuildTarget: images/interfaceDefaultLightPlug.png
# BuildTarget: images/interfaceLightLinkSetupGraphEditor.png
# BuildTarget: images/interfaceLightSetGraphEditor.png
# BuildTarget: images/interfaceLightSetNodeEditor.png
# BuildTarget: images/interfaceLinkedLightsPlug.png
# BuildTarget: images/taskLightLinkingSetExpre... | [
"GafferScene.Sphere",
"GafferUI.PlugValueWidget.acquire",
"GafferUI.WidgetAlgo.grab",
"GafferSceneUI.SceneInspector",
"GafferUI.ScriptWindow.acquire",
"GafferAppleseed.AppleseedLight",
"GafferScene.StandardAttributes",
"IECore.PathMatcher",
"GafferScene.Group",
"GafferUI.NodeEditor.acquire",
"Ga... | [((607, 644), 'GafferUI.ScriptWindow.acquire', 'GafferUI.ScriptWindow.acquire', (['script'], {}), '(script)\n', (636, 644), False, 'import GafferUI\n'), ((901, 921), 'GafferScene.Sphere', 'GafferScene.Sphere', ([], {}), '()\n', (919, 921), False, 'import GafferScene\n'), ((940, 959), 'GafferScene.Group', 'GafferScene.G... |
import numpy as np
def hit_rate(array1, array2):
"""
calculate the hit rate based upon 2 boolean maps. (i.e. where are both 1)
"""
# count the number of cells that are flooded in both array1 and 2
idx_both = np.sum(np.logical_and(array1, array2))
idx_1 = np.sum(array1)
return float(idx... | [
"numpy.sum",
"numpy.logical_and",
"numpy.zeros",
"numpy.logical_or",
"numpy.int16"
] | [((280, 294), 'numpy.sum', 'np.sum', (['array1'], {}), '(array1)\n', (286, 294), True, 'import numpy as np\n'), ((665, 679), 'numpy.sum', 'np.sum', (['array2'], {}), '(array2)\n', (671, 679), True, 'import numpy as np\n'), ((1640, 1662), 'numpy.zeros', 'np.zeros', (['array1.shape'], {}), '(array1.shape)\n', (1648, 1662... |
import apsis.actions
import apsis.lib.json
from apsis.lib.py import tupleize
from apsis.lib import email
#-------------------------------------------------------------------------------
# FIXME: jinja2?
TEMPLATE = """<!doctype html>
<html>
<head>
<title>{subject}</title>
</head>
<body>
<p>
program: <code>{pro... | [
"apsis.lib.py.tupleize",
"apsis.lib.email.send_html"
] | [((554, 566), 'apsis.lib.py.tupleize', 'tupleize', (['to'], {}), '(to)\n', (562, 566), False, 'from apsis.lib.py import tupleize\n'), ((1730, 1809), 'apsis.lib.email.send_html', 'email.send_html', (['self.__to', 'subject', 'body'], {'from_': 'self.__from', 'smtp_cfg': 'smtp_cfg'}), '(self.__to, subject, body, from_=sel... |
# -*- coding:utf-8 -*-
"""
Asynchronous driven quantitative trading framework.
Author: HuangTao
Date: 2017/04/26
Email: <EMAIL>
"""
import signal
import asyncio
from quant.utils import logger
from quant.config import config
class Quant:
""" Asynchronous driven quantitative trading framework.
"""
d... | [
"asyncio.get_event_loop",
"quant.event.EventCenter",
"quant.utils.logger.initLogger",
"quant.utils.logger.info",
"quant.config.config.loads",
"quant.config.config.log.get",
"signal.signal"
] | [((955, 1003), 'signal.signal', 'signal.signal', (['signal.SIGINT', 'keyboard_interrupt'], {}), '(signal.SIGINT, keyboard_interrupt)\n', (968, 1003), False, 'import signal\n'), ((1013, 1058), 'quant.utils.logger.info', 'logger.info', (['"""start io loop ..."""'], {'caller': 'self'}), "('start io loop ...', caller=self)... |
"""
extract configuration
"""
import re
_prompt = "ConfigExtractor > "
def _printConfig(str):
print('%s%s' % (_prompt,str))
def _Service(str):
tmpSvcNew = None
tmpSvcOld = None
# get new service
try:
svcMgr = theApp.serviceMgr()
tmpSvcNew = getattr(svcMgr,str)
except Excepti... | [
"re.search",
"AthenaCommon.AlgSequence.AlgSequence",
"ROOT.gROOT.GetListOfFiles",
"re.sub"
] | [((17136, 17163), 'ROOT.gROOT.GetListOfFiles', 'ROOT.gROOT.GetListOfFiles', ([], {}), '()\n', (17161, 17163), False, 'import ROOT\n'), ((4625, 4638), 'AthenaCommon.AlgSequence.AlgSequence', 'AlgSequence', ([], {}), '()\n', (4636, 4638), False, 'from AthenaCommon.AlgSequence import AlgSequence\n'), ((7126, 7163), 're.se... |
# Project: File Volume Indexer
# Author: <NAME>
# Date Started: February 28, 2019
# Copyright: (c) Copyright 2019 <NAME>
# Module: FrameScroller
# Purpose: View for managing scans of volumes and sub volumes.
# Development:
# Instructions for use:
# Sinc... | [
"tkinter.Text",
"tkinter.LabelFrame.__init__",
"tkinter.Scrollbar",
"tkinter.Frame",
"tkinter.Tk"
] | [((3122, 3126), 'tkinter.Tk', 'Tk', ([], {}), '()\n', (3124, 3126), False, 'from tkinter import Frame, LabelFrame, Tk, Text, Scrollbar, Label, BOTTOM, W, RIGHT, X, Y, VERTICAL, HORIZONTAL, BOTH, INSERT\n'), ((1595, 1642), 'tkinter.LabelFrame.__init__', 'LabelFrame.__init__', (['self', 'container'], {'name': 'name'}), '... |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | [
"unittest.mock.patch.object",
"ironic.tests.unit.api.utils.post_get_test_deploy_template",
"ironic.common.exception.DeployTemplateAlreadyExists",
"ironic.api.controllers.v1.max_version",
"oslo_utils.uuidutils.generate_uuid",
"oslo_utils.timeutils.parse_isotime",
"ironic.tests.unit.objects.utils.create_t... | [((13665, 13729), 'unittest.mock.patch.object', 'mock.patch.object', (['objects.DeployTemplate', '"""save"""'], {'autospec': '(True)'}), "(objects.DeployTemplate, 'save', autospec=True)\n", (13682, 13729), False, 'from unittest import mock\n'), ((39676, 39743), 'unittest.mock.patch.object', 'mock.patch.object', (['obje... |
import pandas as pd
import glob
import os
import yaml
import sys
def namesToReads(reference_dir, names_to_reads, salmon_dir):
if os.path.isfile(os.path.join(reference_dir,names_to_reads)):
print("Salmon reads file previously created; new file will not be created from Salmon directory.")
sys.exit(0... | [
"pandas.read_csv",
"os.path.join",
"sys.exit"
] | [((150, 193), 'os.path.join', 'os.path.join', (['reference_dir', 'names_to_reads'], {}), '(reference_dir, names_to_reads)\n', (162, 193), False, 'import os\n'), ((310, 321), 'sys.exit', 'sys.exit', (['(0)'], {}), '(0)\n', (318, 321), False, 'import sys\n'), ((352, 387), 'os.path.join', 'os.path.join', (['salmon_dir', '... |
import time
import pandas as pd
import numpy as np
CITY_DATA = { 'chicago': 'chicago.csv',
'new york city': 'new_york_city.csv',
'washington': 'washington.csv' }
month_list = ['January', 'February', 'March', 'April', 'May', 'June']
day_list = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', ... | [
"pandas.read_csv",
"pandas.to_datetime",
"time.time"
] | [((3531, 3559), 'pandas.read_csv', 'pd.read_csv', (['CITY_DATA[city]'], {}), '(CITY_DATA[city])\n', (3542, 3559), True, 'import pandas as pd\n'), ((3583, 3615), 'pandas.to_datetime', 'pd.to_datetime', (["df['Start Time']"], {}), "(df['Start Time'])\n", (3597, 3615), True, 'import pandas as pd\n'), ((5451, 5462), 'time.... |
"""The object-oriented wrapper of PyBullet."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import time
import numpy as np
import pybullet
import six
from robovat.math import Orientation
from robovat.math import Pose
from robovat.simulation.p... | [
"pybullet.resetSimulation",
"pybullet.getAPIVersion",
"pybullet.createVisualShape",
"pybullet.calculateInverseKinematics",
"pybullet.resetDebugVisualizerCamera",
"pybullet.resetBaseVelocity",
"pybullet.setJointMotorControl2",
"pybullet.getBaseVelocity",
"pybullet.connect",
"robovat.math.Orientatio... | [((2187, 2232), 'pybullet.disconnect', 'pybullet.disconnect', ([], {'physicsClientId': 'self.uid'}), '(physicsClientId=self.uid)\n', (2206, 2232), False, 'import pybullet\n'), ((2241, 2309), 'robovat.utils.logging.logger.info', 'logger.info', (['"""Disconnected client %d to pybullet server."""', 'self._uid'], {}), "('D... |
#!/usr/bin/env python3
##
## 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 argparse
import subprocess
def gen(out_name, opt):
fout_batch = open('{}.sh'.format(out_name), 'w'... | [
"argparse.ArgumentParser"
] | [((1154, 1179), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1177, 1179), False, 'import argparse\n')] |
import os
from abc import ABCMeta
class JWEAlgorithmBase(object, metaclass=ABCMeta):
"""Base interface for all JWE algorithms.
"""
EXTRA_HEADERS = None
name = None
description = None
algorithm_type = 'JWE'
algorithm_location = 'alg'
def prepare_key(self, raw_data):
raise NotI... | [
"os.urandom"
] | [((1619, 1649), 'os.urandom', 'os.urandom', (['(self.CEK_SIZE // 8)'], {}), '(self.CEK_SIZE // 8)\n', (1629, 1649), False, 'import os\n'), ((1693, 1722), 'os.urandom', 'os.urandom', (['(self.IV_SIZE // 8)'], {}), '(self.IV_SIZE // 8)\n', (1703, 1722), False, 'import os\n')] |
import os
import getpass
import hashlib
if __name__=="__main__":
#Get number of CPUs
cpus_available = int(os.environ['SLURM_CPUS_PER_TASK'])
#Get username
username = getpass.getuser()
#Create Hash Code
hash_object = hashlib.md5(username.encode())
#Result for webcampus is
print('Y... | [
"getpass.getuser"
] | [((187, 204), 'getpass.getuser', 'getpass.getuser', ([], {}), '()\n', (202, 204), False, 'import getpass\n')] |
"""
Module for the Window class which handles everything related to window drawing and updating.
Game wide objects and settings should be set here.
"""
import pygame
from pyggui.gui.page import Page
class Window:
"""
Main class for handling everything window related.
"""
def __init__(self, game: 'Ga... | [
"pygame.display.update"
] | [((890, 913), 'pygame.display.update', 'pygame.display.update', ([], {}), '()\n', (911, 913), False, 'import pygame\n')] |
#!/usr/bin/env python
# -*- encoding: latin-1 -*-
"""SQLatorD - the SQLator daemon - Twisted version of Async
This server is not really part of SQLator, it is a version
just for fun to test twisted."""
import xmlrpclib
from twisted.internet import reactor, protocol
from twisted.protocols import basic
from sqlatord_asy... | [
"twisted.internet.reactor.run",
"sqlatord_async.LayerServer"
] | [((609, 622), 'sqlatord_async.LayerServer', 'LayerServer', ([], {}), '()\n', (620, 622), False, 'from sqlatord_async import LayerServer\n'), ((689, 702), 'twisted.internet.reactor.run', 'reactor.run', ([], {}), '()\n', (700, 702), False, 'from twisted.internet import reactor, protocol\n')] |
import unittest
import numpy as np
import methods
wilkinson_x = np.array([0.138, 0.220, 0.291, 0.560, 0.766, 1.460])
wilkinson_y = np.array([0.148, 0.171, 0.234, 0.324, 0.390, 0.493])
class TestMethods(unittest.TestCase):
def test_lineweaver_burk_with_wilkinson(self):
expected_results = ''
results ... | [
"unittest.main",
"methods.lineweaver_burk",
"numpy.array"
] | [((65, 114), 'numpy.array', 'np.array', (['[0.138, 0.22, 0.291, 0.56, 0.766, 1.46]'], {}), '([0.138, 0.22, 0.291, 0.56, 0.766, 1.46])\n', (73, 114), True, 'import numpy as np\n'), ((132, 183), 'numpy.array', 'np.array', (['[0.148, 0.171, 0.234, 0.324, 0.39, 0.493]'], {}), '([0.148, 0.171, 0.234, 0.324, 0.39, 0.493])\n'... |
from sqlalchemy import Column, text, ForeignKey
from jet_bridge_base import status
from jet_bridge_base.db import get_mapped_base, get_engine, reload_mapped_base
from jet_bridge_base.exceptions.not_found import NotFound
from jet_bridge_base.exceptions.validation_error import ValidationError
from jet_bridge_base.permis... | [
"jet_bridge_base.db.get_engine",
"sqlalchemy.sql.ddl.AddConstraint",
"jet_bridge_base.db.get_mapped_base",
"jet_bridge_base.utils.db_types.map_to_sql_type",
"jet_bridge_base.utils.db_types.db_to_sql_type",
"sqlalchemy.ForeignKey",
"sqlalchemy.text",
"jet_bridge_base.responses.json.JSONResponse",
"je... | [((865, 899), 'jet_bridge_base.utils.db_types.db_to_sql_type', 'db_to_sql_type', (["column['db_field']"], {}), "(column['db_field'])\n", (879, 899), False, 'from jet_bridge_base.utils.db_types import map_to_sql_type, db_to_sql_type\n'), ((929, 961), 'jet_bridge_base.utils.db_types.map_to_sql_type', 'map_to_sql_type', (... |
import re
import io
class FrameDecorator:
_decorators = {}
@staticmethod
def get_frame(name):
if name in FrameDecorator._decorators:
return FrameDecorator._decorators[name]
return None
@staticmethod
def set_frame(name, frame):
FrameDecorator._decorators[name] ... | [
"re.sub"
] | [((2038, 2083), 're.sub', 're.sub', (['pattern', 'route_content', 'frame_content'], {}), '(pattern, route_content, frame_content)\n', (2044, 2083), False, 'import re\n')] |
'''
MoreTransitions
======
Usage:
Import the transitions and use them with the ScreenManager class.
from kivy.garden.moretransitions import PixelTransition,RippleTransition,
BlurTransition,RVBTransition
screenManager = ScreenManager(transition=PixelTransition())
... | [
"kivy.properties.OptionProperty",
"kivy.lang.Builder.load_string",
"kivy.factory.Factory.Button",
"os.path.dirname",
"kivy.properties.StringProperty",
"kivy.properties.ColorProperty",
"kivy.properties.NumericProperty",
"kivy.base.runTouchApp",
"kivy.resources.resource_find"
] | [((844, 861), 'os.path.dirname', 'dirname', (['__file__'], {}), '(__file__)\n', (851, 861), False, 'from os.path import dirname\n'), ((1011, 1045), 'kivy.properties.StringProperty', 'StringProperty', (['TILE_TRANSITION_FS'], {}), '(TILE_TRANSITION_FS)\n', (1025, 1045), False, 'from kivy.properties import StringProperty... |
from unittest.mock import patch
from django.test import TestCase
from sidekick.tasks import add_label_to_turn_conversation, archive_turn_conversation
from sidekick.tests.utils import create_org
class AddLabelToTurnConversationTests(TestCase):
def setUp(self):
self.org = create_org()
@patch("sidekic... | [
"unittest.mock.patch",
"sidekick.tests.utils.create_org",
"sidekick.tasks.add_label_to_turn_conversation",
"sidekick.tasks.archive_turn_conversation"
] | [((306, 352), 'unittest.mock.patch', 'patch', (['"""sidekick.tasks.label_whatsapp_message"""'], {}), "('sidekick.tasks.label_whatsapp_message')\n", (311, 352), False, 'from unittest.mock import patch\n'), ((358, 411), 'unittest.mock.patch', 'patch', (['"""sidekick.tasks.get_whatsapp_contact_messages"""'], {}), "('sidek... |
import torch
from model import CutPasteNet
import math
from anomaly_detection import AnomalyDetection
from dataset import MVTecAD
from torch.utils.data import DataLoader
import os
from tqdm import tqdm
from PIL import Image
import math
import numpy as np
from scipy import signal
import torchvision.transforms as transf... | [
"torch.cat",
"torchvision.transforms.Normalize",
"torch.no_grad",
"os.path.join",
"torch.utils.data.DataLoader",
"numpy.insert",
"numpy.log10",
"cv2.resize",
"tqdm.tqdm",
"numpy.uint8",
"dataset.MVTecAD",
"torch.split",
"torch.nn.Unfold",
"cv2.addWeighted",
"torch.cuda.is_available",
"... | [((5419, 5436), 'cv2.imread', 'cv2.imread', (['image'], {}), '(image)\n', (5429, 5436), False, 'import cv2\n'), ((5447, 5504), 'cv2.resize', 'cv2.resize', (['img', '(256, 256)'], {'interpolation': 'cv2.INTER_AREA'}), '(img, (256, 256), interpolation=cv2.INTER_AREA)\n', (5457, 5504), False, 'import cv2\n'), ((5555, 5583... |
# import the required modules.
import os, stat, pdb
from util import *
# runfile: write the run script string to a file.
#
def runfile(filename):
# write the output file.
f = open(filename, 'w')
f.write(runstr)
f.close()
# set the file as executable.
st = os.stat(filename)
os.chmod(filename, st.st_mode... | [
"pdb.dihed",
"os.chmod",
"pdb.dist",
"os.stat"
] | [((271, 288), 'os.stat', 'os.stat', (['filename'], {}), '(filename)\n', (278, 288), False, 'import os, stat, pdb\n'), ((291, 336), 'os.chmod', 'os.chmod', (['filename', '(st.st_mode | stat.S_IEXEC)'], {}), '(filename, st.st_mode | stat.S_IEXEC)\n', (299, 336), False, 'import os, stat, pdb\n'), ((2928, 2954), 'pdb.dihed... |
#!/usr/bin/python3
import pefile
import string
import os, sys
def tamperUpx(outfile):
pe = pefile.PE(outfile)
newSectionNames = (
'.text',
'.data',
'.rdata',
'.idata',
'.pdata',
)
num = 0
sectnum = 0
section_table_offset = (pe.DOS_HEADER.e_lfanew + 4... | [
"pefile.PE",
"os.path.isfile"
] | [((98, 116), 'pefile.PE', 'pefile.PE', (['outfile'], {}), '(outfile)\n', (107, 116), False, 'import pefile\n'), ((4773, 4795), 'os.path.isfile', 'os.path.isfile', (['infile'], {}), '(infile)\n', (4787, 4795), False, 'import os, sys\n')] |
# Lakeshore 332 Temperature Controller Driver
# <NAME> <<EMAIL>>
# This file is a driver for the Lakeshore 332 series temperature controller.
# Some sort of license information goes here.
from lantz import Feat, Action, DictFeat
from lantz.messagebased import MessageBasedDriver
from time import sleep
class Lakesho... | [
"lantz.Feat",
"time.sleep",
"lantz.DictFeat",
"lantz.Action"
] | [((1478, 1484), 'lantz.Feat', 'Feat', ([], {}), '()\n', (1482, 1484), False, 'from lantz import Feat, Action, DictFeat\n'), ((1645, 1653), 'lantz.Action', 'Action', ([], {}), '()\n', (1651, 1653), False, 'from lantz import Feat, Action, DictFeat\n'), ((1789, 1835), 'lantz.DictFeat', 'DictFeat', ([], {'limits': '(T_min,... |
# 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 u... | [
"tempfile.mktemp"
] | [((1767, 1804), 'tempfile.mktemp', 'tempfile.mktemp', ([], {'prefix': '"""CqlshTests_"""'}), "(prefix='CqlshTests_')\n", (1782, 1804), False, 'import tempfile\n')] |
from arguments import get_args
from ddpg_agent import ddpg_agent
import mujoco_py
import gym
if __name__ == '__main__':
args = get_args()
env = gym.make(args.env_name)
ddpg_trainer = ddpg_agent(args, env)
ddpg_trainer.learn()
| [
"ddpg_agent.ddpg_agent",
"arguments.get_args",
"gym.make"
] | [((132, 142), 'arguments.get_args', 'get_args', ([], {}), '()\n', (140, 142), False, 'from arguments import get_args\n'), ((153, 176), 'gym.make', 'gym.make', (['args.env_name'], {}), '(args.env_name)\n', (161, 176), False, 'import gym\n'), ((196, 217), 'ddpg_agent.ddpg_agent', 'ddpg_agent', (['args', 'env'], {}), '(ar... |
# Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Module for Assessment object"""
from sqlalchemy.orm import validates
from ggrc import db
from ggrc.models import mixins_reminderable
from ggrc.models import mixins_statusable
from ggrc.models import ref... | [
"ggrc.models.track_object_state.track_state_for_class",
"ggrc.db.Column",
"ggrc.models.relationship.Relationship.query.filter",
"ggrc.models.reflection.PublishOnly",
"sqlalchemy.orm.validates"
] | [((6366, 6399), 'ggrc.models.track_object_state.track_state_for_class', 'track_state_for_class', (['Assessment'], {}), '(Assessment)\n', (6387, 6399), False, 'from ggrc.models.track_object_state import track_state_for_class\n'), ((5618, 5644), 'sqlalchemy.orm.validates', 'validates', (['"""operationally"""'], {}), "('o... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'chengzhi'
from tqsdk import TqApi, TqSim
# 创建API实例. 需要指定交易帐号. 如果使用API自带的模拟功能可以指定为 TqSim
api = TqApi(TqSim())
# 获得上期所 cu1906 的行情引用,当行情有变化时 quote 中的字段会对应更新
quote = api.get_quote("SHFE.cu1906")
# 输出 cu1906 的最新行情时间和最新价
print(quote["datetime"], quote["last_pric... | [
"tqsdk.TqSim"
] | [((163, 170), 'tqsdk.TqSim', 'TqSim', ([], {}), '()\n', (168, 170), False, 'from tqsdk import TqApi, TqSim\n')] |
from django.test import TestCase
from .models import User, Friendship
from faker import Faker
class FriendshipTest(TestCase):
def setUp(self):
fake = Faker()
self.user1 = User.objects.create(
username=fake.name(),
dob=fake.date()
)
self.user2 = User.objects... | [
"faker.Faker"
] | [((165, 172), 'faker.Faker', 'Faker', ([], {}), '()\n', (170, 172), False, 'from faker import Faker\n')] |
import os
import re
from pathlib import Path
from typing import Union, List, TypeVar, Generic, Callable
def esc_file_path(path: Union[str, Path]):
return re.sub(r"([ !([\])'\"])", r"\\\1", os.path.normpath(str(path)))
def noop(*args, **kwargs):
pass
def get_boolean_from_string(val: str) -> bool:
val =... | [
"typing.TypeVar"
] | [((746, 758), 'typing.TypeVar', 'TypeVar', (['"""T"""'], {}), "('T')\n", (753, 758), False, 'from typing import Union, List, TypeVar, Generic, Callable\n')] |
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
import os
import pytest
import ly_test_tools.environment.file_system as file_system
from ly_test_tools.o3de.ed... | [
"pytest.mark.parametrize",
"pytest.mark.skip",
"pytest.mark.xfail"
] | [((412, 534), 'pytest.mark.xfail', 'pytest.mark.xfail', ([], {'reason': '"""Optimized tests are experimental, we will enable xfail and monitor them temporarily."""'}), "(reason=\n 'Optimized tests are experimental, we will enable xfail and monitor them temporarily.'\n )\n", (429, 534), False, 'import pytest\n'), ... |
# -*- coding: utf-8 -*-
#
# Author: <NAME>, Finland 2014-2018
#
# This file is part of Kunquat.
#
# CC0 1.0 Universal, http://creativecommons.org/publicdomain/zero/1.0/
#
# To the extent possible under law, Kunquat Affirmers have waived all
# copyright and related or neighboring rights to Kunquat.
#
import json
impor... | [
"json.loads",
"json.dumps"
] | [((16211, 16232), 'json.dumps', 'json.dumps', (['area_info'], {}), '(area_info)\n', (16221, 16232), False, 'import json\n'), ((20420, 20448), 'json.loads', 'json.loads', (['unsafe_area_data'], {}), '(unsafe_area_data)\n', (20430, 20448), False, 'import json\n'), ((20777, 20805), 'json.loads', 'json.loads', (['unsafe_ar... |
# coding: utf-8
"""Module that does all the ML trained model prediction heavy lifting."""
from os.path import normpath, join, dirname
import numpy as np
import pandas as pd
from sklearn.externals import joblib
def full_path(filename):
"""Returns the full normalised path of a file when working dir is the one contai... | [
"pandas.DataFrame",
"pandas.get_dummies",
"os.path.dirname"
] | [((981, 1001), 'pandas.get_dummies', 'pd.get_dummies', (['test'], {}), '(test)\n', (995, 1001), True, 'import pandas as pd\n'), ((940, 969), 'pandas.DataFrame', 'pd.DataFrame', (['data'], {'index': '[0]'}), '(data, index=[0])\n', (952, 969), True, 'import pandas as pd\n'), ((366, 383), 'os.path.dirname', 'dirname', (['... |
from pylightnix.utils import ( tryread, tryread_def, trywrite, tryreadjson,
tryreadjson_def, readstr, writestr, readjson )
from stagedml.imports.sys import ( find_executable, Popen, json_load, islink,
PIPE, STDOUT, fsync, OrderedDict, listdir, re_search, remove, join )
from stagedml.types import ( List, Any, Op... | [
"stagedml.imports.sys.listdir",
"stagedml.imports.sys.join",
"stagedml.imports.sys.Popen",
"stagedml.imports.sys.find_executable",
"stagedml.imports.sys.re_search",
"sys.stdout.flush",
"stagedml.imports.sys.json_load",
"stagedml.imports.sys.islink",
"logging.getLogger"
] | [((663, 684), 'stagedml.imports.sys.find_executable', 'find_executable', (['name'], {}), '(name)\n', (678, 684), False, 'from stagedml.imports.sys import find_executable, Popen, json_load, islink, PIPE, STDOUT, fsync, OrderedDict, listdir, re_search, remove, join\n'), ((1103, 1121), 'stagedml.imports.sys.Popen', 'Popen... |
""""""
import importlib
class StructGenerator:
"""Struct builder """
def __init__(self, filename: str, prefix: str, sub_name: str):
"""Constructor"""
self.filename = filename
self.prefix = prefix
self.sub_name = sub_name
self.typedefs = {}
self.load_constant()... | [
"importlib.import_module"
] | [((430, 466), 'importlib.import_module', 'importlib.import_module', (['module_name'], {}), '(module_name)\n', (453, 466), False, 'import importlib\n')] |
# -*- coding: utf-8 -*-
#
# Copyright 2018-2021 - Swiss Data Science Center (SDSC)
# A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and
# Eidgenössische Technische Hochschule Zürich (ETHZ).
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in c... | [
"renku.core.models.calamus.Nested",
"renku.core.models.calamus.fields.IRI",
"attr.evolve",
"attr.Factory",
"attr.s",
"renku.core.models.calamus.fields.String",
"pathlib.Path",
"weakref.ref",
"renku.core.models.jsonld.read_yaml",
"os.path.lexists",
"renku.core.models.entities.Entity.from_revision... | [((3254, 3283), 'attr.s', 'attr.s', ([], {'eq': '(False)', 'order': '(False)'}), '(eq=False, order=False)\n', (3260, 3283), False, 'import attr\n'), ((13339, 13368), 'attr.s', 'attr.s', ([], {'eq': '(False)', 'order': '(False)'}), '(eq=False, order=False)\n', (13345, 13368), False, 'import attr\n'), ((19965, 19994), 'a... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
VSAN Management SDK sample exercising VSAN rebalance operation
Please use with extereme caution as this can potentially impact
the performance of your existing workload
Usage:
python vsan-rebalance-sample.py -s 192.168.1.51 \
-u '<EMAIL>' -p 'VMware1!' \
... | [
"atexit.register",
"argparse.ArgumentParser",
"vsanapiutils.ConvertVsanTaskToVcTask",
"vsanapiutils.GetVsanVcMos",
"ssl.create_default_context",
"getpass.getpass",
"vsanapiutils.WaitForTasks"
] | [((960, 1048), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Process args for VSAN SDK sample application"""'}), "(description=\n 'Process args for VSAN SDK sample application')\n", (983, 1048), False, 'import argparse\n'), ((3220, 3251), 'atexit.register', 'atexit.register', (['Disc... |
import os
for x in os.walk('/etc'):
print(x)
| [
"os.walk"
] | [((20, 35), 'os.walk', 'os.walk', (['"""/etc"""'], {}), "('/etc')\n", (27, 35), False, 'import os\n')] |
from __future__ import absolute_import, unicode_literals
from json import dumps, loads
from django.contrib import messages
from django.contrib.auth.models import User
from django.contrib.auth.views import login, password_change
from django.contrib.contenttypes.models import ContentType
from django.conf import setting... | [
"json.loads",
"django.contrib.auth.views.login",
"django.contrib.contenttypes.models.ContentType.objects.get",
"django.shortcuts.redirect",
"django.core.urlresolvers.reverse",
"django.contrib.auth.models.User.objects.filter",
"json.dumps",
"django.utils.http.urlencode",
"django.http.HttpResponseRedi... | [((2594, 2630), 'django.contrib.contenttypes.models.ContentType.objects.get', 'ContentType.objects.get', ([], {'model': 'model'}), '(model=model)\n', (2617, 2630), False, 'from django.contrib.contenttypes.models import ContentType\n'), ((10087, 10134), 'django.contrib.auth.views.login', 'login', (['request'], {'extra_c... |
import pytest
from .common import * # NOQA
namespace = {"p_client": None, "ns": None, "cluster": None, "project": None}
random_password = random_test_name("<PASSWORD>")
PROJECT_ISOLATION = os.environ.get('RANCHER_PROJECT_ISOLATION', "disabled")
def test_connectivity_between_pods():
p_client = namespace["p_cli... | [
"pytest.fixture"
] | [((2859, 2905), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""', 'autouse': '"""True"""'}), "(scope='module', autouse='True')\n", (2873, 2905), False, 'import pytest\n')] |
import unittest
import os
from requests import get
import json
class ParticipantQueryParticipantsTest(unittest.TestCase):
host = '127.0.0.1'
port = 40075
login_endpoint = '/api/participant/login'
participants_endpoint = '/api/participant/participants'
def setUp(self):
pass
def tearD... | [
"requests.get"
] | [((626, 679), 'requests.get', 'get', ([], {'url': 'url', 'verify': '(False)', 'auth': '(username, password)'}), '(url=url, verify=False, auth=(username, password))\n', (629, 679), False, 'from requests import get\n'), ((1188, 1241), 'requests.get', 'get', ([], {'url': 'url', 'verify': '(False)', 'auth': '(username, pas... |
import pygame
from pygame.locals import *
#Generic projectile template
class ProjectileObject(pygame.sprite.Sprite):
def __init__(self, width, height, proj_image, speed, screen, owner_x, owner_y):
pygame.sprite.Sprite.__init__(self)
self.width = width
self.height = height
self.speed... | [
"pygame.image.load",
"pygame.transform.scale",
"pygame.sprite.RenderPlain",
"pygame.sprite.Sprite.__init__"
] | [((210, 245), 'pygame.sprite.Sprite.__init__', 'pygame.sprite.Sprite.__init__', (['self'], {}), '(self)\n', (239, 245), False, 'import pygame\n'), ((495, 529), 'pygame.image.load', 'pygame.image.load', (['self.image_file'], {}), '(self.image_file)\n', (512, 529), False, 'import pygame\n'), ((635, 701), 'pygame.transfor... |
from django.shortcuts import render, redirect, reverse, get_object_or_404
from django.contrib.auth import login
from django.contrib.auth.decorators import login_required
from django.utils import timezone, translation
from django.utils.translation import gettext as _, get_language
from django.views import View
from djan... | [
"django.utils.translation.activate",
"django.http.HttpResponse",
"django.utils.translation.gettext",
"django.shortcuts.redirect",
"django.utils.timezone.now",
"django.contrib.messages.error",
"django.contrib.auth.login",
"simple_notes.celery.app.control.revoke",
"django.shortcuts.get_object_or_404",... | [((1043, 1078), 'django.shortcuts.render', 'render', (['request', '"""notes/index.html"""'], {}), "(request, 'notes/index.html')\n", (1049, 1078), False, 'from django.shortcuts import render, redirect, reverse, get_object_or_404\n'), ((1165, 1233), 'django.shortcuts.get_object_or_404', 'get_object_or_404', (['Notebook'... |
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import pylab
from awrams.utils.metatypes import *
import awrams.utils.datetools as dt
from awrams.utils.extents import *
from awrams.utils.ts.processing import *
o = ObjectDict
MIN_FIG_WIDTH = 800.0
MIN_FIG_HEIGHT = 600.0
NAN_FILTER_MAP = matplotli... | [
"mpl_toolkits.axes_grid1.make_axes_locatable",
"matplotlib.pyplot.subplot",
"numpy.empty",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.colorbar",
"awrams.utils.datetools.pretty_print_period",
"matplotlib.pyplot.GridSpec",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.g... | [((311, 373), 'matplotlib.colors.ListedColormap', 'matplotlib.colors.ListedColormap', (['[[0.5, 0.5, 0.5], [1, 0, 0]]'], {}), '([[0.5, 0.5, 0.5], [1, 0, 0]])\n', (343, 373), False, 'import matplotlib\n'), ((2001, 2051), 'matplotlib.ticker.ScalarFormatter', 'matplotlib.ticker.ScalarFormatter', ([], {'useOffset': '(False... |
"""
Author: <NAME>
Date Created: Apr 22, 2019
Last Edited: Apr 22, 2019
Description:
"""
from __future__ import division
import rospy
import numpy as np
from functools import reduce
class RadarUtilities:
def __init__(self):
pass
## filtering of 2D and 3D radar data
def AIRE_filter... | [
"numpy.abs",
"numpy.isnan",
"numpy.nonzero",
"numpy.rad2deg",
"numpy.mean",
"numpy.array",
"functools.reduce",
"numpy.unique"
] | [((1069, 1114), 'numpy.nonzero', 'np.nonzero', (['(radar_intensity > intensity_thres)'], {}), '(radar_intensity > intensity_thres)\n', (1079, 1114), True, 'import numpy as np\n'), ((1140, 1177), 'numpy.nonzero', 'np.nonzero', (['(radar_range > range_thres)'], {}), '(radar_range > range_thres)\n', (1150, 1177), True, 'i... |
import granatum_sdk
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from deepimpute.deepImpute import deepImpute
def main():
gn = granatum_sdk.Granatum()
assay = gn.get_import("assay")
data = np.array(assay.get("matrix")).T
seed = gn.get_arg("seed")
checkbox = gn.get_arg(... | [
"pandas.DataFrame",
"deepimpute.deepImpute.deepImpute",
"granatum_sdk.Granatum",
"numpy.array",
"numpy.log10",
"matplotlib.pyplot.subplots"
] | [((160, 183), 'granatum_sdk.Granatum', 'granatum_sdk.Granatum', ([], {}), '()\n', (181, 183), False, 'import granatum_sdk\n'), ((588, 606), 'pandas.DataFrame', 'pd.DataFrame', (['data'], {}), '(data)\n', (600, 606), True, 'import pandas as pd\n'), ((628, 690), 'deepimpute.deepImpute.deepImpute', 'deepImpute', (['framed... |
# Copyright 2017 The dm_control 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 agreed to i... | [
"dm_control.suite.common.read_model",
"numpy.random.uniform",
"dm_control.rl.control.Environment",
"dm_control.utils.containers.TaggedTasks",
"math.tan",
"numpy.zeros",
"numpy.all",
"dm_env.specs.BoundedArray",
"numpy.shape",
"numpy.random.randint",
"numpy.array",
"numpy.linalg.norm",
"numpy... | [((1562, 1586), 'dm_control.utils.containers.TaggedTasks', 'containers.TaggedTasks', ([], {}), '()\n', (1584, 1586), False, 'from dm_control.utils import containers\n'), ((2097, 2235), 'dm_control.rl.control.Environment', 'control.Environment', (['physics', 'task'], {'control_timestep': '_CONTROL_TIMESTEP', 'special_ta... |
import logging
import typing
from collections import defaultdict
from dataclasses import dataclass
from dataclasses import field as dataclass_field
from typing import Any, Dict, Iterable, Iterator, List, Optional, Set, Tuple, Union
from urllib.parse import urlparse
import yaml
from pydantic import validator
from data... | [
"datahub.metadata.com.linkedin.pegasus2avro.metadata.snapshot.DatasetSnapshot",
"datahub.metadata.schema_classes.OwnershipClass",
"datahub.emitter.mce_builder.make_data_job_urn_with_flow",
"datahub.ingestion.api.workunit.MetadataWorkUnit",
"yaml.safe_load",
"datahub.metadata.schema_classes.UpstreamClass",... | [((1569, 1596), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1586, 1596), False, 'import logging\n'), ((2034, 2072), 'pydantic.validator', 'validator', (['"""glue_s3_lineage_direction"""'], {}), "('glue_s3_lineage_direction')\n", (2043, 2072), False, 'from pydantic import validator\n')... |
""" Tests of utilities.
:Author: <NAME> <<EMAIL>>
:Date: 2016-11-10
:Copyright: 2016, Karr Lab
:License: MIT
"""
from wc_lang.core import (Model, Taxon, Environment, Submodel,
Compartment,
SpeciesType, Species, SpeciesCoefficient, DistributionInitConcentration,
... | [
"wc_lang.util.get_model_summary",
"wc_lang.core.Species",
"wc_lang.core.Model",
"wc_lang.core.DistributionInitConcentration",
"wc_lang.util.get_model_size",
"wc_lang.util.gen_ids",
"wc_lang.util.get_models",
"wc_utils.util.units.unit_registry.parse_units"
] | [((1308, 1315), 'wc_lang.core.Model', 'Model', ([], {}), '()\n', (1313, 1315), False, 'from wc_lang.core import Model, Taxon, Environment, Submodel, Compartment, SpeciesType, Species, SpeciesCoefficient, DistributionInitConcentration, Reaction, RateLaw, RateLawExpression, Parameter, DfbaObjSpecies, DfbaObjReaction, Dfb... |
#coding:utf-8
# K-means
import numpy as np
import sys
import matplotlib.pyplot as plt
argvs = sys.argv
if __name__ == "__main__":
data = np.genfromtxt(argvs[1], delimiter=",")
print(data)
#plt.subplot(2, 1, 1)
#plt.plot(data[:,0])
#plt.subplot(2, 1, 2)
plt.plot(data[:,1])
plt.show()
... | [
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.show",
"numpy.genfromtxt",
"matplotlib.pyplot.plot"
] | [((144, 182), 'numpy.genfromtxt', 'np.genfromtxt', (['argvs[1]'], {'delimiter': '""","""'}), "(argvs[1], delimiter=',')\n", (157, 182), True, 'import numpy as np\n'), ((282, 302), 'matplotlib.pyplot.plot', 'plt.plot', (['data[:, 1]'], {}), '(data[:, 1])\n', (290, 302), True, 'import matplotlib.pyplot as plt\n'), ((307,... |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
# src: https://machinelearningmastery.com/use-word-embedding-layers-deep-learning-keras/
# A word embedding is a class of approaches for representing words and documents,
# using a dense vector representation.
# Word embeddings can be learned from text data and r... | [
"keras.layers.embeddings.Embedding",
"matplotlib.pyplot.show",
"keras.preprocessing.sequence.pad_sequences",
"keras.layers.Flatten",
"keras.layers.Dense",
"numpy.array",
"keras.preprocessing.text.one_hot",
"keras.models.Sequential",
"matplotlib.pyplot.subplots"
] | [((2782, 2822), 'numpy.array', 'np.array', (['[1, 1, 1, 1, 1, 0, 0, 0, 0, 0]'], {}), '([1, 1, 1, 1, 1, 0, 0, 0, 0, 0])\n', (2790, 2822), True, 'import numpy as np\n'), ((3296, 3354), 'keras.preprocessing.sequence.pad_sequences', 'pad_sequences', (['enc_docs'], {'maxlen': 'max_length', 'padding': '"""post"""'}), "(enc_d... |
'''
Copyright 2022 Airbus SAS
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, sof... | [
"pandas.DataFrame",
"gemseo.utils.compare_data_manager_tooling.compare_dict",
"gemseo.utils.compare_data_manager_tooling.delete_keys_from_dict",
"numpy.array",
"sos_trades_core.execution_engine.execution_engine.ExecutionEngine"
] | [((1814, 1839), 'pandas.DataFrame', 'pd.DataFrame', (['dspace_dict'], {}), '(dspace_dict)\n', (1826, 1839), True, 'import pandas as pd\n'), ((1977, 2009), 'sos_trades_core.execution_engine.execution_engine.ExecutionEngine', 'ExecutionEngine', (['self.study_name'], {}), '(self.study_name)\n', (1992, 2009), False, 'from ... |
from datetime import datetime
from airflow import DAG
from airflow.operators.dummy_operator import DummyOperator
from airflow.contrib.sensors.file_sensor import FileSensor
with DAG(
dag_id="file_sensor_consume_new_data",
start_date=datetime(2020, 12, 1),
schedule_interval="0 * * * *"
) as dag:
... | [
"airflow.contrib.sensors.file_sensor.FileSensor",
"airflow.operators.dummy_operator.DummyOperator",
"datetime.datetime"
] | [((351, 447), 'airflow.contrib.sensors.file_sensor.FileSensor', 'FileSensor', ([], {'task_id': '"""get_new_data"""', 'filepath': '"""../shop123/{{ ds_nodash }}/${hour}/data.json"""'}), "(task_id='get_new_data', filepath=\n '../shop123/{{ ds_nodash }}/${hour}/data.json')\n", (361, 447), False, 'from airflow.contrib.s... |
import smtplib
import os
from email.mime.text import MIMEText
from email.mime.image import MIMEImage
from email.mime.multipart import MIMEMultipart
def report(text, img=None):
user = os.environ['EMAIL_USER']
password = os.environ['EMAIL_PASSWORD']
msg = MIMEMultipart()
msg['From'] = user
msg['To'... | [
"email.mime.multipart.MIMEMultipart",
"smtplib.SMTP",
"os.path.basename"
] | [((269, 284), 'email.mime.multipart.MIMEMultipart', 'MIMEMultipart', ([], {}), '()\n', (282, 284), False, 'from email.mime.multipart import MIMEMultipart\n'), ((613, 664), 'smtplib.SMTP', 'smtplib.SMTP', (['"""smtp.office365.com"""', '(587)'], {'timeout': '(10)'}), "('smtp.office365.com', 587, timeout=10)\n", (625, 664... |
#!/usr/bin/env python3
# Copyright (c) 2020-2021, <NAME> <<EMAIL>>
# Copyright (c) 2021, <NAME> <<EMAIL>>
# Copyright (c) 2021, <NAME> <<EMAIL>>
# Copyright (c) 2021, <NAME> <<EMAIL>>
#
# SPDX-License-Identifier: MIT
from __future__ import annotations
import concurrent.futures
import datetime
import glob
import json
... | [
"json.dump",
"tqdm.tqdm",
"tqdm.tqdm.write",
"json.loads",
"os.killpg",
"resource.setrlimit",
"json.dumps",
"threading.Lock",
"pathlib.Path",
"datetime.timedelta",
"traceback.format_exc",
"signal.strsignal",
"os.setpgrp",
"datetime.datetime.now",
"multiprocessing.cpu_count"
] | [((1477, 1504), 'multiprocessing.cpu_count', 'multiprocessing.cpu_count', ([], {}), '()\n', (1502, 1504), False, 'import multiprocessing\n'), ((1540, 1556), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (1554, 1556), False, 'import threading\n'), ((19819, 19831), 'os.setpgrp', 'os.setpgrp', ([], {}), '()\n', (1... |
import argparse
from utils.train_utils import add_flags_from_config
config_args = {
'training_config': {
'lr': (0.01, 'learning rate'),
'dropout': (0.0, 'dropout probability'),
'cuda': (-1, 'which cuda device to use (-1 for cpu training, 99 for auto gpu assign)'),
'epochs': (5000, ... | [
"argparse.ArgumentParser",
"utils.train_utils.add_flags_from_config"
] | [((4176, 4201), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (4199, 4201), False, 'import argparse\n'), ((4258, 4300), 'utils.train_utils.add_flags_from_config', 'add_flags_from_config', (['parser', 'config_dict'], {}), '(parser, config_dict)\n', (4279, 4300), False, 'from utils.train_utils i... |
# coding: utf-8
"""
Marketplace Insights API
<a href=\"https://developer.ebay.com/api-docs/static/versioning.html#limited\" target=\"_blank\"> <img src=\"/cms/img/docs/partners-api.svg\" class=\"legend-icon partners-icon\" title=\"Limited Release\" alt=\"Limited Release\" />(Limited Release)</a> The Marketpl... | [
"six.iteritems"
] | [((3946, 3979), 'six.iteritems', 'six.iteritems', (['self.swagger_types'], {}), '(self.swagger_types)\n', (3959, 3979), False, 'import six\n')] |
#!/usr/bin/python
from __future__ import absolute_import, print_function, unicode_literals
import sys
import os
import re
import signal
import tempfile
from flask import Flask
from flask import request,url_for,redirect,render_template,request,flash
__version__ = "0.0.1a2"
if __name__ == '__main__':
cdir = os.path... | [
"flask.flash",
"os.getpid",
"flask.request.args.get",
"pdxdisplay.homepage.process",
"pdxdisplay.bomtree.process",
"flask.Flask",
"os.path.realpath",
"sys.path.insert",
"flask.request.values.get",
"re.match",
"pdxdisplay.getitem.getitem",
"pdxdisplay.main",
"flask.url_for",
"pypdx.dbconn.D... | [((2383, 2398), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (2388, 2398), False, 'from flask import Flask\n'), ((363, 395), 'sys.path.insert', 'sys.path.insert', (['(0)', "(cdir + '/..')"], {}), "(0, cdir + '/..')\n", (378, 395), False, 'import sys\n'), ((3811, 3831), 'pdxdisplay.homepage.process', 'hom... |
import logging
import ibmsecurity.utilities.tools
import os.path
from ibmsecurity.utilities.tools import files_same, get_random_temp_dir
import shutil
logger = logging.getLogger(__name__)
def get_all(isamAppliance, instance_id, check_mode=False, force=False):
"""
Retrieving the current administration pages r... | [
"shutil.rmtree",
"ibmsecurity.utilities.tools.get_random_temp_dir",
"ibmsecurity.utilities.tools.files_same",
"logging.getLogger"
] | [((161, 188), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (178, 188), False, 'import logging\n'), ((7543, 7564), 'ibmsecurity.utilities.tools.get_random_temp_dir', 'get_random_temp_dir', ([], {}), '()\n', (7562, 7564), False, 'from ibmsecurity.utilities.tools import files_same, get_ran... |
#!/usr/bin/env python3
#! coding:utf-8
'''
Picomotor Power Control
MEIKO WATCH BOOT nino RPC-MCS
Usage:
pico_power_control.py [TARGET] [ON or OFF]
ex.
pico_power_controls.py TEST ON
'''
import sys
import getpass
import telnetlib
import time
import subprocess
from datetime import... | [
"subprocess.Popen",
"datetime.datetime.now",
"telnetlib.Telnet",
"time.sleep"
] | [((8652, 8677), 'subprocess.Popen', 'subprocess.Popen', (['command'], {}), '(command)\n', (8668, 8677), False, 'import subprocess\n'), ((7642, 7656), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (7654, 7656), False, 'from datetime import datetime\n'), ((3329, 3394), 'telnetlib.Telnet', 'telnetlib.Telnet',... |
import torch
import sys
import os
from PIL import Image
from chess_net_simple import SimpleChessNet
from chess_net_simple import transform
# Using a basic version of the chess net which only detects if there is a piece on a field or not
# to remove empty tiles
# Removes empty tiles from a given dataset to simplify l... | [
"chess_net_simple.transform",
"torch.load",
"os.path.exists",
"torch.max",
"torch.unsqueeze",
"os.path.join",
"os.listdir",
"sys.exit",
"chess_net_simple.SimpleChessNet"
] | [((392, 413), 'os.listdir', 'os.listdir', (['file_path'], {}), '(file_path)\n', (402, 413), False, 'import os\n'), ((1086, 1102), 'chess_net_simple.SimpleChessNet', 'SimpleChessNet', ([], {}), '()\n', (1100, 1102), False, 'from chess_net_simple import SimpleChessNet\n'), ((979, 1005), 'os.path.exists', 'os.path.exists'... |
name = input('What is your name? ')
import sys
import time
age = input(F"{name}, how old are you? ")
if age != "11":
if age > "11":
if age == "12" or age == "13" or age == "14" or age == "15" or age == "16" or age == "17":
print(f"Go to your house table, {name.title()}, you are already sorted.")... | [
"sys.exit",
"time.sleep"
] | [((1419, 1434), 'time.sleep', 'time.sleep', (['(0.5)'], {}), '(0.5)\n', (1429, 1434), False, 'import time\n'), ((2558, 2573), 'time.sleep', 'time.sleep', (['(0.5)'], {}), '(0.5)\n', (2568, 2573), False, 'import time\n'), ((2643, 2658), 'time.sleep', 'time.sleep', (['(1.5)'], {}), '(1.5)\n', (2653, 2658), False, 'import... |
from setuptools import setup, find_packages
from hitomi.version import __version__
from setuptools.command.install import install
import sys
import os
def read_file(fname):
"""
return file contents
:param fname: path relative to setup.py
:return: file contents
"""
with open(os.path.join(os.pat... | [
"setuptools.find_packages",
"os.path.dirname",
"os.path.isfile",
"os.getenv",
"sys.exit"
] | [((596, 619), 'os.getenv', 'os.getenv', (['"""CIRCLE_TAG"""'], {}), "('CIRCLE_TAG')\n", (605, 619), False, 'import os\n'), ((1030, 1081), 'setuptools.find_packages', 'find_packages', ([], {'exclude': "['contrib', 'docs', 'tests']"}), "(exclude=['contrib', 'docs', 'tests'])\n", (1043, 1081), False, 'from setuptools impo... |
from datetime import datetime
from quickbooks.objects.term import Term
from tests.integration.test_base import QuickbooksTestCase
class TermTest(QuickbooksTestCase):
def setUp(self):
super(TermTest, self).setUp()
self.name = "Term {0}".format(datetime.now().strftime('%d%H%M'))
def test_crea... | [
"datetime.datetime.now",
"quickbooks.objects.term.Term.all",
"quickbooks.objects.term.Term.get",
"quickbooks.objects.term.Term"
] | [((345, 351), 'quickbooks.objects.term.Term', 'Term', ([], {}), '()\n', (349, 351), False, 'from quickbooks.objects.term import Term\n'), ((467, 503), 'quickbooks.objects.term.Term.get', 'Term.get', (['term.Id'], {'qb': 'self.qb_client'}), '(term.Id, qb=self.qb_client)\n', (475, 503), False, 'from quickbooks.objects.te... |
#!/usr/bin/env python
# -*- coding: latin-1 -*-
#
# !/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for `certifiable.complex.certify_tuple` method."""
import unittest
from mock import Mock
from certifiable import CertifierValueError, make_certifier
from certifiable.complex import certify_dict_schema, certify_... | [
"unittest.main",
"certifiable.make_certifier",
"certifiable.complex.certify_iterable_schema",
"certifiable.complex.certify_dict_schema",
"mock.Mock",
"tests.Doh"
] | [((8448, 8463), 'unittest.main', 'unittest.main', ([], {}), '()\n', (8461, 8463), False, 'import unittest\n'), ((2395, 2411), 'certifiable.make_certifier', 'make_certifier', ([], {}), '()\n', (2409, 2411), False, 'from certifiable import CertifierValueError, make_certifier\n'), ((4232, 4238), 'mock.Mock', 'Mock', ([], ... |
# coding=utf-8
# Copyright 2021 The Dopamine 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... | [
"functools.partial",
"jax.random.normal",
"jax.numpy.pad",
"jax.lax.dynamic_slice",
"jax.numpy.max",
"absl.logging.info",
"dopamine.jax.agents.full_rainbow.full_rainbow_agent.train",
"jax.random.randint",
"tensorflow.compat.v1.Summary.Value",
"jax.numpy.clip",
"jax.numpy.ones",
"jax.numpy.sqrt... | [((961, 1013), 'functools.partial', 'functools.partial', (['jax.vmap'], {'in_axes': '(0, 0, 0, None)'}), '(jax.vmap, in_axes=(0, 0, 0, None))\n', (978, 1013), False, 'import functools\n'), ((1083, 1139), 'jax.lax.dynamic_slice', 'jax.lax.dynamic_slice', (['img', '[x, y, 0]', 'cropped_shape[1:]'], {}), '(img, [x, y, 0],... |
import json
import logging
import os
from django.core.exceptions import ObjectDoesNotExist
from django.http import HttpResponse
from django.conf import settings
from django.views.decorators.csrf import csrf_exempt
from ..models import DiscordRole, EmailRole, Registration
logger = logging.getLogger(__name__)
REGIST... | [
"django.http.HttpResponse",
"logging.getLogger"
] | [((285, 312), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (302, 312), False, 'import logging\n'), ((1240, 1264), 'django.http.HttpResponse', 'HttpResponse', ([], {'status': '(201)'}), '(status=201)\n', (1252, 1264), False, 'from django.http import HttpResponse\n'), ((613, 653), 'django... |
# -*- coding: utf-8 -*-
"""
Provide asynchronous writers for stdout and stderr
Use code from [aioconsole][https://github.com/vxgmichel/aioconsole],
stream.py
"""
import asyncio
import os
import platform
import stat
from typing import Union
StringOfBytes = Union[str, bytes]
def is_pipe_transport_compatible(pipe) -... | [
"asyncio.get_event_loop",
"stat.S_ISCHR",
"stat.S_ISSOCK",
"stat.S_ISFIFO",
"platform.system",
"os.fstat"
] | [((613, 631), 'stat.S_ISCHR', 'stat.S_ISCHR', (['mode'], {}), '(mode)\n', (625, 631), False, 'import stat\n'), ((646, 665), 'stat.S_ISFIFO', 'stat.S_ISFIFO', (['mode'], {}), '(mode)\n', (659, 665), False, 'import stat\n'), ((682, 701), 'stat.S_ISSOCK', 'stat.S_ISSOCK', (['mode'], {}), '(mode)\n', (695, 701), False, 'im... |
import pytest
from apispec.exceptions import APISpecError
def test_undecorated_view(app, spec):
def gist_detail(gist_id):
'''
---
get:
responses:
200:
schema:
$ref: '#/definitions/Gist'
'''
pass
... | [
"pytest.raises"
] | [((328, 355), 'pytest.raises', 'pytest.raises', (['APISpecError'], {}), '(APISpecError)\n', (341, 355), False, 'import pytest\n'), ((722, 749), 'pytest.raises', 'pytest.raises', (['APISpecError'], {}), '(APISpecError)\n', (735, 749), False, 'import pytest\n'), ((1133, 1160), 'pytest.raises', 'pytest.raises', (['APISpec... |
from unittest import main
from ... import dpo7104
from .. import mock_dpo7104
from ...tests.server.test_dpo7104 import DPO7104Test
# Don't lose the real device.
real_DPO7104 = dpo7104.DPO7104
is_mock = DPO7104Test.mock
def setup():
# Run the tests with a fake device.
dpo7104.DPO7104 = mock_dpo7104.MockDPO7104
... | [
"unittest.main"
] | [((503, 509), 'unittest.main', 'main', ([], {}), '()\n', (507, 509), False, 'from unittest import main\n')] |
import pytest
import numpy as np
import pandas as pd
import pygdf
import dask
import dask_gdf as dgd
@pytest.mark.parametrize('by', ['a', 'b'])
@pytest.mark.parametrize('nelem', [10, 100, 1000])
@pytest.mark.parametrize('nparts', [1, 2, 5, 10])
def test_sort_values(nelem, nparts, by):
df = pygdf.DataFrame()
... | [
"pandas.util.testing.assert_frame_equal",
"numpy.random.seed",
"pygdf.DataFrame",
"numpy.random.randint",
"numpy.arange",
"dask.compute",
"pytest.mark.parametrize",
"dask_gdf.from_pygdf"
] | [((106, 147), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""by"""', "['a', 'b']"], {}), "('by', ['a', 'b'])\n", (129, 147), False, 'import pytest\n'), ((149, 198), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""nelem"""', '[10, 100, 1000]'], {}), "('nelem', [10, 100, 1000])\n", (172, 198), Fa... |
# coding=utf-8
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import re
from tensorflow.python.platform import gfile
"""
Utilities for downloading data from WMT, tokenizing, vocabularies.
"""
# Special vocabulary symbols - we always put them at... | [
"tensorflow.python.platform.gfile.GFile",
"re.split",
"tensorflow.python.platform.gfile.Exists",
"os.path.join",
"re.sub",
"re.compile"
] | [((528, 558), 're.compile', 're.compile', (['b\'([.,!?"\\\':;)(])\''], {}), '(b\'([.,!?"\\\':;)(])\')\n', (538, 558), False, 'import re\n'), ((571, 589), 're.compile', 're.compile', (["b'\\\\d'"], {}), "(b'\\\\d')\n", (581, 589), False, 'import re\n'), ((3326, 3355), 'tensorflow.python.platform.gfile.Exists', 'gfile.Ex... |
# -*- coding: utf-8 -*-
# Copyright 2018 New Vector 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-2.0
#
# Unless required by applicable la... | [
"synapse.events.FrozenEvent",
"attr.ib",
"six.moves.zip",
"synapse.event_auth.auth_types_for_event",
"synapse.state.v2.lexicographical_topological_sort",
"itertools.tee",
"itertools.chain",
"synapse.types.EventID"
] | [((17883, 17906), 'itertools.tee', 'itertools.tee', (['iterable'], {}), '(iterable)\n', (17896, 17906), False, 'import itertools\n'), ((17936, 17945), 'six.moves.zip', 'zip', (['a', 'b'], {}), '(a, b)\n', (17939, 17945), False, 'from six.moves import zip\n'), ((18012, 18021), 'attr.ib', 'attr.ib', ([], {}), '()\n', (18... |
from django.urls import path
from . import views
app_name='newsCatch'
urlpatterns = [
path('', views.index , name='index'),
path('politics/', views.politics , name='politics'),
path('culture/', views.culture , name='culture'),
path('society/', views.society , name='society'),
path('economy/', views.... | [
"django.urls.path"
] | [((90, 125), 'django.urls.path', 'path', (['""""""', 'views.index'], {'name': '"""index"""'}), "('', views.index, name='index')\n", (94, 125), False, 'from django.urls import path\n'), ((132, 182), 'django.urls.path', 'path', (['"""politics/"""', 'views.politics'], {'name': '"""politics"""'}), "('politics/', views.poli... |
import matplotlib.pyplot as plt
from collections import defaultdict
import numpy as np
import pandas as pd
import seaborn as sns
import os
import pickle
from tqdm import tqdm
import networkx as nx
import torch
import os
import psutil
from sklearn.metrics import roc_auc_score, average_precision_score, accuracy_score, l... | [
"sys.path.append",
"pandas.DataFrame",
"os.getpid",
"numpy.ones_like",
"opera_tools.load_mc",
"math.fabs",
"torch.LongTensor",
"math.sqrt",
"create_graph.create_graph.generate_distances",
"torch.FloatTensor",
"torch.save",
"math.log",
"torch_geometric.data.Data",
"numpy.vstack",
"network... | [((431, 452), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (446, 452), False, 'import sys\n'), ((2342, 2379), 'numpy.unique', 'np.unique', (['signal'], {'return_counts': '(True)'}), '(signal, return_counts=True)\n', (2351, 2379), True, 'import numpy as np\n'), ((3336, 3381), 'opera_tools.load_m... |
#!/usr/bin/env python
####################
# Required Modules #
####################
# Generic/Built-in
# Libs
from flask import Blueprint
from flask_restx import Api
# Custom
from rest_rpc.connection.collaborations import ns_api as collab_ns
from rest_rpc.connection.projects import ns_api as project_ns
from rest_r... | [
"flask_restx.Api",
"flask.Blueprint"
] | [((697, 731), 'flask.Blueprint', 'Blueprint', (['"""connections"""', '__name__'], {}), "('connections', __name__)\n", (706, 731), False, 'from flask import Blueprint\n'), ((739, 942), 'flask_restx.Api', 'Api', ([], {'app': 'blueprint', 'version': '"""0.1.0"""', 'title': '"""Synergos Orchestrator REST-RPC Connection API... |
import asyncio
from collections import deque
from datetime import datetime
from pathlib import Path
from re import Match, match
from typing import Dict, Iterable, List, Tuple, Union
from urllib import parse
import requests
from bs4 import BeautifulSoup, Tag
from more_itertools import unique_everseen
from pyppeteer imp... | [
"urllib.parse.unquote",
"pyppeteer.connect",
"asyncio.sleep",
"collections.deque",
"requests.get",
"datetime.datetime.fromtimestamp",
"bs4.BeautifulSoup",
"pathlib.Path.cwd",
"urllib.parse.urlparse"
] | [((11539, 11549), 'pathlib.Path.cwd', 'Path.cwd', ([], {}), '()\n', (11547, 11549), False, 'from pathlib import Path\n'), ((12225, 12255), 'requests.get', 'requests.get', (['url'], {'stream': '(True)'}), '(url, stream=True)\n', (12237, 12255), False, 'import requests\n'), ((15306, 15349), 'pyppeteer.connect', 'connect'... |
###
# (C) Copyright [2019-2020] 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 ... | [
"unittest.main",
"unittest.mock.patch.object",
"simplivity.resources.omnistack_clusters.OmnistackClusters",
"simplivity.connection.Connection",
"unittest.mock.call"
] | [((1087, 1123), 'unittest.mock.patch.object', 'mock.patch.object', (['Connection', '"""get"""'], {}), "(Connection, 'get')\n", (1104, 1123), False, 'from unittest import mock\n'), ((1627, 1663), 'unittest.mock.patch.object', 'mock.patch.object', (['Connection', '"""get"""'], {}), "(Connection, 'get')\n", (1644, 1663), ... |
import sys, os, argparse
sys.path.insert(0, os.path.abspath('..'))
import warnings
warnings.filterwarnings("ignore")
import foolbox
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import json
import matplotlib.pyplot as plt
import umap
import seaborn as ... | [
"matplotlib.pyplot.title",
"numpy.load",
"argparse.ArgumentParser",
"matplotlib.pyplot.clf",
"numpy.random.randint",
"numpy.arange",
"matplotlib.pyplot.gca",
"os.path.abspath",
"matplotlib.pyplot.yticks",
"torch.nn.functional.log_softmax",
"torch.nn.Linear",
"matplotlib.pyplot.xticks",
"seab... | [((83, 116), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (106, 116), False, 'import warnings\n'), ((44, 65), 'os.path.abspath', 'os.path.abspath', (['""".."""'], {}), "('..')\n", (59, 65), False, 'import sys, os, argparse\n'), ((696, 737), 'argparse.ArgumentParser', 'ar... |
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
"jax.vmap",
"numpy.lib.stride_tricks._broadcast_shape",
"re.match",
"jax.numpy.moveaxis",
"numpy.lib.stride_tricks.as_strided",
"re.findall",
"functools.wraps",
"jax.numpy.broadcast_to"
] | [((7139, 7193), 'numpy.lib.stride_tricks._broadcast_shape', 'np.lib.stride_tricks._broadcast_shape', (['*broadcast_args'], {}), '(*broadcast_args)\n', (7176, 7193), True, 'import numpy as np\n'), ((4982, 5013), 're.match', 're.match', (['_SIGNATURE', 'signature'], {}), '(_SIGNATURE, signature)\n', (4990, 5013), False, ... |
# coding=utf-8
# Copyright 2019-present, the HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | [
"requests.get"
] | [((2518, 2536), 'requests.get', 'requests.get', (['path'], {}), '(path)\n', (2530, 2536), False, 'import requests\n'), ((3126, 3144), 'requests.get', 'requests.get', (['path'], {}), '(path)\n', (3138, 3144), False, 'import requests\n')] |
from __future__ import print_function
from TestBase import TestBase
from util import run_cmd, capture
class Compilers(TestBase):
error_message=""
def __init__(self):
pass
def setup(self):
pass
def name(self):
return "Check compilers"
def description(self):
return "Check compi... | [
"util.capture"
] | [((802, 818), 'util.capture', 'capture', (['typecmd'], {}), '(typecmd)\n', (809, 818), False, 'from util import run_cmd, capture\n')] |
#!/usr/bin/env python
import os
import re
import sys
from setuptools import setup, find_packages
version = re.compile(r'VERSION\s*=\s*\((.*?)\)')
def get_package_version():
"returns package version without importing it"
base = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(base, "flo... | [
"os.path.dirname",
"os.path.join",
"setuptools.find_packages",
"re.compile"
] | [((110, 151), 're.compile', 're.compile', (['"""VERSION\\\\s*=\\\\s*\\\\((.*?)\\\\)"""'], {}), "('VERSION\\\\s*=\\\\s*\\\\((.*?)\\\\)')\n", (120, 151), False, 'import re\n'), ((256, 281), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (271, 281), False, 'import os\n'), ((1724, 1767), 'setupto... |
#!/usr/bin/python
# Copyright 2015 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 a... | [
"sys.stdout.write",
"yaml.safe_dump",
"flask_script.Manager",
"os.path.isfile",
"timesketch.models.user.User.get_or_create",
"sys.stdout.flush",
"yaml.safe_load",
"timesketch.lib.tasks.build_index_pipeline",
"timesketch.models.sketch.SearchTemplate.query.filter_by",
"flask_script.prompt_bool",
"... | [((16389, 16408), 'flask_script.Manager', 'Manager', (['create_app'], {}), '(create_app)\n', (16396, 16408), False, 'from flask_script import Manager\n'), ((1872, 1939), 'flask_script.prompt_bool', 'prompt_bool', (['u"""Do you really want to drop all the database tables?"""'], {}), "(u'Do you really want to drop all th... |
from __future__ import absolute_import
from __future__ import print_function
from collections import defaultdict
from copy import deepcopy
import datetime
import json
import os
import os.path
import re
import sys
from xml.sax.saxutils import escape
import glob
import yaml
from .build_cpe import CPEDoesNotExist, pars... | [
"copy.deepcopy",
"os.path.basename",
"os.path.isdir",
"os.path.getsize",
"os.path.dirname",
"yaml.dump",
"datetime.date.today",
"xml.sax.saxutils.escape",
"collections.defaultdict",
"os.path.isfile",
"os.path.normpath",
"os.path.splitext",
"sys.stderr.write",
"os.path.join",
"os.listdir"... | [((2532, 2549), 're.compile', 're.compile', (['regex'], {}), '(regex)\n', (2542, 2549), False, 'import re\n'), ((922, 983), 'yaml.dump', 'yaml.dump', (['dictionary', 'file_object'], {'indent': '(4)', 'sort_keys': '(False)'}), '(dictionary, file_object, indent=4, sort_keys=False)\n', (931, 983), False, 'import yaml\n'),... |
# Generated by Django 3.1 on 2020-11-09 11:29
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("selfswab", "0004_auto_20201029_1046"),
]
operations = [
migrations.AlterField(
model_name="selfswabtest",
name="barcod... | [
"django.db.models.CharField"
] | [((342, 387), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(255)', 'unique': '(True)'}), '(max_length=255, unique=True)\n', (358, 387), False, 'from django.db import migrations, models\n')] |
from wsgiref.simple_server import make_server
from framework import settings
from framework import wsgi
from framework.consts import SERVER_RUNNING_BANNER
def run():
banner = SERVER_RUNNING_BANNER.format(host=settings.HOST, port=settings.PORT)
with make_server(settings.HOST, settings.PORT, wsgi.application) ... | [
"wsgiref.simple_server.make_server",
"framework.consts.SERVER_RUNNING_BANNER.format"
] | [((182, 250), 'framework.consts.SERVER_RUNNING_BANNER.format', 'SERVER_RUNNING_BANNER.format', ([], {'host': 'settings.HOST', 'port': 'settings.PORT'}), '(host=settings.HOST, port=settings.PORT)\n', (210, 250), False, 'from framework.consts import SERVER_RUNNING_BANNER\n'), ((260, 319), 'wsgiref.simple_server.make_serv... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# @Author: <NAME> (<EMAIL>)
# @Date: 2020-09-01
# @Filename: test_command.py
# @License: BSD 3-clause (http://www.opensource.org/licenses/BSD-3-Clause)
import asyncio
import pytest
from clu import Command, CommandError, CommandStatus
from clu.exceptions import CluWarni... | [
"pytest.warns",
"pytest.raises",
"asyncio.sleep",
"clu.Command"
] | [((1535, 1588), 'clu.Command', 'Command', ([], {'command_string': '"""new-command"""', 'parent': 'command'}), "(command_string='new-command', parent=command)\n", (1542, 1588), False, 'from clu import Command, CommandError, CommandStatus\n'), ((1707, 1760), 'clu.Command', 'Command', ([], {'command_string': '"""new-comma... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.