code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
# -*- coding: utf-8 -*-
# landportal-data-access-api
# Copyright (c)2014, WESO, Web Semantics Oviedo.
# Written by <NAME>.
# This file is part of landportal-data-access-api.
#
# landportal-data-access-api is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as... | [
"flask.app.Flask",
"flask.ext.track_usage.storage.sql.SQLStorage",
"flask_sqlalchemy.SQLAlchemy",
"flask.ext.cache.Cache",
"flask.ext.track_usage.TrackUsage"
] | [((1261, 1276), 'flask.app.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (1266, 1276), False, 'from flask.app import Flask\n'), ((1462, 1561), 'flask.ext.cache.Cache', 'Cache', (['app'], {'config': "{'CACHE_TYPE': 'memcached', 'CACHE_MEMCACHED_SERVERS': ['localhost:11211']}"}), "(app, config={'CACHE_TYPE': 'memc... |
#!/usr/bin/python
# -*- encoding: utf-8 -*-
import torch
import torch.nn as nn
class LabelSmoothSoftmaxCEV1(nn.Module):
'''
This is the autograd version, you can also try the LabelSmoothSoftmaxCEV2 that uses derived gradients
'''
def __init__(self, lb_smooth=0.1, reduction='mean', ignore_index=-10... | [
"torchvision.models.resnet18",
"torch.log_softmax",
"torch.randint",
"numpy.random.seed",
"torch.nn.LogSoftmax",
"torch.manual_seed",
"torch.randn",
"torch.softmax",
"torch.abs",
"random.seed",
"torch.empty_like",
"torch.no_grad",
"torch.sum"
] | [((3876, 3897), 'torch.manual_seed', 'torch.manual_seed', (['(15)'], {}), '(15)\n', (3893, 3897), False, 'import torch\n'), ((3902, 3917), 'random.seed', 'random.seed', (['(15)'], {}), '(15)\n', (3913, 3917), False, 'import random\n'), ((3922, 3940), 'numpy.random.seed', 'np.random.seed', (['(15)'], {}), '(15)\n', (393... |
# Copyright 2022 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
import json
import logging
import os
import shlex
import sys
import textwrap
from typing import Mapping
from pants.base.build_root import BuildRoot
from... | [
"pants.engine.internals.session.SessionValues",
"pants.base.build_root.BuildRoot",
"sys.stdout.fileno",
"logging.getLogger",
"json.dumps",
"pants.bsp.protocol.BSPConnection",
"shlex.quote",
"pants.bsp.context.BSPContext",
"sys.stdin.fileno",
"pants.util.strutil.softwrap",
"pants.util.docutil.bin... | [((1251, 1278), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1268, 1278), False, 'import logging\n'), ((5886, 5897), 'pants.base.build_root.BuildRoot', 'BuildRoot', ([], {}), '()\n', (5895, 5897), False, 'from pants.base.build_root import BuildRoot\n'), ((9251, 9263), 'pants.bsp.contex... |
# coding=utf-8
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
#
# 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/lice... | [
"datasets.Value",
"datasets.features.ClassLabel",
"datasets.SplitGenerator",
"json.loads"
] | [((3228, 3330), 'datasets.SplitGenerator', 'datasets.SplitGenerator', ([], {'name': 'datasets.Split.TRAIN', 'gen_kwargs': "{'filepaths': downloaded_filepaths}"}), "(name=datasets.Split.TRAIN, gen_kwargs={'filepaths':\n downloaded_filepaths})\n", (3251, 3330), False, 'import datasets\n'), ((3672, 3697), 'json.loads',... |
from frappe.custom.doctype.custom_field.custom_field import create_custom_fields
import frappe
from frappe import _
@frappe.whitelist()
def uom_list(item):
uom_list=frappe.db.get_list('UOM Conversion Detail',{"parent":item},'uom')
new_uoms = []
for uom in uom_list:
new_uoms.append(uom['uom'])
r... | [
"frappe.db.get_list",
"frappe.whitelist",
"frappe.throw",
"frappe.get_roles",
"frappe._"
] | [((118, 136), 'frappe.whitelist', 'frappe.whitelist', ([], {}), '()\n', (134, 136), False, 'import frappe\n'), ((170, 238), 'frappe.db.get_list', 'frappe.db.get_list', (['"""UOM Conversion Detail"""', "{'parent': item}", '"""uom"""'], {}), "('UOM Conversion Detail', {'parent': item}, 'uom')\n", (188, 238), False, 'impo... |
from main import ma
from models.Word import Word
from marshmallow.validate import Length
class WordSchema(ma.SQLAlchemyAutoSchema):
class Meta:
model = Word
word = ma.String(required=True, validate=Length(min=3))
definition = ma.String(required=True, validate=Length(min=5))
pronunciation = ma... | [
"marshmallow.validate.Length"
] | [((217, 230), 'marshmallow.validate.Length', 'Length', ([], {'min': '(3)'}), '(min=3)\n', (223, 230), False, 'from marshmallow.validate import Length\n'), ((283, 296), 'marshmallow.validate.Length', 'Length', ([], {'min': '(5)'}), '(min=5)\n', (289, 296), False, 'from marshmallow.validate import Length\n'), ((352, 365)... |
import json
import logging
class Config(object):
def __init__(self):
self.logger = logging.getLogger('CONFIG')
def read(self):
with open("config.json") as file:
data = json.load(file)
file.close()
self.logger.info("Success on reading configuration file.")
r... | [
"json.load",
"logging.getLogger"
] | [((97, 124), 'logging.getLogger', 'logging.getLogger', (['"""CONFIG"""'], {}), "('CONFIG')\n", (114, 124), False, 'import logging\n'), ((207, 222), 'json.load', 'json.load', (['file'], {}), '(file)\n', (216, 222), False, 'import json\n')] |
from dateutil.parser import parse
class Car:
def __init__(self, brand, name, price, year, damage, last_seen, image, id=None):
self.image = image
self.last_seen = parse(last_seen)
self.damage = damage
self.year = year
self.price = price
self.name = name
self.b... | [
"dateutil.parser.parse"
] | [((183, 199), 'dateutil.parser.parse', 'parse', (['last_seen'], {}), '(last_seen)\n', (188, 199), False, 'from dateutil.parser import parse\n')] |
import scrapy
import re
from scrapy.loader import ItemLoader
from machete.items import VersionItem
class versionSpider(scrapy.Spider):
name = 'versioninspector'
custom_settings = {
'USER_AGENT': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/71.0.3578.80 Chrome/... | [
"machete.items.VersionItem"
] | [((584, 597), 'machete.items.VersionItem', 'VersionItem', ([], {}), '()\n', (595, 597), False, 'from machete.items import VersionItem\n')] |
# -*- coding: utf-8 -*-
# BioSTEAM: The Biorefinery Simulation and Techno-Economic Analysis Modules
# Copyright (C) 2020-2021, <NAME> <<EMAIL>>
#
# This module is under the UIUC open-source license. See
# github.com/BioSTEAMDevelopmentGroup/biosteam/blob/master/LICENSE.txt
# for license details.
"""
"""
import numpy ... | [
"thermosteam.ThermalCondition",
"thermosteam.functional.V_to_rho",
"thermosteam.functional.mu_to_nu",
"numpy.asarray",
"numpy.isfinite",
"thermosteam.settings.get_impact_indicator_units",
"chemicals.elements.array_to_atoms",
"thermosteam.functional.Pr",
"thermosteam.Stream",
"numpy.dot",
"thermo... | [((9089, 9115), 'thermosteam.ThermalCondition', 'tmo.ThermalCondition', (['T', 'P'], {}), '(T, P)\n', (9109, 9115), True, 'import thermosteam as tmo\n'), ((18628, 18646), 'numpy.isfinite', 'np.isfinite', (['price'], {}), '(price)\n', (18639, 18646), True, 'import numpy as np\n'), ((25333, 25388), 'chemicals.elements.ar... |
import mujoco_py
from pathlib import Path
from mushroom_rl.utils import spaces
from mushroom_rl.environments.mujoco import MuJoCo, ObservationType
from mushroom_rl.utils.running_stats import *
from ._external_simulation import NoExternalSimulation, MuscleSimulation
from .reward_goals import CompleteTrajectoryReward, ... | [
"mujoco_py.MjViewer",
"pathlib.Path",
"mujoco_py.MjSimState",
"mushroom_rl.environments.mujoco_envs.humanoid_gait.utils.quat_to_euler"
] | [((11287, 11376), 'mujoco_py.MjSimState', 'mujoco_py.MjSimState', (['old_state.time', 'qpos', 'qvel', 'old_state.act', 'old_state.udd_state'], {}), '(old_state.time, qpos, qvel, old_state.act, old_state.\n udd_state)\n', (11307, 11376), False, 'import mujoco_py\n'), ((11549, 11574), 'mushroom_rl.environments.mujoco_... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_shellcraft.
Tests for `shellcraft` module.
"""
from __future__ import unicode_literals
import os
import pytest
from click.testing import CliRunner
import pkg_resources
from shellcraft.cli import get_game, cli
from shellcraft.shellcraft import Game
@pytest.fix... | [
"pkg_resources.get_distribution",
"shellcraft.cli.get_game",
"shellcraft.shellcraft.Game.load",
"os.path.abspath",
"pytest.fixture",
"click.testing.CliRunner"
] | [((310, 340), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (324, 340), False, 'import pytest\n'), ((397, 408), 'click.testing.CliRunner', 'CliRunner', ([], {}), '()\n', (406, 408), False, 'from click.testing import CliRunner\n'), ((702, 721), 'shellcraft.shellcraft.Game.loa... |
"""
Module for classes to prepare validation dataset from MedInfo dataset.
Data format will be {key: {'question': question, 'summary':, summ, 'articles': articles} ...}
Additionally, format for question driven summarization. For example:
python prepare_validation_data.py -t --add-q
"""
import json
import argparse
im... | [
"json.dump",
"json.load",
"argparse.ArgumentParser",
"spacy.load",
"re.sub"
] | [((425, 494), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Arguments for data exploration"""'}), "(description='Arguments for data exploration')\n", (448, 494), False, 'import argparse\n'), ((1286, 1314), 'spacy.load', 'spacy.load', (['"""en_core_web_sm"""'], {}), "('en_core_web_sm')\n... |
import wheel
from src import roulette_cancellation
from src import bet
from src import table
from src import wheel
from src import roulette_game
import unittest
class TestCancellation(unittest.TestCase):
def setUp(self):
self.wheel = wheel.Wheel()
self.table = table.Table(minimum=10, maximum=1000)
... | [
"unittest.main",
"src.table.Table",
"src.roulette_game.RouletteGame",
"src.wheel.Wheel",
"src.roulette_cancellation.RouletteCancellation"
] | [((1678, 1693), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1691, 1693), False, 'import unittest\n'), ((247, 260), 'src.wheel.Wheel', 'wheel.Wheel', ([], {}), '()\n', (258, 260), False, 'from src import wheel\n'), ((282, 319), 'src.table.Table', 'table.Table', ([], {'minimum': '(10)', 'maximum': '(1000)'}), '(... |
# AUTHOR: <NAME>
# 13-02-2022
# calculate the gini coefficient give the retrievability file
import os
import argparse
from collections import defaultdict
def check_file_exists(filename):
if filename and not os.path.exists(filename):
print("{0} Not Found".format(filename))
quit(1)
def calculate_g... | [
"os.path.exists",
"argparse.ArgumentParser"
] | [((1332, 1397), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Gini Cofficient Calculator"""'}), "(description='Gini Cofficient Calculator')\n", (1355, 1397), False, 'import argparse\n'), ((213, 237), 'os.path.exists', 'os.path.exists', (['filename'], {}), '(filename)\n', (227, 237), Fal... |
from sklearn.ensemble import RandomForestRegressor
from sklearn.ensemble import RandomForestClassifier
from sklearn.utils import check_array
import numpy as np
from ..utils.tools import Solver
class MissForest(Solver):
def __init__(
self,
n_estimators=300,
max_depth=None,
... | [
"sklearn.ensemble.RandomForestClassifier",
"numpy.sum",
"sklearn.utils.check_array",
"numpy.asarray",
"sklearn.ensemble.RandomForestRegressor"
] | [((2477, 2653), 'sklearn.ensemble.RandomForestRegressor', 'RandomForestRegressor', ([], {'n_estimators': 'n_estimators', 'max_depth': 'max_depth', 'min_samples_leaf': 'min_samples_leaf', 'max_features': 'max_features', 'min_samples_split': 'min_samples_split'}), '(n_estimators=n_estimators, max_depth=max_depth,\n mi... |
import os
from paranestamol.utils import Legend, cleanupFileRoot
if os.getenv('QT_API') != "PySide2":
raise RuntimeError(f'TL;DR \n\n`QT_API=PySide2 python3 -m paranestamol `\n\n The moron who\
designed `matplotlib_backend_qtquick` hard-coded a preference for\
pyqt5 for their backend, despite supporting PySide2 ... | [
"os.getenv"
] | [((69, 88), 'os.getenv', 'os.getenv', (['"""QT_API"""'], {}), "('QT_API')\n", (78, 88), False, 'import os\n')] |
#------------------------------------------------------------------------------+
#
# <NAME>
# Create a three color triangle
# 2017-DEC
#
#------------------------------------------------------------------------------+
#--- IMPORT DEPENDENCIES ------------------------------------------------------+
from __future... | [
"math.radians"
] | [((1688, 1699), 'math.radians', 'radians', (['(60)'], {}), '(60)\n', (1695, 1699), False, 'from math import radians\n')] |
import yfinance
import discord
from discord.ext import commands
import threading
import asyncio
import traceback
import requests
import time
class Asset(object):
def __init__(self, symbol=None, name=None, price=None, url=None):
self.symbol = symbol
self.name = name
self.price = price
... | [
"traceback.print_exc",
"discord.Embed",
"asyncio.sleep",
"time.sleep",
"threading.Lock",
"asyncio.get_running_loop",
"yfinance.Ticker",
"requests.get",
"discord.ext.commands.group",
"threading.Semaphore"
] | [((3659, 3675), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (3673, 3675), False, 'import threading\n'), ((4748, 4764), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (4762, 4764), False, 'import threading\n'), ((6604, 6633), 'discord.ext.commands.group', 'commands.group', ([], {'name': '"""stonks"""'})... |
import numpy as np
import time
from nms.nums_py2 import py_cpu_nms # for cpu
# from nms.gpu_nms import gpu_nms # for gpu
np.random.seed( 1 ) # keep fixed
num_rois = 6000
minxy = np.random.randint(50,145,size=(num_rois ,2))
maxxy = np.random.randint(150,200,size=(num_rois ,2))
score = 0.8*np.random.random_sample... | [
"numpy.random.seed",
"numpy.random.random_sample",
"nms.nums_py2.py_cpu_nms",
"time.time",
"numpy.random.randint",
"numpy.concatenate"
] | [((127, 144), 'numpy.random.seed', 'np.random.seed', (['(1)'], {}), '(1)\n', (141, 144), True, 'import numpy as np\n'), ((186, 232), 'numpy.random.randint', 'np.random.randint', (['(50)', '(145)'], {'size': '(num_rois, 2)'}), '(50, 145, size=(num_rois, 2))\n', (203, 232), True, 'import numpy as np\n'), ((239, 286), 'nu... |
def test_mqtt_broker_default_config():
from feeder.util.mqtt.broker import FeederBroker
from feeder import settings
broker = FeederBroker()
assert broker.config["listeners"]["tcp-1"] == {
"bind": f"0.0.0.0:{settings.mqtt_port}"
}
assert broker.config["listeners"]["tcp-ssl-1"] == {
... | [
"feeder.util.mqtt.broker.FeederBroker"
] | [((138, 152), 'feeder.util.mqtt.broker.FeederBroker', 'FeederBroker', ([], {}), '()\n', (150, 152), False, 'from feeder.util.mqtt.broker import FeederBroker\n'), ((670, 710), 'feeder.util.mqtt.broker.FeederBroker', 'FeederBroker', ([], {'config_overrides': 'overrides'}), '(config_overrides=overrides)\n', (682, 710), Fa... |
import tensorflow as tf
from network.Util import smart_shape
RNNCell = tf.nn.rnn_cell.RNNCell
LSTMStateTuple = tf.nn.rnn_cell.LSTMStateTuple
def _conv2d(x, W, strides=None):
if strides is None:
strides = [1, 1]
return tf.nn.conv2d(x, W, strides=[1] + strides + [1], padding="SAME")
def dynamic_conv_rnn(cell,... | [
"tensorflow.nn.dynamic_rnn",
"tensorflow.constant_initializer",
"tensorflow.reshape",
"tensorflow.concat",
"tensorflow.stack",
"tensorflow.get_variable",
"tensorflow.shape",
"tensorflow.nn.conv2d",
"tensorflow.split",
"tensorflow.sigmoid",
"network.Util.smart_shape"
] | [((228, 291), 'tensorflow.nn.conv2d', 'tf.nn.conv2d', (['x', 'W'], {'strides': '([1] + strides + [1])', 'padding': '"""SAME"""'}), "(x, W, strides=[1] + strides + [1], padding='SAME')\n", (240, 291), True, 'import tensorflow as tf\n'), ((584, 603), 'network.Util.smart_shape', 'smart_shape', (['inputs'], {}), '(inputs)\... |
import argparse
import base64
import os
import pickle
from google_auth_oauthlib.flow import InstalledAppFlow
SERVICE_SCOPES = {
"drive": ["drive.appdata", "drive.file", "drive.install", "drive"],
"apps-script": ["script.projects"],
}
def get_arguments(parser):
parser.add_argument(
"--credentials... | [
"argparse.ArgumentParser",
"os.stat",
"os.path.exists",
"google_auth_oauthlib.flow.InstalledAppFlow.from_client_secrets_file",
"pickle.dumps"
] | [((1119, 1184), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Getting Google OAuth token"""'}), "(description='Getting Google OAuth token')\n", (1142, 1184), False, 'import argparse\n'), ((2040, 2118), 'google_auth_oauthlib.flow.InstalledAppFlow.from_client_secrets_file', 'InstalledAppF... |
import apps.common.func.InitDjango
from all_models.models import TbUser, TbAdminUserPermissionRelation
from apps.common.func.WebFunc import *
class UserService(object):
@staticmethod
def getUsers():
return TbUser.objects.all()
@staticmethod
def getUserByLoginname(loginname):
return ... | [
"all_models.models.TbUser.objects.all",
"all_models.models.TbUser.objects.filter"
] | [((226, 246), 'all_models.models.TbUser.objects.all', 'TbUser.objects.all', ([], {}), '()\n', (244, 246), False, 'from all_models.models import TbUser, TbAdminUserPermissionRelation\n'), ((320, 362), 'all_models.models.TbUser.objects.filter', 'TbUser.objects.filter', ([], {'loginName': 'loginname'}), '(loginName=loginn... |
import numpy as np
from PIL import Image
import torch
import torch.nn as nn
from load_test_data import load_test_data
from sklearn.metrics import confusion_matrix
from model_result import model_result
import matplotlib.pyplot as plt
import seaborn as sn
import pandas as pd
import pickle
import os
import mat... | [
"os.mkdir",
"torch.from_numpy",
"torch.nn.ReLU",
"matplotlib.pyplot.imshow",
"torch.load",
"torch.nn.Conv2d",
"matplotlib.pyplot.close",
"matplotlib.use",
"torch.cuda.is_available",
"torch.nn.Linear",
"torch.nn.MaxPool2d",
"matplotlib.pyplot.subplots",
"torch.nn.Sigmoid"
] | [((2158, 2175), 'os.mkdir', 'os.mkdir', (['dirName'], {}), '(dirName)\n', (2166, 2175), False, 'import os\n'), ((2371, 2393), 'torch.load', 'torch.load', (['model_name'], {}), '(model_name)\n', (2381, 2393), False, 'import torch\n'), ((2955, 2977), 'torch.from_numpy', 'torch.from_numpy', (['data'], {}), '(data)\n', (29... |
# -*- coding: utf-8 -*-
"""The CPIO path specification resolver helper implementation."""
from dfvfs.file_io import cpio_file_io
from dfvfs.lib import definitions
from dfvfs.resolver_helpers import manager
from dfvfs.resolver_helpers import resolver_helper
from dfvfs.vfs import cpio_file_system
class CPIOResolverHel... | [
"dfvfs.file_io.cpio_file_io.CPIOFile",
"dfvfs.vfs.cpio_file_system.CPIOFileSystem"
] | [((652, 691), 'dfvfs.file_io.cpio_file_io.CPIOFile', 'cpio_file_io.CPIOFile', (['resolver_context'], {}), '(resolver_context)\n', (673, 691), False, 'from dfvfs.file_io import cpio_file_io\n'), ((906, 955), 'dfvfs.vfs.cpio_file_system.CPIOFileSystem', 'cpio_file_system.CPIOFileSystem', (['resolver_context'], {}), '(res... |
import io
import json
from typing import Optional
import pandas as pd
from astro.constants import DEFAULT_CHUNK_SIZE
from astro.constants import FileType as FileTypeConstants
from astro.files.types.base import FileType
class NDJSONFileType(FileType):
"""Concrete implementation to handle NDJSON file type"""
... | [
"json.loads"
] | [((1834, 1849), 'json.loads', 'json.loads', (['row'], {}), '(row)\n', (1844, 1849), False, 'import json\n')] |
import datetime
import json
import re
import os
import requests
import time
import threading
import pickle
from django.core.mail import send_mail
from django.db import connection
from django.http import JsonResponse
from django.shortcuts import render_to_response, render
from django.core.cache import cache
from ApiMa... | [
"django.core.mail.send_mail",
"django.core.cache.cache.delete_pattern",
"django.db.connection.close",
"threading.Thread.__init__",
"json.loads",
"ApiManager.models.TaskInfo.objects.get",
"ApiManager.utils.forms.get_validate_form_msg",
"threading.Lock",
"ApiManager.models.TaskInfo.objects.all",
"da... | [((20053, 20069), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (20067, 20069), False, 'import threading\n'), ((15619, 15684), 'ApiManager.utils.case_utils.run_case_by_id', 'run_case_by_id', (['base_url', 'case_id', 'task_name', '"""定时任务"""'], {'isTask': '(True)'}), "(base_url, case_id, task_name, '定时任务', isTas... |
from dagster import check
from dagster.utils import single_item
from .builtin_enum import BuiltinEnum
from .config import ConfigType, List, Nullable
from .wrapping import WrappingListType, WrappingNullableType
class InputSchema:
@property
def schema_type(self):
check.not_implemented(
'Mus... | [
"dagster.check.not_implemented",
"dagster.utils.single_item",
"dagster.check.type_param",
"dagster.check.param_invariant"
] | [((2133, 2193), 'dagster.check.param_invariant', 'check.param_invariant', (['config_type.is_selector', '"""config_cls"""'], {}), "(config_type.is_selector, 'config_cls')\n", (2154, 2193), False, 'from dagster import check\n'), ((3027, 3087), 'dagster.check.param_invariant', 'check.param_invariant', (['config_type.is_se... |
from django.conf.urls import url
from django.urls import path,include
from . import views
from .feeds import LatestPostsFeed
from .views import search, PostViewSet
from rest_framework import routers
from django.views.generic import TemplateView
router = routers.DefaultRouter()
router.register(r'api', PostViewSet)
... | [
"django.urls.path",
"django.conf.urls.url",
"rest_framework.routers.DefaultRouter",
"django.urls.include"
] | [((257, 280), 'rest_framework.routers.DefaultRouter', 'routers.DefaultRouter', ([], {}), '()\n', (278, 280), False, 'from rest_framework import routers\n'), ((360, 407), 'django.urls.path', 'path', (['""""""', 'views.most_viewed'], {'name': '"""most_viewed"""'}), "('', views.most_viewed, name='most_viewed')\n", (364, 4... |
import subprocess
import os, signal, time
def run_as_test():
proc = subprocess.Popen('python ./bot.py')
time.sleep(10)
if getattr(signal, 'SIGKILL', None):
os.kill(proc.pid, signal.SIGKILL)
else:
os.kill(proc.pid, signal.SIGTERM)
return True
# def run_as_live():
# proc = subpro... | [
"os.kill",
"subprocess.Popen",
"time.sleep"
] | [((73, 108), 'subprocess.Popen', 'subprocess.Popen', (['"""python ./bot.py"""'], {}), "('python ./bot.py')\n", (89, 108), False, 'import subprocess\n'), ((113, 127), 'time.sleep', 'time.sleep', (['(10)'], {}), '(10)\n', (123, 127), False, 'import os, signal, time\n'), ((177, 210), 'os.kill', 'os.kill', (['proc.pid', 's... |
import logging
from typing import List, Iterable, Dict, Union, Any, Optional, Iterator, Tuple
from presidio_analyzer import DictAnalyzerResult, RecognizerResult, AnalyzerEngine
from presidio_analyzer.nlp_engine import NlpArtifacts
logger = logging.getLogger("presidio-analyzer")
class BatchAnalyzerEngine:
"""
... | [
"presidio_analyzer.AnalyzerEngine",
"logging.getLogger",
"presidio_analyzer.DictAnalyzerResult"
] | [((242, 280), 'logging.getLogger', 'logging.getLogger', (['"""presidio-analyzer"""'], {}), "('presidio-analyzer')\n", (259, 280), False, 'import logging\n'), ((810, 826), 'presidio_analyzer.AnalyzerEngine', 'AnalyzerEngine', ([], {}), '()\n', (824, 826), False, 'from presidio_analyzer import DictAnalyzerResult, Recogni... |
#coding=utf-8
#调色板
import cv2
import numpy as np
img = np.zeros((300, 512, 3), np.uint8)
cv2.namedWindow('image')
def callback(x):
pass
#参数1:名称;参数2:作用窗口,参数3、4:最小值和最大值;参数5:值更改回调方法
cv2.createTrackbar('R', 'image', 0, 255, callback)
cv2.createTrackbar('G', 'image', 0, 255, callback)
cv2.createTrackbar('B', 'image... | [
"cv2.createTrackbar",
"cv2.waitKey",
"cv2.destroyAllWindows",
"numpy.zeros",
"cv2.getTrackbarPos",
"cv2.imshow",
"cv2.namedWindow"
] | [((56, 89), 'numpy.zeros', 'np.zeros', (['(300, 512, 3)', 'np.uint8'], {}), '((300, 512, 3), np.uint8)\n', (64, 89), True, 'import numpy as np\n'), ((90, 114), 'cv2.namedWindow', 'cv2.namedWindow', (['"""image"""'], {}), "('image')\n", (105, 114), False, 'import cv2\n'), ((188, 238), 'cv2.createTrackbar', 'cv2.createTr... |
import os
import sys
# import inspect
def main():
lib_directory = None
# All Python Version that will be searched
lib_major_version = 'lib_{}'.format(sys.version_info.major)
lib_minor_version = '{}.{}'.format(lib_major_version, sys.version_info.minor)
lib_micro_version = '{}.{}'.format(lib_minor_v... | [
"os.getcwd",
"os.path.isdir",
"os.walk",
"os.access",
"os.path.join",
"os.listdir",
"sys.exit"
] | [((400, 411), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (409, 411), False, 'import os\n'), ((427, 447), 'os.listdir', 'os.listdir', (['app_path'], {}), '(app_path)\n', (437, 447), False, 'import os\n'), ((1661, 1698), 'os.path.join', 'os.path.join', (['app_path', 'lib_directory'], {}), '(app_path, lib_directory)\n', ... |
import os
from irc_poker_data_set import IrcPokerData as ipd
basedir = os.path.abspath(os.path.dirname(__file__))
irc_poker_data = ipd()
irc_poker_data.open()
from irc_poker_db import db_session, PlayerRanking
def player_ranking():
if db_session.query(PlayerRanking).count() >= db_session.query(ipd.Player).cou... | [
"irc_poker_data_set.IrcPokerData.db_session.query",
"irc_poker_db.db_session.add",
"irc_poker_data_set.IrcPokerData",
"irc_poker_db.db_session.commit",
"os.path.dirname",
"irc_poker_db.db_session.query",
"irc_poker_db.PlayerRanking"
] | [((133, 138), 'irc_poker_data_set.IrcPokerData', 'ipd', ([], {}), '()\n', (136, 138), True, 'from irc_poker_data_set import IrcPokerData as ipd\n'), ((88, 113), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (103, 113), False, 'import os\n'), ((1506, 1525), 'irc_poker_db.db_session.commit', '... |
import os, sys
from importlib import import_module
sys.path += [os.getcwd()]
def get_params(params_file, import_path=""):
"""Extract the params object from a given Python file.
:param str params_file: the Python file to get the params object from.
:returns: the params object from the given Python file.... | [
"os.getcwd",
"importlib.import_module"
] | [((66, 77), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (75, 77), False, 'import os, sys\n'), ((440, 466), 'importlib.import_module', 'import_module', (['module_name'], {}), '(module_name)\n', (453, 466), False, 'from importlib import import_module\n')] |
from properties.models import AvailableLanguage
from django.test import TestCase
from django.core.exceptions import ObjectDoesNotExist
class TestLanguage(TestCase):
fixtures = ['properties_data.yaml']
def setUp(self):
self.non_exist_lang = "never_exist_lang"
self.lang_python = "Python"
... | [
"properties.models.AvailableLanguage.objects.get",
"properties.models.AvailableLanguage.objects.all"
] | [((657, 709), 'properties.models.AvailableLanguage.objects.get', 'AvailableLanguage.objects.get', ([], {'lang': 'self.lang_python'}), '(lang=self.lang_python)\n', (686, 709), False, 'from properties.models import AvailableLanguage\n'), ((970, 1020), 'properties.models.AvailableLanguage.objects.get', 'AvailableLanguage.... |
# -*- coding: utf-8 -*-
from .energydiagram import ED
import matplotlib.pyplot as plt
import re
ADJUSTEDCOEFFICIENT=0.02
def GetFrontIndex(orbSign):
# In: HOMO/LUMO/HOMO-1/LUMO+1
# Out: {'hoLu': 'HOMO', 'num': -1}
for matchString in [r'HOMO(.*)', r'LUMO(.*)']:
matchObj = re.match(matchString, orbSign)
... | [
"matplotlib.pyplot.close",
"re.match",
"matplotlib.pyplot.savefig"
] | [((9364, 9403), 'matplotlib.pyplot.savefig', 'plt.savefig', (["(fileName + '.png')"], {'dpi': '(300)'}), "(fileName + '.png', dpi=300)\n", (9375, 9403), True, 'import matplotlib.pyplot as plt\n'), ((9418, 9429), 'matplotlib.pyplot.close', 'plt.close', ([], {}), '()\n', (9427, 9429), True, 'import matplotlib.pyplot as p... |
from os import getenv
from pathlib import Path
import dj_database_url
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = getenv("DJANGO_SECRET_KEY")
DEBUG = getenv("DEBUG") == "true"
ALLOWED_HOSTS = ["*"]
AUTH_USER_MODEL = "users_app.CustomUser"
INSTALLED_APPS = [
"django.contrib.admin",
"d... | [
"pathlib.Path",
"os.getenv",
"dj_database_url.parse"
] | [((137, 164), 'os.getenv', 'getenv', (['"""DJANGO_SECRET_KEY"""'], {}), "('DJANGO_SECRET_KEY')\n", (143, 164), False, 'from os import getenv\n'), ((1776, 1798), 'os.getenv', 'getenv', (['"""DATABASE_URL"""'], {}), "('DATABASE_URL')\n", (1782, 1798), False, 'from os import getenv\n'), ((174, 189), 'os.getenv', 'getenv',... |
################################################################################
# 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... | [
"pyflink.table.EnvironmentSettings.in_batch_mode",
"pyflink.common.Configuration",
"pyflink.testing.test_case_utils.get_private_field",
"pyflink.table.EnvironmentSettings.in_streaming_mode",
"pyflink.table.EnvironmentSettings.from_configuration",
"pyflink.table.EnvironmentSettings.new_instance",
"pyflin... | [((1279, 1313), 'pyflink.table.EnvironmentSettings.new_instance', 'EnvironmentSettings.new_instance', ([], {}), '()\n', (1311, 1313), False, 'from pyflink.table import EnvironmentSettings\n'), ((1895, 1929), 'pyflink.table.EnvironmentSettings.new_instance', 'EnvironmentSettings.new_instance', ([], {}), '()\n', (1927, 1... |
from typing import Tuple, Any
from enum import Enum, IntFlag
from datetime import datetime
from collections import namedtuple
from collections.abc import Callable
GRC_TPS = 0x0000 # main return codes (identical to RC_SUP!!)
GRC_SUP = 0x0000 # supervisor task (identical to RCBETA!!)
GRC_ANG = 0x0100 # angle- and ... | [
"collections.namedtuple",
"datetime.datetime"
] | [((23265, 23308), 'collections.namedtuple', 'namedtuple', (['"""Coordinate"""', '"""east north head"""'], {}), "('Coordinate', 'east north head')\n", (23275, 23308), False, 'from collections import namedtuple\n'), ((23318, 23347), 'collections.namedtuple', 'namedtuple', (['"""Angles"""', '"""hz, v"""'], {}), "('Angles'... |
'''Code from python notebook by simoninithomas
available at https://github.com/simoninithomas/Deep_reinforcement_learning_Course/blob/master/Q%20learning/Q%20Learning%20with%20FrozenLake.ipynb
'''
import numpy as np
import gym
import random
env = gym.make("FrozenLake-v0")
action_size = env.action_space.n
state_siz... | [
"gym.make",
"numpy.argmax",
"random.uniform",
"numpy.zeros",
"numpy.max",
"numpy.exp"
] | [((252, 277), 'gym.make', 'gym.make', (['"""FrozenLake-v0"""'], {}), "('FrozenLake-v0')\n", (260, 277), False, 'import gym\n'), ((358, 393), 'numpy.zeros', 'np.zeros', (['(state_size, action_size)'], {}), '((state_size, action_size))\n', (366, 393), True, 'import numpy as np\n'), ((1299, 1319), 'random.uniform', 'rando... |
#!/usr/bin/env python3
#
# Play a game.
#
import raehutils
import sys, os, argparse, logging
class PlayPy(raehutils.RaehBaseClass):
ERR_MATCH = 1
def __init__(self):
retroarch_cores_dir = os.environ.get("HOME") + "/.config/retroarch/cores"
games_dir = os.environ.get("HOME") + "/media/games-lo... | [
"raehutils.run_shell_detached",
"raehutils.get_shell",
"argparse.ArgumentParser",
"os.environ.get"
] | [((2443, 2494), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Play a game."""'}), "(description='Play a game.')\n", (2466, 2494), False, 'import sys, os, argparse, logging\n'), ((4154, 4195), 'raehutils.get_shell', 'raehutils.get_shell', (['cmd_switch_workspace'], {}), '(cmd_switch_work... |
import tensorflow as tf
from tensorflow.keras.regularizers import l2
from tensorflow.keras.layers import Layer, Dense, LayerNormalization, Dropout, Embedding, Input, PReLU
from modules import *
from tensorflow import keras
from tensorflow.keras.models import Model
# api functional model
def get_sasrec(maxlen, item_fea... | [
"tensorflow.range",
"tensorflow.reduce_sum",
"tensorflow.not_equal",
"tensorflow.keras.layers.Dropout",
"tensorflow.keras.initializers.he_uniform",
"tensorflow.keras.layers.LayerNormalization",
"tensorflow.concat",
"tensorflow.nn.sigmoid",
"tensorflow.keras.models.Model",
"tensorflow.cast",
"ten... | [((559, 616), 'tensorflow.keras.layers.Input', 'Input', ([], {'shape': '(170,)', 'dtype': 'tf.float32', 'name': '"""user_inputs"""'}), "(shape=(170,), dtype=tf.float32, name='user_inputs')\n", (564, 616), False, 'from tensorflow.keras.layers import Layer, Dense, LayerNormalization, Dropout, Embedding, Input, PReLU\n'),... |
# -*- coding: utf-8 -*-
# Copyright (c) 2020 Nekokatt
#
# 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, me... | [
"hikari.utilities.event_stream._generate_weak_listener.assert_not_called",
"weakref.WeakMethod.assert_not_called",
"unittest.TestCase",
"tests.hikari.hikari_test_helpers.mock_class_namespace",
"hikari.iterators.LazyIterator.filter.assert_called_once_with",
"hikari.iterators.All",
"tests.hikari.hikari_te... | [((2311, 2327), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (2325, 2327), False, 'import pytest\n'), ((1397, 1427), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (1411, 1427), False, 'import pytest\n'), ((2355, 2376), 'mock.Mock', 'mock.Mock', (['bot.BotApp'], {}),... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | [
"pulumi.get",
"pulumi.getter",
"pulumi.set"
] | [((3575, 3608), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""accountName"""'}), "(name='accountName')\n", (3588, 3608), False, 'import pulumi\n'), ((3950, 3988), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""autoKeyConfigUrl"""'}), "(name='autoKeyConfigUrl')\n", (3963, 3988), False, 'import pulumi\n'), ((4... |
""" Cisco_IOS_XR_tunnel_nve_oper
This module contains a collection of YANG definitions
for Cisco IOS\-XR tunnel\-nve package operational data.
This module contains definitions
for the following management objects\:
nve\: NVE operational data
Copyright (c) 2013\-2016 by Cisco Systems, Inc.
All rights reserved.
""... | [
"ydk.errors.YPYModelError",
"ydk.types.YList"
] | [((1605, 1612), 'ydk.types.YList', 'YList', ([], {}), '()\n', (1610, 1612), False, 'from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64, FixedBitsDict\n'), ((10161, 10168), 'ydk.types.YList', 'YList', ([], {}), '()\n', (10166, 10168), False, 'from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64... |
import os.path
import numpy as np
from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize
from numpy import dot
from numpy.linalg import norm
class NotIntegerError(Exception):
pass
# 문서를 불러와 단어로 토큰화 후, 단어들을 word_list에 저장후 word_list 반환
def doc_tokenize(doc_name):
with open(doc_name, 'rt') as... | [
"numpy.log",
"numpy.linalg.norm",
"nltk.corpus.stopwords.words",
"numpy.dot",
"nltk.tokenize.word_tokenize"
] | [((369, 390), 'nltk.tokenize.word_tokenize', 'word_tokenize', (['string'], {}), '(string)\n', (382, 390), False, 'from nltk.tokenize import word_tokenize\n'), ((2598, 2624), 'nltk.corpus.stopwords.words', 'stopwords.words', (['"""english"""'], {}), "('english')\n", (2613, 2624), False, 'from nltk.corpus import stopword... |
# coding: utf-8
"""
CloudEndure API documentation
© 2017 CloudEndure All rights reserved # General Request authentication in CloudEndure's API is done using session cookies. A session cookie is returned upon successful execution of the \"login\" method. This value must then be provided within the request hea... | [
"six.iteritems"
] | [((9688, 9721), 'six.iteritems', 'six.iteritems', (['self.swagger_types'], {}), '(self.swagger_types)\n', (9701, 9721), False, 'import six\n')] |
"""
NCL_conwomap_2.py
=================
This script illustrates the following concepts:
- Drawing a simple filled contour plot
- Selecting a different color map
- Changing the size/shape of a contour plot
See following URLs to see the reproduced NCL plot & script:
- Original NCL script: https://www.ncl.uc... | [
"matplotlib.pyplot.show",
"geocat.viz.util.set_titles_and_labels",
"matplotlib.pyplot.axes",
"geocat.datafiles.get",
"matplotlib.pyplot.colorbar",
"matplotlib.pyplot.figure",
"geocat.viz.util.add_major_minor_ticks",
"numpy.linspace",
"cartopy.crs.PlateCarree"
] | [((1170, 1197), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(10, 6)'}), '(figsize=(10, 6))\n', (1180, 1197), True, 'import matplotlib.pyplot as plt\n'), ((1243, 1261), 'cartopy.crs.PlateCarree', 'ccrs.PlateCarree', ([], {}), '()\n', (1259, 1261), True, 'import cartopy.crs as ccrs\n'), ((1267, 1298), 'ma... |
# -*- coding: gbk -*-
path1 = u'K:\\选择删除\\' #所需修改文件夹所在路径
import os
import zhconv
for parent, dirnames, filenames in os.walk(path1):
for filename in filenames:
try:
os.rename(os.path.join(parent, filename), os.path.join(parent, zhconv.convert(filename, 'zh-cn')))
#print(zhconv.convert... | [
"os.walk",
"os.path.join",
"os.listdir",
"zhconv.convert"
] | [((116, 130), 'os.walk', 'os.walk', (['path1'], {}), '(path1)\n', (123, 130), False, 'import os, sys\n'), ((430, 447), 'os.listdir', 'os.listdir', (['path1'], {}), '(path1)\n', (440, 447), False, 'import os, sys\n'), ((198, 228), 'os.path.join', 'os.path.join', (['parent', 'filename'], {}), '(parent, filename)\n', (210... |
from itertools import count
import time
from ..core import np, auto_grad_logp, AUTOGRAD
from ..parallel import parallel
from ..progressbar import update_progress
from ..state import State, func_var_names
from ..model import init_model
class Sampler(object):
def __init__(self, logp, start,
grad_lo... | [
"itertools.count",
"time.time"
] | [((4233, 4244), 'time.time', 'time.time', ([], {}), '()\n', (4242, 4244), False, 'import time\n'), ((4487, 4498), 'time.time', 'time.time', ([], {}), '()\n', (4496, 4498), False, 'import time\n'), ((4187, 4209), 'itertools.count', 'count', ([], {'start': '(0)', 'step': '(1)'}), '(start=0, step=1)\n', (4192, 4209), Fals... |
import datetime
from flask_restx import Namespace, Resource, fields, marshal
from flask import request
from . import model
from .schedulerweb_util import get_db
api = Namespace('Zones', title="Zone management")
a_zone = api.model('Zone', {
'zone_id': fields.Integer(description="ID of zone"),
'name': fields... | [
"flask_restx.fields.Float",
"flask_restx.fields.Boolean",
"flask_restx.fields.Integer",
"flask_restx.fields.DateTime",
"flask_restx.Namespace",
"flask_restx.fields.String",
"datetime.timedelta",
"datetime.datetime.now",
"flask_restx.marshal"
] | [((170, 213), 'flask_restx.Namespace', 'Namespace', (['"""Zones"""'], {'title': '"""Zone management"""'}), "('Zones', title='Zone management')\n", (179, 213), False, 'from flask_restx import Namespace, Resource, fields, marshal\n'), ((260, 300), 'flask_restx.fields.Integer', 'fields.Integer', ([], {'description': '"""I... |
import os
import logging
import glob
import pathlib
import argparse
import multiprocessing as mp
import cv2
#import matplotlib.pyplot as plt
logging.basicConfig(
format="%(asctime)s: %(levelname)s: %(message)s", level=logging.INFO
)
def parse_arguments():
argparser = argparse.ArgumentParser(description=__doc... | [
"argparse.ArgumentParser",
"logging.basicConfig",
"os.makedirs",
"cv2.imwrite",
"cv2.imread",
"pathlib.Path",
"logging.info",
"multiprocessing.Process",
"os.path.join",
"cv2.resize",
"multiprocessing.cpu_count"
] | [((143, 237), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s: %(levelname)s: %(message)s"""', 'level': 'logging.INFO'}), "(format='%(asctime)s: %(levelname)s: %(message)s', level\n =logging.INFO)\n", (162, 237), False, 'import logging\n'), ((279, 323), 'argparse.ArgumentParser', 'argpa... |
import os, os.path as op
import logging
import numpy as np
import cv2
import progressbar
import ast
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import pprint
import PIL
from lib.backend import backendDb
from lib.backend import backendMedia
from lib.utils import util
def add_parsers(subparsers)... | [
"pprint.pformat",
"numpy.sum",
"numpy.maximum",
"numpy.argmax",
"matplotlib.pyplot.clf",
"numpy.isnan",
"matplotlib.pyplot.figure",
"lib.backend.backendDb.connect",
"matplotlib.pyplot.gca",
"numpy.diag",
"numpy.bitwise_or",
"matplotlib.pyplot.tight_layout",
"os.path.join",
"numpy.nanmean",... | [((4587, 4638), 'logging.info', 'logging.info', (['"""Total objects of interest: %d"""', 'n_gt'], {}), "('Total objects of interest: %d', n_gt)\n", (4599, 4638), False, 'import logging\n'), ((5041, 5054), 'numpy.cumsum', 'np.cumsum', (['fp'], {}), '(fp)\n', (5050, 5054), True, 'import numpy as np\n'), ((5064, 5077), 'n... |
import tensorflow as tf
"""
Instruction to the code there can be found at:
https://www.tensorflow.org/versions/r0.10/how_tos/using_gpu/index.html
"""
# Creates a graph.
with tf.device('/cpu:0'):
a = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[2, 3], name='a')
b = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.... | [
"tensorflow.matmul",
"tensorflow.device",
"tensorflow.constant",
"tensorflow.ConfigProto"
] | [((175, 194), 'tensorflow.device', 'tf.device', (['"""/cpu:0"""'], {}), "('/cpu:0')\n", (184, 194), True, 'import tensorflow as tf\n'), ((204, 271), 'tensorflow.constant', 'tf.constant', (['[1.0, 2.0, 3.0, 4.0, 5.0, 6.0]'], {'shape': '[2, 3]', 'name': '"""a"""'}), "([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[2, 3], name='a... |
""" Low level tests for the InvenTree API """
from rest_framework import status
from django.urls import reverse
from InvenTree.api_tester import InvenTreeAPITestCase
from users.models import RuleSet
from base64 import b64encode
class APITests(InvenTreeAPITestCase):
""" Tests for the InvenTree API """
fi... | [
"django.urls.reverse",
"base64.b64encode"
] | [((898, 918), 'django.urls.reverse', 'reverse', (['"""api-token"""'], {}), "('api-token')\n", (905, 918), False, 'from django.urls import reverse\n'), ((1263, 1283), 'django.urls.reverse', 'reverse', (['"""api-token"""'], {}), "('api-token')\n", (1270, 1283), False, 'from django.urls import reverse\n'), ((1678, 1707), ... |
#
#
#
#
# date: 2019-08-20
# author: <NAME>
# python3.6
# Copyright (C) 2019 <NAME> <EMAIL>
#
#import .deep_prior_inpainter as dp
#import .contextual_attention_gan as ca
#import .nearest_neighbours_inpainter as nn
from inpainters import (
deep_prior_inpainter as dp ,
contextual_attention_gan as ... | [
"inpainters.deep_prior_inpainter.DeepPrior",
"inpainters.nearest_neighbours_inpainter.NearestNeighbours",
"inpainters.contextual_attention_gan.ContextualAttention"
] | [((916, 984), 'inpainters.deep_prior_inpainter.DeepPrior', 'dp.DeepPrior', (['(Npix, Npix, 4)'], {'verbose': 'args.debug', 'meshgrid': 'meshgrid'}), '((Npix, Npix, 4), verbose=args.debug, meshgrid=meshgrid)\n', (928, 984), True, 'from inpainters import deep_prior_inpainter as dp, contextual_attention_gan as ca, nearest... |
from django.test import TestCase
from django.contrib.auth import get_user_model
from django.urls import reverse
from .models import Snack
# Create your tests here.
class SnacksTests(TestCase):
def setUp(self):
self.user = get_user_model().objects.create_user(
username = 'samer', email = '<EMA... | [
"django.urls.reverse",
"django.contrib.auth.get_user_model"
] | [((876, 897), 'django.urls.reverse', 'reverse', (['"""snack_list"""'], {}), "('snack_list')\n", (883, 897), False, 'from django.urls import reverse\n'), ((1059, 1093), 'django.urls.reverse', 'reverse', (['"""snack_details"""'], {'args': '"""1"""'}), "('snack_details', args='1')\n", (1066, 1093), False, 'from django.url... |
import factory
from sarafan.events import Publication
from .utils import generate_rnd_hash, generate_rnd_address
class PublicationFactory(factory.Factory):
class Meta:
model = Publication
reply_to = '0x'
magnet = factory.LazyFunction(lambda: generate_rnd_hash()[2:])
source = factory.LazyFunc... | [
"factory.LazyFunction"
] | [((304, 346), 'factory.LazyFunction', 'factory.LazyFunction', (['generate_rnd_address'], {}), '(generate_rnd_address)\n', (324, 346), False, 'import factory\n')] |
#!/usr/bin/env python
# Tests for `xclim` package, command line interface
from __future__ import annotations
import numpy as np
import pytest
import xarray as xr
from click.testing import CliRunner
import xclim
from xclim.cli import cli
from xclim.testing import open_dataset
try:
from dask.distributed import Cli... | [
"pytest.importorskip",
"xclim.atmos.tg",
"xclim.core.indicator.registry.items",
"xarray.open_dataset",
"numpy.zeros",
"numpy.ones",
"xarray.concat",
"xarray.Dataset",
"xarray.merge",
"numpy.arange",
"pytest.mark.parametrize",
"xclim.set_options",
"numpy.testing.assert_allclose",
"click.tes... | [((380, 547), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""indicators,indnames"""', "[([xclim.atmos.tg_mean], ['tg_mean']), ([xclim.atmos.tn_mean, xclim.atmos.\n ice_days], ['tn_mean', 'ice_days'])]"], {}), "('indicators,indnames', [([xclim.atmos.tg_mean], [\n 'tg_mean']), ([xclim.atmos.tn_mean, xc... |
from multiprocessing import Process, Queue
import os
import struct
import tempfile
import unittest
import random
from logging import getLogger
from nose.plugins.attrib import attr
from past.builtins import basestring
import cloudsigma.resource as cr
import cloudsigma.errors as errors
from testing.utils import DumpRes... | [
"os.remove",
"cloudsigma.resource.LibDrive",
"tempfile.mkstemp",
"cloudsigma.resumable_upload.Upload",
"testing.utils.DumpResponse",
"os.path.getsize",
"cloudsigma.resource.Server",
"random.randrange",
"multiprocessing.Queue",
"unittest.SkipTest",
"os.fdopen",
"multiprocessing.Process",
"clo... | [((397, 416), 'logging.getLogger', 'getLogger', (['__name__'], {}), '(__name__)\n', (406, 416), False, 'from logging import getLogger\n'), ((420, 443), 'nose.plugins.attrib.attr', 'attr', (['"""acceptance_test"""'], {}), "('acceptance_test')\n", (424, 443), False, 'from nose.plugins.attrib import attr\n'), ((8964, 8987... |
# rct_patch.py
#
# Author: jeFF0Falltrades
#
# A patching script for the Roller Coaster Tycoon (1999) game
# executable for play on modern systems at full resolution.
#
# Homepage with Video Tutorial:
# https://github.com/jeFF0Falltrades/Game-Patches/tree/master/rct_full_res
#
# MIT License
#
# Copyright (c) 2020 <NAME... | [
"os.path.isfile",
"argparse.ArgumentParser"
] | [((2088, 2323), 'argparse.ArgumentParser', 'ArgumentParser', ([], {'description': '"""Roller Coaster Tycoon (1999) Full Resolution Patch by jeFF0Falltrades\n\nHomepage: https://github.com/jeFF0Falltrades/Game-Patches/tree/master/rct_full_res"""', 'formatter_class': 'RawTextHelpFormatter'}), '(description=\n """Rolle... |
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QApplication, QWidget, QPushButton, QLabel, QListWidget, QLineEdit, QTextEdit, QInputDialog, QHBoxLayout, QVBoxLayout, QFormLayout
import json
app = QApplication([])
notes = {
"Добро пожаловать!" : {
"текст" : "Это самое лучшее приложени... | [
"PyQt5.QtWidgets.QLabel",
"json.dump",
"json.load",
"PyQt5.QtWidgets.QWidget",
"PyQt5.QtWidgets.QTextEdit",
"PyQt5.QtWidgets.QPushButton",
"PyQt5.QtWidgets.QLineEdit",
"PyQt5.QtWidgets.QHBoxLayout",
"PyQt5.QtWidgets.QInputDialog.getText",
"PyQt5.QtWidgets.QListWidget",
"PyQt5.QtWidgets.QVBoxLayo... | [((214, 230), 'PyQt5.QtWidgets.QApplication', 'QApplication', (['[]'], {}), '([])\n', (226, 230), False, 'from PyQt5.QtWidgets import QApplication, QWidget, QPushButton, QLabel, QListWidget, QLineEdit, QTextEdit, QInputDialog, QHBoxLayout, QVBoxLayout, QFormLayout\n'), ((490, 499), 'PyQt5.QtWidgets.QWidget', 'QWidget',... |
from unittest import TestCase
from unittest.mock import patch
from app.service.business_service import SuperMan
class TestSuperMan(TestCase):
@classmethod
def setUpClass(cls):
pass
@classmethod
def tearDownClass(cls):
pass
def setUp(self):
pass
def tearDown(self):
... | [
"unittest.mock.patch",
"app.service.business_service.SuperMan"
] | [((337, 426), 'unittest.mock.patch', 'patch', (['"""app.service.business_service.SuperMan._request_get"""'], {'return_value': '"""response"""'}), "('app.service.business_service.SuperMan._request_get', return_value=\n 'response')\n", (342, 426), False, 'from unittest.mock import patch\n'), ((492, 519), 'app.service.... |
#<NAME>
#<EMAIL>
#github.com/bksec
#####################################
###############RENKLER###############
#####################################
sifirla = '\033[0m'
beyaz = '\033[37m'
kirmizi= '\033[31m'
turuncu = '\u001b[38;5;208m'
yesil= '\033[32m'
sari= '\033[33m'
lacivert= '\033[34m'
pembe= '\033[35m'
mor = ... | [
"random.choice"
] | [((1881, 1909), 'random.choice', 'random.choice', (['rastgeleliste'], {}), '(rastgeleliste)\n', (1894, 1909), False, 'import random\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# <NAME> <<EMAIL>> <https://hanxiao.github.io>
import tensorflow as tf
initializer = tf.contrib.layers.variance_scaling_initializer(factor=1.0,
mode='FAN_AVG',
... | [
"tensorflow.reduce_sum",
"tensorflow.python.ops.array_ops.where",
"tensorflow.contrib.layers.l2_regularizer",
"tensorflow.gather_nd",
"tensorflow.clip_by_value",
"tensorflow.matmul",
"tensorflow.greater",
"tensorflow.get_variable",
"tensorflow.one_hot",
"tensorflow.nn.moments",
"tensorflow.gathe... | [((133, 243), 'tensorflow.contrib.layers.variance_scaling_initializer', 'tf.contrib.layers.variance_scaling_initializer', ([], {'factor': '(1.0)', 'mode': '"""FAN_AVG"""', 'uniform': '(True)', 'dtype': 'tf.float32'}), "(factor=1.0, mode='FAN_AVG',\n uniform=True, dtype=tf.float32)\n", (179, 243), True, 'import tenso... |
import shutil
import numpy as np
import pytest
import openmc
import openmc.capi
from tests import cdtemp
pytestmark = pytest.mark.skipif(
not openmc.capi._dagmc_enabled(),
reason="DAGMC CAD geometry is not enabled.")
@pytest.fixture(scope="module", autouse=True)
def dagmc_model(request):
model = open... | [
"openmc.model.Model",
"openmc.Material",
"openmc.capi.init",
"openmc.capi._dagmc_enabled",
"openmc.capi.finalize",
"pytest.fixture",
"openmc.CellFilter",
"tests.cdtemp",
"openmc.Source",
"openmc.stats.Box",
"openmc.Tally",
"pytest.mark.parametrize",
"shutil.copyfile",
"openmc.Materials"
] | [((232, 276), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""', 'autouse': '(True)'}), "(scope='module', autouse=True)\n", (246, 276), False, 'import pytest\n'), ((1665, 1751), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""cell_id,exp_temp"""', '((1, 320.0), (2, 300.0), (3, 293.6))'], {})... |
"""This script requires to launch a local ipcontroller. If you execute this
locally, do it with `ipcluster start`.
"""
import argparse
import glob
import logging
import os
import sys
import time
from ipyparallel import Client
from ipyparallel.util import interactive
logging.basicConfig(format='%(levelname)s: %(messag... | [
"ipyparallel.Client",
"os.path.abspath",
"argparse.ArgumentParser",
"logging.basicConfig",
"pandas.read_hdf",
"time.sleep",
"logging.info",
"sys.stdout.flush",
"os.path.join"
] | [((269, 345), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(levelname)s: %(message)s"""', 'level': 'logging.INFO'}), "(format='%(levelname)s: %(message)s', level=logging.INFO)\n", (288, 345), False, 'import logging\n'), ((518, 543), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '... |
import argparse
from EasyLaMa import TextRemover
from .util import load_image
from .util import load_images
import os
def get_args():
parser = argparse.ArgumentParser()
parser.add_argument("images", nargs="+", help="Images to process. Required")
parser.add_argument("-e", "--edge", type=int, default=1, help... | [
"os.makedirs",
"EasyLaMa.TextRemover",
"argparse.ArgumentParser",
"os.path.basename",
"os.path.join"
] | [((148, 173), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (171, 173), False, 'import argparse\n'), ((1590, 1647), 'EasyLaMa.TextRemover', 'TextRemover', ([], {'languages': 'args.languages', 'device': 'args.device'}), '(languages=args.languages, device=args.device)\n', (1601, 1647), False, 'f... |
from tqdm import tqdm
import numpy as np
import pandas as pd
from scipy.spatial.distance import cdist
from scipy.sparse import issparse
import numdifftools as nd
from multiprocessing.dummy import Pool as ThreadPool
import multiprocessing as mp
import itertools, functools
from ..tools.utils import timeit
def is_outsid... | [
"numdifftools.Hessdiag",
"numpy.trace",
"numpy.sum",
"scipy.sparse.issparse",
"numpy.einsum",
"numpy.ones",
"numdifftools.Gradient",
"numpy.arange",
"numpy.exp",
"numpy.matlib.tile",
"numpy.linalg.norm",
"numpy.unique",
"multiprocessing.cpu_count",
"numpy.atleast_2d",
"pandas.DataFrame",... | [((3391, 3400), 'numpy.exp', 'np.exp', (['K'], {}), '(K)\n', (3397, 3400), True, 'import numpy as np\n'), ((4647, 4672), 'numpy.matlib.tile', 'np.matlib.tile', (['x', '[n, 1]'], {}), '(x, [n, 1])\n', (4661, 4672), True, 'import numpy as np\n'), ((4805, 4829), 'numpy.zeros', 'np.zeros', (['(d * m, d * n)'], {}), '((d * ... |
"""
***************************************************************************
OshAdjustGradient.py
---------------------
Date : Nov 2020
Copyright : (C) 2020 by <NAME>
Email : <EMAIL> at g<EMAIL> dot <EMAIL>
************************************************... | [
"qgis.core.QgsProject.instance",
"qgis.core.QgsRendererCategory",
"qgis.core.QgsGeometryUtils.distanceToVertex",
"qgis.core.QgsField",
"qgis.core.QgsGeometry",
"qgis.core.QgsProcessingParameterFeatureSink",
"qgis.core.QgsFeature",
"qgis.core.QgsProcessingParameterNumber",
"qgis.core.QgsFields",
"q... | [((5879, 5890), 'qgis.core.QgsFields', 'QgsFields', ([], {}), '()\n', (5888, 5890), False, 'from qgis.core import QgsFeature, QgsField, QgsFields, QgsGeometry, QgsGeometryUtils, QgsProject, QgsProperty, QgsVectorLayer, QgsExpressionContextUtils, QgsLineSymbol, QgsRendererCategory, QgsCategorizedSymbolRenderer, QgsSpati... |
import codecs
import os.path
import setuptools
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
def read(rel_path):
here = os.path.abspath(os.path.dirname(__file__))
with codecs.open(os.path.join(here, rel_path), "r") as fp:
return fp.read()
def get_version(rel_... | [
"setuptools.find_packages"
] | [((1412, 1449), 'setuptools.find_packages', 'setuptools.find_packages', ([], {'where': '"""src"""'}), "(where='src')\n", (1436, 1449), False, 'import setuptools\n')] |
#!/usr/bin/env python
import json
import os
import sys
from jsonpath_ng import parse
from lxml import etree
SPEC_DIR = f"{os.path.dirname(os.path.realpath(__file__))}/../specification"
def main(file: str):
with open(file, 'r') as f:
spec = json.load(f)
req_path = parse("$.paths.['/$convert'].p... | [
"json.load",
"os.path.realpath",
"json.dumps",
"jsonpath_ng.parse",
"lxml.etree.parse",
"lxml.etree.tostring"
] | [((1127, 1164), 'jsonpath_ng.parse', 'parse', (['f"""$.{com_path}.value.[\'$ref\']"""'], {}), '(f"$.{com_path}.value.[\'$ref\']")\n', (1132, 1164), False, 'from jsonpath_ng import parse\n'), ((1560, 1580), 'lxml.etree.parse', 'etree.parse', (['content'], {}), '(content)\n', (1571, 1580), False, 'from lxml import etree\... |
bucketName = 'org.cicsnc.albedo'
basePath = 'Input/area/'
satellite = 'goes13'
year = '2017'
startDay = 1
endDay = 10
filterBand = 'BAND_01'
dryrun = False
import re
from os import fdopen, remove
from shutil import move
from tempfile import mkstemp
import boto3
def replace(file_path, pattern, subst):
fh, abs_pa... | [
"os.remove",
"tempfile.mkstemp",
"boto3.client",
"shutil.move",
"os.fdopen",
"re.sub"
] | [((1616, 1634), 'boto3.client', 'boto3.client', (['"""s3"""'], {}), "('s3')\n", (1628, 1634), False, 'import boto3\n'), ((2399, 2443), 'boto3.client', 'boto3.client', (['"""sqs"""'], {'region_name': '"""us-east-1"""'}), "('sqs', region_name='us-east-1')\n", (2411, 2443), False, 'import boto3\n'), ((325, 334), 'tempfile... |
# -*- coding:utf-8 -*-
# Copyright 2019 TEEX
#
# 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 ... | [
"threading.Thread.__init__",
"backend.dispatcher.request_dispatcher.RequestDispatcher",
"time.sleep"
] | [((794, 825), 'threading.Thread.__init__', 'threading.Thread.__init__', (['self'], {}), '(self)\n', (819, 825), False, 'import threading\n'), ((885, 911), 'backend.dispatcher.request_dispatcher.RequestDispatcher', 'RequestDispatcher', (['configs'], {}), '(configs)\n', (902, 911), False, 'from backend.dispatcher.request... |
from spack import *
from glob import glob
import os
class Tensorflow(Package):
"""TensorFlow is an Open Source Software Library for Machine Intelligence"""
homepage = "https://www.tensorflow.org"
url = "https://github.com/tensorflow/tensorflow/archive/v0.10.0.tar.gz"
version('2.0.0-alpha0', 'a26... | [
"glob.glob"
] | [((12544, 12647), 'glob.glob', 'glob', (['"""../bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/org_tensorflow/*"""'], {}), "(\n '../bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/org_tensorflow/*'\n )\n", (12548, 12647), False, 'from glob import glob\n'), ((12687, 12728), 'gl... |
#!/usr/bin/python
#
# Copyright (c) 2018 Amazon.com, Inc. or its affiliates. All Rights
# Reserved.
#
# Additional copyrights may follow
#
import boto3
import botocore
import sys
import re
import os
import json
import tarfile
import hashlib
from io import StringIO
import datetime
import u... | [
"unittest.main",
"sys.stdout.write",
"botocore.exceptions.ClientError",
"hashlib.md5",
"json.load",
"hashlib.sha1",
"os.stat",
"os.path.basename",
"mock.patch",
"json.dumps",
"hashlib.sha256",
"datetime.datetime.fromtimestamp",
"tarfile.open",
"posix.stat_result",
"re.search"
] | [((733, 746), 'hashlib.md5', 'hashlib.md5', ([], {}), '()\n', (744, 746), False, 'import hashlib\n'), ((758, 772), 'hashlib.sha1', 'hashlib.sha1', ([], {}), '()\n', (770, 772), False, 'import hashlib\n'), ((786, 802), 'hashlib.sha256', 'hashlib.sha256', ([], {}), '()\n', (800, 802), False, 'import hashlib\n'), ((9695, ... |
from ethereum import tester, vm
from ethereum.utils import sha3, encode_int32, safe_ord, encode_hex
from ethereum.state_transition import apply_message
s = tester.state()
c = s.contract('eip_96_blockhash_getter.se.py')
blockhash_addr = b'\x00' * 19 + b'\x10'
system_addr = b'\xff' * 19 + b'\xfe'
s.state.set_code(blockha... | [
"ethereum.utils.encode_int32",
"ethereum.vm.Message",
"ethereum.tester.state"
] | [((156, 170), 'ethereum.tester.state', 'tester.state', ([], {}), '()\n', (168, 170), False, 'from ethereum import tester, vm\n'), ((397, 483), 'ethereum.vm.Message', 'vm.Message', ([], {'sender': 'system_addr', 'to': 'blockhash_addr', 'value': '(0)', 'gas': '(1000000)', 'data': 'data'}), '(sender=system_addr, to=blockh... |
from django_docutils.lib.utils import chop_after_docinfo, chop_after_title
def test_chop_after_title():
content = """=============================================
Learn JavaScript for free: The best resources
=============================================
first section
-------------
some content
""".strip()
... | [
"django_docutils.lib.utils.chop_after_docinfo",
"django_docutils.lib.utils.chop_after_title"
] | [((330, 355), 'django_docutils.lib.utils.chop_after_title', 'chop_after_title', (['content'], {}), '(content)\n', (346, 355), False, 'from django_docutils.lib.utils import chop_after_docinfo, chop_after_title\n'), ((794, 820), 'django_docutils.lib.utils.chop_after_docinfo', 'chop_after_docinfo', (['before'], {}), '(bef... |
# to run this test, from directory above:
# setenv PYTHONPATH /path/to/pyradiomics/radiomics
# nosetests --nocapture -v tests/test_docstrings.py
import logging
from nose_parameterized import parameterized
import six
from radiomics import getFeatureClasses
from testUtils import custom_name_func
featureClasses = getF... | [
"logging.info",
"six.iteritems",
"radiomics.getFeatureClasses"
] | [((316, 335), 'radiomics.getFeatureClasses', 'getFeatureClasses', ([], {}), '()\n', (333, 335), False, 'from radiomics import getFeatureClasses\n'), ((1027, 1056), 'six.iteritems', 'six.iteritems', (['featureClasses'], {}), '(featureClasses)\n', (1040, 1056), False, 'import six\n'), ((1490, 1521), 'logging.info', 'logg... |
"""Device RabbitMQ messages module."""
import json
import logging
import time
import pika
from fm_server.settings import get_config
LOGGER = logging.getLogger("fm.device.rabbitmq")
def get_connection(config=None):
"""This method connects to RabbitMQ, returning the connection handle.
When th... | [
"pika.PlainCredentials",
"pika.ConnectionParameters",
"logging.getLogger",
"time.sleep",
"json.dumps",
"pika.BasicProperties",
"fm_server.settings.get_config",
"pika.BlockingConnection"
] | [((153, 192), 'logging.getLogger', 'logging.getLogger', (['"""fm.device.rabbitmq"""'], {}), "('fm.device.rabbitmq')\n", (170, 192), False, 'import logging\n'), ((750, 787), 'pika.PlainCredentials', 'pika.PlainCredentials', (['user', 'password'], {}), '(user, password)\n', (771, 787), False, 'import pika\n'), ((802, 899... |
import pytest
import re
from pytest_mock import mocker
import flask
import flask.sessions
from flask_dynamodb_sessions import Session
def test_session_boto_settings(mocker):
client_mock = mocker.patch('flask_dynamodb_sessions.boto3.client')
app = flask.Flask(__name__)
app.config.update(
SESSION... | [
"flask.Flask",
"pytest_mock.mocker.spy",
"pytest_mock.mocker.patch",
"flask.make_response",
"flask_dynamodb_sessions.Session"
] | [((195, 247), 'pytest_mock.mocker.patch', 'mocker.patch', (['"""flask_dynamodb_sessions.boto3.client"""'], {}), "('flask_dynamodb_sessions.boto3.client')\n", (207, 247), False, 'from pytest_mock import mocker\n'), ((259, 280), 'flask.Flask', 'flask.Flask', (['__name__'], {}), '(__name__)\n', (270, 280), False, 'import ... |
import os
import sys
import unittest
sys.path.insert(0, os.path.abspath('..'))
from uplink.add_entry import add_entry
class TestAddEntry(unittest.TestCase):
def test_one_one(self):
self.assertEqual(1 + 1, 2)
if __name__ == '__main__':
unittest.main()
| [
"unittest.main",
"os.path.abspath"
] | [((57, 78), 'os.path.abspath', 'os.path.abspath', (['""".."""'], {}), "('..')\n", (72, 78), False, 'import os\n'), ((255, 270), 'unittest.main', 'unittest.main', ([], {}), '()\n', (268, 270), False, 'import unittest\n')] |
"""
PyCLES
Desc: This is an implementation of the Common Language Effect Size (CLES) in Python
Author: <NAME>
Date: 04/05/20
"""
import numpy as np
from scipy.stats import norm
def nonparametric_cles(a, b, half_credit=True) -> float:
"""Nonparametric solver for the common language effect size. This solves
... | [
"numpy.subtract.outer",
"scipy.stats.norm.cdf",
"numpy.where",
"numpy.mean",
"numpy.sign",
"numpy.sqrt"
] | [((789, 812), 'numpy.subtract.outer', 'np.subtract.outer', (['a', 'b'], {}), '(a, b)\n', (806, 812), True, 'import numpy as np\n'), ((821, 831), 'numpy.sign', 'np.sign', (['m'], {}), '(m)\n', (828, 831), True, 'import numpy as np\n'), ((902, 925), 'numpy.where', 'np.where', (['(m == -1)', '(0)', 'm'], {}), '(m == -1, 0... |
#!/usr/bin/env python
try:
from debian.changelog import Changelog
except ImportError:
class Changelog(object):
def __init__(self, _):
pass
def get_version(self):
return '0.0.0'
from os import environ
from os.path import abspath, dirname, join
from setuptools import setu... | [
"os.path.dirname",
"os.path.join",
"setuptools.find_packages"
] | [((384, 414), 'os.path.join', 'join', (['here', '"""debian/changelog"""'], {}), "(here, 'debian/changelog')\n", (388, 414), False, 'from os.path import abspath, dirname, join\n'), ((353, 370), 'os.path.dirname', 'dirname', (['__file__'], {}), '(__file__)\n', (360, 370), False, 'from os.path import abspath, dirname, joi... |
from pydevd_constants import * #@UnusedWildImport
from pydevd_file_utils import GetFilenameAndBase
from _pydev_imps import _pydev_thread
threadingCurrentThread = threading.currentThread
DEBUG = False
#====================================================================================================================... | [
"traceback.print_exc",
"_pydev_imps._pydev_thread.allocate_lock",
"pydevd_file_utils.GetFilenameAndBase"
] | [((659, 688), '_pydev_imps._pydev_thread.allocate_lock', '_pydev_thread.allocate_lock', ([], {}), '()\n', (686, 688), False, 'from _pydev_imps import _pydev_thread\n'), ((3629, 3650), 'traceback.print_exc', 'traceback.print_exc', ([], {}), '()\n', (3648, 3650), False, 'import traceback\n'), ((2756, 2781), 'pydevd_file_... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (c) 2016 Juniper Networks, Inc. All rights reserved.
#
"""
CNI implementation
Demultiplexes on the CNI_COMMAND and runs the necessary operation
"""
import ctypes
import errno
import inspect
import json
import os
import sys
import logging
from pyroute2 import ... | [
"cni.Error",
"os.getpid",
"interface.CniNamespace",
"interface.Interface.__init__",
"pyroute2.IPRoute"
] | [((1153, 1164), 'os.getpid', 'os.getpid', ([], {}), '()\n', (1162, 1164), False, 'import os\n'), ((1337, 1369), 'interface.Interface.__init__', 'CniInterface.__init__', (['self', 'cni'], {}), '(self, cni)\n', (1358, 1369), True, 'from interface import Interface as CniInterface\n'), ((6830, 6839), 'pyroute2.IPRoute', 'I... |
# Author: Yubo "Paul" Yang
# Email: <EMAIL>
# Kyrt is a versatile fabric exclusive to the planet Florina of Sark.
# The fluorescent and mutable kyrt is ideal for artsy decorations.
# OK, this is a library of reasonable defaults for matplotlib figures.
# May this library restore elegance to your plots.
import matplotli... | [
"matplotlib.cm.get_cmap",
"numpy.argsort",
"matplotlib.pyplot.figure",
"numpy.arange",
"numpy.diag",
"matplotlib.pyplot.Normalize",
"matplotlib.lines.Line2D",
"sklearn.gaussian_process.kernels.DotProduct",
"matplotlib.pyplot.setp",
"matplotlib.pyplot.colorbar",
"matplotlib.pyplot.cm.ScalarMappab... | [((573, 592), 'matplotlib.cm.get_cmap', 'get_cmap', (['"""viridis"""'], {}), "('viridis')\n", (581, 592), False, 'from matplotlib.cm import get_cmap\n'), ((1409, 1426), 'matplotlib.cm.get_cmap', 'cm.get_cmap', (['name'], {}), '(name)\n', (1420, 1426), False, 'from matplotlib import cm\n'), ((1688, 1713), 'matplotlib.py... |
from django.utils.translation import ugettext_lazy as _
from mayan.apps.task_manager.classes import CeleryQueue
from mayan.apps.task_manager.workers import worker_d
queue_tools = CeleryQueue(label=_('Tools'), name='tools', worker=worker_d)
| [
"django.utils.translation.ugettext_lazy"
] | [((204, 214), 'django.utils.translation.ugettext_lazy', '_', (['"""Tools"""'], {}), "('Tools')\n", (205, 214), True, 'from django.utils.translation import ugettext_lazy as _\n')] |
# this project is licensed under the WTFPLv2, see COPYING.txt for details
"""Helpers for lexer use
In EYE, builtin lexers from QScintilla are used. See :any:`PyQt5.Qsci.QsciLexer`.
"""
import mimetypes
from PyQt5.QtGui import QColor, QFont
from PyQt5.Qsci import (
QsciLexerBash, QsciLexerBatch, QsciLexerCPP, QsciL... | [
"mimetypes.guess_extension",
"PyQt5.QtGui.QFont",
"PyQt5.QtGui.QColor"
] | [((2829, 2860), 'mimetypes.guess_extension', 'mimetypes.guess_extension', (['mime'], {}), '(mime)\n', (2854, 2860), False, 'import mimetypes\n'), ((1252, 1269), 'PyQt5.QtGui.QColor', 'QColor', (['values[0]'], {}), '(values[0])\n', (1258, 1269), False, 'from PyQt5.QtGui import QColor, QFont\n'), ((1313, 1330), 'PyQt5.Qt... |
#! /usr/bin/env python
# coding=utf-8
# Copyright (c) 2021 Graphcore Ltd. All Rights Reserved.
# Copyright (c) 2019 YunYang1994 <<EMAIL>>
# License: MIT (https://opensource.org/licenses/MIT)
# This file has been modified by Graphcore Ltd.
import argparse
import json
import math
import os
import shutil
import time
imp... | [
"os.mkdir",
"argparse.ArgumentParser",
"tensorflow.python.ipu.config.IPUConfig",
"core.utils.nms",
"tensorflow.ConfigProto",
"shutil.rmtree",
"core.utils.read_class_names",
"core.utils.postprocess_boxes",
"tensorflow.train.ExponentialMovingAverage",
"numpy.copy",
"cv2.imwrite",
"os.path.exists... | [((14187, 14266), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""evaluation in TensorFlow"""', 'add_help': '(False)'}), "(description='evaluation in TensorFlow', add_help=False)\n", (14210, 14266), False, 'import argparse\n'), ((781, 828), 'core.utils.read_class_names', 'utils.read_class... |
"""
MIT License
Copyright (c) 2020
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, publish, distribute, s... | [
"autohyper.HyperParameters",
"torchvision.models.resnet18",
"autohyper.optimize",
"torch.nn.CrossEntropyLoss",
"pathlib.Path",
"numpy.mean",
"torch.no_grad",
"torchvision.transforms.ToTensor"
] | [((2854, 2897), 'autohyper.HyperParameters', 'HyperParameters', ([], {'lr': '(True)', 'weight_decay': '(True)'}), '(lr=True, weight_decay=True)\n', (2869, 2897), False, 'from autohyper import optimize, LowRankMetrics, HyperParameters\n'), ((2913, 2985), 'autohyper.optimize', 'optimize', ([], {'epoch_trainer': 'epoch_tr... |
from discord.ext import commands
from discord.ext.commands.cooldowns import BucketType
from mojang import MojangAPI as Mojang
from pyosu import OsuApi
import discord
import pyosu
from custom_funcs import embed_create, is_uuid4
def sync_minecraft(ctx, account):
try:
if is_uuid4(account):
... | [
"discord.utils.escape_markdown",
"discord.ext.commands.command",
"mojang.MojangAPI.get_profile",
"mojang.MojangAPI.get_uuid",
"discord.ext.commands.cooldown",
"custom_funcs.is_uuid4",
"pyosu.OsuApi",
"custom_funcs.embed_create",
"mojang.MojangAPI.get_name_history"
] | [((877, 927), 'custom_funcs.embed_create', 'embed_create', (['ctx'], {'title': '"""Minecraft account info:"""'}), "(ctx, title='Minecraft account info:')\n", (889, 927), False, 'from custom_funcs import embed_create, is_uuid4\n'), ((2698, 2738), 'discord.ext.commands.cooldown', 'commands.cooldown', (['(1)', '(5)', 'Buc... |
import math
# Nb grid square
GRID_WIDTH = 10
GRID_HEIGHT = 10
# Absolute size of a grid square
GRIDSIZE = 20
# Size of window
SCREEN_WIDTH = GRID_WIDTH * GRIDSIZE
SCREEN_HEIGHT = GRID_HEIGHT * GRIDSIZE
UP = (0, -1)
DOWN = (0, 1)
LEFT = (-1, 0)
RIGHT = (1, 0)
# Returns true if a and b have same signs
def same_sign(... | [
"math.sqrt"
] | [((997, 1047), 'math.sqrt', 'math.sqrt', (['((a[0] - b[0]) ** 2 + (a[1] - b[1]) ** 2)'], {}), '((a[0] - b[0]) ** 2 + (a[1] - b[1]) ** 2)\n', (1006, 1047), False, 'import math\n')] |
# Generated by Django 3.1.5 on 2021-04-27 15:28
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('video', '0002_auto_20210427_1508'),
]
operations = [
migrations.AlterField(
model_name='video',
name='views',
... | [
"django.db.models.IntegerField"
] | [((332, 390), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'default': '(0)', 'verbose_name': '"""Views count"""'}), "(default=0, verbose_name='Views count')\n", (351, 390), False, 'from django.db import migrations, models\n')] |
import asyncio
from datetime import datetime
from itertools import combinations
import json
import glob
import os
import time
from typing import Optional, Tuple
import re
import sys
from aiohttp.client import ClientSession, TCPConnector
import redis
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/..")
... | [
"core.async_write.write_data",
"aiohttp.client.TCPConnector",
"json.dumps",
"asyncio.as_completed",
"os.path.join",
"core.async_queue.get_queue",
"redis.Redis",
"core.utils.set_arb",
"os.path.abspath",
"json.loads",
"core.async_queue.worker",
"uvloop.EventLoopPolicy",
"re.sub",
"core.utils... | [((794, 824), 'core.logger.rabbit_logger', 'logger.rabbit_logger', (['__name__'], {}), '(__name__)\n', (814, 824), False, 'from core import logger\n'), ((752, 776), 'uvloop.EventLoopPolicy', 'uvloop.EventLoopPolicy', ([], {}), '()\n', (774, 776), False, 'import uvloop\n'), ((1374, 1424), 'os.path.join', 'os.path.join',... |
# Simple tb logger
import torch
from exp import ex
'''
geometry_normalizer = {
'cartesian': 4, # [0,1]x[0,1]x[0,1]x[0,1]
'angular': 98.696, # [-pi,pi]x[-.5pi,.5pi]x[0,2pi]x[0,pi]
'spherical': 61.348, # [-1,1]x[-1,1]x[-1,1]x[0,2pi]x[0,pi]
'quaternion': 17 # [0,1]x[-1,1]x[-1,1]x[0,2]x[0,2]
... | [
"exp.ex.capture"
] | [((1216, 1228), 'exp.ex.capture', 'ex.capture', ([], {}), '()\n', (1226, 1228), False, 'from exp import ex\n')] |
from time import time
def main():
start = time()
target = 200
ways = 0
for a in range(target, -1, -200):
for b in range(a, -1, -100):
for c in range(b, -1, -50):
for d in range(c, -1, -20):
for e in range(d, -1, -10):
fo... | [
"time.time"
] | [((48, 54), 'time.time', 'time', ([], {}), '()\n', (52, 54), False, 'from time import time\n'), ((473, 479), 'time.time', 'time', ([], {}), '()\n', (477, 479), False, 'from time import time\n')] |
# Copyright (c) 2015, <NAME>
import os
from tap.main import main
from tap.tests import TestCase
class TestMain(TestCase):
"""Tests for tap.main.main"""
def test_exits_with_error(self):
"""The main function returns an error status if there were failures."""
argv = ['/bin/fake', 'fake.tap']
... | [
"tap.main.main"
] | [((376, 401), 'tap.main.main', 'main', (['argv'], {'stream': 'stream'}), '(argv, stream=stream)\n', (380, 401), False, 'from tap.main import main\n')] |