code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
#!/usr/bin/python
import os.path
import cppcodebase
import random
def CreateLibJamfile(lib_number, classes):
os.chdir(cppcodebase.lib_name(lib_number))
handle = file("Jamfile.jam", "w")
handle.write ("SubDir TOP lib_" + str(lib_number) + " ;\n\n")
handle.write ("SubDirHdrs $(INCLUDES) ;\n\n")
han... | [
"cppcodebase.SetDir",
"cppcodebase.CreateSetOfLibraries",
"cppcodebase.lib_name"
] | [((1043, 1072), 'cppcodebase.SetDir', 'cppcodebase.SetDir', (['"""jamplus"""'], {}), "('jamplus')\n", (1061, 1072), False, 'import cppcodebase\n'), ((1077, 1184), 'cppcodebase.CreateSetOfLibraries', 'cppcodebase.CreateSetOfLibraries', (['libs', 'classes', 'internal_includes', 'external_includes', 'CreateLibJamfile'], {... |
"""
FOTA update tool which is called from the dispatcher during installation
Copyright (C) 2017-2022 Intel Corporation
SPDX-License-Identifier: Apache-2.0
"""
import logging
import os
import platform
from threading import Timer
from typing import Any, Optional, Mapping
from future.moves.urllib.parse impo... | [
"logging.getLogger",
"threading.Timer",
"os.path.dirname",
"platform.system",
"os.path.basename",
"future.moves.urllib.parse.urlparse",
"inbm_common_lib.utility.canonicalize_uri"
] | [((996, 1023), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1013, 1023), False, 'import logging\n'), ((7954, 7971), 'platform.system', 'platform.system', ([], {}), '()\n', (7969, 7971), False, 'import platform\n'), ((2609, 2652), 'os.path.basename', 'os.path.basename', (["self._ota_ele... |
from ipso_phen.ipapi.base.ipt_abstract import IptBase
from ipso_phen.ipapi.tools import regions
import numpy as np
import cv2
import logging
logger = logging.getLogger(__name__)
from ipso_phen.ipapi.base import ip_common as ipc
class IptFilterContourBySize(IptBase):
def build_params(self):
... | [
"logging.getLogger",
"numpy.dstack",
"ipso_phen.ipapi.tools.regions.keep_rois",
"cv2.drawContours",
"cv2.bitwise_and",
"cv2.contourArea",
"cv2.putText",
"ipso_phen.ipapi.base.ip_common.get_contours",
"numpy.zeros_like",
"cv2.boundingRect"
] | [((159, 186), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (176, 186), False, 'import logging\n'), ((4349, 4368), 'numpy.zeros_like', 'np.zeros_like', (['mask'], {}), '(mask)\n', (4362, 4368), True, 'import numpy as np\n'), ((8412, 8443), 'cv2.bitwise_and', 'cv2.bitwise_and', (['out_mas... |
from wrapper_tests.upsert_test import *
from wrapper_tests.upsertvaluedict_test import *
import os
import logging
import sys
import argparse
import signal
logging.getLogger().setLevel(logging.DEBUG)
ch = logging.StreamHandler(sys.stdout)
ch.setLevel(logging.DEBUG)
formatter = logging.Formatter('[%(asctime)s - %(name)s... | [
"logging.getLogger",
"logging.StreamHandler",
"argparse.ArgumentParser",
"logging.Formatter",
"os.getpid"
] | [((205, 238), 'logging.StreamHandler', 'logging.StreamHandler', (['sys.stdout'], {}), '(sys.stdout)\n', (226, 238), False, 'import logging\n'), ((278, 335), 'logging.Formatter', 'logging.Formatter', (['"""[%(asctime)s - %(name)s] %(message)s"""'], {}), "('[%(asctime)s - %(name)s] %(message)s')\n", (295, 335), False, 'i... |
#!/usr/bin/env python
##############################################################################
##
# This file is part of Sardana
##
# http://www.sardana-controls.org/
##
# Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
##
# Sardana is free software: you can redistribute it and/or modify
# it under th... | [
"sardana.taurus.core.tango.sardana.macroserver.registerExtensions",
"taurus.external.qt.Qt.QApplication",
"taurus.external.qt.Qt.pyqtProperty",
"taurus.external.qt.Qt.QFont"
] | [((2447, 2561), 'taurus.external.qt.Qt.pyqtProperty', 'Qt.pyqtProperty', (['"""QString"""', 'TaurusBaseWidget.getModel', 'TaurusBaseWidget.setModel', 'TaurusBaseWidget.resetModel'], {}), "('QString', TaurusBaseWidget.getModel, TaurusBaseWidget.\n setModel, TaurusBaseWidget.resetModel)\n", (2462, 2561), False, 'from ... |
from functools import partial
from uuid import UUID
from dateutil.parser import parse as dateutil_parse
from django.apps import apps
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from rest_framework import serializers
from rest_framework.exceptions import ValidationError
from r... | [
"rest_framework.serializers.DateTimeField",
"dateutil.parser.parse",
"datahub.core.validators.OperatorRule",
"datahub.core.validate_utils.DataCombiner",
"rest_framework.serializers.ReadOnlyField",
"rest_framework.fields.UUIDField",
"rest_framework.fields.ReadOnlyField",
"rest_framework.serializers.Cha... | [((5268, 5338), 'functools.partial', 'partial', (['serializers.DateField'], {'input_formats': "('iso-8601', '%Y/%m/%d')"}), "(serializers.DateField, input_formats=('iso-8601', '%Y/%m/%d'))\n", (5275, 5338), False, 'from functools import partial\n'), ((793, 820), 'rest_framework.serializers.ReadOnlyField', 'serializers.... |
import pytest
from stable_baselines import A2C, ACER, ACKTR, DeepQ, DDPG, PPO1, PPO2, TRPO
from stable_baselines.ddpg import AdaptiveParamNoiseSpec
from stable_baselines.common.identity_env import IdentityEnv, IdentityEnvBox
from stable_baselines.common.vec_env import DummyVecEnv
PARAM_NOISE_DDPG = AdaptiveParamNoise... | [
"stable_baselines.TRPO",
"stable_baselines.DDPG",
"stable_baselines.PPO1",
"stable_baselines.common.identity_env.IdentityEnvBox",
"stable_baselines.common.identity_env.IdentityEnv",
"stable_baselines.ACKTR",
"pytest.mark.parametrize",
"stable_baselines.PPO2",
"stable_baselines.DeepQ",
"stable_base... | [((1184, 1284), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""model_name"""', "['a2c', 'acer', 'acktr', 'deepq', 'ppo1', 'ppo2', 'trpo']"], {}), "('model_name', ['a2c', 'acer', 'acktr', 'deepq',\n 'ppo1', 'ppo2', 'trpo'])\n", (1207, 1284), False, 'import pytest\n'), ((2074, 2152), 'pytest.mark.parametr... |
import tensorflow as tf
from tensorflow.python.saved_model import signature_constants
from tensorflow.python.saved_model import tag_constants
export_dir = './reference/00000002'
graph_pb = './creditcardfraud.pb'
builder = tf.saved_model.builder.SavedModelBuilder(export_dir)
with tf.gfile.GFile(graph_pb, "rb") as f:
... | [
"tensorflow.saved_model.signature_def_utils.predict_signature_def",
"tensorflow.Graph",
"tensorflow.gfile.GFile",
"tensorflow.GraphDef",
"tensorflow.import_graph_def",
"tensorflow.saved_model.builder.SavedModelBuilder",
"tensorflow.get_default_graph"
] | [((224, 276), 'tensorflow.saved_model.builder.SavedModelBuilder', 'tf.saved_model.builder.SavedModelBuilder', (['export_dir'], {}), '(export_dir)\n', (264, 276), True, 'import tensorflow as tf\n'), ((283, 313), 'tensorflow.gfile.GFile', 'tf.gfile.GFile', (['graph_pb', '"""rb"""'], {}), "(graph_pb, 'rb')\n", (297, 313),... |
import torch
from scipy.stats import median_absolute_deviation
class Transform_Base(object):
"""
Base class for transformations based on some data.
"""
def __init__(self, Ytr):
self.Ytr = Ytr
# Transform the mean
def scale_mean(self, mu):
return mu
# Reve... | [
"scipy.stats.median_absolute_deviation"
] | [((1327, 1363), 'scipy.stats.median_absolute_deviation', 'median_absolute_deviation', (['Ytr_numpy'], {}), '(Ytr_numpy)\n', (1352, 1363), False, 'from scipy.stats import median_absolute_deviation\n')] |
import pytest
from prefect.core import Edge, Flow, Parameter, Task
from prefect.tasks.core import collections
from prefect.tasks.core.constants import Constant
from prefect.tasks.core.function import FunctionTask
class IdentityTask(Task):
def run(self, x):
return x
class TestConstant:
def test_cons... | [
"prefect.tasks.core.collections.Tuple",
"prefect.core.Task",
"prefect.tasks.core.collections.Dict",
"prefect.core.Edge",
"prefect.tasks.core.constants.Constant",
"prefect.tasks.core.collections.List",
"prefect.tasks.core.collections.Set",
"prefect.tasks.core.function.FunctionTask",
"pytest.raises",
... | [((367, 380), 'prefect.tasks.core.constants.Constant', 'Constant', (['"""x"""'], {}), "('x')\n", (375, 380), False, 'from prefect.tasks.core.constants import Constant\n'), ((424, 437), 'prefect.tasks.core.constants.Constant', 'Constant', (['(100)'], {}), '(100)\n', (432, 437), False, 'from prefect.tasks.core.constants ... |
# This file is part of QuTiP: Quantum Toolbox in Python.
#
# Copyright (c) 2011 and later, <NAME> and <NAME>.
# 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. Redistribut... | [
"numpy.prod",
"scipy.sparse.lil_matrix",
"numpy.sqrt",
"numpy.ones",
"qutip.states.enr_state_dictionaries",
"qutip.dimensions.flatten",
"qutip.qobj.Qobj",
"scipy.sparse.eye",
"numpy.fix",
"numpy.conj",
"qutip.fastsparse.fast_csr_matrix",
"qutip.states.qutrit_basis",
"qutip.fastsparse.fast_id... | [((4281, 4288), 'qutip.qobj.Qobj', 'Qobj', (['A'], {}), '(A)\n', (4285, 4288), False, 'from qutip.qobj import Qobj\n'), ((4415, 4454), 'numpy.arange', 'np.arange', (['j', '(-j - 1)', '(-1)'], {'dtype': 'complex'}), '(j, -j - 1, -1, dtype=complex)\n', (4424, 4454), True, 'import numpy as np\n'), ((4540, 4571), 'numpy.ar... |
from abc import ABCMeta, abstractmethod
import random
import json
import pickle
import numpy as np
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
import nltk
from nltk.stem import WordNetLemmatizer
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Dropout
from tensorflow.... | [
"random.choice",
"pickle.dump",
"random.shuffle",
"nltk.download",
"nltk.word_tokenize",
"tensorflow.keras.layers.Dropout",
"nltk.stem.WordNetLemmatizer",
"pickle.load",
"tensorflow.keras.optimizers.SGD",
"numpy.array",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.models.load_model",
"... | [((396, 430), 'nltk.download', 'nltk.download', (['"""punkt"""'], {'quiet': '(True)'}), "('punkt', quiet=True)\n", (409, 430), False, 'import nltk\n'), ((431, 467), 'nltk.download', 'nltk.download', (['"""wordnet"""'], {'quiet': '(True)'}), "('wordnet', quiet=True)\n", (444, 467), False, 'import nltk\n'), ((1406, 1425)... |
"""
@brief Generate Fe55 images and associated darks and bias images
according to section 5.4 of the E/O document (Dec 19, 2012 version).
@author <NAME> <<EMAIL>>
"""
import os
import numpy as np
from sim_inputs import *
from sim_tools import *
def generate_Fe55_images(exptimes, nxrays, outdir, sensorid, gain=gain,
... | [
"numpy.linspace",
"os.path.join"
] | [((3210, 3233), 'numpy.linspace', 'np.linspace', (['(1)', '(5)', 'nexp'], {}), '(1, 5, nexp)\n', (3221, 3233), True, 'import numpy as np\n'), ((659, 688), 'os.path.join', 'os.path.join', (['outdir', 'outfile'], {}), '(outdir, outfile)\n', (671, 688), False, 'import os\n'), ((1406, 1435), 'os.path.join', 'os.path.join',... |
import math
import numpy as np
import torch
import torch.nn as nn
from ....ops.pointnet2.pointnet2_stack import pointnet2_modules as pointnet2_stack_modules
from ....ops.pointnet2.pointnet2_stack import pointnet2_utils as pointnet2_stack_utils
from ....utils import common_utils
from ...backbones_2d.transformer import ... | [
"torch.nn.ReLU",
"math.ceil",
"torch.nn.ModuleList",
"torch.topk",
"torch.atan2",
"torch.floor",
"torch.nn.LayerNorm",
"torch.max",
"torch.tensor",
"torch.nn.BatchNorm1d",
"torch.arange",
"torch.nn.Linear",
"torch.nn.Identity",
"torch.t",
"torch.clamp",
"torch.cat"
] | [((756, 791), 'torch.clamp', 'torch.clamp', (['x0', '(0)', '(im.shape[1] - 1)'], {}), '(x0, 0, im.shape[1] - 1)\n', (767, 791), False, 'import torch\n'), ((801, 836), 'torch.clamp', 'torch.clamp', (['x1', '(0)', '(im.shape[1] - 1)'], {}), '(x1, 0, im.shape[1] - 1)\n', (812, 836), False, 'import torch\n'), ((846, 881), ... |
#PRIMARY IMPORTS
import discord, os, datetime, sys, json, traceback, logging
#SECONDARY IMPORTS
from apscheduler.schedulers.asyncio import AsyncIOScheduler
from discord.ext import commands
from data import config
#LOGGING
logger = logging.getLogger("ivry")
logger.debug("errors.py Started")
class Er... | [
"logging.getLogger",
"discord.Embed",
"discord.ext.commands.Cog.listener"
] | [((248, 273), 'logging.getLogger', 'logging.getLogger', (['"""ivry"""'], {}), "('ivry')\n", (265, 273), False, 'import discord, os, datetime, sys, json, traceback, logging\n'), ((472, 495), 'discord.ext.commands.Cog.listener', 'commands.Cog.listener', ([], {}), '()\n', (493, 495), False, 'from discord.ext import comman... |
from ariadne import make_executable_schema, load_schema_from_path
from ariadne.asgi import GraphQL
from resolvers import query, skill, person, eye_color, mutation
# import schema from GraphQL file
type_defs = load_schema_from_path("./schema.gql")
schema = make_executable_schema(
type_defs, query, skill, person, ... | [
"ariadne.asgi.GraphQL",
"ariadne.make_executable_schema",
"ariadne.load_schema_from_path"
] | [((211, 248), 'ariadne.load_schema_from_path', 'load_schema_from_path', (['"""./schema.gql"""'], {}), "('./schema.gql')\n", (232, 248), False, 'from ariadne import make_executable_schema, load_schema_from_path\n'), ((259, 335), 'ariadne.make_executable_schema', 'make_executable_schema', (['type_defs', 'query', 'skill',... |
import importlib
import time
from pathlib import Path
import os
import sys
def import_plugins():
#find actual path
realpath = os.path.realpath(__file__)
dirname = os.path.dirname(realpath)
#add modules & plugins
plugin_path = os.path.join(dirname, "plugins")
for dir_path in Path(plugin_path).... | [
"modules.app.App.App",
"importlib.import_module",
"pathlib.Path",
"os.path.join",
"time.sleep",
"os.path.realpath",
"os.path.dirname"
] | [((914, 930), 'modules.app.App.App', 'piTomation.App', ([], {}), '()\n', (928, 930), True, 'import modules.app.App as piTomation\n'), ((135, 161), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (151, 161), False, 'import os\n'), ((176, 201), 'os.path.dirname', 'os.path.dirname', (['realpath... |
"""
Functions support other modules.
"""
import uuid
def check_response(response, key=None):
"""CHeck the api response.
Make sure the status call is successful and the response have specific key.
Return:
class: `Response <Response>`
"""
code = response.status_code
if not 200 <= code ... | [
"uuid.uuid4"
] | [((699, 711), 'uuid.uuid4', 'uuid.uuid4', ([], {}), '()\n', (709, 711), False, 'import uuid\n')] |
import scipy.stats
import numpy as np
def f_test(sample_x, sample_y, larger_varx_alt):
"""
Computes the F-value and corresponding p-value for a pair of samples and alternative hypothesis.
Parameters
----------
sample_x : list
A random sample x1,...,xnx. Let its (underlying) variance be ox... | [
"numpy.mean",
"numpy.median",
"numpy.max",
"numpy.array",
"numpy.sum",
"numpy.var"
] | [((1099, 1123), 'numpy.var', 'np.var', (['sample_x'], {'ddof': '(1)'}), '(sample_x, ddof=1)\n', (1105, 1123), True, 'import numpy as np\n'), ((1143, 1167), 'numpy.var', 'np.var', (['sample_y'], {'ddof': '(1)'}), '(sample_y, ddof=1)\n', (1149, 1167), True, 'import numpy as np\n'), ((2649, 2673), 'numpy.var', 'np.var', (... |
"""
Pycovjson - Command line interface
Author: rileywilliams
Version: 0.1.0
"""
import argparse
from pycovjson.write import Writer
from pycovjson.read_netcdf import NetCDFReader as Reader
def main():
"""
Command line interface for pycovjson - Converts Scientific Data Formats into CovJSON and saves to disk.
... | [
"pycovjson.read_netcdf.NetCDFReader.get_axis",
"pycovjson.read_netcdf.NetCDFReader",
"argparse.ArgumentParser",
"pycovjson.write.Writer"
] | [((618, 707), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Convert Scientific Data Formats into CovJSON."""'}), "(description=\n 'Convert Scientific Data Formats into CovJSON.')\n", (641, 707), False, 'import argparse\n'), ((1953, 1970), 'pycovjson.read_netcdf.NetCDFReader', 'Reader... |
import numpy as np
from kivygames.games import Game
import kivygames.games.noughtsandcrosses.c as c
class CellOccupiedError(Exception):
pass
class NoughtsAndCrosses(Game):
minPlayers = 2
maxPlayers = 2
hasAI = True
gridShape = (3, 3)
def __init__(self):
Game.__init__(self)
... | [
"numpy.count_nonzero",
"numpy.zeros",
"kivygames.games.noughtsandcrosses.c.hasPlayerWon",
"kivygames.games.noughtsandcrosses.c.minimax",
"kivygames.games.Game.__init__"
] | [((294, 313), 'kivygames.games.Game.__init__', 'Game.__init__', (['self'], {}), '(self)\n', (307, 313), False, 'from kivygames.games import Game\n'), ((335, 371), 'numpy.zeros', 'np.zeros', (['self.gridShape'], {'dtype': '"""u1"""'}), "(self.gridShape, dtype='u1')\n", (343, 371), True, 'import numpy as np\n'), ((926, 9... |
import awkward as ak
from coffea.nanoevents.methods import vector
import pytest
ATOL = 1e-8
def record_arrays_equal(a, b):
return (ak.fields(a) == ak.fields(b)) and all(ak.all(a[f] == b[f]) for f in ak.fields(a))
def test_two_vector():
a = ak.zip(
{
"x": [[1, 2], [], [3], [4]],
... | [
"awkward.all",
"awkward.Array",
"awkward.zip",
"awkward.fields"
] | [((254, 364), 'awkward.zip', 'ak.zip', (["{'x': [[1, 2], [], [3], [4]], 'y': [[5, 6], [], [7], [8]]}"], {'with_name': '"""TwoVector"""', 'highlevel': '(False)'}), "({'x': [[1, 2], [], [3], [4]], 'y': [[5, 6], [], [7], [8]]},\n with_name='TwoVector', highlevel=False)\n", (260, 364), True, 'import awkward as ak\n'), (... |
from collections import defaultdict
import graphene
import pytest
from django.core.exceptions import ValidationError
from ....shipping.error_codes import ShippingErrorCode
from ..mutations import BaseChannelListingMutation
def test_validate_duplicated_channel_ids(channel_PLN, channel_USD):
# given
channel_i... | [
"graphene.Node.to_global_id",
"collections.defaultdict",
"pytest.raises"
] | [((324, 377), 'graphene.Node.to_global_id', 'graphene.Node.to_global_id', (['"""Channel"""', 'channel_USD.id'], {}), "('Channel', channel_USD.id)\n", (350, 377), False, 'import graphene\n'), ((402, 455), 'graphene.Node.to_global_id', 'graphene.Node.to_global_id', (['"""Channel"""', 'channel_PLN.id'], {}), "('Channel', ... |
# -*- coding: utf-8 -*-
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Authors: <NAME> / CoopΓ©rative ARTEFACTS <<EMAIL>>
import requests
from django.conf import settings
from django.contrib import messages
from dja... | [
"django.http.HttpResponseRedirect",
"requests.post",
"django.utils.translation.gettext",
"requests.get",
"django.contrib.messages.add_message",
"requests.exceptions.RequestException"
] | [((2605, 2653), 'requests.get', 'requests.get', (['(settings.FRONT_HOST_URL + endpoint)'], {}), '(settings.FRONT_HOST_URL + endpoint)\n', (2617, 2653), False, 'import requests\n'), ((5312, 5359), 'django.http.HttpResponseRedirect', 'HttpResponseRedirect', (["('/' + entity_url + '/add')"], {}), "('/' + entity_url + '/ad... |
"""
:mod:`meshes` -- Discretization
===============================
Everything related to meshes appropriate for the multigrid solver.
"""
# Copyright 2018-2020 The emg3d Developers.
#
# This file is part of emg3d.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except... | [
"numpy.clip",
"numpy.sqrt",
"numpy.array",
"copy.deepcopy",
"numpy.nanmin",
"numpy.arange",
"numpy.diff",
"numpy.max",
"numpy.nanmax",
"numpy.argmin",
"numpy.ceil",
"numpy.ones",
"numpy.floor",
"numpy.squeeze",
"scipy.optimize.fsolve",
"numpy.isclose",
"numpy.unique",
"numpy.sum",
... | [((10528, 10550), 'numpy.array', 'np.array', (['res'], {'ndmin': '(1)'}), '(res, ndmin=1)\n', (10536, 10550), True, 'import numpy as np\n'), ((10807, 10831), 'numpy.array', 'np.array', (['fixed'], {'ndmin': '(1)'}), '(fixed, ndmin=1)\n', (10815, 10831), True, 'import numpy as np\n'), ((12111, 12140), 'numpy.array', 'np... |
from common_src.lib.model.post import Post
from common_src.lib.model.source import Source
from common_src.scrapers.abstract_scraper import make_soup, remove_dups, now
SOURCE_CODE = "second_extinction"
WEBSITE = "https://www.secondextinctiongame.com/news"
ALT_IMAGE = 'https://www.secondextinctiongame.com/static/242486b... | [
"common_src.scrapers.abstract_scraper.make_soup",
"common_src.lib.model.post.Post",
"common_src.lib.model.source.Source",
"common_src.scrapers.abstract_scraper.remove_dups",
"common_src.scrapers.abstract_scraper.now"
] | [((716, 786), 'common_src.lib.model.source.Source', 'Source', (['SOURCE_CODE', 'name', 'description', 'profile_image', 'ALT_IMAGE', 'None'], {}), '(SOURCE_CODE, name, description, profile_image, ALT_IMAGE, None)\n', (722, 786), False, 'from common_src.lib.model.source import Source\n'), ((814, 832), 'common_src.scraper... |
#
# alexnet.py
#
# Author(s):
# <NAME> <<EMAIL>>
#
# Copyright (c) 2020-2021 ETH Zurich.
#
# 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
# ... | [
"torch.manual_seed",
"torch.nn.ReLU",
"torch.nn.Dropout",
"torch.nn.BatchNorm2d",
"torch.nn.init.constant_",
"torch.nn.Sequential",
"torch.nn.init.kaiming_normal_",
"torch.nn.Conv2d",
"torch.nn.MaxPool2d",
"torch.nn.AdaptiveAvgPool2d",
"torch.nn.Linear",
"torch.nn.init.normal_"
] | [((915, 943), 'torch.nn.AdaptiveAvgPool2d', 'nn.AdaptiveAvgPool2d', (['(6, 6)'], {}), '((6, 6))\n', (935, 943), True, 'import torch.nn as nn\n'), ((2400, 2423), 'torch.nn.Sequential', 'nn.Sequential', (['*modules'], {}), '(*modules)\n', (2413, 2423), True, 'import torch.nn as nn\n'), ((2921, 2944), 'torch.nn.Sequential... |
import pytest
from django.utils.timezone import now
from pretix.base.models import Device, Event, Organizer, Team, User
from pretix.base.models.devices import generate_api_token
@pytest.fixture
def organizer():
return Organizer.objects.create(name='Dummy', slug='dummy')
@pytest.fixture
def event(organizer):
... | [
"pretix.base.models.Team.objects.create",
"pretix.base.models.Organizer.objects.create",
"pretix.base.models.devices.generate_api_token",
"django.utils.timezone.now",
"pretix.base.models.Device.objects.last",
"pretix.base.models.User.objects.create_user"
] | [((225, 277), 'pretix.base.models.Organizer.objects.create', 'Organizer.objects.create', ([], {'name': '"""Dummy"""', 'slug': '"""dummy"""'}), "(name='Dummy', slug='dummy')\n", (249, 277), False, 'from pretix.base.models import Device, Event, Organizer, Team, User\n'), ((604, 648), 'pretix.base.models.User.objects.crea... |
# -*- coding: utf-8 -*-
import bleach
import json
def strip_html(unclean):
"""Sanitize a string, removing (as opposed to escaping) HTML tags
:param unclean: A string to be stripped of HTML tags
:return: stripped string
:rtype: str
"""
return bleach.clean(unclean, strip=True, tags=[], attribu... | [
"bleach.clean",
"json.dumps"
] | [((270, 338), 'bleach.clean', 'bleach.clean', (['unclean'], {'strip': '(True)', 'tags': '[]', 'attributes': '[]', 'styles': '[]'}), '(unclean, strip=True, tags=[], attributes=[], styles=[])\n', (282, 338), False, 'import bleach\n'), ((1309, 1327), 'bleach.clean', 'bleach.clean', (['data'], {}), '(data)\n', (1321, 1327)... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.tensorboard import SummaryWriter
from torch.utils import data
from torch import optim
import torchvision.models as models
from torch.autograd import Variable
import torchvision as tv
import random
import math
import time
from datetime i... | [
"torch.randperm",
"torch.nn.init.constant_",
"torch.nn.L1Loss",
"math.sqrt",
"torch.cuda.device_count",
"torch.cuda.synchronize",
"torch.cuda.is_available",
"torch.nn.functional.interpolate",
"torchvision.utils.make_grid",
"torch.utils.tensorboard.SummaryWriter",
"torch.nn.init.kaiming_normal_",... | [((3063, 3088), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (3086, 3088), False, 'import torch\n'), ((4383, 4397), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (4395, 4397), False, 'from datetime import datetime\n'), ((5320, 5354), 'torch.utils.tensorboard.SummaryWriter', 'Summ... |
from stix_shifter_utils.utils.entry_point_base import EntryPointBase
from stix_shifter_utils.modules.cim.stix_translation.cim_data_mapper import CimDataMapper
from stix_shifter_utils.modules.car.stix_translation.car_data_mapper import CarDataMapper
from .stix_translation.stix_to_elastic import StixToElastic
class Entr... | [
"stix_shifter_utils.modules.car.stix_translation.car_data_mapper.CarDataMapper",
"stix_shifter_utils.modules.cim.stix_translation.cim_data_mapper.CimDataMapper"
] | [((530, 552), 'stix_shifter_utils.modules.car.stix_translation.car_data_mapper.CarDataMapper', 'CarDataMapper', (['options'], {}), '(options)\n', (543, 552), False, 'from stix_shifter_utils.modules.car.stix_translation.car_data_mapper import CarDataMapper\n'), ((646, 668), 'stix_shifter_utils.modules.cim.stix_translati... |
"""
Crack a password using a genetic algorithm!
"""
import random as rnd
def main():
"""
This file implements a genetic algorithm to solve the problem of
cracking a given password, by creating 'generations' of different
words, selecting the best, breeeding them, applying a simple crossover
(randomi... | [
"random.random",
"random.choice",
"random.randint",
"random.shuffle"
] | [((4567, 4588), 'random.shuffle', 'rnd.shuffle', (['next_gen'], {}), '(next_gen)\n', (4578, 4588), True, 'import random as rnd\n'), ((5259, 5271), 'random.random', 'rnd.random', ([], {}), '()\n', (5269, 5271), True, 'import random as rnd\n'), ((5469, 5481), 'random.random', 'rnd.random', ([], {}), '()\n', (5479, 5481),... |
import pygame
import time
import numpy as np
import sys
gray = (150, 150, 150)
white = (255, 255, 255)
black = (0, 0, 0, )
red_block = (255, 0, 0)
red_border = (76, 0, 19)
block_color = (255, 128, 0)
border_color = (165,42,42)
screen = None
SIDE = 50
BORDER = 5
MARGIN = 5
LINE = 1
h_switch = True
def __draw_hor... | [
"pygame.init",
"pygame.quit",
"pygame.event.get",
"numpy.where",
"pygame.display.set_mode",
"time.sleep",
"pygame.display.quit",
"sys.exit",
"pygame.display.update",
"pygame.Rect"
] | [((1755, 1773), 'pygame.event.get', 'pygame.event.get', ([], {}), '()\n', (1771, 1773), False, 'import pygame\n'), ((3536, 3559), 'pygame.display.update', 'pygame.display.update', ([], {}), '()\n', (3557, 3559), False, 'import pygame\n'), ((3564, 3579), 'time.sleep', 'time.sleep', (['(0.1)'], {}), '(0.1)\n', (3574, 357... |
# API
from pyramid.scaffolds import PyramidTemplate
import os
import re
import logging
def _camelcase_to_upper_camel_case(the_str):
if not the_str:
return ''
return the_str[0].upper() + the_str[1:]
def _upper_camelcase_to_camelcase(the_str):
if not the_str:
return ''
return the_str[... | [
"logging.warning",
"os.path.dirname",
"os.path.sep.join",
"pyramid.scaffolds.PyramidTemplate.pre",
"os.path.basename",
"re.sub"
] | [((393, 439), 're.sub', 're.sub', (['"""(.)([A-Z][a-z]+)"""', '"""\\\\1_\\\\2"""', 'the_str'], {}), "('(.)([A-Z][a-z]+)', '\\\\1_\\\\2', the_str)\n", (399, 439), False, 'import re\n'), ((722, 859), 'logging.warning', 'logging.warning', (['"""command: %s output_dir: %s vars: %s args: %s module_name: %s"""', 'command', '... |
# -*- coding: utf-8 -*-
"""Test GUI component."""
#------------------------------------------------------------------------------
# Imports
#------------------------------------------------------------------------------
#from contextlib import contextmanager
from pytest import yield_fixture, fixture, raises
import ... | [
"phylib.utils.emit",
"phy.gui.tests.test_widgets._assert",
"phylib.utils.Bunch",
"phy.gui.qt.qInstallMessageHandler",
"numpy.repeat",
"phy.utils.context.Context",
"phy.gui.tests.test_widgets._wait_until_table_ready",
"phy.gui.GUI",
"numpy.array",
"pytest.raises",
"phylib.utils.connect",
"phy.g... | [((978, 1009), 'phy.gui.qt.qInstallMessageHandler', 'qInstallMessageHandler', (['handler'], {}), '(handler)\n', (1000, 1009), False, 'from phy.gui.qt import qInstallMessageHandler\n'), ((1313, 1374), 'phy.gui.GUI', 'GUI', ([], {'position': '(200, 100)', 'size': '(500, 500)', 'config_dir': 'tempdir'}), '(position=(200, ... |
#
# Copyright (C) 2018 <NAME>.
#
# This software may be modified and distributed under the terms
# of the MIT license. See the LICENSE file for details.
#
#
# Portions of this module are copied or lightly modified from the
# Tensor2Tensor registry_test module, so here is their license:
#
# Copyright 2018 The Tensor2Ten... | [
"carpedm.util.registry.register_model",
"carpedm.util.registry.model",
"carpedm.util.registry._reset",
"unittest.main",
"carpedm.util.registry.list_models"
] | [((3474, 3489), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3487, 3489), False, 'import unittest\n'), ((1342, 1359), 'carpedm.util.registry._reset', 'registry._reset', ([], {}), '()\n', (1357, 1359), False, 'from carpedm.util import registry\n'), ((1499, 1526), 'carpedm.util.registry.model', 'registry.model', ... |
# The MIT License (MIT)
# Copyright (c) 2021 by the xcube development team and contributors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation... | [
"numpy.product"
] | [((1433, 1452), 'numpy.product', 'np.product', (['v.shape'], {}), '(v.shape)\n', (1443, 1452), True, 'import numpy as np\n')] |
# Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to us... | [
"logging.getLogger",
"os.path.exists",
"pickle.dump",
"smarts.core.scenario.Heading",
"multiprocessing.Process",
"os.path.join",
"pickle.load",
"smarts.core.scenario.EndlessGoal",
"os.path.isdir",
"ijson.kvitems",
"multiprocessing.Queue",
"multiprocessing.Pipe"
] | [((1918, 1960), 'logging.getLogger', 'logging.getLogger', (['self.__class__.__name__'], {}), '(self.__class__.__name__)\n', (1935, 1960), False, 'import logging\n'), ((2005, 2011), 'multiprocessing.Pipe', 'Pipe', ([], {}), '()\n', (2009, 2011), False, 'from multiprocessing import Pipe, Process, Queue\n'), ((2094, 2101)... |
import argparse
from time import sleep, time
from collections import defaultdict
from sqlalchemy import orm, text, insert, delete
from sqlalchemy.orm import selectinload
import models
from app import db
from app import logger
from scripts.queue import JsonWorks, JsonAuthors, JsonConcepts, JsonInstitutions, JsonVenues... | [
"app.db.session.commit",
"time.sleep",
"sqlalchemy.delete",
"app.logger.info",
"models.Venue.journal_id.in_",
"sqlalchemy.orm.selectinload",
"argparse.ArgumentParser",
"models.Author.author_id.in_",
"sqlalchemy.insert",
"sqlalchemy.orm.Load",
"models.Work.paper_id.in_",
"app.logger.warn",
"u... | [((2547, 2564), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (2558, 2564), False, 'from collections import defaultdict\n'), ((2595, 2612), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (2606, 2612), False, 'from collections import defaultdict\n'), ((3057, 3063), 'time.ti... |
import json
import discord
from discord.ext import commands
from assets import internet_funcs
from assets.list_funcs import chunks
class Memes(commands.Cog, description="Memes from https://imgflip.com/"):
def __init__(self, bot):
self.bot = bot
with open("config.json") as configFile:
... | [
"discord.ext.commands.Cog.listener",
"assets.internet_funcs.get_response",
"assets.list_funcs.chunks",
"json.load",
"assets.internet_funcs.post",
"discord.Embed",
"discord.ext.commands.command"
] | [((497, 520), 'discord.ext.commands.Cog.listener', 'commands.Cog.listener', ([], {}), '()\n', (518, 520), False, 'from discord.ext import commands\n'), ((871, 932), 'discord.ext.commands.command', 'commands.command', ([], {'name': '"""memetemplates"""', 'aliases': "['memetemps']"}), "(name='memetemplates', aliases=['me... |
import itertools
import json
import logging
import re
from django.views.generic import TemplateView
from django.http import HttpResponse
from django.views import View
from django.contrib.auth.mixins import LoginRequiredMixin, PermissionRequiredMixin
from django.views.decorators.csrf import csrf_exempt
from django.short... | [
"logging.getLogger",
"core.utils.pluck",
"itertools.filterfalse",
"core.utils.deep_index_items_by",
"django.urls.reverse",
"core.utils.notify_contact_email",
"django.shortcuts.render",
"core.utils.key_by",
"re.split",
"django.http.HttpResponse",
"json.dumps",
"core.utils.to_json",
"core.util... | [((1891, 1918), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1908, 1918), False, 'import logging\n'), ((1933, 2031), 'json.dumps', 'json.dumps', (["{'Organisation': {'id': 0, 'has_non_draft_subs': 0, 'gov_body': 0,\n 'has_roi': 0}}"], {}), "({'Organisation': {'id': 0, 'has_non_draft... |
import json
import requests
from datetime import datetime
from playsound import playsound
tday=datetime.today().strftime('%Y-%m-%d')
right_now=datetime.today().strftime('%I-%M-%p')
response = requests.get("https://www.londonprayertimes.com/api/times/?format=json&key=0239f686-4423-408e-9a0c-7968a403d197&year=&mont... | [
"datetime.datetime.today",
"requests.get"
] | [((198, 334), 'requests.get', 'requests.get', (['"""https://www.londonprayertimes.com/api/times/?format=json&key=0239f686-4423-408e-9a0c-7968a403d197&year=&month="""'], {}), "(\n 'https://www.londonprayertimes.com/api/times/?format=json&key=0239f686-4423-408e-9a0c-7968a403d197&year=&month='\n )\n", (210, 334), Fa... |
import unittest
import datetime
import rdflib # needed for eval(repr(...)) below
from rdflib.term import Literal, URIRef, _XSD_DOUBLE, bind, _XSD_BOOLEAN
from rdflib.namespace import XSD
def uformat(s):
return s.replace("u'", "'")
class TestLiteral(unittest.TestCase):
def setUp(self):
pass
de... | [
"rdflib.term.URIRef",
"rdflib.term.Literal",
"rdflib.term.bind",
"rdflib.Literal",
"rdflib.Graph",
"unittest.main",
"rdflib.URIRef"
] | [((9047, 9062), 'unittest.main', 'unittest.main', ([], {}), '()\n', (9060, 9062), False, 'import unittest\n'), ((362, 381), 'rdflib.Literal', 'rdflib.Literal', (['"""\'"""'], {}), '("\'")\n', (376, 381), False, 'import rdflib\n'), ((483, 502), 'rdflib.Literal', 'rdflib.Literal', (['"""\\""""'], {}), '(\'"\')\n', (497, ... |
import telegram
from emoji import emojize
from .base import TextMessageBase
class RulingHelpTextMessage(TextMessageBase):
"""
Ruling help message.
Taken from:
https://www.iamexpat.nl/expat-info/taxation/30-percent-ruling/requirements
"""
def get_text(self):
message = emojize(
... | [
"emoji.emojize"
] | [((306, 1789), 'emoji.emojize', 'emojize', (['"""<b>30% RULING INCOME REQUIREMENTS</b>\n\n<a href="https://www.iamexpat.nl/expat-info/taxation/30-percent-ruling/requirements">Go to Source</a>\n\n<b>2019 salary requirements</b>\n\n:small_blue_diamond: Minimum taxable salary at 70%: <b>37743 EUR</b> \n:small_blue_diamond... |
import os
os.environ['CUDA_VISIBLE_DEVICES']='0'
from common import *
from dataset import *
from model import *
def valid_augment(image, mask, infor):
return image, mask, infor
def train_augment(image, mask, infor):
u=np.random.choice(3)
if u==0:
pass
elif u==1:
image, mask = do_... | [
"os.path.exists",
"os.path.basename",
"os.makedirs"
] | [((4727, 4772), 'os.makedirs', 'os.makedirs', (["(out_dir + '/' + f)"], {'exist_ok': '(True)'}), "(out_dir + '/' + f, exist_ok=True)\n", (4738, 4772), False, 'import os\n'), ((8236, 8269), 'os.path.exists', 'os.path.exists', (['initial_optimizer'], {}), '(initial_optimizer)\n', (8250, 8269), False, 'import os\n'), ((14... |
# (c) Copyright [2018-2021] Micro Focus or one of its affiliates.
# 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 applicabl... | [
"verticapy.vDataFrame",
"verticapy.learn.datasets.load_titanic",
"pytest.mark.skip",
"verticapy.set_option",
"warnings.catch_warnings",
"verticapy.drop_table",
"pytest.fixture"
] | [((711, 742), 'verticapy.set_option', 'set_option', (['"""print_info"""', '(False)'], {}), "('print_info', False)\n", (721, 742), False, 'from verticapy import set_option\n'), ((746, 776), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (760, 776), False, 'import pytest, warni... |
#!/usr/bin/env python
#
# Copyright (C) 2007 British Broadcasting Corporation and Kamaelia Contributors(1)
# All Rights Reserved.
#
# You may only modify and redistribute this under the terms of any of the
# following licenses(2): Mozilla Public License, V1.1, GNU General
# Public License, V2.0, GNU Lesser General ... | [
"re.match",
"Kamaelia.File.Reading.RateControlledFileReader",
"Kamaelia.Support.Data.Rationals.rational",
"Axon.Ipc.producerFinished",
"Kamaelia.UI.Pygame.VideoOverlay.VideoOverlay"
] | [((10896, 10943), 're.match', 're.match', (['"""^YUV4MPEG2((?: .\\\\S*)*)\n$"""', 'line'], {}), '("""^YUV4MPEG2((?: .\\\\S*)*)\n$""", line)\n', (10904, 10943), False, 'import re\n'), ((12858, 12894), 're.match', 're.match', (['"""^ (.)(\\\\S*)(.*)$"""', 'fields'], {}), "('^ (.)(\\\\S*)(.*)$', fields)\n", (12866, 12894)... |
import click
from flask.cli import AppGroup
from project import app, db
from project.dateutils import berlin_tz
from project.services.event import (
get_recurring_events,
update_event_dates_with_recurrence_rule,
)
event_cli = AppGroup("event")
@event_cli.command("update-recurring-dates")
def update_recurrin... | [
"project.db.session.execute",
"flask.cli.AppGroup",
"project.services.event.update_event_dates_with_recurrence_rule",
"project.services.event.get_recurring_events",
"project.app.cli.add_command",
"project.db.session.commit"
] | [((236, 253), 'flask.cli.AppGroup', 'AppGroup', (['"""event"""'], {}), "('event')\n", (244, 253), False, 'from flask.cli import AppGroup\n'), ((666, 696), 'project.app.cli.add_command', 'app.cli.add_command', (['event_cli'], {}), '(event_cli)\n', (685, 696), False, 'from project import app, db\n'), ((392, 460), 'projec... |
import os
import re
import sys
import subprocess
import pytest
from testplan.common.utils.path import change_directory
import platform
ON_WINDOWS = platform.system() == 'Windows'
KNOWN_EXCEPTIONS = [
"TclError: Can't find a usable init\.tcl in the following directories:", # Matplotlib module improperly installe... | [
"subprocess.check_output",
"os.listdir",
"os.path.join",
"os.getcwd",
"os.path.realpath",
"os.path.dirname",
"platform.system",
"testplan.common.utils.path.change_directory",
"os.path.abspath",
"pytest.skip",
"pytest.xfail",
"re.search"
] | [((151, 168), 'platform.system', 'platform.system', ([], {}), '()\n', (166, 168), False, 'import platform\n'), ((1240, 1284), 'os.path.join', 'os.path.join', (['"""Cpp"""', '"""GTest"""', '"""test_plan.py"""'], {}), "('Cpp', 'GTest', 'test_plan.py')\n", (1252, 1284), False, 'import os\n'), ((1429, 1440), 'os.getcwd', '... |
import datetime
import getpass
import logging
import os
import pathlib
import platform
import re
import smtplib
import sys
from contextlib import contextmanager
from email.message import EmailMessage
from functools import wraps
import azure.functions as func
import click
import gspread
import pandas as pd
from apsched... | [
"logging.getLogger",
"selenium.webdriver.chrome.options.Options",
"logging.StreamHandler",
"gspread.authorize",
"smtplib.SMTP_SSL",
"datetime.datetime.today",
"email.message.EmailMessage",
"pathlib.Path",
"click.group",
"click.option",
"functools.wraps",
"getpass.getpass",
"platform.system",... | [((752, 779), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (769, 779), False, 'import logging\n'), ((819, 852), 'logging.StreamHandler', 'logging.StreamHandler', (['sys.stdout'], {}), '(sys.stdout)\n', (840, 852), False, 'import logging\n'), ((897, 959), 'logging.Formatter', 'logging.Fo... |
# -*- coding: utf-8 -*-
# Copyright 2020 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | [
"datetime.datetime.strptime",
"libcloudforensics.providers.azure.forensics.CreateDiskCopy",
"Crypto.PublicKey.RSA.generate",
"os.getcwd",
"libcloudforensics.providers.azure.internal.account.AZAccount",
"libcloudforensics.logging_utils.GetLogger",
"libcloudforensics.logging_utils.SetUpLogger",
"libclou... | [((969, 1004), 'libcloudforensics.logging_utils.SetUpLogger', 'logging_utils.SetUpLogger', (['__name__'], {}), '(__name__)\n', (994, 1004), False, 'from libcloudforensics import logging_utils\n'), ((1014, 1047), 'libcloudforensics.logging_utils.GetLogger', 'logging_utils.GetLogger', (['__name__'], {}), '(__name__)\n', ... |
import torch.nn as nn
import torch.nn.functional as F
from haptic.Pointnet_Pointnet2_pytorch.models.pointnet2_utils import PointNetSetAbstractionMsg,PointNetFeaturePropagation
class get_shared_model(nn.Module):
def __init__(self, use_batch_norm, num_classes, num_input_channel=7):
super(get_shared_model, s... | [
"torch.nn.Dropout",
"torch.nn.functional.nll_loss",
"haptic.Pointnet_Pointnet2_pytorch.models.pointnet2_utils.PointNetFeaturePropagation",
"torch.nn.functional.normalize",
"torch.nn.BatchNorm1d",
"haptic.Pointnet_Pointnet2_pytorch.models.pointnet2_utils.PointNetSetAbstractionMsg",
"torch.nn.BCEWithLogit... | [((10025, 10047), 'torch.rand', 'torch.rand', (['(6)', '(9)', '(2048)'], {}), '(6, 9, 2048)\n', (10035, 10047), False, 'import torch\n'), ((356, 495), 'haptic.Pointnet_Pointnet2_pytorch.models.pointnet2_utils.PointNetSetAbstractionMsg', 'PointNetSetAbstractionMsg', (['(1024)', '[0.05, 0.1]', '[16, 32]', 'num_input_chan... |
import krpc
import time
import math
from simple_pid import PID
conn = krpc.connect(name="UI Test")
vessel = conn.space_center.active_vessel
kerbin_frame = vessel.orbit.body.reference_frame
orb_frame = vessel.orbital_reference_frame
srf_frame = vessel.surface_reference_frame
surface_gravity = vessel.orbit.body.surface_... | [
"krpc.connect",
"simple_pid.PID",
"time.sleep"
] | [((71, 99), 'krpc.connect', 'krpc.connect', ([], {'name': '"""UI Test"""'}), "(name='UI Test')\n", (83, 99), False, 'import krpc\n'), ((1005, 1020), 'time.sleep', 'time.sleep', (['(0.2)'], {}), '(0.2)\n', (1015, 1020), False, 'import time\n'), ((1936, 1965), 'simple_pid.PID', 'PID', (['(0.15)', '(0)', '(0.5)'], {'setpo... |
import datetime
import os
from io import BytesIO
import logging
from functools import wraps
from copy import deepcopy
from collections import Counter
import slugify
import yaml
import mistune
import requests
from flask import \
Blueprint, Flask, render_template, abort, send_file, make_response
from flask_cors imp... | [
"flask.render_template",
"mistune.Markdown",
"flask_cors.CORS",
"flask.Flask",
"datapackage_pipelines.utilities.stat_utils.user_facing_stats",
"io.BytesIO",
"copy.deepcopy",
"logging.info",
"functools.wraps",
"flask.abort",
"yaml.dump",
"requests.get",
"flask_jsonpify.jsonify",
"flask.send... | [((823, 855), 'mistune.Markdown', 'mistune.Markdown', ([], {'hard_wrap': '(True)'}), '(hard_wrap=True)\n', (839, 855), False, 'import mistune\n'), ((865, 877), 'datapackage_pipelines.status.status_mgr', 'status_mgr', ([], {}), '()\n', (875, 877), False, 'from datapackage_pipelines.status import status_mgr\n'), ((2852, ... |
import pygame as pg
from pygame.locals import *
import sys
import board.chess_board as board
w = 60 * 8
h = 60 * 8
class Game:
"""
Class to setup and start a game
"""
def __init__(self):
self.b = board.Board(w, h)
def get_board(self):
"""
Returns board
:return: B... | [
"pygame.quit",
"pygame.event.get",
"pygame.mouse.get_pos",
"sys.exit",
"board.chess_board.Board"
] | [((224, 241), 'board.chess_board.Board', 'board.Board', (['w', 'h'], {}), '(w, h)\n', (235, 241), True, 'import board.chess_board as board\n'), ((555, 569), 'pygame.event.get', 'pg.event.get', ([], {}), '()\n', (567, 569), True, 'import pygame as pg\n'), ((662, 671), 'pygame.quit', 'pg.quit', ([], {}), '()\n', (669, 67... |
#importing libraries
import torch
import torch.utils.data as data
import os
import random
from PIL import Image
class CreateDataset(data.Dataset):
def __init__(self , imagedir , subfolder='train' , direction = 'AtoB' , flip = False , transform = None ,resize_scale = None , crop_size = None):
... | [
"os.listdir",
"PIL.Image.open",
"os.path.join",
"random.random",
"random.randint"
] | [((402, 435), 'os.path.join', 'os.path.join', (['imagedir', 'subfolder'], {}), '(imagedir, subfolder)\n', (414, 435), False, 'import os\n'), ((785, 844), 'os.path.join', 'os.path.join', (['self.images_path', 'self.image_filenames[index]'], {}), '(self.images_path, self.image_filenames[index])\n', (797, 844), False, 'im... |
#Prediction model using an instance of the Monte Carlo simulation and Brownian Motion equation
#import of libraries
import numpy as np
import pandas as pd
from pandas_datareader import data as wb
import matplotlib.pyplot as plt
from scipy.stats import norm
#ticker selection
def mainFunction(tradingSymbol):
data ... | [
"numpy.random.rand",
"pandas_datareader.data.DataReader",
"matplotlib.pyplot.plot",
"scipy.stats.norm.ppf",
"numpy.array",
"matplotlib.pyplot.figure",
"pandas.DataFrame",
"numpy.zeros_like",
"matplotlib.pyplot.show"
] | [((322, 336), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (334, 336), True, 'import pandas as pd\n'), ((621, 631), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (629, 631), True, 'import matplotlib.pyplot as plt\n'), ((782, 792), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (790, 792), Tr... |
import os
import csv
import numpy as np
from sklearn.utils import shuffle
## Read in frame data
samples = []
with open('/../opt/carnd_p3/data/driving_log.csv') as csvfile: #open the log file
reader = csv.reader(csvfile) #as a readable csv
for line in reader:
samples.append(line) #add each line of th... | [
"keras.layers.core.Flatten",
"keras.layers.convolutional.Cropping2D",
"sklearn.model_selection.train_test_split",
"sklearn.utils.shuffle",
"keras.layers.core.Lambda",
"keras.models.Sequential",
"numpy.array",
"keras.layers.convolutional.Conv2D",
"csv.reader",
"keras.layers.core.Dense"
] | [((399, 415), 'sklearn.utils.shuffle', 'shuffle', (['samples'], {}), '(samples)\n', (406, 415), False, 'from sklearn.utils import shuffle\n'), ((610, 650), 'sklearn.model_selection.train_test_split', 'train_test_split', (['samples'], {'test_size': '(0.2)'}), '(samples, test_size=0.2)\n', (626, 650), False, 'from sklear... |
#!/usr/bin/env python3
""" A script containing the basic principles of the extraction primitive inner
workings"""
from __future__ import division, print_function
from ghostdr import polyfit
import numpy as pn
# Firstly, let's find all the needed files
fitsdir='/Users/mireland/data/ghost/cal_frames/'
#Define the f... | [
"ghostdr.polyfit.Extractor",
"ghostdr.polyfit.GhostArm",
"ghostdr.polyfit.SlitView"
] | [((1251, 1287), 'ghostdr.polyfit.GhostArm', 'polyfit.GhostArm', (['"""blue"""'], {'mode': '"""std"""'}), "('blue', mode='std')\n", (1267, 1287), False, 'from ghostdr import polyfit\n'), ((1607, 1666), 'ghostdr.polyfit.SlitView', 'polyfit.SlitView', (['image_array', 'flat_image_array'], {'mode': '"""std"""'}), "(image_a... |
import unittest
import datetime
import kronos
string_format_time = "%Y-%m-%d %H:%M:%S"
date_time_str = "2020-07-19 18:14:21"
class KronosTest(unittest.TestCase):
def test_get_day_of_week(self):
for i in range(len(kronos.week_days)):
date = kronos.get_date_time_from_string(f"2020-08-{10 + i} 1... | [
"kronos.is_previous_friday",
"kronos.is_yesterday",
"kronos.is_overdue",
"kronos.get_date_time_from_string",
"kronos.get_day_of_week",
"kronos.get_date_time_as_string",
"kronos.week_days.get"
] | [((468, 523), 'kronos.get_date_time_from_string', 'kronos.get_date_time_from_string', (['"""2020-07-20 18:14:21"""'], {}), "('2020-07-20 18:14:21')\n", (500, 523), False, 'import kronos\n'), ((621, 676), 'kronos.get_date_time_from_string', 'kronos.get_date_time_from_string', (['"""2020-07-19 18:14:21"""'], {}), "('2020... |
from asyncio import Future
from greenlet import getcurrent
import psycopg2
from psycopg2 import * # noqa
from psycopg2 import extensions, OperationalError
__version__ = psycopg2.__version__
def psycopg2_wait_callback(conn):
"""A wait callback to allow greenlet to work with Psycopg.
The caller must be from... | [
"psycopg2.OperationalError",
"psycopg2.extensions.set_wait_callback",
"pulsar.ImproperlyConfigured",
"greenlet.getcurrent",
"asyncio.Future"
] | [((2505, 2557), 'psycopg2.extensions.set_wait_callback', 'extensions.set_wait_callback', (['psycopg2_wait_callback'], {}), '(psycopg2_wait_callback)\n', (2533, 2557), False, 'from psycopg2 import extensions, OperationalError\n'), ((1339, 1351), 'greenlet.getcurrent', 'getcurrent', ([], {}), '()\n', (1349, 1351), False,... |
# Copyright 2011-2012 10gen, 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,... | [
"pymongo.database.Database",
"multiprocessing.Process",
"sys.platform.startswith",
"time.sleep",
"pymongo.replica_set_connection.ReplicaSetConnection",
"signal.alarm",
"copy.deepcopy",
"unittest.main",
"test.utils.delay",
"test.utils.read_from_which_host",
"test.utils.assertReadFrom",
"pymongo... | [((1477, 1513), 'os.environ.get', 'os.environ.get', (['"""DB_IP"""', '"""localhost"""'], {}), "('DB_IP', 'localhost')\n", (1491, 1513), False, 'import os\n'), ((1525, 1557), 'os.environ.get', 'os.environ.get', (['"""DB_PORT"""', '(27017)'], {}), "('DB_PORT', 27017)\n", (1539, 1557), False, 'import os\n'), ((27982, 2799... |
import argparse_helper as argparse
import config_dir
import sys
from .editor import Editor
def main(*args):
if len(args) > 0:
args = [args]
parser = argparse.ArgumentParser()
parser.add_argument("-f", dest="cfg_file", help="query save name")
parser.add_argument("-x", default=False, action="st... | [
"config_dir.config_dir",
"config_dir.load_config",
"sys.exit",
"argparse_helper.ArgumentParser",
"sys.stdin.read"
] | [((168, 193), 'argparse_helper.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (191, 193), True, 'import argparse_helper as argparse\n'), ((1696, 1747), 'config_dir.config_dir', 'config_dir.config_dir', ([], {'name': '""".jqi"""', 'sub_dir': '"""query"""'}), "(name='.jqi', sub_dir='query')\n", (1717, 1747... |
import numpy as np
from visual_dynamics.policies import CameraTargetPolicy
class RandomOffsetCameraTargetPolicy(CameraTargetPolicy):
def __init__(self, env, target_env, camera_node_name, agent_node_name, target_node_name,
height=12.0, radius=16.0, angle=(-np.pi/4, np.pi/4), tightness=0.1, hra_in... | [
"numpy.sin",
"numpy.cos",
"numpy.random.uniform"
] | [((1027, 1058), 'numpy.random.uniform', 'np.random.uniform', (['*self.height'], {}), '(*self.height)\n', (1044, 1058), True, 'import numpy as np\n'), ((1135, 1166), 'numpy.random.uniform', 'np.random.uniform', (['*self.radius'], {}), '(*self.radius)\n', (1152, 1166), True, 'import numpy as np\n'), ((1242, 1272), 'numpy... |
import json
import logging
import os
from typing import Optional
from mir import scm
from mir.tools import mir_storage
def mir_check_repo_dvc_dirty(mir_root: str = ".") -> bool:
names = [name for name in mir_storage.get_all_mir_paths() if os.path.isfile(os.path.join(mir_root, name))]
if names:
dvc_cm... | [
"json.loads",
"mir.scm.Scm",
"os.path.join",
"mir.tools.mir_storage.get_all_mir_paths",
"logging.info"
] | [((1026, 1065), 'mir.scm.Scm', 'scm.Scm', (['mir_root'], {'scm_executable': '"""git"""'}), "(mir_root, scm_executable='git')\n", (1033, 1065), False, 'from mir import scm\n'), ((411, 450), 'mir.scm.Scm', 'scm.Scm', (['mir_root'], {'scm_executable': '"""dvc"""'}), "(mir_root, scm_executable='dvc')\n", (418, 450), False,... |
# coding:utf-8
from sqlalchemy import text
from db.basic_db import db_session
from db.models import SeedIds
from decorators.decorator import db_commit_decorator
def get_seed():
"""
Get all user id to be crawled
:return: user ids
"""
return db_session.query(SeedIds).filter(text('status=0')).all()
d... | [
"db.basic_db.db_session.query",
"sqlalchemy.text",
"db.models.SeedIds.__table__.insert",
"db.basic_db.db_session.commit",
"db.models.SeedIds",
"db.basic_db.db_session.add"
] | [((1097, 1116), 'db.basic_db.db_session.commit', 'db_session.commit', ([], {}), '()\n', (1114, 1116), False, 'from db.basic_db import db_session\n'), ((1366, 1385), 'db.basic_db.db_session.commit', 'db_session.commit', ([], {}), '()\n', (1383, 1385), False, 'from db.basic_db import db_session\n'), ((1758, 1777), 'db.ba... |
"""
Area Weighted Interpolation
"""
import numpy as np
import geopandas as gpd
from ._vectorized_raster_interpolation import _fast_append_profile_in_gdf
import warnings
from scipy.sparse import dok_matrix, diags, coo_matrix
import pandas as pd
from tobler.util.util import _check_crs, _nan_check, _inf_check, _check_p... | [
"scipy.sparse.diags",
"tobler.util.util._check_crs",
"pandas.DataFrame",
"numpy.asarray",
"numpy.diag",
"numpy.array",
"numpy.zeros",
"numpy.dot",
"tobler.util.util._nan_check",
"numpy.isnan",
"geopandas.overlay",
"scipy.sparse.coo_matrix",
"warnings.warn",
"tobler.util.util._inf_check",
... | [((1390, 1422), 'tobler.util.util._check_crs', '_check_crs', (['source_df', 'target_df'], {}), '(source_df, target_df)\n', (1400, 1422), False, 'from tobler.util.util import _check_crs, _nan_check, _inf_check, _check_presence_of_crs\n'), ((2243, 2340), 'scipy.sparse.coo_matrix', 'coo_matrix', (['(areas, (ids_src, ids_t... |
##
# This software was developed and / or modified by Raytheon Company,
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
#
# U.S. EXPORT CONTROLLED TECHNICAL DATA
# This software product contains export-restricted data whose
# export/transfer/disclosure is restricted by U.S. law. Dissemination
# to ... | [
"TestScript.generalTestScript"
] | [((49491, 49553), 'TestScript.generalTestScript', 'TestScript.generalTestScript', (['self', 'dataMgr', 'scripts', 'defaults'], {}), '(self, dataMgr, scripts, defaults)\n', (49519, 49553), False, 'import TestScript\n')] |
import time
old_input_value = False
flag_falling_edge = None
start = None
flag_output_mask = False
DELAY_CONST = 10 # delay time from falling edge ... .
output = None
def response_function():
global old_input_value, flag_falling_edge, start, flag_output_mask, output
if flag_falling... | [
"time.perf_counter"
] | [((365, 384), 'time.perf_counter', 'time.perf_counter', ([], {}), '()\n', (382, 384), False, 'import time\n'), ((1306, 1325), 'time.perf_counter', 'time.perf_counter', ([], {}), '()\n', (1323, 1325), False, 'import time\n')] |
""" This module does validation for data input in incidents """
import re
class Validate():
"""
methods for validatin incidents input data
"""
def valid_email(self, email):
self.vemail = re.match(
r"(^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$)", email)
if not self.vem... | [
"re.match"
] | [((217, 287), 're.match', 're.match', (['"""(^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\\\.[a-zA-Z0-9-.]+$)"""', 'email'], {}), "('(^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\\\.[a-zA-Z0-9-.]+$)', email)\n", (225, 287), False, 'import re\n'), ((434, 479), 're.match', 're.match', (['"""[A-Za-z0-9@#$%^&+=]{8,}"""', 'password'], {}), "('[A-Z... |
from .terraform import TerraformManager
import pytest
from _pytest.tmpdir import TempPathFactory
@pytest.fixture(scope='session')
def tfenv(tmp_path_factory: TempPathFactory):
env_vars = {
}
with TerraformManager(path_factory=tmp_path_factory, env_vars=env_vars) as deployment:
yield deplo... | [
"pytest.fixture"
] | [((100, 131), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (114, 131), False, 'import pytest\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*- #
# vim: encoding=utf-8
#
# 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 yo... | [
"datetime.date.today"
] | [((1419, 1431), 'datetime.date.today', 'date.today', ([], {}), '()\n', (1429, 1431), False, 'from datetime import date\n')] |
# -*- coding: utf-8 -*-
#Copyright (c) 2010,12 <NAME>
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to use, copy, modify, merge, ... | [
"random.uniform",
"cairo.ImageSurface",
"tacanvas.wrap100",
"cairo.Context",
"math.sqrt",
"tautils.debug_output",
"math.cos",
"gtk.gdk.CairoContext",
"tasprite_factory.SVG",
"sprites.Sprite",
"math.sin"
] | [((1556, 1561), 'tasprite_factory.SVG', 'SVG', ([], {}), '()\n', (1559, 1561), False, 'from tasprite_factory import SVG, svg_str_to_pixbuf\n'), ((4257, 4306), 'sprites.Sprite', 'Sprite', (['turtles.sprite_list', '(0)', '(0)', 'self.shapes[0]'], {}), '(turtles.sprite_list, 0, 0, self.shapes[0])\n', (4263, 4306), False, ... |
try:
from django.forms.utils import pretty_name
except ImportError:
from django.forms.forms import pretty_name
from django.template import Context
from django.template.loader import render_to_string
from .compat import context_flatten
class Group(list):
"""
A simplistic representation of backends tha... | [
"django.forms.forms.pretty_name"
] | [((621, 636), 'django.forms.forms.pretty_name', 'pretty_name', (['id'], {}), '(id)\n', (632, 636), False, 'from django.forms.forms import pretty_name\n')] |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from flask import Flask, request, abort, render_template
from datetime import timedelta
import pymysql
from search import start_search, decorate
page_dir = "E:/WEBPAGES_RAW"
app = Flask(__name__)
app.config['DEBUG'] = True
app.config['SEND_FILE_MAX_AGE_DEFAULT'] ... | [
"flask.render_template",
"flask.request.args.get",
"flask.Flask",
"pymysql.connect",
"search.start_search",
"datetime.timedelta",
"search.decorate"
] | [((235, 250), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (240, 250), False, 'from flask import Flask, request, abort, render_template\n'), ((322, 342), 'datetime.timedelta', 'timedelta', ([], {'seconds': '(1)'}), '(seconds=1)\n', (331, 342), False, 'from datetime import timedelta\n'), ((359, 432), 'pym... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
.. codeauthor:: <NAME> <<EMAIL>>
"""
import logging
import sys, os, json
from cdumay_rest_client.client import RESTClient
from cdumay_rest_client.exceptions import NotFound, HTTPException
class NoSuchFile(NotFound):
"""NoSuchFile"""
def oncritical(exc):
"... | [
"os.path.exists",
"cdumay_rest_client.client.RESTClient",
"logging.debug",
"os.path.realpath",
"logging.critical",
"sys.exit",
"json.dump"
] | [((477, 488), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (485, 488), False, 'import sys, os, json\n'), ((570, 596), 'os.path.realpath', 'os.path.realpath', (['filename'], {}), '(filename)\n', (586, 596), False, 'import sys, os, json\n'), ((1129, 1223), 'json.dump', 'json.dump', (['data', 'out'], {'ensure_ascii': '... |
import numpy as np
import pytest
import apexpy
import tempfile
import os
import h5py
from ttools import create_dataset, config, io, utils
map_periods = [np.timedelta64(10, 'm'), np.timedelta64(30, 'm'), np.timedelta64(1, 'h'), np.timedelta64(2, 'h')]
@pytest.fixture
def times():
yield np.datetime64('2010-01-01T... | [
"numpy.random.rand",
"numpy.array",
"numpy.arange",
"os.path.exists",
"numpy.datetime64",
"numpy.meshgrid",
"ttools.create_dataset.process_file",
"numpy.ceil",
"numpy.ones",
"h5py.File",
"numpy.isnan",
"ttools.io.open_tec_file",
"numpy.timedelta64",
"apexpy.Apex",
"tempfile.TemporaryDire... | [((376, 426), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""map_period"""', 'map_periods'], {}), "('map_period', map_periods)\n", (399, 426), False, 'import pytest\n'), ((1278, 1328), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""map_period"""', 'map_periods'], {}), "('map_period', map_perio... |
import typer
def name_callback(value: str):
if value != "Camila":
raise typer.BadParameter("Only Camila is allowed")
return value
def main(name: str = typer.Option(..., callback=name_callback)):
typer.echo(f"Hello {name}")
if __name__ == "__main__":
typer.run(main)
| [
"typer.Option",
"typer.run",
"typer.echo",
"typer.BadParameter"
] | [((171, 212), 'typer.Option', 'typer.Option', (['...'], {'callback': 'name_callback'}), '(..., callback=name_callback)\n', (183, 212), False, 'import typer\n'), ((219, 246), 'typer.echo', 'typer.echo', (['f"""Hello {name}"""'], {}), "(f'Hello {name}')\n", (229, 246), False, 'import typer\n'), ((280, 295), 'typer.run', ... |
from math import sqrt
def stream_primes(num):
primes = []
candidate = 2
for i in range(num):
prime = next_prime(primes, candidate)
primes.append(prime)
candidate = prime + 1
yield prime
def next_prime(primes, candidate):
while True:
for prime in primes:
... | [
"math.sqrt"
] | [((398, 413), 'math.sqrt', 'sqrt', (['candidate'], {}), '(candidate)\n', (402, 413), False, 'from math import sqrt\n')] |
from typing import List, Dict
import json
from gtmcore.http import ConcurrentRequestManager, ConcurrentRequest
from gtmcore.environment.packagemanager import PackageManager, PackageResult, PackageMetadata
from gtmcore.container import container_for_context
from gtmcore.labbook import LabBook
from gtmcore.logging impor... | [
"json.loads",
"gtmcore.http.ConcurrentRequest",
"gtmcore.environment.packagemanager.PackageMetadata",
"gtmcore.logging.LMLogger.get_logger",
"gtmcore.container.container_for_context",
"gtmcore.http.ConcurrentRequestManager"
] | [((341, 362), 'gtmcore.logging.LMLogger.get_logger', 'LMLogger.get_logger', ([], {}), '()\n', (360, 362), False, 'from gtmcore.logging import LMLogger\n'), ((1065, 1091), 'gtmcore.http.ConcurrentRequestManager', 'ConcurrentRequestManager', ([], {}), '()\n', (1089, 1091), False, 'from gtmcore.http import ConcurrentReque... |
from tensor.main_module import Tensor
import numpy as np
def getTensor(value):
if type(value) is np.ndarray:
return Tensor.numpy2Tensor(value)
elif type(value) is Tensor:
return value
else:
raise Exception | [
"tensor.main_module.Tensor.numpy2Tensor"
] | [((129, 155), 'tensor.main_module.Tensor.numpy2Tensor', 'Tensor.numpy2Tensor', (['value'], {}), '(value)\n', (148, 155), False, 'from tensor.main_module import Tensor\n')] |
# coding: utf-8
"""
TGS API
A production scale tool for BYOND server management # noqa: E501
OpenAPI spec version: 9.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import swagger_client
from swagger_client.model... | [
"unittest.main"
] | [((862, 877), 'unittest.main', 'unittest.main', ([], {}), '()\n', (875, 877), False, 'import unittest\n')] |
from setuptools import find_packages, setup
setup(
name='src',
packages=find_packages(),
version='0.1.0',
description='Python codebase for the housing classification ML problem',
author='Joesan',
license='',
)
| [
"setuptools.find_packages"
] | [((81, 96), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (94, 96), False, 'from setuptools import find_packages, setup\n')] |
# Copyright (c) OpenMMLab. All rights reserved.
import pytest
import torch
from mmedit.models.backbones.sr_backbones.edvr_net import (EDVRNet,
PCDAlignment,
TSAFusion)
def test_pcd_alignment():
"... | [
"mmedit.models.backbones.sr_backbones.edvr_net.PCDAlignment",
"mmedit.models.backbones.sr_backbones.edvr_net.TSAFusion",
"mmedit.models.backbones.sr_backbones.edvr_net.EDVRNet",
"torch.cuda.is_available",
"pytest.raises",
"torch.rand"
] | [((375, 420), 'mmedit.models.backbones.sr_backbones.edvr_net.PCDAlignment', 'PCDAlignment', ([], {'mid_channels': '(4)', 'deform_groups': '(2)'}), '(mid_channels=4, deform_groups=2)\n', (387, 420), False, 'from mmedit.models.backbones.sr_backbones.edvr_net import EDVRNet, PCDAlignment, TSAFusion\n'), ((804, 829), 'torc... |
import os
from shutil import rmtree
from tempfile import mkdtemp
from unittest import TestCase
from enjoliver import generator
class GenerateGroupTestCase(TestCase):
api_uri = None
test_matchbox_path = None
test_resources_path = None
tests_path = None
@classmethod
def setUpClass(cls):
... | [
"os.path.join",
"os.path.isfile",
"tempfile.mkdtemp",
"os.mkdir",
"enjoliver.generator.GenerateGroup",
"shutil.rmtree",
"os.remove"
] | [((339, 358), 'tempfile.mkdtemp', 'mkdtemp', ([], {'dir': '"""/tmp"""'}), "(dir='/tmp')\n", (346, 358), False, 'from tempfile import mkdtemp\n'), ((392, 437), 'os.path.join', 'os.path.join', (['cls.tests_path', '"""test_matchbox"""'], {}), "(cls.tests_path, 'test_matchbox')\n", (404, 437), False, 'import os\n'), ((472,... |
# Enter your code here. Read input from STDIN. Print output to STDOUT
import calendar
mm,dd,yyyy = map(int,input().split())
day = ["MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY","SUNDAY"]
val = int (calendar.weekday(yyyy,mm,dd))
print(day[val])
| [
"calendar.weekday"
] | [((217, 247), 'calendar.weekday', 'calendar.weekday', (['yyyy', 'mm', 'dd'], {}), '(yyyy, mm, dd)\n', (233, 247), False, 'import calendar\n')] |
"""Defines the models for trigger rules and events"""
from __future__ import unicode_literals
import django.contrib.postgres.fields
from django.db import models, transaction
from django.utils.timezone import now
class TriggerEventManager(models.Manager):
"""Provides additional methods for handling trigger events... | [
"django.db.models.ForeignKey",
"django.db.models.BooleanField",
"django.utils.timezone.now",
"trigger.handler.get_trigger_rule_handler",
"django.db.models.DateTimeField",
"django.db.models.CharField"
] | [((2395, 2441), 'django.db.models.CharField', 'models.CharField', ([], {'db_index': '(True)', 'max_length': '(50)'}), '(db_index=True, max_length=50)\n', (2411, 2441), False, 'from django.db import models, transaction\n'), ((2453, 2547), 'django.db.models.ForeignKey', 'models.ForeignKey', (['"""trigger.TriggerRule"""']... |
# Copyright 2018 Flight Lab authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | [
"threading.Timer",
"subprocess.call"
] | [((1865, 1903), 'threading.Timer', 'threading.Timer', (['(1)', 'self._check_status'], {}), '(1, self._check_status)\n', (1880, 1903), False, 'import threading\n'), ((3563, 3583), 'subprocess.call', 'subprocess.call', (['cmd'], {}), '(cmd)\n', (3578, 3583), False, 'import subprocess\n'), ((3801, 3821), 'subprocess.call'... |
"""Randomize the minitaur_gym_alternating_leg_env when reset() is called.
The randomization include swing_offset, extension_offset of all legs that mimics
bent legs, desired_pitch from user input, battery voltage and motor damping.
"""
import os, inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(in... | [
"os.path.dirname",
"inspect.currentframe",
"os.sys.path.insert",
"numpy.random.uniform"
] | [((457, 489), 'os.sys.path.insert', 'os.sys.path.insert', (['(0)', 'parentdir'], {}), '(0, parentdir)\n', (475, 489), False, 'import os, inspect\n'), ((372, 399), 'os.path.dirname', 'os.path.dirname', (['currentdir'], {}), '(currentdir)\n', (387, 399), False, 'import os, inspect\n'), ((429, 455), 'os.path.dirname', 'os... |
"""
The TensorProductState class and supporting functionality.
"""
#***************************************************************************************************
# Copyright 2015, 2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
# Under the terms of Contract DE-NA0003525 with NTESS, the U.... | [
"numpy.product",
"itertools.product",
"pygsti.modelmembers.states.state.State.__init__",
"numpy.take",
"numpy.kron",
"numpy.zeros",
"numpy.array",
"numpy.empty",
"pygsti.baseobjs.statespace.QubitSpace",
"numpy.concatenate",
"pygsti.modelmembers.term.RankOnePolynomialPrepTerm.create_from",
"num... | [((1791, 1826), 'pygsti.modelmembers.states.state.State.__init__', '_State.__init__', (['self', 'rep', 'evotype'], {}), '(self, rep, evotype)\n', (1806, 1826), True, 'from pygsti.modelmembers.states.state import State as _State\n'), ((2134, 2204), 'pygsti.baseobjs.statespace.StateSpace.from_nice_serialization', '_state... |
from .exceptions import MazeNotSolved, AlgorithmNotFound
from .dijkstra import Dijkstra
from .astar import Astar
from functools import wraps
import warnings
from daedalus import Maze as _maze
from PIL import Image
warnings.simplefilter("once", UserWarning)
class Maze:
"""
Create a maze and solve it.
A... | [
"daedalus.Maze",
"PIL.Image.new",
"functools.wraps",
"warnings.simplefilter",
"warnings.warn"
] | [((217, 259), 'warnings.simplefilter', 'warnings.simplefilter', (['"""once"""', 'UserWarning'], {}), "('once', UserWarning)\n", (238, 259), False, 'import warnings\n'), ((1427, 1447), 'daedalus.Maze', '_maze', (['width', 'height'], {}), '(width, height)\n', (1432, 1447), True, 'from daedalus import Maze as _maze\n'), (... |
#!/usr/bin/python
"""Interface to OpenShift oc command"""
import os
import shlex
import shutil
import subprocess
from ansible.module_utils.basic import AnsibleModule
ADDITIONAL_PATH_LOOKUPS = ['/usr/local/bin', os.path.expanduser('~/bin')]
def locate_oc_binary():
"""Find and return oc binary file"""
# htt... | [
"shlex.split",
"os.pathsep.join",
"os.path.join",
"os.environ.get",
"os.path.expanduser"
] | [((215, 242), 'os.path.expanduser', 'os.path.expanduser', (['"""~/bin"""'], {}), "('~/bin')\n", (233, 242), False, 'import os\n'), ((1600, 1633), 'shlex.split', 'shlex.split', (["module.params['cmd']"], {}), "(module.params['cmd'])\n", (1611, 1633), False, 'import shlex\n'), ((492, 526), 'os.environ.get', 'os.environ.g... |
import fractions
class Network(object):
def __init__(self, network):
self.network = network
def degree(self, link_type, key):
return len(self.network.get(link_type).get(key))
def average_degree(self, link_type):
degree = 0
for link in self.network.get(link_type).itervalue... | [
"fractions.gcd"
] | [((1247, 1281), 'fractions.gcd', 'fractions.gcd', (['intersection', 'union'], {}), '(intersection, union)\n', (1260, 1281), False, 'import fractions\n'), ((2065, 2133), 'fractions.gcd', 'fractions.gcd', (['new_similarity_sum', '(degree * (degree - 1) * precision)'], {}), '(new_similarity_sum, degree * (degree - 1) * pr... |
import ansible
import pprint
from ansible import utils
from jinja2 import Environment, PackageLoader
from collections import namedtuple
from ansible import utils
from ansible.parsing.dataloader import DataLoader
from ansible.vars import VariableManager
from ansible.inventory import Inventory
from ansible.executor.playb... | [
"ansible.vars.VariableManager",
"collections.namedtuple",
"ansible.inventory.Inventory",
"callbacks.PlaybookCallback",
"ansible.parsing.dataloader.DataLoader",
"ansible.executor.playbook_executor.PlaybookExecutor"
] | [((585, 597), 'ansible.parsing.dataloader.DataLoader', 'DataLoader', ([], {}), '()\n', (595, 597), False, 'from ansible.parsing.dataloader import DataLoader\n'), ((621, 638), 'ansible.vars.VariableManager', 'VariableManager', ([], {}), '()\n', (636, 638), False, 'from ansible.vars import VariableManager\n'), ((696, 785... |
#!/usr/bin/env python3
import itertools
import string
from elasticsearch import Elasticsearch,helpers
import sys
import os
from glob import glob
import pandas as pd
import json
host = sys.argv[1]
port = int(sys.argv[2])
alias = sys.argv[3]
print(host)
print(port)
print(alias)
es = Elasticsearch([{'host':... | [
"pandas.Series",
"json.loads",
"pandas.read_csv",
"elasticsearch.helpers.bulk",
"elasticsearch.Elasticsearch",
"os.path.join",
"pandas.DataFrame",
"os.walk"
] | [((297, 342), 'elasticsearch.Elasticsearch', 'Elasticsearch', (["[{'host': host, 'port': port}]"], {}), "([{'host': host, 'port': port}])\n", (310, 342), False, 'from elasticsearch import Elasticsearch, helpers\n'), ((1842, 1856), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (1854, 1856), True, 'import pandas ... |
from absl import app
from mainLoop import main
if __name__ == '__main__':
app.run(main)
| [
"absl.app.run"
] | [((91, 104), 'absl.app.run', 'app.run', (['main'], {}), '(main)\n', (98, 104), False, 'from absl import app\n')] |
#!/usr/bin/env python
# vgm2electron.py
# Tool for converting SN76489-based PSG VGM data to Acorn Electron
# By <NAME> (https://github.com/simondotm/)
# See https://github.com/simondotm/vgm-packer
#
# Copyright (c) 2019 <NAME>. All rights reserved.
#
# "MIT License":
# Permission is hereby granted, free of charge, to a... | [
"argparse.ArgumentParser",
"os.path.splitext",
"struct.pack",
"os.path.isfile",
"modules.vgmparser.VgmStream",
"sys.exit"
] | [((19976, 20080), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'formatter_class': 'argparse.RawDescriptionHelpFormatter', 'epilog': 'epilog_string'}), '(formatter_class=argparse.\n RawDescriptionHelpFormatter, epilog=epilog_string)\n', (19999, 20080), False, 'import argparse\n'), ((5444, 5467), 'modul... |
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# βββββββββββββββββββββββββββββββββββββββ¦βββββββββββββββββββββββββββββββββ
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# βββββββββββββ... | [
"wow.utils.posts.PostsUtils.get_posts_by_blizzard_id",
"wow.utils.posts.PostsUtils.add_category",
"fastapi.HTTPException",
"wow.utils.posts.PostsUtils.get_categories",
"fastapi.Depends",
"wow.utils.posts.PostsUtils.get_posts_by_category_limit",
"fastapi.APIRouter",
"wow.utils.users.BlizzardUsersUtils.... | [((1530, 1541), 'fastapi.APIRouter', 'APIRouter', ([], {}), '()\n', (1539, 1541), False, 'from fastapi import APIRouter, Depends, HTTPException\n'), ((2208, 2247), 'wow.utils.users.BlizzardUsersUtils.id__safe', 'BlizzardUsersUtils.id__safe', (['body.token'], {}), '(body.token)\n', (2235, 2247), False, 'from wow.utils.u... |
import datetime
import pickle
import tensorflow as tf
def save_checkpoint(model, current_step, epoch, output_path, **kwargs):
""" Save TF Vocoder model """
state = {
'model': model.weights,
'step': current_step,
'epoch': epoch,
'date': datetime.date.today().strftime("%B %d, %Y"... | [
"datetime.date.today",
"tensorflow.keras.backend.set_value"
] | [((763, 813), 'tensorflow.keras.backend.set_value', 'tf.keras.backend.set_value', (['tf_var', 'chkp_var_value'], {}), '(tf_var, chkp_var_value)\n', (789, 813), True, 'import tensorflow as tf\n'), ((278, 299), 'datetime.date.today', 'datetime.date.today', ([], {}), '()\n', (297, 299), False, 'import datetime\n')] |
import sys
import copy
import matplotlib
import matplotlib.pyplot as plt
import seaborn as sns
from collections import Counter
from .utils import *
import numpy as np
import pandas as pd
class plotFeatures:
usage = """Produces different feature plots given a data table and peak table.
Initial_Paramete... | [
"copy.deepcopy",
"matplotlib.pyplot.savefig",
"collections.Counter",
"seaborn.boxplot",
"matplotlib.pyplot.style.context",
"seaborn.violinplot",
"sys.exit",
"pandas.DataFrame",
"seaborn.pointplot",
"pandas.concat",
"seaborn.swarmplot",
"matplotlib.pyplot.show"
] | [((6879, 6910), 'copy.deepcopy', 'copy.deepcopy', (['self.__datatable'], {}), '(self.__datatable)\n', (6892, 6910), False, 'import copy\n'), ((9401, 9432), 'pandas.DataFrame', 'pd.DataFrame', (['X'], {'columns': 'labels'}), '(X, columns=labels)\n', (9413, 9432), True, 'import pandas as pd\n'), ((9597, 9621), 'matplotli... |