code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import json
import http.client
conn = http.client.HTTPSConnection("public.radio.co")
station = 'stations/sd71de59b3/status'
payload = "{}"
conn.request("GET", station, payload)
res = conn.getresponse()
data = res.read()
json_string = data.decode("utf-8")
now_playing = json.loads(json_string)
print("JEMP is currently... | [
"json.loads"
] | [((271, 294), 'json.loads', 'json.loads', (['json_string'], {}), '(json_string)\n', (281, 294), False, 'import json\n')] |
from setuptools import setup
setup(
name='voronoiz',
version='0.1.0',
author='<NAME>',
description="Functions for generating Voronoi diagrams with "
"alternate metrics.",
license="MIT",
url="https://github.com/WarrenWeckesser/voronoiz",
classifiers=[
"License :: OSI... | [
"setuptools.setup"
] | [((31, 602), 'setuptools.setup', 'setup', ([], {'name': '"""voronoiz"""', 'version': '"""0.1.0"""', 'author': '"""<NAME>"""', 'description': '"""Functions for generating Voronoi diagrams with alternate metrics."""', 'license': '"""MIT"""', 'url': '"""https://github.com/WarrenWeckesser/voronoiz"""', 'classifiers': "['Li... |
# ORIE 7590
import numpy as np
from bd_sim_cython import discrete_bessel_sim, discrete_laguerre_sim, cmeixner
from scipy.special import jv, laguerre, poch, eval_laguerre, j0
from scipy.integrate import quad
from math import comb, factorial, exp, sqrt, log
import hankel
def bd_simulator(t, x0, num_paths, method='besse... | [
"math.exp",
"hankel.HankelTransform",
"numpy.maximum",
"scipy.special.eval_laguerre",
"numpy.polyval",
"numpy.random.exponential",
"numpy.zeros",
"numpy.ones",
"numpy.random.gamma",
"scipy.special.poch",
"numpy.mean",
"numpy.array",
"numpy.random.poisson",
"scipy.special.j0",
"numpy.eye"... | [((887, 928), 'numpy.zeros', 'np.zeros', ([], {'dtype': 'np.int64', 'shape': 'num_paths'}), '(dtype=np.int64, shape=num_paths)\n', (895, 928), True, 'import numpy as np\n'), ((6930, 6941), 'numpy.zeros', 'np.zeros', (['N'], {}), '(N)\n', (6938, 6941), True, 'import numpy as np\n'), ((7984, 8027), 'hankel.HankelTransfor... |
from django.shortcuts import render, get_object_or_404
from .models import Contato
from django.http import Http404
def index(request):
contatos = Contato.objects.all()
return render(request, 'contatos/index.html', {
'contatos': contatos
})
def ver_contato(request, contato_id):
#contato = Co... | [
"django.shortcuts.render",
"django.shortcuts.get_object_or_404"
] | [((185, 247), 'django.shortcuts.render', 'render', (['request', '"""contatos/index.html"""', "{'contatos': contatos}"], {}), "(request, 'contatos/index.html', {'contatos': contatos})\n", (191, 247), False, 'from django.shortcuts import render, get_object_or_404\n'), ((367, 408), 'django.shortcuts.get_object_or_404', 'g... |
#!/usr/bin/python3
import os
import sys
import getopt
import json
import re
import xlrd
import openpyxl
from openpyxl.utils import get_column_letter
from pprint import pprint
def usage():
print("Usage : {0}".format(sys.argv[0]))
def main():
ret = 0
try:
opts, args = getopt.getopt(
sys.argv[1:], "hvo:", ... | [
"getopt.getopt",
"xlrd.open_workbook",
"openpyxl.load_workbook",
"openpyxl.utils.get_column_letter",
"os.path.splitext",
"pprint.pprint",
"sys.exit"
] | [((280, 347), 'getopt.getopt', 'getopt.getopt', (['sys.argv[1:]', '"""hvo:"""', "['help', 'version', 'output=']"], {}), "(sys.argv[1:], 'hvo:', ['help', 'version', 'output='])\n", (293, 347), False, 'import getopt\n'), ((723, 734), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (731, 734), False, 'import sys\n'), ((91... |
import os.path as osp
import sys
import numpy as np
import torch
from matplotlib import pyplot as plt
from scipy.stats import norm
sys.path.append(osp.dirname(sys.path[0]))
from neko import neko_utils
class utils(neko_utils.neko_utils):
def __init__(self):
super(utils, self).__init__()
def plot_lat... | [
"matplotlib.pyplot.show",
"matplotlib.pyplot.imshow",
"os.path.dirname",
"numpy.zeros",
"matplotlib.pyplot.figure",
"torch.Tensor",
"numpy.array",
"numpy.linspace"
] | [((149, 173), 'os.path.dirname', 'osp.dirname', (['sys.path[0]'], {}), '(sys.path[0])\n', (160, 173), True, 'import os.path as osp\n'), ((621, 641), 'numpy.zeros', 'np.zeros', (['image_size'], {}), '(image_size)\n', (629, 641), True, 'import numpy as np\n'), ((1203, 1231), 'matplotlib.pyplot.figure', 'plt.figure', ([],... |
import tensorflow as tf
import numpy as np
def img2mse(x, y):
return tf.reduce_mean(tf.square(x - y))
def mse2psnr(x):
return -10.*tf.math.log(x)/tf.math.log(10.)
def variance_weighted_loss(tof, gt, c=1.):
tof = outputs['tof_map']
tof_std = tof[..., -1:]
tof = tof[..., :2]
gt = gt[..., :2]
... | [
"tensorflow.math.log",
"tensorflow.abs",
"numpy.clip",
"tensorflow.square"
] | [((89, 105), 'tensorflow.square', 'tf.square', (['(x - y)'], {}), '(x - y)\n', (98, 105), True, 'import tensorflow as tf\n'), ((156, 173), 'tensorflow.math.log', 'tf.math.log', (['(10.0)'], {}), '(10.0)\n', (167, 173), True, 'import tensorflow as tf\n'), ((1490, 1522), 'numpy.clip', 'np.clip', (['target_depth', 'near',... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
import signal
import socket
import subprocess
import textwrap
import time
from contextlib import ExitSta... | [
"antlir.common.listen_temporary_unix_socket",
"antlir.common.get_logger",
"socket.socket",
"contextlib.ExitStack",
"time.time",
"antlir.common.recv_fds_from_unix_sock",
"time.localtime",
"antlir.common.check_popen_returncode"
] | [((590, 602), 'antlir.common.get_logger', 'get_logger', ([], {}), '()\n', (600, 602), False, 'from antlir.common import FD_UNIX_SOCK_TIMEOUT, check_popen_returncode, get_logger, listen_temporary_unix_socket, recv_fds_from_unix_sock\n'), ((709, 720), 'time.time', 'time.time', ([], {}), '()\n', (718, 720), False, 'import... |
"""
This is the main entry point for pyproj
e.g. python -m pyproj
"""
import argparse
from pyproj import __proj_version__, __version__, _show_versions
parser = argparse.ArgumentParser()
parser.add_argument(
"-v",
"--verbose",
help="Show verbose debugging version information.",
action="store_true",
... | [
"pyproj._show_versions.show_versions",
"argparse.ArgumentParser"
] | [((165, 190), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (188, 190), False, 'import argparse\n'), ((370, 400), 'pyproj._show_versions.show_versions', '_show_versions.show_versions', ([], {}), '()\n', (398, 400), False, 'from pyproj import __proj_version__, __version__, _show_versions\n')] |
import math
import json
import os
import sys
from datetime import datetime
import pandas as pd
import googlemaps
import populartimes
from apikeys import API_KEY
#%%
PLACE_SEARCHES = [
# ('restaurant', 'restaurant', True),
# ('bar', 'bar', True),
('fast food', None, True),
# ('club', None, True),
... | [
"googlemaps.Client",
"json.dump",
"json.load",
"math.sqrt",
"math.radians",
"pandas.read_csv",
"os.path.exists",
"math.sin",
"datetime.datetime.utcnow",
"math.cos",
"populartimes.get_id",
"datetime.datetime.now",
"pandas.concat"
] | [((1859, 1889), 'googlemaps.Client', 'googlemaps.Client', ([], {'key': 'API_KEY'}), '(key=API_KEY)\n', (1876, 1889), False, 'import googlemaps\n'), ((1900, 1937), 'pandas.read_csv', 'pd.read_csv', (['"""data/cities_edited.csv"""'], {}), "('data/cities_edited.csv')\n", (1911, 1937), True, 'import pandas as pd\n'), ((194... |
'''
Title: Time Series Deconfounder: Estimating Treatment Effects over Time in the Presence of Hidden Confounders
Authors: <NAME>, <NAME>, <NAME>
International Conference on Machine Learning (ICML) 2020
Last Updated Date: July 20th 2020
Code Author: <NAME> (<EMAIL>)
'''
import logging
logging.basicConfig(format='%(lev... | [
"tensorflow.clip_by_value",
"tensorflow.distributions.Bernoulli",
"tensorflow.reshape",
"tensorflow.get_variable",
"tensorflow.compat.v1.global_variables_initializer",
"tensorflow.abs",
"utils.predictive_checks_utils.compute_test_statistic_all_timesteps",
"tensorflow.compat.v1.placeholder",
"tensorf... | [((287, 362), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(levelname)s:%(message)s"""', 'level': 'logging.INFO'}), "(format='%(levelname)s:%(message)s', level=logging.INFO)\n", (306, 362), False, 'import logging\n'), ((363, 382), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (380, 3... |
from collections import namedtuple
from datasets import VUPDataset, NUPDataset, MLMDataset
import numpy as np
from data_utils import read_dataset
from models.VUPScorer import VUPScorer
from models.NUPScorer import NUPScorer
from models.MLMScorer import MLMScorer
import argparse
import json
from tqdm.auto import tqdm
... | [
"numpy.quantile",
"argparse.ArgumentParser",
"data_utils.read_dataset",
"models.MLMScorer.MLMScorer.load_from_checkpoint",
"json.dumps",
"tqdm.auto.tqdm",
"torch.cuda.is_available",
"torch.no_grad"
] | [((1130, 1223), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Calculating min and max of MLM for normalizatiion"""'}), "(description=\n 'Calculating min and max of MLM for normalizatiion')\n", (1153, 1223), False, 'import argparse\n'), ((1625, 1653), 'data_utils.read_dataset', 'read_... |
import unittest
class TestReadBatchfile(unittest.TestCase):
def test_read_batchfile(self):
# self.assertEqual(expected, read_batchfile(pythonpath, file_ending))
assert True # TODO: implement your test here
class TestBatchCommandProcessor(unittest.TestCase):
def test_parse_file(self):
#... | [
"unittest.main"
] | [((1400, 1415), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1413, 1415), False, 'import unittest\n')] |
from __future__ import annotations
import unittest
from src.austin_heller_repo.socket_queued_message_framework import ClientMessenger, ServerMessenger, ClientServerMessage, ClientServerMessageTypeEnum, Structure, StructureStateEnum, StructureFactory, StructureTransitionException, StructureInfluence, SourceTypeEnum, Cli... | [
"uuid.uuid4",
"matplotlib.pyplot.show",
"austin_heller_repo.threading.SingletonMemorySequentialQueueFactory",
"austin_heller_repo.kafka_manager.KafkaSequentialQueueFactory",
"austin_heller_repo.threading.start_thread",
"austin_heller_repo.threading.Semaphore",
"austin_heller_repo.socket.ClientSocketFact... | [((1228, 1280), 'austin_heller_repo.common.HostPointer', 'HostPointer', ([], {'host_address': '"""0.0.0.0"""', 'host_port': '(36429)'}), "(host_address='0.0.0.0', host_port=36429)\n", (1239, 1280), False, 'from austin_heller_repo.common import HostPointer\n'), ((1351, 1402), 'austin_heller_repo.common.HostPointer', 'Ho... |
from pymongo import MongoClient
import os
class Mongodb:
@classmethod
def db_connect(cls):
DB_URI = os.environ.get('DB_URI')
#print(DB_URI) os.environ.get('DB_URI')
client = MongoClient(DB_URI)
db = client.contentagregatordb
return db
@classmethod
def get_u... | [
"os.environ.get",
"pymongo.MongoClient"
] | [((122, 146), 'os.environ.get', 'os.environ.get', (['"""DB_URI"""'], {}), "('DB_URI')\n", (136, 146), False, 'import os\n'), ((212, 231), 'pymongo.MongoClient', 'MongoClient', (['DB_URI'], {}), '(DB_URI)\n', (223, 231), False, 'from pymongo import MongoClient\n')] |
from contextlib import contextmanager
from functools import lru_cache
from typing import Generator
@lru_cache(maxsize=None)
def slow_function(message, timeout):
"""This function is slow."""
print(message)
@contextmanager
def feeling_good(x: int, y: int) -> Generator:
"""You'll feel better in this contex... | [
"functools.lru_cache"
] | [((102, 125), 'functools.lru_cache', 'lru_cache', ([], {'maxsize': 'None'}), '(maxsize=None)\n', (111, 125), False, 'from functools import lru_cache\n')] |
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
from registry import registry_pb2 as registry_dot_registry__pb2
class RegistryStub(object):
"""Missing associated documentation comment in .proto file."""
... | [
"grpc.method_handlers_generic_handler",
"grpc.unary_stream_rpc_method_handler",
"grpc.unary_unary_rpc_method_handler",
"grpc.experimental.unary_stream",
"grpc.experimental.unary_unary"
] | [((5081, 5159), 'grpc.method_handlers_generic_handler', 'grpc.method_handlers_generic_handler', (['"""registry.Registry"""', 'rpc_method_handlers'], {}), "('registry.Registry', rpc_method_handlers)\n", (5117, 5159), False, 'import grpc\n'), ((3551, 3769), 'grpc.unary_unary_rpc_method_handler', 'grpc.unary_unary_rpc_met... |
"""
Query and deal common tables.
"""
from evennia.utils import logger
from django.apps import apps
from django.conf import settings
class ImageResourcesMapper(object):
"""
Object's image.
"""
def __init__(self):
self.model_name = "image_resources"
self.model = apps.get_model(settings... | [
"django.apps.apps.get_model"
] | [((297, 353), 'django.apps.apps.get_model', 'apps.get_model', (['settings.WORLD_DATA_APP', 'self.model_name'], {}), '(settings.WORLD_DATA_APP, self.model_name)\n', (311, 353), False, 'from django.apps import apps\n')] |
import re
import collections
from enum import Enum
from ydk._core._dm_meta_info import _MetaInfoClassMember, _MetaInfoClass, _MetaInfoEnum
from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64, FixedBitsDict
from ydk._core._dm_meta_info import ATTRIBUTE, REFERENCE_CLASS, REFERENCE_LIST, REFERENCE_LEAFLI... | [
"ydk._core._dm_meta_info._MetaInfoEnum"
] | [((546, 773), 'ydk._core._dm_meta_info._MetaInfoEnum', '_MetaInfoEnum', (['"""Ipv4DefaultPingEnum"""', '"""ydk.models.cisco_ios_xr.Cisco_IOS_XR_ipv4_io_cfg"""', "{'disabled': 'disabled', 'enabled': 'enabled'}", '"""Cisco-IOS-XR-ipv4-io-cfg"""', "_yang_ns._namespaces['Cisco-IOS-XR-ipv4-io-cfg']"], {}), "('Ipv4DefaultPin... |
#!/usr/bin/env python
from __future__ import print_function, division
from glob import glob
import astropy.io.fits as pyfits
import sys, os
from os import path, remove
from astropy import log
from astropy.table import Table
from subprocess import check_call
import argparse
import re
import numpy as np
# from nicer.val... | [
"matplotlib.pyplot.title",
"astropy.table.Table.read",
"matplotlib.pyplot.show",
"argparse.ArgumentParser",
"matplotlib.pyplot.plot",
"numpy.any",
"numpy.where",
"numpy.array",
"astropy.log.error",
"glob.glob",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"os.path.join",
"subpro... | [((372, 611), 'numpy.array', 'np.array', (['[0, 1, 2, 3, 4, 5, 6, 7, 10, 11, 12, 13, 14, 15, 16, 17, 20, 21, 22, 23, 24,\n 25, 26, 27, 30, 31, 32, 33, 34, 35, 36, 37, 40, 41, 42, 43, 44, 45, 46,\n 47, 50, 51, 52, 53, 54, 55, 56, 57, 60, 61, 62, 63, 64, 65, 66, 67]'], {}), '([0, 1, 2, 3, 4, 5, 6, 7, 10, 11, 12, 13... |
# Generated by Django 2.0 on 2018-01-06 08:02
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tangerine', '0016_auto_20180104_2324'),
]
operations = [
migrations.AddField(
model_name='config',
name='show_future',... | [
"django.db.models.BooleanField"
] | [((339, 493), 'django.db.models.BooleanField', 'models.BooleanField', ([], {'default': '(False)', 'help_text': '"""If enabled, posts dated in the future appear immediately. Default is False (drip-date behavior)."""'}), "(default=False, help_text=\n 'If enabled, posts dated in the future appear immediately. Default i... |
#!/usr/bin/env python
from subprocess import check_output
"""
Bus 001 Device 008: ID 239a:d1ed
Bus 001 Device 015: ID 045e:00db Microsoft Corp. Natural Ergonomic Keyboard 4000 V1.0
Bus 001 Device 014: ID 046d:c52f Logitech, Inc. Unifying Receiver
Bus 001 Device 013: ID 0b95:772a ASIX Electronics Corp. AX88772A Fast ... | [
"subprocess.check_output"
] | [((880, 903), 'subprocess.check_output', 'check_output', (["['lsusb']"], {}), "(['lsusb'])\n", (892, 903), False, 'from subprocess import check_output\n')] |
import sys
from plotnn import plotnn
import plotnn.tikzeng as tk
def main():
namefile = str(sys.argv[0]).split('.')[0]
arch = [
tk.Image("input", "./images/dogcat.jpg"),
tk.Conv2D(name='conv_0', out_width=570, out_channel=64, activation="relu",
offset=(3, 0, 0), location="i... | [
"plotnn.tikzeng.Conv2D",
"plotnn.tikzeng.ConvTranspose2D",
"plotnn.tikzeng.Image",
"plotnn.tikzeng.Softmax",
"plotnn.tikzeng.Connection",
"plotnn.plotnn.generate",
"plotnn.tikzeng.Concat",
"plotnn.tikzeng.Box",
"plotnn.tikzeng.Pool"
] | [((8285, 8327), 'plotnn.plotnn.generate', 'plotnn.generate', (['[arch]', "(namefile + '.tex')"], {}), "([arch], namefile + '.tex')\n", (8300, 8327), False, 'from plotnn import plotnn\n'), ((147, 187), 'plotnn.tikzeng.Image', 'tk.Image', (['"""input"""', '"""./images/dogcat.jpg"""'], {}), "('input', './images/dogcat.jpg... |
import tensorflow as tf
import numpy as np
from PIL import Image
from PIL import ImageDraw
from PIL import ImageColor
import cv2
import time
from styx_msgs.msg import TrafficLight
class TLClassifier(object):
def __init__(self):
self.current_light = TrafficLight.UNKNOWN
SSD_GRAPH_FILE = '.... | [
"numpy.asarray",
"tensorflow.Session",
"tensorflow.gfile.GFile",
"tensorflow.Graph",
"numpy.squeeze",
"tensorflow.import_graph_def",
"tensorflow.GraphDef"
] | [((1342, 1352), 'tensorflow.Graph', 'tf.Graph', ([], {}), '()\n', (1350, 1352), True, 'import tensorflow as tf\n'), ((1413, 1426), 'tensorflow.GraphDef', 'tf.GraphDef', ([], {}), '()\n', (1424, 1426), True, 'import tensorflow as tf\n'), ((2063, 2096), 'numpy.asarray', 'np.asarray', (['image'], {'dtype': 'np.uint8'}), '... |
# -*- coding: utf-8 -*-
"""Simple OSC client."""
import socket
try:
from ustruct import pack
except ImportError:
from struct import pack
from uosc.common import Bundle, to_frac
if isinstance("", bytes):
have_bytes = False
unicodetype = unicode # noqa
else:
have_bytes = True
... | [
"uosc.common.to_frac",
"socket.getaddrinfo",
"socket.socket",
"struct.pack"
] | [((781, 817), 'socket.getaddrinfo', 'socket.getaddrinfo', (['addr[0]', 'addr[1]'], {}), '(addr[0], addr[1])\n', (799, 817), False, 'import socket\n'), ((1612, 1628), 'struct.pack', 'pack', (['""">I"""', 'blen'], {}), "('>I', blen)\n", (1616, 1628), False, 'from struct import pack\n'), ((952, 962), 'uosc.common.to_frac'... |
'''
Created on Jun 21, 2018
@author: moffat
'''
from django.contrib import admin
from ..models import IneligibleSubject
from ..admin_site import tp_screening_admin
class ChoiceInline(admin.TabularInline):
model = IneligibleSubject
@admin.register(IneligibleSubject, site=tp_screening_admin)
class IneligibleSu... | [
"django.contrib.admin.register",
"django.contrib.admin.site.register"
] | [((243, 301), 'django.contrib.admin.register', 'admin.register', (['IneligibleSubject'], {'site': 'tp_screening_admin'}), '(IneligibleSubject, site=tp_screening_admin)\n', (257, 301), False, 'from django.contrib import admin\n'), ((868, 930), 'django.contrib.admin.site.register', 'admin.site.register', (['IneligibleSub... |
#!/usr/bin/env python3
#
# Author: <NAME>
# License: BSD 2-clause
# Last Change: Mon Oct 25, 2021 at 09:41 PM +0200
import sys
import os
import os.path as op
from argparse import ArgumentParser, Action
from os import chdir
from shutil import rmtree
from pyBabyMaker.base import TermColor as TC
sys.path.insert(0, op.... | [
"utils.aggregate_fltr",
"os.path.abspath",
"argparse.ArgumentParser",
"utils.find_polarity",
"shutil.rmtree",
"utils.ensure_dir",
"os.path.basename",
"utils.workflow_cached_ntuple",
"utils.aggregate_output",
"utils.run_cmd_wrapper",
"utils.find_all_input",
"utils.load_yaml_db",
"utils.find_y... | [((1080, 1142), 'utils.aggregate_fltr', 'aggregate_fltr', ([], {'keep': "['^(Dst|D0).*\\\\.root']", 'blocked': "['__aux']"}), "(keep=['^(Dst|D0).*\\\\.root'], blocked=['__aux'])\n", (1094, 1142), False, 'from utils import run_cmd_wrapper, append_path, abs_path, ensure_dir, find_all_input, aggregate_fltr, aggregate_outp... |
#!/usr/bin/env python
# coding: utf-8
from mpi4py import MPI
from PyQNLPSimulator import PyQNLPSimulator as p
import QNLP as q
import numpy as np
num_qubits = 24
# Create simulator object
use_fusion = False
sim = p(num_qubits, use_fusion)
sim.initRegister()
comm = MPI.COMM_WORLD
rank = comm.Get_rank()
val = 0
s... | [
"PyQNLPSimulator.PyQNLPSimulator"
] | [((219, 244), 'PyQNLPSimulator.PyQNLPSimulator', 'p', (['num_qubits', 'use_fusion'], {}), '(num_qubits, use_fusion)\n', (220, 244), True, 'from PyQNLPSimulator import PyQNLPSimulator as p\n')] |
import pandas as pd
import warnings
from ...pysd import read_vensim
from io import open
def read_tabular(table_file, sheetname='Sheet1'):
"""
Reads a vensim syntax model which has been formatted as a table.
This is useful in contexts where model building is performed
without the aid of Vensim.
P... | [
"pandas.read_excel",
"warnings.warn",
"pandas.read_csv",
"io.open"
] | [((1751, 1826), 'warnings.warn', 'warnings.warn', (['"""Column for "Units" not found"""', 'RuntimeWarning'], {'stacklevel': '(2)'}), '(\'Column for "Units" not found\', RuntimeWarning, stacklevel=2)\n', (1764, 1826), False, 'import warnings\n'), ((1904, 1977), 'warnings.warn', 'warnings.warn', (['"""Column for "Min" no... |
import netscrypt
with netscrypt.Client ('localhost', 6666) as client:
dogs = client ('dogs')
for dog in dogs:
print (dog.name)
print (dog.speak ('wraff'))
| [
"netscrypt.Client"
] | [((23, 58), 'netscrypt.Client', 'netscrypt.Client', (['"""localhost"""', '(6666)'], {}), "('localhost', 6666)\n", (39, 58), False, 'import netscrypt\n')] |
import torch
from torch import nn
class ScaleNorm(nn.Module):
def __init__(self, dim, eps=1e-5):
super().__init__()
self.scale = dim ** -0.5
self.g = nn.Parameter(torch.ones(1))
self.eps = eps
def forward(self, x):
n = torch.norm(x, dim=-1, keepdim=True).cl... | [
"torch.norm",
"torch.ones"
] | [((201, 214), 'torch.ones', 'torch.ones', (['(1)'], {}), '(1)\n', (211, 214), False, 'import torch\n'), ((282, 317), 'torch.norm', 'torch.norm', (['x'], {'dim': '(-1)', 'keepdim': '(True)'}), '(x, dim=-1, keepdim=True)\n', (292, 317), False, 'import torch\n')] |
from flask import Blueprint, redirect, url_for, jsonify, make_response, request
from ..models.users import User
from ..utils.database import db
from flask_login import login_user, logout_user
from ..controllers.methods import check_email_exists, check_username_exists
auth_bp = Blueprint("auth", __name__)
@auth_bp.r... | [
"flask.Blueprint",
"flask.request.form.get",
"flask_login.login_user",
"flask_login.logout_user",
"flask.url_for",
"flask.jsonify",
"flask.request.get_json"
] | [((280, 307), 'flask.Blueprint', 'Blueprint', (['"""auth"""', '__name__'], {}), "('auth', __name__)\n", (289, 307), False, 'from flask import Blueprint, redirect, url_for, jsonify, make_response, request\n'), ((388, 406), 'flask.request.get_json', 'request.get_json', ([], {}), '()\n', (404, 406), False, 'from flask imp... |
from mycroft.skills import MycroftSkill
from mycroft.messagebus.message import Message
from mail_monitor import EmailMonitor
from os.path import dirname, join
class EmailMonitorSkill(MycroftSkill):
def __init__(self):
super().__init__()
self.email_config = self.config_core.get("email", {})
... | [
"mail_monitor.EmailMonitor",
"os.path.dirname",
"mycroft.messagebus.message.Message"
] | [((1908, 2038), 'mycroft.messagebus.message.Message', 'Message', (['"""recognizer_loop:utterance"""', "{'utterances': [email['payload']]}", "{'source': email['email'], 'destinatary': 'skills'}"], {}), "('recognizer_loop:utterance', {'utterances': [email['payload']]}, {\n 'source': email['email'], 'destinatary': 'ski... |
'''
Created on Feb. 25, 2020
@author: cefect
helper functions w/ Qgis api
'''
#==============================================================================
# imports------------
#==============================================================================
#python
import os, configparser, logging, inspect, copy, ... | [
"os.remove",
"hlpr.exceptions.QError",
"processing.run",
"numpy.isnan",
"hlpr.basic.linr",
"os.path.join",
"pandas.DataFrame",
"hlpr.basic.view",
"processing.core.Processing.Processing.initialize",
"inspect.isclass",
"os.path.dirname",
"os.path.exists",
"inspect.isbuiltin",
"hlpr.basic.is_... | [((816, 838), 'logging.getLogger', 'logging.getLogger', (['"""Q"""'], {}), "('Q')\n", (833, 838), False, 'import os, configparser, logging, inspect, copy, datetime, re\n'), ((110896, 110914), 'os.path.exists', 'os.path.exists', (['fp'], {}), '(fp)\n', (110910, 110914), False, 'import os, configparser, logging, inspect,... |
import pytest
from tests.unit import a_pkg_import
@pytest.fixture(scope="function")
def read_meta(a_pkg_import):
a_pkg = a_pkg_import()
return a_pkg.pkg.meta
def test_meta(read_meta):
expected = {
"name": "a-pkg",
"version": "1.2.3",
"author": "<NAME>",
"author-email": "... | [
"pytest.fixture",
"tests.unit.a_pkg_import"
] | [((54, 86), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""function"""'}), "(scope='function')\n", (68, 86), False, 'import pytest\n'), ((128, 142), 'tests.unit.a_pkg_import', 'a_pkg_import', ([], {}), '()\n', (140, 142), False, 'from tests.unit import a_pkg_import\n')] |
#!/usr/bin/env python3
# 6a-render-model3.py - investigate delauney triangulation for
# individual image surface mesh generation.
# for all the images in the fitted group, generate a 2d polygon
# surface fit. Then project the individual images onto this surface
# and generate an AC3D model.
#
# Note: insufficient im... | [
"lib.project.intersectVectorsWithGroundPlane",
"cv2.undistortPoints",
"argparse.ArgumentParser",
"math.sqrt",
"math.atan2",
"lib.srtm.interpolate_vectors",
"lib.panda3d.generate_from_fit",
"lib.groups.load",
"numpy.zeros",
"numpy.isnan",
"lib.project.ProjectMgr",
"numpy.array",
"numpy.linalg... | [((905, 973), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Set the initial camera poses."""'}), "(description='Set the initial camera poses.')\n", (928, 973), False, 'import argparse\n'), ((1527, 1559), 'lib.project.ProjectMgr', 'project.ProjectMgr', (['args.project'], {}), '(args.proj... |
# coding:utf-8:
from lisp.sexpressions import (
SexprNumber, SexprString, SexprCons, SexprNil, SexprSymbol,
SexprTrue, SexprFalse, SexprProcedure, SexprBuiltin, SexprList,
SexprBool, bool_value, num_value, string_value, is_keyword,
intern_symbol, consp, symbolp, symbol_name, car, cdr, s... | [
"lisp.sexpressions.consp",
"lisp.sexpressions.SexprList",
"lisp.sexpressions.symbolp",
"lisp.sexpressions.symbol_name",
"lisp.sexpressions.is_null",
"lisp.sexpressions.num_value",
"lisp.sexpressions.SexprFalse",
"lisp.sexpressions.bool_value",
"lisp.sexpressions.SexprCons",
"lisp.sexpressions.is_n... | [((4543, 4561), 'lisp.sexpressions.consp', 'consp', (['environment'], {}), '(environment)\n', (4548, 4561), False, 'from lisp.sexpressions import SexprNumber, SexprString, SexprCons, SexprNil, SexprSymbol, SexprTrue, SexprFalse, SexprProcedure, SexprBuiltin, SexprList, SexprBool, bool_value, num_value, string_value, is... |
from setuptools import setup, find_packages
setup(
name="ceres_infer",
version="1.0",
author="<NAME>",
description='CERES inference',
long_description=open('README.md').read(),
package_dir={"": "src"},
packages=find_packages("ceres_infer"),
include_package_data=True,
zip_safe=False,... | [
"setuptools.find_packages"
] | [((240, 268), 'setuptools.find_packages', 'find_packages', (['"""ceres_infer"""'], {}), "('ceres_infer')\n", (253, 268), False, 'from setuptools import setup, find_packages\n')] |
from flask import Flask,render_template,request
import random
import sqlite3
app = Flask(__name__)
DATABASE='mydb.db'
def connect_db():
return sqlite3.connect(DATABASE)
@app.route('/')
def index():
return render_template('Home.html')
@app.route('/details')
def details():
return render_... | [
"random.randint",
"flask.request.args.get",
"flask.Flask",
"sqlite3.connect",
"flask.render_template"
] | [((88, 103), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (93, 103), False, 'from flask import Flask, render_template, request\n'), ((159, 184), 'sqlite3.connect', 'sqlite3.connect', (['DATABASE'], {}), '(DATABASE)\n', (174, 184), False, 'import sqlite3\n'), ((230, 258), 'flask.render_template', 'render_... |
import numpy as np
def sherman_morrison_row(e, inv, vec):
ratio = np.einsum("ij,ij->i", vec, inv[:, :, e])
tmp = np.einsum("ek,ekj->ej", vec, inv)
invnew = (
inv
- np.einsum("ki,kj->kij", inv[:, :, e], tmp) / ratio[:, np.newaxis, np.newaxis]
)
invnew[:, :, e] = inv[:, :, ... | [
"numpy.sum",
"numpy.abs",
"numpy.random.randn",
"numpy.asarray",
"numpy.einsum",
"numpy.zeros",
"pyqmc.testwf.test_updateinternals",
"pyqmc.testwf.test_wf_gradient",
"pyscf.gto.M",
"pyscf.scf.RHF",
"numpy.array",
"numpy.linalg.slogdet",
"numpy.linalg.inv",
"numpy.sign",
"pyscf.scf.ROHF",... | [((76, 116), 'numpy.einsum', 'np.einsum', (['"""ij,ij->i"""', 'vec', 'inv[:, :, e]'], {}), "('ij,ij->i', vec, inv[:, :, e])\n", (85, 116), True, 'import numpy as np\n'), ((128, 161), 'numpy.einsum', 'np.einsum', (['"""ek,ekj->ej"""', 'vec', 'inv'], {}), "('ek,ekj->ej', vec, inv)\n", (137, 161), True, 'import numpy as n... |
from dateutil.relativedelta import relativedelta
from custom.icds_reports.const import AGG_DAILY_FEEDING_TABLE
from custom.icds_reports.utils.aggregation_helpers import (
month_formatter,
transform_day_to_month,
)
from custom.icds_reports.utils.aggregation_helpers.distributed.base import (
StateBasedAggreg... | [
"custom.icds_reports.utils.aggregation_helpers.month_formatter",
"dateutil.relativedelta.relativedelta"
] | [((1087, 1114), 'custom.icds_reports.utils.aggregation_helpers.month_formatter', 'month_formatter', (['self.month'], {}), '(self.month)\n', (1102, 1114), False, 'from custom.icds_reports.utils.aggregation_helpers import month_formatter, transform_day_to_month\n'), ((1243, 1270), 'custom.icds_reports.utils.aggregation_h... |
'''
Script to monitor ssh running on
a raspberry pi. If ssh is not
currently active, then reboot.
'''
import subprocess
def main():
cmd = subprocess.Popen("service ssh status", shell=True, stdout=subprocess.PIPE)
for line in cmd.stdout:
if "Active: " in line:
if "active" in line.split(' '):
return
els... | [
"subprocess.Popen",
"subprocess.call"
] | [((142, 216), 'subprocess.Popen', 'subprocess.Popen', (['"""service ssh status"""'], {'shell': '(True)', 'stdout': 'subprocess.PIPE'}), "('service ssh status', shell=True, stdout=subprocess.PIPE)\n", (158, 216), False, 'import subprocess\n'), ((327, 381), 'subprocess.call', 'subprocess.call', (["['sudo', 'service', 'ss... |
''' Script constants '''
import os
from portfolio.settings import BASE_DIR
import constants.common as common
# db script arguments
FOR_PROD = 'for_prod'
UPDATING = 'updating'
DB_UPDATE = 'db_update'
TEST_UPDATE = 'test_update'
# s3 updater script argurments
HOME = 'home'
DELETE = 'delete'
static_files = list(common.... | [
"os.path.join"
] | [((547, 594), 'os.path.join', 'os.path.join', (['BASE_DIR', '"""data/data_for_creates"""'], {}), "(BASE_DIR, 'data/data_for_creates')\n", (559, 594), False, 'import os\n'), ((623, 689), 'os.path.join', 'os.path.join', (['BASE_DIR', '"""data/data_for_updates/dev_input_step_one"""'], {}), "(BASE_DIR, 'data/data_for_updat... |
#!/usr/bin/env python
# ~*~ coding: utf-8 ~*~
from __future__ import absolute_import
from django.urls import path
from users.views import login, users, groups, project, permission,role,keys
app_name = 'users'
urlpatterns = [
# Login View
path('login/', login.UserLoginView.as_view(), name='login'... | [
"users.views.keys.KeyAdd.as_view",
"users.views.users.UsersDetail.as_view",
"users.views.users.UsersChangePassword.as_view",
"users.views.permission.PermissionUpdate.as_view",
"users.views.permission.PermissionListAll.as_view",
"users.views.groups.GroupsListAll.as_view",
"users.views.role.RoleEdit.as_vi... | [((277, 306), 'users.views.login.UserLoginView.as_view', 'login.UserLoginView.as_view', ([], {}), '()\n', (304, 306), False, 'from users.views import login, users, groups, project, permission, role, keys\n'), ((344, 374), 'users.views.login.UserLogoutView.as_view', 'login.UserLogoutView.as_view', ([], {}), '()\n', (372... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import unicode_literals
import responses
from testing.util import read_json_file
YELP_SAN_FRANCISCO = responses.Response(
method="GET",
url="https://api.yelp.com/v3/businesses/yelp-san-francisco",
json=read_json_file("busines... | [
"testing.util.read_json_file"
] | [((297, 354), 'testing.util.read_json_file', 'read_json_file', (['"""business_lookup_yelp_san_francisco.json"""'], {}), "('business_lookup_yelp_san_francisco.json')\n", (311, 354), False, 'from testing.util import read_json_file\n'), ((549, 605), 'testing.util.read_json_file', 'read_json_file', (['"""business_lookup_sa... |
from flask import Flask, render_template, request
import json
from thrift import Thrift
from thrift.transport import TSocket,TTransport
from thrift.protocol import TBinaryProtocol
from hbase import Hbase
from hbase.ttypes import ColumnDescriptor,Mutation,BatchMutation,TRegionInfo
from hbase.ttypes import IOError,Alre... | [
"hbase.Hbase.Client",
"thrift.transport.TSocket.TSocket",
"flask.Flask",
"json.dumps",
"thrift.protocol.TBinaryProtocol.TBinaryProtocol",
"thrift.transport.TTransport.TBufferedTransport"
] | [((337, 352), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (342, 352), False, 'from flask import Flask, render_template, request\n'), ((420, 450), 'thrift.transport.TSocket.TSocket', 'TSocket.TSocket', (['"""hbase"""', '(9090)'], {}), "('hbase', 9090)\n", (435, 450), False, 'from thrift.transport import ... |
__title__ = "playground"
__author__ = "murlux"
__copyright__ = "Copyright 2019, " + __author__
__credits__ = (__author__, )
__license__ = "MIT"
__email__ = "<EMAIL>"
import json
import logging
from typing import Any, Dict, Optional
from dateutil.relativedelta import relativedelta
from datetime import datetime
from jso... | [
"jsonschema.validate",
"logging.basicConfig",
"json.loads",
"logging.getLogger"
] | [((602, 625), 'logging.getLogger', 'logging.getLogger', (['name'], {}), '(name)\n', (619, 625), False, 'import logging\n'), ((630, 737), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO', 'format': '"""%(asctime)s - %(name)s - %(levelname)s - %(message)s"""'}), "(level=logging.INFO, format=\n ... |
"""Test the rules that protect AVU records having attributes with a
given prefix.
"""
import ConfigParser
import subprocess
import unittest
class AVUProtectTest(unittest.TestCase): #pylint: disable=R0904
"""Test suite based on the unittest framework."""
def __init__(self, *args, **kwargs):
"""Read co... | [
"unittest.main",
"ConfigParser.RawConfigParser",
"subprocess.call"
] | [((7490, 7505), 'unittest.main', 'unittest.main', ([], {}), '()\n', (7503, 7505), False, 'import unittest\n'), ((425, 455), 'ConfigParser.RawConfigParser', 'ConfigParser.RawConfigParser', ([], {}), '()\n', (453, 455), False, 'import ConfigParser\n'), ((907, 970), 'subprocess.call', 'subprocess.call', (['("imeta ls -d \... |
import logging
from django.core.urlresolvers import reverse
from django.http import HttpResponse, HttpResponseRedirect
from django.views.generic.base import View
from django.views.generic.detail import DetailView
from getpaid.backends.payu import PaymentProcessor
from getpaid.models import Payment
logger = logging.get... | [
"django.core.urlresolvers.reverse",
"django.http.HttpResponse",
"logging.getLogger",
"getpaid.backends.payu.PaymentProcessor.online"
] | [((309, 351), 'logging.getLogger', 'logging.getLogger', (['"""getpaid.backends.payu"""'], {}), "('getpaid.backends.payu')\n", (326, 351), False, 'import logging\n'), ((982, 1034), 'getpaid.backends.payu.PaymentProcessor.online', 'PaymentProcessor.online', (['pos_id', 'session_id', 'ts', 'sig'], {}), '(pos_id, session_i... |
# Unless explicitly stated otherwise all files in this repository are licensed under the the Apache License Version 2.0.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2021 Datadog, Inc.
from utils import BaseTestCase, context, released, interfaces, coverage
import pyte... | [
"pytest.mark.skip",
"utils.released"
] | [((407, 496), 'utils.released', 'released', ([], {'golang': '"""?"""', 'dotnet': '"""?"""', 'java': '"""?"""', 'nodejs': '"""?"""', 'php': '"""?"""', 'python': '"""?"""', 'ruby': '"""?"""'}), "(golang='?', dotnet='?', java='?', nodejs='?', php='?', python='?',\n ruby='?')\n", (415, 496), False, 'from utils import Ba... |
'''
Created on Jan, 2017
@author: hugo
'''
from __future__ import absolute_import
import multiprocessing
from gensim.models import Doc2Vec
class MyDoc2Vec(object):
def __init__(self, dim, hs=0, window=5, negative=5, epoches=5, dm=1, dm_concat=1):
super(MyDoc2Vec, self).__init__()
self.dim = dim
... | [
"gensim.models.Doc2Vec.load",
"multiprocessing.cpu_count"
] | [((1167, 1189), 'gensim.models.Doc2Vec.load', 'Doc2Vec.load', (['mod_file'], {}), '(mod_file)\n', (1179, 1189), False, 'from gensim.models import Doc2Vec\n'), ((619, 646), 'multiprocessing.cpu_count', 'multiprocessing.cpu_count', ([], {}), '()\n', (644, 646), False, 'import multiprocessing\n')] |
from enum import Enum
from typing import Any
from app.schemas.debit import DebitCreate, DebitUpdate
from fastapi import APIRouter, Depends, HTTPException
from fastapi import status as sts
from sqlalchemy.orm import Session
from app import crud, models, schemas
from app.api import deps
from app.core.celery_app import ... | [
"app.crud.debit.get_by_owner",
"app.crud.user.get",
"fastapi.HTTPException",
"app.crud.debit.create_with_owner",
"app.core.celery_app.celery_app.send_task",
"app.schemas.debit.DebitCreate",
"fastapi.Depends",
"app.schemas.debit.DebitUpdate",
"app.crud.debit.update_status",
"fastapi.APIRouter"
] | [((341, 352), 'fastapi.APIRouter', 'APIRouter', ([], {}), '()\n', (350, 352), False, 'from fastapi import APIRouter, Depends, HTTPException\n'), ((578, 598), 'fastapi.Depends', 'Depends', (['deps.get_db'], {}), '(deps.get_db)\n', (585, 598), False, 'from fastapi import APIRouter, Depends, HTTPException\n'), ((632, 669)... |
import warnings
warnings.filterwarnings('ignore')
from autox.autox_server.model import model_util
def lgb_with_fe(G_df_dict, G_data_info, G_hist, is_train, remain_time, params, lgb_para_dict, data_name, exp_name):
remain_time = model_util.lgb_model(G_df_dict['BIG_FE'], G_data_info, G_hist, is_train, remain_time, e... | [
"autox.autox_server.model.model_util.lgb_model",
"warnings.filterwarnings"
] | [((16, 49), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (39, 49), False, 'import warnings\n'), ((233, 366), 'autox.autox_server.model.model_util.lgb_model', 'model_util.lgb_model', (["G_df_dict['BIG_FE']", 'G_data_info', 'G_hist', 'is_train', 'remain_time', 'exp_name', ... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
"""Tests for MicroBenchmark and MicroBenchmarkWithInvoke modules."""
import os
import re
import shutil
from superbench.benchmarks import BenchmarkType, ReturnCode
from superbench.benchmarks.micro_benchmarks import MicroBenchmark, MicroBenchmark... | [
"re.findall",
"os.path.join",
"shutil.which"
] | [((1415, 1463), 'os.path.join', 'os.path.join', (['self._args.bin_dir', 'self._bin_name'], {}), '(self._args.bin_dir, self._bin_name)\n', (1427, 1463), False, 'import os\n'), ((2219, 2250), 're.findall', 're.findall', (['pattern', 'raw_output'], {}), '(pattern, raw_output)\n', (2229, 2250), False, 'import re\n'), ((386... |
# -*- coding: utf-8 -*-
import pdb,importlib,inspect,time,datetime,json
# from PyFin.api import advanceDateByCalendar
# from data.polymerize import DBPolymerize
from data.storage_engine import StorageEngine
import time
import pandas as pd
import numpy as np
from datetime import timedelta, datetime
from financial impor... | [
"datetime.datetime.strftime",
"pandas.DataFrame",
"data.storage_engine.StorageEngine",
"pandas.merge",
"data.sqlengine.sqlEngine",
"financial.factor_earning.FactorEarning",
"time.time",
"datetime.datetime.strptime",
"datetime.timedelta"
] | [((2290, 2331), 'datetime.datetime.strptime', 'datetime.strptime', (['trade_date', '"""%Y-%m-%d"""'], {}), "(trade_date, '%Y-%m-%d')\n", (2307, 2331), False, 'from datetime import timedelta, datetime\n'), ((2353, 2392), 'datetime.datetime.strftime', 'datetime.strftime', (['time_array', '"""%Y%m%d"""'], {}), "(time_arra... |
from app.mongodb_models.user import User as DBUser
from typing import Optional, List
from app.fields.user import Permission
from app.fields.role import Role
from app.core.permission import enforcer
from app import crud
def get_all_roles() -> List[Role]:
db_users = DBUser.objects()
db_users_name = [db_user.Use... | [
"app.core.permission.enforcer.get_all_subjects",
"app.core.permission.enforcer.get_grouping_policy",
"app.fields.role.Role",
"app.core.permission.enforcer.get_users_for_role",
"app.mongodb_models.user.User.objects",
"app.crud.user.get_user_base",
"app.fields.user.Permission",
"app.core.permission.enfo... | [((271, 287), 'app.mongodb_models.user.User.objects', 'DBUser.objects', ([], {}), '()\n', (285, 287), True, 'from app.mongodb_models.user import User as DBUser\n'), ((373, 400), 'app.core.permission.enforcer.get_all_subjects', 'enforcer.get_all_subjects', ([], {}), '()\n', (398, 400), False, 'from app.core.permission i... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-12-05 19:01
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('store', '0002_auto_20161204_2335'),
]
operations = [
migrations.AddField(
... | [
"django.db.models.ImageField",
"django.db.models.ManyToManyField"
] | [((400, 504), 'django.db.models.ImageField', 'models.ImageField', ([], {'default': 'None', 'null': '(True)', 'upload_to': "b''", 'verbose_name': '"""Main image of the product"""'}), "(default=None, null=True, upload_to=b'', verbose_name=\n 'Main image of the product')\n", (417, 504), False, 'from django.db import mi... |
# coding:utf-8
import hashlib
import time
import math
import platform
class DataHub:
# 数据存放出
_tmpData = {}
# -1为无限制
_size_max = -1
_regID = []
'''
数据中心
临时存放数据的位置
'''
def __init__(self, size_max=0):
# 获取数据中心最大值 默认无限制
self._size_max = size_max if size_max != 0 e... | [
"time.asctime",
"platform.platform",
"time.clock"
] | [((2066, 2080), 'time.asctime', 'time.asctime', ([], {}), '()\n', (2078, 2080), False, 'import time\n'), ((1674, 1686), 'time.clock', 'time.clock', ([], {}), '()\n', (1684, 1686), False, 'import time\n'), ((1706, 1725), 'platform.platform', 'platform.platform', ([], {}), '()\n', (1723, 1725), False, 'import platform\n'... |
"""
Forum member model admin definitions
====================================
This module defines admin classes used to populate the Django administration dashboard.
"""
from django.contrib import admin
from machina.core.db.models import get_model
from machina.models.fields import MarkupTextField, Marku... | [
"machina.core.db.models.get_model",
"django.contrib.admin.site.register"
] | [((354, 395), 'machina.core.db.models.get_model', 'get_model', (['"""forum_member"""', '"""ForumProfile"""'], {}), "('forum_member', 'ForumProfile')\n", (363, 395), False, 'from machina.core.db.models import get_model\n'), ((782, 834), 'django.contrib.admin.site.register', 'admin.site.register', (['ForumProfile', 'Foru... |
import binascii
import hashlib
import os
import sys
from ecdsa import SigningKey, VerifyingKey, curves
from ecdsa import ecdsa
from ecdsa import util as ecdsautil
DEFAULT_KEYTYPE = curves.NIST192p
def get_keys_folder(datafolder):
"""
:param datafolder:
:return:
"""
return os.path.join(datafolder,... | [
"os.makedirs",
"ecdsa.SigningKey.generate",
"binascii.hexlify",
"os.path.exists",
"binascii.unhexlify",
"ecdsa.ecdsa.ecdh",
"sys.stderr.write",
"ecdsa.VerifyingKey.from_pem",
"os.path.join"
] | [((296, 328), 'os.path.join', 'os.path.join', (['datafolder', '"""keys"""'], {}), "(datafolder, 'keys')\n", (308, 328), False, 'import os\n'), ((474, 513), 'os.path.join', 'os.path.join', (['keyfolder', '"""identity.pub"""'], {}), "(keyfolder, 'identity.pub')\n", (486, 513), False, 'import os\n'), ((661, 701), 'os.path... |
import ast
import re
import parsy
R_REFERENCE = re.compile(r'(?:(?:[^\d\W]\w*)?\.)?[^\d\W]\w*\s*', re.IGNORECASE)
R_SPACE = re.compile(r'\s+', re.IGNORECASE)
R_STRING = re.compile(r"('[^'\\]*(?:\\.[^'\\]*)*'|\"[^\"\\]*(?:\\.[^\"\\]*)*\")\s*", re.IGNORECASE)
R_OPERATOR_UNARY = re.compile(r'[+\-!~]\s*', re.IGNORECASE)
R... | [
"ast.literal_eval",
"parsy.regex",
"re.compile"
] | [((49, 121), 're.compile', 're.compile', (['"""(?:(?:[^\\\\d\\\\W]\\\\w*)?\\\\.)?[^\\\\d\\\\W]\\\\w*\\\\s*"""', 're.IGNORECASE'], {}), "('(?:(?:[^\\\\d\\\\W]\\\\w*)?\\\\.)?[^\\\\d\\\\W]\\\\w*\\\\s*', re.IGNORECASE)\n", (59, 121), False, 'import re\n'), ((125, 158), 're.compile', 're.compile', (['"""\\\\s+"""', 're.IGNO... |
import datetime,os,torch
from torch.utils.data import Dataset
from loadData import *
from lib import *
from fit import *
from model import *
from skimage.measure import block_reduce
import sys
date = datetime.datetime.now()
os.environ['CUDA_VISIBLE_DEVICES'] = '6' # change
# UnetAE_preRoll
# UnetAE_preIP_preRoll ... | [
"datetime.datetime.now",
"os.makedirs",
"os.path.exists"
] | [((200, 223), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (221, 223), False, 'import datetime, os, torch\n'), ((1181, 1209), 'os.path.exists', 'os.path.exists', (['out_model_fn'], {}), '(out_model_fn)\n', (1195, 1209), False, 'import datetime, os, torch\n'), ((1216, 1241), 'os.makedirs', 'os.mak... |
# -*- coding: utf-8 -*-
name = 'ue4'
version = '4.20.2'
author = ['ue4']
requires = ["python-2.7.11"]
variants = []
def commands():
import os
applications_path = os.environ["APPLICATIONS_PATH"]
python_path = os.path.join(applications_path, "python", "2.7.11").replace("/", os.sep)
ue4_path = os.... | [
"os.path.join"
] | [((224, 275), 'os.path.join', 'os.path.join', (['applications_path', '"""python"""', '"""2.7.11"""'], {}), "(applications_path, 'python', '2.7.11')\n", (236, 275), False, 'import os\n'), ((317, 371), 'os.path.join', 'os.path.join', (['applications_path', '"""ue4"""', "('%s' % version)"], {}), "(applications_path, 'ue4'... |
import numpy as np
from pmesh.pm import ParticleMesh
from nbodykit.lab import BigFileCatalog, MultipleSpeciesCatalog,\
BigFileMesh, FFTPower
from nbodykit import setup_logging
from mpi4py import MPI
import HImodels
# enable logging, we have some clue what's going on.
setup_loggin... | [
"nbodykit.lab.BigFileCatalog",
"numpy.abs",
"nbodykit.setup_logging",
"nbodykit.lab.FFTPower",
"pmesh.pm.ParticleMesh",
"nbodykit.lab.BigFileMesh"
] | [((308, 329), 'nbodykit.setup_logging', 'setup_logging', (['"""info"""'], {}), "('info')\n", (321, 329), False, 'from nbodykit import setup_logging\n'), ((933, 977), 'pmesh.pm.ParticleMesh', 'ParticleMesh', ([], {'BoxSize': 'bs', 'Nmesh': '[nc, nc, nc]'}), '(BoxSize=bs, Nmesh=[nc, nc, nc])\n', (945, 977), False, 'from ... |
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 2 19:15:26 2020
@author: Diego
"""
import pandas as pd
import sqlite3
import wget
import os
from urllib.request import urlopen
from bs4 import BeautifulSoup
import urllib.request
import datetime
import zipfile
import io
import requests
if not os.path.exists('data'):
... | [
"io.BytesIO",
"os.makedirs",
"pandas.DataFrame.from_dict",
"os.path.exists",
"urllib.request.urlopen",
"datetime.datetime.strptime",
"pandas.to_datetime",
"requests.get",
"pandas.read_sql",
"bs4.BeautifulSoup",
"os.path.join"
] | [((294, 316), 'os.path.exists', 'os.path.exists', (['"""data"""'], {}), "('data')\n", (308, 316), False, 'import os\n'), ((322, 341), 'os.makedirs', 'os.makedirs', (['"""data"""'], {}), "('data')\n", (333, 341), False, 'import os\n'), ((465, 498), 'os.path.join', 'os.path.join', (['"""data"""', '"""fundos.db"""'], {}),... |
# Copyright (c) The Libra Core Contributors
# SPDX-License-Identifier: Apache-2.0
from ..protocol import VASPPairChannel
from ..status_logic import Status, KYCResult, State, InvalidStateException
from ..payment_command import PaymentCommand, PaymentLogicError
from ..business import BusinessForceAbort, BusinessValidati... | [
"pytest.raises",
"os.urandom"
] | [((1679, 1715), 'pytest.raises', 'pytest.raises', (['InvalidStateException'], {}), '(InvalidStateException)\n', (1692, 1715), False, 'import pytest\n'), ((1872, 1908), 'pytest.raises', 'pytest.raises', (['InvalidStateException'], {}), '(InvalidStateException)\n', (1885, 1908), False, 'import pytest\n'), ((2463, 2499), ... |
from design_patterns.strategy.fahrenheit_celsius_strategy import ConverterStrategy
class ApplicationRunner:
def __init__(self, application):
self.application = application
def run(self):
self.application.init()
while not self.application.done:
self.application.idle()
... | [
"design_patterns.strategy.fahrenheit_celsius_strategy.ConverterStrategy"
] | [((430, 449), 'design_patterns.strategy.fahrenheit_celsius_strategy.ConverterStrategy', 'ConverterStrategy', ([], {}), '()\n', (447, 449), False, 'from design_patterns.strategy.fahrenheit_celsius_strategy import ConverterStrategy\n')] |
import json, os
labels = ['ID', '标题', '副标题', '总价', '总价单位', '均价', '小区名称', '所在区域', '房屋户型', '所在楼层', '建筑面积', '户型结构', '套内面积', '建筑类型',
'房屋朝向', '建筑结构', '装修情况', '梯户比例', '配备电梯', '产权年限', '挂牌时间', '交易权属', '上次交易', '房屋用途', '房屋年限', '产权所属', '抵押信息',
'房本备件', '房源标签', '税费解析', '交通出行', '核心卖点', '别墅类型', '售房详情', '周边配套', '... | [
"json.dump",
"json.load",
"os.listdir"
] | [((418, 435), 'os.listdir', 'os.listdir', (['path1'], {}), '(path1)\n', (428, 435), False, 'import json, os\n'), ((504, 519), 'json.load', 'json.load', (['file'], {}), '(file)\n', (513, 519), False, 'import json, os\n'), ((689, 709), 'json.dump', 'json.dump', (['tmp', 'file'], {}), '(tmp, file)\n', (698, 709), False, '... |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import os
import pandas as pd
from datetime import datetime, timedelta
from msrest.serialization import UTC
from azure.monitor.query import LogsQueryClient
from azure.identity import DefaultAzureCredential
credential = Defa... | [
"azure.monitor.query.LogsQueryClient",
"datetime.timedelta",
"pandas.DataFrame",
"azure.identity.DefaultAzureCredential"
] | [((316, 340), 'azure.identity.DefaultAzureCredential', 'DefaultAzureCredential', ([], {}), '()\n', (338, 340), False, 'from azure.identity import DefaultAzureCredential\n'), ((350, 377), 'azure.monitor.query.LogsQueryClient', 'LogsQueryClient', (['credential'], {}), '(credential)\n', (365, 377), False, 'from azure.moni... |
import pickle
dbfile = open('people-pickle', 'rb') # use binary mode files in 3.X
db = pickle.load(dbfile)
for key in db:
print(key, '=>\n ', db[key])
print(db['sue']['name'])
| [
"pickle.load"
] | [((103, 122), 'pickle.load', 'pickle.load', (['dbfile'], {}), '(dbfile)\n', (114, 122), False, 'import pickle\n')] |
import torch
import argparse
import os
import random
import numpy as np
from tensorboardX import SummaryWriter
from misc.utils import set_log, visualize
from torch.optim import SGD, Adam
from torch.nn.modules.loss import MSELoss
from inner_loop import InnerLoop
from omniglot_net import OmniglotNet
from score import *
f... | [
"numpy.random.seed",
"argparse.ArgumentParser",
"torch.nn.modules.loss.MSELoss",
"os.makedirs",
"torch.manual_seed",
"inner_loop.InnerLoop",
"misc.utils.set_log",
"os.path.exists",
"torch.cuda.manual_seed",
"omniglot_net.OmniglotNet",
"torch.cuda.manual_seed_all",
"misc.replay_buffer.ReplayBuf... | [((5202, 5215), 'misc.utils.set_log', 'set_log', (['args'], {}), '(args)\n', (5209, 5215), False, 'from misc.utils import set_log, visualize\n'), ((5241, 5263), 'random.seed', 'random.seed', (['args.seed'], {}), '(args.seed)\n', (5252, 5263), False, 'import random\n'), ((5268, 5293), 'numpy.random.seed', 'np.random.see... |
"""
733. Flood Fill
An image is represented by an m x n integer grid image where image[i][j] represents the pixel value of the image.
You are also given three integers sr, sc, and newColor. You should perform a flood fill on the image starting from the pixel image[sr][sc].
To perform a flood fill, consider the start... | [
"collections.deque"
] | [((1769, 1798), 'collections.deque', 'collections.deque', (['[(sr, sc)]'], {}), '([(sr, sc)])\n', (1786, 1798), False, 'import collections\n')] |
import time
import random
import requests
# def tieba_spider(keyword, page_start, page_end):
# url = 'https://tieba.baidu.com/f?kw={}&ie=utf-8&pn={}'
# headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64)'
# ' AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.163 Saf... | [
"random.randint",
"requests.get"
] | [((1290, 1333), 'requests.get', 'requests.get', ([], {'url': 'url', 'headers': 'self.headers'}), '(url=url, headers=self.headers)\n', (1302, 1333), False, 'import requests\n'), ((1953, 1973), 'random.randint', 'random.randint', (['(1)', '(3)'], {}), '(1, 3)\n', (1967, 1973), False, 'import random\n')] |
import numpy as np
from pandas import (
DataFrame,
IndexSlice,
)
class Render:
params = [[12, 24, 36], [12, 120]]
param_names = ["cols", "rows"]
def setup(self, cols, rows):
self.df = DataFrame(
np.random.randn(rows, cols),
columns=[f"float_{i+1}" for i in range(... | [
"pandas.DataFrame",
"numpy.random.randn"
] | [((2743, 2815), 'pandas.DataFrame', 'DataFrame', (['"""abc"""'], {'index': 'self.df.index[::2]', 'columns': 'self.df.columns[::2]'}), "('abc', index=self.df.index[::2], columns=self.df.columns[::2])\n", (2752, 2815), False, 'from pandas import DataFrame, IndexSlice\n'), ((240, 267), 'numpy.random.randn', 'np.random.ran... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from typing import List
from unittest.mock import patch
from unittest import TestCase
import genty
import numpy as np
fro... | [
"numpy.random.seed",
"genty.genty_dataset",
"numpy.testing.assert_almost_equal",
"numpy.zeros",
"unittest.mock.patch",
"numpy.testing.assert_equal",
"numpy.random.normal",
"numpy.all"
] | [((389, 660), 'genty.genty_dataset', 'genty.genty_dataset', ([], {'bragg': "('bragg', [2.93, 2.18, 2.35, 2.12, 31.53, 15.98, 226.69, 193.11])", 'morpho': "('morpho', [280.36, 52.96, 208.16, 72.69, 89.92, 60.37, 226.69, 193.11])", 'chirped': "('chirped', [280.36, 52.96, 104.08, 36.34, 31.53, 15.98, 226.69, 193.11])"}), ... |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe, erpnext
import frappe.defaults
from frappe import msgprint, _
from frappe.utils import cstr, flt, cint
from erpnext.controllers.stock_con... | [
"erpnext.accounts.utils.get_company_default",
"frappe.ValidationError",
"frappe.has_permission",
"erpnext.stock.doctype.item.item.validate_cancelled_item",
"erpnext.stock.doctype.batch.batch.get_batch_qty",
"erpnext.is_perpetual_inventory_enabled",
"frappe.bold",
"frappe.get_cached_value",
"erpnext.... | [((16167, 16185), 'frappe.whitelist', 'frappe.whitelist', ([], {}), '()\n', (16183, 16185), False, 'import frappe, erpnext\n'), ((17550, 17568), 'frappe.whitelist', 'frappe.whitelist', ([], {}), '()\n', (17566, 17568), False, 'import frappe, erpnext\n'), ((18385, 18403), 'frappe.whitelist', 'frappe.whitelist', ([], {})... |
import sqlite3
class sqdb3:
__ERROR_CODES = []
__CONNECTION_FLAG = False
def __init__(self):
self.ConnectDB()
def ConnectDB(self, dbname = "player_infos.db"):
self.__CONNECTION_FLAG = True
self.__connection = sqlite3.connect(dbname)
def DisconnectDB(self):
self.__CONN... | [
"sqlite3.connect"
] | [((249, 272), 'sqlite3.connect', 'sqlite3.connect', (['dbname'], {}), '(dbname)\n', (264, 272), False, 'import sqlite3\n')] |
#
# Copyright (C) [2020] Futurewei Technologies, Inc.
#
# FORCE-RISCV is 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
#
# THIS SOFTWARE IS PRO... | [
"RandomUtils.random32",
"base.GenThreadExecutor.GenThreadExecutorFactory.createGenThreadExecutor",
"importlib.import_module",
"Log.notice"
] | [((1984, 2106), 'base.GenThreadExecutor.GenThreadExecutorFactory.createGenThreadExecutor', 'GenThreadExecutorFactory.createGenThreadExecutor', (['(self.numberChips * self.numberCores * self.numberThreads)', 'interface'], {}), '(self.numberChips * self.\n numberCores * self.numberThreads, interface)\n', (2032, 2106),... |
from flask_restful import Resource
from flask import request
from prx.TrainProxy import TrainProxy
from prx.TestProxy import TestProxy
class TestApi(Resource):
def testPicture():
rtn = {'success':False}
_projectname = request.form.get('projectname')
if not _projectname:
rtn['err... | [
"prx.TestProxy.TestProxy.testDirectory",
"prx.TestProxy.TestProxy.testPicture",
"flask.request.form.get"
] | [((239, 270), 'flask.request.form.get', 'request.form.get', (['"""projectname"""'], {}), "('projectname')\n", (255, 270), False, 'from flask import request\n'), ((401, 424), 'flask.request.form.get', 'request.form.get', (['"""tag"""'], {}), "('tag')\n", (417, 424), False, 'from flask import request\n'), ((540, 564), 'f... |
__author__ = 'DafniAntotsiou'
import os
from pso import pso, particle2actuator
from functions import *
import mujoco_py as mp
from math import ceil
from mjviewerext import MjViewerExt
import glob
import argparse
from replay_trajectories import play
def argsparser():
parser = argparse.ArgumentParser("Implementati... | [
"mujoco_py.MjSim",
"pso.particle2actuator",
"os.path.abspath",
"mujoco_py.load_model_from_path",
"argparse.ArgumentParser",
"os.makedirs",
"os.path.basename",
"os.path.isdir",
"math.ceil",
"replay_trajectories.play",
"os.path.isfile",
"glob.glob",
"pso.pso",
"mjviewerext.MjViewerExt",
"o... | [((283, 370), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (['"""Implementation of Task Oriented Hand Motion Retargeting"""'], {}), "(\n 'Implementation of Task Oriented Hand Motion Retargeting')\n", (306, 370), False, 'import argparse\n'), ((8747, 8779), 'os.path.abspath', 'os.path.abspath', (['args.model_... |
import frappe
no_cache = 1
def get_context(context):
context.form_dict = frappe.form_dict
context.title = 'Service Providers'
context.gold_members = []
if frappe.form_dict.country:
context.parents = [dict(label='All Service Providers',
route='service-providers', title='All Service Providers')]
filters = di... | [
"frappe.get_all"
] | [((611, 719), 'frappe.get_all', 'frappe.get_all', (['"""Service Provider"""', '"""title, introduction, `image`, route, website_url, country"""', 'filters'], {}), "('Service Provider',\n 'title, introduction, `image`, route, website_url, country', filters)\n", (625, 719), False, 'import frappe\n'), ((1230, 1338), 'fr... |
from contextlib import contextmanager
from filecmp import cmp, dircmp
from pathlib import Path
from shutil import copyfile, copytree, rmtree
import pytest
from demisto_sdk.commands.common.constants import PACKS_DIR, TEST_PLAYBOOKS_DIR
from demisto_sdk.commands.common.logger import logging_setup
from demisto_sdk.comma... | [
"demisto_sdk.commands.common.tools.src_root",
"demisto_sdk.commands.create_artifacts.content_artifacts_creator.Pack",
"demisto_sdk.commands.common.content.Content",
"shutil.copytree",
"shutil.rmtree",
"TestSuite.test_tools.ChangeCWD",
"demisto_sdk.commands.create_artifacts.content_artifacts_creator.sign... | [((2532, 2548), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (2546, 2548), False, 'import pytest\n'), ((2804, 2820), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (2818, 2820), False, 'import pytest\n'), ((6746, 6815), 'pytest.mark.parametrize', 'pytest.mark.parametrize', ([], {'argnames': '"""suffix""... |
from weather import Weather, Unit
import inkyphat
from PIL import Image, ImageDraw, ImageFont
weather = Weather(unit=Unit.CELSIUS)
location = weather.lookup_by_location('west lafayette')
condition = location.condition
day, date, month, year, time, am_pm, zone = condition.date.split(" ")
inkyphat.set_colour("yellow")... | [
"inkyphat.set_colour",
"inkyphat.set_border",
"PIL.Image.open",
"PIL.ImageFont.truetype",
"PIL.ImageDraw.Draw",
"inkyphat.show",
"inkyphat.set_image",
"weather.Weather"
] | [((105, 131), 'weather.Weather', 'Weather', ([], {'unit': 'Unit.CELSIUS'}), '(unit=Unit.CELSIUS)\n', (112, 131), False, 'from weather import Weather, Unit\n'), ((291, 320), 'inkyphat.set_colour', 'inkyphat.set_colour', (['"""yellow"""'], {}), "('yellow')\n", (310, 320), False, 'import inkyphat\n'), ((321, 356), 'inkyph... |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
# File : functional.py
# Author : <NAME>
# Email : <EMAIL>
# Date : 03/03/2018
#
# This file is part of Jacinle.
# Distributed under terms of the MIT license.
import math
from PIL import Image
import numpy as np
import torchvision.transforms.functional as TF
impor... | [
"numpy.ones_like",
"torchvision.transforms.functional.rotate",
"torchvision.transforms.functional.hflip",
"math.radians",
"math.ceil",
"jactorch.transforms.image.functional.pad",
"torchvision.transforms.functional.resize",
"math.floor",
"math.sin",
"torchvision.transforms.functional.crop",
"nump... | [((978, 1002), 'jacinle.utils.argument.get_2dshape', 'get_2dshape', (['output_size'], {}), '(output_size)\n', (989, 1002), False, 'from jacinle.utils.argument import get_2dshape\n'), ((1454, 1500), 'jactorch.transforms.image.functional.pad', 'jac_tf.pad', (['img', 'padding'], {'mode': 'mode', 'fill': 'fill'}), '(img, p... |
from engine.Database import db
from prettytable import PrettyTable
from utils import GeneralHelper
class Project:
def __init__(self, ref, name=None, database=None):
self.ref_name = GeneralHelper.prepare_string(ref)
if name:
self.name = GeneralHelper.prepare_name(name)
self.nam... | [
"utils.GeneralHelper.prepare_string",
"utils.GeneralHelper.prepare_name"
] | [((196, 229), 'utils.GeneralHelper.prepare_string', 'GeneralHelper.prepare_string', (['ref'], {}), '(ref)\n', (224, 229), False, 'from utils import GeneralHelper\n'), ((271, 303), 'utils.GeneralHelper.prepare_name', 'GeneralHelper.prepare_name', (['name'], {}), '(name)\n', (297, 303), False, 'from utils import GeneralH... |
# Copyright (c) 2016 Mirantis, 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... | [
"six.itervalues"
] | [((2192, 2227), 'six.itervalues', 'six.itervalues', (['attribute_remapping'], {}), '(attribute_remapping)\n', (2206, 2227), False, 'import six\n')] |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import ... | [
"pulumi.get",
"pulumi.getter",
"pulumi.ResourceOptions",
"pulumi.set"
] | [((1852, 1882), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""clientId"""'}), "(name='clientId')\n", (1865, 1882), False, 'import pulumi\n'), ((2113, 2150), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""clientSecretKey"""'}), "(name='clientSecretKey')\n", (2126, 2150), False, 'import pulumi\n'), ((2421, 246... |
#%%
import requests
# url = "http://1172.16.31.10"
url = "http://192.168.1.10"
# data = bytes("connection\r\n")
data = "connection\r\n"
res = requests.post(url=url,
data=data,
headers={'Content-Type': 'text/plain'})
print(res.text)
# %%
import requests
res = requests.post(url... | [
"requests.post"
] | [((142, 215), 'requests.post', 'requests.post', ([], {'url': 'url', 'data': 'data', 'headers': "{'Content-Type': 'text/plain'}"}), "(url=url, data=data, headers={'Content-Type': 'text/plain'})\n", (155, 215), False, 'import requests\n'), ((303, 723), 'requests.post', 'requests.post', ([], {'url': '"""http://192.168.1.5... |
"""opdelete module
Implementation of "delete" operation for "realtime" etl process for
transferring data from MongoDB nested collections to PostgreSQL flat data
with using pregenerated schema and tailing records (events) in oplog.rs
collection.
How to use:
del = op_delete_stmts(dbreq, schema, path, str_id, datab... | [
"gizer.util.get_last_idx_from_path",
"gizer.util.get_table_name_from_list",
"gizer.util.get_indexes_dictionary_idx",
"gizer.util.get_ids_list",
"gizer.util.get_root_table_from_path",
"gizer.util.get_table_name_schema",
"gizer.util.get_idx_column_name_from_list"
] | [((2959, 2991), 'gizer.util.get_indexes_dictionary_idx', 'get_indexes_dictionary_idx', (['path'], {}), '(path)\n', (2985, 2991), False, 'from gizer.util import get_idx_column_name_from_list, SELECT_TMPLT, UPDATE_TMPLT, DELETE_TMPLT, get_indexes_dictionary_idx, get_root_table_from_path, get_ids_list, get_table_name_from... |
# -*- encoding: utf-8 -*-
'''
Emacs Behavior
==============
The :class:`~kivy.uix.behaviors.emacs.EmacsBehavior`
`mixin <https://en.wikipedia.org/wiki/Mixin>`_ allows you to add
`Emacs <https://www.gnu.org/software/emacs/>`_ keyboard shortcuts for basic
movement and editing to the :class:`~kivy.uix.textinput.TextInput... | [
"kivy.properties.StringProperty"
] | [((1996, 2019), 'kivy.properties.StringProperty', 'StringProperty', (['"""emacs"""'], {}), "('emacs')\n", (2010, 2019), False, 'from kivy.properties import StringProperty\n')] |
from sklearn.tree import DecisionTreeRegressor
from sklearn.ensemble import RandomForestRegressor
from sklearn.ensemble import GradientBoostingRegressor
from sklearn.ensemble import AdaBoostRegressor
from sklearn.model_selection import train_test_split, cross_val_score
from sklearn.model_selection import GridSearchCV
... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.axhline",
"sklearn.model_selection.GridSearchCV",
"sklearn.model_selection.cross_val_score",
"numpy.zeros",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.subplots",
"sklearn.metrics.mean_squared_error",
"numpy.sqrt"
] | [((2361, 2414), 'numpy.zeros', 'np.zeros', (['(estimator.n_estimators,)'], {'dtype': 'np.float64'}), '((estimator.n_estimators,), dtype=np.float64)\n', (2369, 2414), True, 'import numpy as np\n'), ((2433, 2486), 'numpy.zeros', 'np.zeros', (['(estimator.n_estimators,)'], {'dtype': 'np.float64'}), '((estimator.n_estimato... |
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
"torch.ones",
"third_party.models.base_model.BaseModel.__init__"
] | [((1061, 1090), 'third_party.models.base_model.BaseModel.__init__', 'BaseModel.__init__', (['self', 'opt'], {}), '(self, opt)\n', (1079, 1090), False, 'from third_party.models.base_model import BaseModel\n'), ((2240, 2335), 'torch.ones', 'torch.ones', (['pred_uv.shape[0]', '(2)', 'pred_uv.shape[2]', 'pred_uv.shape[3]']... |
from django.db import models
# Create your models here.
# class Essay(models.Model):
# score = models.IntegerField()
# essayA = models.TextField()
# essayQ = models.TextField()
# name = models.CharField(max_length=20)
#
# def __str__(self):
# return self.score
class choice(models.Model):... | [
"django.db.models.DecimalField",
"django.db.models.TextField",
"django.db.models.IntegerField"
] | [((334, 352), 'django.db.models.TextField', 'models.TextField', ([], {}), '()\n', (350, 352), False, 'from django.db import models\n'), ((362, 383), 'django.db.models.IntegerField', 'models.IntegerField', ([], {}), '()\n', (381, 383), False, 'from django.db import models\n'), ((393, 411), 'django.db.models.TextField', ... |
"""Unit tests for the OpenVAS source."""
from datetime import datetime, timezone
import unittest
from unittest.mock import Mock, patch
from src.collector import MetricCollector
class OpenVASTest(unittest.TestCase):
"""Unit tests for the OpenVAS metrics."""
def setUp(self):
self.mock_response = Mock... | [
"unittest.mock.Mock",
"datetime.datetime",
"unittest.mock.patch",
"src.collector.MetricCollector",
"datetime.datetime.now"
] | [((316, 322), 'unittest.mock.Mock', 'Mock', ([], {}), '()\n', (320, 322), False, 'from unittest.mock import Mock, patch\n'), ((947, 1001), 'unittest.mock.patch', 'patch', (['"""requests.get"""'], {'return_value': 'self.mock_response'}), "('requests.get', return_value=self.mock_response)\n", (952, 1001), False, 'from un... |
from django.urls import path
from blog_app01 import views
urlpatterns = [
path('index/', views.index),
path('login/', views.login),
path('regist/', views.regist),
path('valid_img/', views.valid_img),
]
| [
"django.urls.path"
] | [((79, 106), 'django.urls.path', 'path', (['"""index/"""', 'views.index'], {}), "('index/', views.index)\n", (83, 106), False, 'from django.urls import path\n'), ((112, 139), 'django.urls.path', 'path', (['"""login/"""', 'views.login'], {}), "('login/', views.login)\n", (116, 139), False, 'from django.urls import path\... |
"""
Name: SampleEvent
breif: Samples events for particles provided in a phase space for MCDC-TNT
Author: <NAME> (OR State Univ - <EMAIL>) CEMeNT
Date: Dec 2nd 2021
"""
import numpy as np
import pykokkos as pk
@pk.workload
class SampleEvent:
def __init__(self, p_mesh_cell, p_alive, mesh_cap_xsec, mesh_scat_xsec, me... | [
"pykokkos.printf",
"numpy.zeros",
"numpy.ones",
"pykokkos.from_numpy",
"numpy.array"
] | [((3753, 3791), 'numpy.array', 'np.array', (['[0, 1, 0, 5]'], {'dtype': 'np.int32'}), '([0, 1, 0, 5], dtype=np.int32)\n', (3761, 3791), True, 'import numpy as np\n'), ((3807, 3845), 'numpy.array', 'np.array', (['[1, 1, 1, 0]'], {'dtype': 'np.int32'}), '([1, 1, 1, 0], dtype=np.int32)\n', (3815, 3845), True, 'import nump... |
import torch
from torch.nn import Parameter
import torch.nn.functional as F
from torch_geometric.nn.conv import MessagePassing
from torch_geometric.utils import remove_self_loops
from torch_geometric.nn.inits import glorot, zeros
class KGCNConv(MessagePassing):
def __init__(
self, in_channels, out_ch... | [
"torch_geometric.nn.inits.zeros",
"torch_geometric.nn.inits.glorot",
"torch.mm",
"torch.Tensor",
"torch_geometric.utils.remove_self_loops",
"torch.is_tensor"
] | [((860, 879), 'torch_geometric.nn.inits.glorot', 'glorot', (['self.weight'], {}), '(self.weight)\n', (866, 879), False, 'from torch_geometric.nn.inits import glorot, zeros\n'), ((888, 904), 'torch_geometric.nn.inits.zeros', 'zeros', (['self.bias'], {}), '(self.bias)\n', (893, 904), False, 'from torch_geometric.nn.inits... |
import json
from django.apps import apps
from django.contrib.auth import get_user_model
from django.core.exceptions import ObjectDoesNotExist
from django.core.serializers.json import DjangoJSONEncoder
from django.db.models import TextField
from django.db.models.functions import Cast
from django.template.defaultfilters... | [
"django.db.models.TextField",
"pyston.utils.decorators.filter_by",
"django.apps.apps.get_app_configs",
"django.contrib.auth.get_user_model",
"json.dumps",
"django.contrib.contenttypes.models.ContentType.objects.get_for_model",
"django.template.defaultfilters.truncatechars",
"pyston.utils.decorators.or... | [((1299, 1369), 'json.dumps', 'json.dumps', (['value'], {'indent': '(4)', 'ensure_ascii': '(False)', 'cls': 'DjangoJSONEncoder'}), '(value, indent=4, ensure_ascii=False, cls=DjangoJSONEncoder)\n', (1309, 1369), False, 'import json\n'), ((1795, 1860), 'is_core.utils.render_model_objects_with_link', 'render_model_objects... |
import os
from argparse import ArgumentParser
from imgtools.io import (ImageFileLoader, ImageFileWriter,
read_dicom_rtstruct, read_dicom_series, read_dicom_rtdose, read_dicom_pet)
from imgtools.ops import StructureSetToSegmentation, ImageFileInput, ImageFileOutput, Resample
from imgtools.pipel... | [
"imgtools.ops.ImageFileInput",
"argparse.ArgumentParser",
"imgtools.ops.Resample",
"os.path.join",
"imgtools.ops.StructureSetToSegmentation"
] | [((5497, 5551), 'argparse.ArgumentParser', 'ArgumentParser', (['"""Example RADCURE processing pipeline."""'], {}), "('Example RADCURE processing pipeline.')\n", (5511, 5551), False, 'from argparse import ArgumentParser\n'), ((1486, 1622), 'imgtools.ops.ImageFileInput', 'ImageFileInput', (['self.input_directory'], {'get... |
import logging
logging.basicConfig(format='%(levelname)s::%(module)s(l%(lineno)s)::%(funcName)s::%(message)s')
| [
"logging.basicConfig"
] | [((16, 116), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(levelname)s::%(module)s(l%(lineno)s)::%(funcName)s::%(message)s"""'}), "(format=\n '%(levelname)s::%(module)s(l%(lineno)s)::%(funcName)s::%(message)s')\n", (35, 116), False, 'import logging\n')] |