code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
from io import TextIOWrapper
import os
from typing import List
OUTPUT = "files/output.csv"
FOLDER = "modules/week2/folders"
def get_file_names(folderpath, out=OUTPUT):
"""takes a path to a folder and writes all filenames in the folder to a specified output file"""
dir_list = os.listdir(folderpath)
with o... | [
"os.listdir",
"os.path.isdir"
] | [((287, 309), 'os.listdir', 'os.listdir', (['folderpath'], {}), '(folderpath)\n', (297, 309), False, 'import os\n'), ((732, 759), 'os.path.isdir', 'os.path.isdir', (['path_to_file'], {}), '(path_to_file)\n', (745, 759), False, 'import os\n'), ((968, 990), 'os.listdir', 'os.listdir', (['folderpath'], {}), '(folderpath)\... |
import math
import re
import unittest
import urllib.error
import urllib.request
from .core import Quantity
from .define import defined_systems
si = defined_systems['si']
esu = defined_systems['esu']
emu = defined_systems['emu']
gauss = defined_systems['gauss']
class PhysicalQuantitiesTest(unittest.TestCase):
def a... | [
"re.split",
"math.isclose",
"math.sqrt",
"math.cos",
"unittest.main"
] | [((8506, 8521), 'unittest.main', 'unittest.main', ([], {}), '()\n', (8519, 8521), False, 'import unittest\n'), ((4296, 4307), 'math.cos', 'math.cos', (['a'], {}), '(a)\n', (4304, 4307), False, 'import math\n'), ((4309, 4320), 'math.cos', 'math.cos', (['(1)'], {}), '(1)\n', (4317, 4320), False, 'import math\n'), ((4343,... |
import unittest
import sys
import os
sys.path.append(os.getcwd().replace("test", "src"))
import cirrus_ngs.cfnCluster.ConnectionManager as ConnectionManager
import paramiko
import tempfile
import re
##THIS TEST WILL NOT WORK##
class test_ConnectionManager(unittest.TestCase):
def test_paramiko(self):
key_f... | [
"cirrus_ngs.cfnCluster.ConnectionManager.copy_file",
"paramiko.RSAKey.from_private_key_file",
"cirrus_ngs.cfnCluster.ConnectionManager.connect_master",
"cirrus_ngs.cfnCluster.ConnectionManager.execute_command",
"os.getcwd",
"tempfile.NamedTemporaryFile",
"unittest.main",
"sys.stdout.getvalue",
"re.f... | [((3772, 3827), 'unittest.main', 'unittest.main', ([], {'module': '__name__', 'buffer': '(True)', 'exit': '(False)'}), '(module=__name__, buffer=True, exit=False)\n', (3785, 3827), False, 'import unittest\n'), ((326, 355), 'tempfile.NamedTemporaryFile', 'tempfile.NamedTemporaryFile', ([], {}), '()\n', (353, 355), False... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | [
"openerp.osv.fields.selection",
"openerp.osv.fields.many2many"
] | [((1592, 1720), 'openerp.osv.fields.many2many', 'fields.many2many', (['"""res.partner"""', '"""lead_forward_to_partner_res_partner_rel"""', '"""wizard_id"""', '"""partner_id"""', '"""Additional contacts"""'], {}), "('res.partner', 'lead_forward_to_partner_res_partner_rel',\n 'wizard_id', 'partner_id', 'Additional co... |
import tensorflow as tf
from tensorflow.keras.losses import binary_crossentropy,sparse_categorical_crossentropy
from config import Configuration
cfg = Configuration()
class YOLOLoss(tf.losses.Loss):
def __init__(self, anchors):
super(YOLOLoss, self).__init__(reduction="none", name="YOLOLoss")
self.... | [
"tensorflow.shape",
"tensorflow.math.log",
"tensorflow.reduce_sum",
"tensorflow.split",
"tensorflow.keras.losses.binary_crossentropy",
"tensorflow.cast",
"tensorflow.math.is_inf",
"tensorflow.concat",
"tensorflow.maximum",
"tensorflow.zeros_like",
"tensorflow.square",
"tensorflow.stack",
"co... | [((151, 166), 'config.Configuration', 'Configuration', ([], {}), '()\n', (164, 166), False, 'from config import Configuration\n'), ((330, 350), 'tensorflow.constant', 'tf.constant', (['anchors'], {}), '(anchors)\n', (341, 350), True, 'import tensorflow as tf\n'), ((715, 740), 'tensorflow.expand_dims', 'tf.expand_dims',... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2017-08-15 16:23
from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion
import djangoplicity.archives.base
import djangoplicity.archives.fields
class Migratio... | [
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.db.models.ManyToManyField",
"django.db.models.BooleanField",
"django.db.models.SlugField",
"django.db.models.AutoField",
"django.db.models.DateTimeField",
"django.db.models.CharField"
] | [((4222, 4259), 'django.db.models.ManyToManyField', 'models.ManyToManyField', ([], {'to': '"""blog.Tag"""'}), "(to='blog.Tag')\n", (4244, 4259), False, 'from django.db import migrations, models\n'), ((4388, 4466), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'on_delete': 'django.db.models.deletion.CASCADE'... |
# Copyright (c) 2019-2020 steelpy
# Python stdlib imports
# package imports
#from steelpy.codes.aisc.aisc360 import AISC_360_16
#from steelpy.codes.aisc.aisc335 import AISC_335_89
#from steelpy.codes.iso.ISO19902 import ISOCodeCheck
from steelpy.codes.piping.pipeline import Pipeline_Assessment
#from steelpy.codes.api... | [
"steelpy.codes.dnv.pannel.CodeCheckPanel",
"steelpy.codes.piping.pipeline.Pipeline_Assessment",
"steelpy.codes.api.main.API_design"
] | [((884, 896), 'steelpy.codes.api.main.API_design', 'API_design', ([], {}), '()\n', (894, 896), False, 'from steelpy.codes.api.main import API_design\n'), ((968, 989), 'steelpy.codes.piping.pipeline.Pipeline_Assessment', 'Pipeline_Assessment', ([], {}), '()\n', (987, 989), False, 'from steelpy.codes.piping.pipeline impo... |
import os
os.system("pip install pytorch_transformers")
import nsml
print(nsml.DATASET_PATH)
os.system('python ./code/train.py --n-labeled 10 --data-path '+ nsml.DATASET_PATH + '/train/ --batch-size 4 --batch-size-u 8 --epochs 20 --val-iteration 1000 --lambda-u 1 --T 0.5 --alpha 16 --mix-layers-set 7 9 12 --lrmain 0.0... | [
"os.system"
] | [((10, 55), 'os.system', 'os.system', (['"""pip install pytorch_transformers"""'], {}), "('pip install pytorch_transformers')\n", (19, 55), False, 'import os\n'), ((94, 359), 'os.system', 'os.system', (["('python ./code/train.py --n-labeled 10 --data-path ' + nsml.DATASET_PATH +\n '/train/ --batch-size 4 --batch-siz... |
# -*- coding: utf-8 -*-
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
import math
from selenium.webdriver.support.ui import Select
import os
import time
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
link = "http://... | [
"selenium.webdriver.Chrome",
"selenium.webdriver.ChromeOptions",
"selenium.webdriver.support.expected_conditions.text_to_be_present_in_element",
"selenium.webdriver.support.ui.WebDriverWait"
] | [((367, 392), 'selenium.webdriver.ChromeOptions', 'webdriver.ChromeOptions', ([], {}), '()\n', (390, 392), False, 'from selenium import webdriver\n'), ((445, 481), 'selenium.webdriver.Chrome', 'webdriver.Chrome', ([], {'chrome_options': 'opt'}), '(chrome_options=opt)\n', (461, 481), False, 'from selenium import webdriv... |
#!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'
}
DOCUMENTATION = '''
---
module: import_workload_create_instance
short_description: Create NBD ex... | [
"ansible.module_utils.basic.AnsibleModule",
"ansible_collections.os_migrate.os_migrate.plugins.module_utils.server.Server.from_sdk",
"ansible_collections.os_migrate.os_migrate.plugins.module_utils.server.Server.from_data",
"ansible.module_utils.openstack.openstack_cloud_from_module"
] | [((8102, 8144), 'ansible.module_utils.basic.AnsibleModule', 'AnsibleModule', ([], {'argument_spec': 'argument_spec'}), '(argument_spec=argument_spec)\n', (8115, 8144), False, 'from ansible.module_utils.basic import AnsibleModule\n'), ((8177, 8212), 'ansible.module_utils.openstack.openstack_cloud_from_module', 'openstac... |
from abc import ABC
from typing import List, Optional, Union
import numpy as np
from allopy import OptData
from allopy.penalty import NoPenalty, Penalty
__all__ = ["AbstractObjectiveBuilder", "AbstractConstraintBuilder"]
class AbstractObjectiveBuilder(ABC):
def __init__(self, data: List[OptData], cvar_data: Li... | [
"allopy.penalty.NoPenalty",
"allopy.OptData"
] | [((2494, 2515), 'allopy.OptData', 'OptData', (['d', 'time_unit'], {}), '(d, time_unit)\n', (2501, 2515), False, 'from allopy import OptData\n'), ((1054, 1080), 'allopy.penalty.NoPenalty', 'NoPenalty', (['self.num_assets'], {}), '(self.num_assets)\n', (1063, 1080), False, 'from allopy.penalty import NoPenalty, Penalty\n... |
import os
import pandas as pd
import matplotlib.pyplot as plt
wine_df = pd.read_csv(filepath_or_buffer='~/class5-homework/wine.data',
sep=',',
header=None)
wine_df.columns = ['Class','Alcohol','Malic_Acid','Ash','Alcalinity_of_Ash','Magnesium',
'Total_Phenols','Flavanoid... | [
"matplotlib.pyplot.savefig",
"os.makedirs",
"pandas.read_csv",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.title"
] | [((73, 160), 'pandas.read_csv', 'pd.read_csv', ([], {'filepath_or_buffer': '"""~/class5-homework/wine.data"""', 'sep': '""","""', 'header': 'None'}), "(filepath_or_buffer='~/class5-homework/wine.data', sep=',',\n header=None)\n", (84, 160), True, 'import pandas as pd\n'), ((493, 529), 'os.makedirs', 'os.makedirs', (... |
import numpy as np
"""
Contains preprocessing code for creating additional information based on MRI volumes and true segmentation maps (asegs).
Eg. weight masks for median frequency class weighing, edge weighing etc.
"""
def create_weight_mask(aseg):
"""
Main function for calculating weight mask of segmentati... | [
"numpy.median",
"numpy.unique",
"numpy.array",
"numpy.zeros",
"numpy.zeros_like"
] | [((756, 788), 'numpy.zeros', 'np.zeros', (['(h, w, d)'], {'dtype': 'float'}), '((h, w, d), dtype=float)\n', (764, 788), True, 'import numpy as np\n'), ((1441, 1476), 'numpy.unique', 'np.unique', (['aseg'], {'return_counts': '(True)'}), '(aseg, return_counts=True)\n', (1450, 1476), True, 'import numpy as np\n'), ((2410,... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
###
# Copyright (2016-2020) Hewlett Packard Enterprise Development LP
#
# Licensed under the Apache License, Version 2.0 (the "License");
# You may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licen... | [
"oneview_module_loader.HypervisorClusterProfileFactsModule",
"mock.Mock",
"pytest.mark.resource",
"pytest.main",
"copy.deepcopy"
] | [((1278, 1374), 'pytest.mark.resource', 'pytest.mark.resource', ([], {'TestHypervisorClusterProfileFactsModule': '"""hypervisor_cluster_profiles"""'}), "(TestHypervisorClusterProfileFactsModule=\n 'hypervisor_cluster_profiles')\n", (1298, 1374), False, 'import pytest\n'), ((4357, 4380), 'pytest.main', 'pytest.main',... |
import os
import scipy
import numpy as np
import pandas as pd
import torch
from torch.autograd import Variable
def predict_batch(net, inputs):
v = Variable(inputs.cuda(), volatile=True)
return net(v).data.cpu().numpy()
def get_probabilities(model, loader):
model.eval()
return np.vstack(predict_batch... | [
"numpy.copy",
"numpy.mean",
"scipy.stats.mode",
"torch.max",
"numpy.empty",
"numpy.vstack",
"scipy.stats.mstats.gmean"
] | [((411, 425), 'numpy.copy', 'np.copy', (['probs'], {}), '(probs)\n', (418, 425), True, 'import numpy as np\n'), ((568, 592), 'torch.max', 'torch.max', (['output'], {'dim': '(1)'}), '(output, dim=1)\n', (577, 592), False, 'import torch\n'), ((988, 1016), 'numpy.vstack', 'np.vstack', (['[targets, target]'], {}), '([targe... |
import click
import logging
import matplotlib
import matplotlib.pyplot as plt
import joblib
import fact.io
from ..configuration import AICTConfig
from ..plotting import (
plot_regressor_confusion,
plot_bias_resolution,
plot_feature_importances,
)
if matplotlib.get_backend() == 'pgf':
from matplotlib.b... | [
"logging.getLogger",
"logging.basicConfig",
"click.option",
"matplotlib.get_backend",
"matplotlib.pyplot.figure",
"click.Path",
"joblib.load",
"click.command",
"matplotlib.backends.backend_pdf.PdfPages",
"matplotlib.pyplot.show"
] | [((422, 437), 'click.command', 'click.command', ([], {}), '()\n', (435, 437), False, 'import click\n'), ((760, 829), 'click.option', 'click.option', (['"""-k"""', '"""--key"""'], {'help': '"""HDF5 key for hdf5"""', 'default': '"""data"""'}), "('-k', '--key', help='HDF5 key for hdf5', default='data')\n", (772, 829), Fal... |
##########################################################################
#
# MRC FGU Computational Genomics Group
#
# $Id$
#
# Copyright (C) 2009 <NAME>
#
# 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 Fre... | [
"os.path.join",
"tempfile.mkdtemp",
"os.path.basename",
"shutil.rmtree",
"CGAT.IOTools.openFile"
] | [((1943, 1961), 'tempfile.mkdtemp', 'tempfile.mkdtemp', ([], {}), '()\n', (1959, 1961), False, 'import tempfile\n'), ((2775, 2794), 'os.path.basename', 'os.path.basename', (['x'], {}), '(x)\n', (2791, 2794), False, 'import os\n'), ((3405, 3432), 'CGAT.IOTools.openFile', 'IOTools.openFile', (['f[0]', '"""r"""'], {}), "(... |
# Copyright (c) 2019 <NAME> and <NAME>
#
# This file is part of the LipidFinder software tool and governed by the
# 'MIT License'. Please see the LICENSE file that should have been
# included as part of this software.
"""Represent a DataFrame to be processed with LipidFinder's workflow."""
import glob
import logging
i... | [
"logging.getLogger",
"pandas.read_csv",
"os.path.join",
"os.path.splitext",
"os.path.isdir",
"pandas.read_excel"
] | [((9947, 9972), 'logging.getLogger', 'logging.getLogger', (['module'], {}), '(module)\n', (9964, 9972), False, 'import logging\n'), ((3932, 3950), 'os.path.isdir', 'os.path.isdir', (['src'], {}), '(src)\n', (3945, 3950), False, 'import os\n'), ((11243, 11287), 'pandas.read_csv', 'pandas.read_csv', (['src'], {'float_pre... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.framework import ops
from tensorflow.python.ops import variables
from tensorflow.python.ops import array_ops
from tensorflow.python.framework import sparse_tensor
from tensorflow.python.o... | [
"tensorflow.python.framework.ops.RegisterGradient",
"tensorflow.python.ops.gen_fused_embedding_ops.fused_embedding_sparse_post_look_up",
"tensorflow.python.ops.array_ops.gather",
"tensorflow.python.framework.ops.colocate_with",
"tensorflow.python.ops.gen_fused_embedding_ops.fused_embedding_sparse_pre_look_u... | [((3667, 3722), 'tensorflow.python.framework.ops.RegisterGradient', 'ops.RegisterGradient', (['"""FusedEmbeddingLocalSparseLookUp"""'], {}), "('FusedEmbeddingLocalSparseLookUp')\n", (3687, 3722), False, 'from tensorflow.python.framework import ops\n'), ((4217, 4271), 'tensorflow.python.framework.ops.RegisterGradient', ... |
#!/usr/bin/env python3
#
# Author: <NAME>
# License: BSD 2-clause
# Last Change: Sun May 09, 2021 at 02:52 AM +0200
import numpy as np
ARRAY_TYPE = 'np'
def read_branch(ntp, tree, branch, idx=None):
data = ntp[tree][branch].array(library=ARRAY_TYPE)
return data if not idx else data[idx]
def read_branches... | [
"numpy.column_stack"
] | [((623, 644), 'numpy.column_stack', 'np.column_stack', (['data'], {}), '(data)\n', (638, 644), True, 'import numpy as np\n')] |
#!/usr/bin/env python
"""
Test code for the BBox Object
"""
import numpy as np
import pytest
from geometry_utils.bound_box import (BBox,
asBBox,
NullBBox,
InfBBox,
f... | [
"geometry_utils.bound_box.fromBBArray",
"geometry_utils.bound_box.InfBBox",
"geometry_utils.bound_box.BBox",
"numpy.array",
"geometry_utils.bound_box.from_points",
"pytest.raises",
"numpy.isnan",
"numpy.isinf",
"geometry_utils.bound_box.NullBBox",
"geometry_utils.bound_box.asBBox"
] | [((10354, 10387), 'geometry_utils.bound_box.BBox', 'BBox', (['((-23.5, 456), (56, 532.0))'], {}), '(((-23.5, 456), (56, 532.0)))\n', (10358, 10387), False, 'from geometry_utils.bound_box import BBox, asBBox, NullBBox, InfBBox, fromBBArray, from_points\n'), ((10396, 10427), 'geometry_utils.bound_box.BBox', 'BBox', (['((... |
import cv2
cv2.setNumThreads(0)
cv2.ocl.setUseOpenCL(False)
import numpy as np
import math
from functools import wraps
def clip(img, dtype, maxval):
return np.clip(img, 0, maxval).astype(dtype)
def clipped(func):
"""
wrapper to clip results of transform to image dtype value range
"""
... | [
"numpy.clip",
"numpy.ascontiguousarray",
"math.cos",
"numpy.array",
"cv2.warpPerspective",
"numpy.rot90",
"numpy.moveaxis",
"cv2.ocl.setUseOpenCL",
"numpy.where",
"functools.wraps",
"numpy.max",
"numpy.dot",
"cv2.blur",
"cv2.add",
"cv2.merge",
"cv2.warpAffine",
"cv2.getPerspectiveTra... | [((12, 32), 'cv2.setNumThreads', 'cv2.setNumThreads', (['(0)'], {}), '(0)\n', (29, 32), False, 'import cv2\n'), ((34, 61), 'cv2.ocl.setUseOpenCL', 'cv2.ocl.setUseOpenCL', (['(False)'], {}), '(False)\n', (54, 61), False, 'import cv2\n'), ((326, 337), 'functools.wraps', 'wraps', (['func'], {}), '(func)\n', (331, 337), Fa... |
# -*- coding: utf-8 -*-
"""
Created on Mon Aug 14 09:49:13 2017
@author: vmg
"""
import os
import buildingspy.development.regressiontest as r
rt = r.Tester(check_html=False)#,tool="dymola")
LibPath = os.path.join("TRANSFORM")
ResPath = LibPath
rt.showGUI(True)
rt.setLibraryRoot(LibPath, ResPath)
rt.setNumberOfThread... | [
"os.path.join",
"buildingspy.development.regressiontest.Tester"
] | [((149, 175), 'buildingspy.development.regressiontest.Tester', 'r.Tester', ([], {'check_html': '(False)'}), '(check_html=False)\n', (157, 175), True, 'import buildingspy.development.regressiontest as r\n'), ((203, 228), 'os.path.join', 'os.path.join', (['"""TRANSFORM"""'], {}), "('TRANSFORM')\n", (215, 228), False, 'im... |
'''
Configuration generation for running Pancreas datasets
'''
import os, argparse
from pipelines import method_utils, dataloading_utils
from preprocess.process_train_test_data import *
if __name__ == "__main__":
data_dir = "~/gpu/data"
## parse arguments
import argparse
parser = argparse.ArgumentPa... | [
"os.makedirs",
"argparse.ArgumentParser",
"pipelines.dataloading_utils.load_Pancreas_adata",
"pipelines.dataloading_utils.process_loaded_data",
"pipelines.method_utils.run_pipeline"
] | [((301, 360), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Celltyping pipeline."""'}), "(description='Celltyping pipeline.')\n", (324, 360), False, 'import argparse\n'), ((1672, 1713), 'os.makedirs', 'os.makedirs', (['result_prefix'], {'exist_ok': '(True)'}), '(result_prefix, exist_ok=... |
import pandas as pd
from sklearn.preprocessing import StandardScaler
def stand_demo():
data = pd.read_csv("dating.txt")
print(data)
transfer = StandardScaler()
data = transfer.fit_transform(data[['milage', 'Liters', 'Consumtime']])
print("Standardization result: \n", data)
print("Mean of each ... | [
"sklearn.preprocessing.StandardScaler",
"pandas.read_csv"
] | [((99, 124), 'pandas.read_csv', 'pd.read_csv', (['"""dating.txt"""'], {}), "('dating.txt')\n", (110, 124), True, 'import pandas as pd\n'), ((157, 173), 'sklearn.preprocessing.StandardScaler', 'StandardScaler', ([], {}), '()\n', (171, 173), False, 'from sklearn.preprocessing import StandardScaler\n')] |
# -*- coding: utf-8 -*-
"""
Created on Mon Aug 18 22:20:01 2014
@author: baki
"""
import shlex
from subprocess import Popen, PIPE
from .Log import Log
class Shell:
def __init__(self, TAG=""):
self.log = Log(TAG=TAG)
self.current_process = None
self.process_output = None
def setTag(s... | [
"shlex.split",
"subprocess.Popen"
] | [((523, 539), 'shlex.split', 'shlex.split', (['cmd'], {}), '(cmd)\n', (534, 539), False, 'import shlex\n'), ((552, 611), 'subprocess.Popen', 'Popen', (['args'], {'stdout': 'PIPE', 'stderr': 'PIPE', 'cwd': 'cwd', 'shell': 'shell'}), '(args, stdout=PIPE, stderr=PIPE, cwd=cwd, shell=shell)\n', (557, 611), False, 'from sub... |
import os
import six
import copy
import pickle
import random
import logging
from scrapy.http import Request
from scrapy.exceptions import NotConfigured
from scrapy.commands.genspider import sanitize_module_name
from scrapy.spiders import CrawlSpider
from .utils import (
add_sample,
response_to_dict,
get_o... | [
"logging.getLogger",
"scrapy.commands.genspider.sanitize_module_name",
"scrapy.exceptions.NotConfigured",
"copy.deepcopy",
"random.randint"
] | [((446, 473), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (463, 473), False, 'import logging\n'), ((1049, 1096), 'scrapy.exceptions.NotConfigured', 'NotConfigured', (['"""scrapy-autounit is not enabled"""'], {}), "('scrapy-autounit is not enabled')\n", (1062, 1096), False, 'from scrapy... |
import asyncio
import discord
from discord.ext import commands
from discord.ext.commands.core import has_permissions
class cog(commands.Cog):
def __init__(self, client):
self.client = client
@commands.command(aliases=["clear"])
@has_permissions(ban_members=True)
async def purge(self, ctx, cou... | [
"discord.ext.commands.core.has_permissions",
"discord.ext.commands.command",
"asyncio.sleep"
] | [((211, 246), 'discord.ext.commands.command', 'commands.command', ([], {'aliases': "['clear']"}), "(aliases=['clear'])\n", (227, 246), False, 'from discord.ext import commands\n'), ((252, 285), 'discord.ext.commands.core.has_permissions', 'has_permissions', ([], {'ban_members': '(True)'}), '(ban_members=True)\n', (267,... |
from unittest import TestCase
from ..helpers import (
create_web3,
create_contract,
get_future_execution_start_at_timestamp,
proceed_time,
get_prediction_time_shift,
get_purchase_time_shift,
get_shipping_time_shift,
get_publication_time_shift,
get_tournament_id,
get_chain_id,
... | [
"src.web3.get_account_address"
] | [((2847, 2905), 'src.web3.get_account_address', 'get_account_address', (['self.w3_purchaser.eth.default_account'], {}), '(self.w3_purchaser.eth.default_account)\n', (2866, 2905), False, 'from src.web3 import get_account_address\n'), ((3715, 3773), 'src.web3.get_account_address', 'get_account_address', (['self.w3_purcha... |
from scapy.fields import ByteField, ShortField
from scapy.packet import Packet
class TPKT(Packet):
name = "TPKT"
fields_desc = [ByteField("version", 3),
ByteField("reserved", 0),
ShortField("length", 0x0000)]
| [
"scapy.fields.ShortField",
"scapy.fields.ByteField"
] | [((138, 161), 'scapy.fields.ByteField', 'ByteField', (['"""version"""', '(3)'], {}), "('version', 3)\n", (147, 161), False, 'from scapy.fields import ByteField, ShortField\n'), ((182, 206), 'scapy.fields.ByteField', 'ByteField', (['"""reserved"""', '(0)'], {}), "('reserved', 0)\n", (191, 206), False, 'from scapy.fields... |
import argparse
import datetime
def get_last_elapsed_tax_year() -> int:
now = datetime.datetime.now()
if now.date() >= datetime.date(now.year, 4, 6):
return now.year - 1
else:
return now.year - 2
def create_parser() -> argparse.ArgumentParser:
# Schwab transactions
# Montly GBP/U... | [
"datetime.datetime.now",
"datetime.date",
"argparse.ArgumentParser"
] | [((84, 107), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (105, 107), False, 'import datetime\n'), ((635, 788), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Calculate capital gains from stock transactions."""', 'formatter_class': 'argparse.ArgumentDefaultsHelpFor... |
"""Submit a batch task to livy server."""
import argparse
import datetime
import importlib
import json
import logging
import re
import typing
import livy
import livy.cli.config
import livy.cli.logging
logger = logging.getLogger(__name__)
class PreSubmitArguments(argparse.Namespace):
"""Typed :py:class:`~argpars... | [
"logging.getLogger",
"importlib.import_module",
"argparse.ArgumentParser",
"livy.cli.config.load",
"json.dumps",
"argparse.ArgumentTypeError",
"livy.cli.logging.init",
"re.fullmatch",
"datetime.datetime.now",
"livy.cli.logging.get",
"livy.cli.logging.setup_argparse",
"livy.LivyClient",
"livy... | [((212, 239), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (229, 239), False, 'import logging\n'), ((1499, 1521), 'livy.cli.config.load', 'livy.cli.config.load', ([], {}), '()\n', (1519, 1521), False, 'import livy\n'), ((1535, 1599), 'argparse.ArgumentParser', 'argparse.ArgumentParser',... |
"""Minimal setup file for learn project."""
import pathlib
from setuptools import setup, find_packages
# The directory containing this file
HERE = pathlib.Path(__file__).parent
# The text of the README file
README = (HERE / "README.md").read_text()
setup(
name = 'premoji',
version = '0.1.4',
descriptio... | [
"setuptools.find_packages",
"pathlib.Path"
] | [((149, 171), 'pathlib.Path', 'pathlib.Path', (['__file__'], {}), '(__file__)\n', (161, 171), False, 'import pathlib\n'), ((648, 674), 'setuptools.find_packages', 'find_packages', ([], {'where': '"""src"""'}), "(where='src')\n", (661, 674), False, 'from setuptools import setup, find_packages\n')] |
"""
Class that holds the results: used for evaluating model performance on activity cliff compounds
<NAME>, Eindhoven University of Technology, March 2022
"""
import os
import numpy as np
from MoleculeACE.benchmark.utils.const import Algorithms
from .metrics import calc_rmse, calc_q2f3
class Results:
def __init... | [
"os.path.isfile"
] | [((6462, 6486), 'os.path.isfile', 'os.path.isfile', (['filename'], {}), '(filename)\n', (6476, 6486), False, 'import os\n')] |
from pathlib import Path
import weakref
import warnings
from typing import Union, Optional, List
from .merger import select_merge_algorithm
from .constants import DIR_HANGAR
from .remotes import Remotes
from .context import Environments
from .diagnostics import ecosystem, integrity
from .records import heads, parsing,... | [
"warnings.simplefilter",
"weakref.proxy",
"warnings.catch_warnings",
"pathlib.Path"
] | [((5092, 5119), 'weakref.proxy', 'weakref.proxy', (['self._remote'], {}), '(self._remote)\n', (5105, 5119), False, 'import weakref\n'), ((2142, 2152), 'pathlib.Path', 'Path', (['path'], {}), '(path)\n', (2146, 2152), False, 'from pathlib import Path\n'), ((12813, 12850), 'warnings.catch_warnings', 'warnings.catch_warni... |
from pathlib import Path
from re import sub
from shutil import rmtree
from unittest import TestCase
from dotify import Dotify, models
class BaseNameResolverMixin(object):
@classmethod
def get_download_basename(cls, obj):
if isinstance(obj, models.Track):
return cls.get_download_basename_t... | [
"re.sub",
"dotify.Dotify",
"pathlib.Path",
"shutil.rmtree"
] | [((1440, 1448), 'dotify.Dotify', 'Dotify', ([], {}), '()\n', (1446, 1448), False, 'from dotify import Dotify, models\n'), ((1606, 1633), 'shutil.rmtree', 'rmtree', (['self.test_directory'], {}), '(self.test_directory)\n', (1612, 1633), False, 'from shutil import rmtree\n'), ((813, 837), 're.sub', 'sub', (['"""\\\\s+"""... |
import random
import requests
from FIREX.utils import admin_cmd, edit_or_reply, sudo_cmd
from userbot.cmdhelp import CmdHelp
LOVESTR = [
"The best and most beautiful things in this world cannot be seen or even heard, but must be felt with the heart.",
"You know you're in love when you can't fall asleep becau... | [
"userbot.cmdhelp.CmdHelp",
"random.choice",
"requests.get",
"FIREX.utils.sudo_cmd",
"FIREX.utils.edit_or_reply",
"FIREX.utils.admin_cmd"
] | [((22598, 22620), 'random.choice', 'random.choice', (['LOVESTR'], {}), '(LOVESTR)\n', (22611, 22620), False, 'import random\n'), ((22473, 22515), 'FIREX.utils.admin_cmd', 'admin_cmd', ([], {'pattern': 'f"""love$"""', 'outgoing': '(True)'}), "(pattern=f'love$', outgoing=True)\n", (22482, 22515), False, 'from FIREX.utils... |
############
# Standard #
############
import math
###############
# Third Party #
###############
import ophyd
import pytest
##########
# Module #
##########
from detrot import ConeJoint, AngledJoint, StandPoint, Point
from conftest import PseudoMotor
@pytest.fixture(scope='function')
def pseudo_cone():
angled... | [
"pytest.approx",
"conftest.PseudoMotor",
"detrot.Point",
"detrot.ConeJoint.model",
"pytest.fixture",
"detrot.AngledJoint",
"detrot.AngledJoint.model"
] | [((258, 290), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""function"""'}), "(scope='function')\n", (272, 290), False, 'import pytest\n'), ((473, 505), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""function"""'}), "(scope='function')\n", (487, 505), False, 'import pytest\n'), ((3125, 3156), 'detrot.An... |
import numpy as np
from urban_AD_env.utils import rotated_rectangles_intersect
def test_rotated_rectangles_intersect():
assert rotated_rectangles_intersect(([12.86076812, 28.60182391], 5.0, 2.0, -0.4675779906495494),
([9.67753944, 28.90585412], 5.0, 2.0, -0.341701936447320... | [
"urban_AD_env.utils.rotated_rectangles_intersect"
] | [((134, 293), 'urban_AD_env.utils.rotated_rectangles_intersect', 'rotated_rectangles_intersect', (['([12.86076812, 28.60182391], 5.0, 2.0, -0.4675779906495494)', '([9.67753944, 28.90585412], 5.0, 2.0, -0.3417019364473201)'], {}), '(([12.86076812, 28.60182391], 5.0, 2.0, -\n 0.4675779906495494), ([9.67753944, 28.9058... |
"""Functions that test server functions."""
import pytest
from pyramid.httpexceptions import HTTPBadRequest, HTTPNotFound
from datetime import datetime
from learning_journal.models import Entry
def test_list_view_returns_list_of_entries_in_dict(dummy_request):
"""Test for the list_view function."""
from learn... | [
"learning_journal.views.default.create_view",
"learning_journal.views.default.list_view",
"datetime.datetime.now",
"pytest.raises",
"learning_journal.views.default.about_view",
"learning_journal.views.default.detail_view"
] | [((378, 402), 'learning_journal.views.default.list_view', 'list_view', (['dummy_request'], {}), '(dummy_request)\n', (387, 402), False, 'from learning_journal.views.default import list_view\n'), ((1061, 1085), 'learning_journal.views.default.list_view', 'list_view', (['dummy_request'], {}), '(dummy_request)\n', (1070, ... |
from aiohttp import ClientSession, FormData
from Findclone import __version__
from .models import Account, Profiles, Histories, get_builder
from .utils import random_string, paint_boxes
from .exceptions import a_error_handler, FindcloneError
from io import BufferedReader, BytesIO
class FindcloneAsync:
"""async f... | [
"aiohttp.ClientSession",
"aiohttp.FormData"
] | [((458, 473), 'aiohttp.ClientSession', 'ClientSession', ([], {}), '()\n', (471, 473), False, 'from aiohttp import ClientSession, FormData\n'), ((3353, 3363), 'aiohttp.FormData', 'FormData', ([], {}), '()\n', (3361, 3363), False, 'from aiohttp import ClientSession, FormData\n')] |
#!/usr/bin/env python3
# Standalone script which rebuilds the history of maintainership
#
# Copyright (C) 2015 Intel Corporation
# Author: <NAME> <<EMAIL>>
#
# Licensed under the MIT license, see COPYING.MIT for details
import sys
import os.path
import optparse
import logging
sys.path.insert(0, os.path.realpath(os.p... | [
"layerindex.utils.lock_file",
"re.compile",
"rrs.models.RecipeMaintainer",
"rrs.models.RecipeMaintenanceLink.link_maintainer",
"rrs.models.RecipeMaintainer.objects.filter",
"layerindex.utils.setup_django",
"sys.exit",
"layerindex.models.Recipe.objects.filter",
"rrs.models.Maintainer.objects.get_or_c... | [((427, 441), 'common.common_setup', 'common_setup', ([], {}), '()\n', (439, 441), False, 'from common import common_setup, get_logger, DryRunRollbackException\n'), ((485, 505), 'layerindex.utils.setup_django', 'utils.setup_django', ([], {}), '()\n', (503, 505), False, 'from layerindex import utils, recipeparse\n'), ((... |
__author__ = "<NAME>"
__copyright__ = "Copyright 2015-2019, <NAME>"
__email__ = "<EMAIL>"
__license__ = "MIT"
import os
import shutil
import signal
import marshal
import pickle
import json
import time
from base64 import urlsafe_b64encode, b64encode
from functools import lru_cache, partial
from itertools import filterf... | [
"os.pathconf",
"pickle.dumps",
"base64.b64encode",
"snakemake.logging.logger.info",
"os.walk",
"os.remove",
"os.path.exists",
"os.listdir",
"pathlib.Path",
"os.path.isdir",
"os.mkdir",
"os.path.expanduser",
"snakemake.logging.logger.debug",
"os.path.dirname",
"shutil.copyfile",
"os.pat... | [((12485, 12496), 'functools.lru_cache', 'lru_cache', ([], {}), '()\n', (12494, 12496), False, 'from functools import lru_cache, partial\n'), ((12621, 12632), 'functools.lru_cache', 'lru_cache', ([], {}), '()\n', (12630, 12632), False, 'from functools import lru_cache, partial\n'), ((12757, 12768), 'functools.lru_cache... |
"""
Author: <NAME>
Created: 23/11/2020 11:06 AM
"""
import ksl_env
# add basgra nz functions
ksl_env.add_basgra_nz_path()
from supporting_functions.plotting import plot_multiple_results
from check_basgra_python.support_for_tests import establish_org_input, get_lincoln_broadfield, get_woodward_weather, _clean_harves... | [
"check_basgra_python.support_for_tests.get_lincoln_broadfield",
"basgra_python.run_basgra_nz",
"check_basgra_python.support_for_tests._clean_harvest",
"check_basgra_python.support_for_tests.establish_org_input",
"ksl_env.add_basgra_nz_path",
"supporting_functions.plotting.plot_multiple_results"
] | [((97, 125), 'ksl_env.add_basgra_nz_path', 'ksl_env.add_basgra_nz_path', ([], {}), '()\n', (123, 125), False, 'import ksl_env\n'), ((511, 541), 'check_basgra_python.support_for_tests.establish_org_input', 'establish_org_input', (['"""lincoln"""'], {}), "('lincoln')\n", (530, 541), False, 'from check_basgra_python.suppo... |
import telnetlib
import time
def send_command_telnetlib(ipaddress, username, password, enable_pass, command):
t = telnetlib.Telnet("192.168.100.1")
t.read_until(b"Username:")
t.write(username.encode("ascii") + b"\n")
t.read_until(b"Password:")
t.write(password.encode("ascii") + b"\n")
t.writ... | [
"time.sleep",
"telnetlib.Telnet"
] | [((120, 153), 'telnetlib.Telnet', 'telnetlib.Telnet', (['"""192.168.100.1"""'], {}), "('192.168.100.1')\n", (136, 153), False, 'import telnetlib\n'), ((510, 523), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (520, 523), False, 'import time\n')] |
from social_tornado.models import TornadoStorage
from skyportal.models import DBSession, ACL, Role, User, Token, Group
from skyportal.enum_types import LISTENER_CLASSES, sqla_enum_types
from baselayer.app.env import load_env
all_acl_ids = [
'Become user',
'Comment',
'Annotate',
'Manage users',
'Man... | [
"skyportal.models.User",
"skyportal.models.Token",
"skyportal.models.ACL.query.get",
"skyportal.models.Token.query.filter",
"skyportal.models.Group",
"skyportal.models.ACL.create_or_get",
"baselayer.app.env.load_env",
"social_tornado.models.TornadoStorage.user.create_social_auth",
"skyportal.models.... | [((1044, 1054), 'baselayer.app.env.load_env', 'load_env', ([], {}), '()\n', (1052, 1054), False, 'from baselayer.app.env import load_env\n'), ((3150, 3160), 'baselayer.app.env.load_env', 'load_env', ([], {}), '()\n', (3158, 3160), False, 'from baselayer.app.env import load_env\n'), ((3937, 3971), 'skyportal.models.Toke... |
"""
Use this script to evaluate your model. It stores metrics in the file
`scores.txt`.
Input:
predictions (str): filepath. Should be a file that matches the submission
format;
groundtruths (str): filepath. Should be an annotation file.
Usage:
evaluate_classification.py <groundtruths> <predictions> ... | [
"os.path.join",
"pandas.read_csv"
] | [((549, 583), 'pandas.read_csv', 'pd.read_csv', (['groundtruths_filepath'], {}), '(groundtruths_filepath)\n', (560, 583), True, 'import pandas as pd\n'), ((599, 632), 'pandas.read_csv', 'pd.read_csv', (['predictions_filepath'], {}), '(predictions_filepath)\n', (610, 632), True, 'import pandas as pd\n'), ((1285, 1322), ... |
import expressions
import abc
import copy
class Instruction(abc.ABC):
@abc.abstractmethod
def __init__(): ...
@abc.abstractmethod
def wykonaj(self, zmienne) -> dict[str, int]:
'''Evaluate the instruction'''
...
@abc.abstractmethod
def __str__(self): ...
class If(Instruction... | [
"copy.copy"
] | [((670, 688), 'copy.copy', 'copy.copy', (['zmienne'], {}), '(zmienne)\n', (679, 688), False, 'import copy\n'), ((761, 779), 'copy.copy', 'copy.copy', (['zmienne'], {}), '(zmienne)\n', (770, 779), False, 'import copy\n'), ((1420, 1438), 'copy.copy', 'copy.copy', (['zmienne'], {}), '(zmienne)\n', (1429, 1438), False, 'im... |
"""
TODO
"""
from collections import Counter
import simplejson
import yaml
import flask
from sheepdog.errors import (
UserError,
)
def oph_raise_for_duplicates(object_pairs):
"""
Given an list of ordered pairs, contstruct a dict as with the normal JSON
``object_pairs_hook``, but raise an exception ... | [
"collections.Counter",
"simplejson.loads",
"flask.request.get_data"
] | [((416, 451), 'collections.Counter', 'Counter', (['(p[0] for p in object_pairs)'], {}), '(p[0] for p in object_pairs)\n', (423, 451), False, 'from collections import Counter\n'), ((1055, 1120), 'simplejson.loads', 'simplejson.loads', (['raw'], {'object_pairs_hook': 'oph_raise_for_duplicates'}), '(raw, object_pairs_hook... |
# -*- coding: utf-8 -*-
#
# This file is part of Sequana software
#
# Copyright (c) 2016 - Sequana Development Team
#
# File author(s):
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>,
# <<EMAIL>>
#
# Distributed under the terms of the 3-clause BSD license.
# The full license is in the LICENSE file, distr... | [
"os.path.exists",
"easydev.get_package_location",
"os.path.split",
"os.sep.join",
"collections.defaultdict",
"glob.glob"
] | [((1603, 1642), 'easydev.get_package_location', 'easydev.get_package_location', (['"""sequana"""'], {}), "('sequana')\n", (1631, 1642), False, 'import easydev\n'), ((1658, 1709), 'os.sep.join', 'os.sep.join', (["[sequana_path, 'sequana', 'resources']"], {}), "([sequana_path, 'sequana', 'resources'])\n", (1669, 1709), F... |
#!/usr/bin/python3
import cv2
if __name__ == '__main__':
cv2.SIFT_create()
| [
"cv2.SIFT_create"
] | [((61, 78), 'cv2.SIFT_create', 'cv2.SIFT_create', ([], {}), '()\n', (76, 78), False, 'import cv2\n')] |
import io
import pytest
import pytorch_pfn_extras as ppe
from pytorch_pfn_extras.training.extensions import _ipython_module_available
from pytorch_pfn_extras.training.extensions.log_report import _pandas_available
@pytest.mark.skipif(
not _ipython_module_available or not _pandas_available,
reason="print rep... | [
"pytorch_pfn_extras.training.extensions.LogReport",
"pytest.main",
"pytorch_pfn_extras.training.ExtensionsManager",
"pytest.mark.skipif",
"io.StringIO",
"pytorch_pfn_extras.training.extensions.PrintReportNotebook"
] | [((219, 380), 'pytest.mark.skipif', 'pytest.mark.skipif', (['(not _ipython_module_available or not _pandas_available)'], {'reason': '"""print report notebook import failed, maybe ipython is not installed"""'}), "(not _ipython_module_available or not _pandas_available,\n reason=\n 'print report notebook import fai... |
#!/usr/bin/env python3
# Copyright 2017 The Imaging Source Europe GmbH
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | [
"gi.repository.Gst.ElementFactory.make",
"gi.repository.Gst.init",
"gi.require_version"
] | [((723, 756), 'gi.require_version', 'gi.require_version', (['"""Tcam"""', '"""0.1"""'], {}), "('Tcam', '0.1')\n", (741, 756), False, 'import gi\n'), ((757, 789), 'gi.require_version', 'gi.require_version', (['"""Gst"""', '"""1.0"""'], {}), "('Gst', '1.0')\n", (775, 789), False, 'import gi\n'), ((929, 963), 'gi.reposito... |
from .linear_torch import TorchGradientDescentAutogradRegression
import torch, math, random
class stochasticGradientDescent(TorchGradientDescentAutogradRegression):
def __init__(self, X, Y, alpha, **kwargs):
super(stochasticGradientDescent, self).__init__(X, Y, alpha, **kwargs)
try:
h ... | [
"random.shuffle"
] | [((777, 809), 'random.shuffle', 'random.shuffle', (['r', 'random.random'], {}), '(r, random.random)\n', (791, 809), False, 'import torch, math, random\n')] |
import pytest
import ast
from pytest_mock import MockerFixture
from pystratis.api.node import Node
from pystratis.api.node.responsemodels import *
from pystratis.api import FullNodeState, FeatureInitializationState, LogRule
from pystratis.core.networks import StraxMain, CirrusMain
@pytest.mark.parametrize('network', ... | [
"pystratis.core.networks.StraxMain",
"pystratis.core.networks.CirrusMain",
"pystratis.api.LogRule"
] | [((321, 332), 'pystratis.core.networks.StraxMain', 'StraxMain', ([], {}), '()\n', (330, 332), False, 'from pystratis.core.networks import StraxMain, CirrusMain\n'), ((334, 346), 'pystratis.core.networks.CirrusMain', 'CirrusMain', ([], {}), '()\n', (344, 346), False, 'from pystratis.core.networks import StraxMain, Cirru... |
import numpy as np
def get_conf_thresholded(conf, thresh_log_conf, dtype_np):
"""Normalizes a confidence score to (0..1).
Args:
conf (float):
Unnormalized confidence.
dtype_np (type):
Desired return type.
Returns:
confidence (np.float32):
Norma... | [
"numpy.zeros"
] | [((1052, 1107), 'numpy.zeros', 'np.zeros', (['query_2d_full.poses.shape[-1]'], {'dtype': 'dtype_np'}), '(query_2d_full.poses.shape[-1], dtype=dtype_np)\n', (1060, 1107), True, 'import numpy as np\n')] |
"""
Copyright (c) 2017 <NAME>
https://github.com/jeffmer/micropython-ili9341
Jan 6, 2018
MIT License
https://github.com/jeffmer/micropython-ili9341/blob/master/LICENSE
"""
# This is an adapted version of the ILI934X driver as below.
# It works with multiple fonts and also works with the esp32 H/W SPI implementation
#... | [
"time.sleep_ms",
"ustruct.pack",
"micropython.const"
] | [((818, 827), 'micropython.const', 'const', (['(15)'], {}), '(15)\n', (823, 827), False, 'from micropython import const\n'), ((878, 887), 'micropython.const', 'const', (['(17)'], {}), '(17)\n', (883, 887), False, 'from micropython import const\n'), ((912, 921), 'micropython.const', 'const', (['(38)'], {}), '(38)\n', (9... |
import subprocess
import os
import sys
import datetime
import random
from configparser import ConfigParser
from datetime import datetime
import s03_heteroplasmy_likelihood, s04_sort_candidates, s05_select_sites, s06_location_conservation
import multiprocessing
def check_exist(cmd, thing):
try:
subprocess.c... | [
"subprocess.check_output",
"os.path.exists",
"s06_location_conservation.main",
"os.makedirs",
"subprocess.check_call",
"os.path.join",
"os.getcwd",
"sys.exc_info",
"datetime.datetime.now",
"s05_select_sites.process",
"multiprocessing.Pool",
"sys.exit"
] | [((775, 829), 'os.path.join', 'os.path.join', (['SCRIPT_DIR', '"""log_align_analyze_sort.txt"""'], {}), "(SCRIPT_DIR, 'log_align_analyze_sort.txt')\n", (787, 829), False, 'import os\n'), ((1898, 1909), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (1907, 1909), False, 'import os\n'), ((2311, 2342), 'os.path.join', 'os.pa... |
from datetime import datetime
from typing import Any, List
import json
import tempfile
from airflow.models.baseoperator import BaseOperator
from airflow.providers.mongo.hooks.mongo import MongoHook
import pandas
from airflow.providers.siasg.dw.hooks.dw import DWSIASGHook
class DWSIASGRelatorioParaMongoOperator(Base... | [
"json.loads",
"datetime.datetime.now",
"tempfile.NamedTemporaryFile",
"airflow.providers.mongo.hooks.mongo.MongoHook",
"pandas.read_excel",
"airflow.providers.siasg.dw.hooks.dw.DWSIASGHook"
] | [((2489, 2523), 'json.loads', 'json.loads', (['self.respostas_prompts'], {}), '(self.respostas_prompts)\n', (2499, 2523), False, 'import json\n'), ((2637, 2675), 'tempfile.NamedTemporaryFile', 'tempfile.NamedTemporaryFile', ([], {'mode': '"""wb"""'}), "(mode='wb')\n", (2664, 2675), False, 'import tempfile\n'), ((2711, ... |
#!/usr/bin/python3
import sys
import glob
import os
import re
def main():
directory = sys.argv[1]
builddir = sys.argv[2]
extra_module = ""
if(len(sys.argv) > 3):
extra_module = sys.argv[3]
projectModules = {}
for filename in glob.glob(os.path.join(directory, '*.bsv')):
m = re.m... | [
"os.path.join",
"re.match"
] | [((269, 301), 'os.path.join', 'os.path.join', (['directory', '"""*.bsv"""'], {}), "(directory, '*.bsv')\n", (281, 301), False, 'import os\n'), ((316, 349), 're.match', 're.match', (['""".*/(.*).bsv"""', 'filename'], {}), "('.*/(.*).bsv', filename)\n", (324, 349), False, 'import re\n')] |
"""Ingest USGS Bird Banding Laboratory data."""
from pathlib import Path
import pandas as pd
from . import db, util
DATASET_ID = 'bbl'
RAW_DIR = Path('data') / 'raw' / DATASET_ID
BANDING = RAW_DIR / 'Banding'
ENCOUNTERS = RAW_DIR / 'Encounters'
RECAPTURES = RAW_DIR / 'Recaptures'
SPECIES = RAW_DIR / 'species.html'
... | [
"pandas.read_csv",
"pandas.to_datetime",
"pathlib.Path"
] | [((3737, 3784), 'pandas.to_datetime', 'pd.to_datetime', (['df[event_date]'], {'errors': '"""coerce"""'}), "(df[event_date], errors='coerce')\n", (3751, 3784), True, 'import pandas as pd\n'), ((149, 161), 'pathlib.Path', 'Path', (['"""data"""'], {}), "('data')\n", (153, 161), False, 'from pathlib import Path\n'), ((3374... |
# Generated by Django 2.1.10 on 2019-07-19 12:42
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0002_remove_content_type_name'),
('cms_content', '0003_auto_20190719_1232'),
]
operations ... | [
"django.db.migrations.AlterModelOptions",
"django.db.models.PositiveIntegerField",
"django.db.models.ForeignKey"
] | [((332, 478), 'django.db.migrations.AlterModelOptions', 'migrations.AlterModelOptions', ([], {'name': '"""element"""', 'options': "{'ordering': ['position'], 'verbose_name': 'Element', 'verbose_name_plural':\n 'Element'}"}), "(name='element', options={'ordering': [\n 'position'], 'verbose_name': 'Element', 'verbo... |
from direct.directnotify import DirectNotifyGlobal
from direct.fsm import ClassicFSM, State
from direct.fsm import State
from pandac.PandaModules import *
from toontown.battle import BattlePlace
from toontown.building import Elevator
from toontown.coghq import CogHQExterior
from toontown.dna.DNAParser import loadDNAFil... | [
"libpandadna.DNAStorage",
"direct.directnotify.DirectNotifyGlobal.directNotify.newCategory",
"toontown.hood.ZoneUtil.getBranchZone",
"toontown.hood.ZoneUtil.getTrueZoneId",
"toontown.coghq.CogHQExterior.CogHQExterior.enter",
"toontown.dna.DNAParser.loadDNAFileAI"
] | [((508, 571), 'direct.directnotify.DirectNotifyGlobal.directNotify.newCategory', 'DirectNotifyGlobal.directNotify.newCategory', (['"""LawbotHQExterior"""'], {}), "('LawbotHQExterior')\n", (551, 571), False, 'from direct.directnotify import DirectNotifyGlobal\n'), ((617, 671), 'toontown.coghq.CogHQExterior.CogHQExterior... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('convos', '0004_auto_20150511_0945'),
]
operations = [
migrations.AddField(
model_name='convothread',
... | [
"django.db.models.DateTimeField"
] | [((363, 438), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'null': '(True)', 'verbose_name': '"""Last message at"""', 'blank': '(True)'}), "(null=True, verbose_name='Last message at', blank=True)\n", (383, 438), False, 'from django.db import models, migrations\n')] |
#!/usr/bin/env python
import sys
from itertools import chain
from common import open_example_serial_interface
from coax import read_feature_ids, parse_features, Feature, LoadAddressCounterHi, LoadAddressCounterLo, WriteData, EABWriteAlternate, EABLoadMask
def get_features(interface):
commands = read_feature_ids... | [
"coax.LoadAddressCounterHi",
"common.open_example_serial_interface",
"coax.read_feature_ids",
"sys.exit",
"coax.parse_features",
"coax.WriteData",
"coax.LoadAddressCounterLo"
] | [((304, 322), 'coax.read_feature_ids', 'read_feature_ids', ([], {}), '()\n', (320, 322), False, 'from coax import read_feature_ids, parse_features, Feature, LoadAddressCounterHi, LoadAddressCounterLo, WriteData, EABWriteAlternate, EABLoadMask\n'), ((374, 403), 'coax.parse_features', 'parse_features', (['ids', 'commands... |
# coding=utf-8
from Base.DevicesList import devicesList as dl
from Base.Common import Common
class DevicesConnect:
def deviceConnect(self):
commands = []
data = dl().get_Tv_IP()
for IP in data:
cmd = "adb connect %s" %(IP)
commands.append(cmd)
Common().loop... | [
"Base.DevicesList.devicesList",
"Base.Common.Common"
] | [((184, 188), 'Base.DevicesList.devicesList', 'dl', ([], {}), '()\n', (186, 188), True, 'from Base.DevicesList import devicesList as dl\n'), ((307, 315), 'Base.Common.Common', 'Common', ([], {}), '()\n', (313, 315), False, 'from Base.Common import Common\n')] |
# Copyright 2011 The scales Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | [
"greplin.scales.getStats",
"json.dumps",
"six.iteritems",
"six.binary_type"
] | [((1145, 1168), 'six.iteritems', 'six.iteritems', (['statDict'], {}), '(statDict)\n', (1158, 1168), False, 'import six\n'), ((2616, 2633), 'greplin.scales.getStats', 'scales.getStats', ([], {}), '()\n', (2631, 2633), False, 'from greplin import scales\n'), ((4173, 4190), 'greplin.scales.getStats', 'scales.getStats', ([... |
import click
from ..cli import with_context
@click.command('clean', short_help="Cleans a book' output directories")
@with_context
def clean_command(ctx=None):
pass
| [
"click.command"
] | [((47, 117), 'click.command', 'click.command', (['"""clean"""'], {'short_help': '"""Cleans a book\' output directories"""'}), '(\'clean\', short_help="Cleans a book\' output directories")\n', (60, 117), False, 'import click\n')] |
#MenuTitle: Steal Kerning Groups from Font
"""Copy kerning groups from one font to another."""
from __future__ import print_function
import vanilla
class GroupsCopy(object):
"""GUI for copying kerning groups from one font to another"""
def __init__(self):
self.w = vanilla.FloatingWindow((400, 70), "Steal kerning ... | [
"traceback.format_exc",
"vanilla.FloatingWindow",
"vanilla.TextBox",
"vanilla.Button"
] | [((271, 328), 'vanilla.FloatingWindow', 'vanilla.FloatingWindow', (['(400, 70)', '"""Steal kerning groups"""'], {}), "((400, 70), 'Steal kerning groups')\n", (293, 328), False, 'import vanilla\n'), ((355, 433), 'vanilla.TextBox', 'vanilla.TextBox', (['(15, 12 + 2, 130, 14)', '"""Copy groups from:"""'], {'sizeStyle': '"... |
# extdiff.py - external diff program support for mercurial
#
# Copyright 2006 <NAME> <<EMAIL>>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
'''command to allow external programs to compare revisions
The extdiff Mercurial exten... | [
"mercurial.node.short",
"shlex.split",
"mercurial.scmutil.revsingle",
"mercurial.scmutil.match",
"mercurial.scmutil.revpair",
"mercurial.util.uirepr",
"re.search",
"mercurial.util.setflags",
"os.mkdir",
"mercurial.util.Abort",
"mercurial.i18n._",
"os.path.isfile",
"tempfile.mkdtemp",
"merc... | [((2637, 2664), 'os.path.basename', 'os.path.basename', (['repo.root'], {}), '(repo.root)\n', (2653, 2664), False, 'import os, shlex, shutil, tempfile, re\n'), ((2799, 2829), 'os.path.join', 'os.path.join', (['tmproot', 'dirname'], {}), '(tmproot, dirname)\n', (2811, 2829), False, 'import os, shlex, shutil, tempfile, r... |
# encoding: utf-8
import datetime
import numpy as np
import pandas as pd
def get_next_period_day(current, period, n=1, extra_offset=0):
"""
Get the n'th day in next period from current day.
Parameters
----------
current : int
Current date in format "%Y%m%d".
period : str
Inter... | [
"pandas.Series",
"numpy.int64",
"pandas.Timedelta",
"pandas.tseries.offsets.BMonthBegin",
"pandas.tseries.offsets.Week",
"pandas.tseries.offsets.BDay",
"pandas.Timestamp",
"pandas.to_datetime"
] | [((1491, 1526), 'pandas.to_datetime', 'pd.to_datetime', (['dt'], {'format': '"""%Y%m%d"""'}), "(dt, format='%Y%m%d')\n", (1505, 1526), True, 'import pandas as pd\n'), ((2277, 2304), 'pandas.Timedelta', 'pd.Timedelta', ([], {'weeks': 'n_weeks'}), '(weeks=n_weeks)\n', (2289, 2304), True, 'import pandas as pd\n'), ((618, ... |
import flask
from flask import request
import flask_restful as restful
from marshmallow import Schema, fields, validate
from api.helpers import success, created
from api.exceptions import NotFound
from sensors.ds18b20 import lookup
class DS18B20Query (restful.Resource):
def __init__(self, *args, **kwargs):
... | [
"api.helpers.success"
] | [((465, 483), 'api.helpers.success', 'success', (['available'], {}), '(available)\n', (472, 483), False, 'from api.helpers import success, created\n')] |
import deepchem as dc
import numpy as np
import tensorflow as tf
import deepchem.models.tensorgraph.layers as layers
from tensorflow.python.eager import context
from tensorflow.python.framework import test_util
class TestLayersEager(test_util.TensorFlowTestCase):
"""
Test that layers function in eager mode.
"""... | [
"numpy.log",
"deepchem.models.tensorgraph.layers.MaxPool1D",
"deepchem.models.tensorgraph.layers.BatchNorm",
"deepchem.models.tensorgraph.layers.Conv3D",
"deepchem.models.tensorgraph.layers.ReduceMax",
"deepchem.models.tensorgraph.layers.SoftMax",
"deepchem.models.tensorgraph.layers.Gather",
"deepchem... | [((403, 423), 'tensorflow.python.eager.context.eager_mode', 'context.eager_mode', ([], {}), '()\n', (421, 423), False, 'from tensorflow.python.eager import context\n'), ((619, 654), 'deepchem.models.tensorgraph.layers.Conv1D', 'layers.Conv1D', (['filters', 'kernel_size'], {}), '(filters, kernel_size)\n', (632, 654), Tr... |
# Solution of;
# Project Euler Problem 49: Prime permutations
# https://projecteuler.net/problem=49
#
# The arithmetic sequence, 1487, 4817, 8147, in which each of the terms
# increases by 3330, is unusual in two ways: (i) each of the three terms are
# prime, and, (ii) each of the 4-digit numbers are permutations of... | [
"timed.caller"
] | [((755, 789), 'timed.caller', 'timed.caller', (['dummy', 'n', 'i', 'prob_id'], {}), '(dummy, n, i, prob_id)\n', (767, 789), False, 'import timed\n')] |
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
from pathlib import Path
import pandas as pd
from numpy import around
if __name__ == "__main__":
# Harden's PPG is from 2018-19 season
# Bryant's PPG is from 2005-06 season
# Jordan's PPG is from 1986-87 season
per_game_df = pd.read_csv(Path('../data/com... | [
"numpy.around",
"pathlib.Path"
] | [((303, 347), 'pathlib.Path', 'Path', (['"""../data/compare_players_per_game.csv"""'], {}), "('../data/compare_players_per_game.csv')\n", (307, 347), False, 'from pathlib import Path\n'), ((377, 419), 'pathlib.Path', 'Path', (['"""../data/compare_players_per_48.csv"""'], {}), "('../data/compare_players_per_48.csv')\n",... |
# GENERATED BY KOMAND SDK - DO NOT EDIT
from setuptools import setup, find_packages
setup(name="easyvista-rapid7-plugin",
version="1.0.0",
description="EasyVista Service Manager platform supports even the most complex requirements, while bringing a new level of simplicity, agility, and mobility required t... | [
"setuptools.find_packages"
] | [((654, 669), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (667, 669), False, 'from setuptools import setup, find_packages\n')] |
# stdlib
from copy import deepcopy
from functools import wraps
import os
import tempfile
from time import time
# 3p
import mock
# datadog
from datadog import initialize, api, util
from datadog.api import (
Distribution,
Metric,
ServiceCheck
)
from datadog.api.exceptions import ApiError, ApiNotInitialized
... | [
"tests.unit.api.helper.MyListableSubResource.get_items",
"datadog.initialize",
"tests.unit.api.helper.MyAddableSubResource.add_items",
"datadog.api.Monitor.get_all",
"tests.unit.api.helper.MyDeletableSubResource.delete_items",
"copy.deepcopy",
"datadog.util.hostname.get_hostname",
"mock.patch",
"tes... | [((1448, 1497), 'mock.patch', 'mock.patch', (['"""datadog.util.config.get_config_path"""'], {}), "('datadog.util.config.get_config_path')\n", (1458, 1497), False, 'import mock\n'), ((1145, 1157), 'datadog.initialize', 'initialize', ([], {}), '()\n', (1155, 1157), False, 'from datadog import initialize, api, util\n'), (... |
# -*- coding: utf-8 -*-
"""
Core views to provide custom operations
"""
import uuid
from datetime import datetime
from django.http import HttpResponseRedirect
from threepio import logger
from atmosphere import settings
from django_cyverse_auth.decorators import atmo_login_required
from django_cyverse_auth.models imp... | [
"django.http.HttpResponseRedirect",
"uuid.uuid4",
"datetime.datetime.now",
"threepio.logger.info",
"core.models.AtmosphereUser.objects.get",
"threepio.logger.exception",
"threepio.logger.warn"
] | [((481, 557), 'threepio.logger.info', 'logger.info', (["('Emulate attempt: %s wants to be %s' % (request.user, username))"], {}), "('Emulate attempt: %s wants to be %s' % (request.user, username))\n", (492, 557), False, 'from threepio import logger\n'), ((586, 623), 'threepio.logger.info', 'logger.info', (['request.ses... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Check the state of an AWS AMI."""
from __future__ import annotations
import json
from typing import Any, Dict
import boto3
print("Loading function get_image_status")
ec2_client = boto3.client("ec2")
# {
# "instance_id": "i-identifier",
# "kms_id": "KMS ID",
# ... | [
"json.dumps",
"boto3.client"
] | [((232, 251), 'boto3.client', 'boto3.client', (['"""ec2"""'], {}), "('ec2')\n", (244, 251), False, 'import boto3\n'), ((600, 627), 'json.dumps', 'json.dumps', (['event'], {'indent': '(2)'}), '(event, indent=2)\n', (610, 627), False, 'import json\n')] |
'''
Created on June 24, 2019
@author: <NAME>
'''
import copy
import json
import sys
import math
import numbers
import intervals as I
from abc import ABC, abstractmethod
from greenery.lego import parse
from intervals import inf as infinity
import config
import _constants
from canoncalization import canoncalize_object... | [
"canoncalization.canoncalize_object",
"intervals.openclosed",
"intervals.closedopen",
"_utils.validate_schema",
"json.JSONDecoder.__init__",
"intervals.open",
"_utils.print_db",
"intervals.closed",
"greenery.lego.parse",
"sys.exit",
"json.load",
"_utils.is_list",
"_utils.is_dict",
"_utils.... | [((1296, 1317), '_utils.validate_schema', 'validate_schema', (['self'], {}), '(self)\n', (1311, 1317), False, 'from _utils import validate_schema, print_db, is_sub_interval_from_optional_ranges, is_num, is_list, is_dict, is_empty_dict_or_none, is_dict_or_true, one\n'), ((17661, 17710), 'sys.exit', 'sys.exit', (['"""onO... |
"""
Various utilities functions used by django_community and
other apps to perform authentication related tasks.
"""
import hashlib, re
import django.forms as forms
from django.core.exceptions import ObjectDoesNotExist
from django.forms import ValidationError
import django.http as http
from django.conf import setting... | [
"django.contrib.auth.authenticate",
"hashlib.sha256",
"random.randint",
"django.contrib.auth.models.User",
"django_community.models.UserProfile",
"django_community.models.UserOpenID",
"django.contrib.auth.login",
"django.contrib.auth.models.User.objects.all",
"django_community.models.UserOpenID.obje... | [((903, 923), 'django.contrib.auth.logout', 'auth_logout', (['request'], {}), '(request)\n', (914, 923), True, 'from django.contrib.auth import logout as auth_logout\n'), ((2341, 2391), 'django.contrib.auth.authenticate', 'authenticate', ([], {'username': 'username', 'password': 'password'}), '(username=username, passw... |
import os
from pathlib import Path
from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch.actions import IncludeLaunchDescription, SetEnvironmentVariable, Shutdown
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch_ros.a... | [
"launch.actions.SetEnvironmentVariable",
"launch.actions.Shutdown",
"ament_index_python.packages.get_package_share_directory",
"launch.LaunchDescription",
"launch.launch_description_sources.PythonLaunchDescriptionSource",
"launch_ros.actions.Node"
] | [((511, 578), 'launch.actions.SetEnvironmentVariable', 'SetEnvironmentVariable', (['"""RCUTILS_CONSOLE_STDOUT_LINE_BUFFERED"""', '"""1"""'], {}), "('RCUTILS_CONSOLE_STDOUT_LINE_BUFFERED', '1')\n", (533, 578), False, 'from launch.actions import IncludeLaunchDescription, SetEnvironmentVariable, Shutdown\n'), ((601, 661),... |
# A Rapid Proof of Concept for the eDensiometer
# Copyright 2018, <NAME>. All Rights Reserved. Created with contributions from <NAME>.
# Imports
from PIL import Image
from pprint import pprint
import numpy as np
import time as time_
def millis(): # from https://stackoverflow.com/questions/5998245/get-current-time-in-... | [
"numpy.zeros",
"PIL.Image.open",
"time.time"
] | [((653, 708), 'numpy.zeros', 'np.zeros', (['(temp.shape[0], temp.shape[1], temp.shape[2])'], {}), '((temp.shape[0], temp.shape[1], temp.shape[2]))\n', (661, 708), True, 'import numpy as np\n'), ((723, 763), 'numpy.zeros', 'np.zeros', (['(temp.shape[0], temp.shape[1])'], {}), '((temp.shape[0], temp.shape[1]))\n', (731, ... |
from core.utilities.functions import delete_message
from core.utilities.message import message
from core.database.repository.group import GroupRepository
"""
This function allows you to terminate the type
of file that contains a message on telegram and filter it
"""
def init(update, context):
apk = 'application/vnd... | [
"core.database.repository.group.GroupRepository",
"core.utilities.functions.delete_message",
"core.utilities.message.message"
] | [((895, 912), 'core.database.repository.group.GroupRepository', 'GroupRepository', ([], {}), '()\n', (910, 912), False, 'from core.database.repository.group import GroupRepository\n'), ((1068, 1099), 'core.utilities.functions.delete_message', 'delete_message', (['update', 'context'], {}), '(update, context)\n', (1082, ... |
from behave.matchers import RegexMatcher
from ahk import AHK
from behave_classy import step_impl_base
Base = step_impl_base()
class AHKSteps(AHK, Base):
@Base.given(u'the mouse position is ({xpos:d}, {ypos:d})')
def given_mouse_move(self, xpos, ypos):
self.mouse_move(x=xpos, y=ypos)
@Base.when(u... | [
"behave_classy.step_impl_base"
] | [((110, 126), 'behave_classy.step_impl_base', 'step_impl_base', ([], {}), '()\n', (124, 126), False, 'from behave_classy import step_impl_base\n')] |
import numpy as nm
from sfepy.linalg import dot_sequences
from sfepy.terms.terms import Term, terms
class DivGradTerm(Term):
r"""
Diffusion term.
:Definition:
.. math::
\int_{\Omega} \nu\ \nabla \ul{v} : \nabla \ul{u} \mbox{ , }
\int_{\Omega} \nu\ \nabla \ul{u} : \nabla \ul{w} \\
... | [
"numpy.array",
"sfepy.linalg.dot_sequences",
"numpy.ones",
"numpy.ascontiguousarray"
] | [((11757, 11785), 'numpy.ascontiguousarray', 'nm.ascontiguousarray', (['div_bf'], {}), '(div_bf)\n', (11777, 11785), True, 'import numpy as nm\n'), ((1821, 1863), 'numpy.ones', 'nm.ones', (['(1, n_qp, 1, 1)'], {'dtype': 'nm.float64'}), '((1, n_qp, 1, 1), dtype=nm.float64)\n', (1828, 1863), True, 'import numpy as nm\n')... |
# Generated by Django 3.1.1 on 2021-09-21 04:52
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('crawler', '0012_auto_20210921_0451'),
]
operations = [
migrations.AlterField(
model_name='crawlerline',
name='ustatu... | [
"django.db.models.PositiveIntegerField"
] | [((342, 403), 'django.db.models.PositiveIntegerField', 'models.PositiveIntegerField', ([], {'blank': '(True)', 'default': '(1)', 'null': '(True)'}), '(blank=True, default=1, null=True)\n', (369, 403), False, 'from django.db import migrations, models\n')] |
#!/usr/bin/env python
#
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import logging
import os
import sys
import tempfile
from subprocess import PIPE, CalledProcessError, check_call # nosec
from typing import List, Optional
from onefuzztypes.models import NotificationConfig
from onefuzzty... | [
"onefuzz.api.Onefuzz",
"tempfile.TemporaryDirectory",
"logging.getLogger",
"subprocess.check_call",
"os.getcwd",
"os.chdir"
] | [((1008, 1049), 'subprocess.check_call', 'check_call', (['cmd'], {'stderr': 'PIPE', 'stdout': 'PIPE'}), '(cmd, stderr=PIPE, stdout=PIPE)\n', (1018, 1049), False, 'from subprocess import PIPE, CalledProcessError, check_call\n'), ((2596, 2605), 'onefuzz.api.Onefuzz', 'Onefuzz', ([], {}), '()\n', (2603, 2605), False, 'fro... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import itertools
import operator
from collections import OrderedDict, defaultdict
from functools import reduce
import six
from .formatters import DEFAULT_FORMATTER, DEFAULT_LENGTH
from .utils import is_site_package, is_st... | [
"operator.attrgetter",
"collections.OrderedDict",
"functools.reduce",
"operator.methodcaller",
"collections.defaultdict"
] | [((4131, 4297), 'collections.OrderedDict', 'OrderedDict', (["(('stdlib', StdLibGroup), ('sitepackages', SitePackagesGroup), ('packages',\n PackagesGroup), ('local', LocalGroup), ('remainder', RemainderGroup))"], {}), "((('stdlib', StdLibGroup), ('sitepackages', SitePackagesGroup),\n ('packages', PackagesGroup), (... |
"""
Function convert lists of 10 elements
into in the format of phone number
Example,
(123) 456-789
"""
def create_phone_number(n: list) -> str:
"""
>>> create_phone_number([1,2,3,4,5,6,7,8,9,0])
'(123) 456-7890'
"""
return "({}{}{}) {}{}{}-{}{}{}{}".format(*n)
if __name__ == "__main__... | [
"doctest.testmod"
] | [((347, 364), 'doctest.testmod', 'doctest.testmod', ([], {}), '()\n', (362, 364), False, 'import doctest\n')] |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import cv2
import imageio
import numpy as np
from tar.miscellaneous import convert_flow_to_color
prev = imageio.imread("ressources/1_1.png")
prev = cv2.cvtColor(prev, cv2.COLOR_RGB2GRAY)
curr = imageio.imread("ressources/1_2.png")
curr = cv2.cvtColor(curr, cv2.COLOR_RGB... | [
"tar.miscellaneous.convert_flow_to_color",
"imageio.imsave",
"cv2.cvtColor",
"imageio.imread",
"cv2.calcOpticalFlowFarneback"
] | [((154, 190), 'imageio.imread', 'imageio.imread', (['"""ressources/1_1.png"""'], {}), "('ressources/1_1.png')\n", (168, 190), False, 'import imageio\n'), ((198, 236), 'cv2.cvtColor', 'cv2.cvtColor', (['prev', 'cv2.COLOR_RGB2GRAY'], {}), '(prev, cv2.COLOR_RGB2GRAY)\n', (210, 236), False, 'import cv2\n'), ((244, 280), 'i... |
# -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt
def plot_loss(model, n_iter):
plt.figure()
plt.plot(model.trainloss, 'b-', model.validloss, 'r-')
plt.xlim(0, n_iter)
plt.xlabel('iteration')
plt.ylabel('loss')
plt.title('learning curve')
plt.legend(['training loss... | [
"matplotlib.pyplot.ylabel",
"numpy.hstack",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.title",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.show"
] | [((111, 123), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (121, 123), True, 'import matplotlib.pyplot as plt\n'), ((128, 182), 'matplotlib.pyplot.plot', 'plt.plot', (['model.trainloss', '"""b-"""', 'model.validloss', '"""r-"""'], {}), "(model.trainloss, 'b-', model.validloss, 'r-')\n", (136, 182), True,... |
#!/usr/bin/python
import logging
# create logger
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
# create console handler and set level to debug
ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)
# create file handler which and set level to debug
fh = logging.FileHandler('pythonLogging.log')
fh.setLev... | [
"logging.getLogger",
"logging.Formatter",
"logging.StreamHandler",
"logging.FileHandler"
] | [((59, 78), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (76, 78), False, 'import logging\n'), ((163, 186), 'logging.StreamHandler', 'logging.StreamHandler', ([], {}), '()\n', (184, 186), False, 'import logging\n'), ((270, 310), 'logging.FileHandler', 'logging.FileHandler', (['"""pythonLogging.log"""'], ... |
from sys import argv
from server.AServer import AServer
if '--old' in argv:
from server.server import Server
Server()
else:
AServer( websocket='--websocket' in argv ).Start()
| [
"server.AServer.AServer",
"server.server.Server"
] | [((114, 122), 'server.server.Server', 'Server', ([], {}), '()\n', (120, 122), False, 'from server.server import Server\n'), ((130, 170), 'server.AServer.AServer', 'AServer', ([], {'websocket': "('--websocket' in argv)"}), "(websocket='--websocket' in argv)\n", (137, 170), False, 'from server.AServer import AServer\n')] |
#!/usr/bin/env python2.7
from common import *
from random import randint, choice
registers = {\
"a" : int("0000", 2),
"f" : int("0001", 2),
"b" : int("0010", 2),
"c" : int("0011", 2),
"d" : int("0100", 2),
"e" : int("0101", 2),
"h" : int("0110", 2),
"l" : int("0111", 2),
"af" : int("1000", 2),
"bc" : int("1001... | [
"random.randint"
] | [((2423, 2436), 'random.randint', 'randint', (['(0)', '(1)'], {}), '(0, 1)\n', (2430, 2436), False, 'from random import randint, choice\n'), ((2548, 2565), 'random.randint', 'randint', (['(0)', '(65535)'], {}), '(0, 65535)\n', (2555, 2565), False, 'from random import randint, choice\n')] |
import os
import sys
def find_docs_root() -> str:
filepath = os.path.abspath(__file__)
path_chunks = filepath.split(os.path.sep)
while path_chunks[-1] != "docs":
path_chunks.pop()
return os.path.sep.join(path_chunks)
sys.path.append(find_docs_root())
from _rtd_conf import *
from _sphinx_conf... | [
"os.path.abspath",
"os.path.sep.join"
] | [((67, 92), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (82, 92), False, 'import os\n'), ((213, 242), 'os.path.sep.join', 'os.path.sep.join', (['path_chunks'], {}), '(path_chunks)\n', (229, 242), False, 'import os\n')] |
import socket
import click
import uvicorn # type: ignore
def get_address(default: str = "127.0.0.1") -> str:
try:
ip_address = socket.gethostbyname(socket.gethostname())
except socket.gaierror:
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
try:
s.connect(("8.8.8.8"... | [
"socket.socket",
"uvicorn.run",
"click.group",
"click.option",
"socket.gethostname"
] | [((500, 513), 'click.group', 'click.group', ([], {}), '()\n', (511, 513), False, 'import click\n'), ((581, 650), 'click.option', 'click.option', (['"""--host"""'], {'default': 'None', 'help': '"""Specify application host"""'}), "('--host', default=None, help='Specify application host')\n", (593, 650), False, 'import cl... |
import pytheia as pt
import os
import numpy as np
def test_track_set_descriptor_read_write():
recon = pt.sfm.Reconstruction()
view_id1 = recon.AddView("0",0.0)
m_view1 = recon.MutableView(view_id1)
m_view1.IsEstimated = True
view_id2 = recon.AddView("1",1.0)
m_view2 = recon.MutableView(view_id2... | [
"pytheia.io.ReadReconstruction",
"numpy.asarray",
"pytheia.sfm.Reconstruction",
"pytheia.io.WriteReconstruction",
"os.remove"
] | [((107, 130), 'pytheia.sfm.Reconstruction', 'pt.sfm.Reconstruction', ([], {}), '()\n', (128, 130), True, 'import pytheia as pt\n'), ((523, 555), 'numpy.asarray', 'np.asarray', (['[100, 200, 300, 400]'], {}), '([100, 200, 300, 400])\n', (533, 555), True, 'import numpy as np\n'), ((678, 718), 'pytheia.io.WriteReconstruct... |
# -*- coding: utf-8 -*-
"""
@author: <NAME>.
Department of Aerodynamics
Faculty of Aerospace Engineering
TU Delft, Delft, Netherlands
"""
from numpy import sin, cos, pi
from objects.CSCG._3d.exact_solutions.status.incompressible_Navier_Stokes.base import incompressible_NavierStokes_Base
fro... | [
"numpy.sin",
"objects.CSCG._3d.fields.vector.main._3dCSCG_VectorField",
"numpy.cos"
] | [((918, 933), 'numpy.cos', 'cos', (['(2 * pi * z)'], {}), '(2 * pi * z)\n', (921, 933), False, 'from numpy import sin, cos, pi\n'), ((1126, 1141), 'numpy.sin', 'sin', (['(2 * pi * z)'], {}), '(2 * pi * z)\n', (1129, 1141), False, 'from numpy import sin, cos, pi\n'), ((1333, 1348), 'numpy.sin', 'sin', (['(2 * pi * x)'],... |
import os
BEHIND_REVERSE_PROXY = bool(os.environ.get('BBBS_BEHIND_REVERSE_PROXY', False))
POSTS_PER_PAGE = 25
TEMPLATES_AUTO_RELOAD = True
RECAPTCHA_ENABLED = os.environ.get('BBBS_RECAPTCHA_ENABLED', False)
RECAPTCHA_SITE_KEY = os.environ.get('BBBS_RECAPTCHA_SITE_KEY', 'CHANGEGME')
RECAPTCHA_SECRET_KEY = os.environ... | [
"os.environ.get"
] | [((163, 210), 'os.environ.get', 'os.environ.get', (['"""BBBS_RECAPTCHA_ENABLED"""', '(False)'], {}), "('BBBS_RECAPTCHA_ENABLED', False)\n", (177, 210), False, 'import os\n'), ((232, 286), 'os.environ.get', 'os.environ.get', (['"""BBBS_RECAPTCHA_SITE_KEY"""', '"""CHANGEGME"""'], {}), "('BBBS_RECAPTCHA_SITE_KEY', 'CHANGE... |