code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 11 01:26:31 2019
@author: f.divruno
"""
import numpy as np
import pycraf as pycraf
from astropy.coordinates import SkyCoord, EarthLocation, AltAz
from astropy.time import Time
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import cartopy.crs as ... | [
"matplotlib.pyplot.title",
"numpy.abs",
"numpy.random.seed",
"numpy.sum",
"numpy.arctan2",
"astropy.coordinates.AltAz",
"numpy.einsum",
"matplotlib.pyplot.figure",
"numpy.sin",
"numpy.interp",
"numpy.unique",
"matplotlib.pyplot.draw",
"numpy.max",
"numpy.linspace",
"numpy.log10",
"nump... | [((11518, 11551), 'numba.jit', 'jit', ([], {'nopython': '(True)', 'parallel': '(True)'}), '(nopython=True, parallel=True)\n', (11521, 11551), False, 'from numba import jit\n'), ((614, 625), 'numpy.zeros', 'np.zeros', (['N'], {}), '(N)\n', (622, 625), True, 'import numpy as np\n'), ((639, 652), 'numpy.abs', 'np.abs', ([... |
import pygame
import sys
import os
def load():
# path of player with different states
PLAYER_PATH = (
os.path.join('game', 'assets', 'sprites', 'redbird-upflap.png'),
os.path.join('game', 'assets', 'sprites', 'redbird-midflap.png'),
os.path.join('game', 'assets', 'sprites', ... | [
"pygame.image.load",
"os.path.join"
] | [((398, 463), 'os.path.join', 'os.path.join', (['"""game"""', '"""assets"""', '"""sprites"""', '"""background-black.png"""'], {}), "('game', 'assets', 'sprites', 'background-black.png')\n", (410, 463), False, 'import os\n'), ((500, 559), 'os.path.join', 'os.path.join', (['"""game"""', '"""assets"""', '"""sprites"""', '... |
from GridCal.Engine.calculation_engine import *
from GridCal.Engine.Simulations.Dynamics.dynamic_modules import *
grid = MultiCircuit()
# grid.load_file('lynn5buspv.xlsx')
grid.load_file('IEEE30.xlsx')
grid.compile()
circuit = grid.circuits[0]
options = PowerFlowOptions(SolverType.NR, verbose=False, robust=False, to... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show"
] | [((1031, 1043), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (1041, 1043), True, 'from matplotlib import pyplot as plt\n'), ((1094, 1125), 'matplotlib.pyplot.title', 'plt.title', (['"""Generator voltages"""'], {}), "('Generator voltages')\n", (1103, 1125), True, 'from matplotlib import pyplot as plt\n'),... |
# DO NOT EDIT THIS FILE!
#
# Python module CosReference__POA generated by omniidl
import omniORB
omniORB.updateModule("CosReference__POA")
# ** 1. Stub files contributing to this module
import CosReference_idl
# ** 2. Sub-modules
# ** 3. End
| [
"omniORB.updateModule"
] | [((98, 139), 'omniORB.updateModule', 'omniORB.updateModule', (['"""CosReference__POA"""'], {}), "('CosReference__POA')\n", (118, 139), False, 'import omniORB\n')] |
"""
Copyright 2013 Rackspace, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software... | [
"uuid.uuid4",
"structlog.get_logger"
] | [((987, 1009), 'structlog.get_logger', 'structlog.get_logger', ([], {}), '()\n', (1007, 1009), False, 'import structlog\n'), ((1120, 1132), 'uuid.uuid4', 'uuid.uuid4', ([], {}), '()\n', (1130, 1132), False, 'import uuid\n')] |
# Copyright 2017 The TensorFlow Authors. 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 applica... | [
"tensorflow.compat.v2.test.main",
"tensorflow.compat.v2.constant",
"tensorflow.compat.v2.enable_v2_behavior",
"absl.testing.parameterized.parameters",
"tensorflow.compat.v2.function",
"itertools.product",
"tensorflow.compat.v2.Variable"
] | [((946, 969), 'tensorflow.compat.v2.enable_v2_behavior', 'tf.enable_v2_behavior', ([], {}), '()\n', (967, 969), True, 'import tensorflow.compat.v2 as tf\n'), ((4491, 5129), 'absl.testing.parameterized.parameters', 'parameterized.parameters', (["(if_creates_var, False, bool, TypeError, 'special_values.Undefined')", '(if... |
import numpy as np
from scipy.special import kv, iv # Needed for K1 in Well class, and in CircInhom
from .aquifer import AquiferData
from .element import Element
from .equation import InhomEquation
class CircInhomData(AquiferData):
def __init__(self, model, x0=0, y0=0, R=1, kaq=[1], Haq=[1], c=[1],
... | [
"numpy.ones_like",
"numpy.sum",
"numpy.zeros",
"numpy.ones",
"scipy.special.iv",
"numpy.sin",
"numpy.array",
"numpy.arange",
"numpy.linspace",
"numpy.exp",
"numpy.cos",
"scipy.special.kv",
"numpy.atleast_1d",
"numpy.sqrt"
] | [((2073, 2095), 'numpy.arange', 'np.arange', (['self.Nterms'], {}), '(self.Nterms)\n', (2082, 2095), True, 'import numpy as np\n'), ((2183, 2227), 'numpy.ones', 'np.ones', (['(self.Norder, 2 * self.Nterms)', '"""d"""'], {}), "((self.Norder, 2 * self.Nterms), 'd')\n", (2190, 2227), True, 'import numpy as np\n'), ((2246,... |
'''
Created on 9 de nov de 2020
@author: klaus
'''
import jsonlines
from folders import DATA_DIR, SUBMISSIONS_DIR
import os
from os import path
import pandas as pd
import numpy as np
import urllib
import igraph as ig
from input.read_input import read_item_data, get_emb
def create_ratio(mode = 'train',CUTOFF=50, whi... | [
"fasttext.FastText.load_model",
"pandas.DataFrame.from_dict",
"pandas.read_csv",
"numpy.std",
"numpy.round",
"input.read_input.read_item_data",
"pandas.unique",
"urllib.request.urlretrieve",
"os.path.isfile",
"numpy.mean",
"numpy.array",
"numpy.where",
"pandas.qcut",
"jsonlines.open",
"o... | [((475, 491), 'input.read_input.read_item_data', 'read_item_data', ([], {}), '()\n', (489, 491), False, 'from input.read_input import read_item_data, get_emb\n'), ((515, 547), 'pandas.qcut', 'pd.qcut', (["df['price'].values", '(100)'], {}), "(df['price'].values, 100)\n", (522, 547), True, 'import pandas as pd\n'), ((89... |
import os
from math import sqrt
import numpy as np
import scipy.optimize
from scipy.stats import chi2
import matplotlib
matplotlib.use('Agg')
matplotlib.rc('font', **{'family': 'serif', 'serif': ['Computer Modern'], 'size': 15})
matplotlib.rc('text', usetex=False)
import matplotlib.pyplot as plt
from enrico import util... | [
"matplotlib.rc",
"numpy.floor",
"enrico.config.get_config",
"enrico.submit.call",
"os.path.isfile",
"matplotlib.pyplot.figure",
"enrico.utils._log",
"numpy.arange",
"numpy.mean",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.tight_layout",
"enrico.environ.DIRS.get",
"enrico.utils.MJD_to_met",
... | [((120, 141), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (134, 141), False, 'import matplotlib\n'), ((142, 232), 'matplotlib.rc', 'matplotlib.rc', (['"""font"""'], {}), "('font', **{'family': 'serif', 'serif': ['Computer Modern'],\n 'size': 15})\n", (155, 232), False, 'import matplotlib\n'... |
import json
from datetime import datetime
import hashlib
import hmac
from base64 import b64encode
from django.utils.crypto import constant_time_compare
from django.utils.timezone import utc
from .base import AnymailBaseWebhookView
from ..exceptions import AnymailWebhookValidationFailure, AnymailConfigurationError
fro... | [
"django.utils.crypto.constant_time_compare",
"json.loads",
"datetime.datetime.fromtimestamp"
] | [((2478, 2521), 'json.loads', 'json.loads', (["request.POST['mandrill_events']"], {}), "(request.POST['mandrill_events'])\n", (2488, 2521), False, 'import json\n'), ((2058, 2110), 'django.utils.crypto.constant_time_compare', 'constant_time_compare', (['signature', 'expected_signature'], {}), '(signature, expected_signa... |
from db.database import _update_time, _get_last_remind
from datetime import datetime, timedelta
from utils.constants import DATETIME_FORMAT, HOUR
def postpone(bot, update, args):
user_chat_id = update.message.chat_id
user_message = ' '.join(args).split(" ")
postpone_timedelta = user_message[0]
postpone... | [
"db.database._get_last_remind",
"db.database._update_time",
"datetime.datetime.strptime",
"datetime.timedelta"
] | [((925, 972), 'db.database._update_time', '_update_time', (['user_chat_id', 'remind_id', 'new_time'], {}), '(user_chat_id, remind_id, new_time)\n', (937, 972), False, 'from db.database import _update_time, _get_last_remind\n'), ((1957, 2004), 'db.database._update_time', '_update_time', (['user_chat_id', 'remind_id', 'n... |
from django.db import models
# Create your models here.
class UserCart(models.Model):
user = models.ForeignKey('core.User', on_delete=models.PROTECT)
pdfs = models.ManyToManyField('core.PDF', blank=True)
mcqs = models.ManyToManyField('core.MCQ', blank=True)
summaries = models.ManyToManyField('core.Summ... | [
"django.db.models.OneToOneField",
"django.db.models.ManyToManyField",
"django.db.models.ForeignKey",
"django.db.models.CharField",
"django.db.models.BooleanField",
"django.db.models.DateTimeField"
] | [((98, 154), 'django.db.models.ForeignKey', 'models.ForeignKey', (['"""core.User"""'], {'on_delete': 'models.PROTECT'}), "('core.User', on_delete=models.PROTECT)\n", (115, 154), False, 'from django.db import models\n'), ((166, 212), 'django.db.models.ManyToManyField', 'models.ManyToManyField', (['"""core.PDF"""'], {'bl... |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
# another: Jeff.Chen
# "/api"映射的访问接口
from bottle import Bottle, jinja2_view
from ..settings import *
###################
# 初始化app,加载中间件
###################
api_app = Bottle()
# 加载log
api_app.install(log_to_logger)
@api_app.get('/')
@jinja2_view('index.html')
@cache.cache... | [
"bottle.jinja2_view",
"bottle.Bottle"
] | [((212, 220), 'bottle.Bottle', 'Bottle', ([], {}), '()\n', (218, 220), False, 'from bottle import Bottle, jinja2_view\n'), ((282, 307), 'bottle.jinja2_view', 'jinja2_view', (['"""index.html"""'], {}), "('index.html')\n", (293, 307), False, 'from bottle import Bottle, jinja2_view\n')] |
import os
import platform
if platform.system() == "Windows":
lib_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "core", "bin")
win_dir = "win64" if platform.architecture()[0] == "64bit" else "win32"
dll_path = os.path.join(lib_dir, win_dir)
os.environ["PATH"] = dll_path + os.pathsep + o... | [
"platform.system",
"os.path.abspath",
"os.path.join",
"platform.architecture"
] | [((30, 47), 'platform.system', 'platform.system', ([], {}), '()\n', (45, 47), False, 'import platform\n'), ((239, 269), 'os.path.join', 'os.path.join', (['lib_dir', 'win_dir'], {}), '(lib_dir, win_dir)\n', (251, 269), False, 'import os\n'), ((105, 130), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file... |
from behave import given, when, then # pylint: disable=no-name-in-module
from asserts import assert_tuple
from core import point, vector
from shapes import Triangle
@given(u't <- triangle(p1, p2, p3)')
def step_create_triangle_t(context):
context.t = Triangle(context.p1, context.p2, context.p3)
@given(
u't... | [
"behave.when",
"behave.then",
"shapes.Triangle",
"core.point",
"core.vector",
"asserts.assert_tuple",
"behave.given"
] | [((169, 204), 'behave.given', 'given', (['u"""t <- triangle(p1, p2, p3)"""'], {}), "(u't <- triangle(p1, p2, p3)')\n", (174, 204), False, 'from behave import given, when, then\n'), ((306, 432), 'behave.given', 'given', (['u"""t <- triangle(point({x1:g}, {y1:g}, {z1:g}), point({x2:g}, {y2:g}, {z2:g}), point({x3:g}, {y3:... |
import unittest
import argparse
import tests
from tensor_parser.index_map import index_map
from tensor_parser.tensor_config import tensor_config
class TestTensorConfig(unittest.TestCase):
def test_delim(self):
config = tensor_config()
config.set_delimiter('|')
self.assertEqual(config.get_delimiter(), ... | [
"unittest.main",
"tensor_parser.tensor_config.tensor_config"
] | [((1560, 1575), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1573, 1575), False, 'import unittest\n'), ((229, 244), 'tensor_parser.tensor_config.tensor_config', 'tensor_config', ([], {}), '()\n', (242, 244), False, 'from tensor_parser.tensor_config import tensor_config\n'), ((364, 407), 'tensor_parser.tensor_co... |
#! /usr/bin/env python
from numpy import *
from osgeo import gdal
from osgeo import ogr
from osgeo import osr
from osgeo import gdal_array
from osgeo import gdalconst
import os
from log_it import *
#############################################################################
# Created on 3/24/2014 by <NAME>, USGS/ERO... | [
"osgeo.gdal.Open",
"os.path.exists"
] | [((2426, 2442), 'osgeo.gdal.Open', 'gdal.Open', (['fname'], {}), '(fname)\n', (2435, 2442), False, 'from osgeo import gdal\n'), ((2176, 2197), 'os.path.exists', 'os.path.exists', (['fname'], {}), '(fname)\n', (2190, 2197), False, 'import os\n')] |
from psyrun import Param
from psyrun.store.h5 import H5Store
pspace = Param(x=range(4))
store = H5Store()
def execute(x):
return {'y': x ** 2}
| [
"psyrun.store.h5.H5Store"
] | [((98, 107), 'psyrun.store.h5.H5Store', 'H5Store', ([], {}), '()\n', (105, 107), False, 'from psyrun.store.h5 import H5Store\n')] |
from copy import deepcopy
from random import random
from typing import Any, Dict, List, Tuple
import pika
from pika import exceptions
from pika.adapters.blocking_connection import BlockingChannel
from .app import Rabbitmq
class Dummy:
pass
class MockRabbitmq(Rabbitmq):
def create_connection(self):
... | [
"random.random",
"copy.deepcopy",
"pika.exceptions.ConnectionWrongStateError"
] | [((2403, 2411), 'random.random', 'random', ([], {}), '()\n', (2409, 2411), False, 'from random import random\n'), ((755, 822), 'pika.exceptions.ConnectionWrongStateError', 'exceptions.ConnectionWrongStateError', (['"""called on closed connection"""'], {}), "('called on closed connection')\n", (791, 822), False, 'from p... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | [
"os.environ.get",
"ctypes.byref",
"ctypes.c_uint",
"ctypes.POINTER"
] | [((3409, 3424), 'ctypes.c_uint', 'ctypes.c_uint', ([], {}), '()\n', (3422, 3424), False, 'import ctypes\n'), ((3364, 3395), 'ctypes.POINTER', 'ctypes.POINTER', (['ctypes.c_char_p'], {}), '(ctypes.c_char_p)\n', (3378, 3395), False, 'import ctypes\n'), ((1037, 1080), 'os.environ.get', 'os.environ.get', (['"""MXNET_ENABLE... |
import subprocess
import numpy as np
from rsbeams.rsdata.SDDS import readSDDS
def obj_f(_):
analysis_command = ["sddsanalyzebeam", "run_setup.output.sdds", "output.anb"]
subprocess.call(analysis_command)
anb = readSDDS("output.anb")
anb.read()
betax, betax_target = anb.columns['betax'].squeeze()... | [
"numpy.array",
"numpy.sqrt",
"subprocess.call",
"rsbeams.rsdata.SDDS.readSDDS"
] | [((180, 213), 'subprocess.call', 'subprocess.call', (['analysis_command'], {}), '(analysis_command)\n', (195, 213), False, 'import subprocess\n'), ((225, 247), 'rsbeams.rsdata.SDDS.readSDDS', 'readSDDS', (['"""output.anb"""'], {}), "('output.anb')\n", (233, 247), False, 'from rsbeams.rsdata.SDDS import readSDDS\n'), ((... |
import numpy as np
from ..utils.darray import DependArray
class NonPBC(object):
def __init__(self, rij, charges, cell_basis=None, exclusion=None, *, dij_inverse=None, dij_inverse_gradient=None):
self.charges = charges
self.qmmm_coulomb_tensor = DependArray(
name="qmmm_coulomb_tensor... | [
"numpy.asarray",
"numpy.zeros",
"numpy.copy"
] | [((1598, 1635), 'numpy.zeros', 'np.zeros', (['(4, t.shape[0], t.shape[1])'], {}), '((4, t.shape[0], t.shape[1]))\n', (1606, 1635), True, 'import numpy as np\n'), ((1099, 1119), 'numpy.copy', 'np.copy', (['dij_inverse'], {}), '(dij_inverse)\n', (1106, 1119), True, 'import numpy as np\n'), ((1373, 1402), 'numpy.copy', 'n... |
#
import numpy
import pandas
#
import torch
from torch import nn
#
N = 10_000
data_raw = pandas.DataFrame(data={'A': numpy.array(numpy.arange(N)),
# 'A': numpy.random.choice([0, 1], size=(N,)),
'B': numpy.array(numpy.arange(N)) + numpy.random.normal(size=(N,)),
... | [
"new_siege.neuro.Gene",
"torch.nn.MSELoss",
"new_siege.data.DataHandler",
"numpy.arange",
"numpy.random.normal"
] | [((803, 832), 'new_siege.data.DataHandler', 'DataHandler', (['data_set', 'target'], {}), '(data_set, target)\n', (814, 832), False, 'from new_siege.data import DataHandler\n'), ((1181, 1288), 'new_siege.neuro.Gene', 'Gene', (['data', 'layers', 'layers_dimensions', 'activators', 'activators_args', 'preprocessors', 'embe... |
#!/usr/bin/env python
from __future__ import print_function
from __future__ import unicode_literals
try:
from unittest import mock
except ImportError:
import mock
import pytest
from tdclient import api
from tdclient import client
from tdclient.test.test_helper import *
def setup_function(function):
unse... | [
"pytest.raises",
"mock.MagicMock",
"tdclient.client.Client"
] | [((368, 388), 'tdclient.client.Client', 'client.Client', (['"""foo"""'], {}), "('foo')\n", (381, 388), False, 'from tdclient import client\n'), ((489, 512), 'tdclient.client.Client', 'client.Client', (['"""APIKEY"""'], {}), "('APIKEY')\n", (502, 512), False, 'from tdclient import client\n'), ((527, 543), 'mock.MagicMoc... |
import faiss
import numpy as np
from scipy import sparse, special
def estimate_pdf(target, emb, C=0.1):
"""Estimate the density of entities at the given target locations in the
embedding space using the density estimator based on the k-nearest
neighbors.
:param target: Target location at which the de... | [
"scipy.special.loggamma",
"numpy.log",
"numpy.power",
"numpy.max",
"faiss.IndexFlatL2"
] | [((1615, 1637), 'faiss.IndexFlatL2', 'faiss.IndexFlatL2', (['dim'], {}), '(dim)\n', (1632, 1637), False, 'import faiss\n'), ((1942, 1967), 'numpy.max', 'np.max', (['distances'], {'axis': '(1)'}), '(distances, axis=1)\n', (1948, 1967), True, 'import numpy as np\n'), ((1901, 1932), 'scipy.special.loggamma', 'special.logg... |
#!/usr/bin/python
# Copyright: (c) 2020, <NAME>
# MIT License
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'
}
DOCUMENTATION = '''
---
module: github_release_metadata... | [
"ansible.module_utils._text.to_native",
"ansible.module_utils.basic.AnsibleModule",
"ansible.module_utils._text.to_text",
"ansible.module_utils.urls.fetch_url"
] | [((1938, 2004), 'ansible.module_utils.basic.AnsibleModule', 'AnsibleModule', ([], {'argument_spec': 'module_args', 'supports_check_mode': '(True)'}), '(argument_spec=module_args, supports_check_mode=True)\n', (1951, 2004), False, 'from ansible.module_utils.basic import AnsibleModule\n'), ((2449, 2471), 'ansible.module_... |
#!/usr/bin/env python3 -u
import sys
import time
import serial # pyserial
def make_serial():
from serial.tools.list_ports import comports
names = [ x.device for x in comports() if 'Bluetooth' not in x.device ]
if not names:
raise Exception("No serial port found")
return serial.Serial(port=names... | [
"serial.Serial",
"sys.stdout.write",
"serial.tools.list_ports.comports",
"time.sleep",
"sys.stdout.flush"
] | [((296, 352), 'serial.Serial', 'serial.Serial', ([], {'port': 'names[0]', 'baudrate': '(115200)', 'timeout': '(2)'}), '(port=names[0], baudrate=115200, timeout=2)\n', (309, 352), False, 'import serial\n'), ((175, 185), 'serial.tools.list_ports.comports', 'comports', ([], {}), '()\n', (183, 185), False, 'from serial.too... |
"""这是介绍tensorflow基本用法的伪函数"""
import tensorflow as tf
b = tf.Variable(tf.zeros([100])) # 生成100维的向量初始值是0
W = tf.Variable(tf.random_uniform([784, 100], -1, 1)) # 生成784*100随机矩阵W
"""Outputs random values from a uniform distribution.The generated values follow a uniform distribution in the range
`[minval, maxval)`. The lo... | [
"tensorflow.random_uniform",
"tensorflow.Session",
"tensorflow.placeholder",
"tensorflow.matmul",
"tensorflow.zeros"
] | [((416, 440), 'tensorflow.placeholder', 'tf.placeholder', ([], {'name': '"""X"""'}), "(name='X')\n", (430, 440), True, 'import tensorflow as tf\n'), ((545, 557), 'tensorflow.Session', 'tf.Session', ([], {}), '()\n', (555, 557), True, 'import tensorflow as tf\n'), ((70, 85), 'tensorflow.zeros', 'tf.zeros', (['[100]'], {... |
import warnings, sys, time, random, pickle, pygame
warnings.filterwarnings("ignore")
file = sys.argv[0]
class keys:
UP = pygame.K_UP
DOWN = pygame.K_DOWN
LEFT = pygame.K_LEFT
RIGHT = pygame.K_RIGHT
WIDTH = 660
HEIGHT = 600
TITLE = "Snek Game"
size = 20
def saveMap(obj, filename):
... | [
"pickle.dump",
"pickle.load",
"random.randrange",
"warnings.filterwarnings"
] | [((52, 85), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (75, 85), False, 'import warnings, sys, time, random, pickle, pygame\n'), ((399, 446), 'pickle.dump', 'pickle.dump', (['obj', 'outp', 'pickle.HIGHEST_PROTOCOL'], {}), '(obj, outp, pickle.HIGHEST_PROTOCOL)\n', (410,... |
import time
# from flask import Flask, request
import flask
from flask import request, Response, render_template, jsonify, send_file, make_response
import os
import subprocess
import sys
import pandas
from shelljob import proc
import csv
import json
import pandas as pd
from copy import deepcopy
from ruamel import yam... | [
"subprocess.Popen",
"copy.deepcopy",
"flask.request.args.get",
"ruamel.yaml.dump",
"numpy.std",
"os.getcwd",
"pandas.read_csv",
"flask.Flask",
"time.sleep",
"flask.jsonify",
"numpy.mean",
"ruamel.yaml.load",
"shutil.copytree",
"os.listdir"
] | [((340, 361), 'flask.Flask', 'flask.Flask', (['__name__'], {}), '(__name__)\n', (351, 361), False, 'import flask\n'), ((667, 695), 'flask.request.args.get', 'request.args.get', (['"""sentence"""'], {}), "('sentence')\n", (683, 695), False, 'from flask import request, Response, render_template, jsonify, send_file, make_... |
#!/usr/bin/python
# Licensed under the Apache License, Version 2.0 (the "License")
# fileinfoupdater ---- a tool to trace file content changes in an appointed path.
# version 1.0
# <NAME> August 30, 2019
from __future__ import print_function
from bcc import BPF
import argparse
import datetime
import os
import sys
#... | [
"argparse.ArgumentParser",
"os.stat",
"bcc.BPF",
"datetime.datetime.fromtimestamp",
"datetime.datetime.now",
"sys.exit"
] | [((495, 639), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Get file info when file closes"""', 'formatter_class': 'argparse.RawDescriptionHelpFormatter', 'epilog': 'examples'}), "(description='Get file info when file closes',\n formatter_class=argparse.RawDescriptionHelpFormatter, e... |
from dbt.adapters.sql import SQLAdapter
from dbt.adapters.dremio import DremioConnectionManager
from dbt.adapters.dremio.relation import DremioRelation
from typing import List
from typing import Optional
import dbt.flags
from dbt.adapters.base.relation import BaseRelation
from dbt.logger import GLOBAL_LOGGER as logger... | [
"agate.MaxPrecision"
] | [((1077, 1104), 'agate.MaxPrecision', 'agate.MaxPrecision', (['col_idx'], {}), '(col_idx)\n', (1095, 1104), False, 'import agate\n')] |
from . import Instrument
from collections import deque
import mido
import numpy
import itertools
import operator
SCALE_WEIGHTS = [6, 2, 4, 2, 4, 1, 3]
MAX_JUMP = 7
EOLIAN_SCALE = [0, 2, 3, 5, 7, 8, 10]
class SynthLead(Instrument):
TRACK_NAME_BASE = "Lead Synth"
def __init__(self, live_set, role, recordi... | [
"itertools.repeat",
"mido.Message",
"itertools.count",
"itertools.islice",
"numpy.random.choice",
"itertools.cycle",
"mido.open_output",
"collections.deque"
] | [((454, 461), 'collections.deque', 'deque', ([], {}), '()\n', (459, 461), False, 'from collections import deque\n'), ((489, 541), 'mido.open_output', 'mido.open_output', (["('IAC Driver Melody %s' % self.role)"], {}), "('IAC Driver Melody %s' % self.role)\n", (505, 541), False, 'import mido\n'), ((4843, 4865), 'itertoo... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import feedparser
import time
import re
TITLE_RE = r'(?P<type>\w*): ?(?P<name>.*) \((?P<state>\w\w)\)'
DESCRIPTION_RE = r'CONTACT: ?(?P<contact>.*) (?P<phone>\d?-?\d{3}-\d{3}-\d{4}).?'
ID_RE = r'caseNum=(?P<id>\d+)'
KID_FEED_URL = "http://www.missingkids.com/missingkids/servle... | [
"time.strptime",
"re.search",
"feedparser.parse"
] | [((2924, 2959), 're.search', 're.search', (['TITLE_RE', 'self.raw_title'], {}), '(TITLE_RE, self.raw_title)\n', (2933, 2959), False, 'import re\n'), ((3361, 3419), 'time.strptime', 'time.strptime', (['self.time_raw[:-4]', '"""%a, %d %b %Y %H:%M:%S"""'], {}), "(self.time_raw[:-4], '%a, %d %b %Y %H:%M:%S')\n", (3374, 341... |
import groundstation.proto.channel_list_pb2
from groundstation import logger
log = logger.getLogger(__name__)
from groundstation.gref import Gref, Tip
def handle_describechannels(self):
if not self.payload:
log.info("station %s sent empty DESCRIBECHANNELS payload - new database?" % (str(self.origin)))
... | [
"groundstation.gref.Tip",
"groundstation.logger.getLogger",
"groundstation.gref.Gref"
] | [((84, 110), 'groundstation.logger.getLogger', 'logger.getLogger', (['__name__'], {}), '(__name__)\n', (100, 110), False, 'from groundstation import logger\n'), ((554, 616), 'groundstation.gref.Gref', 'Gref', (['self.station.store', 'channel.channelname', 'gref.identifier'], {}), '(self.station.store, channel.channelna... |
"""Payouts resource client for the paypal resource group.
Resource docs & Reference: https://developer.paypal.com/docs/api/payments.payouts-batch/v1/
"""
import json
from typing import Type, TypeVar, List
from pypaypal.clients.base import ClientBase, ActionLink
from pypaypal.http import (
parse_url,
Pa... | [
"pypaypal.entities.base.PaypalApiResponse.success",
"pypaypal.entities.payouts.PayoutItem.serialize_from_json",
"pypaypal.http.parse_url",
"pypaypal.entities.payouts.PayoutHeader.serialize_from_json",
"typing.TypeVar",
"pypaypal.entities.base.PaypalApiResponse.error"
] | [((725, 772), 'pypaypal.http.parse_url', 'parse_url', (['LEGACY_LIVE_API_BASE_URL', '"""payments"""'], {}), "(LEGACY_LIVE_API_BASE_URL, 'payments')\n", (734, 772), False, 'from pypaypal.http import parse_url, PayPalSession, LEGACY_LIVE_API_BASE_URL, LEGACY_SANDBOX_API_BASE_URL\n'), ((841, 891), 'pypaypal.http.parse_url... |
#!/bin/env python
# file color_cube_actor.py
from textwrap import dedent
from OpenGL.GL import * # @UnusedWildImport # this comment squelches an IDE warning
from OpenGL.GL.shaders import compileShader, compileProgram
from openvr.glframework import shader_string
"""
Color cube for use in "hello world" openvr apps
... | [
"OpenGL.GL.shaders.compileProgram",
"openvr.glframework.shader_string"
] | [((3113, 3159), 'OpenGL.GL.shaders.compileProgram', 'compileProgram', (['vertex_shader', 'fragment_shader'], {}), '(vertex_shader, fragment_shader)\n', (3127, 3159), False, 'from OpenGL.GL.shaders import compileShader, compileProgram\n'), ((676, 2788), 'openvr.glframework.shader_string', 'shader_string', (['"""\n ... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import functools
import numpy as np
from ....tests.helper import pytest
from .. import iers
from ....table import Table
from ....time import Time... | [
"functools.partial",
"numpy.array",
"numpy.all"
] | [((337, 391), 'functools.partial', 'functools.partial', (['np.allclose'], {'rtol': '(1e-15)', 'atol': '(1e-09)'}), '(np.allclose, rtol=1e-15, atol=1e-09)\n', (354, 391), False, 'import functools\n'), ((865, 930), 'numpy.array', 'np.array', (['[2456108.5, 2456108.5, 2456108.5, 2456109.5, 2456109.5]'], {}), '([2456108.5,... |
import torch
from torch import nn
from utils.log import get_logger
from .fm import FM
from model.module.embedding import ContextEmbedding
logger = get_logger()
class DeepFm(nn.Module):
"""DeepFm for multi actions.
Reference: https://www.ijcai.org/Proceedings/2017/0239.pdf.
http://d2l.ai/chapter_rec... | [
"torch.nn.Dropout",
"torch.nn.ReLU",
"torch.nn.ModuleList",
"torch.cat",
"model.module.embedding.ContextEmbedding",
"torch.nn.Linear",
"utils.log.get_logger"
] | [((149, 161), 'utils.log.get_logger', 'get_logger', ([], {}), '()\n', (159, 161), False, 'from utils.log import get_logger\n'), ((575, 590), 'torch.nn.ModuleList', 'nn.ModuleList', ([], {}), '()\n', (588, 590), False, 'from torch import nn\n'), ((3015, 3030), 'torch.nn.ModuleList', 'nn.ModuleList', ([], {}), '()\n', (3... |
# Copyright 2022 The KerasCV Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | [
"tensorflow.split",
"tensorflow.concat"
] | [((1801, 1852), 'tensorflow.split', 'tf.split', (['bounding_boxes', '[1, 1, 1, 1, -1]'], {'axis': '(-1)'}), '(bounding_boxes, [1, 1, 1, 1, -1], axis=-1)\n', (1809, 1852), True, 'import tensorflow as tf\n'), ((1864, 1964), 'tensorflow.concat', 'tf.concat', (['[x - width / 2.0, y - height / 2.0, x + width / 2.0, y + heig... |
# -*- coding: utf-8 -*-
import requests
import json
from base64 import b64encode
from neutron_lib.exceptions import dns as dns_exc
from oslo_config import cfg
from oslo_log import log
from neutron._i18n import _
from neutron.services.externaldns import driver
LOG = log.getLogger(__name__)
CONF = cfg.CONF
solidserv... | [
"oslo_log.log.getLogger",
"neutron_lib.exceptions.dns.DuplicateRecordSet",
"oslo_config.cfg.OptGroup",
"json.dumps",
"neutron._i18n._",
"requests.delete",
"requests.get",
"neutron_lib.exceptions.dns.DNSDomainNotFound",
"neutron_lib.exceptions.dns.BadRequest"
] | [((269, 292), 'oslo_log.log.getLogger', 'log.getLogger', (['__name__'], {}), '(__name__)\n', (282, 292), False, 'from oslo_log import log\n'), ((833, 906), 'oslo_config.cfg.OptGroup', 'cfg.OptGroup', ([], {'name': '"""solidserver"""', 'title': '"""EfficientIP SolidServer options"""'}), "(name='solidserver', title='Effi... |
import os
from src.api import create_app
app = create_app(os.environ["FLASK_CONFIG"])
| [
"src.api.create_app"
] | [((49, 87), 'src.api.create_app', 'create_app', (["os.environ['FLASK_CONFIG']"], {}), "(os.environ['FLASK_CONFIG'])\n", (59, 87), False, 'from src.api import create_app\n')] |
#!/usr/bin/env python
from setuptools import setup, find_packages
with open('requirements.txt') as f:
install_requires = f.read().splitlines()
setup(
name='Storitch',
version='1.0.4',
author='<NAME>',
author_email='<EMAIL>',
url='https://github.com/thomaserlang/storitch',
description='Fil... | [
"setuptools.find_packages"
] | [((398, 413), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (411, 413), False, 'from setuptools import setup, find_packages\n')] |
"""
test.py
Defines tests functions
"""
__version__ = '1.0'
__author__ = '<NAME>'
__email__ = '<EMAIL>'
from module import *
from module.bbo import Bbo
# spark
def test_spark_constructor():
return Spark.session()
# data
def test_data_load():
spark = Spark.session()
data = Data(spark, 'l3_data_v3')
... | [
"module.bbo.Bbo"
] | [((610, 620), 'module.bbo.Bbo', 'Bbo', (['spark'], {}), '(spark)\n', (613, 620), False, 'from module.bbo import Bbo\n')] |
import torch.utils.data as data
from PIL import Image
from torchvision.transforms import Compose, ToTensor, Normalize
import numpy as np
from random import randrange
# --- Validation/test dataset --- #
class ValData(data.Dataset):
def __init__(self, val_data_dir):
super().__init__()
val_list = va... | [
"torchvision.transforms.Normalize",
"torchvision.transforms.ToTensor",
"PIL.Image.open"
] | [((809, 850), 'PIL.Image.open', 'Image.open', (['(self.val_data_dir + haze_name)'], {}), '(self.val_data_dir + haze_name)\n', (819, 850), False, 'from PIL import Image\n'), ((868, 907), 'PIL.Image.open', 'Image.open', (['(self.val_data_dir + gt_name)'], {}), '(self.val_data_dir + gt_name)\n', (878, 907), False, 'from P... |
import logging
from django.db import models
from django.db.models.signals import pre_save
from django.dispatch import receiver
from service_catalog.models import Operation
logger = logging.getLogger(__name__)
class TowerSurveyField(models.Model):
name = models.CharField(null=False, blank=False, max_length=200,... | [
"django.db.models.CharField",
"django.db.models.ForeignKey",
"django.dispatch.receiver",
"django.db.models.BooleanField",
"logging.getLogger"
] | [((184, 211), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (201, 211), False, 'import logging\n'), ((889, 932), 'django.dispatch.receiver', 'receiver', (['pre_save'], {'sender': 'TowerSurveyField'}), '(pre_save, sender=TowerSurveyField)\n', (897, 932), False, 'from django.dispatch impor... |
import struct
import textwrap
class TabApp:
'''
Representation of a Tock app for a specific board from a TAB file. This is
different from a TAB, since a TAB can include compiled binaries for a range
of architectures, or compiled for various scenarios, which may not be
applicable for a particular board.
A TabApp... | [
"struct.unpack"
] | [((3831, 3884), 'struct.unpack', 'struct.unpack', (['"""<IIIIIIIIII"""', 'app_binary_notbfh[0:40]'], {}), "('<IIIIIIIIII', app_binary_notbfh[0:40])\n", (3844, 3884), False, 'import struct\n')] |
"""A script to play mighty in the console, using the engine.py module."""
import random
from cards import *
import engine
from constructs import CallType
import constructs
from time import time
from typing import Optional
space = 100
card_mode = 0 # 0 for standard card string, 1 for unicode representations
def car... | [
"constructs.is_miss_deal",
"random.shuffle",
"random.choice",
"time.time",
"constructs.is_valid_bid",
"random.random",
"engine.GameEngine",
"constructs.next_player",
"constructs.legal_plays",
"constructs.FriendCall"
] | [((4639, 4670), 'random.shuffle', 'random.shuffle', (['ai_players_seed'], {}), '(ai_players_seed)\n', (4653, 4670), False, 'import random\n'), ((5056, 5075), 'engine.GameEngine', 'engine.GameEngine', ([], {}), '()\n', (5073, 5075), False, 'import engine\n'), ((638, 666), 'constructs.legal_plays', 'constructs.legal_play... |
from csp import *
from time import time
from itertools import permutations
######### Kakuro puzzles
# Given, 4x3
kakuro_given4x3 = [
['*', '*', '*', [6, ''], [3, '']],
['*', [4, ''], [3, 3], '_', '_'],
[['', 10], '_', '_', '_', '_'],
[['', 3], '_', '_', '*', '*']
]
#Given, 5x7
kakuro_given5x7 = [
['*', [17, '... | [
"itertools.permutations",
"time.time"
] | [((8077, 8083), 'time.time', 'time', ([], {}), '()\n', (8081, 8083), False, 'from time import time\n'), ((8486, 8492), 'time.time', 'time', ([], {}), '()\n', (8490, 8492), False, 'from time import time\n'), ((8852, 8858), 'time.time', 'time', ([], {}), '()\n', (8856, 8858), False, 'from time import time\n'), ((9262, 92... |
import re
import argparse
import sys
from pathlib import Path
removedFilter = re.compile(r"\[removed\]")
deletedFilter = re.compile(r"\[deleted\]")
linkCapture = re.compile(r"\[(.*?)\]\((.*?)\)")
urlInStr = re.compile(r"https?://[^\s]+")
numInWord = re.compile(r"\w*\d\w")
nonStandardChar = re.compile(r"[^\w\s\.?!]")
m... | [
"pathlib.Path",
"argparse.ArgumentParser",
"re.compile"
] | [((79, 106), 're.compile', 're.compile', (['"""\\\\[removed\\\\]"""'], {}), "('\\\\[removed\\\\]')\n", (89, 106), False, 'import re\n'), ((122, 149), 're.compile', 're.compile', (['"""\\\\[deleted\\\\]"""'], {}), "('\\\\[deleted\\\\]')\n", (132, 149), False, 'import re\n'), ((163, 199), 're.compile', 're.compile', (['"... |
import unittest
import ee
from ee_extra.ImageCollection.core import *
ee.Initialize()
point = ee.Geometry.Point([-76.21, 3.45])
x = ee.ImageCollection("COPERNICUS/S2_SR").filterBounds(point)
class Test(unittest.TestCase):
"""Tests for ee_extra package."""
def test_closest(self):
"""Test the close... | [
"unittest.main",
"ee.ImageCollection",
"ee.Initialize",
"ee.Geometry.Point"
] | [((73, 88), 'ee.Initialize', 'ee.Initialize', ([], {}), '()\n', (86, 88), False, 'import ee\n'), ((98, 131), 'ee.Geometry.Point', 'ee.Geometry.Point', (['[-76.21, 3.45]'], {}), '([-76.21, 3.45])\n', (115, 131), False, 'import ee\n'), ((480, 495), 'unittest.main', 'unittest.main', ([], {}), '()\n', (493, 495), False, 'i... |
# TCP support
# https://docs.micropython.org/en/latest/esp8266/esp8266/tutorial/network_tcp.html
import socket
# Address info from DHCP
addr = socket.getaddrinfo('micropython.org',80)[0][-1]
# Connect to address and port using TCP
s = socket.socket()
s.connect(addr)
# Send HTTP protocol request
# We work with HTTP p... | [
"socket.getaddrinfo",
"socket.socket"
] | [((237, 252), 'socket.socket', 'socket.socket', ([], {}), '()\n', (250, 252), False, 'import socket\n'), ((144, 185), 'socket.getaddrinfo', 'socket.getaddrinfo', (['"""micropython.org"""', '(80)'], {}), "('micropython.org', 80)\n", (162, 185), False, 'import socket\n')] |
import sys
import subprocess as sp
import re
from collections import defaultdict
from peo.util import format_message
ParseError = TypeError, AssertionError, IndexError
def decompile(filepath):
proc = sp.run(
["objdump", "-d", "-M", "intel", filepath],
encoding="utf-8",
stdout=sp.PIPE,
... | [
"subprocess.run",
"peo.util.format_message",
"re.match",
"collections.defaultdict",
"sys.exit"
] | [((210, 315), 'subprocess.run', 'sp.run', (["['objdump', '-d', '-M', 'intel', filepath]"], {'encoding': '"""utf-8"""', 'stdout': 'sp.PIPE', 'stderr': 'sp.PIPE'}), "(['objdump', '-d', '-M', 'intel', filepath], encoding='utf-8', stdout\n =sp.PIPE, stderr=sp.PIPE)\n", (216, 315), True, 'import subprocess as sp\n'), ((4... |
import os
import example_config
import example_runner
from run_modes import single_run, utils
MAIN_FILE_PATH = os.path.dirname(os.path.realpath(__file__))
if __name__ == "__main__":
runner = example_runner.ExampleRunner
config = example_config.ExampleConfig
single_checkpoint_path = utils.setup_experime... | [
"os.path.realpath",
"os.path.join"
] | [((129, 155), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (145, 155), False, 'import os\n'), ((370, 417), 'os.path.join', 'os.path.join', (['MAIN_FILE_PATH', '"""example_results"""'], {}), "(MAIN_FILE_PATH, 'example_results')\n", (382, 417), False, 'import os\n'), ((439, 482), 'os.path.j... |
"""
Some examples are inspired by firestore documentations, some copyright
conditions of the firestore documentations apply to code on this page.
https://firebase.google.com/docs/firestore/query-data/queries
"""
import pytest
from google.cloud.firestore import Query, DocumentReference, \
CollectionReferen... | [
"pytest.mark.usefixtures",
"onto.attrs.bproperty"
] | [((1947, 1986), 'pytest.mark.usefixtures', 'pytest.mark.usefixtures', (['"""setup_cities"""'], {}), "('setup_cities')\n", (1970, 1986), False, 'import pytest\n'), ((3414, 3453), 'pytest.mark.usefixtures', 'pytest.mark.usefixtures', (['"""setup_cities"""'], {}), "('setup_cities')\n", (3437, 3453), False, 'import pytest\... |
#*
# MIT License
#
# Copyright (C) 2021 <FacuFalcone - CaidevOficial>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, ... | [
"pandas.read_excel"
] | [((1730, 1771), 'pandas.read_excel', 'pd.read_excel', (['"""Clase_01/Docs/Datos.xlsx"""'], {}), "('Clase_01/Docs/Datos.xlsx')\n", (1743, 1771), True, 'import pandas as pd\n')] |
#!/usr/bin/env python
# -*-coding:UTF-8
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
author = "夜微凉"
"""
1.用户名和密码根据自己情况去输入
2.可以发送附件,抄送邮件
"""
usr = "*********"
password = "*********"
to = "*********"
# _cc = "*********"
msg = MIMEMultipart()
msg["Subject... | [
"email.mime.multipart.MIMEMultipart",
"email.mime.text.MIMEText",
"smtplib.SMTP"
] | [((292, 307), 'email.mime.multipart.MIMEMultipart', 'MIMEMultipart', ([], {}), '()\n', (305, 307), False, 'from email.mime.multipart import MIMEMultipart\n'), ((476, 517), 'email.mime.text.MIMEText', 'MIMEText', (['"""<h1>hello python</h1>"""', '"""html"""'], {}), "('<h1>hello python</h1>', 'html')\n", (484, 517), Fals... |
from django.urls import path
from frontend import views
app_name = 'frontend'
urlpatterns = [
path('', views.IndexView.as_view(), name='index'),
path('about', views.AboutView.as_view(), name='about'),
path('testimonials', views.TestimonialsView.as_view(), name='testimonials'),
path('services', views.... | [
"frontend.views.IndexView.as_view",
"frontend.views.ServicesView.as_view",
"frontend.views.TermsView.as_view",
"frontend.views.AboutView.as_view",
"frontend.views.PrivacyPolicyView.as_view",
"frontend.views.ScheduleView.as_view",
"frontend.views.ReturnPolicyView.as_view",
"frontend.views.DisclaimerVie... | [((110, 135), 'frontend.views.IndexView.as_view', 'views.IndexView.as_view', ([], {}), '()\n', (133, 135), False, 'from frontend import views\n'), ((170, 195), 'frontend.views.AboutView.as_view', 'views.AboutView.as_view', ([], {}), '()\n', (193, 195), False, 'from frontend import views\n'), ((237, 269), 'frontend.view... |
# -*- coding: utf-8 -*-
#!/usr/bin/env python3
import sys
import re
from util import *
from keylogger import Keylogger
from spycam import takeAPicture
#----------- actif form val
keyloggerL = [None, None]
#----------- actif form val
spycamL = [False, None]
print("\n"+(" "*6)+Colors.GREEN+"╋╋╋╋┏┓┏┓╋╋╋╋╋╋╋╋┏━┓... | [
"keylogger.Keylogger",
"re.search",
"sys.argv.index"
] | [((854, 881), 'sys.argv.index', 'sys.argv.index', (['"""keylogger"""'], {}), "('keylogger')\n", (868, 881), False, 'import sys\n'), ((1729, 1753), 'sys.argv.index', 'sys.argv.index', (['"""spycam"""'], {}), "('spycam')\n", (1743, 1753), False, 'import sys\n'), ((1142, 1241), 're.search', 're.search', (['"""[1234567890]... |
#!/usr/bin/python
""" test_create_map
Author: datadonk23
Date: 30.04.19
"""
import unittest
from hypothesis import given
import hypothesis.strategies as st
from create_map import map_center, loc, get_info
class TestLocation(unittest.TestCase):
def test_map_center_size(self):
center = map_center
... | [
"unittest.main",
"hypothesis.strategies.text",
"create_map.get_info"
] | [((3468, 3483), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3481, 3483), False, 'import unittest\n'), ((1107, 1168), 'create_map.get_info', 'get_info', (['"""title"""', '"""descr"""', '"""url.jpg"""', '"""https://example.com/"""'], {}), "('title', 'descr', 'url.jpg', 'https://example.com/')\n", (1115, 1168), F... |
from django.shortcuts import render
from .models import Category
from .models import BlogPost
from SeanCodeMedia.settings import MEDIA_ROOT, MEDIA_URL
# Create your views here.
def show_tutorials(request):
context={
"Category": Category.objects.all(),
'media_root': MEDIA_ROOT.replace("/media",""),
'media_url'... | [
"django.shortcuts.render",
"SeanCodeMedia.settings.MEDIA_ROOT.replace"
] | [((344, 391), 'django.shortcuts.render', 'render', (['request', '"""blog/tutorials.html"""', 'context'], {}), "(request, 'blog/tutorials.html', context)\n", (350, 391), False, 'from django.shortcuts import render\n'), ((627, 673), 'django.shortcuts.render', 'render', (['request', '"""blog/articles.html"""', 'context'],... |
import socket
from time import sleep, strftime, time
from typing import Any, List, Optional
from numpy import random
def log(*args: Any) -> None:
print(strftime('%Y-%m-%d %H:%M:%S - hlp - INFO -'), *args)
def get_random_bytes(size: int, seed: int) -> bytes:
random.seed(seed)
result = random.bytes(s... | [
"numpy.random.seed",
"socket.socket",
"time.strftime",
"time.time",
"time.sleep",
"numpy.random.bytes",
"numpy.random.choice"
] | [((275, 292), 'numpy.random.seed', 'random.seed', (['seed'], {}), '(seed)\n', (286, 292), False, 'from numpy import random\n'), ((306, 324), 'numpy.random.bytes', 'random.bytes', (['size'], {}), '(size)\n', (318, 324), False, 'from numpy import random\n'), ((436, 453), 'numpy.random.seed', 'random.seed', (['seed'], {})... |
import functools
import gzip
from io import BytesIO as IO
from flask import after_this_request, request
from .exceptions import handler, create_logger
from .messages import internal_error
def exception(original_function=None, message='Some error occurred on our end.'):
def decorator(function):
@functool... | [
"io.BytesIO",
"gzip.GzipFile",
"functools.wraps",
"flask.request.headers.get"
] | [((751, 769), 'functools.wraps', 'functools.wraps', (['f'], {}), '(f)\n', (766, 769), False, 'import functools\n'), ((312, 337), 'functools.wraps', 'functools.wraps', (['function'], {}), '(function)\n', (327, 337), False, 'import functools\n'), ((894, 936), 'flask.request.headers.get', 'request.headers.get', (['"""Acce... |
import more_itertools as mit
import csv
import random
def get_range(lst):
return [list(group) for group in mit.consecutive_groups(lst)]
def get_reading_count(item, lst):
count = 0
for i in range(item[0],item[-1]+1):
count = count + lst.count(i)
return count
def calc_ranges(lst):
range_d... | [
"more_itertools.consecutive_groups",
"csv.DictWriter"
] | [((725, 771), 'csv.DictWriter', 'csv.DictWriter', (['csvfile'], {'fieldnames': 'fieldnames'}), '(csvfile, fieldnames=fieldnames)\n', (739, 771), False, 'import csv\n'), ((113, 140), 'more_itertools.consecutive_groups', 'mit.consecutive_groups', (['lst'], {}), '(lst)\n', (135, 140), True, 'import more_itertools as mit\n... |
# -*- coding: utf-8 -*-
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
### Alias : PosServer.dataclass.orders & Last Modded : 2021.11.07. ###
Coded with Python 3.10 Grammar by IRACK000
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
import datetime
import sql... | [
"datetime.datetime.now",
"src.main.cli.apis.log"
] | [((1369, 1423), 'src.main.cli.apis.log', 'log', (['f"""[ORDRLST] NEW ORDER from TABLE {self.user_id}."""'], {}), "(f'[ORDRLST] NEW ORDER from TABLE {self.user_id}.')\n", (1372, 1423), False, 'from src.main.cli.apis import log\n'), ((1554, 1600), 'src.main.cli.apis.log', 'log', (['f"""[ORDRLST] Temporary order id = {_oi... |
import PySimpleGUI as sg
from .base import GeneratorBase
class Canvas(GeneratorBase):
CANVAS = 'canvas'
BACKGROUND_COLOR = 'background_color'
SIZE = 'size'
PAD = 'pad'
KEY = 'key'
TOOLTIP = 'tooltip'
RIGHT_CLICK_MENU = 'right_click_menu'
EXPAND_X = 'expand_x'
EXPAND_Y = 'expand_y'
... | [
"PySimpleGUI.Canvas"
] | [((1317, 1343), 'PySimpleGUI.Canvas', 'sg.Canvas', ([], {}), '(**active_params)\n', (1326, 1343), True, 'import PySimpleGUI as sg\n')] |
import torch
import math
from ....ops.center_ops import center_ops_cuda
class CenterAssigner(object):
def __init__(self, assigner_cfg, num_classes, no_log, grid_size, pc_range, voxel_size):
"""Return CenterNet training labels like heatmap, height, offset"""
self.out_size_factor = assigner_cfg.out_s... | [
"torch.stack",
"math.sqrt",
"math.floor",
"torch.cat",
"math.sin",
"torch.meshgrid",
"torch.exp",
"torch.arange",
"math.cos",
"torch.zeros",
"math.log",
"torch.log",
"torch.tensor"
] | [((992, 1024), 'math.sqrt', 'math.sqrt', (['(b1 ** 2 - 4 * a1 * c1)'], {}), '(b1 ** 2 - 4 * a1 * c1)\n', (1001, 1024), False, 'import math\n'), ((1165, 1197), 'math.sqrt', 'math.sqrt', (['(b2 ** 2 - 4 * a2 * c2)'], {}), '(b2 ** 2 - 4 * a2 * c2)\n', (1174, 1197), False, 'import math\n'), ((1367, 1399), 'math.sqrt', 'mat... |
"""
2021 <NAME>, ETHZ, MPI IS
Application to train generative model.
"""
import numpy as np
import healthgen.apps.global_parameters
from healthgen.apps.base_app import BaseApplication
from healthgen.generation import VAEGenModel, MultiVAEGenModel, SRNNGenModel, KVAEGenModel, KVAEMissGenModel, HealthGenModel
import tor... | [
"healthgen.generation.VAEGenModel",
"healthgen.generation.HealthGenModel",
"healthgen.generation.KVAEMissGenModel",
"healthgen.generation.MultiVAEGenModel",
"absl.app.run",
"wandb.init",
"torch.cuda.is_available",
"healthgen.generation.SRNNGenModel",
"healthgen.generation.KVAEGenModel",
"numpy.con... | [((5588, 5613), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (5611, 5613), False, 'import torch\n'), ((5619, 5808), 'wandb.init', 'wandb.init', ([], {'project': '"""wand_project"""', 'entity': '"""wandb_user"""', 'group': 'FLAGS.gen_model', 'job_type': "('cluster' if use_cuda else 'local')", ... |
from typing import Any, Callable, Tuple, Union
import torch
from pydantic import BaseModel
from config.data import SomethingSomethingV2DatasetConfig, SomethingSomethingV2FeaturesDatasetConfig
from config.model import FeatureMultiscaleNetworkConfig, FeatureTRNConfig, \
FeatureTSNConfig, TRNConfig, TSNConfig
from c... | [
"transforms.builder.get_transforms"
] | [((875, 935), 'transforms.builder.get_transforms', 'get_transforms', (['self.transform', 'self.model.backbone_settings'], {}), '(self.transform, self.model.backbone_settings)\n', (889, 935), False, 'from transforms.builder import get_transforms\n')] |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.http import HttpResponse
from django.shortcuts import render_to_response
from mysite.books.models import Book, Author, Publisher
from django.core.mail import send_mail
# Create your views here.
def search_form(request):
return render_to_res... | [
"django.shortcuts.render_to_response",
"mysite.books.models.Author.objects.all",
"mysite.books.models.Author.objects.get",
"mysite.books.models.Book.objects.all",
"mysite.books.models.Book.objects.get",
"mysite.books.models.Publisher.objects.get",
"mysite.books.models.Book.objects.filter"
] | [((307, 345), 'django.shortcuts.render_to_response', 'render_to_response', (['"""search_form.html"""'], {}), "('search_form.html')\n", (325, 345), False, 'from django.shortcuts import render_to_response\n'), ((1185, 1241), 'django.shortcuts.render_to_response', 'render_to_response', (['"""search_form.html"""', "{'error... |
from contextlib import contextmanager
from elegy import utils, types
import functools
import threading
import typing as tp
from dataclasses import dataclass
import jax
import jax.numpy as jnp
import numpy as np
from elegy import types
__all__ = [
"add_loss",
"add_metric",
"add_summary",
"get_losses",... | [
"elegy.types.Summary",
"jax.jit",
"functools.wraps"
] | [((7331, 7394), 'jax.jit', 'jax.jit', (['_transform_fn'], {'static_argnums': 'static_argnums'}), '(_transform_fn, static_argnums=static_argnums, **kwargs)\n', (7338, 7394), False, 'import jax\n'), ((7432, 7450), 'functools.wraps', 'functools.wraps', (['f'], {}), '(f)\n', (7447, 7450), False, 'import functools\n'), ((32... |
#
# Copyright (c) 2013 FadingRed LLC
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, dis... | [
"os.mkdir",
"os.path.exists",
"re.match",
"re.search",
"os.path.join",
"re.sub"
] | [((1537, 1584), 'os.path.join', 'os.path.join', (['resources', "('%s.lproj' % self.lang)"], {}), "(resources, '%s.lproj' % self.lang)\n", (1549, 1584), False, 'import os\n'), ((1596, 1640), 'os.path.join', 'os.path.join', (['lang', "('%s.strings' % self.name)"], {}), "(lang, '%s.strings' % self.name)\n", (1608, 1640), ... |
# -*- coding: UTF-8 -*-
import tensorflow as tf
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from bokeh.plotting import output_file, figure, show
class NeuralNetwork:
def __init__(self, input_shape, stock_or_return):
self.input_shape = input_shape
self.stock_or_return = ... | [
"pandas.DataFrame",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"pandas.read_csv",
"numpy.std",
"tensorflow.keras.layers.InputLayer",
"numpy.mean",
"numpy.array",
"tensorflow.keras.models.Sequential",
"numpy.reshape",
"tensorflow.keras.regularizers.l2"
] | [((501, 529), 'tensorflow.keras.models.Sequential', 'tf.keras.models.Sequential', ([], {}), '()\n', (527, 529), True, 'import tensorflow as tf\n'), ((562, 618), 'tensorflow.keras.layers.InputLayer', 'tf.keras.layers.InputLayer', ([], {'input_shape': '(1, input_shape)'}), '(input_shape=(1, input_shape))\n', (588, 618), ... |
import numpy as np
import matplotlib.pyplot as plt
from math import cos, sin, pi
def get_float(msg="Number: ", wrng_msg="Invalid Input"):
try:
f = float(input(msg))
except ValueError:
print(wrng_msg)
return get_float(msg, wrng_msg)
else:
return f
# t = 2usin(... | [
"matplotlib.pyplot.subplots",
"math.cos",
"math.sin",
"matplotlib.pyplot.show"
] | [((1322, 1337), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(2)'], {}), '(2)\n', (1334, 1337), True, 'import matplotlib.pyplot as plt\n'), ((1748, 1758), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (1756, 1758), True, 'import matplotlib.pyplot as plt\n'), ((565, 575), 'math.cos', 'cos', (['theta'], {})... |
import argparse
import os
# import shutil
# from tqdm import tqdm
import logging
from src.utils.common import read_yaml, create_directories, unzip_file
from src.utils.data_processing import validate_imgdata
# import random
from urllib import request as req
STAGE = "GET_DATA" ## <<< change stage name
LOG_DIR = "log... | [
"logging.exception",
"argparse.ArgumentParser",
"src.utils.common.read_yaml",
"os.path.exists",
"logging.info",
"os.path.isfile",
"urllib.request.urlretrieve",
"src.utils.data_processing.validate_imgdata",
"os.path.join",
"src.utils.common.create_directories",
"src.utils.common.unzip_file"
] | [((651, 673), 'src.utils.common.read_yaml', 'read_yaml', (['config_path'], {}), '(config_path)\n', (660, 673), False, 'from src.utils.common import read_yaml, create_directories, unzip_file\n'), ((774, 805), 'src.utils.common.create_directories', 'create_directories', (['[local_dir]'], {}), '([local_dir])\n', (792, 805... |
from gym_scarecrow.envs.utils import *
from gym_scarecrow.params import *
from gym_scarecrow.envs.keepout import Keepout
from gym_scarecrow.envs.defender import *
from gym_scarecrow.envs.subject import Subject
if HARDWARE:
from src.system.controller.python.controller_interface import ControllerInterface
import py... | [
"pygame.quit",
"src.system.controller.python.controller_interface.ControllerInterface",
"pygame.draw.line",
"pygame.font.SysFont",
"pygame.event.get",
"pygame.display.set_mode",
"pygame.init",
"pygame.display.flip",
"gym_scarecrow.envs.keepout.Keepout",
"gym_scarecrow.envs.subject.Subject",
"pyg... | [((395, 408), 'pygame.init', 'pygame.init', ([], {}), '()\n', (406, 408), False, 'import pygame\n'), ((417, 452), 'pygame.display.set_caption', 'pygame.display.set_caption', (['CAPTION'], {}), '(CAPTION)\n', (443, 452), False, 'import pygame\n'), ((534, 553), 'pygame.time.Clock', 'pygame.time.Clock', ([], {}), '()\n', ... |
from __future__ import division, absolute_import
from sklearn import datasets
import pytest
from algorithms import WeightedGaussianMixture, WeightedBayesianGaussianMixture
class TestMixtures(object):
def test_mixtures(self):
iris = datasets.load_iris()
wgm = WeightedGaussianMixture()
w... | [
"sklearn.datasets.load_iris",
"algorithms.WeightedBayesianGaussianMixture",
"algorithms.WeightedGaussianMixture"
] | [((249, 269), 'sklearn.datasets.load_iris', 'datasets.load_iris', ([], {}), '()\n', (267, 269), False, 'from sklearn import datasets\n'), ((285, 310), 'algorithms.WeightedGaussianMixture', 'WeightedGaussianMixture', ([], {}), '()\n', (308, 310), False, 'from algorithms import WeightedGaussianMixture, WeightedBayesianGa... |
from django.views.generic import DetailView
from django.views.generic.edit import UpdateView
from django.shortcuts import get_object_or_404, redirect
from django.http import Http404
from ..models import FoiProject
from ..auth import can_read_foiproject, can_manage_foiproject
from ..forms import ProjectTeamForm
def p... | [
"django.shortcuts.redirect",
"django.shortcuts.get_object_or_404"
] | [((368, 404), 'django.shortcuts.get_object_or_404', 'get_object_or_404', (['FoiProject'], {'pk': 'pk'}), '(FoiProject, pk=pk)\n', (385, 404), False, 'from django.shortcuts import get_object_or_404, redirect\n'), ((491, 511), 'django.shortcuts.redirect', 'redirect', (['foiproject'], {}), '(foiproject)\n', (499, 511), Fa... |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import matplotlib.pyplot as plt
def teardown(*args, **kwargs):
plt.close('all')
def time_subplots(n):
fig, ax = plt.subplots(n, n)
fig.canvas.draw()
time_subplots.params = (1, 2, 10)
time_subplo... | [
"matplotlib.pyplot.close",
"matplotlib.pyplot.subplots"
] | [((179, 195), 'matplotlib.pyplot.close', 'plt.close', (['"""all"""'], {}), "('all')\n", (188, 195), True, 'import matplotlib.pyplot as plt\n'), ((234, 252), 'matplotlib.pyplot.subplots', 'plt.subplots', (['n', 'n'], {}), '(n, n)\n', (246, 252), True, 'import matplotlib.pyplot as plt\n'), ((651, 665), 'matplotlib.pyplot... |
import networkx as nx
import numpy as np
def _graph2dag(graph):
"""Converts nx.Graph to an directed, acyclic form. Returns the adjancency matrix"""
adj = nx.adj_matrix(graph).todense()
adj = adj + adj.T
adj = (adj != 0).astype(int)
adj = np.tril(adj)
assert nx.is_directed_acyclic_graph(nx.fro... | [
"networkx.from_numpy_matrix",
"numpy.eye",
"networkx.erdos_renyi_graph",
"numpy.tril",
"networkx.adj_matrix",
"numpy.ones",
"warnings.warn",
"numpy.sqrt"
] | [((260, 272), 'numpy.tril', 'np.tril', (['adj'], {}), '(adj)\n', (267, 272), True, 'import numpy as np\n'), ((767, 815), 'networkx.erdos_renyi_graph', 'nx.erdos_renyi_graph', (['n', 'p', 'seed'], {'directed': '(False)'}), '(n, p, seed, directed=False)\n', (787, 815), True, 'import networkx as nx\n'), ((2573, 2583), 'nu... |
'''
sample test of pycoq.serlib
'''
import logging
import os
import json
import pkg_resources
import numpy
import pytest
import pycoq.log
import serlib.parser
def with_prefix(s: str) -> str:
''' adds package path as prefix '''
return os.path.join(pkg_resources.resource_filename('pycoq', 'tests'), s)
d... | [
"logging.info",
"pytest.raises",
"numpy.array",
"pkg_resources.resource_filename"
] | [((1118, 1195), 'numpy.array', 'numpy.array', (['[1, 2, 3, -3, 4, 1, 2, 3, -3, 5, 6, -2, 7, -5]'], {'dtype': 'numpy.intc'}), '([1, 2, 3, -3, 4, 1, 2, 3, -3, 5, 6, -2, 7, -5], dtype=numpy.intc)\n', (1129, 1195), False, 'import numpy\n'), ((1451, 1528), 'numpy.array', 'numpy.array', (['[1, 2, 3, -3, 4, 1, 2, 3, -3, 5, 6,... |
import logging
import numpy as np
import umap
import matplotlib.pyplot as plt
from pathlib import Path
from typing import Optional
class UMAPVisualizer:
def __init__(self, output_path, **kwargs):
kwargs.pop("label_index", None)
self.output_path = output_path
self.reducer = umap.UMAP(**kwargs)
def visualize... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.colorbar",
"umap.UMAP",
"pathlib.Path",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.savefig"
] | [((284, 303), 'umap.UMAP', 'umap.UMAP', ([], {}), '(**kwargs)\n', (293, 303), False, 'import umap\n'), ((508, 570), 'matplotlib.pyplot.scatter', 'plt.scatter', (['embeddings[:, 0]', 'embeddings[:, 1]'], {'s': '(1)', 'c': 'labels'}), '(embeddings[:, 0], embeddings[:, 1], s=1, c=labels)\n', (519, 570), True, 'import matp... |
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
from importlib import metadata
from importlib.metadata import EntryPoint
from typing import Dict
# pyre-ignore-... | [
"importlib.metadata.entry_points"
] | [((748, 771), 'importlib.metadata.entry_points', 'metadata.entry_points', ([], {}), '()\n', (769, 771), False, 'from importlib import metadata\n')] |
from OpenGL.GL import *
import data.tools.maths as m
class EntityRenderer:
def __init__(self, shader, display, projection_matrix):
self.shader = shader
self.shader.start()
self.shader.load_projection_matrix(projection_matrix)
self.shader.stop()
def render(self, enti... | [
"data.tools.maths.Maths"
] | [((2203, 2212), 'data.tools.maths.Maths', 'm.Maths', ([], {}), '()\n', (2210, 2212), True, 'import data.tools.maths as m\n')] |
from __future__ import print_function
import torch
import cv2
import time
import numpy as np
import os
from imutils.video import FPS, WebcamVideoStream
from data import BaseTransform
from ssd import build_ssd
COLORS = [(255, 0, 0), (0, 255, 0), (0, 0, 255)]
FONT = cv2.FONT_HERSHEY_SIMPLEX
THRESHOLD = 0.2
def slidi... | [
"data.BaseTransform",
"cv2.waitKey",
"torch.load",
"numpy.zeros",
"ssd.build_ssd",
"cv2.imread",
"torch.Tensor",
"cv2.imshow",
"cv2.resize"
] | [((1564, 1590), 'ssd.build_ssd', 'build_ssd', (['"""test"""', '(300)', '(21)'], {}), "('test', 300, 21)\n", (1573, 1590), False, 'from ssd import build_ssd\n'), ((1699, 1763), 'data.BaseTransform', 'BaseTransform', (['net.size', '(104 / 256.0, 117 / 256.0, 123 / 256.0)'], {}), '(net.size, (104 / 256.0, 117 / 256.0, 123... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2017-12-25 21:12
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ircview', '0001_initial'),
]
operations = [
migrations.AddField(
... | [
"django.db.models.CharField"
] | [((390, 513), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'choices': "[('Y', 'Yes'), ('N', 'No')]", 'db_index': '(True)', 'default': '"""N"""', 'max_length': '(1)', 'null': '(True)'}), "(blank=True, choices=[('Y', 'Yes'), ('N', 'No')], db_index=\n True, default='N', max_length=1, null=... |
import sys
from tkinter import Tk
from PyQt5.QtWidgets import QScrollArea, QGridLayout, QMainWindow, QPushButton, QLabel, QApplication, QWidget, \
QInputDialog, QLineEdit, QFileDialog, QFrame, QComboBox
from PyQt5.QtCore import QRect, Qt
from PyQt5.QtGui import QIcon, QPixmap
from timeit import default_timer as ti... | [
"PyQt5.QtWidgets.QComboBox",
"PyQt5.QtWidgets.QLabel",
"timeit.default_timer",
"PyQt5.QtWidgets.QPushButton",
"PyQt5.QtWidgets.QLineEdit",
"PyQt5.QtWidgets.QFileDialog.Options",
"PyQt5.QtWidgets.QFileDialog.getOpenFileNames",
"PyQt5.QtWidgets.QApplication.processEvents",
"PyQt5.QtGui.QPixmap",
"Py... | [((7504, 7526), 'PyQt5.QtWidgets.QApplication', 'QApplication', (['sys.argv'], {}), '(sys.argv)\n', (7516, 7526), False, 'from PyQt5.QtWidgets import QScrollArea, QGridLayout, QMainWindow, QPushButton, QLabel, QApplication, QWidget, QInputDialog, QLineEdit, QFileDialog, QFrame, QComboBox\n'), ((1347, 1359), 'PyQt5.QtWi... |
import sys, os
def trySetupCoverage(): # pragma: no cover - can hardly measure coverage here :)
try:
import coverage
coverage.process_startup() # doesn't do anything unless COVERAGE_PROCESS_START is set
except Exception:
pass
def loadTestCustomize():
try:
# Generic file ... | [
"imp.find_module",
"os.path.dirname",
"coverage.process_startup",
"capturemock.process_startup",
"sys.path.index",
"imp.load_module"
] | [((889, 914), 'os.path.dirname', 'os.path.dirname', (['fileName'], {}), '(fileName)\n', (904, 914), False, 'import sys, os\n'), ((925, 946), 'sys.path.index', 'sys.path.index', (['myDir'], {}), '(myDir)\n', (939, 946), False, 'import sys, os\n'), ((139, 165), 'coverage.process_startup', 'coverage.process_startup', ([],... |
import click
import pickle
from os.path import basename, join as pjoin
from expcomb.cmd import mk_expcomb
from expcomb.table.utils import pick_str
from expcomb.utils import TinyDBParam, mk_iden
from expcomb.sigtest.bootstrap import Bootstrapper, mk_resample, simple_compare_resampled, bootstrap, read_schedule
from sense... | [
"pickle.dump",
"senseclust.methods.base.ExpPathInfo",
"click.option",
"click.Path",
"os.path.join",
"senseclust.groupings.gen_groupings",
"senseclust.eval.eval_resampled",
"expcomb.sigtest.bootstrap.simple_compare_resampled",
"expcomb.cmd.mk_expcomb",
"expcomb.sigtest.bootstrap.read_schedule",
"... | [((2474, 2515), 'click.argument', 'click.argument', (['"""measure"""'], {'required': '(False)'}), "('measure', required=False)\n", (2488, 2515), False, 'import click\n'), ((2517, 2549), 'click.option', 'click.option', (['"""--multi/--single"""'], {}), "('--multi/--single')\n", (2529, 2549), False, 'import click\n'), ((... |
from PyCRC.CRCCCITT import CRCCCITT
import binascii
def calculate_crc(bytes):
crc = CRCCCITT(version='FFFF').calculate(binascii.hexlify(bytearray(bytes)).decode('hex'))
return [(crc >> 8) & 0xff, crc & 0xff]
| [
"PyCRC.CRCCCITT.CRCCCITT"
] | [((90, 114), 'PyCRC.CRCCCITT.CRCCCITT', 'CRCCCITT', ([], {'version': '"""FFFF"""'}), "(version='FFFF')\n", (98, 114), False, 'from PyCRC.CRCCCITT import CRCCCITT\n')] |
from mpi4py import MPI
import mpi
import math as m
comm = MPI.COMM_WORLD
ncpu = comm.size
rank = comm.Get_rank()
def action(x):
sqr = lambda y : m.sin(m.cos(m.sin(m.cos(y*y))))*m.sin(m.cos(m.sin(m.cos(y*y))))
return sqr(x)
if rank == 0:
task = [[i+j*10+1 for i in range(1000)] for j in range(100)]
num = 2
els... | [
"mpi.control",
"math.cos"
] | [((390, 415), 'mpi.control', 'mpi.control', (['action', 'task'], {}), '(action, task)\n', (401, 415), False, 'import mpi\n'), ((168, 180), 'math.cos', 'm.cos', (['(y * y)'], {}), '(y * y)\n', (173, 180), True, 'import math as m\n'), ((200, 212), 'math.cos', 'm.cos', (['(y * y)'], {}), '(y * y)\n', (205, 212), True, 'im... |
import os
import click
from pypgatk.commands.utils import print_help
from pypgatk.ensembl.ensembl import EnsemblDataService
this_dir, this_filename = os.path.split(__file__)
@click.command("dnaseq-to-proteindb", short_help="Generate peptides based on DNA sequences")
@click.option('-c', '--config_file', help='Confi... | [
"click.option",
"pypgatk.commands.utils.print_help",
"click.command",
"pypgatk.ensembl.ensembl.EnsemblDataService",
"os.path.split"
] | [((153, 176), 'os.path.split', 'os.path.split', (['__file__'], {}), '(__file__)\n', (166, 176), False, 'import os\n'), ((180, 276), 'click.command', 'click.command', (['"""dnaseq-to-proteindb"""'], {'short_help': '"""Generate peptides based on DNA sequences"""'}), "('dnaseq-to-proteindb', short_help=\n 'Generate pep... |
from selenium import webdriver
import time
driver = webdriver.Chrome(executable_path="/home/alex/Downloads/SoftWare/chromedriver/chromedriver")
# driver = webdriver.Chrome()
driver.get('https://python.org')
| [
"selenium.webdriver.Chrome"
] | [((53, 149), 'selenium.webdriver.Chrome', 'webdriver.Chrome', ([], {'executable_path': '"""/home/alex/Downloads/SoftWare/chromedriver/chromedriver"""'}), "(executable_path=\n '/home/alex/Downloads/SoftWare/chromedriver/chromedriver')\n", (69, 149), False, 'from selenium import webdriver\n')] |
""" Logging module for the package
The logging will be handled with the abseil library.
An addition is being made in order to allow different levels of verbosity.
"""
from __future__ import absolute_import
from absl import flags
from absl.logging import (DEBUG, ERROR, FATAL, INFO, WARN, WARNING, debug,
... | [
"absl.logging.skip_log_prefix",
"absl.logging.set_verbosity",
"absl.logging.info",
"absl.flags.FLAGS.mark_as_parsed"
] | [((475, 503), 'absl.flags.FLAGS.mark_as_parsed', 'flags.FLAGS.mark_as_parsed', ([], {}), '()\n', (501, 503), False, 'from absl import flags\n'), ((829, 853), 'absl.logging.skip_log_prefix', 'skip_log_prefix', (['verbose'], {}), '(verbose)\n', (844, 853), False, 'from absl.logging import DEBUG, ERROR, FATAL, INFO, WARN,... |
"""Utilites: Functions to help load environment variables."""
from ast import literal_eval
from os.path import exists
def dotenv(path):
if not exists(path):
return
for line in open(path):
line = line.strip()
# Ignore comments and lines w/ out equal sign.
if line.startswith('#') ... | [
"ast.literal_eval",
"os.path.exists"
] | [((148, 160), 'os.path.exists', 'exists', (['path'], {}), '(path)\n', (154, 160), False, 'from os.path import exists\n'), ((743, 762), 'ast.literal_eval', 'literal_eval', (['value'], {}), '(value)\n', (755, 762), False, 'from ast import literal_eval\n')] |
from flask import Flask
from flask_pymongo import PyMongo
from flask_cors import CORS
from flask_sslify import SSLify
from config import STRICT_HTTPS
app = Flask(__name__)
app.config.from_object('config')
CORS(app)
mongo = PyMongo(app)
if STRICT_HTTPS:
sslify = SSLify(app, subdomains=True, permanent=True)
from ... | [
"flask_cors.CORS",
"flask_pymongo.PyMongo",
"flask.Flask",
"flask_sslify.SSLify"
] | [((158, 173), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (163, 173), False, 'from flask import Flask\n'), ((208, 217), 'flask_cors.CORS', 'CORS', (['app'], {}), '(app)\n', (212, 217), False, 'from flask_cors import CORS\n'), ((226, 238), 'flask_pymongo.PyMongo', 'PyMongo', (['app'], {}), '(app)\n', (23... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'ruian'
import os
import sys
import time
from subprocess import call
from os.path import exists, join
from ctypes import *
package_directory = os.path.dirname(os.path.abspath(__file__))
libPath = join(package_directory, 'liblevenshtein.so')
if not exists(li... | [
"os.path.abspath",
"os.path.exists",
"time.time",
"subprocess.call",
"os.path.join"
] | [((259, 303), 'os.path.join', 'join', (['package_directory', '"""liblevenshtein.so"""'], {}), "(package_directory, 'liblevenshtein.so')\n", (263, 303), False, 'from os.path import exists, join\n'), ((222, 247), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (237, 247), False, 'import os\n'), ... |
import scrapy
from common.util import xpath_class
from event.items import ResponseItem
class UKBiotechDatabaseEventSpider(scrapy.Spider):
name = 'uk_biotech_database_event'
base_url = 'http://www.ukbiotech.com'
events_path = '/uk/portal/events.php'
source = 'UK Biotech Database'
custom_settings... | [
"common.util.xpath_class",
"event.items.ResponseItem",
"scrapy.Request"
] | [((961, 1013), 'scrapy.Request', 'scrapy.Request', (['f"""{self.base_url}{self.events_path}"""'], {}), "(f'{self.base_url}{self.events_path}')\n", (975, 1013), False, 'import scrapy\n'), ((1218, 1270), 'event.items.ResponseItem', 'ResponseItem', (["{'body': entry, 'meta': response.meta}"], {}), "({'body': entry, 'meta'... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from os import getenv
bot_token = getenv('secret_telegram_token')
bot_master = [1234567]
tz_name = 'Europe/Moscow'
ex_host = 'ex.any.ru'
ex_user = getenv('secret_exchange_user')
ex_pass = getenv('secret_exchange_pass')
ex_cal = '<EMAIL>'
ex_tz = 'Europe/Moscow'
db_hos... | [
"os.getenv"
] | [((83, 114), 'os.getenv', 'getenv', (['"""secret_telegram_token"""'], {}), "('secret_telegram_token')\n", (89, 114), False, 'from os import getenv\n'), ((198, 228), 'os.getenv', 'getenv', (['"""secret_exchange_user"""'], {}), "('secret_exchange_user')\n", (204, 228), False, 'from os import getenv\n'), ((239, 269), 'os.... |
"""
<NAME>, 2020
"""
import numpy as np
def ara_backward_induction(energy_cost_current = 1,energy_cost_future = 1,energy_bonus = 0):
"""
This function implements the backward induction algorithm.
The inputs energy_cost_future and energy_cost_current specify the energy
costs of the current and future ... | [
"numpy.absolute",
"numpy.maximum",
"numpy.sum",
"numpy.zeros",
"numpy.array",
"numpy.arange"
] | [((3498, 3540), 'numpy.array', 'np.array', (['[[1, 1], [2, 1], [1, 2], [2, 2]]'], {}), '([[1, 1], [2, 1], [1, 2], [2, 2]])\n', (3506, 3540), True, 'import numpy as np\n'), ((3592, 3614), 'numpy.zeros', 'np.zeros', (['(7, 4, 9, 4)'], {}), '((7, 4, 9, 4))\n', (3600, 3614), True, 'import numpy as np\n'), ((3640, 3665), 'n... |