code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
"""
Author: <NAME> and <NAME>
E-mail author: <EMAIL>
Last Modified: May 7 2020
"""
import math
import pandas as pd
import motmetrics as mm
import numpy as np
from collections import defaultdict
from Metrics import Metrics
"""
Create individual metrics class for new challenge. The new metrics class inherits functiona... | [
"motmetrics.MOTAccumulator",
"numpy.log10",
"numpy.asarray",
"numpy.zeros",
"motmetrics.metrics.create",
"numpy.linalg.norm",
"math.isnan"
] | [((8546, 8578), 'motmetrics.MOTAccumulator', 'mm.MOTAccumulator', ([], {'auto_id': '(False)'}), '(auto_id=False)\n', (8563, 8578), True, 'import motmetrics as mm\n'), ((13173, 13197), 'numpy.zeros', 'np.zeros', (['(X_ele, Y_ele)'], {}), '((X_ele, Y_ele))\n', (13181, 13197), True, 'import numpy as np\n'), ((13660, 13679... |
import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config(object):
MENTALUS_TITLE = 'MentalUs'
SECRET_KEY = '123456'
SQLALCHEMY_COMMIT_ON_TEARDOWN = True
@staticmethod
def init_app(app):
pass
class DevConfig(Config):
DEBUG = True
SQLALCHEMY_DATABASE_URI = 'sqli... | [
"os.path.dirname",
"os.path.join"
] | [((36, 61), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (51, 61), False, 'import os\n'), ((330, 365), 'os.path.join', 'os.path.join', (['basedir', '"""dev.sqlite"""'], {}), "(basedir, 'dev.sqlite')\n", (342, 365), False, 'import os\n'), ((445, 481), 'os.path.join', 'os.path.join', (['based... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-05-22 05:34
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('resume', '0015_auto_20170512_0749'),
]
operations = [
migrations.RemoveField(
model_name='resume',
... | [
"django.db.migrations.RemoveField"
] | [((252, 311), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""resume"""', 'name': '"""company"""'}), "(model_name='resume', name='company')\n", (274, 311), False, 'from django.db import migrations\n'), ((356, 419), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], ... |
from geopy import distance
from tracardi.service.plugin.domain.register import Plugin, Spec, MetaData, Documentation, PortDoc, Form, FormGroup, \
FormField, FormComponent
from tracardi.service.plugin.runner import ActionRunner
from tracardi.service.plugin.domain.result import Result
from .model.configuration import... | [
"tracardi.service.plugin.domain.register.PortDoc",
"tracardi.service.plugin.domain.register.FormComponent",
"geopy.distance.distance",
"tracardi.service.plugin.domain.result.Result"
] | [((966, 1055), 'tracardi.service.plugin.domain.result.Result', 'Result', ([], {'port': '"""payload"""', 'value': "{'inside': distance_from_center <= self.config.radius}"}), "(port='payload', value={'inside': distance_from_center <= self.config\n .radius})\n", (972, 1055), False, 'from tracardi.service.plugin.domain.... |
# -*- coding: utf-8 -*-
import unittest
import sys
import os
import multiprocessing
import tempfile
import time
import random
import numpy as np
if __name__ == '__main__':
# add ../.. directory to python path such that we can import the main
# module
HERE = os.path.dirname(os.path.realpath(__file__))
... | [
"numpy.all",
"sys.path.insert",
"numpy.random.random",
"unittest.TextTestRunner",
"multiprocessing.Process",
"os.path.join",
"time.sleep",
"os.path.realpath",
"tempfile.gettempdir",
"numpy.empty",
"random.random",
"h5pyswmr.File",
"unittest.TestLoader"
] | [((382, 411), 'sys.path.insert', 'sys.path.insert', (['(0)', 'PROJ_PATH'], {}), '(0, PROJ_PATH)\n', (397, 411), False, 'import sys\n'), ((289, 315), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (305, 315), False, 'import os\n'), ((349, 376), 'os.path.join', 'os.path.join', (['HERE', '""".... |
import time
import logging
from ..data_asset import DataAsset
from ..dataset import Dataset
from great_expectations.exceptions import GreatExpectationsError
logger = logging.getLogger(__name__)
class DataAssetProfiler(object):
@classmethod
def validate(cls, data_asset):
return isinstance(data_asset,... | [
"logging.getLogger",
"time.time",
"great_expectations.exceptions.GreatExpectationsError"
] | [((168, 195), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (185, 195), False, 'import logging\n'), ((1046, 1057), 'time.time', 'time.time', ([], {}), '()\n', (1055, 1057), False, 'import time\n'), ((1525, 1592), 'great_expectations.exceptions.GreatExpectationsError', 'GreatExpectationsE... |
#!/usr/bin/env python
# Created by <NAME>
# https://github.com/ImreSamu/natural-earth-vector-qa
#
from SPARQLWrapper import SPARQLWrapper, SPARQLExceptions, JSON
from urllib.error import URLError, HTTPError
from sys import argv
import argparse
import datetime
import editdistance
import fiona
import jellyfish
im... | [
"sqlite3.connect",
"argparse.ArgumentParser",
"SPARQLWrapper.SPARQLWrapper",
"time.sleep",
"datetime.datetime.now",
"fiona.open",
"sys.exit",
"os.system",
"sys.stdout.flush"
] | [((479, 558), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Search Natural-Earth places in Wikidata."""'}), "(description='Search Natural-Earth places in Wikidata.')\n", (502, 558), False, 'import argparse\n'), ((2180, 2220), 'os.system', 'os.system', (["('rm -f ' + args.database_name)"... |
from scipy.misc import comb
import math
def ensemble_error(n_classifier, error):
k_start = int(math.ceil(n_classifier / 2.))
probs = [comb(n_classifier, k) * error ** k * (1 - error) ** (n_classifier - k)
for k in range(k_start, n_classifier + 1)]
return sum(probs)
import numpy as np
error... | [
"matplotlib.pyplot.grid",
"math.ceil",
"scipy.misc.comb",
"numpy.arange",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.show"
] | [((329, 355), 'numpy.arange', 'np.arange', (['(0.0)', '(1.01)', '(0.01)'], {}), '(0.0, 1.01, 0.01)\n', (338, 355), True, 'import numpy as np\n'), ((489, 559), 'matplotlib.pyplot.plot', 'plt.plot', (['error_range', 'ens_errors'], {'label': '"""Ensemble error"""', 'linewidth': '(2)'}), "(error_range, ens_errors, label='E... |
# Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | [
"numpy.prod",
"nnunet.training.loss_functions.dice_loss.DC_and_CE_loss",
"torch.rand",
"torch.nn.ModuleList",
"monai.networks.nets.ViT",
"monai.networks.blocks.UnetrPrUpBlock",
"monai.networks.blocks.UnetrUpBlock",
"numpy.array",
"torch.no_grad",
"nnunet.network_architecture.generic_modular_UNet.g... | [((16605, 16678), 'nnunet.training.loss_functions.dice_loss.DC_and_CE_loss', 'DC_and_CE_loss', (["{'batch_dice': True, 'smooth': 1e-05, 'do_bg': False}", '{}'], {}), "({'batch_dice': True, 'smooth': 1e-05, 'do_bg': False}, {})\n", (16619, 16678), False, 'from nnunet.training.loss_functions.dice_loss import DC_and_CE_lo... |
"""
DANet for image segmentation, implemented in Chainer.
Original paper: 'Dual Attention Network for Scene Segmentation,' https://arxiv.org/abs/1809.02983.
"""
__all__ = ['DANet', 'danet_resnetd50b_cityscapes', 'danet_resnetd101b_cityscapes']
import os
import chainer.functions as F
from chainer import link
... | [
"chainer.functions.max",
"chainer.functions.batch_matmul",
"os.path.join",
"chainer.functions.softmax",
"numpy.zeros",
"functools.partial",
"chainer.functions.resize_images",
"chainer.initializers._get_initializer",
"chainer.variable.Parameter"
] | [((8388, 8427), 'os.path.join', 'os.path.join', (['"""~"""', '""".chainer"""', '"""models"""'], {}), "('~', '.chainer', 'models')\n", (8400, 8427), False, 'import os\n'), ((2543, 2592), 'chainer.functions.batch_matmul', 'F.batch_matmul', (['proj_query', 'proj_key'], {'transa': '(True)'}), '(proj_query, proj_key, transa... |
from setuptools import setup
with open("README.md", "r") as fh:
long_description = fh.read()
APP = ['src/clippy.py']
DATA_FILES = []
OPTIONS = {
'iconfile': 'clipboard.icns'
}
setup(
name="clippy",
version="0.0.1",
author="<NAME>",
author_email="<EMAIL>",
description="Clipboard manager us... | [
"setuptools.setup"
] | [((187, 829), 'setuptools.setup', 'setup', ([], {'name': '"""clippy"""', 'version': '"""0.0.1"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'description': '"""Clipboard manager using tkinter"""', 'python_requires': '""">=3.6.0"""', 'long_description': 'long_description', 'url': '"""https://github.com/... |
from __future__ import absolute_import, division, print_function, unicode_literals
import os
import subprocess
from caffe2.proto import caffe2_pb2
from caffe2.python import core, workspace
def create_blobs_if_not_existed(blob_names):
existd_names = set(workspace.Blobs())
for xx in blob_names:
if xx n... | [
"caffe2.proto.caffe2_pb2.NetDef",
"caffe2.python.workspace.Blobs",
"subprocess.check_call"
] | [((428, 514), 'subprocess.check_call', 'subprocess.check_call', (["['adb', 'push', net_file, '/data/local/tmp/predict_net.pb']"], {}), "(['adb', 'push', net_file,\n '/data/local/tmp/predict_net.pb'])\n", (449, 514), False, 'import subprocess\n'), ((515, 600), 'subprocess.check_call', 'subprocess.check_call', (["['ad... |
# -*- coding: utf-8 -*-
import unittest
from .context import pytools_command
class TestSimpleCalls(unittest.TestCase):
def test_exec_command(self):
result = pytools_command.exec_command(['echo 1'], shell=True)
self.assertTrue(result.success())
self.assertFalse(result.failure())
def... | [
"unittest.main"
] | [((541, 556), 'unittest.main', 'unittest.main', ([], {}), '()\n', (554, 556), False, 'import unittest\n')] |
from __future__ import absolute_import
import os
import re
import tempfile
import slugify
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
from django.core import management
from django.core.files.uploadedfile import SimpleUploadedFile
from django.db import models
from d... | [
"StringIO.StringIO",
"django.utils.translation.ugettext_lazy",
"os.extsep.join",
"django.core.management.call_command",
"os.close",
"re.compile",
"django.utils.timezone.now",
"os.unlink",
"tempfile.mkstemp",
"slugify.slugify"
] | [((1846, 1864), 'tempfile.mkstemp', 'tempfile.mkstemp', ([], {}), '()\n', (1862, 1864), False, 'import tempfile\n'), ((1934, 1950), 'os.close', 'os.close', (['handle'], {}), '(handle)\n', (1942, 1950), False, 'import os\n'), ((2146, 2156), 'StringIO.StringIO', 'StringIO', ([], {}), '()\n', (2154, 2156), False, 'from St... |
import sc2
from task.micro.entire_army import *
from task.macro.zerg_unit import *
from task.macro.zerg_building import *
from decider.random_decider import *
from decider.zerg_macro_decider import ZergMacroDecider
# steps before old task times out and new task is chosen
MACRO_TIMEOUT = 500
# number of skipped steps ... | [
"decider.zerg_macro_decider.ZergMacroDecider"
] | [((638, 660), 'decider.zerg_macro_decider.ZergMacroDecider', 'ZergMacroDecider', (['self'], {}), '(self)\n', (654, 660), False, 'from decider.zerg_macro_decider import ZergMacroDecider\n')] |
#from mmseg.apis import inference_segmentor, init_segmentor, show_result_pyplot
from mmseg.core.evaluation import get_palette
import mmcv
from mmcv import Config
import matplotlib.pyplot as plt
import os.path as osp
import numpy as np
from PIL import Image
from mmcv.utils import print_log
from mmseg.datasets.builder im... | [
"mmcv.Config.fromfile",
"os.path.abspath",
"mmseg.datasets.build_dataset",
"mmseg.apis.set_random_seed"
] | [((828, 856), 'mmcv.Config.fromfile', 'Config.fromfile', (['config_file'], {}), '(config_file)\n', (843, 856), False, 'from mmcv import Config\n'), ((1885, 1924), 'mmseg.apis.set_random_seed', 'set_random_seed', (['(0)'], {'deterministic': '(False)'}), '(0, deterministic=False)\n', (1900, 1924), False, 'from mmseg.apis... |
import os
import sys
import math
import api_check
class Project:
def __init__(self, path_prefix, filename, full_set):
self.path = path_prefix + '/' + filename
self.name = filename.split(".capi.dat")[0]
print("===== " + self.name + " =====")
self.full_set = full_set
def get_dat... | [
"api_check.Macro",
"os.listdir",
"api_check.pycapi_comp.Python"
] | [((3348, 3371), 'os.listdir', 'os.listdir', (['path_prefix'], {}), '(path_prefix)\n', (3358, 3371), False, 'import os\n'), ((2054, 2096), 'api_check.pycapi_comp.Python', 'api_check.pycapi_comp.Python', (['self.py_path'], {}), '(self.py_path)\n', (2082, 2096), False, 'import api_check\n'), ((1995, 2027), 'api_check.Macr... |
#!/usr/bin/env python
import sys
from cbapi.response.models import Process, Binary
from cbapi.example_helpers import build_cli_parser, get_cb_response_object
from cbapi.errors import ObjectNotFoundError
def main():
parser = build_cli_parser("Search for cmd.exe writing to exe and dll filepaths")
args = parse... | [
"cbapi.example_helpers.build_cli_parser",
"cbapi.example_helpers.get_cb_response_object"
] | [((231, 302), 'cbapi.example_helpers.build_cli_parser', 'build_cli_parser', (['"""Search for cmd.exe writing to exe and dll filepaths"""'], {}), "('Search for cmd.exe writing to exe and dll filepaths')\n", (247, 302), False, 'from cbapi.example_helpers import build_cli_parser, get_cb_response_object\n'), ((344, 372), '... |
# Το προγραμμα προσομειωνει την ριψη ενος κερματος, 10 φορες και θα εμφανιζει
# αν είναι κορώνα ή γράμμα.
import random
def ektelesi():
x = 0
while x != 10:
tyxaios_arithmos()
x = x + 1
print()
print()
def tyxaios_arithmos():
arithmos = random.randint(1, 2)
... | [
"random.randint"
] | [((296, 316), 'random.randint', 'random.randint', (['(1)', '(2)'], {}), '(1, 2)\n', (310, 316), False, 'import random\n')] |
"""
Views for knowledge articles
"""
from django.shortcuts import render # pylint: disable=E0401
from django.contrib.auth.decorators import login_required # pylint: disable=E0401
from ..models import KnowledgeArticle # pylint: disable=E0401
@login_required
def knowledge_article(request, knowledge_article_id=None):... | [
"django.shortcuts.render"
] | [((883, 925), 'django.shortcuts.render', 'render', (['request', '"""knowledge.html"""', 'context'], {}), "(request, 'knowledge.html', context)\n", (889, 925), False, 'from django.shortcuts import render\n')] |
from datetime import timedelta
from django.utils.translation import ugettext as _, ugettext_noop
from corehq.apps.reports.commconnect import div, CommConnectReport
from corehq.apps.reports.datatables import DataTablesHeader, DataTablesColumn
from corehq.apps.reports.graph_models import LineChart
from corehq.apps.sms.mo... | [
"corehq.apps.sms.models.WORKFLOW_REMINDER.lower",
"django.utils.translation.ugettext_noop",
"corehq.elastic.es_query",
"corehq.util.dates.unix_time_millis",
"django.utils.translation.ugettext",
"datetime.timedelta",
"corehq.apps.reports.commconnect.div"
] | [((587, 627), 'django.utils.translation.ugettext_noop', 'ugettext_noop', (['"""Appointment Performance"""'], {}), "('Appointment Performance')\n", (600, 627), False, 'from django.utils.translation import ugettext as _, ugettext_noop\n'), ((646, 706), 'django.utils.translation.ugettext_noop', 'ugettext_noop', (['"""Appo... |
import torch
import numpy
from ove import utils
from . import model
class RTer:
def __init__(
self,
height, width,
model_path=None, default_model_dir=None,
with_scratch=False,
*args, **kwargs
):
torch.set_grad_enabled(False)
# Make s... | [
"torch.set_grad_enabled",
"torch.cuda.is_available",
"ove.utils.tensor.stack",
"torch.device"
] | [((274, 303), 'torch.set_grad_enabled', 'torch.set_grad_enabled', (['(False)'], {}), '(False)\n', (296, 303), False, 'import torch\n'), ((446, 471), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (469, 471), False, 'import torch\n'), ((494, 551), 'torch.device', 'torch.device', (["('cuda' if se... |
import struct
def ascii_85_decode(data):
decoded = b''
n = b = 0
for c in data:
if b'!' <= c <= b'u':
n += 1
b = b * 85 + (ord(c) - 33)
if n == 5:
decoded += struct.pack('>L', b)
n = b = 0
elif c == b'z':
decod... | [
"struct.pack"
] | [((232, 252), 'struct.pack', 'struct.pack', (['""">L"""', 'b'], {}), "('>L', b)\n", (243, 252), False, 'import struct\n'), ((480, 500), 'struct.pack', 'struct.pack', (['""">L"""', 'b'], {}), "('>L', b)\n", (491, 500), False, 'import struct\n')] |
from socketio.namespace import BaseNamespace
from socketio.mixins import RoomsMixin, BroadcastMixin
from socketio.sdjango import namespace
from collections import defaultdict
import redis
from gevent import Greenlet
def home_redis_worker():
r = redis.StrictRedis(host='localhost', port=6379, db=0)
... | [
"socketio.sdjango.namespace",
"collections.defaultdict",
"redis.StrictRedis",
"gevent.Greenlet.spawn"
] | [((594, 627), 'gevent.Greenlet.spawn', 'Greenlet.spawn', (['home_redis_worker'], {}), '(home_redis_worker)\n', (608, 627), False, 'from gevent import Greenlet\n'), ((634, 652), 'socketio.sdjango.namespace', 'namespace', (['"""/home"""'], {}), "('/home')\n", (643, 652), False, 'from socketio.sdjango import namespace\n')... |
# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------
# SubInterface model
# ---------------------------------------------------------------------
# Copyright (C) 2007-2019 The NOC Project
# See LICENSE for details
# -------------------------------------------------------------... | [
"noc.core.mongo.fields.ForeignKeyField",
"mongoengine.fields.IntField",
"mongoengine.fields.StringField",
"noc.core.mongo.fields.PlainReferenceField"
] | [((2081, 2111), 'noc.core.mongo.fields.PlainReferenceField', 'PlainReferenceField', (['Interface'], {}), '(Interface)\n', (2100, 2111), False, 'from noc.core.mongo.fields import PlainReferenceField, ForeignKeyField\n'), ((2133, 2163), 'noc.core.mongo.fields.ForeignKeyField', 'ForeignKeyField', (['ManagedObject'], {}), ... |
""" --- Inside Block --- Challenging
When it comes to city planning it's import to understand
the borders of various city structures. Parks, lakes or
living blocks can be represented as closed polygon and
can be described using cartesian coordinates on a map.
We need functionality to determine is a point (a building
o... | [
"math.sqrt"
] | [((1555, 1600), 'math.sqrt', 'sqrt', (['((a[0] - b[0]) ** 2 + (a[1] - b[1]) ** 2)'], {}), '((a[0] - b[0]) ** 2 + (a[1] - b[1]) ** 2)\n', (1559, 1600), False, 'from math import sqrt\n')] |
from __future__ import unicode_literals
from django.contrib import admin
from post.models import *
@admin.register(Category)
class CategoryAdmin(admin.ModelAdmin):
"""CategoryAdmin"""
search_fields = ("name",)
list_display = ("name", "grouping", "counting")
@admin.register(Contact)
class SourceAdmin(... | [
"django.contrib.admin.register"
] | [((104, 128), 'django.contrib.admin.register', 'admin.register', (['Category'], {}), '(Category)\n', (118, 128), False, 'from django.contrib import admin\n'), ((278, 301), 'django.contrib.admin.register', 'admin.register', (['Contact'], {}), '(Contact)\n', (292, 301), False, 'from django.contrib import admin\n'), ((467... |
import MDAnalysis
import MDAnalysis.lib.NeighborSearch as NeighborSearch
import warnings
import matplotlib.pyplot as plt
from clustercode.BaseUniverse import BaseUniverse
# from MDAnalysis.core.groups import ResidueGroup
"""
ToDo:
Make sure PBC do what we want
Ensure behaviour for gro files
Make paths to B... | [
"matplotlib.pyplot.savefig",
"MDAnalysis.lib.NeighborSearch.AtomNeighborSearch",
"warnings.warn",
"MDAnalysis.core.groups.AtomGroup",
"matplotlib.pyplot.show"
] | [((4840, 4948), 'MDAnalysis.lib.NeighborSearch.AtomNeighborSearch', 'NeighborSearch.AtomNeighborSearch', (['self.aggregate_species'], {'box': 'self.universe.dimensions', 'bucket_size': '(10)'}), '(self.aggregate_species, box=self.universe\n .dimensions, bucket_size=10)\n', (4873, 4948), True, 'import MDAnalysis.lib.... |
import os
import re
import sys
from collections import UserDict
import bandbox
class Tree(UserDict):
def __new__(cls, sep='/', show_file_counts=True):
cls.sep = sep
cls.show_file_counts = show_file_counts
return super().__new__(cls)
@classmethod
def from_data(cls, data, prefix=""... | [
"re.match",
"re.compile"
] | [((9202, 9234), 're.match', 're.match', (['""".*[A-Z].*"""', 'dir_entry'], {}), "('.*[A-Z].*', dir_entry)\n", (9210, 9234), False, 'import re\n'), ((9240, 9272), 're.match', 're.match', (['""".*[a-z].*"""', 'dir_entry'], {}), "('.*[a-z].*', dir_entry)\n", (9248, 9272), False, 'import re\n'), ((9048, 9075), 're.match', ... |
# -*- coding: utf-8 -*-
import config
import telebot
import db
import threading
import traceback
import time
from otrh import function as otrh_f
from otrh import names
from otrh import equip
db.init()
temp_data = {}
API_TOKEN = config.market_token
bot = telebot.TeleBot(API_TOKEN, skip_pending = True)
game_bot = teleb... | [
"db.get_hero",
"db.add_inventory",
"time.sleep",
"db.init",
"telebot.TeleBot"
] | [((192, 201), 'db.init', 'db.init', ([], {}), '()\n', (199, 201), False, 'import db\n'), ((256, 301), 'telebot.TeleBot', 'telebot.TeleBot', (['API_TOKEN'], {'skip_pending': '(True)'}), '(API_TOKEN, skip_pending=True)\n', (271, 301), False, 'import telebot\n'), ((315, 347), 'telebot.TeleBot', 'telebot.TeleBot', (['confi... |
import numpy as np
import cv2
#K&D for the wide angle camera used
DIM=(1920, 1080)
K=np.array([[1276.399158532128, 0.0, 930.054799272954], [0.0, 1274.1510638009997, 510.7404213142207], [0.0, 0.0, 1.0]])
D=np.array([[0.10664484858106192], [-2.4113027405249046], [12.185556649445054], [-20.93957191606188]])
cap = cv2.Vi... | [
"cv2.imwrite",
"numpy.eye",
"cv2.remap",
"cv2.imshow",
"numpy.array",
"cv2.destroyAllWindows",
"cv2.VideoCapture",
"cv2.waitKey"
] | [((86, 208), 'numpy.array', 'np.array', (['[[1276.399158532128, 0.0, 930.054799272954], [0.0, 1274.1510638009997, \n 510.7404213142207], [0.0, 0.0, 1.0]]'], {}), '([[1276.399158532128, 0.0, 930.054799272954], [0.0, \n 1274.1510638009997, 510.7404213142207], [0.0, 0.0, 1.0]])\n', (94, 208), True, 'import numpy as ... |
import os
def delete_file(filename):
os.remove(filename)
| [
"os.remove"
] | [((42, 61), 'os.remove', 'os.remove', (['filename'], {}), '(filename)\n', (51, 61), False, 'import os\n')] |
import calendar
import datetime
import webbrowser
from periods import *
#get current time
now = datetime.datetime.now()
# math zoom link
def math():
url = "ZOOM LINK HERE"
webbrowser.open(url)
# homeroom zoom link
def homeroom():
url = "ZOOM LINK HERE"
webbrowser.open(url)
# socail studies ... | [
"datetime.datetime.now",
"webbrowser.open"
] | [((97, 120), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (118, 120), False, 'import datetime\n'), ((182, 202), 'webbrowser.open', 'webbrowser.open', (['url'], {}), '(url)\n', (197, 202), False, 'import webbrowser\n'), ((276, 296), 'webbrowser.open', 'webbrowser.open', (['url'], {}), '(url)\n', (... |
import pygame.midi
import board
import neopixel
n_pixels = 177
n_keys = 88.0
pixels = neopixel.NeoPixel(board.D18, n_pixels, brightness=1.0, auto_write=False, pixel_order=neopixel.GRB)
min_key = 21
max_key = 108
def number_to_light(note_number):
led_num = int((note_number - min_key) * (float(n_pixels) / float(n_k... | [
"neopixel.NeoPixel"
] | [((87, 189), 'neopixel.NeoPixel', 'neopixel.NeoPixel', (['board.D18', 'n_pixels'], {'brightness': '(1.0)', 'auto_write': '(False)', 'pixel_order': 'neopixel.GRB'}), '(board.D18, n_pixels, brightness=1.0, auto_write=False,\n pixel_order=neopixel.GRB)\n', (104, 189), False, 'import neopixel\n')] |
from collections import namedtuple
import xml.etree.ElementTree as ET
OPERA_TIMESTAMP_FORMAT = "%Y%m%dT%H:%M:%S"
def parse_receipts_xml(receipt_xml_data):
tree = ET.fromstring(receipt_xml_data)
return map(receipt_to_namedtuple, tree.findall('receipt'))
def receipt_element_to_dict(element):
"""
Turn... | [
"xml.etree.ElementTree.fromstring"
] | [((169, 200), 'xml.etree.ElementTree.fromstring', 'ET.fromstring', (['receipt_xml_data'], {}), '(receipt_xml_data)\n', (182, 200), True, 'import xml.etree.ElementTree as ET\n'), ((1041, 1075), 'xml.etree.ElementTree.fromstring', 'ET.fromstring', (['post_event_xml_data'], {}), '(post_event_xml_data)\n', (1054, 1075), Tr... |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import os
import errno
import time
import datetime
# global configuration
import vprimer.glv as glv
import subprocess as sbp
import pandas as pd
import pickle
import vprimer.utils as utl
from vprimer.blast import Blast
from vprimer.logging_config import Lo... | [
"vprimer.logging_config.LogConf.open_log",
"pickle.dump",
"pandas.read_csv",
"vprimer.utils.try_exec",
"subprocess.Popen",
"vprimer.blast.Blast.makeblastdb",
"os.path.splitext",
"vprimer.utils.ln_s",
"pickle.load",
"os.path.isfile",
"os.path.basename",
"sys.exit",
"vprimer.glv.ref.refseq.key... | [((568, 594), 'vprimer.logging_config.LogConf.open_log', 'LogConf.open_log', (['__name__'], {}), '(__name__)\n', (584, 594), False, 'from vprimer.logging_config import LogConf\n'), ((685, 724), 'os.path.isfile', 'os.path.isfile', (['glv.conf.ref_fasta_user'], {}), '(glv.conf.ref_fasta_user)\n', (699, 724), False, 'impo... |
from data_science.tools.threading_utilities import ThreadableClass
import data_science.tools.transformations as transf
from data_science.tools.classes import InstanceTraceable
from data_science.simulation.parameter import Parameter
class ChannelTypes():
"""Communication channel types."""
UNDEFINED = "undefin... | [
"data_science.tools.transformations.range_to_range_linear",
"data_science.simulation.parameter.Parameter.getinstance"
] | [((2974, 3093), 'data_science.tools.transformations.range_to_range_linear', 'transf.range_to_range_linear', (['temp_value', 'self.physical_minimum', 'self.physical_maximum', 'self.minimum', 'self.maximum'], {}), '(temp_value, self.physical_minimum, self.\n physical_maximum, self.minimum, self.maximum)\n', (3002, 309... |
import os
import protocols as p
from marks import Mark
from typing import Dict, Tuple, Optional, Callable, Any
class Filtering(object):
def __init__(self,
limit_names: Tuple[str, ...],
accounts: Tuple[p.Account, ...],
account_usage: Dict[str, Dict[p.Account, p.Usa... | [
"os.path.exists"
] | [((628, 660), 'os.path.exists', 'os.path.exists', (['"""/sbin/iptables"""'], {}), "('/sbin/iptables')\n", (642, 660), False, 'import os\n')] |
#! /usr/bin/python3
# -*- coding: utf-8 -*-
##############################################################################
# Copyright 2020 AlexPDev
#
# 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 Lice... | [
"torrentfile.magnet",
"PySide6.QtWidgets.QLabel",
"os.path.exists",
"PySide6.QtWidgets.QSpacerItem",
"PySide6.QtWidgets.QHBoxLayout",
"pathlib.Path.home",
"PySide6.QtWidgets.QLineEdit",
"PySide6.QtWidgets.QVBoxLayout"
] | [((1799, 1812), 'PySide6.QtWidgets.QVBoxLayout', 'QVBoxLayout', ([], {}), '()\n', (1810, 1812), False, 'from PySide6.QtWidgets import QFileDialog, QHBoxLayout, QLabel, QLineEdit, QPushButton, QSpacerItem, QToolButton, QVBoxLayout, QWidget\n'), ((1872, 1885), 'PySide6.QtWidgets.QHBoxLayout', 'QHBoxLayout', ([], {}), '()... |
import itertools
import time
# I want to use the memoize pattern (instead of setting up a grid) - to see how it changes and if it is possible in Nim:
def memoize(func):
cache = dict()
def memoized_func(*args):
if args in cache:
return cache[args]
result = func(*args)
cache[... | [
"time.time"
] | [((3189, 3200), 'time.time', 'time.time', ([], {}), '()\n', (3198, 3200), False, 'import time\n'), ((3529, 3540), 'time.time', 'time.time', ([], {}), '()\n', (3538, 3540), False, 'import time\n'), ((3670, 3681), 'time.time', 'time.time', ([], {}), '()\n', (3679, 3681), False, 'import time\n'), ((3811, 3822), 'time.time... |
from typing import Any, Callable, List, Optional, Sequence, Type, TypeVar, Union
from visions.relations import IdentityRelation, InferenceRelation
from visions.types.type import VisionsBaseType
T = TypeVar("T")
def process_relation(items: Union[dict, Type[VisionsBaseType]]) -> IdentityRelation:
if isinstance(it... | [
"visions.relations.InferenceRelation",
"visions.relations.IdentityRelation",
"typing.TypeVar"
] | [((200, 212), 'typing.TypeVar', 'TypeVar', (['"""T"""'], {}), "('T')\n", (207, 212), False, 'from typing import Any, Callable, List, Optional, Sequence, Type, TypeVar, Union\n'), ((347, 372), 'visions.relations.IdentityRelation', 'IdentityRelation', ([], {}), '(**items)\n', (363, 372), False, 'from visions.relations im... |
from typing import Tuple, Union
from Crypto.Cipher.AES import MODE_ECB
from Crypto.Cipher.AES import new as new_aes_ctx
from Crypto.Cipher.PKCS1_OAEP import new as new_pkcs1_oaep_ctx
from Crypto.Hash import SHA256
from Crypto.PublicKey.RSA import import_key as import_rsa_key
from enum import IntEnum
from json import du... | [
"Crypto.Cipher.PKCS1_OAEP.new",
"json.loads",
"random.randint",
"pathlib.Path",
"zstd.ZSTD_compress",
"json.dumps",
"zlib.compress",
"Crypto.Cipher.AES.new",
"zstd.ZSTD_uncompress",
"zstandard.ZstdDecompressor",
"zstandard.ZstdCompressor",
"zlib.decompress"
] | [((3026, 3085), 'Crypto.Cipher.PKCS1_OAEP.new', 'new_pkcs1_oaep_ctx', (['rsa_pub_key'], {'hashAlgo': 'SHA256', 'label': "b''"}), "(rsa_pub_key, hashAlgo=SHA256, label=b'')\n", (3044, 3085), True, 'from Crypto.Cipher.PKCS1_OAEP import new as new_pkcs1_oaep_ctx\n'), ((3150, 3185), 'Crypto.Cipher.AES.new', 'new_aes_ctx', ... |
from time import time
import math, os
from utils import *
import scanpy as sc
from sklearn import metrics
from sklearn.cluster import KMeans
import torch
import torch.nn as nn
from torch.autograd import Variable
from torch.nn import Parameter
import torch.nn.functional as F
import torch.optim as optim
from torch.utils.... | [
"preprocess.read_dataset",
"sklearn.metrics.adjusted_rand_score",
"numpy.array",
"sklearn.metrics.normalized_mutual_info_score",
"preprocess.normalize",
"os.path.exists",
"argparse.ArgumentParser",
"scanpy.AnnData",
"scipy.spatial.distance_matrix",
"h5py.File",
"numpy.savetxt",
"numpy.transpos... | [((592, 697), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""train"""', 'formatter_class': 'argparse.ArgumentDefaultsHelpFormatter'}), "(description='train', formatter_class=argparse.\n ArgumentDefaultsHelpFormatter)\n", (615, 697), False, 'import argparse\n'), ((1990, 2015), 'h5py.Fi... |
""" FTX exchange subclass """
import logging
from typing import Any, Dict
import ccxt
from freqtrade.exceptions import (DDosProtection, InsufficientFundsError, InvalidOrderException,
OperationalException, TemporaryError)
from freqtrade.exchange import Exchange
from freqtrade.exchange... | [
"logging.getLogger",
"freqtrade.misc.safe_value_fallback2",
"freqtrade.exceptions.InvalidOrderException",
"freqtrade.exceptions.TemporaryError",
"freqtrade.exchange.common.retrier",
"freqtrade.exceptions.InsufficientFundsError",
"freqtrade.exceptions.DDosProtection",
"freqtrade.exceptions.OperationalE... | [((431, 458), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (448, 458), False, 'import logging\n'), ((1256, 1274), 'freqtrade.exchange.common.retrier', 'retrier', ([], {'retries': '(0)'}), '(retries=0)\n', (1263, 1274), False, 'from freqtrade.exchange.common import API_FETCH_ORDER_RETRY_... |
from loader import parse_grammar
def main():
while True:
print("Input filename with grammar or q to exit")
filename = input()
if filename == "q":
break
print("Input filename with test sequences")
testname = input()
grammar_file = open(filename)
g... | [
"loader.parse_grammar"
] | [((323, 350), 'loader.parse_grammar', 'parse_grammar', (['grammar_file'], {}), '(grammar_file)\n', (336, 350), False, 'from loader import parse_grammar\n')] |
from django.conf import settings
from django.utils.module_loading import import_string
JsonEncoder = import_string(settings.JSON_ENCODER)
| [
"django.utils.module_loading.import_string"
] | [((103, 139), 'django.utils.module_loading.import_string', 'import_string', (['settings.JSON_ENCODER'], {}), '(settings.JSON_ENCODER)\n', (116, 139), False, 'from django.utils.module_loading import import_string\n')] |
from famille.models import has_user_related, get_user_related
from famille.utils import get_context
def related_user(request):
"""
A context processor that returns the related user from a request.user.
:param request: the request to be processed
"""
if not has_user_related(request.user):
... | [
"famille.utils.get_context",
"famille.models.get_user_related",
"famille.models.has_user_related"
] | [((532, 545), 'famille.utils.get_context', 'get_context', ([], {}), '()\n', (543, 545), False, 'from famille.utils import get_context\n'), ((287, 317), 'famille.models.has_user_related', 'has_user_related', (['request.user'], {}), '(request.user)\n', (303, 317), False, 'from famille.models import has_user_related, get_... |
import numpy as np
import matplotlib.patches as mpatches
from matplotlib.colors import LinearSegmentedColormap
from scipy import stats
"""
Load 8 simulations (main experiment)
print for each simulation:
SimID: Performance(mean,std) rejcetedBlocks maxMinDist
"""
#load data
folder1='2020_09_23_mainExperiment_fina... | [
"numpy.max",
"numpy.mean",
"numpy.zeros",
"numpy.std"
] | [((414, 430), 'numpy.zeros', 'np.zeros', (['(8, 2)'], {}), '((8, 2))\n', (422, 430), True, 'import numpy as np\n'), ((445, 456), 'numpy.zeros', 'np.zeros', (['(8)'], {}), '(8)\n', (453, 456), True, 'import numpy as np\n'), ((468, 479), 'numpy.zeros', 'np.zeros', (['(8)'], {}), '(8)\n', (476, 479), True, 'import numpy a... |
#import stanfordnlp
#from spacy_stanfordnlp import StanfordNLPLanguage
import os
import sys
PATH = '/home/usuaris/veu/jordi.armengol/tfg/new/data/iwslt14.tokenized.de-en/tmp'
LANG = 'de'
#snlp = stanfordnlp.Pipeline(lang=LANG, disable=['ner'])
#nlp = StanfordNLPLanguage(snlp)
import spacy
nlp = spacy.load("de_core_n... | [
"spacy.load",
"os.path.join"
] | [((299, 328), 'spacy.load', 'spacy.load', (['"""de_core_news_sm"""'], {}), "('de_core_news_sm')\n", (309, 328), False, 'import spacy\n'), ((3874, 3914), 'os.path.join', 'os.path.join', (['PATH', "(dataset + '.' + LANG)"], {}), "(PATH, dataset + '.' + LANG)\n", (3886, 3914), False, 'import os\n'), ((3946, 3986), 'os.pat... |
import datetime
import qdarkstyle
from PyQt5 import QtCore, QtWidgets
from PyQt5.QtWidgets import QTableWidgetItem
from Model.dataUtils import *
from Model.Values import Values
from View import UserManagerWindow
class UserManager(QtWidgets.QMainWindow, UserManagerWindow.Ui_MainWindow):
switch_back = QtCore.pyqt... | [
"PyQt5.QtCore.pyqtSignal",
"PyQt5.QtCore.QCoreApplication.translate",
"qdarkstyle.load_stylesheet_pyqt5",
"datetime.datetime.now",
"datetime.datetime.strftime"
] | [((309, 328), 'PyQt5.QtCore.pyqtSignal', 'QtCore.pyqtSignal', ([], {}), '()\n', (326, 328), False, 'from PyQt5 import QtCore, QtWidgets\n'), ((349, 368), 'PyQt5.QtCore.pyqtSignal', 'QtCore.pyqtSignal', ([], {}), '()\n', (366, 368), False, 'from PyQt5 import QtCore, QtWidgets\n'), ((546, 580), 'qdarkstyle.load_styleshee... |
#!/usr/local/bin/python3.6
# vim: expandtab shiftwidth=4
# Copyright (C) 2019 National Institute of Informatics
#
# 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 own... | [
"logging.basicConfig",
"logging.getLogger",
"tempfile.TemporaryDirectory",
"sinetstream.MessageWriter",
"pathlib.Path.cwd",
"time.sleep",
"copy.copy",
"threading.Event",
"pytest.mark.parametrize",
"conftest.create_config_file",
"pytest.mark.usefixtures",
"sinetstream.MessageReader",
"pytest.... | [((1219, 1262), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.CRITICAL'}), '(level=logging.CRITICAL)\n', (1238, 1262), False, 'import logging\n'), ((1272, 1299), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1289, 1299), False, 'import logging\n'), ((1313, 1352),... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from libfb.py.controller.base import BaseController
from fboss.system_tests.test import TestService
from openr.cli.transition_tmp.breeze_cli_utils import ip_addr_to_str
i... | [
"os.system",
"openr.cli.transition_tmp.breeze_cli_utils.ip_addr_to_str"
] | [((452, 470), 'openr.cli.transition_tmp.breeze_cli_utils.ip_addr_to_str', 'ip_addr_to_str', (['ip'], {}), '(ip)\n', (466, 470), False, 'from openr.cli.transition_tmp.breeze_cli_utils import ip_addr_to_str\n'), ((512, 544), 'os.system', 'os.system', (["('ping -c 1 ' + str_ip)"], {}), "('ping -c 1 ' + str_ip)\n", (521, 5... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from decimal import Decimal
from datetime import date
from django.apps import apps
from django.conf import settings
from django.core import mail
from django.contrib import messages
from django.shortcuts import redirect
from django.core.ur... | [
"blousebrothers.tools.get_full_url",
"django.core.urlresolvers.reverse",
"mangopay.models.MangoPayPayInByCard.objects.get",
"django.core.mail.EmailMessage",
"django.template.loader.render_to_string",
"django.apps.apps.get_model",
"django.http.HttpResponseRedirect",
"djstripe.models.Plan.objects.first"... | [((1725, 1763), 'django.apps.apps.get_model', 'apps.get_model', (['"""catalogue"""', '"""Product"""'], {}), "('catalogue', 'Product')\n", (1739, 1763), False, 'from django.apps import apps\n'), ((1779, 1822), 'django.apps.apps.get_model', 'apps.get_model', (['"""catalogue"""', '"""ProductClass"""'], {}), "('catalogue',... |
from __future__ import print_function
import argparse
import os
import json
import torch
import torch.multiprocessing as mp
import numpy as np
import optim
from envs import create_atari_env
from model import ActorCritic
from evaluation import evaluation
from train import train
def parse_arg():
parser = argpars... | [
"torch.multiprocessing.Process",
"torch.manual_seed",
"model.ActorCritic",
"os.makedirs",
"argparse.ArgumentParser",
"torch.multiprocessing.Lock",
"os.path.join",
"visdom.Visdom",
"os.path.isdir",
"torch.multiprocessing.Value",
"envs.create_atari_env"
] | [((313, 355), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""A3C"""'}), "(description='A3C')\n", (336, 355), False, 'import argparse\n'), ((1873, 1916), 'os.makedirs', 'os.makedirs', (['args.model_path'], {'exist_ok': '(True)'}), '(args.model_path, exist_ok=True)\n', (1884, 1916), False,... |
import json
import urllib3
def lambda_handler(event, context):
http = urllib3.PoolManager()
data = {"text": "sample message from lambda_handler"}
r = http.request("POST", "<KEY>", body = json.dumps(data), headers = {"Content-Type": "application/json"})
if "challenge" in event:
re... | [
"json.dumps",
"urllib3.PoolManager"
] | [((75, 96), 'urllib3.PoolManager', 'urllib3.PoolManager', ([], {}), '()\n', (94, 96), False, 'import urllib3\n'), ((427, 448), 'json.dumps', 'json.dumps', (['"""success"""'], {}), "('success')\n", (437, 448), False, 'import json\n'), ((210, 226), 'json.dumps', 'json.dumps', (['data'], {}), '(data)\n', (220, 226), False... |
"""A setuptools based setup module.
See:
https://packaging.python.org/guides/distributing-packages-using-setuptools/
https://github.com/pypa/sampleproject
"""
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
import pkg_resources
def readme():
with open('README.md') as f:
... | [
"setuptools.find_packages"
] | [((1637, 1663), 'setuptools.find_packages', 'find_packages', ([], {'where': '"""src"""'}), "(where='src')\n", (1650, 1663), False, 'from setuptools import setup, find_packages\n')] |
# Copyright 2021 Google LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | [
"tensorflow_decision_forests.component.py_tree.dataspec.column_name_to_column_idx",
"tensorflow.test.main",
"yggdrasil_decision_forests.dataset.data_spec_pb2.DataSpecification",
"tensorflow_decision_forests.component.py_tree.dataspec.categorical_value_idx_to_value",
"tensorflow_decision_forests.component.py... | [((942, 975), 'yggdrasil_decision_forests.dataset.data_spec_pb2.DataSpecification', 'data_spec_pb2.DataSpecification', ([], {}), '()\n', (973, 975), False, 'from yggdrasil_decision_forests.dataset import data_spec_pb2\n'), ((3420, 3434), 'tensorflow.test.main', 'tf.test.main', ([], {}), '()\n', (3432, 3434), True, 'imp... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import unittest
import httpretty
from pyfakefs import fake_filesystem_unittest
from click import UsageError, ClickException
from mock import Mock, MagicMock, patch
from requests.exceptions import SSLError
from cloudshell.rest.api import FeatureUnavailable
from shellfoundry.c... | [
"mock.patch",
"httpretty.register_uri",
"mock.Mock",
"shellfoundry.utilities.template_retriever.FilteredTemplateRetriever",
"requests.exceptions.SSLError",
"cloudshell.rest.api.FeatureUnavailable",
"mock.patch.object",
"shellfoundry.commands.list_command.ListCommandExecutor",
"shellfoundry.utilities... | [((592, 611), 'mock.patch', 'patch', (['"""click.echo"""'], {}), "('click.echo')\n", (597, 611), False, 'from mock import Mock, MagicMock, patch\n'), ((617, 688), 'mock.patch', 'patch', (['"""shellfoundry.commands.list_command.AsciiTable.column_max_width"""'], {}), "('shellfoundry.commands.list_command.AsciiTable.colum... |
from flask import Flask
from zemfrog.app import make_celery
def init_app(app: Flask):
celery = make_celery(app)
app.extensions["celery"] = celery
| [
"zemfrog.app.make_celery"
] | [((108, 124), 'zemfrog.app.make_celery', 'make_celery', (['app'], {}), '(app)\n', (119, 124), False, 'from zemfrog.app import make_celery\n')] |
from util import *
import numpy as np
import cv2
def questao9A(img):
'''
aplicar o filtro
0 -1 0
+ +
-1 5 -1
+ +
0 -1 0
'''
kernel = np.array(([0,-1,0],[-1, 5, -1],[ 0, -1, 0]))
return applyFilter3x3(img, kernel)
def questao9B(img):
'''
aplicar o filtro
0 0 0
+ +
0 1 ... | [
"numpy.array",
"cv2.filter2D"
] | [((164, 211), 'numpy.array', 'np.array', (['([0, -1, 0], [-1, 5, -1], [0, -1, 0])'], {}), '(([0, -1, 0], [-1, 5, -1], [0, -1, 0]))\n', (172, 211), True, 'import numpy as np\n'), ((359, 403), 'numpy.array', 'np.array', (['([0, 0, 0], [0, 1, 0], [0, 0, -1])'], {}), '(([0, 0, 0], [0, 1, 0], [0, 0, -1]))\n', (367, 403), Tr... |
# coding: utf-8
"""
sentry_zabbix.forms
"""
from django import forms
import socket
class ZabbixOptionsForm(forms.Form):
server_host = forms.CharField(
max_length=255,
initial='127.0.0.1',
help_text='Zabbix host (for example: "localhost")'
)
server_port = forms.IntegerField(
... | [
"django.forms.IntegerField",
"socket.gethostname",
"django.forms.CharField"
] | [((141, 250), 'django.forms.CharField', 'forms.CharField', ([], {'max_length': '(255)', 'initial': '"""127.0.0.1"""', 'help_text': '"""Zabbix host (for example: "localhost")"""'}), '(max_length=255, initial=\'127.0.0.1\', help_text=\n \'Zabbix host (for example: "localhost")\')\n', (156, 250), False, 'from django im... |
"""
Script containing methods useful for other plots
"""
import csv
import pathlib
import shutil
import numpy as np
from matplotlib import patches
from config import FrameworkConfiguration
def get_font_family_and_size():
"""
Function to globally set and get font family and font size for plots
"""
... | [
"csv.reader",
"pathlib.Path",
"shutil.rmtree"
] | [((8647, 8670), 'shutil.rmtree', 'shutil.rmtree', (['"""./tmp/"""'], {}), "('./tmp/')\n", (8660, 8670), False, 'import shutil\n'), ((5514, 5549), 'csv.reader', 'csv.reader', (['csv_file'], {'delimiter': '""","""'}), "(csv_file, delimiter=',')\n", (5524, 5549), False, 'import csv\n'), ((6347, 6382), 'csv.reader', 'csv.r... |
# -*- coding: utf-8 -*-
import json
import unittest
from botocore.exceptions import ClientError
from localstack.utils.aws import aws_stack
from localstack.utils.common import to_str
TEST_TOPIC_NAME = 'TestTopic_snsTest'
TEST_QUEUE_NAME = 'TestQueue_snsTest'
class SNSTest(unittest.TestCase):
def setUp(self):
... | [
"localstack.utils.aws.aws_stack.sqs_queue_arn",
"localstack.utils.aws.aws_stack.connect_to_service",
"localstack.utils.common.to_str"
] | [((346, 381), 'localstack.utils.aws.aws_stack.connect_to_service', 'aws_stack.connect_to_service', (['"""sqs"""'], {}), "('sqs')\n", (374, 381), False, 'from localstack.utils.aws import aws_stack\n'), ((408, 443), 'localstack.utils.aws.aws_stack.connect_to_service', 'aws_stack.connect_to_service', (['"""sns"""'], {}), ... |
from Sql.KLineTable import KLineTable, KLine
from Sql.StockBriefTable import StockBriefTable
from Sql.KLineBuyRecdTable import KLineBuyRecd
from Sql.ProfitRecdTable import ProfitRecdTable
from datetime import datetime
from datetime import timedelta
import pandas as pd
from pandas import DataFrame
from pandas.pl... | [
"datetime.datetime",
"Sql.StockBriefTable.StockBriefTable.get_stock_id_list",
"Sql.KLineTable.KLineTable.select_k_line_list",
"matplotlib.pyplot.plot",
"math.isnan",
"talib.MACD",
"pandas.plotting.register_matplotlib_converters",
"pandas.DataFrame",
"datetime.timedelta",
"Sql.KLineBuyRecdTable.KLi... | [((533, 568), 'Sql.StockBriefTable.StockBriefTable.get_stock_id_list', 'StockBriefTable.get_stock_id_list', ([], {}), '()\n', (566, 568), False, 'from Sql.StockBriefTable import StockBriefTable\n'), ((761, 793), 'pandas.plotting.register_matplotlib_converters', 'register_matplotlib_converters', ([], {}), '()\n', (791, ... |
# Copyright (c) 2021, VRAI Labs and/or its affiliates. All rights reserved.
#
# This software is licensed under the Apache License, Version 2.0 (the
# "License") as published by the Apache Software Foundation.
#
# You may not use this file except in compliance with the License. You may
# obtain a copy of the License at... | [
"httpx.AsyncClient"
] | [((1717, 1730), 'httpx.AsyncClient', 'AsyncClient', ([], {}), '()\n', (1728, 1730), False, 'from httpx import AsyncClient\n')] |
# Copyright: (c) 2021, <NAME>
import numpy as np
import sys
sys.path.append('../../pyCuSDR')
from lib import *
packetData = lambda: createBitSequence(10000,seed=123) # gives us a default 10000 bit length packet
zeropad = lambda sig,n: np.concatenate((np.zeros(n),sig,np.zeros(n))) # pre and post pad signal with zer... | [
"numpy.random.get_state",
"numpy.log10",
"numpy.random.set_state",
"numpy.sqrt",
"numpy.array",
"sys.path.append",
"numpy.mod",
"numpy.repeat",
"numpy.exp",
"numpy.random.seed",
"numpy.concatenate",
"numpy.tile",
"numpy.abs",
"numpy.ones",
"numpy.iscomplexobj",
"numpy.sum",
"numpy.ra... | [((62, 94), 'sys.path.append', 'sys.path.append', (['"""../../pyCuSDR"""'], {}), "('../../pyCuSDR')\n", (77, 94), False, 'import sys\n'), ((730, 761), 'numpy.random.randint', 'np.random.randint', (['(0)', '(2)', 'n_bits'], {}), '(0, 2, n_bits)\n', (747, 761), True, 'import numpy as np\n'), ((2078, 2111), 'numpy.array',... |
import io
import re
from rich.console import Console, RenderableType
from rich.__main__ import make_test_card
from ._card_render import expected
re_link_ids = re.compile(r"id=[\d\.\-]*?;.*?\x1b")
def replace_link_ids(render: str) -> str:
"""Link IDs have a random ID and system path which is a problem for
r... | [
"io.StringIO",
"rich.__main__.make_test_card",
"re.compile"
] | [((162, 201), 're.compile', 're.compile', (['"""id=[\\\\d\\\\.\\\\-]*?;.*?\\\\x1b"""'], {}), "('id=[\\\\d\\\\.\\\\-]*?;.*?\\\\x1b')\n", (172, 201), False, 'import re\n'), ((703, 719), 'rich.__main__.make_test_card', 'make_test_card', ([], {}), '()\n', (717, 719), False, 'from rich.__main__ import make_test_card\n'), ((... |
import numpy as np
import numpy.testing as npt
from stumpy import core
import pytest
def naive_rolling_window_dot_product(Q, T):
window = len(Q)
result = np.zeros(len(T) - window + 1)
for i in range(len(result)):
result[i] = np.dot(T[i:i + window], Q)
return result
test_data = [
(np.array(... | [
"stumpy.core.compute_mean_std",
"stumpy.core.calculate_distance_profile",
"stumpy.core.z_norm",
"numpy.square",
"pytest.mark.parametrize",
"numpy.testing.assert_almost_equal",
"numpy.dot",
"stumpy.core.sliding_dot_product",
"numpy.array",
"numpy.sum",
"numpy.random.uniform",
"stumpy.core.rolli... | [((570, 612), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""Q, T"""', 'test_data'], {}), "('Q, T', test_data)\n", (593, 612), False, 'import pytest\n'), ((785, 827), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""Q, T"""', 'test_data'], {}), "('Q, T', test_data)\n", (808, 827), False, 'import... |
# Generated by Django 4.0 on 2022-01-17 04:58
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('base', '0006_phone_sar_phone_sareu'),
]
operations = [
migrations.AlterField(
model_name='phone',
name='... | [
"django.db.models.TextField"
] | [((353, 425), 'django.db.models.TextField', 'models.TextField', ([], {'blank': '(True)', 'max_length': '(200)', 'verbose_name': '"""Performance"""'}), "(blank=True, max_length=200, verbose_name='Performance')\n", (369, 425), False, 'from django.db import migrations, models\n')] |
#-*- coding: utf-8 -*-
"""Test the relative speed of iteration tool alternatives"""
import sys
import timer2
reps = 10000
repslist = list(range(reps))
def forLoop():
res = []
for x in repslist:
res.append(x + 10)
return res
def listComp():
return [x + 10 for x in repslist]
def mapCall()... | [
"timer2.bestoftotal"
] | [((680, 726), 'timer2.bestoftotal', 'timer2.bestoftotal', (['test'], {'_reps1': '(5)', '_reps': '(1000)'}), '(test, _reps1=5, _reps=1000)\n', (698, 726), False, 'import timer2\n')] |
from .tree_utils import load_tree
from .tree import *
from anytree import NodeMixin, RenderTree, render
import pickle
""" Operator test functions
* root : currently empty root node of a tree
* _a : does nothing currently
* _b : does nothing currently
"""
def root():
return "Executing Operator roo... | [
"numpy.array",
"anytree.exporter.JsonExporter",
"tree_utils.load_pipeline",
"forecasting.mlp_model",
"tree_utils.load_tree"
] | [((1960, 2038), 'anytree.exporter.JsonExporter', 'JsonExporter', ([], {'indent': '(2)', 'sort_keys': '(True)', 'default': "(lambda o: '<not serializable>')"}), "(indent=2, sort_keys=True, default=lambda o: '<not serializable>')\n", (1972, 2038), False, 'from anytree.exporter import JsonExporter\n'), ((3744, 3775), 'tre... |
import numpy as np
import torch
import matplotlib.pylab
from fiery.utils.instance import predict_instance_segmentation_and_trajectories
DEFAULT_COLORMAP = matplotlib.pylab.cm.jet
def flow_to_image(flow: np.ndarray, autoscale: bool = False) -> np.ndarray:
"""
Applies colour map to flow which should be a 2 ch... | [
"numpy.uint8",
"fiery.utils.instance.predict_instance_segmentation_and_trajectories",
"numpy.sqrt",
"numpy.logical_not",
"numpy.array",
"numpy.arctan2",
"numpy.arange",
"torch.unique",
"numpy.repeat",
"numpy.asarray",
"numpy.max",
"numpy.stack",
"numpy.concatenate",
"numpy.min",
"numpy.o... | [((578, 602), 'numpy.sqrt', 'np.sqrt', (['(u ** 2 + v ** 2)'], {}), '(u ** 2 + v ** 2)\n', (585, 602), True, 'import numpy as np\n'), ((616, 627), 'numpy.max', 'np.max', (['rad'], {}), '(rad)\n', (622, 627), True, 'import numpy as np\n'), ((899, 912), 'numpy.min', 'np.min', (['image'], {}), '(image)\n', (905, 912), Tru... |
# Copyright 2021 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Test the zmake re-exec functionality."""
import os
import sys
import unittest.mock as mock
import pytest
import zmake.__main__ as main
@pytest.fixt... | [
"unittest.mock.patch",
"zmake.__main__.maybe_reexec"
] | [((689, 718), 'zmake.__main__.maybe_reexec', 'main.maybe_reexec', (["['--help']"], {}), "(['--help'])\n", (706, 718), True, 'import zmake.__main__ as main\n'), ((960, 989), 'zmake.__main__.maybe_reexec', 'main.maybe_reexec', (["['--help']"], {}), "(['--help'])\n", (977, 989), True, 'import zmake.__main__ as main\n'), (... |
"""NodeJS tooling orchestration.
Broadly, it has a `.nodeenv` created using the nodeenv package; and ensures that the
`node_modules` directory is kept in sync with the `package.json` file of the project.
"""
import os
import shlex
import shutil
import subprocess
import sys
import textwrap
from pathlib import Path
fro... | [
"textwrap.dedent",
"unittest.mock.patch.dict",
"subprocess.CalledProcessError",
"shutil.which",
"subprocess.run",
"shutil.rmtree",
"shlex.quote",
"os.fsdecode"
] | [((1299, 1338), 'shutil.which', 'shutil.which', (['args[0]'], {'path': "env['PATH']"}), "(args[0], path=env['PATH'])\n", (1311, 1338), False, 'import shutil\n'), ((939, 959), 'os.fsdecode', 'os.fsdecode', (['nodeenv'], {}), '(nodeenv)\n', (950, 959), False, 'import os\n'), ((990, 1010), 'os.fsdecode', 'os.fsdecode', ([... |
# ----------------------------------------------------------------------
# |
# | ParserInfo.py
# |
# | <NAME> <<EMAIL>>
# | 2021-09-28 17:13:44
# |
# ----------------------------------------------------------------------
# |
# | Copyright <NAME> 2021
# | Distributed under the Boost Software License, ... | [
"dataclasses.fields",
"dataclasses.dataclass",
"os.path.split",
"CommonEnvironment.YamlRepr.ObjectReprImplBase.__init__",
"CommonEnvironment.ThisFullpath",
"dataclasses.field"
] | [((1014, 1046), 'CommonEnvironment.ThisFullpath', 'CommonEnvironment.ThisFullpath', ([], {}), '()\n', (1044, 1046), False, 'import CommonEnvironment\n'), ((1094, 1125), 'os.path.split', 'os.path.split', (['_script_fullpath'], {}), '(_script_fullpath)\n', (1107, 1125), False, 'import os\n'), ((1280, 1302), 'dataclasses.... |
#-------------------------------------------------------------------------------
# Copyright (c) 2012 <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... | [
"unittest.main",
"numpy.array",
"numpy.random.seed",
"complex_systems.mobility.stabrnd.stabrnd"
] | [((1763, 1778), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1776, 1778), False, 'import unittest\n'), ((1551, 1604), 'numpy.array', 'N.array', (['[[2.92229997], [-0.78181396], [-0.44122327]]'], {}), '([[2.92229997], [-0.78181396], [-0.44122327]])\n', (1558, 1604), True, 'import numpy as N\n'), ((1611, 1632), '... |
import os
import json
import torch
import torch.nn.functional as F
from dotmap import DotMap
from src.ood.base import BaseOODEvaluator
from src.systems.simclr import SimCLRSystem
from src.systems.supervised import SupervisedSystem
from src.utils import utils
class MCDropoutOODEvaluator(BaseOODEvaluator):
def get_... | [
"os.makedirs",
"src.utils.utils.load_json",
"torch.load",
"torch.stack",
"os.path.join",
"dotmap.DotMap",
"torch.nn.functional.normalize",
"os.path.isdir",
"torch.std",
"json.dump"
] | [((479, 516), 'os.path.join', 'os.path.join', (['base_dir', '"""config.json"""'], {}), "(base_dir, 'config.json')\n", (491, 516), False, 'import os\n'), ((539, 567), 'src.utils.utils.load_json', 'utils.load_json', (['config_path'], {}), '(config_path)\n', (554, 567), False, 'from src.utils import utils\n'), ((585, 604)... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
.. currentmodule:: sample
.. moduleauthor:: <NAME> <<EMAIL>>
This script initializes the plugin, making it known to QGIS.
"""
#noinspection PyPep8Naming
def classFactory(iface):
"""
:param iface: a QGIS interface instance
:return: :py:class:`QgsInterfac... | [
"plugin.Plugin"
] | [((372, 385), 'plugin.Plugin', 'Plugin', (['iface'], {}), '(iface)\n', (378, 385), False, 'from plugin import Plugin\n')] |
#!/usr/bin/env python
from pathlib import Path
from setuptools import setup, find_namespace_packages
# Get long_description from README.md
long_description = (Path(__file__).parent / "README.md").read_text().strip()
setup(
name="cron_parser",
license="MIT",
url="https://github.com/expobrain/cron_parser"... | [
"setuptools.find_namespace_packages",
"pathlib.Path"
] | [((616, 652), 'setuptools.find_namespace_packages', 'find_namespace_packages', ([], {'where': '"""src"""'}), "(where='src')\n", (639, 652), False, 'from setuptools import setup, find_namespace_packages\n'), ((162, 176), 'pathlib.Path', 'Path', (['__file__'], {}), '(__file__)\n', (166, 176), False, 'from pathlib import ... |
# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
# with the License. A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "LICENSE.txt" file accom... | [
"assertpy.assert_that",
"configparser.ConfigParser",
"tests.common.MockedBoto3Request",
"tests.pcluster.config.utils.get_mocked_pcluster_config",
"pytest.mark.parametrize",
"pytest.fail",
"pytest.raises",
"pytest.fixture",
"tests.pcluster.config.utils.init_pcluster_config_from_configparser"
] | [((800, 816), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (814, 816), False, 'import pytest\n'), ((888, 1377), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""path, boto3_response, expected_message"""', "[('/aws/service/ami-amazon-linux-latest', {'Parameters': [{'Name':\n '/aws/service/ami-amaz... |
from __future__ import annotations
import functools
from typing import Union, Optional, Tuple, Dict, Iterable, Sequence, List, Set
from boltons.iterutils import first, flatten
from libcst import MetadataWrapper, Assign, AnnAssign, SimpleString, VisitorMetadataProvider, AugAssign, Name, \
BaseExpression, Concatena... | [
"functools.lru_cache"
] | [((1133, 1154), 'functools.lru_cache', 'functools.lru_cache', ([], {}), '()\n', (1152, 1154), False, 'import functools\n'), ((1495, 1516), 'functools.lru_cache', 'functools.lru_cache', ([], {}), '()\n', (1514, 1516), False, 'import functools\n'), ((1713, 1734), 'functools.lru_cache', 'functools.lru_cache', ([], {}), '(... |
import pandas as pd
import numpy as np
def downgrade_dtypes(df):
"""Downgrade column types in the dataframe from float64/int64 type to float32/int32 type
Parameters
----------
df : DataFrame
Returns
-------
df: DataFrame
the output column types will be changed from float64... | [
"numpy.clip",
"pandas.DataFrame"
] | [((1213, 1235), 'numpy.clip', 'np.clip', (['y_test', '(0)', '(20)'], {}), '(y_test, 0, 20)\n', (1220, 1235), True, 'import numpy as np\n'), ((1252, 1310), 'pandas.DataFrame', 'pd.DataFrame', (["{'ID': test.index, 'item_cnt_month': y_test}"], {}), "({'ID': test.index, 'item_cnt_month': y_test})\n", (1264, 1310), True, '... |
# Author: <NAME>
# E-mail: <EMAIL>
# Author: <NAME>
# E-mail: <EMAIL>
# Author: <NAME>
# E-mail: <EMAIL>
try:
from Oblig3.packages.preprocess import load_raw_data, pad
from Oblig3.packages.preprocess import OurCONLLUDataset
except:
from packages.preprocess import load_raw_data, pad
from packages.pre... | [
"sklearn.utils.resample",
"packages.preprocess.load_raw_data"
] | [((1156, 1179), 'packages.preprocess.load_raw_data', 'load_raw_data', (['datapath'], {}), '(datapath)\n', (1169, 1179), False, 'from packages.preprocess import load_raw_data, pad\n'), ((911, 978), 'sklearn.utils.resample', 'resample', (['df'], {'replace': '(False)', 'n_samples': 'n', 'random_state': 'random_state'}), '... |
import re
import os.path
from abc import ABCMeta, abstractmethod
from os import makedirs
from parso import parse
from parso.python.tree import (
EndMarker, PythonErrorLeaf, PythonErrorNode, Name, Keyword, Operator)
from config.config_parser import get_main_config_parser
class Separator():
__metaclass__ = AB... | [
"config.config_parser.get_main_config_parser",
"parso.parse",
"os.makedirs",
"re.search"
] | [((828, 852), 'config.config_parser.get_main_config_parser', 'get_main_config_parser', ([], {}), '()\n', (850, 852), False, 'from config.config_parser import get_main_config_parser\n'), ((2205, 2221), 'os.makedirs', 'makedirs', (['subdir'], {}), '(subdir)\n', (2213, 2221), False, 'from os import makedirs\n'), ((3713, 3... |
import re
class ReplaceChar:
def __init__(self, mapping):
self.mapping = mapping
def run(self, token):
for x, y in self.mapping.items():
token = token.replace(x, y)
return [token]
class ReplaceFull:
def __init__(self, mapping):
self.mapping = mapping
... | [
"re.sub",
"re.escape",
"re.compile"
] | [((874, 893), 're.compile', 're.compile', (['"""^\\\\d$"""'], {}), "('^\\\\d$')\n", (884, 893), False, 'import re\n'), ((1745, 1764), 're.compile', 're.compile', (['"""^\\\\d$"""'], {}), "('^\\\\d$')\n", (1755, 1764), False, 'import re\n'), ((624, 643), 're.sub', 're.sub', (['x', 'y', 'token'], {}), '(x, y, token)\n', ... |
import os
import argparse
import click
from scrape_etsy.scrape_etsy import scrape
def parse_args():
"""Extract arguments from the command line and return in dictionatry
Parameters:
Returns:
dict: A dictionary of command line arguments and values
"""
parser = argparse.ArgumentParser(descript... | [
"os.path.exists",
"click.confirm",
"argparse.ArgumentParser"
] | [((288, 389), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Scrape product information from etsy.com into a CSV file."""'}), "(description=\n 'Scrape product information from etsy.com into a CSV file.')\n", (311, 389), False, 'import argparse\n'), ((1626, 1648), 'os.path.exists', 'os... |
# $Id$
#-----------------------------------------------------------------------
# Copyright (C) 2004-2020
# Associated Universities, Inc. Washington DC, USA.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free So... | [
"os.times",
"Image.POpen",
"FArray.PClipBlank",
"ImageUtil.PInterpolateImage",
"Image.PGetName",
"FArray.PDiv",
"Image.PClone2",
"ImageDesc.POverlap",
"FArray.PGetBlank",
"ImageUtil.PGetXYPixels",
"FArray.PMax",
"ImageDesc.PGetDict",
"Image.PPutPlane",
"ImageDesc.PSetDict",
"InfoList.PSe... | [((2991, 3020), 'Image.POpen', 'Image.POpen', (['template', '(1)', 'err'], {}), '(template, 1, err)\n', (3002, 3020), False, 'import Image, ImageDesc, ImageUtil, FArray, InfoList, OErr, History, GPUFInterpolate\n'), ((3026, 3052), 'Image.PRead', 'Image.PRead', (['template', 'err'], {}), '(template, err)\n', (3037, 3052... |
import sys
import heapq
import math
def solve():
read = sys.stdin.readline
v, e = map(int, read().split())
s = int(read())
graph = [[] for _ in range(v + 1)]
for _ in range(e):
v1, v2, w = map(int, read().split())
graph[v1].append((v2, w))
dist = [math.inf for _ in range(v + 1... | [
"heapq.heappush",
"heapq.heappop"
] | [((355, 381), 'heapq.heappush', 'heapq.heappush', (['hq', '(0, s)'], {}), '(hq, (0, s))\n', (369, 381), False, 'import heapq\n'), ((415, 432), 'heapq.heappop', 'heapq.heappop', (['hq'], {}), '(hq)\n', (428, 432), False, 'import heapq\n'), ((553, 587), 'heapq.heappush', 'heapq.heappush', (['hq', '(dist[v2], v2)'], {}), ... |
# -*- coding: utf-8 -*-
from resources.lib import kodiutils
from resources.lib import kodilogging
import logging
import xbmcaddon
import xbmcgui
import xbmc
import urllib
from subprocess import call
logger = logging.getLogger(ADDON.getAddonInfo('mebo.updater'))
# Put your code here, this is just an ex... | [
"xbmc.Notification",
"xbmcgui.Dialog"
] | [((914, 983), 'xbmc.Notification', 'xbmc.Notification', (['"""Plugin Installed"""', '"""You can now use this plugin!"""'], {}), "('Plugin Installed', 'You can now use this plugin!')\n", (931, 983), False, 'import xbmc\n'), ((551, 567), 'xbmcgui.Dialog', 'xbmcgui.Dialog', ([], {}), '()\n', (565, 567), False, 'import xbm... |
from openpyxl import load_workbook
xlsx_file = "E:\\hello-git-sourcetree\\R_GO\\Python_RPA\\"
xlsx = load_workbook(xlsx_file+"result.xlsx", read_only =True)
sheet=xlsx.active
print(sheet['A25'].value)
print(sheet['B1'].value)
row = sheet['1']
for data in row:
print(data.value)
xlsx=load_workbook(xlsx_file+"resu... | [
"openpyxl.load_workbook",
"openpyxl.Workbook"
] | [((102, 158), 'openpyxl.load_workbook', 'load_workbook', (["(xlsx_file + 'result.xlsx')"], {'read_only': '(True)'}), "(xlsx_file + 'result.xlsx', read_only=True)\n", (115, 158), False, 'from openpyxl import load_workbook\n'), ((291, 331), 'openpyxl.load_workbook', 'load_workbook', (["(xlsx_file + 'result.xlsx')"], {}),... |
from __future__ import division
import gzip
import numpy as np
import pandas as pd
from astropy.io import fits
import matplotlib.pyplot as plt
from VALDextraction import VALDmail
from plot_fits import get_wavelength
plt.rcParams['xtick.direction'] = 'in'
plt.rcParams['ytick.direction'] = 'in'
plt.rcParams['axes.spines... | [
"numpy.median",
"astropy.io.fits.getheader",
"pandas.read_csv",
"matplotlib.pyplot.xticks",
"numpy.random.choice",
"matplotlib.pyplot.gca",
"pandas.merge",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.ylabel",
"gzip.open",
"matplotlib.pyplot.vlines",
"astropy.io.f... | [((572, 638), 'pandas.read_csv', 'pd.read_csv', (['"""Fe1.moog"""'], {'names': 'names', 'delimiter': '"""\\\\s+"""', 'skiprows': '(1)'}), "('Fe1.moog', names=names, delimiter='\\\\s+', skiprows=1)\n", (583, 638), True, 'import pandas as pd\n'), ((716, 793), 'pandas.read_csv', 'pd.read_csv', (['"""linelist_newEW.moog"""... |
from datetime import datetime
from sklearn.model_selection import train_test_split
from IMLearn import BaseEstimator
from challenge.agoda_cancellation_estimator import AgodaCancellationEstimator
import numpy as np
import pandas as pd
def load_data(filename: str, have_true_val: bool = True):
"""
Load Agoda bo... | [
"pandas.isnull",
"pandas.read_csv",
"datetime.datetime.strptime",
"sklearn.model_selection.train_test_split",
"numpy.random.seed",
"challenge.agoda_cancellation_estimator.AgodaCancellationEstimator",
"pandas.get_dummies"
] | [((3016, 3077), 'datetime.datetime.strptime', 'datetime.strptime', (['data_row[first_data_name][:10]', '"""%Y-%m-%d"""'], {}), "(data_row[first_data_name][:10], '%Y-%m-%d')\n", (3033, 3077), False, 'from datetime import datetime\n'), ((3087, 3149), 'datetime.datetime.strptime', 'datetime.strptime', (['data_row[second_d... |
import os
def is_in_cloud():
"""
Checks if this code is running in a deployed Lovage stack. Useful when you have to initialize global variables
only in deployed code.
:return: True if running in AWS/GCP/Azure/etc.
"""
return os.getenv("LOVAGE_IN_CLOUD", "0") == "1"
| [
"os.getenv"
] | [((251, 284), 'os.getenv', 'os.getenv', (['"""LOVAGE_IN_CLOUD"""', '"""0"""'], {}), "('LOVAGE_IN_CLOUD', '0')\n", (260, 284), False, 'import os\n')] |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import cstr, getdate
from frappe import _
from erpnext.stock.utils import get_valid_serial_nos
from erpnext.utilities... | [
"frappe.db.exists",
"frappe.db.get_value",
"erpnext.controllers.selling_controller.check_active_sales_items",
"frappe._",
"erpnext.stock.utils.get_valid_serial_nos",
"frappe.utils.cstr",
"frappe.utils.getdate",
"frappe.db.set"
] | [((1142, 1172), 'erpnext.controllers.selling_controller.check_active_sales_items', 'check_active_sales_items', (['self'], {}), '(self)\n', (1166, 1172), False, 'from erpnext.controllers.selling_controller import check_active_sales_items\n'), ((1245, 1300), 'frappe.db.get_value', 'frappe.db.get_value', (['"""Item"""', '... |
# -*- coding: utf-8 -*-
from TM1py.Objects import ElementAttribute, Element
from TM1py.Services.ObjectService import ObjectService
from TM1py.Utils import build_element_unique_names
class ElementService(ObjectService):
""" Service to handle Object Updates for TM1 Dimension (resp. Hierarchy) Elements
"""
... | [
"TM1py.Objects.ElementAttribute.from_dict",
"TM1py.Objects.Element.from_dict",
"TM1py.CellService"
] | [((2047, 2073), 'TM1py.Objects.Element.from_dict', 'Element.from_dict', (['element'], {}), '(element)\n', (2064, 2073), False, 'from TM1py.Objects import ElementAttribute, Element\n'), ((2394, 2420), 'TM1py.Objects.Element.from_dict', 'Element.from_dict', (['element'], {}), '(element)\n', (2411, 2420), False, 'from TM1... |
import logging
from db.core import exec_hub_query, exec_remote_query
from db.references import HubSqlReference, PowerDnsSqlReference
from utils.decorators import log_start_end
from utils.utils import flatten_list
logger = logging.getLogger(__name__)
def to_record_set(input_str):
row_strings = map(lambda row: r... | [
"logging.getLogger",
"db.references.HubSqlReference.select_domain_id",
"db.references.HubSqlReference.select_powerdns_hosts",
"db.references.PowerDnsSqlReference.select_domains",
"utils.utils.flatten_list",
"db.core.exec_remote_query",
"db.references.PowerDnsSqlReference.select_dns_records",
"db.refer... | [((225, 252), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (242, 252), False, 'import logging\n'), ((832, 888), 'db.references.PowerDnsSqlReference.select_dns_records', 'PowerDnsSqlReference.select_dns_records', (['domain_ids_list'], {}), '(domain_ids_list)\n', (871, 888), False, 'from ... |
from rest_framework import serializers
from .models import Notification
from users.serializers import UserProfileSerializer
from feed.serializers import MumbleSerializer
from article.serializers import ArticleSerializer
from discussion.serializers import DiscussionSerializer
class NotificationSerializer(serializers.M... | [
"users.serializers.UserProfileSerializer",
"rest_framework.serializers.SerializerMethodField",
"article.serializers.ArticleSerializer",
"discussion.serializers.DiscussionSerializer",
"feed.serializers.MumbleSerializer"
] | [((354, 403), 'rest_framework.serializers.SerializerMethodField', 'serializers.SerializerMethodField', ([], {'read_only': '(True)'}), '(read_only=True)\n', (387, 403), False, 'from rest_framework import serializers\n'), ((422, 471), 'rest_framework.serializers.SerializerMethodField', 'serializers.SerializerMethodField'... |
from pathlib import Path
from fhir.resources.valueset import ValueSet as _ValueSet
from oops_fhir.utils import ValueSet
from oops_fhir.r4.code_system.v3_query_status_code import (
v3QueryStatusCode as v3QueryStatusCode_,
)
__all__ = ["v3QueryStatusCode"]
_resource = _ValueSet.parse_file(Path(__file__).with_s... | [
"pathlib.Path"
] | [((299, 313), 'pathlib.Path', 'Path', (['__file__'], {}), '(__file__)\n', (303, 313), False, 'from pathlib import Path\n')] |
from aiogram import types
kb_shop = types.InlineKeyboardMarkup()
btn_items = types.InlineKeyboardButton(
text="🗃 Сундуки", callback_data="shop_chest"
)
btn_money = types.InlineKeyboardButton(
text="💰 Монеты", callback_data="shop_money"
)
btn_stock = types.InlineKeyboardButton(
text="⚒ Ресурсы", callba... | [
"aiogram.types.InlineKeyboardMarkup",
"aiogram.types.InlineKeyboardButton"
] | [((37, 65), 'aiogram.types.InlineKeyboardMarkup', 'types.InlineKeyboardMarkup', ([], {}), '()\n', (63, 65), False, 'from aiogram import types\n'), ((79, 151), 'aiogram.types.InlineKeyboardButton', 'types.InlineKeyboardButton', ([], {'text': '"""🗃 Сундуки"""', 'callback_data': '"""shop_chest"""'}), "(text='🗃 Сундуки',... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.4'
# jupytext_version: 1.1.4
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# # S_Pr... | [
"matplotlib.pyplot.grid",
"numpy.sqrt",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.fill_between",
"numpy.array",
"numpy.arange",
"numpy.mean",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.style.use",
"numpy.diff",
"numpy.max",
"numpy.exp",
"numpy.min",
"matplotlib.pyplot.xticks",
"... | [((1088, 1112), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""seaborn"""'], {}), "('seaborn')\n", (1101, 1112), True, 'import matplotlib.pyplot as plt\n'), ((1499, 1530), 'ARPM_utils.struct_to_dict', 'struct_to_dict', (["db['StocksSPX']"], {}), "(db['StocksSPX'])\n", (1513, 1530), False, 'from ARPM_utils import... |