code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
# -*- encoding: utf-8 -*-
##############################################################################
#
# Acrisel LTD
# Copyright (C) 2008- Acrisel (acrisel.com) . All Rights Reserved
#
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public... | [
"logging.getLogger",
"argparse.ArgumentParser"
] | [((1267, 1286), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (1284, 1286), False, 'import logging\n'), ((1549, 1574), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1572, 1574), False, 'import argparse\n')] |
from Bio import SeqIO
from Bio.Seq import Seq
from Bio.Alphabet import generic_dna
import numpy
import sys
import re
###Definitions###
infile = sys.argv[1]
###Functions###
def get_scaff_names(file):
names = []
for seq in SeqIO.parse(file, 'fasta'):
names.append(seq.id)
return names
def get_sca... | [
"numpy.sum",
"Bio.SeqIO.parse",
"Bio.SeqIO.index",
"re.sub",
"re.findall"
] | [((960, 988), 'Bio.SeqIO.index', 'SeqIO.index', (['infile', '"""fasta"""'], {}), "(infile, 'fasta')\n", (971, 988), False, 'from Bio import SeqIO\n'), ((234, 260), 'Bio.SeqIO.parse', 'SeqIO.parse', (['file', '"""fasta"""'], {}), "(file, 'fasta')\n", (245, 260), False, 'from Bio import SeqIO\n'), ((1075, 1097), 'numpy.s... |
import json
import random
from flask import Flask, request
from flask_restplus import Resource, Api, Namespace
import os
from datetime import date, datetime
from faker import Faker
import security
fake = Faker('en_AU')
## load bsb data into memory
with open('./resources/bsbs.json') as json_file:
bsbs = json.load(... | [
"faker.Faker",
"json.load",
"flask_restplus.Namespace",
"random.choice"
] | [((205, 219), 'faker.Faker', 'Faker', (['"""en_AU"""'], {}), "('en_AU')\n", (210, 219), False, 'from faker import Faker\n'), ((338, 391), 'flask_restplus.Namespace', 'Namespace', (['"""account"""'], {'description': '"""Account Namespace"""'}), "('account', description='Account Namespace')\n", (347, 391), False, 'from f... |
import subprocess
import shutil
from tqdm import tqdm
import torch
import os
import argparse
import sys
from pathlib import Path
from cosypose.config import PROJECT_DIR, RESULTS_DIR
TOOLKIT_DIR = Path(PROJECT_DIR / 'deps' / 'bop_toolkit_challenge')
EVAL_SCRIPT_PATH = TOOLKIT_DIR / 'scripts/eval_bop19.py'
... | [
"cosypose.config.PROJECT_DIR.as_posix",
"argparse.ArgumentParser",
"pathlib.Path",
"torch.load",
"os.environ.copy",
"shutil.copy",
"bop_toolkit_lib.inout.save_bop_results"
] | [((209, 261), 'pathlib.Path', 'Path', (["(PROJECT_DIR / 'deps' / 'bop_toolkit_challenge')"], {}), "(PROJECT_DIR / 'deps' / 'bop_toolkit_challenge')\n", (213, 261), False, 'from pathlib import Path\n'), ((586, 627), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (['"""Bop evaluation"""'], {}), "('Bop evaluation')... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-08-30 06:34
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pcari', '0025_auto_20160829_1929'),
]
operations = [
migrations.AddField(
... | [
"django.db.models.CharField"
] | [((407, 450), 'django.db.models.CharField', 'models.CharField', ([], {'default': '""""""', 'max_length': '(50)'}), "(default='', max_length=50)\n", (423, 450), False, 'from django.db import migrations, models\n')] |
import psycopg2 as pg
import os
import logging
DATABASE_HOSTNAME = 'localhost'
DATABASE_USERNAME = 'enviso'
DATABASE_PASSWORD = '<PASSWORD>'
def connect_database():
'''
This method is used to connect to a postgresql database and return the
connection object.
'''
try:
logging.... | [
"psycopg2.connect",
"logging.warning",
"logging.info",
"logging.error"
] | [((312, 353), 'logging.info', 'logging.info', (['"""Connecting to database..."""'], {}), "('Connecting to database...')\n", (324, 353), False, 'import logging\n'), ((375, 499), 'psycopg2.connect', 'pg.connect', ([], {'host': 'DATABASE_HOSTNAME', 'database': '"""stock_price_analysis"""', 'user': 'DATABASE_USERNAME', 'pa... |
#!/usr/bin/env python
from __future__ import print_function
import cv2
class Button(object):
def __init__(self, text, x, y, width, height, command=None):
self.text = text
self.x = x
self.y = y
self.width = width
self.height = height
self.left = x
... | [
"cv2.setMouseCallback",
"cv2.imshow",
"cv2.putText",
"cv2.circle",
"cv2.destroyAllWindows",
"cv2.VideoCapture",
"cv2.waitKey"
] | [((1687, 1706), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (1703, 1706), False, 'import cv2\n'), ((3194, 3217), 'cv2.destroyAllWindows', 'cv2.destroyAllWindows', ([], {}), '()\n', (3215, 3217), False, 'import cv2\n'), ((2647, 2724), 'cv2.putText', 'cv2.putText', (['frame', '"""ESC - QUIT"""', '(wid... |
# Generated by Django 3.1 on 2022-04-12 10:34
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0005_textdescriptioncomponent'),
]
operations = [
migrations.AddField(
model_name='textcomponent',
name='text_e... | [
"django.db.models.TextField"
] | [((342, 391), 'django.db.models.TextField', 'models.TextField', ([], {'null': '(True)', 'verbose_name': '"""Текст"""'}), "(null=True, verbose_name='Текст')\n", (358, 391), False, 'from django.db import migrations, models\n'), ((537, 589), 'django.db.models.TextField', 'models.TextField', ([], {'null': '(True)', 'verbos... |
# encoding: utf-8
"""
Gherkin step implementations for chart features.
"""
from __future__ import absolute_import, print_function
import hashlib
from ast import literal_eval
from itertools import islice
from behave import given, then, when
from pptx import Presentation
from pptx.chart.chart import Legend
from ppt... | [
"pptx.chart.data.Category",
"behave.given",
"pptx.chart.data.CategoryChartData",
"helpers.test_pptx",
"pptx.dml.color.RGBColor",
"pptx.util.Inches",
"itertools.islice",
"pptx.chart.data.XyChartData",
"pptx.chart.data.ChartData",
"behave.when",
"ast.literal_eval",
"pptx.chart.data.BubbleChartDa... | [((861, 888), 'behave.given', 'given', (['"""a {axis_type} axis"""'], {}), "('a {axis_type} axis')\n", (866, 888), False, 'from behave import given, then, when\n'), ((1151, 1194), 'behave.given', 'given', (['"""a bar plot having known categories"""'], {}), "('a bar plot having known categories')\n", (1156, 1194), False... |
# -*- coding: utf-8 -*-
'''Consolidates settings from defaults.py and local.py.
::
>>> from api.base import settings
>>> settings.API_BASE
'v2/'
'''
import os
from urlparse import urlparse
import warnings
import itertools
from .defaults import * # noqa
try:
from .local import * # noqa
except Import... | [
"os.environ.get",
"osf.models.Institution.find",
"osf.models.PreprintProvider.objects.exclude",
"warnings.warn",
"urlparse.urlparse"
] | [((340, 484), 'warnings.warn', 'warnings.warn', (['"""No api/base/settings/local.py settings file found. Did you remember to copy local-dist.py to local.py?"""', 'ImportWarning'], {}), "(\n 'No api/base/settings/local.py settings file found. Did you remember to copy local-dist.py to local.py?'\n , ImportWarning)\... |
import os
import sys
import numpy as np
from copy import deepcopy
from collections import deque
import torch
from torch import nn
from torch import optim
from torch.nn import functional as F
sys.path.append(os.path.join(os.environ["HOME"], "TTTArena"))
from environment import Environment
from alphazero.mcts import ... | [
"torch.tanh",
"torch.manual_seed",
"torch.nn.functional.leaky_relu",
"torch.log",
"torch.nn.Flatten",
"os.path.join",
"torch.from_numpy",
"torch.nn.Conv2d",
"torch.nn.MSELoss",
"torch.cuda.is_available",
"numpy.random.seed",
"torch.nn.Linear",
"numpy.expand_dims",
"torch.nn.functional.soft... | [((411, 435), 'torch.manual_seed', 'torch.manual_seed', (['(80085)'], {}), '(80085)\n', (428, 435), False, 'import torch\n'), ((436, 457), 'numpy.random.seed', 'np.random.seed', (['(80085)'], {}), '(80085)\n', (450, 457), True, 'import numpy as np\n'), ((209, 253), 'os.path.join', 'os.path.join', (["os.environ['HOME']"... |
import os
from unittest import mock
import pytest
from iotedgedev.envvars import EnvVars
from iotedgedev.output import Output
pytestmark = pytest.mark.unit
def test_get_envvar__valid():
envvars = EnvVars(Output())
deployment_template = envvars.get_envvar("DEPLOYMENT_CONFIG_TEMPLATE_FILE")
assert deploym... | [
"iotedgedev.output.Output",
"pytest.mark.parametrize",
"unittest.mock.patch.dict",
"pytest.raises"
] | [((1766, 2051), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""command, command_list"""', "[('solution new test_solution', ['init', 'e2e', 'solution new', 'new',\n 'simulator stop']), ('solution new', ['init', 'e2e', 'solution new',\n 'new', 'simulator stop']), ('', ['init', 'e2e', '', 'new',\n 's... |
#!/usr/bin/env python
## playbacktest.py
##
## This is an example of a simple sound playback script.
##
## The script opens an ALSA pcm for sound playback. Set
## various attributes of the device. It then reads data
## from stdin and writes it to the device.
##
## To test it out do the following:
## python recordtest.... | [
"sys.stderr.write",
"getopt.getopt",
"alsaaudio.PCM",
"sys.exit"
] | [((659, 722), 'sys.stderr.write', 'sys.stderr.write', (['"""usage: playbacktest.py [-c <card>] <file>\n"""'], {}), "('usage: playbacktest.py [-c <card>] <file>\\n')\n", (675, 722), False, 'import sys\n'), ((727, 738), 'sys.exit', 'sys.exit', (['(2)'], {}), '(2)\n', (735, 738), False, 'import sys\n'), ((807, 840), 'geto... |
import PySimpleGUI as sg
import pickle
import platform
if platform.system() == 'Linux':
import Modulos.m_sonidosLINUX as sound
else:
import Modulos.m_sonidos as sound
from Modulos.m_tablero import tomar_y_borrar
from Modulos.m_carpeta import crear_carpeta
def ganar(total_jugador,total_maquina):
"""Crea y ... | [
"Modulos.m_carpeta.crear_carpeta",
"pickle.dump",
"PySimpleGUI.Column",
"pickle.load",
"Modulos.m_sonidos.s_ganador",
"PySimpleGUI.Text",
"platform.system",
"PySimpleGUI.Button",
"PySimpleGUI.InputText",
"Modulos.m_tablero.tomar_y_borrar",
"PySimpleGUI.Window",
"Modulos.m_sonidos.s_perdedor"
] | [((58, 75), 'platform.system', 'platform.system', ([], {}), '()\n', (73, 75), False, 'import platform\n'), ((1803, 1855), 'PySimpleGUI.Window', 'sg.Window', (['"""Resultado"""', 'win_layout'], {'keep_on_top': '(True)'}), "('Resultado', win_layout, keep_on_top=True)\n", (1812, 1855), True, 'import PySimpleGUI as sg\n'),... |
import unittest
import tempfile
import shutil
import os
from splits import SplitReader, SplitWriter
class TestMultiReader(unittest.TestCase):
def setUp(self):
self.temp_dir_path = tempfile.mkdtemp()
self.path = os.path.join(self.temp_dir_path, 'foo')
os.makedirs(self.path)
self.... | [
"splits.SplitWriter",
"os.makedirs",
"splits.SplitReader",
"os.path.join",
"tempfile.mkdtemp",
"shutil.rmtree"
] | [((196, 214), 'tempfile.mkdtemp', 'tempfile.mkdtemp', ([], {}), '()\n', (212, 214), False, 'import tempfile\n'), ((235, 274), 'os.path.join', 'os.path.join', (['self.temp_dir_path', '"""foo"""'], {}), "(self.temp_dir_path, 'foo')\n", (247, 274), False, 'import os\n'), ((283, 305), 'os.makedirs', 'os.makedirs', (['self.... |
# python-libjit, Copyright 2014 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | [
"inspect.getargspec",
"functools.wraps",
"ctypes.sizeof"
] | [((2825, 2855), 'ctypes.sizeof', 'ctypes.sizeof', (['ctypes.c_void_p'], {}), '(ctypes.c_void_p)\n', (2838, 2855), False, 'import ctypes\n'), ((863, 884), 'inspect.getargspec', 'inspect.getargspec', (['f'], {}), '(f)\n', (881, 884), False, 'import inspect\n'), ((2495, 2503), 'functools.wraps', 'wraps', (['f'], {}), '(f)... |
# MIT License
#
# Copyright (c) 2018 Pyjcsx, 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including withou... | [
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.Sequential",
"torch.as_strided",
"torch.utils.model_zoo.load_url",
"torch.tile",
"torch.nn.init.kaiming_normal_",
"torch.nn.Conv2d",
"math.sqrt",
"torch.nn.functional.interpolate",
"torch.nn.AdaptiveAvgPool2d",
"torch.no_grad",
"torch.randn"... | [((17786, 17813), 'torch.randn', 'torch.randn', (['(1)', '(3)', '(512)', '(512)'], {}), '(1, 3, 512, 512)\n', (17797, 17813), False, 'import torch\n'), ((1492, 1593), 'torch.nn.Conv2d', 'nn.Conv2d', (['inplanes', 'inplanes', 'kernel_size', 'stride', 'padding', 'dilation'], {'groups': 'inplanes', 'bias': 'bias'}), '(inp... |
import os
import shutil
from os.path import join
import pathlib
from setuptools import find_packages
from setuptools import setup
here = pathlib.Path(__file__).parent.resolve()
long_description = open(join(here, 'README.md')).read()
setup(
name='Qnverter',
version="1.2.4",
packages = ["qnve... | [
"pathlib.Path",
"os.path.join",
"setuptools.setup",
"os.mkdir",
"os.path.expanduser"
] | [((238, 774), 'setuptools.setup', 'setup', ([], {'name': '"""Qnverter"""', 'version': '"""1.2.4"""', 'packages': "['qnverter']", 'url': '"""https://github.com/Nicky5/Qnverter"""', 'license': '"""MIT"""', 'author': '"""nicky"""', 'author_email': '"""<EMAIL>"""', 'description': '"""Python application for quick text conve... |
"""
Module that renders the Jinja templates
"""
import pathlib
from typing import Dict
from jinja2 import Environment, FileSystemLoader
from jinja2schema import infer
CONFIG_DIR: pathlib.Path = pathlib.Path(__file__).parent.parent / "config/configs"
class Template:
"""
Base class for manipulating ... | [
"jinja2schema.infer",
"jinja2.Environment",
"pathlib.Path"
] | [((759, 785), 'jinja2.Environment', 'Environment', ([], {'loader': 'loader'}), '(loader=loader)\n', (770, 785), False, 'from jinja2 import Environment, FileSystemLoader\n'), ((955, 968), 'jinja2schema.infer', 'infer', (['source'], {}), '(source)\n', (960, 968), False, 'from jinja2schema import infer\n'), ((202, 224), '... |
import unittest
import bowling
class BowlingTest(unittest.TestCase):
def test_no_strike_no_spare(self):
frames = [[1, 1], [1, 1], [1, 1], [1, 1], [1, 1],
[1, 1], [1, 1], [1, 1], [1, 1], [1, 1, 0]]
self.assertEqual(20, bowling.CalculateScore(frames))
def test_strikes_no_spar... | [
"unittest.main",
"bowling.CalculateScore"
] | [((1497, 1512), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1510, 1512), False, 'import unittest\n'), ((259, 289), 'bowling.CalculateScore', 'bowling.CalculateScore', (['frames'], {}), '(frames)\n', (281, 289), False, 'import bowling\n'), ((511, 541), 'bowling.CalculateScore', 'bowling.CalculateScore', (['fram... |
# Authors: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
#
# License: BSD (3-clause)
from os import path
from .io.meas_info import Info
from . import pick_types
from .utils import logger, verbose
@verbose
def read_selection(name, fname=None, info=None, verbose=None):
"""Read channel s... | [
"os.path.isfile",
"os.path.dirname"
] | [((2608, 2626), 'os.path.isfile', 'path.isfile', (['fname'], {}), '(fname)\n', (2619, 2626), False, 'from os import path\n'), ((2545, 2567), 'os.path.dirname', 'path.dirname', (['__file__'], {}), '(__file__)\n', (2557, 2567), False, 'from os import path\n')] |
"""
Volume Color Map Editor Panel.
"""
from __future__ import print_function
import itertools, math
import pymol
from pymol.Qt import QtGui, QtCore
from pymol.Qt import QtWidgets
try:
xrange
except NameError:
xrange = range
Qt = QtCore.Qt
DOT_RADIUS = 5
ALPHA_LOG_BASE = 10.0
DEFAULT_COLORS = [
(1., ... | [
"math.floor",
"pymol.Qt.QtWidgets.QInputDialog.getDouble",
"math.log",
"pymol.Qt.QtWidgets.QPlainTextEdit",
"pymol.Qt.QtWidgets.QDialog",
"pymol.Qt.QtWidgets.QColorDialog",
"pymol.Qt.QtWidgets.QWidget",
"pymol.Qt.QtGui.QPainterPath",
"pymol.Qt.QtWidgets.QCheckBox",
"random.randint",
"itertools.c... | [((27756, 27781), 'pymol.Qt.QtWidgets.QWidget', 'QtWidgets.QWidget', (['parent'], {}), '(parent)\n', (27773, 27781), False, 'from pymol.Qt import QtWidgets\n'), ((27795, 27824), 'pymol.Qt.QtWidgets.QDockWidget', 'QtWidgets.QDockWidget', (['parent'], {}), '(parent)\n', (27816, 27824), False, 'from pymol.Qt import QtWidg... |
import numpy as np
import cv2
from libs.util import MaskGenerator, ImageChunker
mask = MaskGenerator(128, 128, 3, rand_seed = 1222)._generate_mask()
mask=mask[0:63,0:63,0]
# import keras.activations as activations
# import tensorflow as tf
# f = np.array([[1, 2, 1],
# [1, 0, 0],
# [-1, 0, 1... | [
"numpy.ones",
"numpy.random.rand",
"libs.util.MaskGenerator",
"numpy.zeros",
"numpy.savetxt",
"cv2.imread"
] | [((610, 683), 'cv2.imread', 'cv2.imread', (['"""C:\\\\Users\\\\dell\\\\Desktop\\\\paper2\\\\\\\\figure\\\\Fig3\\\\\\\\img.jpg"""'], {}), "('C:\\\\Users\\\\dell\\\\Desktop\\\\paper2\\\\\\\\figure\\\\Fig3\\\\\\\\img.jpg')\n", (620, 683), False, 'import cv2\n'), ((753, 773), 'numpy.random.rand', 'np.random.rand', (['(7)',... |
from matplotlib import pyplot as plt
def make_training_plots(
title: str, save_file_path: str, epoch_data, test_data, test_data_generated=None
):
"""
Make plots for training progress of NPI network
Arguments:
epoch_losses -- List of tuples: (epoch, avg_epoch_loss)
test_losses -- List of tuple... | [
"matplotlib.pyplot.draw",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.legend"
] | [((521, 535), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (533, 535), True, 'from matplotlib import pyplot as plt\n'), ((873, 885), 'matplotlib.pyplot.legend', 'plt.legend', ([], {}), '()\n', (883, 885), True, 'from matplotlib import pyplot as plt\n'), ((890, 900), 'matplotlib.pyplot.draw', 'plt.dra... |
#!/usr/bin/env python
# coding: utf-8
# ### - Plot BIC and Silhouette scores across all clusters for Cell painting & L1000
# In[1]:
from collections import defaultdict
import os
import requests
import pickle
import argparse
import pandas as pd
import numpy as np
import re
from os import walk
from collections import... | [
"seaborn.set_context",
"numpy.warnings.filterwarnings",
"os.path.join",
"seaborn.set_style",
"warnings.simplefilter",
"pandas.concat",
"seaborn.relplot"
] | [((464, 489), 'seaborn.set_style', 'sns.set_style', (['"""darkgrid"""'], {}), "('darkgrid')\n", (477, 489), True, 'import seaborn as sns\n'), ((559, 582), 'seaborn.set_context', 'sns.set_context', (['"""talk"""'], {}), "('talk')\n", (574, 582), True, 'import seaborn as sns\n'), ((644, 706), 'warnings.simplefilter', 'wa... |
import numpy as np
import networkx as nx
import json
class SIRNetwork:
def __init__(self, datafiles, travel_rate, beta, gamma, travel_infection_rate = 1):
self.graph, self.A, self.pos = self.load_graph(datafiles['data'], datafiles['position'])
self.nodes = list(self.graph.nodes())
self.nod... | [
"networkx.node_link_graph",
"networkx.to_numpy_array",
"numpy.sum",
"json.load",
"networkx.number_of_nodes"
] | [((331, 348), 'numpy.sum', 'np.sum', (['self.A', '(0)'], {}), '(self.A, 0)\n', (337, 348), True, 'import numpy as np\n'), ((859, 890), 'networkx.node_link_graph', 'nx.node_link_graph', (['import_data'], {}), '(import_data)\n', (877, 890), True, 'import networkx as nx\n'), ((960, 981), 'networkx.number_of_nodes', 'nx.nu... |
import requests
from requests import get
url = 'http://1172.16.31.10:5000/api'
params = dict(
texts="This is a test")
# r = requests.get(url=url,json=params)
r = requests.post(url,json=params)
print(r.json())
| [
"requests.post"
] | [((167, 198), 'requests.post', 'requests.post', (['url'], {'json': 'params'}), '(url, json=params)\n', (180, 198), False, 'import requests\n')] |
"""
SK-Net Model for point clouds classification
"""
import os
import sys
BASE_DIR = os.path.dirname(__file__)
sys.path.append(BASE_DIR)
sys.path.append(os.path.join(BASE_DIR, '../utils'))
import tensorflow as tf
import numpy as np
import tf_util
import losses
from SkeypointNet_util import PDE_module,Aggregation
... | [
"tf_util.fully_connected",
"tensorflow.nn.sparse_softmax_cross_entropy_with_logits",
"tf_util.dropout",
"tensorflow.reduce_mean",
"SkeypointNet_util.PDE_module",
"sys.path.append",
"tensorflow.Graph",
"tensorflow.placeholder",
"tensorflow.concat",
"losses.Separation_loss",
"tensorflow.summary.sc... | [((91, 116), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (106, 116), False, 'import os\n'), ((117, 142), 'sys.path.append', 'sys.path.append', (['BASE_DIR'], {}), '(BASE_DIR)\n', (132, 142), False, 'import sys\n'), ((159, 193), 'os.path.join', 'os.path.join', (['BASE_DIR', '"""../utils"""'... |
import argparse
import pandas as pd
import get_counts as gc
import update_graphml as ug
recip_rels = {'P527': 'P361',
'P361': 'P527',
'P2176': 'P2175',
'P2175': 'P2176',
'P702': 'P688',
'P688': 'P702',
'P1343': 'P4510',
'... | [
"get_counts.get_prop_labels",
"update_graphml.get_node_id_to_qid",
"get_counts.change_endpoint",
"pandas.DataFrame",
"argparse.ArgumentParser",
"update_graphml.read_graphml",
"update_graphml.get_graph",
"update_graphml.get_node_edge_attrib_mappers",
"update_graphml.get_edge_info_to_update",
"updat... | [((724, 749), 'update_graphml.read_graphml', 'ug.read_graphml', (['filename'], {}), '(filename)\n', (739, 749), True, 'import update_graphml as ug\n'), ((788, 806), 'update_graphml.get_graph', 'ug.get_graph', (['root'], {}), '(root)\n', (800, 806), True, 'import update_graphml as ug\n'), ((819, 838), 'update_graphml.ge... |
from gmailClient import GmailClient
from tqdm import tqdm
import sys
class GmailMethod:
def __init__(self):
self.gmailclient = GmailClient()
self.users = []
self.users_query = []
self.total_from_users = 0
self.messages = []
self.total_messages = 0
self.moved_to_trash = 0
self.moved_to_spam = 0
sel... | [
"gmailClient.GmailClient"
] | [((132, 145), 'gmailClient.GmailClient', 'GmailClient', ([], {}), '()\n', (143, 145), False, 'from gmailClient import GmailClient\n')] |
from os import walk
from os.path import join
import toml
_, _, filenames = next(walk('config/scripts'))
filenames = list(map(lambda p: join('config/scripts', p), filenames))
SCRIPTS = []
for file in filenames:
data = toml.load(file)
SCRIPTS.append(data['script'])
def findScripts(node):
parents = node... | [
"os.path.join",
"toml.load",
"os.walk"
] | [((82, 104), 'os.walk', 'walk', (['"""config/scripts"""'], {}), "('config/scripts')\n", (86, 104), False, 'from os import walk\n'), ((226, 241), 'toml.load', 'toml.load', (['file'], {}), '(file)\n', (235, 241), False, 'import toml\n'), ((138, 163), 'os.path.join', 'join', (['"""config/scripts"""', 'p'], {}), "('config/... |
#######################################
import numpy as np
import pylab
from scipy.interpolate import interp1d
from scipy import optimize
from numba import jit
#######################################
@jit(nopython=True)
def qr(t00,Start_time,heatscale): #interior radiogenic heatproduction
t = t00 - Start... | [
"numpy.copy",
"numpy.log10",
"numpy.log",
"scipy.optimize.newton",
"numpy.exp",
"numpy.sum",
"numpy.linspace",
"numba.jit"
] | [((210, 228), 'numba.jit', 'jit', ([], {'nopython': '(True)'}), '(nopython=True)\n', (213, 228), False, 'from numba import jit\n'), ((886, 904), 'numba.jit', 'jit', ([], {'nopython': '(True)'}), '(nopython=True)\n', (889, 904), False, 'from numba import jit\n'), ((1534, 1552), 'numba.jit', 'jit', ([], {'nopython': '(Tr... |
# coding=utf-8
# Copyright 2018 The TF-Agents 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... | [
"tf_agents.utils.nest_utils.is_batched_nested_tensors",
"tf_agents.utils.nest_utils.map_structure_with_paths",
"tf_agents.utils.nest_utils.prune_extra_keys",
"tf_agents.trajectories.trajectory.to_n_step_transition",
"tf_agents.trajectories.trajectory.Trajectory",
"tf_agents.utils.composite.squeeze",
"tf... | [((2902, 3160), 'tf_agents.trajectories.trajectory.Trajectory', 'trajectory.Trajectory', ([], {'step_type': 'time_step_spec.step_type', 'observation': 'time_step_spec.observation', 'action': 'action_spec', 'policy_info': 'info_spec', 'next_step_type': 'time_step_spec.step_type', 'reward': 'time_step_spec.reward', 'disc... |
# Script for re-sizing/shrinking photos
import PIL
from PIL import Image
import os
os.chdir('/home/benbrew88/Desktop/pics')
for number in range(1)[1:]:
img = Image.open(str(number) + '.png')
img = img.resize((600, 400), PIL.Image.ANTIALIAS)
img.save(str(number) + '_big.png')
| [
"os.chdir"
] | [((84, 124), 'os.chdir', 'os.chdir', (['"""/home/benbrew88/Desktop/pics"""'], {}), "('/home/benbrew88/Desktop/pics')\n", (92, 124), False, 'import os\n')] |
# Generated by Django 2.0.3 on 2018-03-29 06:42
import django.db.models.deletion
import django_prices.models
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("product", "0054_merge_20180320_1108"),
("order", "0044_... | [
"django.db.migrations.RemoveField",
"django.db.models.ForeignKey"
] | [((376, 436), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""orderline"""', 'name': '"""stock"""'}), "(model_name='orderline', name='stock')\n", (398, 436), False, 'from django.db import migrations, models\n'), ((446, 515), 'django.db.migrations.RemoveField', 'migrations.RemoveFie... |
#!/usr/bin/env python3
file = open('file_example.txt', 'r')
contents = file.read()
file.close()
print(contents)
with open('file_example.txt', 'r') as file:
contents = file.read()
print(contents)
import os
print(os.getcwd())
os.chdir('/Users/denov/Downloads/python-book/')
print(os.getcwd())
os.chdir('/Users/de... | [
"os.chdir",
"os.getcwd"
] | [((234, 281), 'os.chdir', 'os.chdir', (['"""/Users/denov/Downloads/python-book/"""'], {}), "('/Users/denov/Downloads/python-book/')\n", (242, 281), False, 'import os\n'), ((301, 365), 'os.chdir', 'os.chdir', (['"""/Users/denov/Downloads/python-book/file_examplesch10"""'], {}), "('/Users/denov/Downloads/python-book/file... |
import os
import re
import cv2
import numpy as np
import pandas as pd
from Scripts.Experiments import RESULTS
# ------------------------------------------------------------------------------------------------------------------ #
# -------------------------------------------------- Restructure UNBC Data ------------... | [
"numpy.array_split",
"numpy.array",
"numpy.divide",
"os.walk",
"os.listdir",
"os.path.isdir",
"os.mkdir",
"numpy.concatenate",
"pandas.DataFrame",
"os.rename",
"os.path.splitext",
"re.findall",
"cv2.imread",
"numpy.minimum",
"numpy.unique",
"os.path.join",
"os.rmdir",
"os.path.base... | [((427, 457), 're.findall', 're.findall', (['regex', 'folder_name'], {}), '(regex, folder_name)\n', (437, 457), False, 'import re\n'), ((605, 632), 're.findall', 're.findall', (['regex', 'filename'], {}), '(regex, filename)\n', (615, 632), False, 'import re\n'), ((783, 810), 're.findall', 're.findall', (['regex', 'file... |
from textx import metamodel_for_language, generator_for_language_target
from os.path import abspath, join, dirname, exists
from shutil import rmtree
from os import mkdir
from glob import glob
import sys
def pytest_configure(config):
this_folder = abspath(dirname(__file__))
mm = metamodel_for_language("item")
... | [
"os.path.exists",
"textx.generator_for_language_target",
"os.path.join",
"textx.metamodel_for_language",
"os.path.dirname",
"os.mkdir",
"shutil.rmtree",
"sys.path.append",
"glob.glob"
] | [((289, 319), 'textx.metamodel_for_language', 'metamodel_for_language', (['"""item"""'], {}), "('item')\n", (311, 319), False, 'from textx import metamodel_for_language, generator_for_language_target\n'), ((359, 426), 'os.path.join', 'join', (['this_folder', '"""../mdsd_support_library_common/model/**/*.item"""'], {}),... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from django import template
from django.template.defaultfilters import stringfilter
from django.utils.safestring import mark_safe
import mistune
from pygments import highlight
from pygments.lexers import get_lexer_by_name
from pygments.formatters import HtmlFormat... | [
"mistune.Markdown",
"pygments.highlight",
"pygments.formatters.HtmlFormatter",
"mistune.escape",
"django.template.Library",
"pygments.lexers.get_lexer_by_name"
] | [((338, 356), 'django.template.Library', 'template.Library', ([], {}), '()\n', (354, 356), False, 'from django import template\n'), ((755, 790), 'mistune.Markdown', 'mistune.Markdown', ([], {'renderer': 'renderer'}), '(renderer=renderer)\n', (771, 790), False, 'import mistune\n'), ((875, 910), 'mistune.Markdown', 'mist... |
"""
Created by yan on 2018/9/26 16:31
"""
import json
from flask import request, jsonify, flash
from app.models import db
from app.libs.helper import get_book_info
from app.models.book import Book
from app.models.user import User
from app.web import web
__author__ = 'yan'
@web.route('/addbook',methods = ["POST" ]... | [
"json.loads",
"app.models.book.Book.count.desc",
"flask.flash",
"app.libs.helper.get_book_info",
"app.models.book.Book",
"app.models.db.session.add",
"app.models.user.User.query.filter_by",
"app.models.book.Book.query.filter_by",
"app.web.web.route",
"flask.request.values.get",
"app.models.db.se... | [((280, 319), 'app.web.web.route', 'web.route', (['"""/addbook"""'], {'methods': "['POST']"}), "('/addbook', methods=['POST'])\n", (289, 319), False, 'from app.web import web\n'), ((2028, 2070), 'app.web.web.route', 'web.route', (['"""/top"""'], {'methods': "['GET', 'POST']"}), "('/top', methods=['GET', 'POST'])\n", (2... |
from datetime import datetime
from typing import Tuple
from astral import LocationInfo
from astral.sun import sun
import pytz
def day_night_split(time_now, latitude: str, longitude: str) -> Tuple[datetime, datetime]:
loc_info = LocationInfo(latitude=float(latitude), longitude=float(longitude))
sun_info = sun... | [
"datetime.datetime.now",
"astral.sun.sun"
] | [((317, 354), 'astral.sun.sun', 'sun', (['loc_info.observer'], {'date': 'time_now'}), '(loc_info.observer, date=time_now)\n', (320, 354), False, 'from astral.sun import sun\n'), ((462, 476), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (474, 476), False, 'from datetime import datetime\n')] |
"""Testing of module hooks."""
# pylint: disable=no-self-use, invalid-name
import unittest
from hamcrest import assert_that, equal_to
from spline.components.hooks import Hooks
class TestHooks(unittest.TestCase):
"""Testing of class Hooks."""
def test_simple(self):
"""Testing hooks without a document.... | [
"spline.components.hooks.Hooks",
"hamcrest.equal_to"
] | [((340, 347), 'spline.components.hooks.Hooks', 'Hooks', ([], {}), '()\n', (345, 347), False, 'from spline.components.hooks import Hooks\n'), ((488, 521), 'spline.components.hooks.Hooks', 'Hooks', (["{'hooks': {'cleanup': {}}}"], {}), "({'hooks': {'cleanup': {}}})\n", (493, 521), False, 'from spline.components.hooks imp... |
## <NAME>
# By <NAME>
# Noice ca (by Senku)
# add des commandes de fun
import os
import discord
from typing import Optional
from discord.ext import commands
from discord import File
#from PIL import Image, ImageSequence
import asyncio
import json
import random
os.chdir('.')
token = 'the token'
def wrapper(ctx, emoj... | [
"discord.ext.commands.has_permissions",
"os.listdir",
"discord.ext.commands.Bot",
"discord.ext.commands.TextChannelConverter",
"discord.File",
"discord.Permissions",
"os.chdir",
"discord.Color.green",
"discord.Activity",
"json.load",
"discord.ext.commands.cooldown",
"discord.Embed",
"json.du... | [((264, 277), 'os.chdir', 'os.chdir', (['"""."""'], {}), "('.')\n", (272, 277), False, 'import os\n'), ((590, 629), 'discord.ext.commands.Bot', 'commands.Bot', ([], {'command_prefix': 'get_prefix'}), '(command_prefix=get_prefix)\n', (602, 629), False, 'from discord.ext import commands\n'), ((1067, 1087), 'os.listdir', ... |
# A unit fraction contains 1 in the numerator. The decimal representation of the unit fractions with denominators 2 to 10 are given:
#
# 1/2 = 0.5
# 1/3 = 0.(3)
# 1/4 = 0.25
# 1/5 = 0.2
# 1/6 = 0.1(6)
# 1/7 = 0.(142857)
# 1/8 = 0.125
# 1/9 = 0.(1)
# 1/10 = 0.1
# Where 0.1(6) means 0.166666..., and has a 1-digi... | [
"util.repeats.unit_fraction_cycle"
] | [((778, 815), 'util.repeats.unit_fraction_cycle', 'unit_fraction_cycle', (['x', 'max_precision'], {}), '(x, max_precision)\n', (797, 815), False, 'from util.repeats import unit_fraction_cycle\n')] |
#!/usr/bin/env python3.2
from distutils.core import setup
setup(name="nanocut",
version="12.12",
description="Cutting out various shapes from crystals",
author="<NAME>, <NAME>, <NAME>",
author_email="<EMAIL>",
url="http://bitbucket.org/aradi/nanocut",
license="BSD",
platforms=... | [
"distutils.core.setup"
] | [((59, 1079), 'distutils.core.setup', 'setup', ([], {'name': '"""nanocut"""', 'version': '"""12.12"""', 'description': '"""Cutting out various shapes from crystals"""', 'author': '"""<NAME>, <NAME>, <NAME>"""', 'author_email': '"""<EMAIL>"""', 'url': '"""http://bitbucket.org/aradi/nanocut"""', 'license': '"""BSD"""', '... |
"""Visualization for sequential tracks."""
import numpy as np
import open3d as o3d
from ..data.loadmodels import track_palette
def make_geometries_from_dict(tracks, old_track_geometries=None,
palette=track_palette):
track_line_sets = {}
for track_id, points in tracks.items():
... | [
"numpy.asarray",
"numpy.reshape",
"open3d.geometry.LineSet",
"open3d.utility.Vector3dVector"
] | [((340, 391), 'numpy.reshape', 'np.reshape', (['[point[0] for point in points]', '(-1, 3)'], {}), '([point[0] for point in points], (-1, 3))\n', (350, 391), True, 'import numpy as np\n'), ((452, 474), 'open3d.geometry.LineSet', 'o3d.geometry.LineSet', ([], {}), '()\n', (472, 474), True, 'import open3d as o3d\n'), ((506... |
import json
from storyhub.sdk.service.Volume import Volume
from tests.storyhub.sdk.JsonFixtureHelper import JsonFixtureHelper
volume_fixture = JsonFixtureHelper.load_fixture("volume_fixture")
volume_fixture_json = json.dumps(volume_fixture)
def test_deserialization(mocker):
mocker.patch.object(json, "loads", ... | [
"json.dumps",
"json.dumps.assert_called_with",
"storyhub.sdk.service.Volume.Volume.from_dict",
"json.loads.assert_called_with",
"tests.storyhub.sdk.JsonFixtureHelper.JsonFixtureHelper.load_fixture",
"storyhub.sdk.service.Volume.Volume.from_json"
] | [((145, 193), 'tests.storyhub.sdk.JsonFixtureHelper.JsonFixtureHelper.load_fixture', 'JsonFixtureHelper.load_fixture', (['"""volume_fixture"""'], {}), "('volume_fixture')\n", (175, 193), False, 'from tests.storyhub.sdk.JsonFixtureHelper import JsonFixtureHelper\n'), ((217, 243), 'json.dumps', 'json.dumps', (['volume_fi... |
import os
import subprocess
import requests
from flask import Flask, request
app = Flask(__name__)
@app.route('/', methods = ['POST'])
def run_transform():
payload_url = request.args.get("payload_url")
r = requests.get(payload_url, allow_redirects=True)
open('payload.json', 'wb').write(r.content)
transf... | [
"flask.request.args.get",
"flask.Flask",
"flask.request.get_data",
"subprocess.run",
"os.environ.get",
"requests.get"
] | [((85, 100), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (90, 100), False, 'from flask import Flask, request\n'), ((176, 207), 'flask.request.args.get', 'request.args.get', (['"""payload_url"""'], {}), "('payload_url')\n", (192, 207), False, 'from flask import Flask, request\n'), ((215, 262), 'requests.... |
"""
Example program to demonstrate how to send a PPG time series to
LSL from the Arduino Uno by automatically connecting to it over serial.
The sources for significant example code are cited below.
"""
import random
import time
from time import sleep
import serial
from serial import Serial
import serial.tools.list_por... | [
"signal.signal",
"serial.tools.list_ports.comports",
"random.randint",
"datetime.datetime.fromtimestamp",
"pylsl.StreamInfo",
"pylsl.local_clock",
"time.sleep",
"platform.release",
"platform.python_version",
"platform.system",
"pylsl.StreamOutlet",
"serial.Serial",
"sys.exit",
"re.sub",
... | [((1837, 1852), 'time.sleep', 'time.sleep', (['(1.0)'], {}), '(1.0)\n', (1847, 1852), False, 'import time\n'), ((6900, 6925), 'atexit.register', 'atexit.register', (['doAtExit'], {}), '(doAtExit)\n', (6915, 6925), False, 'import atexit\n'), ((7532, 7618), 'pylsl.StreamInfo', 'StreamInfo', (['lsl_stream_name', 'lsl_stre... |
# Copyright 2018-2019 SourceOptics Project Contributors
#
# 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... | [
"re.compile",
"os.path.splitext",
"os.path.join",
"os.path.dirname",
"fnmatch.fnmatch",
"os.path.basename",
"django.utils.dateparse.parse_datetime"
] | [((1417, 1457), 're.compile', 're.compile', (['PARSER_RE_STRING', 're.VERBOSE'], {}), '(PARSER_RE_STRING, re.VERBOSE)\n', (1427, 1457), False, 'import re\n'), ((1804, 1847), 're.compile', 're.compile', (['"""(/)?(?:\\\\{[^}=]+=>)([^}]+)\\\\}"""'], {}), "('(/)?(?:\\\\{[^}=]+=>)([^}]+)\\\\}')\n", (1814, 1847), False, 'im... |
##########################################################################
#
# Copyright (c) 2015, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistrib... | [
"GafferSceneUI.SceneHierarchy",
"GafferSceneUI.ContextAlgo.getExpandedPaths",
"GafferScene.Group",
"Gaffer.ScriptNode",
"GafferScene.PathMatcher",
"GafferScene.Plane"
] | [((2386, 2405), 'Gaffer.ScriptNode', 'Gaffer.ScriptNode', ([], {}), '()\n', (2403, 2405), False, 'import Gaffer\n'), ((2427, 2446), 'GafferScene.Plane', 'GafferScene.Plane', ([], {}), '()\n', (2444, 2446), False, 'import GafferScene\n'), ((2467, 2486), 'GafferScene.Group', 'GafferScene.Group', ([], {}), '()\n', (2484, ... |
from ctypes import c_int, c_char_p, c_void_p, CFUNCTYPE
from ctypes import POINTER as _P
from .dll import _bind, SDLFunc, AttributeDict
__all__ = [
# Defines
"SDL_MAX_LOG_MESSAGE",
# Enums
"SDL_LogCategory",
"SDL_LOG_CATEGORY_APPLICATION",
"SDL_LOG_CATEGORY_ERROR", "SDL_LOG_CATEGORY_ASSER... | [
"ctypes.CFUNCTYPE",
"ctypes.POINTER"
] | [((2078, 2137), 'ctypes.CFUNCTYPE', 'CFUNCTYPE', (['None', 'c_void_p', 'c_int', 'SDL_LogPriority', 'c_char_p'], {}), '(None, c_void_p, c_int, SDL_LogPriority, c_char_p)\n', (2087, 2137), False, 'from ctypes import c_int, c_char_p, c_void_p, CFUNCTYPE\n'), ((2878, 2903), 'ctypes.POINTER', '_P', (['SDL_LogOutputFunction'... |
import uuid
from typing import Optional, Union
from fastapi import APIRouter, Depends, HTTPException, Query
from sqlalchemy import distinct, func, select
from sqlalchemy.exc import NoResultFound
from sqlalchemy.ext.asyncio import AsyncSession
from sqlalchemy.sql.functions import count
from starlette import status
from... | [
"core.services.task.TaskService.create_task_non_db",
"sqlalchemy.func.count",
"fastapi.APIRouter",
"core.services.task.TaskService",
"fastapi.Query",
"sqlalchemy.distinct",
"fastapi.Depends"
] | [((818, 829), 'fastapi.APIRouter', 'APIRouter', ([], {}), '()\n', (827, 829), False, 'from fastapi import APIRouter, Depends, HTTPException, Query\n'), ((1008, 1019), 'fastapi.Query', 'Query', (['None'], {}), '(None)\n', (1013, 1019), False, 'from fastapi import APIRouter, Depends, HTTPException, Query\n'), ((1052, 106... |
# Copyright 2013 OpenStack Foundation
#
# 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... | [
"keystoneauth1.fixture.V2Token",
"oslo_utils.timeutils.utcnow",
"keystoneclient.common.cms.cms_hash_token",
"os.path.join",
"uuid.uuid4",
"oslo_serialization.jsonutils.dumps",
"os.path.abspath",
"keystoneclient.utils.hash_signed_token",
"keystoneauth1.fixture.V3Token"
] | [((969, 1018), 'os.path.join', 'os.path.join', (['ROOTDIR', '"""examples"""', '"""pki"""', '"""certs"""'], {}), "(ROOTDIR, 'examples', 'pki', 'certs')\n", (981, 1018), False, 'import os\n'), ((1028, 1075), 'os.path.join', 'os.path.join', (['ROOTDIR', '"""examples"""', '"""pki"""', '"""cms"""'], {}), "(ROOTDIR, 'example... |
# -*- coding: utf-8 -*-
from django.template import Context, RequestContext, Template
from django_filters.filters import (
BaseInFilter,
# BaseRangeFilter,
NumberFilter,
# DateTimeFilter,
Filter
)
from django_filters.fields import BaseCSVField
from edw.rest.filters.widgets import CSVWidget as Cus... | [
"django.template.RequestContext",
"django.template.Context"
] | [((2768, 2800), 'django.template.RequestContext', 'RequestContext', (['request', 'context'], {}), '(request, context)\n', (2782, 2800), False, 'from django.template import Context, RequestContext, Template\n'), ((2837, 2853), 'django.template.Context', 'Context', (['context'], {}), '(context)\n', (2844, 2853), False, '... |
import FWCore.ParameterSet.Config as cms
from Validation.HGCalValidation.simhitValidation_cff import *
from Validation.HGCalValidation.digiValidation_cff import *
from Validation.HGCalValidation.rechitValidation_cff import *
from Validation.HGCalValidation.hgcalHitValidation_cfi import *
from Validation.H... | [
"FWCore.ParameterSet.Config.Sequence"
] | [((402, 430), 'FWCore.ParameterSet.Config.Sequence', 'cms.Sequence', (['hgcalValidator'], {}), '(hgcalValidator)\n', (414, 430), True, 'import FWCore.ParameterSet.Config as cms\n'), ((450, 769), 'FWCore.ParameterSet.Config.Sequence', 'cms.Sequence', (['(hgcalSimHitValidationEE + hgcalSimHitValidationHEF +\n hgcalSim... |
import re
from datetime import timezone, datetime, timedelta
match_zoom_link = re.compile("https:\/\/.*\.zoom\.us\/j\/.*")
def parse_youtube_time(time):
# If a suffix in milliseconds was included, remove it
if "." in time:
t = time.split(".")
time = t[0] + "Z"
# Youtube times are all UTC
... | [
"datetime.datetime.strptime",
"re.compile"
] | [((80, 129), 're.compile', 're.compile', (['"""https:\\\\/\\\\/.*\\\\.zoom\\\\.us\\\\/j\\\\/.*"""'], {}), "('https:\\\\/\\\\/.*\\\\.zoom\\\\.us\\\\/j\\\\/.*')\n", (90, 129), False, 'import re\n'), ((330, 375), 'datetime.datetime.strptime', 'datetime.strptime', (['time', '"""%Y-%m-%dT%H:%M:%SZ"""'], {}), "(time, '%Y-%m-... |
import numpy as np
import pandas as pd
from pyopenms import FeatureMap, FeatureXMLFile
def extractNamesAndIntensities(feature_dir, sample_names, database):
"""
This function takes .featureXML files, the output of SmartPeak
pre-processing, and extracts the metabolite's reference and its measured
intens... | [
"pyopenms.FeatureMap",
"numpy.mean",
"numpy.sqrt",
"pyopenms.FeatureXMLFile",
"pandas.DataFrame.from_dict",
"pandas.DataFrame",
"numpy.var"
] | [((2150, 2202), 'pandas.DataFrame.from_dict', 'pd.DataFrame.from_dict', (['extracted_data_dict', '"""index"""'], {}), "(extracted_data_dict, 'index')\n", (2172, 2202), True, 'import pandas as pd\n'), ((5513, 5560), 'pandas.DataFrame.from_dict', 'pd.DataFrame.from_dict', (['stats_all_dict', '"""index"""'], {}), "(stats_... |
import matplotlib.animation as animation
import matplotlib.pyplot as plt
import numpy as np
import os
import sys
def save_ani(episode, reward, frames, fps=50, skip_frames=4,
out_path='./animations/', mode='train'):
if not os.path.exists(out_path):
os.makedirs(out_path)
fig = plt.figu... | [
"matplotlib.pyplot.imshow",
"os.path.exists",
"os.listdir",
"os.makedirs",
"matplotlib.animation.FuncAnimation",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.title",
"numpy.load"
] | [((312, 324), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (322, 324), True, 'import matplotlib.pyplot as plt\n'), ((329, 386), 'matplotlib.pyplot.title', 'plt.title', (['f"""{mode} episode: {episode}, reward: {reward}"""'], {}), "(f'{mode} episode: {episode}, reward: {reward}')\n", (338, 386), True, 'im... |
# Importing Class
import sys
import os
from model_trainer import ModelTrainer
# Creating Model Trainer Class
model_trainer = ModelTrainer(
feature_used='logmelfb', duration_range=(2, 6), epoch=462)
# Loading Audio Files to the Class
model_trainer.load_audio_files()
# Extracting Features and Constructing Model... | [
"model_trainer.ModelTrainer"
] | [((127, 198), 'model_trainer.ModelTrainer', 'ModelTrainer', ([], {'feature_used': '"""logmelfb"""', 'duration_range': '(2, 6)', 'epoch': '(462)'}), "(feature_used='logmelfb', duration_range=(2, 6), epoch=462)\n", (139, 198), False, 'from model_trainer import ModelTrainer\n')] |
from csgoinvshuffle.types import SlotTagMap
from csgoinvshuffle.utils import get_depending_item_slots, get_loadout_slot_enum_value
from csgoinvshuffle.enums import LoadoutSlot
from csgoinvshuffle.item import _slot_tag_map, _slot_tag_map_ct, _slot_tag_map_t
def test_get_loadout_slot_enum_value():
for enum_value in... | [
"csgoinvshuffle.utils.get_depending_item_slots",
"csgoinvshuffle.utils.get_loadout_slot_enum_value"
] | [((349, 394), 'csgoinvshuffle.utils.get_loadout_slot_enum_value', 'get_loadout_slot_enum_value', (['enum_value.value'], {}), '(enum_value.value)\n', (376, 394), False, 'from csgoinvshuffle.utils import get_depending_item_slots, get_loadout_slot_enum_value\n'), ((548, 590), 'csgoinvshuffle.utils.get_depending_item_slots... |
# Copyright (c) 2017, <NAME>
import markdown
from handroll.composers.generic import GenericHTMLComposer
class MarkdownComposer(GenericHTMLComposer):
"""Compose HTML from Markdown files (``.md``).
The first line of the file will be used as the ``title`` data for the
template. All following lines will be... | [
"markdown.markdown"
] | [((1165, 1241), 'markdown.markdown', 'markdown.markdown', (['source'], {'extensions': 'self.EXTENSIONS', 'output_format': '"""html5"""'}), "(source, extensions=self.EXTENSIONS, output_format='html5')\n", (1182, 1241), False, 'import markdown\n')] |
from kubernetes import client
from kubernetes.client.rest import ApiException
from .load_kube_config import kubeConfig
kubeConfig.load_kube_config()
apps = client.AppsV1Api()
class K8sStatefulSet:
def get_sts(ns, logger):
try:
if ns != 'all':
logger.info ("Fetching {} namespace... | [
"kubernetes.client.AppsV1Api"
] | [((157, 175), 'kubernetes.client.AppsV1Api', 'client.AppsV1Api', ([], {}), '()\n', (173, 175), False, 'from kubernetes import client\n')] |
from PIL import Image, ImageDraw
import webcolors
def get_colors(img, colors=10):
resized = img.resize((255, 255))
# Quantize to 10 colors, turn it back into RGB for easier convertion to HEX
converted = resized.convert('P', palette=Image.ADAPTIVE, colors=colors).convert('RGB')
def get_first_item(a):
... | [
"PIL.Image.new",
"PIL.ImageDraw.Draw",
"webcolors.rgb_to_hex"
] | [((903, 1006), 'PIL.Image.new', 'Image.new', (['"""RGBA"""', '(baseWidth, baseHeight + colorSize + spaceBetweenColors * 2)', '(197, 197, 197, 1)'], {}), "('RGBA', (baseWidth, baseHeight + colorSize + spaceBetweenColors *\n 2), (197, 197, 197, 1))\n", (912, 1006), False, 'from PIL import Image, ImageDraw\n'), ((1149,... |
from unittest import TestCase
from mcleece.crypto_box import PrivateKey, PublicKey, SealedBox
class CryptoBoxTest(TestCase):
@classmethod
def setUpClass(cls):
cls.sk, cls.pk = PrivateKey.generate()
def test_serialize_keys(self):
pk = PublicKey(bytes(self.pk))
self.assertEqual(pk.... | [
"mcleece.crypto_box.PrivateKey.generate",
"mcleece.crypto_box.SealedBox"
] | [((195, 216), 'mcleece.crypto_box.PrivateKey.generate', 'PrivateKey.generate', ([], {}), '()\n', (214, 216), False, 'from mcleece.crypto_box import PrivateKey, PublicKey, SealedBox\n'), ((474, 492), 'mcleece.crypto_box.SealedBox', 'SealedBox', (['self.pk'], {}), '(self.pk)\n', (483, 492), False, 'from mcleece.crypto_bo... |
import pandas as pd
import torch
from typing import Callable, List
from torch.utils.data import TensorDataset
class CsvDataset(TensorDataset):
data: pd
y_cols: List
x_cols: List
transform: Callable
test_fraction: float = 0.0
train: bool
def __init__(self, file_path: str, y_cols: List, x... | [
"torch.tensor",
"pandas.read_csv"
] | [((514, 578), 'pandas.read_csv', 'pd.read_csv', ([], {}), "(**{'filepath_or_buffer': file_path, 'nrows': nrows})\n", (525, 578), True, 'import pandas as pd\n'), ((893, 942), 'torch.tensor', 'torch.tensor', (['self.train_data[self.x_cols].values'], {}), '(self.train_data[self.x_cols].values)\n', (905, 942), False, 'impo... |
from copy import deepcopy
from elasticsearch_dsl import UpdateByQuery, query, Q, Document
def test_ubq_starts_with_no_query():
ubq = UpdateByQuery()
assert ubq.query._proxied is None
def test_ubq_to_dict():
ubq = UpdateByQuery()
assert {} == ubq.to_dict()
ubq = ubq.query('match', f=42)
asse... | [
"elasticsearch_dsl.UpdateByQuery",
"elasticsearch_dsl.UpdateByQuery.from_dict",
"elasticsearch_dsl.Q",
"copy.deepcopy"
] | [((139, 154), 'elasticsearch_dsl.UpdateByQuery', 'UpdateByQuery', ([], {}), '()\n', (152, 154), False, 'from elasticsearch_dsl import UpdateByQuery, query, Q, Document\n'), ((229, 244), 'elasticsearch_dsl.UpdateByQuery', 'UpdateByQuery', ([], {}), '()\n', (242, 244), False, 'from elasticsearch_dsl import UpdateByQuery,... |
# -*- coding: utf-8 -*-
"""
figure_ref
==============
A Pelican plugin that provices a LaTeX-like system for referencing figure
elements within an article or page. Figures whose figcaption elements begin
with the format
labelname :: caption text
will have `labelname ::` replaced by figure numbering. This figure ... | [
"logging.getLogger",
"pelican.signals.all_generators_finalized.connect",
"bs4.BeautifulSoup",
"re.compile"
] | [((730, 765), 're.compile', 're.compile', (['"""\\\\{#\\\\s*(\\\\w+)\\\\s*\\\\}"""'], {}), "('\\\\{#\\\\s*(\\\\w+)\\\\s*\\\\}')\n", (740, 765), False, 'import re\n'), ((772, 803), 're.compile', 're.compile', (['"""^\\\\s*(\\\\w+)\\\\s*::"""'], {}), "('^\\\\s*(\\\\w+)\\\\s*::')\n", (782, 803), False, 'import re\n'), ((8... |
# coding=utf-8
# Copyright 2019 The SEED 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 agre... | [
"absl.app.UsageError",
"absl.flags.DEFINE_bool",
"absl.flags.DEFINE_integer",
"seed_rl.common.actor.actor_loop",
"absl.app.run",
"seed_rl.agents.vtrace.networks.MLPandLSTM",
"tensorflow.keras.optimizers.Adam",
"seed_rl.common.normalizer.Normalizer",
"seed_rl.mujoco.env.create_environment",
"seed_r... | [((1084, 1145), 'absl.flags.DEFINE_float', 'flags.DEFINE_float', (['"""learning_rate"""', '(0.0003)', '"""Learning rate."""'], {}), "('learning_rate', 0.0003, 'Learning rate.')\n", (1102, 1145), False, 'from absl import flags\n'), ((1164, 1235), 'absl.flags.DEFINE_integer', 'flags.DEFINE_integer', (['"""n_mlp_layers"""... |
# Copyright 2016 VMware, Inc.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | [
"osc_lib.utils.tags.update_tags_for_set",
"openstackclient.identity.common.find_project",
"vmware_nsx._i18n._",
"osc_lib.utils.get_item_properties",
"vmware_nsx.osc.v2.utils.get_extensions",
"openstackclient.network.v2.security_group._get_columns"
] | [((1069, 1105), 'vmware_nsx.osc.v2.utils.get_extensions', 'utils.get_extensions', (['client_manager'], {}), '(client_manager)\n', (1089, 1105), False, 'from vmware_nsx.osc.v2 import utils\n'), ((1800, 1836), 'vmware_nsx.osc.v2.utils.get_extensions', 'utils.get_extensions', (['client_manager'], {}), '(client_manager)\n'... |
import datetime
import time
import warnings
import pymysql
from pymysql.tests import base
import unittest2
try:
import imp
reload = imp.reload
except AttributeError:
pass
__all__ = ["TestOldIssues", "TestNewIssues", "TestGitHubIssues"]
class TestOldIssues(base.PyMySQLTestCase):
def test_issue_3(sel... | [
"unittest2.skip",
"warnings.catch_warnings",
"pymysql.connect",
"time.sleep",
"warnings.filterwarnings"
] | [((5598, 5708), 'unittest2.skip', 'unittest2.skip', (['"""test_issue_17() requires a custom, legacy MySQL configuration and will not be run."""'], {}), "(\n 'test_issue_17() requires a custom, legacy MySQL configuration and will not be run.'\n )\n", (5612, 5708), False, 'import unittest2\n'), ((7781, 7837), 'unit... |
from __future__ import absolute_import, print_function, division
import copy
import unittest
# Skip test if cuda_ndarray is not available.
from nose.plugins.skip import SkipTest
import numpy
from six.moves import xrange
import theano
import theano.sandbox.cuda as cuda_ndarray
from theano.tensor.basic import _allclose... | [
"numpy.random.rand",
"theano.sandbox.cuda.CudaNdarray.zeros",
"six.moves.xrange",
"copy.deepcopy",
"theano.tensor.basic._allclose",
"copy.copy",
"numpy.arange",
"theano.sandbox.cuda.CudaNdarray",
"theano.sandbox.cuda.dot",
"numpy.int64",
"numpy.asarray",
"theano.tests.unittest_tools.fetch_seed... | [((415, 457), 'nose.plugins.skip.SkipTest', 'SkipTest', (['"""Optional package cuda disabled"""'], {}), "('Optional package cuda disabled')\n", (423, 457), False, 'from nose.plugins.skip import SkipTest\n'), ((6103, 6130), 'theano.sandbox.cuda.CudaNdarray', 'cuda_ndarray.CudaNdarray', (['a'], {}), '(a)\n', (6127, 6130)... |
"""
Create an MSI package using the WIX toolset
We adopt the rule of 'one file per component' as suggested although this requires thousands
of components. Generation of GUIDs is accomplished by using the Python UUID library to generate
the ID based on a hash of the file path. This should ensure that the GUIDs are spe... | [
"os.makedirs",
"shutil.move",
"os.path.join",
"os.path.normpath",
"os.path.dirname",
"six.StringIO",
"os.path.basename",
"shutil.rmtree",
"update_version.update_version",
"os.system",
"sys.path.append"
] | [((6493, 6503), 'six.StringIO', 'StringIO', ([], {}), '()\n', (6501, 6503), False, 'from six import StringIO\n'), ((6657, 6667), 'six.StringIO', 'StringIO', ([], {}), '()\n', (6665, 6667), False, 'from six import StringIO\n'), ((7367, 7399), 'os.path.join', 'os.path.join', (['distdir', 'os.pardir'], {}), '(distdir, os.... |
import sqlite3
import sys; sys.path.insert(0, '../..')
from autograd import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import time
from IPython.display import display
from src.models import LUNA
from src.utils import generate_data
import LUNA_database_parse as par
def run_experiments():
x, y,... | [
"sys.path.insert",
"LUNA_database_parse.save_runtime_to_database",
"sqlite3.connect",
"LUNA_database_parse.save_training_data_to_database",
"autograd.numpy.zeros",
"LUNA_database_parse.save_params_to_database",
"time.time",
"src.models.LUNA",
"autograd.numpy.random.RandomState",
"src.utils.generat... | [((27, 54), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""../.."""'], {}), "(0, '../..')\n", (42, 54), False, 'import sys\n'), ((329, 381), 'src.utils.generate_data', 'generate_data', ([], {'number_of_points': '(50)', 'noise_variance': '(9)'}), '(number_of_points=50, noise_variance=9)\n', (342, 381), False, 'from ... |
"""Main entry point for running preparation of CWL inputs.
"""
from bcbio.pipeline import run_info
from bcbio.cwl import create
def run(args):
"""Run a CWL preparation pipeline.
"""
dirs, config, run_info_yaml = run_info.prep_system(args.sample_config, args.systemconfig)
integrations = args.integration... | [
"bcbio.cwl.create.from_world",
"bcbio.pipeline.run_info.organize",
"bcbio.pipeline.run_info.prep_system"
] | [((225, 284), 'bcbio.pipeline.run_info.prep_system', 'run_info.prep_system', (['args.sample_config', 'args.systemconfig'], {}), '(args.sample_config, args.systemconfig)\n', (245, 284), False, 'from bcbio.pipeline import run_info\n'), ((375, 466), 'bcbio.pipeline.run_info.organize', 'run_info.organize', (['dirs', 'confi... |
from .base import Strategy, Transform
from summit.domain import *
from summit.domain import Domain
from summit.utils.dataset import DataSet
from summit.utils import jsonify_dict, unjsonify_dict
import numpy as np
import pandas as pd
from scipy.optimize import OptimizeResult
class NelderMead(Strategy):
"""Nelder-... | [
"numpy.log10",
"numpy.random.rand",
"numpy.argsort",
"numpy.asfarray",
"numpy.array",
"summit.utils.jsonify_dict",
"numpy.add.reduce",
"numpy.where",
"numpy.delete",
"numpy.asarray",
"numpy.take",
"pandas.DataFrame",
"numpy.maximum",
"numpy.round",
"numpy.abs",
"numpy.ones",
"summit.... | [((11690, 11721), 'numpy.asarray', 'np.asarray', (['bounds'], {'dtype': 'float'}), '(bounds, dtype=float)\n', (11700, 11721), True, 'import numpy as np\n'), ((27909, 27934), 'numpy.zeros', 'np.zeros', (['(N + 1,)', 'float'], {}), '((N + 1,), float)\n', (27917, 27934), True, 'import numpy as np\n'), ((28009, 28025), 'nu... |
from src.classifier.bidirectional_lstm import BidirectionalLstm
from src.classifier.lstm import Lstm
from src.classifier.word_cnn import WordCNN
from src.classifier.char_cnn import CharCNN
from src.support import resources_preparer
from src.evaluation import evaluator_results
from src.support import support
def execu... | [
"src.classifier.bidirectional_lstm.BidirectionalLstm",
"src.support.support.colored_print",
"src.support.support.install_dependencies",
"src.support.resources_preparer.get_word_vector",
"src.support.resources_preparer.get_phrases",
"src.classifier.char_cnn.CharCNN",
"src.evaluation.evaluator_results.eva... | [((397, 415), 'src.support.support.set_time', 'support.set_time', ([], {}), '()\n', (413, 415), False, 'from src.support import support\n'), ((420, 495), 'src.support.support.colored_print', 'support.colored_print', (['"""Installing dependencies..."""', '"""light_green"""', 'verbose'], {}), "('Installing dependencies..... |
import os
sections = [
'angular-now/README.md',
'advanced-observables/README.md',
'unidirectional-data-flow/README.md',
'progressive-web-application/README.md',
'e2e-testing/README.md'
]
for filename in sections:
f = open(os.path.join('.', filename), 'rt')
print(f.read() + '\n\n---')
f.close()
# Making PDF s... | [
"os.path.join"
] | [((230, 257), 'os.path.join', 'os.path.join', (['"""."""', 'filename'], {}), "('.', filename)\n", (242, 257), False, 'import os\n')] |
from datetime import datetime
from rest_framework import serializers
from .models import Block, Transaction
class BlockModelSerializer(serializers.ModelSerializer):
blockNumber = serializers.ReadOnlyField()
timeStamp = serializers.ReadOnlyField()
timeStampDateTime = serializers.SerializerMethodField()
... | [
"rest_framework.serializers.SerializerMethodField",
"rest_framework.serializers.ReadOnlyField"
] | [((187, 214), 'rest_framework.serializers.ReadOnlyField', 'serializers.ReadOnlyField', ([], {}), '()\n', (212, 214), False, 'from rest_framework import serializers\n'), ((231, 258), 'rest_framework.serializers.ReadOnlyField', 'serializers.ReadOnlyField', ([], {}), '()\n', (256, 258), False, 'from rest_framework import ... |
import os
import shutil
base_dir = f"C:\\Users\\balsnctf\\Documents\\Dark Knight\\tmp-{os.urandom(16).hex()}"
def init():
os.mkdir(base_dir)
os.chdir(base_dir)
with open("39671", "w") as f:
f.write("alice\nalice1025")
with open("683077", "w") as f:
f.write("bob\nbob0105a")
def passwo... | [
"os.listdir",
"os.urandom",
"os.chdir",
"os.mkdir",
"shutil.rmtree",
"os.remove"
] | [((128, 146), 'os.mkdir', 'os.mkdir', (['base_dir'], {}), '(base_dir)\n', (136, 146), False, 'import os\n'), ((151, 169), 'os.chdir', 'os.chdir', (['base_dir'], {}), '(base_dir)\n', (159, 169), False, 'import os\n'), ((1990, 2005), 'os.listdir', 'os.listdir', (['"""."""'], {}), "('.')\n", (2000, 2005), False, 'import o... |
# -*- coding: utf-8 -*-
import re
import hashlib
import json
import base64
import hmac
from Crypto.Cipher import DES3
from abc import ABCMeta, abstractmethod
from . import currencies, languages, transactions
from .response import Response
from .request import Request
# Calculated parameters
SIGNATURE_VERSION = 'Ds_Si... | [
"hmac.new",
"re.compile",
"base64.b64encode",
"json.dumps",
"base64.b64decode",
"re.sub"
] | [((1705, 1732), 'base64.b64encode', 'base64.b64encode', (['signature'], {}), '(signature)\n', (1721, 1732), False, 'import base64\n'), ((2349, 2375), 're.compile', 're.compile', (['"""[^a-zA-Z0-9]"""'], {}), "('[^a-zA-Z0-9]')\n", (2359, 2375), False, 'import re\n'), ((2401, 2432), 're.sub', 're.sub', (['alphanum', '"""... |
import os
def write_log(dir_name, file_name, log_str):
"""
Write log to file
:param dir_name: the path of directory
:param file_name: the name of the saved file
:param log_str: the string that need to be saved
"""
if not os.path.isdir(dir_name):
os.mkdir(dir_name)
... | [
"os.path.isdir",
"os.path.join",
"os.mkdir"
] | [((262, 285), 'os.path.isdir', 'os.path.isdir', (['dir_name'], {}), '(dir_name)\n', (275, 285), False, 'import os\n'), ((296, 314), 'os.mkdir', 'os.mkdir', (['dir_name'], {}), '(dir_name)\n', (304, 314), False, 'import os\n'), ((330, 363), 'os.path.join', 'os.path.join', (['dir_name', 'file_name'], {}), '(dir_name, fil... |
from countess.plugins.scoring import BaseScorerPlugin
from countess.plugins.options import Options
options_1 = Options()
options_2 = Options()
class CountsScorer(BaseScorerPlugin):
name = "Counts Only"
version = "1.0"
author = "<NAME>, <NAME>"
def __init__(self, store_manager, options):
su... | [
"countess.plugins.options.Options"
] | [((113, 122), 'countess.plugins.options.Options', 'Options', ([], {}), '()\n', (120, 122), False, 'from countess.plugins.options import Options\n'), ((135, 144), 'countess.plugins.options.Options', 'Options', ([], {}), '()\n', (142, 144), False, 'from countess.plugins.options import Options\n')] |
from django.contrib import admin
from polls.models import Choice
# Register your models here.
from polls.models import Question
admin.site.register([Question, Choice])
| [
"django.contrib.admin.site.register"
] | [((130, 169), 'django.contrib.admin.site.register', 'admin.site.register', (['[Question, Choice]'], {}), '([Question, Choice])\n', (149, 169), False, 'from django.contrib import admin\n')] |
"""Test cases for IR generation."""
import os.path
from mypy.test.config import test_temp_dir
from mypy.test.data import DataDrivenTestCase
from mypy.errors import CompileError
from mypyc.common import TOP_LEVEL_NAME
from mypyc.ir.func_ir import format_func
from mypyc.test.testutil import (
ICODE_GEN_BUILTINS, u... | [
"mypyc.ir.func_ir.format_func",
"mypyc.test.testutil.build_ir_for_single_file",
"mypyc.test.testutil.assert_test_output",
"mypyc.test.testutil.remove_comment_lines",
"mypyc.options.CompilerOptions",
"mypyc.test.testutil.replace_native_int"
] | [((1160, 1221), 'mypyc.options.CompilerOptions', 'CompilerOptions', ([], {'strip_asserts': "('StripAssert' in testcase.name)"}), "(strip_asserts='StripAssert' in testcase.name)\n", (1175, 1221), False, 'from mypyc.options import CompilerOptions\n'), ((1415, 1452), 'mypyc.test.testutil.remove_comment_lines', 'remove_com... |
import requests
import click
from soccer.exceptions import APIErrorException
class RequestHandler(object):
BASE_URL = 'http://api.football-data.org/v2/'
LIVE_URL = 'http://soccer-cli.appspot.com/'
def __init__(self, headers, league_ids, team_names, writer):
self.headers = headers
self.l... | [
"soccer.exceptions.APIErrorException",
"requests.get",
"click.secho"
] | [((502, 567), 'requests.get', 'requests.get', (['(RequestHandler.BASE_URL + url)'], {'headers': 'self.headers'}), '(RequestHandler.BASE_URL + url, headers=self.headers)\n', (514, 567), False, 'import requests\n'), ((1314, 1351), 'requests.get', 'requests.get', (['RequestHandler.LIVE_URL'], {}), '(RequestHandler.LIVE_UR... |
import logging
import datetime
from django.conf import settings
from api.ingest.source import Source
from api.rdf.namespace import OMIM
import api.lookup.lookup_elasticsearch as lookup_es
import pandas as pd
logger = logging.getLogger(__name__)
class OMIMValueset(Source):
def __init__(self):
super(... | [
"logging.getLogger",
"api.lookup.lookup_elasticsearch.index",
"pandas.read_csv",
"datetime.datetime.now",
"api.lookup.lookup_elasticsearch.index_by_bulk",
"api.lookup.lookup_elasticsearch.delete_valueset"
] | [((224, 251), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (241, 251), False, 'import logging\n'), ((675, 829), 'pandas.read_csv', 'pd.read_csv', (['self.url'], {'sep': '"""\t"""', 'skiprows': '(3)', 'skipfooter': '(13)', 'names': "['prefix', 'mim_number', 'preferred_title', 'alternativ... |
from .generic_indicator import GenericIndicator
from pyti.average_true_range import average_true_range as atr
# params: period
# https://github.com/kylejusticemagnuson/pyti/blob/master/pyti/average_true_range.py
class PytiAverageTrueRange(GenericIndicator):
def __init__(self, market, interval, periods, params=No... | [
"pyti.average_true_range.average_true_range"
] | [((447, 479), 'pyti.average_true_range.average_true_range', 'atr', (['data', "self.params['period']"], {}), "(data, self.params['period'])\n", (450, 479), True, 'from pyti.average_true_range import average_true_range as atr\n')] |
import json
from time import process_time
import numpy as np
from matplotlib import pyplot as plt
from sklearn.metrics import accuracy_score
from PCA.reductionPCA import reductionPCA, plotting, standardise
from RBFN.classifierRBFN import train_data, make_prediction, get_XY, amount_centroids, plot_centroids
from Resou... | [
"matplotlib.pyplot.grid",
"matplotlib.pyplot.ylabel",
"numpy.array",
"RBFN.classifierRBFN.train_data",
"time.process_time",
"numpy.mean",
"PCA.reductionPCA.plotting",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.ylim",
"PCA.reductionPCA.reductionPCA",
"matplotlib.... | [((3380, 3397), 'PCA.reductionPCA.plotting', 'plotting', (['pca_all'], {}), '(pca_all)\n', (3388, 3397), False, 'from PCA.reductionPCA import reductionPCA, plotting, standardise\n'), ((4237, 4251), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (4249, 4251), True, 'from matplotlib import pyplot as plt\... |
import os
import tempfile
import mock
import numpy as np
from yt.testing import assert_equal, fake_random_ds
from yt.units.unit_object import Unit
def setup():
from yt.config import ytcfg
ytcfg["yt", "__withintesting"] = "True"
def teardown_func(fns):
for fn in fns:
try:
os.remove... | [
"mock.patch",
"yt.testing.assert_equal",
"numpy.unique",
"os.close",
"yt.testing.fake_random_ds",
"yt.units.unit_object.Unit",
"numpy.finfo",
"tempfile.mkstemp",
"os.remove"
] | [((369, 441), 'mock.patch', 'mock.patch', (['"""yt.visualization._mpl_imports.FigureCanvasAgg.print_figure"""'], {}), "('yt.visualization._mpl_imports.FigureCanvasAgg.print_figure')\n", (379, 441), False, 'import mock\n'), ((3032, 3098), 'yt.testing.fake_random_ds', 'fake_random_ds', (['(64)'], {'nprocs': '(8)', 'field... |
import re
from collections import namedtuple
Help = namedtuple('Help', 'options')
opt_pattern = re.compile(r'((--[a-zA-Z\-]+)|(-[a-zA-Z])\b)')
def parse_help(helpstr):
# Contains options, e.g. --help, --verbose, -o
options = [match[1] for match in opt_pattern.finditer(helpstr)]
return Help(options=options)
| [
"collections.namedtuple",
"re.compile"
] | [((54, 83), 'collections.namedtuple', 'namedtuple', (['"""Help"""', '"""options"""'], {}), "('Help', 'options')\n", (64, 83), False, 'from collections import namedtuple\n'), ((99, 146), 're.compile', 're.compile', (['"""((--[a-zA-Z\\\\-]+)|(-[a-zA-Z])\\\\b)"""'], {}), "('((--[a-zA-Z\\\\-]+)|(-[a-zA-Z])\\\\b)')\n", (109... |
from holdem import Table, TableProxy, PlayerControl, PlayerControlProxy
import time
seats = 8
# start an table with 8 seats
t = Table(seats)
tp = TableProxy(t)
# controller for human meat bag
h = PlayerControl("localhost", 8001, 1, False, None)
hp = PlayerControlProxy(h)
print('starting ai players')
#rule based ai
... | [
"holdem.Table",
"holdem.PlayerControl",
"holdem.TableProxy",
"holdem.PlayerControlProxy"
] | [((129, 141), 'holdem.Table', 'Table', (['seats'], {}), '(seats)\n', (134, 141), False, 'from holdem import Table, TableProxy, PlayerControl, PlayerControlProxy\n'), ((147, 160), 'holdem.TableProxy', 'TableProxy', (['t'], {}), '(t)\n', (157, 160), False, 'from holdem import Table, TableProxy, PlayerControl, PlayerContr... |
# Copyright 2022 NVIDIA Corporation
#
# 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 wr... | [
"numpy.random.randint",
"numpy.array_equal",
"cunumeric.array.convert_to_cunumeric_ndarray"
] | [((2028, 2079), 'numpy.random.randint', 'np.random.randint', ([], {'low': '(0)', 'high': '(100)', 'size': 'input_size'}), '(low=0, high=100, size=input_size)\n', (2045, 2079), True, 'import numpy as np\n'), ((2094, 2125), 'cunumeric.array.convert_to_cunumeric_ndarray', 'convert_to_cunumeric_ndarray', (['a'], {}), '(a)\... |
import numpy as np
import math
from keras.initializations import normal, identity
from keras.models import model_from_json
from keras.models import Sequential, Model
from keras.engine.training import collect_trainable_weights
from keras.layers import Dense, Flatten, Input, merge, Lambda, GRU, Conv2D, MaxPooling2D, Flat... | [
"keras.initializations.normal",
"keras.layers.Conv2D",
"tensorflow.initialize_all_variables",
"keras.layers.Flatten",
"keras.layers.MaxPooling2D",
"tensorflow.placeholder",
"keras.backend.set_session",
"keras.layers.merge",
"tensorflow.gradients",
"keras.layers.Input",
"keras.models.Model",
"k... | [((714, 733), 'keras.backend.set_session', 'K.set_session', (['sess'], {}), '(sess)\n', (727, 733), True, 'import keras.backend as K\n'), ((1088, 1135), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32', '[None, action_size]'], {}), '(tf.float32, [None, action_size])\n', (1102, 1135), True, 'import tensorflow ... |
#!/usr/bin/env python
import torch, sys
import torch.nn.functional as F
import torch.nn as nn
from .classifier_base import ClassifierBase
class Classifier(ClassifierBase):
def __init__(self, target_size, vocab, pretrained_embed=True, cnn_kernel_num=20, cnn_kernel_size=5, pool_size=2, dropout=0.8, max_seq_len=16, d... | [
"torch.nn.MaxPool1d",
"torch.nn.Dropout",
"torch.nn.Conv2d",
"torch.cat",
"torch.nn.functional.relu",
"torch.nn.Embedding"
] | [((422, 551), 'torch.nn.Embedding', 'nn.Embedding', ([], {'num_embeddings': 'self.vocab.vocab_size', 'embedding_dim': 'self.vocab.emb_ins.vec_len', 'padding_idx': 'self.vocab._id_PAD'}), '(num_embeddings=self.vocab.vocab_size, embedding_dim=self.vocab\n .emb_ins.vec_len, padding_idx=self.vocab._id_PAD)\n', (434, 551... |
#!/anaconda/envs/tensorflow/bin/python
# -*- coding: utf-8 -*-
"""
Yet another one of the simplest implementation of neural network.
It supports layer structure configuration via a list.
Created on Wed Mar 28 20:07:33 2018
@author: <NAME>
"""
import numpy as np
from LogisticRegression import traincsv2matrix, onezero
... | [
"numpy.random.rand",
"LogisticRegression.traincsv2matrix",
"numpy.exp",
"LogisticRegression.onezero",
"pprint.pprint"
] | [((9679, 9718), 'LogisticRegression.traincsv2matrix', 'traincsv2matrix', (['"""diabetes_dataset.csv"""'], {}), "('diabetes_dataset.csv')\n", (9694, 9718), False, 'from LogisticRegression import traincsv2matrix, onezero\n'), ((9809, 9827), 'pprint.pprint', 'pprint', (['mlp.hidden'], {}), '(mlp.hidden)\n', (9815, 9827), ... |
# coding: utf-8
# In[1]:
import requests
import zipfile
import os
import shutil
import StringIO #In Python 3.x substitute StringIO with io
import argparse
import codecs
import json
# In[2]:
#This section parses arguments passed through it from command line
parser = argparse.ArgumentParser()
#Metadata url
parser.ad... | [
"StringIO.StringIO",
"os.path.exists",
"os.makedirs",
"argparse.ArgumentParser",
"zipfile.ZipFile",
"json.dump",
"os.path.join",
"requests.get",
"shutil.copy",
"os.path.abspath",
"os.walk",
"os.remove"
] | [((271, 296), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (294, 296), False, 'import argparse\n'), ((5135, 5161), 'os.path.join', 'os.path.join', (['root', '"""Data"""'], {}), "(root, 'Data')\n", (5147, 5161), False, 'import os\n'), ((1897, 1914), 'requests.get', 'requests.get', (['url'], {}... |
import types
from importlib import import_module
from importlib.util import module_from_spec, spec_from_file_location
from inspect import ismodule
from os import environ as os_environ
from pathlib import Path
from re import findall as re_findall
from typing import Union
from x_rpc.exceptions import LoadFileException, ... | [
"os.environ.keys",
"importlib.import_module",
"types.ModuleType",
"inspect.ismodule",
"importlib.util.spec_from_file_location",
"x_rpc.exceptions.PyFileException",
"importlib.util.module_from_spec",
"re.findall"
] | [((704, 742), 'importlib.import_module', 'import_module', (['module'], {'package': 'package'}), '(module, package=package)\n', (717, 742), False, 'from importlib import import_module\n'), ((783, 796), 'inspect.ismodule', 'ismodule', (['obj'], {}), '(obj)\n', (791, 796), False, 'from inspect import ismodule\n'), ((2123,... |
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 8 20:05:36 2016
@author: JSong
"""
import os
import time
import pandas as pd
import numpy as np
pd.set_option('display.float_format', lambda x: '%.2f' % x)
from . import config
from .utils import Delaunay2D
import matplotlib.image as mpimg
import seaborn as sns
from... | [
"numpy.sqrt",
"numpy.random.rand",
"matplotlib.image.imread",
"io.BytesIO",
"pptx.Presentation",
"pptx.chart.data.XyChartData",
"numpy.mean",
"pptx.dml.color.RGBColor",
"os.path.exists",
"pptx.util.Emu",
"os.path.split",
"pandas.set_option",
"pptx.chart.data.ChartData",
"numpy.linspace",
... | [((147, 206), 'pandas.set_option', 'pd.set_option', (['"""display.float_format"""', "(lambda x: '%.2f' % x)"], {}), "('display.float_format', lambda x: '%.2f' % x)\n", (160, 206), True, 'import pandas as pd\n'), ((634, 657), 'os.path.split', 'os.path.split', (['__file__'], {}), '(__file__)\n', (647, 657), False, 'impor... |
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
import umbra_pb2 as umbra__pb2
class BrokerStub(object):
# missing associated documentation comment in .proto file
pass
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.... | [
"grpc.method_handlers_generic_handler",
"grpc.unary_unary_rpc_method_handler"
] | [((1191, 1264), 'grpc.method_handlers_generic_handler', 'grpc.method_handlers_generic_handler', (['"""umbra.Broker"""', 'rpc_method_handlers'], {}), "('umbra.Broker', rpc_method_handlers)\n", (1227, 1264), False, 'import grpc\n'), ((2409, 2484), 'grpc.method_handlers_generic_handler', 'grpc.method_handlers_generic_hand... |