code stringlengths 20 1.04M | apis list | extract_api stringlengths 75 9.94M |
|---|---|---|
import uuid
from codecs import decode, encode
from enum import Enum
from serdepa import Array, List, nx_uint8, nx_uint32, nx_int32, nx_int64
from moteannouncement.deva_packets import base
from moteannouncement.utils import chunk, strtime
class RadioTechnologies(Enum):
UNKNOWN = 0
IEEE_802_15_4 = 1
BLE ... | [
"serdepa.List",
"uuid.UUID",
"moteannouncement.utils.chunk",
"serdepa.Array",
"moteannouncement.utils.strtime"
] | [((1099, 1117), 'serdepa.Array', 'Array', (['nx_uint8', '(8)'], {}), '(nx_uint8, 8)\n', (1104, 1117), False, 'from serdepa import Array, List, nx_uint8, nx_uint32, nx_int32, nx_int64\n'), ((1309, 1328), 'serdepa.Array', 'Array', (['nx_uint8', '(16)'], {}), '(nx_uint8, 16)\n', (1314, 1328), False, 'from serdepa import A... |
import gzip
import json
import threading
import time
import os
import os.path
import traceback
from glob import glob
import socket
import pytest
import io
import sys
try:
from urllib2 import urlopen, HTTPError
except ImportError:
from urllib.request import urlopen, HTTPError
import flask
class LiveServer(ob... | [
"threading.Thread",
"io.BytesIO",
"json.load",
"traceback.format_exception",
"pytest.yield_fixture",
"os.unlink",
"flask.Flask",
"socket.socket",
"pytest.fixture",
"flask.abort",
"time.sleep",
"flask.request.environ.get",
"json.dumps",
"sys.exc_info",
"glob.glob",
"gzip.GzipFile"
] | [((2053, 2091), 'pytest.yield_fixture', 'pytest.yield_fixture', ([], {'scope': '"""function"""'}), "(scope='function')\n", (2073, 2091), False, 'import pytest\n'), ((3144, 3176), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""function"""'}), "(scope='function')\n", (3158, 3176), False, 'import pytest\n'), ((254... |
#!/usr/local/bin/python3.6
from ipico.reader import FileReader
from datetime import datetime, timedelta
from Grouper import Grouper
from ipico import TagFactory
def main():
"""
device = usb.core.find(idVendor=0x0483, idProduct=0x3490)
# use the first/default configuration
device.set_configuration()
... | [
"ipico.reader.FileReader"
] | [((502, 522), 'ipico.reader.FileReader', 'FileReader', (['"""finish"""'], {}), "('finish')\n", (512, 522), False, 'from ipico.reader import FileReader\n')] |
import sys
import unittest
import smuthi.initial_field as init
import smuthi.particles as part
import smuthi.simulation as simul
import smuthi.layers as lay
import smuthi.postprocessing.scattered_field as sf
import smuthi.utility.cuda as cu
import numpy as np
class TestNearFieldCUDA(unittest.TestCase):
def testE... | [
"unittest.main",
"smuthi.postprocessing.scattered_field.scattered_field_piecewise_expansion",
"smuthi.utility.cuda.enable_gpu",
"smuthi.initial_field.DipoleSource",
"sys.modules.keys",
"numpy.array",
"numpy.linalg.norm",
"smuthi.particles.Sphere",
"smuthi.layers.LayerSystem"
] | [((3138, 3153), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3151, 3153), False, 'import unittest\n'), ((805, 906), 'smuthi.particles.Sphere', 'part.Sphere', ([], {'position': '[200, 200, 300]', 'refractive_index': '(2.4 + 0.0j)', 'radius': '(110)', 'l_max': '(3)', 'm_max': '(3)'}), '(position=[200, 200, 300], ... |
# -*- encoding:utf-8 -*-
import pandas as pd
import numpy as np
import datetime
# from datetime import datetime
dire = '../../data/'
start = datetime.datetime.now()
orderHistory_train = pd.read_csv(dire + 'train/orderHistory_train.csv', encoding='utf-8')
orderFuture_train = pd.read_csv(dire + 'train/orderFuture_train... | [
"pandas.read_csv",
"datetime.datetime.now"
] | [((143, 166), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (164, 166), False, 'import datetime\n'), ((188, 256), 'pandas.read_csv', 'pd.read_csv', (["(dire + 'train/orderHistory_train.csv')"], {'encoding': '"""utf-8"""'}), "(dire + 'train/orderHistory_train.csv', encoding='utf-8')\n", (199, 256),... |
'''
Since the tool is tested as a black box, we could just write a single
test that runs over all the input files and verifies that converting them
produces the output files.
However we've chosen instead to generate tests. This has the advantage of
allowing us to have the test output interpreted by any CI system, run ... | [
"os.mkdir",
"optparse.OptionParser",
"os.path.basename",
"os.path.isdir",
"os.walk",
"os.path.relpath",
"os.path.splitext",
"os.path.join",
"os.listdir"
] | [((4806, 4829), 'optparse.OptionParser', 'optparse.OptionParser', ([], {}), '()\n', (4827, 4829), False, 'import optparse\n'), ((5185, 5235), 'os.path.join', 'os.path.join', (['options.fbcode_dir', 'options.code_dir'], {}), '(options.fbcode_dir, options.code_dir)\n', (5197, 5235), False, 'import os\n'), ((5281, 5319), ... |
# !/usr/bin/env python
# coding: utf-8
from contextlib import contextmanager
import functools
from flask import Blueprint
from flask import g
from flask import jsonify
from flask import Response
__author__ = 'zhouhenglc'
@contextmanager
def _context_func(*args):
yield None
class View(Blueprint):
jinja_en... | [
"flask.Blueprint.add_url_rule",
"flask.jsonify",
"functools.wraps"
] | [((567, 593), 'functools.wraps', 'functools.wraps', (['view_func'], {}), '(view_func)\n', (582, 593), False, 'import functools\n'), ((992, 1054), 'flask.Blueprint.add_url_rule', 'Blueprint.add_url_rule', (['self', 'rule', 'endpoint', 'inner'], {}), '(self, rule, endpoint, inner, **options)\n', (1014, 1054), False, 'fro... |
"""
Verifies that kext bundles are built correctly.
"""
import TestGyp
test = TestGyp.TestGyp(formats=['xcode'], platforms=['darwin'])
test.run_gyp('kext.gyp', chdir='kext')
test.build('kext.gyp', test.ALL, chdir='kext')
test.built_file_must_exist('GypKext.kext/Contents/MacOS/GypKext', chdir='kext')
test.built_file_m... | [
"TestGyp.TestGyp"
] | [((80, 136), 'TestGyp.TestGyp', 'TestGyp.TestGyp', ([], {'formats': "['xcode']", 'platforms': "['darwin']"}), "(formats=['xcode'], platforms=['darwin'])\n", (95, 136), False, 'import TestGyp\n')] |
# The MIT license:
#
# Copyright 2017 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge... | [
"deep_learning.CModel",
"deep_driving.model.cifar.CMerger",
"deep_learning.printer.CProgressPrinter"
] | [((2169, 2195), 'deep_learning.CModel', 'dl.CModel', (['cifar.CCifarNet'], {}), '(cifar.CCifarNet)\n', (2178, 2195), True, 'import deep_learning as dl\n'), ((2316, 2395), 'deep_learning.printer.CProgressPrinter', 'dl.printer.CProgressPrinter', ([], {'LossName': '"""Loss/Loss"""', 'ErrorName': '"""ClassError/Error"""'})... |
import os
from robot.rebot import rebot
from robot.api import ExecutionResult, ResultVisitor
from tkinter import filedialog, Tk, messagebox
class RobotReportGenerator:
@staticmethod
def get_root_folder():
root = Tk()
root.withdraw()
return filedialog.askdirectory(title="Please select... | [
"os.getcwd",
"os.walk",
"robot.api.ExecutionResult",
"tkinter.filedialog.askdirectory",
"os.path.join",
"tkinter.Tk"
] | [((232, 236), 'tkinter.Tk', 'Tk', ([], {}), '()\n', (234, 236), False, 'from tkinter import filedialog, Tk, messagebox\n'), ((276, 343), 'tkinter.filedialog.askdirectory', 'filedialog.askdirectory', ([], {'title': '"""Please select output report folder"""'}), "(title='Please select output report folder')\n", (299, 343)... |
from celery.utils.log import get_task_logger
import datetime
from flask.ext.mail import Message
import hipchat
import requests
from redash.utils import json_dumps
from requests.auth import HTTPBasicAuth
from redash.worker import celery
from redash import utils, mail
from redash import models, settings
from .base import... | [
"redash.utils.utcnow",
"redash.wsgi.app.app_context",
"hipchat.HipChat",
"redash.worker.celery.task",
"datetime.timedelta",
"celery.utils.log.get_task_logger",
"redash.models.Query.get_by_id",
"requests.auth.HTTPBasicAuth",
"redash.utils.json_dumps",
"redash.mail.send"
] | [((341, 366), 'celery.utils.log.get_task_logger', 'get_task_logger', (['__name__'], {}), '(__name__)\n', (356, 366), False, 'from celery.utils.log import get_task_logger\n'), ((507, 593), 'redash.worker.celery.task', 'celery.task', ([], {'name': '"""redash.tasks.check_alerts_for_query"""', 'bind': '(True)', 'base': 'Ba... |
"""
An example showing how to set the Image title on a jpeg file.
"""
import pexif
# Modify the exif in a file
img = pexif.JpegFile.fromFile("test/data/rose.jpg")
img.exif.primary.ImageDescription = "Hello world!"
img.writeFile("hello1.jpg")
# Add exif in a file
img = pexif.JpegFile.fromFile("test/data/noexif.jpg"... | [
"pexif.JpegFile.fromFile"
] | [((120, 165), 'pexif.JpegFile.fromFile', 'pexif.JpegFile.fromFile', (['"""test/data/rose.jpg"""'], {}), "('test/data/rose.jpg')\n", (143, 165), False, 'import pexif\n'), ((274, 321), 'pexif.JpegFile.fromFile', 'pexif.JpegFile.fromFile', (['"""test/data/noexif.jpg"""'], {}), "('test/data/noexif.jpg')\n", (297, 321), Fal... |
from django.urls import path
from .views import delete_investidor, list_investidores, create_investidor, update_investidor, delete_investidor
urlpatterns = [
path('', list_investidores, name='list_investidores'),
path('new', create_investidor, name='create_investidor'),
path('update/<int:id>/', update_inve... | [
"django.urls.path"
] | [((163, 216), 'django.urls.path', 'path', (['""""""', 'list_investidores'], {'name': '"""list_investidores"""'}), "('', list_investidores, name='list_investidores')\n", (167, 216), False, 'from django.urls import path\n'), ((222, 278), 'django.urls.path', 'path', (['"""new"""', 'create_investidor'], {'name': '"""create... |
import twitter_credentials
import tweepy
from tweepy import API
from tweepy import Cursor
from tweepy import Stream
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import re
import csv
import nltk
from textblob import TextBlob
from sklearn.tree import DecisionTreeClassifier
fr... | [
"tweepy.OAuthHandler",
"tweepy.Cursor",
"tweepy.API"
] | [((639, 734), 'tweepy.OAuthHandler', 'tweepy.OAuthHandler', (['twitter_credentials.CONSUMER_KEY', 'twitter_credentials.CONSUMER_SECRET'], {}), '(twitter_credentials.CONSUMER_KEY, twitter_credentials.\n CONSUMER_SECRET)\n', (658, 734), False, 'import tweepy\n'), ((1023, 1094), 'tweepy.API', 'API', (['self.auth'], {'w... |
#!/usr/bin/env python
"""
author: <NAME>
email: <EMAIL>
"""
import os
import torch
import random
import linecache
import pickle
import json
import logging
from typing import List
from torch.utils.data import Dataset
import src.constants as C
logger = logging.getLogger()
class Parser(object):
def __init__(sel... | [
"json.dump",
"os.remove",
"json.load",
"linecache.getline",
"torch.utils.data.DataLoader",
"torch.LongTensor",
"random.randint",
"torch.FloatTensor",
"os.path.exists",
"pickle.load",
"os.path.join",
"logging.getLogger"
] | [((256, 275), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (273, 275), False, 'import logging\n'), ((9179, 9278), 'torch.utils.data.DataLoader', 'DataLoader', (['dataset'], {'batch_size': '(3)', 'shuffle': '(False)', 'drop_last': '(False)', 'collate_fn': 'processor.process'}), '(dataset, batch_size=3, sh... |
# -*- coding: utf-8 -*-
# Copyright (c) 2016-2019 by University of Kassel and Fraunhofer Institute for Energy Economics
# and Energy System Technology (IEE), Kassel. All rights reserved.
import os
import numpy as np
import pytest
import pandapower as pp
import pandapower.networks as nw
from pandapower.estimation i... | [
"pandapower.networks.case118",
"copy.deepcopy",
"pandapower.estimation.ppc_conversion.pp2eppci",
"pandapower.networks.case30",
"numpy.allclose",
"pandapower.estimation.algorithm.estimator.SHGMEstimatorIRWLS",
"pandapower.estimation.util.add_virtual_meas_from_loadflow",
"pytest.main",
"pandapower.run... | [((1214, 1225), 'pandapower.networks.case14', 'nw.case14', ([], {}), '()\n', (1223, 1225), True, 'import pandapower.networks as nw\n'), ((1230, 1243), 'pandapower.runpp', 'pp.runpp', (['net'], {}), '(net)\n', (1238, 1243), True, 'import pandapower as pp\n'), ((1248, 1283), 'pandapower.estimation.util.add_virtual_meas_f... |
#################################################################
# WARNING: Auto-Generated File
# This file was generated by a tool(py/pyis-torch/code_gen.py)
# Any changes made to it will be overwritten when regenerated
#################################################################
# Copyright (c) ... | [
"unittest.main",
"pyis.torch.ops.BertTokenizer",
"transformers.BertTokenizer.from_pretrained",
"os.makedirs"
] | [((1542, 1557), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1555, 1557), False, 'import unittest\n'), ((568, 597), 'os.makedirs', 'os.makedirs', (['"""tmp"""', '(511)', '(True)'], {}), "('tmp', 511, True)\n", (579, 597), False, 'import os\n'), ((615, 678), 'transformers.BertTokenizer.from_pretrained', 'transfo... |
from typing import Optional, List
import numpy
from pyrr import Matrix44, Vector3
from vistas.core.bounds import BoundingBox
from vistas.core.graphics.object import Object3D, Intersection
class Ray:
"""
Representation of a ray in 3D space. Rays emit from an origin along a direction. Implementation inspired ... | [
"pyrr.Vector3",
"numpy.sum",
"numpy.cross",
"numpy.finfo",
"numpy.where",
"numpy.array",
"pyrr.Matrix44.from_translation"
] | [((2678, 2705), 'numpy.array', 'numpy.array', (['self.direction'], {}), '(self.direction)\n', (2689, 2705), False, 'import numpy\n'), ((2723, 2747), 'numpy.array', 'numpy.array', (['self.origin'], {}), '(self.origin)\n', (2734, 2747), False, 'import numpy\n'), ((2809, 2835), 'numpy.cross', 'numpy.cross', (['direction',... |
from tkinter import *
from tkvideoutils import VideoRecorder
from tkinter import messagebox
if __name__ == '__main__':
# create instance of window
root = Tk()
# set window title
root.title('Video Player')
# load images
pause_image = PhotoImage(file='pause.png')
play_image = PhotoImage(file... | [
"tkvideoutils.VideoRecorder",
"tkinter.messagebox.showwarning",
"tkvideoutils.VideoRecorder.get_sources"
] | [((578, 605), 'tkvideoutils.VideoRecorder.get_sources', 'VideoRecorder.get_sources', ([], {}), '()\n', (603, 605), False, 'from tkvideoutils import VideoRecorder\n'), ((718, 822), 'tkvideoutils.VideoRecorder', 'VideoRecorder', ([], {'source': 'video_sources[0]', 'path': 'video_path', 'fps': '(30)', 'label': 'video_labe... |
import os
import sys
from concurrent.futures import Future, ThreadPoolExecutor
from unittest.mock import MagicMock, call, create_autospec
import pytest
from pyfakefs.fake_filesystem import FakeFilesystem
from pytest_mock import MockFixture
import abridge.cli
from abridge.cli import _shutdown, main
from abridge.proces... | [
"unittest.mock.create_autospec",
"concurrent.futures.Future",
"abridge.cli.main",
"os.path.isdir",
"pytest.raises",
"abridge.cli._shutdown",
"unittest.mock.call"
] | [((620, 640), 'unittest.mock.create_autospec', 'create_autospec', (['set'], {}), '(set)\n', (635, 640), False, 'from unittest.mock import MagicMock, call, create_autospec\n'), ((663, 671), 'concurrent.futures.Future', 'Future', ([], {}), '()\n', (669, 671), False, 'from concurrent.futures import Future, ThreadPoolExecu... |
from sgcn import SignedGCNTrainer
from parser import parameter_parser
from utils import tab_printer, read_graph, score_printer, save_logs
def main():
"""
Parsing command line parameters.
Creating target matrix.
Fitting an SGCN.
Predicting edge signs and saving the embedding.
"""
args = para... | [
"utils.tab_printer",
"utils.score_printer",
"parser.parameter_parser",
"utils.read_graph",
"utils.save_logs",
"sgcn.SignedGCNTrainer"
] | [((316, 334), 'parser.parameter_parser', 'parameter_parser', ([], {}), '()\n', (332, 334), False, 'from parser import parameter_parser\n'), ((339, 356), 'utils.tab_printer', 'tab_printer', (['args'], {}), '(args)\n', (350, 356), False, 'from utils import tab_printer, read_graph, score_printer, save_logs\n'), ((369, 385... |
#!/usr/bin/python
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Commands to support cros_gestures
This code is modeled after and derived from the Command class in
gsutil/gslib/command.py for m... | [
"optparse.OptionGroup",
"hashlib.md5",
"os.path.join",
"os.makedirs",
"os.path.basename",
"cros_gestures_utils.RunGSUtil",
"os.path.exists",
"re.match",
"os.path.isfile",
"datetime.datetime.strptime",
"exception.CrosGesturesException",
"sys.stderr.write",
"re.sub",
"cros_gestures_utils.Col... | [((569, 596), 'cros_gestures_utils.Color', 'cros_gestures_utils.Color', ([], {}), '()\n', (594, 596), False, 'import cros_gestures_utils\n'), ((604, 647), 'logging.getLogger', 'logging.getLogger', (['"""cros_gestures_commands"""'], {}), "('cros_gestures_commands')\n", (621, 647), False, 'import logging\n'), ((1547, 159... |
import random
import subprocess
from itertools import cycle
from time import sleep
from platform import system
# Change the piactl path if executing on Windows
piapath = "piactl"
if system()=='Windows':
piapath = "C:\Program Files\Private Internet Access\piactl.exe"
class PiaVpn:
def __init__(self):
p... | [
"subprocess.run",
"random.choice",
"time.sleep",
"platform.system",
"itertools.cycle"
] | [((183, 191), 'platform.system', 'system', ([], {}), '()\n', (189, 191), False, 'from platform import system\n'), ((497, 549), 'subprocess.run', 'subprocess.run', (['cmd'], {'shell': '(True)', 'capture_output': '(True)'}), '(cmd, shell=True, capture_output=True)\n', (511, 549), False, 'import subprocess\n'), ((965, 101... |
#!/usr/bin/python3
import flask
import sys
import argparse
import json
import os
import subprocess
import hashlib
import hmac
app = flask.Flask("webhook-listener")
app.config["EXEC_CONFIG"] = "webhook.config"
TOKEN_HEADER = "X-Gitlab-Token"
PROJECT_IDENTIFIER = "web_url"
SEPERATOR = ","
COMMENT_INDICATOR ... | [
"subprocess.Popen",
"argparse.ArgumentParser",
"flask.Flask",
"json.dumps",
"os.path.expanduser"
] | [((133, 164), 'flask.Flask', 'flask.Flask', (['"""webhook-listener"""'], {}), "('webhook-listener')\n", (144, 164), False, 'import flask\n'), ((3289, 3319), 'os.path.expanduser', 'os.path.expanduser', (['scriptName'], {}), '(scriptName)\n', (3307, 3319), False, 'import os\n'), ((3324, 3346), 'subprocess.Popen', 'subpro... |
import numpy
def merge_times(time1,time2):
"""
merge two time vectors and remove duplicates
"""
times = numpy.append(time1,time2)
resortIndices = numpy.argsort(times)
times = times[resortIndices]
diff = numpy.diff(times)
diff = numpy.append([1],diff)# the diff has one less, so we ... | [
"numpy.full",
"numpy.load",
"numpy.copy",
"numpy.isscalar",
"numpy.asarray",
"numpy.searchsorted",
"numpy.isfinite",
"numpy.insert",
"numpy.argsort",
"numpy.append",
"numpy.isnan",
"numpy.diff",
"numpy.arange",
"numpy.where",
"numpy.linspace",
"numpy.interp",
"numpy.savez"
] | [((127, 153), 'numpy.append', 'numpy.append', (['time1', 'time2'], {}), '(time1, time2)\n', (139, 153), False, 'import numpy\n'), ((173, 193), 'numpy.argsort', 'numpy.argsort', (['times'], {}), '(times)\n', (186, 193), False, 'import numpy\n'), ((238, 255), 'numpy.diff', 'numpy.diff', (['times'], {}), '(times)\n', (248... |
"""
Functions for assembling a minimal Python package in a temporary
directory and upload it to PyPI, so that the package name can be
registered as belonging to the author (while they develope the
codebase).
"""
import re
from pathlib import Path
from shutil import move, rmtree
from subprocess import CalledProcessError... | [
"subprocess.run",
"pathlib.Path",
"tempfile.mkdtemp",
"re.findall",
"shutil.rmtree"
] | [((2213, 2229), 'tempfile.mkdtemp', 'mkdtemp', ([], {'dir': 'cwd'}), '(dir=cwd)\n', (2220, 2229), False, 'from tempfile import mkdtemp\n'), ((2250, 2264), 'pathlib.Path', 'Path', (['temp_dir'], {}), '(temp_dir)\n', (2254, 2264), False, 'from pathlib import Path\n'), ((2643, 2731), 'subprocess.run', 'run', (["['python3'... |
import h5py
import numpy as np
import os
from Utils.ObjHelper import writeObj
from Utils.Commonutils import createDirectory
def SkeletonObjGenerator():
unNormalizedSkeletonFile = '/mnt/korhal_home/masterThesis/wordAreGlosses/wacv2020/data/demo/keypoints/PHOENIX-2014-T-01-dev_filter_10.h5'
NormalizedSkeletonFi... | [
"Utils.ObjHelper.writeObj",
"h5py.File",
"os.path.join",
"Utils.Commonutils.createDirectory"
] | [((555, 595), 'h5py.File', 'h5py.File', (['unNormalizedSkeletonFile', '"""r"""'], {}), "(unNormalizedSkeletonFile, 'r')\n", (564, 595), False, 'import h5py\n'), ((615, 653), 'h5py.File', 'h5py.File', (['NormalizedSkeletonFile', '"""r"""'], {}), "(NormalizedSkeletonFile, 'r')\n", (624, 653), False, 'import h5py\n'), ((9... |
import os
from dataclasses import dataclass, field
from typing import Any, List, Optional
from hydra.core.config_store import ConfigStore
from omegaconf import MISSING
from hiding_adversarial_attacks.config.classifiers.classifier_config import (
Cifar10ClassifierConfig,
ClassifierCheckpointConfig,
Classif... | [
"dataclasses.field",
"hydra.core.config_store.ConfigStore.instance",
"hiding_adversarial_attacks.config.classifiers.classifier_config.ClassifierCheckpointConfig",
"os.path.join"
] | [((2507, 2529), 'hydra.core.config_store.ConfigStore.instance', 'ConfigStore.instance', ([], {}), '()\n', (2527, 2529), False, 'from hydra.core.config_store import ConfigStore\n'), ((938, 1082), 'dataclasses.field', 'field', ([], {'default_factory': "(lambda : {'lr': {'log': True, 'low': 1e-05, 'high': 0.01}, 'batch_si... |
# -*- coding: utf-8 -*-
import matplotlib.gridspec
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from ..ecg import ecg_peaks
from ..epochs import epochs_to_df
from ..signal import signal_fixpeaks
from ..stats import rescale
from .ecg_segment import ecg_segment
def ecg_plot(ecg_signals, rpeak... | [
"matplotlib.pyplot.figure",
"numpy.where",
"numpy.arange",
"numpy.min",
"numpy.linspace",
"numpy.max",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.subplots"
] | [((1980, 2021), 'numpy.where', 'np.where', (["(ecg_signals['ECG_R_Peaks'] == 1)"], {}), "(ecg_signals['ECG_R_Peaks'] == 1)\n", (1988, 2021), True, 'import numpy as np\n'), ((2952, 2995), 'matplotlib.pyplot.subplots_adjust', 'plt.subplots_adjust', ([], {'hspace': '(0.3)', 'wspace': '(0.1)'}), '(hspace=0.3, wspace=0.1)\n... |
"""
Web service main file to API access of well imager slices.
"""
import os
from typing import List, Optional, Union
from fastapi import FastAPI, HTTPException
from pydantic import BaseModel
from challenge2.select import query_imager
app = FastAPI()
class ImagerModel(BaseModel):
"""
GET: /imagers result ... | [
"challenge2.select.query_imager",
"fastapi.HTTPException",
"fastapi.FastAPI"
] | [((245, 254), 'fastapi.FastAPI', 'FastAPI', ([], {}), '()\n', (252, 254), False, 'from fastapi import FastAPI, HTTPException\n'), ((1016, 1190), 'challenge2.select.query_imager', 'query_imager', ([], {'well_id': 'well_id', 'imager_table': "os.environ['IMAGERS_TABLE']", 'min_depth': 'min_depth', 'max_depth': 'max_depth'... |
# Generated by Django 2.2.1 on 2019-07-02 17:10
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tasks', '0013_auto_20190627_1416'),
]
operations = [
migrations.AlterField(
model_name='optimization',
name='paramet... | [
"django.db.models.TextField"
] | [((344, 376), 'django.db.models.TextField', 'models.TextField', ([], {'editable': '(False)'}), '(editable=False)\n', (360, 376), False, 'from django.db import migrations, models\n'), ((503, 558), 'django.db.models.TextField', 'models.TextField', ([], {'blank': '(True)', 'editable': '(False)', 'null': '(True)'}), '(blan... |
import redis
import simplejson as json
import datatype
import util
r = redis.Redis()
def qpop(topic):
return r.lpop('Q:%s' % topic)
def qpush(topic, datum):
r.rpush('Q:%s' % topic, datum)
def list_views(user):
return r.smembers('U:%s:views' % user)
def add_view(user, view):
r.sadd('U:%s:vie... | [
"redis.Redis",
"datatype.blank_meta",
"util.batch_retrieve",
"datatype.track_from_dict",
"simplejson.loads"
] | [((72, 85), 'redis.Redis', 'redis.Redis', ([], {}), '()\n', (83, 85), False, 'import redis\n'), ((692, 737), 'util.batch_retrieve', 'util.batch_retrieve', (['tracks', '"""a"""', 'get_artists'], {}), "(tracks, 'a', get_artists)\n", (711, 737), False, 'import util\n'), ((742, 786), 'util.batch_retrieve', 'util.batch_retr... |
"""
entry point to cron jobs
"""
from flask import Blueprint
from data_service.api.api_authenticator import handle_auth
from data_service.cron.eod_close_data.exchange_close_data_calls import cron_call_close_data_apis, \
cron_call_crypto_close_data_api
from data_service.cron.operational_jobs.operational_jobs i... | [
"flask.Blueprint",
"data_service.cron.operational_jobs.operational_jobs.cron_create_membership_invoices",
"data_service.cron.eod_close_data.exchange_close_data_calls.cron_call_crypto_close_data_api",
"data_service.cron.eod_close_data.exchange_close_data_calls.cron_call_close_data_apis",
"data_service.cron.o... | [((445, 472), 'flask.Blueprint', 'Blueprint', (['"""cron"""', '__name__'], {}), "('cron', __name__)\n", (454, 472), False, 'from flask import Blueprint\n'), ((1345, 1378), 'data_service.cron.operational_jobs.operational_jobs.cron_create_membership_invoices', 'cron_create_membership_invoices', ([], {}), '()\n', (1376, 1... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-05-12 13:03
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
def create_default_categories(apps, schema_editor):
Category = apps.get_model('tasks', 'Category')
db_alias = schema_editor.... | [
"django.db.migrations.RunPython",
"django.db.models.CharField",
"django.db.models.ForeignKey",
"django.db.models.AutoField",
"django.db.models.DateTimeField"
] | [((2213, 2260), 'django.db.migrations.RunPython', 'migrations.RunPython', (['create_default_categories'], {}), '(create_default_categories)\n', (2233, 2260), False, 'from django.db import migrations, models\n'), ((2270, 2317), 'django.db.migrations.RunPython', 'migrations.RunPython', (['create_default_priorities'], {})... |
import logging
import urllib.request as urllib2
import json
from datetime import datetime
from pydsstools.heclib.utils import HecTime
from pydsstools.heclib.dss import HecDss
from pydsstools.core import TimeSeriesContainer,DssPathName,UNDEFINED
__all__ = ['gage2dss']
headers ={'User-Agent': 'Mozilla/5.0 (Windows NT 1... | [
"logging.error",
"pydsstools.heclib.utils.HecTime",
"logging.debug",
"json.loads",
"urllib.request.Request",
"logging.warning",
"urllib.request.urlopen",
"pydsstools.heclib.dss.HecDss.Open",
"pydsstools.core.TimeSeriesContainer",
"datetime.datetime.now"
] | [((2154, 2173), 'pydsstools.heclib.dss.HecDss.Open', 'HecDss.Open', (['output'], {}), '(output)\n', (2165, 2173), False, 'from pydsstools.heclib.dss import HecDss\n'), ((2409, 2437), 'logging.debug', 'logging.debug', (['"""url=%s"""', 'url'], {}), "('url=%s', url)\n", (2422, 2437), False, 'import logging\n'), ((2455, 2... |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础平台 available.
Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
BK-BASE 蓝鲸基础平台 is licensed under the MIT License.
License for BK-BASE 蓝鲸基础平台:
---------------------------------------------... | [
"sklearn.feature_extraction.text.CountVectorizer",
"attr.s",
"sklearn.feature_extraction.text.TfidfVectorizer",
"numpy.argsort",
"gc.collect",
"networkx.faster_could_be_isomorphic",
"requests.get",
"metadata.util.i18n.lazy_selfish",
"jsonext.dumps",
"jinja2.Template",
"jieba.cut",
"attr.ib",
... | [((2166, 2193), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (2183, 2193), False, 'import logging\n'), ((2431, 2450), 'attr.s', 'attr.s', ([], {'frozen': '(True)'}), '(frozen=True)\n', (2437, 2450), False, 'import attr\n'), ((2491, 2508), 'attr.ib', 'attr.ib', ([], {'type': 'str'}), '(t... |
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
# <NAME> <<EMAIL>>
# Septebmer 9, 2017
import logging
import os
import tempfile
from subprocess import PIPE
from subprocess import Popen
from . import io
logger = logging.getLogger(__name__)
def train_mono(
feats,
trans_words,
fst_L,
topology_in... | [
"tempfile.NamedTemporaryFile",
"subprocess.Popen",
"os.unlink",
"logging.getLogger"
] | [((220, 247), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (237, 247), False, 'import logging\n'), ((7486, 7506), 'os.unlink', 'os.unlink', (['arkf.name'], {}), '(arkf.name)\n', (7495, 7506), False, 'import os\n'), ((7511, 7532), 'os.unlink', 'os.unlink', (['topof.name'], {}), '(topof.n... |
from pysensationcore import *
import sensation_helpers as sh
# Inner blocks
lerp = createInstance("Lerp", "lerp")
circlePath = createInstance("CirclePath", "CirclePathInstance")
comparator = createInstance("Comparator", "ComparatorInstance")
# Inner block connections
connect(lerp.out, circlePath.radius)
connect(Cons... | [
"sensation_helpers.createSensationFromPath"
] | [((561, 922), 'sensation_helpers.createSensationFromPath', 'sh.createSensationFromPath', (['"""Open"""', "{('t', lerp.x): (0, 0, 0), ('duration', lerp.y1): (1, 0, 0), ('startRadius',\n lerp.x0): (0.01, 0, 0), ('endRadius', lerp.x1): (0.05, 0, 0), ('t',\n comparator.a): (0, 0, 0), ('duration', comparator.b): (1, 0... |
import logging
from functools import reduce
from django.db.models import Q
from django.db.models.fields.related import RelatedField
logger = logging.getLogger(__name__)
def filter_qs(queryset, valid_queries, **queries):
"""
Filter the queryset.
:param queryset: QuerySet to filter
:param valid_querie... | [
"functools.reduce",
"django.db.models.Q",
"logging.getLogger"
] | [((143, 170), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (160, 170), False, 'import logging\n'), ((1367, 1396), 'functools.reduce', 'reduce', (['(lambda x, y: x & y)', 'q'], {}), '(lambda x, y: x & y, q)\n', (1373, 1396), False, 'from functools import reduce\n'), ((1188, 1217), 'djang... |
# -*- coding: utf-8 -*-
from docutils import nodes
import traceback
from docutils.parsers.rst import Directive
from past.builtins import basestring
from sphinx.locale import _
from six.moves.urllib import parse as urlparse # Retain Py2 compatibility for urlparse
import requests
from requests_file import FileAdapte... | [
"docutils.nodes.tgroup",
"docutils.nodes.Text",
"docutils.nodes.colspec",
"six.moves.urllib.parse.urlparse",
"traceback.print_exc",
"json.loads",
"requests.Session",
"docutils.nodes.section",
"docutils.nodes.paragraph",
"docutils.nodes.bullet_list",
"docutils.nodes.list_item",
"requests_file.F... | [((740, 762), 'six.moves.urllib.parse.urlparse', 'urlparse.urlparse', (['url'], {}), '(url)\n', (757, 762), True, 'from six.moves.urllib import parse as urlparse\n'), ((1293, 1310), 'docutils.nodes.paragraph', 'nodes.paragraph', ([], {}), '()\n', (1308, 1310), False, 'from docutils import nodes\n'), ((1327, 1348), 'doc... |
from geosnap import Community, datasets
import pytest
import os
try:
LTDB = os.environ["LTDB_SAMPLE"]
NCDB = os.environ["NCDB"]
except:
LTDB=None
NCDB=None
def test_Community_from_cbsa():
la = Community.from_census(msa_fips="31080")
assert la.gdf.shape == (7683, 195)
def test_Community_from... | [
"geosnap.Community.from_geodataframes",
"geosnap.datasets.tracts_2000",
"pytest.mark.skipif",
"geosnap.Community.from_lodes",
"geosnap.datasets.msas",
"geosnap.Community.from_ncdb",
"geosnap.Community.from_census",
"geosnap.datasets.tracts_1990"
] | [((456, 521), 'pytest.mark.skipif', 'pytest.mark.skipif', (['(not NCDB)'], {'reason': '"""unable to locate NCDB data"""'}), "(not NCDB, reason='unable to locate NCDB data')\n", (474, 521), False, 'import pytest\n'), ((216, 255), 'geosnap.Community.from_census', 'Community.from_census', ([], {'msa_fips': '"""31080"""'})... |
import numpy as np
import xarray as xr
import dacite
from vcm.data_transform import (
DATA_TRANSFORM_REGISTRY,
DLW_SFC,
DSW_SFC,
DSW_TOA,
ULW_SFC,
ULW_TOA,
USW_SFC,
USW_TOA,
LHF,
SHF,
COL_T_NUDGE,
)
import vcm
import pytest
# to construct datasets that operate on all transfo... | [
"vcm.DataTransform",
"numpy.random.random_sample",
"dacite.from_dict",
"xarray.testing.assert_allclose",
"pytest.mark.parametrize"
] | [((2665, 2969), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""transforms, expected_inputs, expected_outputs"""', "[([], [], []), ([{'name': 'Q1_from_dQ1_pQ1'}, {'name': 'Qm_from_Q1_Q2'}], [\n 'Q2', 'dQ1', 'pQ1'], ['Q1', 'Qm']), ([{'name': 'Q1_from_dQ1_pQ1'}, {\n 'name': 'Q2_from_dQ2_pQ2'}], ['dQ1', ... |
# Generated by Django 3.2.11 on 2022-01-20 18:35
from django.db import migrations, models
import django.db.models.deletion
import parler.fields
class Migration(migrations.Migration):
dependencies = [
('aldryn_categories', '0004_auto_20150623_0859'),
]
operations = [
migrations.AlterFiel... | [
"django.db.models.BigAutoField"
] | [((399, 495), 'django.db.models.BigAutoField', 'models.BigAutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (418, 495), False, 'from django.db import migrations, m... |
from direct.gui.DirectGui import DirectFrame, DirectButton, DirectLabel
from direct.gui.DirectGui import DirectScrolledList, DirectCheckButton
from direct.gui.DirectCheckBox import DirectCheckBox
from direct.gui import DirectGuiGlobals
from toontown.toonbase import ToontownGlobals
from pandac.PandaModules import Vec3, ... | [
"direct.gui.DirectGui.DirectCheckButton",
"pandac.PandaModules.Vec4",
"direct.gui.DirectGui.DirectLabel"
] | [((1902, 2194), 'direct.gui.DirectGui.DirectCheckButton', 'DirectCheckButton', ([], {'relief': 'None', 'scale': '(0.1)', 'boxBorder': '(0.08)', 'boxImage': '(uncheckedImage, checkedImage, None)', 'boxImageScale': '(10.0)', 'boxRelief': 'None', 'text': 'name', 'text_align': 'TextNode.ALeft', 'text_scale': '(0.7)', 'text... |
import matplotlib.pyplot as plt
import os
home_dir = os.path.expanduser('~')
repository_dir = os.path.join(home_dir, 'Desktop/AU-REU-21')
x1 = []
x2 = []
x3 = []
y1 = []
yCounter = 0
with open(os.path.join(repository_dir, 'magData.txt'),'r') as file:
line=file.readline()
for line in file:
xTemp =... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"os.path.join",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"os.path.expanduser"
] | [((54, 77), 'os.path.expanduser', 'os.path.expanduser', (['"""~"""'], {}), "('~')\n", (72, 77), False, 'import os\n'), ((95, 138), 'os.path.join', 'os.path.join', (['home_dir', '"""Desktop/AU-REU-21"""'], {}), "(home_dir, 'Desktop/AU-REU-21')\n", (107, 138), False, 'import os\n'), ((487, 539), 'matplotlib.pyplot.plot',... |
import cv2
import os, sys
import glob
import numpy as np
import pickle
curr_path = os.path.dirname(os.path.abspath(__file__))
project_path = os.path.dirname(curr_path)
config_path = os.path.join(project_path, '.config')
os.makedirs(config_path, exist_ok=True)
im = cv2.imread(os.path.join(project_path, 'test_images', ... | [
"cv2.warpPerspective",
"os.path.abspath",
"cv2.circle",
"os.makedirs",
"cv2.waitKey",
"cv2.destroyAllWindows",
"os.path.dirname",
"numpy.float32",
"cv2.setMouseCallback",
"numpy.array",
"numpy.linalg.inv",
"cv2.perspectiveTransform",
"cv2.imshow",
"os.path.join",
"cv2.namedWindow"
] | [((141, 167), 'os.path.dirname', 'os.path.dirname', (['curr_path'], {}), '(curr_path)\n', (156, 167), False, 'import os, sys\n'), ((182, 219), 'os.path.join', 'os.path.join', (['project_path', '""".config"""'], {}), "(project_path, '.config')\n", (194, 219), False, 'import os, sys\n'), ((220, 259), 'os.makedirs', 'os.m... |
import json
from django import template
from django.utils.safestring import mark_safe
from misago.core.utils import encode_json_html
register = template.Library()
@register.filter
def as_json(value):
json_dump = json.dumps(value)
# fixes XSS as described in #651
return mark_safe(encode_json_html(json_... | [
"misago.core.utils.encode_json_html",
"django.template.Library",
"json.dumps"
] | [((148, 166), 'django.template.Library', 'template.Library', ([], {}), '()\n', (164, 166), False, 'from django import template\n'), ((222, 239), 'json.dumps', 'json.dumps', (['value'], {}), '(value)\n', (232, 239), False, 'import json\n'), ((298, 325), 'misago.core.utils.encode_json_html', 'encode_json_html', (['json_d... |
#!/usr/bin/env python
# https://projecteuler.net/problem=9
import unittest
from math import sqrt
def is_triplet(a, b, c):
return a * a + b * b == c * c
def answer():
target = 1000
limit = 10000
for a in range(1, limit):
for b in range(1, a):
c = int(sqrt(a * a + b ... | [
"math.sqrt"
] | [((305, 324), 'math.sqrt', 'sqrt', (['(a * a + b * b)'], {}), '(a * a + b * b)\n', (309, 324), False, 'from math import sqrt\n')] |
"""
Move indexes to gen:
Gen 1: 001 - 165
Gen 2: 166 - 251
Gen 3: 252 - 354
Gen 4: 355 - 467
Gen 5: 468 - 559
Gen 6: 560 - 621
Gen 7: 622 - 742
Gen 8: 743 - 826 (Gmax moves are all 1000)
"""
import json
max_move_index = {1: 165, 2: 251, 3: 354, 4: 467, 5: 559, 6: 621, 7: 742}
for gen i... | [
"json.load",
"json.dumps"
] | [((412, 427), 'json.load', 'json.load', (['file'], {}), '(file)\n', (421, 427), False, 'import json\n'), ((522, 537), 'json.load', 'json.load', (['file'], {}), '(file)\n', (531, 537), False, 'import json\n'), ((1018, 1063), 'json.dumps', 'json.dumps', (['old_gen'], {'indent': '(4)', 'sort_keys': '(True)'}), '(old_gen, ... |
from . import Cosmology
import numpy as np
from scipy.special import gamma as gamma_fn
from scipy.interpolate import interp1d
class MassFunction:
"""Class to hold a mass function for halos and associated bias.
Implemented Mass Functions:
- **Sheth-Tormen**: Sheth & Tormen 1999 analytic mass function. Thi... | [
"numpy.power",
"numpy.asarray",
"numpy.exp",
"scipy.interpolate.interp1d",
"numpy.log10",
"scipy.special.gamma",
"numpy.sqrt"
] | [((3788, 3801), 'numpy.log10', 'np.log10', (['m_h'], {}), '(m_h)\n', (3796, 3801), True, 'import numpy as np\n'), ((5310, 5323), 'numpy.log10', 'np.log10', (['m_h'], {}), '(m_h)\n', (5318, 5323), True, 'import numpy as np\n'), ((6785, 6798), 'numpy.log10', 'np.log10', (['m_h'], {}), '(m_h)\n', (6793, 6798), True, 'impo... |
# Copyright (c) 2014 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 agreed to in writin... | [
"glanceclient.Client",
"glance.common.glare.definitions.Blob",
"glance.i18n._",
"glance.common.glare.definitions.String",
"glance.common.glare.definitions.BinaryObject"
] | [((864, 904), 'glance.common.glare.definitions.BinaryObject', 'definitions.BinaryObject', ([], {'required': '(False)'}), '(required=False)\n', (888, 904), False, 'from glance.common.glare import definitions\n'), ((927, 1060), 'glance.common.glare.definitions.String', 'definitions.String', ([], {'required': '(False)', '... |
"""Defines the pool model."""
from typing import Union, List, Callable, Optional, Tuple
import tensorflow as tf
from keras.engine import data_adapter
from ..utils.data_utils import convert_to_list
# TODO: AutopycoinBaseClass
# TODO: finish doc and unit testing.
class BasePool(tf.keras.Model):
"""Tensorflow mod... | [
"tensorflow.random.set_seed",
"tensorflow.random.uniform",
"keras.engine.data_adapter.unpack_x_y_sample_weight",
"tensorflow.nest.flatten",
"tensorflow.nest.map_structure"
] | [((1995, 2019), 'tensorflow.random.set_seed', 'tf.random.set_seed', (['seed'], {}), '(seed)\n', (2013, 2019), True, 'import tensorflow as tf\n'), ((4624, 4665), 'tensorflow.nest.map_structure', 'tf.nest.map_structure', (['init', 'distribution'], {}), '(init, distribution)\n', (4645, 4665), True, 'import tensorflow as t... |
import asyncio
import argparse
from urllib.parse import urlparse
import aiohttp
import aiohttp_proxy
from lxml import etree
from async_dns.core import types
from colorama import Fore, Back, Style
from async_dns.resolver import ProxyResolver
from aiohttp_proxy import ProxyConnector, ProxyType
from . import valid_dom... | [
"aiohttp.ClientTimeout",
"asyncio.sleep",
"aiohttp_proxy.ProxyConnector",
"async_dns.resolver.ProxyResolver",
"lxml.etree.HTML",
"urllib.parse.urlparse"
] | [((891, 985), 'aiohttp_proxy.ProxyConnector', 'ProxyConnector', ([], {'proxy_type': 'ProxyType.SOCKS5', 'host': '"""127.0.0.1"""', 'port': '(9050)', 'verify_ssl': '(False)'}), "(proxy_type=ProxyType.SOCKS5, host='127.0.0.1', port=9050,\n verify_ssl=False)\n", (905, 985), False, 'from aiohttp_proxy import ProxyConnec... |
# -*- coding: utf-8 -*-
import re
import scrapy
from FinalProject.items import RentItem
class A5i5jRentSpider(scrapy.Spider):
name = "5i5j_rent"
allowed_domains = ["5i5j.com"]
start_urls = ['http://bj.5i5j.com/rent/']
def start_requests(self):
requests = []
for index in range(1, 201)... | [
"FinalProject.items.RentItem",
"re.search",
"scrapy.Request"
] | [((978, 988), 'FinalProject.items.RentItem', 'RentItem', ([], {}), '()\n', (986, 988), False, 'from FinalProject.items import RentItem\n'), ((344, 398), 'scrapy.Request', 'scrapy.Request', (["(self.start_urls[0] + 'pn%s/w1' % index)"], {}), "(self.start_urls[0] + 'pn%s/w1' % index)\n", (358, 398), False, 'import scrapy... |
# Copyright (c) 2021, NVIDIA CORPORATION. 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 appli... | [
"os.getcwd",
"code.common.args_to_string",
"code.common.dict_get",
"os.path.expandvars",
"numpy.mean",
"re.findall"
] | [((680, 691), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (689, 691), False, 'import os\n'), ((1787, 1829), 'code.common.dict_get', 'dict_get', (['flag_dict', '"""use_jemalloc"""', '(False)'], {}), "(flag_dict, 'use_jemalloc', False)\n", (1795, 1829), False, 'from code.common import logging, dict_get, run_command, args... |
#!/usr/bin/env python
# -*- coding: utf-8; py-indent-offset:4 -*-
# ##################################################################
# Quant Robot for Cryptocurrency
# author: <NAME>
# Date : 2018.11.26
##################################################################
import logging
import ssl
import json
import a... | [
"logging.getLogger",
"time.sleep"
] | [((631, 650), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (648, 650), False, 'import logging\n'), ((3476, 3520), 'time.sleep', 'time.sleep', (['(qsettings.INTERVAL_STRATEGY * 10)'], {}), '(qsettings.INTERVAL_STRATEGY * 10)\n', (3486, 3520), False, 'import time\n')] |
"""
Pull the position of a node to a target point.
"""
from ghpythonlib.componentbase import executingcomponent as component
from compas_cem.optimization import PointConstraint
from compas_rhino.geometry import RhinoPoint
class PointConstraintComponent(component):
def RunScript(self, node_key, point, weight):
... | [
"compas_cem.optimization.PointConstraint",
"compas_rhino.geometry.RhinoPoint.from_geometry"
] | [((475, 515), 'compas_cem.optimization.PointConstraint', 'PointConstraint', (['node_key', 'point', 'weight'], {}), '(node_key, point, weight)\n', (490, 515), False, 'from compas_cem.optimization import PointConstraint\n'), ((412, 443), 'compas_rhino.geometry.RhinoPoint.from_geometry', 'RhinoPoint.from_geometry', (['poi... |
# coding=utf-8
# Copyright 2021 The Uncertainty Baselines Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | [
"tensorflow.test.main",
"os.listdir",
"tensorflow.one_hot",
"input_utils.get_data",
"tensorflow.io.decode_image",
"tensorflow.boolean_mask",
"jax.local_device_count",
"tensorflow.reshape",
"tensorflow_datasets.testing.mock_data",
"jax.process_count",
"jax.random.PRNGKey",
"pathlib.Path",
"te... | [((6226, 6240), 'tensorflow.test.main', 'tf.test.main', ([], {}), '()\n', (6238, 6240), True, 'import tensorflow as tf\n'), ((1441, 1605), 'input_utils.get_num_examples', 'input_utils.get_num_examples', (['dataset_name'], {'split': 'split', 'host_batch_size': 'host_batch_size', 'drop_remainder': '(True)', 'num_hosts': ... |
import unittest
import pytest
from rx import operators as ops
from rx.subject import Subject
from rx.testing import TestScheduler, ReactiveTest
on_next = ReactiveTest.on_next
on_completed = ReactiveTest.on_completed
on_error = ReactiveTest.on_error
subscribe = ReactiveTest.subscribe
subscribed = ReactiveTest.subscrib... | [
"rx.operators.zip",
"rx.operators.map",
"rx.subject.Subject",
"rx.operators.multicast",
"rx.testing.TestScheduler"
] | [((485, 500), 'rx.testing.TestScheduler', 'TestScheduler', ([], {}), '()\n', (498, 500), False, 'from rx.testing import TestScheduler, ReactiveTest\n'), ((514, 523), 'rx.subject.Subject', 'Subject', ([], {}), '()\n', (521, 523), False, 'from rx.subject import Subject\n'), ((1780, 1795), 'rx.testing.TestScheduler', 'Tes... |
# 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.ResourceOptions",
"pulumi.set"
] | [((2297, 2335), 'pulumi.set', 'pulumi.set', (['__self__', '"""domain"""', 'domain'], {}), "(__self__, 'domain', domain)\n", (2307, 2335), False, 'import pulumi\n'), ((2344, 2378), 'pulumi.set', 'pulumi.set', (['__self__', '"""type"""', 'type'], {}), "(__self__, 'type', type)\n", (2354, 2378), False, 'import pulumi\n'),... |
# -*- coding: utf-8 -*-
import sys
from pyspark import SparkContext, SparkConf, SQLContext
from pyspark.sql.types import StructType, StructField, FloatType, IntegerType
from pyspark.ml.feature import VectorAssembler, StringIndexer, MinMaxScaler
from pyspark.ml import Pipeline
from pyspark.ml.tuning import TrainVa... | [
"pyspark.ml.feature.StringIndexer",
"pyspark.ml.feature.VectorAssembler",
"pyspark.ml.Pipeline",
"pyspark.ml.tuning.ParamGridBuilder",
"pyspark.ml.classification.LogisticRegression",
"pyspark.SparkContext",
"pyspark.SparkConf",
"pyspark.ml.evaluation.BinaryClassificationEvaluator",
"pyspark.ml.tunin... | [((675, 698), 'pyspark.SparkContext', 'SparkContext', ([], {'conf': 'conf'}), '(conf=conf)\n', (687, 698), False, 'from pyspark import SparkContext, SparkConf, SQLContext\n'), ((1217, 1231), 'pyspark.SQLContext', 'SQLContext', (['sc'], {}), '(sc)\n', (1227, 1231), False, 'from pyspark import SparkContext, SparkConf, SQ... |
import os as _os
import numpy as np
import collections
from pychemia.utils.periodic import atomic_symbol, covalent_radius, atomic_number
from pychemia.utils.constants import bohr_angstrom, angstrom_bohr
from pychemia.utils.mathematics import unit_vectors
from .abifiles import AbiFiles
from .parser import parser
from .o... | [
"pychemia.utils.mathematics.unit_vectors",
"numpy.dtype",
"numpy.zeros",
"numpy.identity",
"pychemia.utils.periodic.atomic_symbol",
"numpy.ones",
"matplotlib.patches.Circle",
"os.path.isfile",
"pychemia.utils.periodic.atomic_number",
"numpy.array",
"matplotlib.collections.PatchCollection",
"py... | [((19441, 19456), 'pychemia.utils.periodic.atomic_symbol', 'atomic_symbol', ([], {}), '()\n', (19454, 19456), False, 'from pychemia.utils.periodic import atomic_symbol, covalent_radius, atomic_number\n'), ((19978, 19995), 'numpy.array', 'np.array', (['[natom]'], {}), '([natom])\n', (19986, 19995), True, 'import numpy a... |
import argparse
import logging.config
import platform
import sys
import textwrap
import traceback
from typing import TextIO
import cli_ui
import luddite
import pkg_resources
from packaging import version as packaging_version
from gitlabform import EXIT_INVALID_INPUT, EXIT_PROCESSING_ERROR
from gitlabform.configuratio... | [
"pkg_resources.get_distribution",
"textwrap.dedent",
"cli_ui.info_1",
"cli_ui.debug",
"packaging.version.parse",
"gitlabform.gitlabform.processors.project.ProjectProcessors",
"gitlabform.gitlab.GitLab",
"cli_ui.message",
"cli_ui.info",
"cli_ui.error",
"cli_ui.Symbol",
"traceback.format_exc",
... | [((2609, 2637), 'gitlabform.gitlabform.processors.group.GroupProcessors', 'GroupProcessors', (['self.gitlab'], {}), '(self.gitlab)\n', (2624, 2637), False, 'from gitlabform.gitlabform.processors.group import GroupProcessors\n'), ((2672, 2735), 'gitlabform.gitlabform.processors.project.ProjectProcessors', 'ProjectProces... |
import os
import pandas as pd
import re
import numpy as np
import pickle
import codecs
import torch
import torch.nn as nn
import torch.optim as optim
import torch.utils.data as D
from torch.autograd import Variable
from models.BiLSTM_ATT import BiLSTM_ATT
import multiprocessing as mp
mp.set_start_method('spawn')
# Def... | [
"numpy.load",
"torch.utils.data.DataLoader",
"torch.autograd.Variable",
"multiprocessing.set_start_method",
"torch.nn.CrossEntropyLoss",
"torch.save",
"torch.max",
"torch.utils.data.TensorDataset",
"torch.cuda.LongTensor",
"models.BiLSTM_ATT.BiLSTM_ATT"
] | [((285, 313), 'multiprocessing.set_start_method', 'mp.set_start_method', (['"""spawn"""'], {}), "('spawn')\n", (304, 313), True, 'import multiprocessing as mp\n'), ((886, 923), 'numpy.load', 'np.load', (['"""itmd_files/lstm_sentTT.npy"""'], {}), "('itmd_files/lstm_sentTT.npy')\n", (893, 923), True, 'import numpy as np\... |
from collections import namedtuple
from datetime import datetime
import re
from django.core.management.base import BaseCommand
from net153.journal.models import Entry
class Command(BaseCommand):
help = "Migrate from text file journal"
def _create_post(self, path, file):
full_path = path + '/' + file
... | [
"re.match",
"datetime.datetime.strptime",
"net153.journal.models.Entry",
"collections.namedtuple"
] | [((753, 763), 'net153.journal.models.Entry', 'Entry', ([], {}), '(**d)\n', (758, 763), False, 'from net153.journal.models import Entry\n'), ((970, 1011), 'datetime.datetime.strptime', 'datetime.strptime', (['"""01/01/22"""', '"""%m/%d/%y"""'], {}), "('01/01/22', '%m/%d/%y')\n", (987, 1011), False, 'from datetime import... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# TileDB documentation build configuration file, created by
# sphinx-quickstart on Mon Feb 5 10:08:37 2018.
#
# -- Imports configuration -------------------------------------------------
import os
import subprocess
import sys
from os.path import abspath, join, dirname... | [
"gensidebar.generate_sidebar",
"sphinx_rtd_theme.get_html_theme_path",
"os.path.dirname",
"os.environ.get",
"subprocess.check_call"
] | [((658, 705), 'os.environ.get', 'os.environ.get', (['"""READTHEDOCS_VERSION"""', '"""latest"""'], {}), "('READTHEDOCS_VERSION', 'latest')\n", (672, 705), False, 'import os\n'), ((5632, 5726), 'gensidebar.generate_sidebar', 'gensidebar.generate_sidebar', (["{'on_rtd': readthedocs, 'rtd_version': rtd_version}", '"""tiled... |
from graphene.test import Client
from ..data import setup
from ..schema import schema
setup()
client = Client(schema)
def test_str_schema(snapshot):
snapshot.assert_match(str(schema).strip())
def test_correctly_fetches_id_name_rebels(snapshot):
query = """
query RebelsQuery {
rebels {
... | [
"graphene.test.Client"
] | [((106, 120), 'graphene.test.Client', 'Client', (['schema'], {}), '(schema)\n', (112, 120), False, 'from graphene.test import Client\n')] |
# the calculator
from tkinter import Tk, Button, Label, Grid, Entry, END
root = Tk()
root.title("CALCULATOR")
e = Entry(
root,
width=35,
borderwidth=10,
)
e.grid(row=0, column=0, columnspan=4, padx=8, pady=8)
def joker(number):
now = e.get()
e.delete(0, END)
e.insert(0, str(now) + str(number)... | [
"tkinter.Button",
"tkinter.Entry",
"tkinter.Tk"
] | [((81, 85), 'tkinter.Tk', 'Tk', ([], {}), '()\n', (83, 85), False, 'from tkinter import Tk, Button, Label, Grid, Entry, END\n'), ((115, 152), 'tkinter.Entry', 'Entry', (['root'], {'width': '(35)', 'borderwidth': '(10)'}), '(root, width=35, borderwidth=10)\n', (120, 152), False, 'from tkinter import Tk, Button, Label, G... |
from .compatibility import IntegerTypes
from .ref import AnonRef
from .bit import Bit, VCC, GND
from .array import ArrayType, ArrayKind
from .debug import debug_wire
import weakref
from hwtypes import BitVector, SIntVector
__all__ = ['Bits', 'BitsType', 'BitsKind']
__all__ += ['UInt', 'UIntType', 'UIntKind']
__all__ ... | [
"magma.get_family",
"weakref.WeakValueDictionary"
] | [((440, 469), 'weakref.WeakValueDictionary', 'weakref.WeakValueDictionary', ([], {}), '()\n', (467, 469), False, 'import weakref\n'), ((4347, 4376), 'weakref.WeakValueDictionary', 'weakref.WeakValueDictionary', ([], {}), '()\n', (4374, 4376), False, 'import weakref\n'), ((6395, 6424), 'weakref.WeakValueDictionary', 'we... |
"""
Training costs for unsupervised learning of energy-based models
"""
from functools import wraps
import logging
import numpy as np
import sys
from theano import scan
import theano.tensor as T
from theano.compat.six.moves import zip as izip
from pylearn2.compat import OrderedDict
from pylearn2.costs.cost import Cos... | [
"pylearn2.compat.OrderedDict",
"theano.tensor.grad",
"theano.tensor.mean",
"theano.compat.six.moves.zip",
"theano.tensor.sqr",
"functools.wraps",
"pylearn2.utils.rng.make_theano_rng",
"theano.tensor.arange",
"sys.setrecursionlimit",
"logging.getLogger"
] | [((497, 524), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (514, 524), False, 'import logging\n'), ((1391, 1419), 'sys.setrecursionlimit', 'sys.setrecursionlimit', (['(40000)'], {}), '(40000)\n', (1412, 1419), False, 'import sys\n'), ((4839, 4855), 'functools.wraps', 'wraps', (['Cost.ex... |
from pymui import createMuiTheme, colors
theme = createMuiTheme({
'palette': {
'primary': colors['teal'],
'secondary': colors['pink'],
'special': {
'main': colors['deepPurple'][600],
'contrastText': colors['common']['white'],
},
},
'overrides': {
... | [
"pymui.createMuiTheme"
] | [((50, 528), 'pymui.createMuiTheme', 'createMuiTheme', (["{'palette': {'primary': colors['teal'], 'secondary': colors['pink'],\n 'special': {'main': colors['deepPurple'][600], 'contrastText': colors[\n 'common']['white']}}, 'overrides': {'MuiButton': {'root': {'margin':\n '0.5rem'}}}, 'props': {'MuiButton': {'... |
# Copyright (C) 2020 Tsuda Laboratory
#
# 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, d... | [
"PrefInt.ibo.gaussianprocess.PDF",
"numpy.isscalar",
"numpy.max",
"PrefInt.ibo.gaussianprocess.CDF",
"numpy.sqrt"
] | [((1436, 1450), 'numpy.max', 'max', (['self.GP.Y'], {}), '(self.GP.Y)\n', (1439, 1450), False, 'from numpy import array, sqrt, max, arange, log, nan, linalg, isscalar, pi\n'), ((1516, 1535), 'numpy.isscalar', 'isscalar', (['self.ymax'], {}), '(self.ymax)\n', (1524, 1535), False, 'from numpy import array, sqrt, max, ara... |
import argparse
import logging
from pdb import set_trace
from threading import Thread
from Utils.MisclUtils import TimeUtil
from Utils.RandomUtil import Random
from Utils.CalcUtils import mean_wait_time
from Utils.ServerUtil import Customer, Server
from Utils.CalcUtils import mean_service_time
from Utils.CalcUtils impo... | [
"Utils.MisclUtils.TimeUtil",
"threading.Thread",
"Utils.CalcUtils.mean_wait_time",
"argparse.ArgumentParser",
"logging.basicConfig",
"Utils.CalcUtils.mean_service_time",
"Utils.ServerUtil.Server",
"Utils.RandomUtil.Random",
"Utils.CalcUtils.cust_arrival",
"Utils.CalcUtils.cust_departr",
"Utils.C... | [((412, 515), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG', 'format': '"""(Queuing Customer %(threadName)s) | %(message)s"""'}), "(level=logging.DEBUG, format=\n '(Queuing Customer %(threadName)s) | %(message)s')\n", (431, 515), False, 'import logging\n'), ((542, 552), 'Utils.MisclUti... |
#!/usr/bin/env python
import argparse
import pandas as pd
from bs4 import BeautifulSoup
__version__ = '0.1'
def main(input, output):
with open(input, 'r') as f:
soup = BeautifulSoup(f.read(), features="lxml")
results = soup.find_all('a')
del soup
df = pd.DataFrame((result.attrs for result... | [
"pandas.DataFrame",
"pandas.to_datetime",
"argparse.ArgumentParser"
] | [((283, 331), 'pandas.DataFrame', 'pd.DataFrame', (['(result.attrs for result in results)'], {}), '(result.attrs for result in results)\n', (295, 331), True, 'import pandas as pd\n'), ((404, 443), 'pandas.to_datetime', 'pd.to_datetime', (['df.time_added'], {'unit': '"""s"""'}), "(df.time_added, unit='s')\n", (418, 443)... |
# downlink_waveform.py
############################################################################
# Functions defined here will be used to generate downlink OFDM 5G NR waves
############################################################################
import numpy as np
import matplotlib.pyplot as plt
from scipy impo... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.show",
"numpy.flip",
"numpy.fft.fft",
"numpy.zeros",
"matplotlib.pyplot.figure",
"numpy.max",
"matplotlib.pyplot.psd",
"matplotlib.pyplot.set_cmap",
"numpy.linspace",
"numpy.loadtxt",
"numpy.real",
"numpy.log10",
"nu... | [((6870, 6882), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (6880, 6882), True, 'import matplotlib.pyplot as plt\n'), ((6883, 6931), 'matplotlib.pyplot.title', 'plt.title', (['"""UL-PSD Comparison OFDM Vs OFDM-WOLA"""'], {}), "('UL-PSD Comparison OFDM Vs OFDM-WOLA')\n", (6892, 6931), True, 'import matpl... |
import numbers
import os
import queue as Queue
import threading
from typing import Iterable
import mxnet as mx
import numpy as np
import torch
from functools import partial
from torch import distributed
from torch.utils.data import DataLoader, Dataset
from torchvision import transforms
from torchvision.datasets import... | [
"mxnet.recordio.MXIndexedRecordIO",
"nvidia.dali.fn.decoders.image",
"mxnet.image.imdecode",
"numpy.random.randint",
"torch.distributed.get_world_size",
"torchvision.transforms.Normalize",
"torch.no_grad",
"os.path.join",
"nvidia.dali.fn.crop_mirror_normalize",
"torch.distributed.get_rank",
"tor... | [((7234, 7249), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (7247, 7249), False, 'import torch\n'), ((624, 659), 'os.path.join', 'os.path.join', (['root_dir', '"""train.rec"""'], {}), "(root_dir, 'train.rec')\n", (636, 659), False, 'import os\n'), ((670, 705), 'os.path.join', 'os.path.join', (['root_dir', '"""t... |
import itertools
import fnmatch
import re
import botconfig
import src.settings as var
from src import proxy, debuglog
from src.events import Event
from src.messages import messages
__all__ = ["pm", "is_fake_nick", "mass_mode", "mass_privmsg", "reply",
"is_user_simple", "is_user_notice", "in_wolflist",
... | [
"src.functions.get_participants",
"src.users._get",
"src.settings.MAIN_ROLES.get",
"src.settings.ROLES.items",
"re.match",
"src.functions.get_players",
"src.events.Event",
"botconfig.NICK.lower",
"src.settings.MAIN_ROLES.items",
"itertools.chain",
"re.compile"
] | [((1167, 1189), 're.compile', 're.compile', (['"""^[0-9]+$"""'], {}), "('^[0-9]+$')\n", (1177, 1189), False, 'import re\n'), ((8013, 8061), 're.match', 're.match', (['"""(?:(?:(.*?)!)?(.*?)@)?(.*)"""', 'hostmask'], {}), "('(?:(?:(.*?)!)?(.*?)@)?(.*)', hostmask)\n", (8021, 8061), False, 'import re\n'), ((11874, 11887), ... |
# 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"
] | [((2027, 2063), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""eventSourceArn"""'}), "(name='eventSourceArn')\n", (2040, 2063), False, 'import pulumi\n'), ((2774, 2808), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""eventPattern"""'}), "(name='eventPattern')\n", (2787, 2808), False, 'import pulumi\n'), ((362... |
import logging
import os
from flask import Flask
from flask import Markup
from flask import render_template
from flask import request
from flask import Response
from flask import jsonify
from flask_babel import Babel, gettext
from google.cloud import datastore
from opencensus.ext.azure.log_exporter import AzureLogHand... | [
"opencensus.ext.azure.log_exporter.AzureLogHandler",
"google.cloud.datastore.Client",
"flask_babel.gettext",
"logging.basicConfig",
"opencensus.trace.status.Status",
"opencensus.trace.execution_context.get_opencensus_tracer",
"flask.Flask",
"flask.Response",
"flask_babel.Babel",
"opencensus.ext.az... | [((688, 715), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (705, 715), False, 'import logging\n'), ((716, 737), 'logging.basicConfig', 'logging.basicConfig', ([], {}), '()\n', (735, 737), False, 'import logging\n'), ((748, 775), 'logging.getLogger', 'logging.getLogger', (['__name__'], {... |
from kivy.uix.widget import Widget
from sightread.kv.sheetview import SheetView
from kivy.lang.builder import Builder
class RootWidget( Widget ):
pass
Builder.load_file( "sightread/kv/rootwidget.kv" )
| [
"kivy.lang.builder.Builder.load_file"
] | [((156, 203), 'kivy.lang.builder.Builder.load_file', 'Builder.load_file', (['"""sightread/kv/rootwidget.kv"""'], {}), "('sightread/kv/rootwidget.kv')\n", (173, 203), False, 'from kivy.lang.builder import Builder\n')] |
"""
Manages the Acid ability.
--
Author : DrLarck
Last update : 28/09/19 (DrLarck)
"""
# dependance
import asyncio
from random import randint
# utility
from utility.cog.displayer.move import Move_displayer
from utility.cog.fight_system.calculator.damage import Damage_calculator
from utility.cog.character.ability.... | [
"utility.cog.character.ability.util.effect_checker.Effect_checker",
"utility.cog.character.ability.effect.dot.dot_acid.Dot_acid",
"random.randint",
"utility.cog.character.ability.ability.Ability.__init__",
"utility.cog.fight_system.calculator.damage.Damage_calculator",
"utility.cog.displayer.move.Move_dis... | [((722, 789), 'utility.cog.character.ability.ability.Ability.__init__', 'Ability.__init__', (['self', 'client', 'ctx', 'caster', 'target', 'team_a', 'team_b'], {}), '(self, client, ctx, caster, target, team_a, team_b)\n', (738, 789), False, 'from utility.cog.character.ability.ability import Ability\n'), ((2026, 2042), ... |
#!/usr/bin/env python3
from json.tool import main
import os
import custom_log as l
import argument_handler as argh
import file_walker
def rename_files(prefix: str, force_run: bool = False):
# print(prefix)
files = file_walker.get_files()
if force_run:
print("force run, changes will be made")
... | [
"file_walker.get_files",
"os.rename",
"argument_handler.force_run",
"os.path.splitext",
"argument_handler.prefix",
"os.path.split"
] | [((225, 248), 'file_walker.get_files', 'file_walker.get_files', ([], {}), '()\n', (246, 248), False, 'import file_walker\n'), ((489, 520), 'os.path.split', 'os.path.split', (['current_filepath'], {}), '(current_filepath)\n', (502, 520), False, 'import os\n'), ((553, 587), 'os.path.splitext', 'os.path.splitext', (['curr... |
# -*- coding:utf-8 -*-
from time import time
from struct import pack,unpack
import io,logging,sqlite3,os
from os.path import exists,isfile,isdir
from collections import deque
from threading import Lock
CACHING_TIME = 10
# 10 minutes
BUFFERING_TIME = 5 * 60
MIN_SIZE = 512
# because struct's max int for "!I" = 65535
COU... | [
"os.remove",
"os.path.exists",
"struct.pack",
"logging.getLogger",
"threading.Lock",
"sqlite3.connect",
"collections.deque"
] | [((7393, 7423), 'sqlite3.connect', 'sqlite3.connect', (['"""content_id1"""'], {}), "('content_id1')\n", (7408, 7423), False, 'import io, logging, sqlite3, os\n'), ((7462, 7483), 'struct.pack', 'pack', (['"""!III"""', '(1)', '(2)', '(3)'], {}), "('!III', 1, 2, 3)\n", (7466, 7483), False, 'from struct import pack, unpack... |
from django.db import models
# Create your models here.
class Article(models.Model):
title = models.CharField(max_length = 100)
category = models.CharField(max_length = 50, blank = True)
date_time = models.DateTimeField(auto_now_add = True)
content = models.TextField(blank = True, null = True)
def... | [
"django.db.models.CharField",
"django.db.models.DateTimeField",
"django.db.models.TextField"
] | [((98, 130), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)'}), '(max_length=100)\n', (114, 130), False, 'from django.db import models\n'), ((148, 191), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(50)', 'blank': '(True)'}), '(max_length=50, blank=True)\n', (164,... |
#!/usr/bin/py
#solved by FabioLima
#
#NameScript: balance.py
#
#Author and Maintaining: <NAME>
#
#-----------------------------------
#Description: Just a simple checker for balanced parentheses
#using class Stack in folder 3.5
#
#-----------------------------------
#
#Example: python balance.py
#
#
#----------------... | [
"os.path.abspath"
] | [((468, 501), 'os.path.abspath', 'os.path.abspath', (['"""../../3.5/src/"""'], {}), "('../../3.5/src/')\n", (483, 501), False, 'import sys, os\n')] |
from aiohttp import web
from homeassistant.components.http import HomeAssistantView
import os.path
def setup_view(hass, name):
hass.http.register_view(CustomComponentServer(hass, name))
class CustomComponentServer(HomeAssistantView):
requires_auth = False
def __init__(self, hass, domain):
self.n... | [
"aiohttp.web.Response"
] | [((904, 983), 'aiohttp.web.Response', 'web.Response', ([], {'body': 'filecontent', 'content_type': '"""text/javascript"""', 'charset': '"""utf-8"""'}), "(body=filecontent, content_type='text/javascript', charset='utf-8')\n", (916, 983), False, 'from aiohttp import web\n'), ((863, 887), 'aiohttp.web.Response', 'web.Resp... |
# Generated by Django 2.1.7 on 2019-04-08 07:08
from django.db import migrations, models
import uni_ticket.models
class Migration(migrations.Migration):
dependencies = [
('uni_ticket', '0003_ticketreply_attachment'),
]
operations = [
migrations.RemoveField(
model_name='ticke... | [
"django.db.migrations.RemoveField"
] | [((267, 332), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""tickethistory"""', 'name': '"""status"""'}), "(model_name='tickethistory', name='status')\n", (289, 332), False, 'from django.db import migrations, models\n')] |
#! python3
"""Downloads any web comics that have been updated since it was last run."""
import os
import datetime
import requests
import bs4
def check_xkcd(last_url):
"""Download all XKCD comics released after the given URL."""
url = 'https://xkcd.com'
# Get latest comics URL with comic number for compa... | [
"os.makedirs",
"os.path.basename",
"requests.get",
"bs4.BeautifulSoup",
"datetime.datetime.now"
] | [((3768, 3808), 'os.makedirs', 'os.makedirs', (['"""Web Comics"""'], {'exist_ok': '(True)'}), "('Web Comics', exist_ok=True)\n", (3779, 3808), False, 'import os\n'), ((348, 365), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (360, 365), False, 'import requests\n'), ((404, 439), 'bs4.BeautifulSoup', 'bs4.Bea... |
from rest_framework import viewsets
import django_filters
from .base import TranslatedModelSerializer, register_view
from resources.models import Equipment, EquipmentAlias, EquipmentCategory
class PlainEquipmentSerializer(TranslatedModelSerializer):
class Meta:
model = Equipment
fields = ('name', ... | [
"resources.models.EquipmentCategory.objects.all",
"resources.models.Equipment.objects.all",
"django_filters.Filter"
] | [((769, 800), 'resources.models.EquipmentCategory.objects.all', 'EquipmentCategory.objects.all', ([], {}), '()\n', (798, 800), False, 'from resources.models import Equipment, EquipmentAlias, EquipmentCategory\n'), ((1391, 1558), 'django_filters.Filter', 'django_filters.Filter', ([], {'field_name': '"""resource_equipmen... |
import json
from db import db
from db import Workouts, Exercise
from flask import Flask
from flask import request
db_filename = "workout.db"
app = Flask(__name__)
app.config["SQLALCHEMY_DATABASE_URI"] = f"sqlite:///{db_filename}"
app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False
app.config["SQLALCHEMY... | [
"db.db.create_all",
"json.loads",
"db.db.init_app",
"db.Workouts.query.all",
"db.Workouts.query.filter_by",
"flask.Flask",
"db.db.session.delete",
"json.dumps",
"db.db.session.add",
"db.db.session.commit"
] | [((157, 172), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (162, 172), False, 'from flask import Flask\n'), ((338, 354), 'db.db.init_app', 'db.init_app', (['app'], {}), '(app)\n', (349, 354), False, 'from db import db\n'), ((385, 400), 'db.db.create_all', 'db.create_all', ([], {}), '()\n', (398, 400), Fa... |
import os
from pynvim.compat import IS_PYTHON3
def test_repr(vim):
assert repr(vim.current.buffer) == "<Buffer(handle=2)>"
def test_get_length(vim):
assert len(vim.current.buffer) == 1
vim.current.buffer.append('line')
assert len(vim.current.buffer) == 2
vim.current.buffer.append('line')
as... | [
"os.path.isfile",
"os.unlink"
] | [((3880, 3904), 'os.path.isfile', 'os.path.isfile', (['new_name'], {}), '(new_name)\n', (3894, 3904), False, 'import os\n'), ((3909, 3928), 'os.unlink', 'os.unlink', (['new_name'], {}), '(new_name)\n', (3918, 3928), False, 'import os\n')] |
# Generated by Django 2.1.dev20180403030529 on 2018-04-05 20:34
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('mixGroups', '0002_auto_20180405_1332'),
]
operations = [
migrations.RenameModel(
old_name='Groups',
new_name... | [
"django.db.migrations.RenameModel"
] | [((245, 304), 'django.db.migrations.RenameModel', 'migrations.RenameModel', ([], {'old_name': '"""Groups"""', 'new_name': '"""Group"""'}), "(old_name='Groups', new_name='Group')\n", (267, 304), False, 'from django.db import migrations\n')] |
from django.db.models.query import QuerySet
from django.shortcuts import render
from django.http import HttpResponse
from django.template.loader import get_template
from .models import Item
# Create your views here.
def home(request):
return render(request, "inventory.html",
{})
def search_inv... | [
"django.shortcuts.render"
] | [((248, 285), 'django.shortcuts.render', 'render', (['request', '"""inventory.html"""', '{}'], {}), "(request, 'inventory.html', {})\n", (254, 285), False, 'from django.shortcuts import render\n'), ((1628, 1750), 'django.shortcuts.render', 'render', (['request', '"""lab_location.html"""', "{'searched': searched_item, '... |
"""Configuration file for jupyter-qtconsole."""
import logging
import os
from pathlib import Path
import shutil
import sys
import traitlets
from traitlets.config import get_config
# I think we can safely assume this one
try:
from jupyter_core.paths import get_home_dir
from jupyter_client.manager import Kern... | [
"logging.basicConfig",
"traitlets.config.get_config",
"shutil.which",
"jupyter_core.paths.get_home_dir",
"sys.exit"
] | [((592, 606), 'jupyter_core.paths.get_home_dir', 'get_home_dir', ([], {}), '()\n', (604, 606), False, 'from jupyter_core.paths import get_home_dir\n'), ((611, 623), 'traitlets.config.get_config', 'get_config', ([], {}), '()\n', (621, 623), False, 'from traitlets.config import get_config\n'), ((625, 667), 'logging.basic... |
import os
from celery import Celery
import tempfile
import gzip
import json
from ohapi import api
import requests
# from .views import raise_http_error
from django.conf import settings
# set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'oh_data_uploader.s... | [
"tempfile.NamedTemporaryFile",
"celery.Celery",
"os.environ.setdefault",
"gzip.open",
"json.dumps",
"ohapi.api.exchange_oauth2_member",
"requests.get",
"ohapi.api.message"
] | [((253, 329), 'os.environ.setdefault', 'os.environ.setdefault', (['"""DJANGO_SETTINGS_MODULE"""', '"""oh_data_uploader.settings"""'], {}), "('DJANGO_SETTINGS_MODULE', 'oh_data_uploader.settings')\n", (274, 329), False, 'import os\n'), ((576, 590), 'celery.Celery', 'Celery', (['"""proj"""'], {}), "('proj')\n", (582, 590... |
from datetime import timedelta
from uuid import uuid4
from django.urls import reverse
from django.utils import timezone
from rest_framework.test import APITestCase
from seedorf.games.models import Game, RsvpStatus
from seedorf.sports.models import Sport
from seedorf.sports.tests.factories import SportFactory
from see... | [
"seedorf.users.tests.factories.UserFactory",
"uuid.uuid4",
"seedorf.spots.models.Spot.objects.filter",
"django.utils.timezone.now",
"seedorf.spots.tests.factories.SpotFactory",
"seedorf.sports.models.Sport.objects.filter",
"unittest.mock.patch",
"django.urls.reverse",
"seedorf.games.models.Game.obje... | [((794, 865), 'unittest.mock.patch', 'patch', (['"""seedorf.games.models.get_firebase_link"""', 'mock_get_firebase_link'], {}), "('seedorf.games.models.get_firebase_link', mock_get_firebase_link)\n", (799, 865), False, 'from unittest.mock import patch\n'), ((867, 965), 'unittest.mock.patch', 'patch', (['"""seedorf.game... |
# -*- coding: utf-8 -*-
# Importing Required Libraries
import clr, codecs, json, os, re, sys, threading, datetime
clr.AddReference("IronPython.Modules.dll")
clr.AddReferenceToFileAndPath(os.path.join(os.path.dirname(os.path.realpath(__file__)) + "\References", "TwitchLib.PubSub.dll"))
from TwitchLib.PubSub import Twi... | [
"threading.Thread",
"json.dump",
"json.load",
"json.loads",
"codecs.open",
"TwitchLib.PubSub.TwitchPubSub",
"os.path.dirname",
"os.path.realpath",
"json.dumps",
"clr.AddReference",
"os.path.isfile",
"datetime.timedelta",
"datetime.datetime.now",
"os.startfile"
] | [((116, 158), 'clr.AddReference', 'clr.AddReference', (['"""IronPython.Modules.dll"""'], {}), "('IronPython.Modules.dll')\n", (132, 158), False, 'import clr, codecs, json, os, re, sys, threading, datetime\n'), ((858, 881), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (879, 881), False, 'import cl... |
import torch
import math
import numpy as np
def log10(x):
"""Convert a new tensor with the base-10 logarithm of the elements of x. """
return torch.log(x) / math.log(10)
class Result(object):
def __init__(self):
self.irmse, self.imae = 0, 0
self.mse, self.rmse, self.mae = 0, 0, 0
... | [
"math.sqrt",
"torch.max",
"torch.pow",
"math.log",
"torch.log"
] | [((155, 167), 'torch.log', 'torch.log', (['x'], {}), '(x)\n', (164, 167), False, 'import torch\n'), ((170, 182), 'math.log', 'math.log', (['(10)'], {}), '(10)\n', (178, 182), False, 'import math\n'), ((1416, 1435), 'math.sqrt', 'math.sqrt', (['self.mse'], {}), '(self.mse)\n', (1425, 1435), False, 'import math\n'), ((16... |
from pandas import DataFrame
from dashboard.covid_data_handler import parse_csv_data, process_covid_csv_data, covid_API_request,\
schedule_covid_updates, first_non_null, config_location
def test_parse_csv_data():
data = parse_csv_data('nation_2021-10-28.csv')
assert len(data) == 639
def test_proce... | [
"dashboard.covid_data_handler.covid_API_request",
"dashboard.covid_data_handler.config_location",
"dashboard.covid_data_handler.parse_csv_data",
"dashboard.covid_data_handler.first_non_null",
"dashboard.covid_data_handler.schedule_covid_updates"
] | [((234, 273), 'dashboard.covid_data_handler.parse_csv_data', 'parse_csv_data', (['"""nation_2021-10-28.csv"""'], {}), "('nation_2021-10-28.csv')\n", (248, 273), False, 'from dashboard.covid_data_handler import parse_csv_data, process_covid_csv_data, covid_API_request, schedule_covid_updates, first_non_null, config_loca... |
# -*- coding: utf-8 -*-
# 操作文件和目录
import os
# 获取当前文件所在的目录
root_path = os.path.dirname(__file__)
# 基本配置
configs = dict(
debug=False, # 指定调试,开发者模式:True;生产模式:False
template_path=os.path.join(root_path, "templates"), # 指定模板路径
static_path=os.path.join(root_path, "static") # 指定静态路径
)
# 数据库配置
mysql_configs =... | [
"os.path.dirname",
"os.path.join"
] | [((71, 96), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (86, 96), False, 'import os\n'), ((186, 222), 'os.path.join', 'os.path.join', (['root_path', '"""templates"""'], {}), "(root_path, 'templates')\n", (198, 222), False, 'import os\n'), ((250, 283), 'os.path.join', 'os.path.join', (['roo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.