code
stringlengths
22
1.05M
apis
listlengths
1
3.31k
extract_api
stringlengths
75
3.25M
# Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. # Copyright 2019 The Prescience-Client Authors. All rights reserved. import os from prescience_client.bean.task import Task from prescience_client.client.prescience_client import PrescienceClient from prescience_clie...
[ "os.path.splitext", "os.path.isfile", "os.path.dirname", "os.path.isdir", "os.path.basename" ]
[((1424, 1447), 'os.path.isdir', 'os.path.isdir', (['filepath'], {}), '(filepath)\n', (1437, 1447), False, 'import os\n'), ((1526, 1550), 'os.path.isfile', 'os.path.isfile', (['filepath'], {}), '(filepath)\n', (1540, 1550), False, 'import os\n'), ((1468, 1493), 'os.path.dirname', 'os.path.dirname', (['filepath'], {}), ...
from requests_html import HTMLSession import pandas as pd from pprint import pprint from web_util import get_bodies, parse_articles from difflib import SequenceMatcher import time import re from datetime import datetime import numpy as np def keywords_search(url): session = HTMLSession() resp = session.get(url) ...
[ "web_util.get_bodies", "re.compile", "difflib.SequenceMatcher", "web_util.parse_articles", "requests_html.HTMLSession", "pandas.DataFrame" ]
[((278, 291), 'requests_html.HTMLSession', 'HTMLSession', ([], {}), '()\n', (289, 291), False, 'from requests_html import HTMLSession\n'), ((448, 471), 're.compile', 're.compile', (['f"""[a-zA-Z]"""'], {}), "(f'[a-zA-Z]')\n", (458, 471), False, 'import re\n'), ((1076, 1090), 'pandas.DataFrame', 'pd.DataFrame', ([], {})...
"""Basic test of tone synthesis with `muser.live.Synth`""" import muser.live as live import math import time synth = live.Synth(channels=2) def synth_on(synth, duration, pause=0): """Activate synth's tone generation for a time, then pause.""" synth.toggle() time.sleep(duration) synth.toggle() tim...
[ "muser.live.Synth", "time.sleep", "math.sin" ]
[((119, 141), 'muser.live.Synth', 'live.Synth', ([], {'channels': '(2)'}), '(channels=2)\n', (129, 141), True, 'import muser.live as live\n'), ((273, 293), 'time.sleep', 'time.sleep', (['duration'], {}), '(duration)\n', (283, 293), False, 'import time\n'), ((317, 334), 'time.sleep', 'time.sleep', (['pause'], {}), '(pau...
from collections import defaultdict def parse(filename): mem = defaultdict(int) with open(filename) as f: prog = [int(x) for x in f.read().strip().split(",")] for i in range(len(prog)): mem[i] = prog[i] return mem def createEmptyState(name, mem): return {"nr": name, "pc": 0...
[ "collections.defaultdict" ]
[((3279, 3295), 'collections.defaultdict', 'defaultdict', (['int'], {}), '(int)\n', (3290, 3295), False, 'from collections import defaultdict\n'), ((3576, 3592), 'collections.defaultdict', 'defaultdict', (['int'], {}), '(int)\n', (3587, 3592), False, 'from collections import defaultdict\n'), ((68, 84), 'collections.def...
__author__ = 'sibirrer' from astrofunc.LensingProfiles.nfw import NFW from astrofunc.LensingProfiles.nfw_ellipse import NFW_ELLIPSE import numpy as np import numpy.testing as npt import pytest class TestNFW(object): """ tests the Gaussian methods """ def setup(self): self.nfw = NFW() d...
[ "pytest.main", "astrofunc.LensingProfiles.nfw.NFW", "numpy.array", "numpy.testing.assert_almost_equal", "astrofunc.LensingProfiles.nfw_ellipse.NFW_ELLIPSE" ]
[((4080, 4093), 'pytest.main', 'pytest.main', ([], {}), '()\n', (4091, 4093), False, 'import pytest\n'), ((307, 312), 'astrofunc.LensingProfiles.nfw.NFW', 'NFW', ([], {}), '()\n', (310, 312), False, 'from astrofunc.LensingProfiles.nfw import NFW\n'), ((356, 369), 'numpy.array', 'np.array', (['[1]'], {}), '([1])\n', (36...
# [346] Moving Average from Data Stream # Description # Given a stream of integers and a window size, calculate the moving average of all integers in the sliding window. # Example # Example 1: # MovingAverage m = new MovingAverage(3); # m.next(1) = 1 // return 1.00000 # m.next(10) = (1 + 10) / 2 // return 5.50000 ...
[ "collections.deque" ]
[((616, 625), 'collections.deque', 'deque', (['[]'], {}), '([])\n', (621, 625), False, 'from collections import deque\n')]
import os import curses import numpy as np from pathlib import Path ROOT = Path("terminal_dungeon") WALL_DIR = ROOT / "wall_textures" SPRITE_DIR = ROOT / "sprite_textures" def clamp(mi, val, ma): return max(min(ma, val), mi) class Renderer: """ Graphic engine. Casts rays. Casts sprites. Kicks ass. ...
[ "numpy.clip", "os.get_terminal_size", "pathlib.Path", "numpy.where", "numpy.heaviside", "numpy.array", "numpy.zeros", "numpy.linalg.inv", "numpy.sign", "curses.resizeterm", "numpy.full", "numpy.arange" ]
[((76, 100), 'pathlib.Path', 'Path', (['"""terminal_dungeon"""'], {}), "('terminal_dungeon')\n", (80, 100), False, 'from pathlib import Path\n'), ((1939, 1950), 'numpy.zeros', 'np.zeros', (['w'], {}), '(w)\n', (1947, 1950), True, 'import numpy as np\n'), ((1973, 1993), 'numpy.full', 'np.full', (['(h, w)', '""" """'], {...
# -*- coding: utf-8 -*- from setuptools import setup, find_packages with open('README.rst') as f: readme = f.read() with open('LICENSE') as f: license = f.read() setup( name='HTTP Log Monitor', version='1.0.0', description='Simple HTTP Log Monitor (Datadogs homework assignement)', long_desc...
[ "setuptools.find_packages" ]
[((472, 512), 'setuptools.find_packages', 'find_packages', ([], {'exclude': "('tests', 'docs')"}), "(exclude=('tests', 'docs'))\n", (485, 512), False, 'from setuptools import setup, find_packages\n')]
#! /usr/bin/env python3 """two.py Second module for testing""" import one print(">>>Top level in two.py") print(repr(__name__)) print(repr(__name__)) one.main() one.func() def main(): print("hello from two.py") if __name__ == '__main__': print("two.py is being run directly") main() else: pri...
[ "one.main", "one.func" ]
[((157, 167), 'one.main', 'one.main', ([], {}), '()\n', (165, 167), False, 'import one\n'), ((169, 179), 'one.func', 'one.func', ([], {}), '()\n', (177, 179), False, 'import one\n')]
#!/usr/bin/env python3 # This sample demonstrates how to use the siem endpoint in the # REST API. # For this scenario to work, there must already be custom offense # types on the system where the sample is being run. # The scenario demonstrates the following # actions: # - How to get all offense types # - How to get...
[ "os.path.realpath", "importlib.import_module", "sys.exit" ]
[((667, 707), 'importlib.import_module', 'importlib.import_module', (['"""RestApiClient"""'], {}), "('RestApiClient')\n", (690, 707), False, 'import importlib\n'), ((726, 768), 'importlib.import_module', 'importlib.import_module', (['"""SampleUtilities"""'], {}), "('SampleUtilities')\n", (749, 768), False, 'import impo...
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import tensorflow as tf import edward as ed from edward.models import Normal, Empirical from scipy.special import erf import importlib import utils importlib.reload(...
[ "numpy.mean", "numpy.atleast_2d", "numpy.sqrt", "numpy.reshape", "tensorflow.reshape", "tensorflow.ones", "tensorflow.placeholder", "numpy.square", "numpy.array", "numpy.random.randint", "tensorflow.name_scope", "tensorflow.matmul", "importlib.reload", "numpy.std", "numpy.matmul", "ten...
[((303, 326), 'importlib.reload', 'importlib.reload', (['utils'], {}), '(utils)\n', (319, 326), False, 'import importlib\n'), ((11730, 11747), 'numpy.array', 'np.array', (['y_preds'], {}), '(y_preds)\n', (11738, 11747), True, 'import numpy as np\n'), ((11763, 11787), 'numpy.mean', 'np.mean', (['y_preds'], {'axis': '(0)...
from subprocess import Popen,call class Task(object): command = None process = None background = None def __init__(self, *command, background=False): self.command = command self.background = background def run(self): self.process = Popen(self.command) if not self.ba...
[ "subprocess.Popen" ]
[((278, 297), 'subprocess.Popen', 'Popen', (['self.command'], {}), '(self.command)\n', (283, 297), False, 'from subprocess import Popen, call\n')]
import cherrypy from paste.translogger import TransLogger from flask import Flask, request, abort, jsonify, make_response import json import os from utils import decode_string from DeepRecommender.reco_encoder.data import input_layer_api, input_layer from DeepRecommender.reco_encoder.model import model import torch fro...
[ "DeepRecommender.reco_encoder.data.input_layer_api.UserItemRecDataProviderAPI", "cherrypy.log", "DeepRecommender.reco_encoder.data.input_layer.UserItemRecDataProvider", "cherrypy.engine.block", "flask.Flask", "torch.load", "cherrypy.config.update", "cherrypy.tree.graft", "os.path.isfile", "cherryp...
[((393, 408), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (398, 408), False, 'from flask import Flask, request, abort, jsonify, make_response\n'), ((953, 969), 'paste.translogger.TransLogger', 'TransLogger', (['app'], {}), '(app)\n', (964, 969), False, 'from paste.translogger import TransLogger\n'), ((1...
''' Detect pseudoprime aspect of number Status: Accepted ''' from math import gcd ############################################################################### def pollard_rho(number): """Produce random factor of number""" bits = ((number - 1) & (1 - number)).bit_length() - 1 exponent = number >> bit...
[ "math.gcd" ]
[((791, 812), 'math.gcd', 'gcd', (['(prev - 1)', 'number'], {}), '(prev - 1, number)\n', (794, 812), False, 'from math import gcd\n')]
# BLOGSTER by <NAME> # a.k.a. "The Black Unicorn" a.k.a. "<NAME>". # Licensed under the MIT license. import os from django.core.wsgi import get_wsgi_application os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'blogster.settings') application = get_wsgi_application()
[ "os.environ.setdefault", "django.core.wsgi.get_wsgi_application" ]
[((162, 230), 'os.environ.setdefault', 'os.environ.setdefault', (['"""DJANGO_SETTINGS_MODULE"""', '"""blogster.settings"""'], {}), "('DJANGO_SETTINGS_MODULE', 'blogster.settings')\n", (183, 230), False, 'import os\n'), ((245, 267), 'django.core.wsgi.get_wsgi_application', 'get_wsgi_application', ([], {}), '()\n', (265,...
import logging from typing import Optional, Union, cast import discord from ddtrace import tracer from discord.errors import DiscordException from discord_slash.context import ComponentContext, InteractionContext from .metrics import add_span_error from .utils import ( CANT_SEND_CODE, DiscordChannel, bot_...
[ "logging.getLogger", "ddtrace.tracer.wrap", "ddtrace.tracer.current_span", "discord.utils.find", "typing.cast" ]
[((441, 468), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (458, 468), False, 'import logging\n'), ((500, 513), 'ddtrace.tracer.wrap', 'tracer.wrap', ([], {}), '()\n', (511, 513), False, 'from ddtrace import tracer\n'), ((1014, 1027), 'ddtrace.tracer.wrap', 'tracer.wrap', ([], {}), '()\...
from typing import Union, AsyncIterator, cast from google.cloud.firestore_v1.async_client import AsyncClient from google.cloud.firestore_v1.async_collection import AsyncCollectionReference from google.cloud.firestore_v1.base_document import DocumentSnapshot from tools.integrations import firestore_client from settings....
[ "models.user.User.from_doc" ]
[((1002, 1031), 'models.user.User.from_doc', 'User.from_doc', ([], {'doc': 'parsed_doc'}), '(doc=parsed_doc)\n', (1015, 1031), False, 'from models.user import User\n')]
# Copyright (C) 2016 Glamping Hub (https://glampinghub.com) # License: BSD 3-Clause from django.conf.urls import patterns, url urlpatterns = patterns( 'keyrock.views', url(r'oauth/authorize', 'keyrock_start_authorization', name='keyrock_start_authorization'), url(r'oauth/callback$', 'keyrock_oauth_callb...
[ "django.conf.urls.url" ]
[((180, 274), 'django.conf.urls.url', 'url', (['"""oauth/authorize"""', '"""keyrock_start_authorization"""'], {'name': '"""keyrock_start_authorization"""'}), "('oauth/authorize', 'keyrock_start_authorization', name=\n 'keyrock_start_authorization')\n", (183, 274), False, 'from django.conf.urls import patterns, url\n...
#!/usr/bin/env python3 # Goshu IRC Bot # written by <NAME> <<EMAIL>> # licensed under the ISC license import json import urllib.request, urllib.parse, urllib.error from girc.formatting import escape, unescape from gbot.modules import Module class urbandictionary(Module): """Allows access to UrbanDictionary."""...
[ "girc.formatting.unescape" ]
[((508, 539), 'girc.formatting.unescape', 'unescape', (['usercommand.arguments'], {}), '(usercommand.arguments)\n', (516, 539), False, 'from girc.formatting import escape, unescape\n')]
import math import os import sys from flask import jsonify, current_app from dmutils.timing import logged_duration def get_version_label(path): try: path = os.path.join(path, 'version_label') with open(path) as f: return f.read().strip() except IOError: return None def ...
[ "math.ceil", "flask.current_app.logger.error", "os.statvfs", "os.path.join", "sys.exc_info", "dmutils.timing.logged_duration.default_message", "dmutils.timing.logged_duration.default_condition", "flask.jsonify" ]
[((747, 762), 'os.statvfs', 'os.statvfs', (['"""/"""'], {}), "('/')\n", (757, 762), False, 'import os\n'), ((172, 207), 'os.path.join', 'os.path.join', (['path', '"""version_label"""'], {}), "(path, 'version_label')\n", (184, 207), False, 'import os\n'), ((792, 855), 'math.ceil', 'math.ceil', (['(disk_stats.f_bfree * 1...
from django import forms from django.core.exceptions import ValidationError from .models import Process class ProcessCancelForm(forms.ModelForm): def __init__(self, user=None, **kwargs): self.user = user super(ProcessCancelForm, self).__init__(**kwargs) def clean(self): data = super(P...
[ "django.core.exceptions.ValidationError" ]
[((428, 490), 'django.core.exceptions.ValidationError', 'ValidationError', (['"""You can\'t cancel that process at this time."""'], {}), '("You can\'t cancel that process at this time.")\n', (443, 490), False, 'from django.core.exceptions import ValidationError\n')]
import pickle import xlsxwriter import numpy as np import os def load(filename): loaded_dict = pickle.load(open(filename, 'rb')) return dict def np_2darray_converter(matrix): if(type(matrix) == type({})): # making dictionary suitable for excel keys = list(matrix.keys()) value...
[ "numpy.array", "os.path.splitext", "xlsxwriter.Workbook" ]
[((468, 493), 'numpy.array', 'np.array', (['matrix'], {'ndmin': '(2)'}), '(matrix, ndmin=2)\n', (476, 493), True, 'import numpy as np\n'), ((1200, 1229), 'xlsxwriter.Workbook', 'xlsxwriter.Workbook', (['filename'], {}), '(filename)\n', (1219, 1229), False, 'import xlsxwriter\n'), ((1110, 1136), 'os.path.splitext', 'os....
import numpy as np wavelength = 626.34 constant = np.array([(3050+0.6*np.cos(np.pi*i/40.0))*(1/wavelength) for i in range(30)]) exactdata = constant*wavelength errorbar = 0.1*constant realdata = np.random.normal(exactdata,errorbar) runnumber = np.array(range(30))
[ "numpy.random.normal", "numpy.cos" ]
[((196, 233), 'numpy.random.normal', 'np.random.normal', (['exactdata', 'errorbar'], {}), '(exactdata, errorbar)\n', (212, 233), True, 'import numpy as np\n'), ((70, 94), 'numpy.cos', 'np.cos', (['(np.pi * i / 40.0)'], {}), '(np.pi * i / 40.0)\n', (76, 94), True, 'import numpy as np\n')]
''' Usage: necro shell|s USER_COMMAND Options USER_COMMAND a command in the .necro.toml ''' from docopt import docopt if __name__ == '__main__': print(docopt(__doc__))
[ "docopt.docopt" ]
[((170, 185), 'docopt.docopt', 'docopt', (['__doc__'], {}), '(__doc__)\n', (176, 185), False, 'from docopt import docopt\n')]
# -*- coding: utf-8 -*- """ Created on Fri Mar 1 11:52:48 2019 This is the module for evaluation metrics @author: Cheng """ # -*- coding: utf-8 -*- """ Created on Sat Mar 2 21:31:32 2019 @author: cheng """ import numpy as np from scipy.spatial.distance import directed_hausdorff def get_classified_errors(test_pred...
[ "numpy.mean", "numpy.reshape", "numpy.amin", "scipy.spatial.distance.directed_hausdorff", "numpy.array_str", "numpy.linalg.norm", "numpy.arctan2", "numpy.vstack", "numpy.std" ]
[((569, 609), 'numpy.reshape', 'np.reshape', (['indexed_predictions', '[-1, 5]'], {}), '(indexed_predictions, [-1, 5])\n', (579, 609), True, 'import numpy as np\n'), ((630, 660), 'numpy.reshape', 'np.reshape', (['test_pred', '[-1, 5]'], {}), '(test_pred, [-1, 5])\n', (640, 660), True, 'import numpy as np\n'), ((972, 10...
# Generated by Django 4.0.3 on 2022-03-17 14:32 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] ope...
[ "django.db.models.TextField", "django.db.models.ForeignKey", "django.db.models.BigAutoField", "django.db.models.DateTimeField", "django.db.migrations.swappable_dependency" ]
[((247, 304), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (278, 304), False, 'from django.db import migrations, models\n'), ((447, 543), 'django.db.models.BigAutoField', 'models.BigAutoField', ([], {'auto_created': '...
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distribu...
[ "openfermion.chem.molecular_data.MolecularData", "numpy.allclose", "openfermion.ops.representations.doci_hamiltonian.DOCIHamiltonian.from_integrals", "openfermion.linalg.get_sparse_operator", "openfermion.ops.representations.doci_hamiltonian.get_doci_from_integrals", "os.path.join", "numpy.ix_", "nump...
[((1287, 1343), 'os.path.join', 'os.path.join', (['DATA_DIRECTORY', '"""H2_sto-3g_singlet_0.7414"""'], {}), "(DATA_DIRECTORY, 'H2_sto-3g_singlet_0.7414')\n", (1299, 1343), False, 'import os\n'), ((1368, 1456), 'openfermion.chem.molecular_data.MolecularData', 'MolecularData', (['self.geometry', 'self.basis', 'self.multi...
import pytest import mal_tier_list_bbcode_gen.exceptions as exceptions from mal_tier_list_bbcode_gen.entry import Entry @pytest.fixture(autouse=True) def direct_image_url(): return 'example.com/test.png' @pytest.mark.parametrize( "mal_url,expected_name", [ pytest.param( 'https://my...
[ "pytest.fixture", "pytest.param", "pytest.raises", "mal_tier_list_bbcode_gen.entry.Entry" ]
[((125, 153), 'pytest.fixture', 'pytest.fixture', ([], {'autouse': '(True)'}), '(autouse=True)\n', (139, 153), False, 'import pytest\n'), ((938, 984), 'mal_tier_list_bbcode_gen.entry.Entry', 'Entry', (['mal_url', '"""direct URL"""', 'direct_image_url'], {}), "(mal_url, 'direct URL', direct_image_url)\n", (943, 984), Fa...
import numpy as np import torch from torch.utils.tensorboard import SummaryWriter from torch.utils.data import DataLoader from ProcessData.TrainingLoss import TrainingLoss from ProcessData.Utils import getX_full from typing import Tuple from HighFrequency.HighFrequency import HighFrequency from HighFrequency.Discrim...
[ "torch.utils.tensorboard.SummaryWriter", "HighFrequency.HighFrequency.HighFrequency", "torch.split", "torch.optim.lr_scheduler.LambdaLR", "HighFrequency.Vizualise.plotState", "HighFrequency.Discriminator.Discriminator", "HighFrequency.LossFunction.LossFunction", "torch.cuda.is_available", "numpy.cos...
[((2043, 2083), 'torch.utils.tensorboard.SummaryWriter', 'SummaryWriter', ([], {'log_dir': "('runs/' + runName)"}), "(log_dir='runs/' + runName)\n", (2056, 2083), False, 'from torch.utils.tensorboard import SummaryWriter\n'), ((2090, 2115), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (2113, ...
""" Author: <NAME> Strategy description: Hold a portfolio composed by top 5 assets by volume whose EMA 10 is above the EMA 21. Rebalance it every hour. """ from alchemist_lib.portfolio import LongsOnlyPortfolio from alchemist_lib.broker import BittrexBroker from alchemist_lib.tradingsystem import TradingSystem from ...
[ "alchemist_lib.portfolio.LongsOnlyPortfolio", "alchemist_lib.exchange.get_assets", "alchemist_lib.broker.BittrexBroker", "pandas.concat", "alchemist_lib.factor.Factor" ]
[((669, 726), 'alchemist_lib.exchange.get_assets', 'exch.get_assets', ([], {'session': 'session', 'exchange_name': '"""bittrex"""'}), "(session=session, exchange_name='bittrex')\n", (684, 726), True, 'import alchemist_lib.exchange as exch\n'), ((778, 801), 'alchemist_lib.factor.Factor', 'Factor', ([], {'session': 'sess...
import scapy.all as scapy import netfilterqueue import re from threading import Thread import time import subprocess class Injector: def __init__(self): self.ack_list=[] self.injection = '' self.injector_running = False def enable_forward_chain(self): subprocess.call(["iptabl...
[ "time.sleep", "netfilterqueue.NetfilterQueue", "subprocess.call", "threading.Thread", "re.search" ]
[((296, 336), 'subprocess.call', 'subprocess.call', (["['iptables', '--flush']"], {}), "(['iptables', '--flush'])\n", (311, 336), False, 'import subprocess\n'), ((345, 432), 'subprocess.call', 'subprocess.call', (["['iptables', '-I', 'FORWARD', '-j', 'NFQUEUE', '--queue-num', '1']"], {}), "(['iptables', '-I', 'FORWARD'...
import os import time import subprocess ROOT = "/home/ubuntu/run_on_gateway/clusters" def remove_prom_operator(clusters): for cluster in clusters: print("For %s" % cluster) os.system("helm --kube-context=%s --namespace monitoring uninstall po" % cluster) os.system("kubectl --context=%s del...
[ "os.system", "os.listdir" ]
[((1412, 1445), 'os.system', 'os.system', (['"""docker rm -f grafana"""'], {}), "('docker rm -f grafana')\n", (1421, 1445), False, 'import os\n'), ((195, 280), 'os.system', 'os.system', (["('helm --kube-context=%s --namespace monitoring uninstall po' % cluster)"], {}), "('helm --kube-context=%s --namespace monitoring u...
import pytz from datetime import datetime from freezegun import freeze_time from unittest import TestCase from datetoken.evaluator import Datetoken from datetoken.evaluator import localize, make_aware class EvaluatorTestCase(TestCase): def test_eval_token_fluent_several_stages(self): now = datetime(201...
[ "datetime.datetime", "pytz.timezone", "datetoken.evaluator.Datetoken", "datetoken.evaluator.make_aware", "freezegun.freeze_time" ]
[((308, 342), 'datetime.datetime', 'datetime', (['(2014)', '(11)', '(25)', '(23)', '(48)', '(43)'], {}), '(2014, 11, 25, 23, 48, 43)\n', (316, 342), False, 'from datetime import datetime\n'), ((366, 400), 'datetime.datetime', 'datetime', (['(2014)', '(11)', '(24)', '(23)', '(48)', '(43)'], {}), '(2014, 11, 24, 23, 48, ...
from rest_framework import serializers from blog.models import Blog, Category # create serializers class BlogsListSerializer(serializers.ModelSerializer): author = serializers.SerializerMethodField(method_name='get_author') category = serializers.SerializerMethodField(method_name='get_category') def g...
[ "blog.models.Category.objects.all", "rest_framework.serializers.SerializerMethodField", "rest_framework.serializers.ReadOnlyField" ]
[((173, 232), 'rest_framework.serializers.SerializerMethodField', 'serializers.SerializerMethodField', ([], {'method_name': '"""get_author"""'}), "(method_name='get_author')\n", (206, 232), False, 'from rest_framework import serializers\n'), ((248, 309), 'rest_framework.serializers.SerializerMethodField', 'serializers....
from django.http import HttpResponse from test_pipeline import test from django.shortcuts import render import base64 import torch.cuda from PIL import Image cat2id = {0:'Bar', 1:'Line', 2:'Pie'} Lock = False def get_group(request): global Lock print("The method is: %s" %request.method) if not Lock: ...
[ "django.shortcuts.render", "test_pipeline.test" ]
[((4600, 4629), 'django.shortcuts.render', 'render', (['request', '"""onuse.html"""'], {}), "(request, 'onuse.html')\n", (4606, 4629), False, 'from django.shortcuts import render\n'), ((4470, 4510), 'django.shortcuts.render', 'render', (['request', '"""results.html"""', 'context'], {}), "(request, 'results.html', conte...
from tqdm import tqdm from argparse import ArgumentParser from subprocess import check_output def wc(filename): return int(check_output(["wc", "-l", filename]).split()[0]) parser = ArgumentParser(description='Creates the entity description file for IndoWiki') parser.add_argument('wiki_file', help='Filename of Wik...
[ "subprocess.check_output", "tqdm.tqdm", "argparse.ArgumentParser" ]
[((187, 265), 'argparse.ArgumentParser', 'ArgumentParser', ([], {'description': '"""Creates the entity description file for IndoWiki"""'}), "(description='Creates the entity description file for IndoWiki')\n", (201, 265), False, 'from argparse import ArgumentParser\n'), ((972, 996), 'tqdm.tqdm', 'tqdm', (['f'], {'total...
""" Compute the entropy in bits of a list of probabilities. """ import numpy as np def entropy(ps): """ Compute the entropy in bits of a list of probabilities. The input list of probabilities must sum to one and no element should be larger than 1 or less than 0. :param list ps: list of probabil...
[ "numpy.sum", "numpy.log2", "numpy.isnan" ]
[((665, 676), 'numpy.log2', 'np.log2', (['ps'], {}), '(ps)\n', (672, 676), True, 'import numpy as np\n'), ((730, 744), 'numpy.isnan', 'np.isnan', (['item'], {}), '(item)\n', (738, 744), True, 'import numpy as np\n'), ((522, 532), 'numpy.sum', 'np.sum', (['ps'], {}), '(ps)\n', (528, 532), True, 'import numpy as np\n'), ...
# -*- coding: utf-8 -*- import random import itertools import numpy as np import numbers from .. import indexing def genindexing(dim, advanced=False, eco=False): if dim > 1: a = random.randint(-dim, dim - 1) i = random.randint(1, dim - 1) j = random.randint(-dim, -1) k = random....
[ "itertools.product", "random.shuffle", "random.randint" ]
[((195, 224), 'random.randint', 'random.randint', (['(-dim)', '(dim - 1)'], {}), '(-dim, dim - 1)\n', (209, 224), False, 'import random\n'), ((237, 263), 'random.randint', 'random.randint', (['(1)', '(dim - 1)'], {}), '(1, dim - 1)\n', (251, 263), False, 'import random\n'), ((276, 300), 'random.randint', 'random.randin...
import socket import threading from datetime import datetime SERVER = '127.0.0.1' PORT = 63541 FORMAT = 'utf-8' ADDR = (SERVER, PORT) DISCONNECT_MSG = '!exit' DISCONNECT_CLIENT = '!close' HEADER = 128 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) clients = [] nickname = {} # funzione per gestir...
[ "threading.active_count", "threading.Thread", "datetime.datetime.now", "socket.socket" ]
[((217, 266), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_STREAM'], {}), '(socket.AF_INET, socket.SOCK_STREAM)\n', (230, 266), False, 'import socket\n'), ((2749, 2810), 'threading.Thread', 'threading.Thread', ([], {'target': 'handle_connection', 'args': '(conn, addr)'}), '(target=handle_connectio...
# -*- coding: utf-8 -*- """ Created on Tue Feb 23 15:29:41 2021. @author: pielsticker """ import numpy as np import h5py from sklearn.utils import shuffle import seaborn as sns import matplotlib.pyplot as plt import matplotlib.colors as mcolors from .utils import ClassDistribution, SpectraPlot #%% class DataHandle...
[ "numpy.dstack", "numpy.mean", "numpy.hstack", "numpy.where", "sklearn.utils.shuffle", "numpy.argmax", "numpy.min", "h5py.File", "numpy.max", "numpy.array", "numpy.random.randint", "matplotlib.colors.CSS4_COLORS.keys", "numpy.random.seed", "numpy.around", "numpy.std", "matplotlib.pyplot...
[((40394, 40413), 'numpy.random.seed', 'np.random.seed', (['(502)'], {}), '(502)\n', (40408, 40413), True, 'import numpy as np\n'), ((22610, 22624), 'numpy.array', 'np.array', (['data'], {}), '(data)\n', (22618, 22624), True, 'import numpy as np\n'), ((30068, 30143), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {...
from selenium.webdriver.support.ui import WebDriverWait TIMEOUT = 10 class BaseInputElement: """ https://selenium-python.readthedocs.io/page-objects.html """ def __set__(self, obj, value): driver = obj.driver WebDriverWait(driver, TIMEOUT).until( lambda driver: driver.fi...
[ "selenium.webdriver.support.ui.WebDriverWait" ]
[((246, 276), 'selenium.webdriver.support.ui.WebDriverWait', 'WebDriverWait', (['driver', 'TIMEOUT'], {}), '(driver, TIMEOUT)\n', (259, 276), False, 'from selenium.webdriver.support.ui import WebDriverWait\n'), ((545, 580), 'selenium.webdriver.support.ui.WebDriverWait', 'WebDriverWait', (['driver', 'self.TIMEOUT'], {})...
from aerosandbox.aerodynamics.aerodynamics import * from aerosandbox.geometry import * import aerosandbox.library.aerodynamics as aero class Buildup(AeroProblem): def __init__(self, airplane, # type: Airplane op_point, # type: op_point run_setup=True, ...
[ "aerosandbox.library.aerodynamics.Cf_flat_plate" ]
[((1599, 1635), 'aerosandbox.library.aerodynamics.Cf_flat_plate', 'aero.Cf_flat_plate', (['self.fuse_Res[i]'], {}), '(self.fuse_Res[i])\n', (1617, 1635), True, 'import aerosandbox.library.aerodynamics as aero\n')]
import random as rnd # returns the random array def random_arr(lower, upper, size): return [rnd.randrange(lower, upper+1) for _ in range(size)] # cross over between chromosomes def reproduce(x, y): tmp = rnd.randint(0, len(x)-1) return x[:tmp]+y[tmp:] # randomly change the value of index def mutate...
[ "random.random", "random.randrange" ]
[((99, 130), 'random.randrange', 'rnd.randrange', (['lower', '(upper + 1)'], {}), '(lower, upper + 1)\n', (112, 130), True, 'import random as rnd\n'), ((1682, 1694), 'random.random', 'rnd.random', ([], {}), '()\n', (1692, 1694), True, 'import random as rnd\n')]
__author__ = 'gpratt' import gzip from optparse import OptionParser import sys def add_back_randomers(in_file_name, out_file_name): #reads through initial file parses everything out with gzip.open(in_file_name) as fastq_file, gzip.open(out_file_name, 'w') as out_file: while True: try: ...
[ "gzip.open", "optparse.OptionParser", "sys.exit" ]
[((1057, 1071), 'optparse.OptionParser', 'OptionParser', ([], {}), '()\n', (1069, 1071), False, 'from optparse import OptionParser\n'), ((1323, 1334), 'sys.exit', 'sys.exit', (['(0)'], {}), '(0)\n', (1331, 1334), False, 'import sys\n'), ((198, 221), 'gzip.open', 'gzip.open', (['in_file_name'], {}), '(in_file_name)\n', ...
"""Quantum Inspire library Copyright 2019 <NAME> qilib is available under the [MIT open-source license](https://opensource.org/licenses/MIT): 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 with...
[ "qilib.utils.storage.interface.NodeAlreadyExistsError", "qilib.utils.storage.interface.NoDataAtKeyError", "qilib.utils.storage.interface.NodeDoesNotExistsError" ]
[((2733, 2754), 'qilib.utils.storage.interface.NoDataAtKeyError', 'NoDataAtKeyError', (['tag'], {}), '(tag)\n', (2749, 2754), False, 'from qilib.utils.storage.interface import NoDataAtKeyError, NodeAlreadyExistsError, StorageInterface, NodeDoesNotExistsError\n'), ((3282, 3303), 'qilib.utils.storage.interface.NoDataAtKe...
import tempfile import shutil try: from pathlib import Path except ImportError: from pathlib2 import Path import pytest import cat.config from cat.utils.snapshots import long_running, load_snapshot, clear_snapshots @pytest.fixture() def testdir(): tmpdir = Path(tempfile.mkdtemp()) cat.config.getcont...
[ "pytest.fixture", "cat.utils.snapshots.load_snapshot", "tempfile.mkdtemp", "cat.utils.snapshots.clear_snapshots" ]
[((228, 244), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (242, 244), False, 'import pytest\n'), ((371, 388), 'cat.utils.snapshots.clear_snapshots', 'clear_snapshots', ([], {}), '()\n', (386, 388), False, 'from cat.utils.snapshots import long_running, load_snapshot, clear_snapshots\n'), ((597, 640), 'cat.util...
import dash import dash_core_components as dcc import dash_bootstrap_components as dbc import dash_html_components as html from dash.dependencies import Input, Output import config import requests from markdown import md1, md2 colors = {'background': 'lightcyan'} app = dash.Dash(__name__, external_sty...
[ "requests.post", "dash.dependencies.Output", "dash_html_components.H1", "dash_core_components.Textarea", "dash.dependencies.Input", "dash_bootstrap_components.Progress", "dash_core_components.Markdown", "dash_html_components.Img", "dash.Dash", "dash_html_components.Div" ]
[((272, 425), 'dash.Dash', 'dash.Dash', (['__name__'], {'external_stylesheets': '[dbc.themes.BOOTSTRAP]', 'meta_tags': "[{'name': 'viewport', 'content': 'width=device-width, initial-scale=1'}]"}), "(__name__, external_stylesheets=[dbc.themes.BOOTSTRAP], meta_tags=\n [{'name': 'viewport', 'content': 'width=device-wid...
from OpenGLCffi.EGL import params @params(api='egl', prms=['dpy', 'attrib_list']) def eglCreateDRMImageMESA(dpy, attrib_list): pass @params(api='egl', prms=['dpy', 'image', 'name', 'handle', 'stride']) def eglExportDRMImageMESA(dpy, image, name, handle, stride): pass
[ "OpenGLCffi.EGL.params" ]
[((35, 81), 'OpenGLCffi.EGL.params', 'params', ([], {'api': '"""egl"""', 'prms': "['dpy', 'attrib_list']"}), "(api='egl', prms=['dpy', 'attrib_list'])\n", (41, 81), False, 'from OpenGLCffi.EGL import params\n'), ((136, 204), 'OpenGLCffi.EGL.params', 'params', ([], {'api': '"""egl"""', 'prms': "['dpy', 'image', 'name', ...
import os import textfsm def parse_with_textfsm(template, command_output): """ :param template: TextFSM template to parse command :param command_output: Command output from a node :return: List of dicts. Dict per FSM row. """ with open(os.path.join(os.path.dirname(os.path.realpath(__file__)), ...
[ "os.path.realpath", "textfsm.TextFSM" ]
[((368, 398), 'textfsm.TextFSM', 'textfsm.TextFSM', (['template_file'], {}), '(template_file)\n', (383, 398), False, 'import textfsm\n'), ((1123, 1153), 'textfsm.TextFSM', 'textfsm.TextFSM', (['template_file'], {}), '(template_file)\n', (1138, 1153), False, 'import textfsm\n'), ((291, 317), 'os.path.realpath', 'os.path...
import csv import person import string def load(file_name): ppl_list = {} with open(file_name, newline='') as csvfile: filereader = csv.reader(csvfile, delimiter=',') first_row = False for row in filereader: if not first_row: first_row = True ...
[ "csv.writer", "csv.reader", "person.person" ]
[((154, 188), 'csv.reader', 'csv.reader', (['csvfile'], {'delimiter': '""","""'}), "(csvfile, delimiter=',')\n", (164, 188), False, 'import csv\n'), ((1046, 1122), 'csv.writer', 'csv.writer', (['csvfile'], {'delimiter': '""","""', 'quotechar': '"""|"""', 'quoting': 'csv.QUOTE_MINIMAL'}), "(csvfile, delimiter=',', quote...
#!/usr/bin/env python import boto3 from nebula_sdk import Interface, Dynamic as D relay = Interface() session_token = None try: session_token = relay.get(D.aws.connection.sessionToken) except: pass sess = boto3.Session( aws_access_key_id=relay.get(D.aws.connection.accessKeyID), aws_secret_access_key=relay.ge...
[ "nebula_sdk.Interface" ]
[((91, 102), 'nebula_sdk.Interface', 'Interface', ([], {}), '()\n', (100, 102), False, 'from nebula_sdk import Interface, Dynamic as D\n')]
import glob import pandas as pd import json,os from collections import defaultdict from settings import CRAWLING_OUTPUT_FOLDER, SCORING_OUTPUT_FOLDER, PATTERNS_PATH def get_course_view(file): js=json.load(open(file)) courses=defaultdict(list) for pattern_res in js.values(): for course_id in pattern...
[ "pandas.read_csv", "sklearn.metrics.classification_report", "pandas.DataFrame.from_dict", "os.path.split", "collections.defaultdict", "pandas.ExcelWriter", "glob.glob" ]
[((234, 251), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (245, 251), False, 'from collections import defaultdict\n'), ((1696, 1759), 'glob.glob', 'glob.glob', (["('../../' + CRAWLING_OUTPUT_FOLDER + '*courses_2020*')"], {}), "('../../' + CRAWLING_OUTPUT_FOLDER + '*courses_2020*')\n", (1705, 1...
import torch import torch.nn as nn from torch.autograd import Variable from include import IMG_h from include import CNN_h from include import UI_h import torch.utils.data as Data train_path = 'D:/PycharmProjects/Num_distinguish/train_data/labels.txt' test_path = 'D:/PycharmProjects/Num_distinguish/test_data'...
[ "include.CNN_h.CNN", "torch.nn.CrossEntropyLoss", "torch.autograd.Variable", "include.CNN_h.predicted_data", "torch.max", "include.IMG_h.Carlicense_distinguish", "include.CNN_h.decode_output", "torch.utils.data.DataLoader", "include.CNN_h.MyDataset" ]
[((337, 364), 'include.CNN_h.MyDataset', 'CNN_h.MyDataset', (['train_path'], {}), '(train_path)\n', (352, 364), False, 'from include import CNN_h\n'), ((381, 459), 'torch.utils.data.DataLoader', 'Data.DataLoader', ([], {'dataset': 'train_data', 'batch_size': '(1)', 'shuffle': '(True)', 'num_workers': '(0)'}), '(dataset...
#!/usr/bin/env python3.6 # 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, softwar...
[ "io.BytesIO", "devtest.devices.android.adb.AsyncAndroidDeviceClient", "devtest.os.process.get_manager", "devtest.io.reactor.SignalEvent", "devtest.io.reactor.sleep" ]
[((1038, 1059), 'devtest.os.process.get_manager', 'process.get_manager', ([], {}), '()\n', (1057, 1059), False, 'from devtest.os import process\n'), ((3623, 3661), 'devtest.devices.android.adb.AsyncAndroidDeviceClient', 'adb.AsyncAndroidDeviceClient', (['serialno'], {}), '(serialno)\n', (3651, 3661), False, 'from devte...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'user_login.ui' # # Created by: PyQt4 UI code generator 4.11.4 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: def...
[ "PyQt4.QtCore.QSize", "PyQt4.QtGui.QApplication", "PyQt4.QtGui.QDialog", "PyQt4.QtCore.QMetaObject.connectSlotsByName", "PyQt4.QtGui.QLabel", "PyQt4.QtGui.QPushButton", "PyQt4.QtGui.QIcon", "PyQt4.QtCore.QRect", "PyQt4.QtGui.QLineEdit", "PyQt4.QtGui.QApplication.translate", "PyQt4.QtGui.QGroupBo...
[((5343, 5371), 'PyQt4.QtGui.QApplication', 'QtGui.QApplication', (['sys.argv'], {}), '(sys.argv)\n', (5361, 5371), False, 'from PyQt4 import QtCore, QtGui\n'), ((5392, 5407), 'PyQt4.QtGui.QDialog', 'QtGui.QDialog', ([], {}), '()\n', (5405, 5407), False, 'from PyQt4 import QtCore, QtGui\n'), ((471, 535), 'PyQt4.QtGui.Q...
import os import cv2 import queue import random import threading import face_recognition import numpy as np from sklearn import svm import joblib q = queue.Queue() # 加载人脸图片并进行编码 def Encode(): print("Start Encoding") image_path = 'C:\\Users\\Administrator\\Desktop\\face_recognition-master\\examples\\knn_exam...
[ "cv2.rectangle", "face_recognition.face_locations", "os.listdir", "cv2.resize", "cv2.imshow", "cv2.putText", "cv2.waitKey", "face_recognition.face_encodings", "cv2.VideoCapture", "face_recognition.load_image_file", "joblib.load", "threading.Thread", "queue.Queue", "numpy.load", "joblib.d...
[((152, 165), 'queue.Queue', 'queue.Queue', ([], {}), '()\n', (163, 165), False, 'import queue\n'), ((352, 374), 'os.listdir', 'os.listdir', (['image_path'], {}), '(image_path)\n', (362, 374), False, 'import os\n'), ((1109, 1130), 'os.listdir', 'os.listdir', (['data_path'], {}), '(data_path)\n', (1119, 1130), False, 'i...
"""Cutting plane solution algorithm for the lower-level bilevel MILP or LP. Includes a LLCuttingPLane class which applies the cutting plane solution method given a protection vector. Returns the objective value and attack vector obtained from the lower-level bilevel maximization. The class can be used to model either...
[ "cplex.Cplex" ]
[((3322, 3335), 'cplex.Cplex', 'cplex.Cplex', ([], {}), '()\n', (3333, 3335), False, 'import cplex\n'), ((8461, 8474), 'cplex.Cplex', 'cplex.Cplex', ([], {}), '()\n', (8472, 8474), False, 'import cplex\n')]
from numpy import array, compress, zeros import wx from wx.lib.mixins.listctrl import ListCtrlAutoWidthMixin from spacq.interface.list_columns import ListParser """ Embeddable, generic, virtual, tabular display. """ class VirtualListCtrl(wx.ListCtrl, ListCtrlAutoWidthMixin): """ A generic virtual list. """ ma...
[ "wx.BoxSizer", "wx.lib.mixins.listctrl.ListCtrlAutoWidthMixin.__init__", "spacq.interface.list_columns.ListParser", "numpy.array", "wx.ListCtrl.__init__", "wx.Frame.__init__", "wx.Panel.__init__" ]
[((738, 860), 'wx.ListCtrl.__init__', 'wx.ListCtrl.__init__', (['self', 'parent', '*args'], {'style': '(wx.LC_REPORT | wx.LC_VIRTUAL | wx.LC_HRULES | wx.LC_VRULES)'}), '(self, parent, *args, style=wx.LC_REPORT | wx.\n LC_VIRTUAL | wx.LC_HRULES | wx.LC_VRULES, **kwargs)\n', (758, 860), False, 'import wx\n'), ((861, 8...
import unittest import ramda as R """ https://github.com/ramda/ramda/blob/master/test/unionWith.js """ Ro = [{'a': 1}, {'a': 2}, {'a': 3}, {'a': 4}] So = [{'a': 3}, {'a': 4}, {'a': 5}, {'a': 6}] def eqA(r, s): return r['a'] == s['a'] class TestUnionWith(unittest.TestCase): def test_combines_two_lists_into_t...
[ "unittest.main", "ramda.unionWith" ]
[((538, 553), 'unittest.main', 'unittest.main', ([], {}), '()\n', (551, 553), False, 'import unittest\n'), ((481, 505), 'ramda.unionWith', 'R.unionWith', (['eqA', 'Ro', 'So'], {}), '(eqA, Ro, So)\n', (492, 505), True, 'import ramda as R\n')]
import os from services.Utils.converter import Converter from services.Utils.getters import Getter from strategies.models import Company, IndicatorType, StrategyType, StrategyConfig, VisualizationType, TickerData, \ Signal, Order, Trade from backtester.models import BackTestReport, BackTestTrade all_companies = ...
[ "services.Utils.getters.Getter", "strategies.models.Company.objects.all", "os.listdir", "os.mkdir" ]
[((325, 346), 'strategies.models.Company.objects.all', 'Company.objects.all', ([], {}), '()\n', (344, 346), False, 'from strategies.models import Company, IndicatorType, StrategyType, StrategyConfig, VisualizationType, TickerData, Signal, Order, Trade\n'), ((2015, 2056), 'os.listdir', 'os.listdir', (['f"""/home/app/res...
import unittest from colorexlib.colorexlib.common.datastructures import TileGroup, TileGroups class TestInit(unittest.TestCase): def setUp(self): self.tg1 = TileGroup(1, 9,label='label1') self.tg2 = TileGroup(10, 80,label='label2') self.tg3 = TileGroup(-15, 40,label='label3') self.tg4 = TileGroup(50...
[ "unittest.skip", "colorexlib.colorexlib.common.datastructures.TileGroups", "colorexlib.colorexlib.common.datastructures.TileGroup" ]
[((889, 951), 'unittest.skip', 'unittest.skip', (['"""Cannot access and test a private class method"""'], {}), "('Cannot access and test a private class method')\n", (902, 951), False, 'import unittest\n'), ((1005, 1067), 'unittest.skip', 'unittest.skip', (['"""Cannot access and test a private class method"""'], {}), "...
from typing import Any, Dict, List, Optional, Tuple, Union import numpy as np import torch as th from gym import spaces from stable_baselines3.common.buffers import BaseBuffer from stable_baselines3.common.preprocessing import get_obs_shape from stable_baselines3.common.type_aliases import EpisodicRolloutBufferSample...
[ "numpy.ones", "numpy.arange", "numpy.exp", "numpy.sum", "numpy.zeros", "stable_baselines3.common.preprocessing.get_obs_shape" ]
[((2994, 3031), 'stable_baselines3.common.preprocessing.get_obs_shape', 'get_obs_shape', (['self.observation_space'], {}), '(self.observation_space)\n', (3007, 3031), False, 'from stable_baselines3.common.preprocessing import get_obs_shape\n'), ((3193, 3235), 'numpy.zeros', 'np.zeros', (['self.nb_rollouts'], {'dtype': ...
# -*- coding: utf-8 -*- import signal from itertools import groupby, islice try: from itertools import zip_longest except ImportError: from itertools import izip_longest as zip_longest def per_section(it, is_delimiter=lambda x: x.isspace()): """ From http://stackoverflow.com/a/25226944/610569 """...
[ "itertools.izip_longest" ]
[((962, 1001), 'itertools.izip_longest', 'zip_longest', (['*args'], {'fillvalue': 'fillvalue'}), '(*args, fillvalue=fillvalue)\n', (973, 1001), True, 'from itertools import izip_longest as zip_longest\n')]
"""All exceptions for the extension.""" from django.utils.safestring import mark_safe class FileParseError(Exception): """Throw file parsing error.""" def __init__(self, message, errors): """Initialise error messages.""" self.message = message self.errors = errors def to_html(se...
[ "django.utils.safestring.mark_safe" ]
[((858, 873), 'django.utils.safestring.mark_safe', 'mark_safe', (['html'], {}), '(html)\n', (867, 873), False, 'from django.utils.safestring import mark_safe\n')]
# -*- coding: utf-8 -*- try: from setuptools import setup except ImportError: from distutils.core import setup setup(name='biogridpy', version='0.1.1', description='Python client for the BioGRID REST API webservice', license='MIT', keywords=['genetics', 'genomics', 'interaction', 'bioinformat...
[ "distutils.core.setup" ]
[((122, 772), 'distutils.core.setup', 'setup', ([], {'name': '"""biogridpy"""', 'version': '"""0.1.1"""', 'description': '"""Python client for the BioGRID REST API webservice"""', 'license': '"""MIT"""', 'keywords': "['genetics', 'genomics', 'interaction', 'bioinformatics']", 'classifiers': "['Programming Language :: P...
import logging import yarqueue import redis LOGGER = logging.getLogger(__name__) def consume(): queue = yarqueue.Queue( name="example", redis=redis.Redis() ) LOGGER.info("waiting...") while True: data = queue.get() LOGGER.info(data)
[ "logging.getLogger", "redis.Redis" ]
[((55, 82), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (72, 82), False, 'import logging\n'), ((167, 180), 'redis.Redis', 'redis.Redis', ([], {}), '()\n', (178, 180), False, 'import redis\n')]
#%% import numpy as np import pandas as pd from sklearn.metrics import confusion_matrix from sklearn import preprocessing import random #%% df_train = pd.read_csv("data/train_ohe.csv") df_val = pd.read_csv("data/validation_ohe.csv") df_test = pd.read_csv("data/test_ohe.csv") print (df_train.click.va...
[ "sklearn.preprocessing.LabelEncoder", "sklearn.neural_network.MLPClassifier", "pandas.read_csv", "random.seed", "numpy.random.seed", "pandas.DataFrame", "pandas.concat", "sklearn.preprocessing.MinMaxScaler", "sklearn.metrics.confusion_matrix" ]
[((166, 199), 'pandas.read_csv', 'pd.read_csv', (['"""data/train_ohe.csv"""'], {}), "('data/train_ohe.csv')\n", (177, 199), True, 'import pandas as pd\n'), ((210, 248), 'pandas.read_csv', 'pd.read_csv', (['"""data/validation_ohe.csv"""'], {}), "('data/validation_ohe.csv')\n", (221, 248), True, 'import pandas as pd\n'),...
import random import os from func.question import question from func.file import readJsonFile from func.error import saveError def getExam(path, clear): # 模拟考试(40道单选,10道多选) questionList = readJsonFile(path[0]) examList = [] while len(examList) < 40: flag = random.randint(0, len(questionList) -...
[ "os.system", "func.error.saveError", "func.file.readJsonFile" ]
[((198, 219), 'func.file.readJsonFile', 'readJsonFile', (['path[0]'], {}), '(path[0])\n', (210, 219), False, 'from func.file import readJsonFile\n'), ((794, 810), 'os.system', 'os.system', (['clear'], {}), '(clear)\n', (803, 810), False, 'import os\n'), ((741, 765), 'func.error.saveError', 'saveError', (['path[2]', 'it...
# -*- coding: utf-8 -*- # # Created on Tue Jan 16 09:32:22 2018 # # @author: hsauro # --------------------------------------------------------------------- # Plotting Utilities # --------------------------------------------------------------------- import tellurium as _te from mpl_toolkits.mplot3d import Axes3D as _...
[ "matplotlib.pyplot.grid", "teUtils.plotting.plotFluxControlIn3D", "matplotlib.pyplot.ylabel", "math.trunc", "matplotlib.pyplot.subplot2grid", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "teUtils.plotting.plotFluxControlHeatMap", "pandas.DataFrame", "numpy.meshgrid", "matplotlib.pyplot....
[((2939, 2983), 'matplotlib.pyplot.subplots', '_plt.subplots', (['ngrid', 'ngrid'], {'figsize': 'figsize'}), '(ngrid, ngrid, figsize=figsize)\n', (2952, 2983), True, 'import matplotlib.pyplot as _plt\n'), ((4915, 4951), 'matplotlib.pyplot.subplots', '_plt.subplots', (['n', 'n'], {'figsize': 'figsize'}), '(n, n, figsize...
import numpy as np def solution(N): shape=(N+1,N+1) steps = np.zeros(shape,int) steps[3][2] = steps[4][2] = 1 for y in range (5, N+1) : steps[y][2] = steps[y-2][2] + 1 for x in range (3, y + 1) : steps[y][x] = steps[y-x][x-1] ...
[ "numpy.sum", "numpy.zeros" ]
[((70, 90), 'numpy.zeros', 'np.zeros', (['shape', 'int'], {}), '(shape, int)\n', (78, 90), True, 'import numpy as np\n'), ((404, 420), 'numpy.sum', 'np.sum', (['steps[N]'], {}), '(steps[N])\n', (410, 420), True, 'import numpy as np\n')]
import os import pytest import requests from pytest_bdd import given, when, parsers from helpers.environment import Env @given(parsers.parse('I set Req Res API URL to ${base_url}')) def set_req_res_api_base_url(base_url): req_res_api_base_url = os.environ.get(base_url, None) if req_res_api_base_url is None:...
[ "pytest_bdd.parsers.parse", "helpers.environment.Env.get_user_id", "os.environ.get", "requests.get" ]
[((253, 283), 'os.environ.get', 'os.environ.get', (['base_url', 'None'], {}), '(base_url, None)\n', (267, 283), False, 'import os\n'), ((131, 184), 'pytest_bdd.parsers.parse', 'parsers.parse', (['"""I set Req Res API URL to ${base_url}"""'], {}), "('I set Req Res API URL to ${base_url}')\n", (144, 184), False, 'from py...
""" Tests shared for DatetimeIndex/TimedeltaIndex/PeriodIndex """ from datetime import datetime, timedelta import numpy as np import pytest import pandas as pd from pandas import ( CategoricalIndex, DatetimeIndex, Index, PeriodIndex, TimedeltaIndex, date_range, period_range...
[ "pandas.Series", "datetime.datetime", "pandas.DatetimeIndex", "datetime.timedelta", "pandas.Index", "pytest.mark.parametrize", "pandas._testing.assert_numpy_array_equal", "pandas.period_range", "pandas.PeriodIndex", "numpy.timedelta64", "pandas.TimedeltaIndex", "pandas.CategoricalIndex", "pa...
[((1516, 1559), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""freq"""', "['D', 'M']"], {}), "('freq', ['D', 'M'])\n", (1539, 1559), False, 'import pytest\n'), ((4712, 4755), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""freq"""', "['B', 'C']"], {}), "('freq', ['B', 'C'])\n", (4735, 4755), Fa...
from django.urls import path from blog.views import ( BlogPostView, CommentView, CreatePostView, DeletePostView, DownVoteView, HotPostsView, IndexView, UpdatePostView, UpvoteView ) urlpatterns = [ path('', IndexView.as_view(), name='index'), path('hot_posts/', HotPostsView...
[ "blog.views.DownVoteView.as_view", "blog.views.DeletePostView.as_view", "blog.views.BlogPostView.as_view", "blog.views.CreatePostView.as_view", "blog.views.HotPostsView.as_view", "blog.views.UpdatePostView.as_view", "blog.views.IndexView.as_view", "blog.views.CommentView.as_view", "blog.views.Upvote...
[((249, 268), 'blog.views.IndexView.as_view', 'IndexView.as_view', ([], {}), '()\n', (266, 268), False, 'from blog.views import BlogPostView, CommentView, CreatePostView, DeletePostView, DownVoteView, HotPostsView, IndexView, UpdatePostView, UpvoteView\n'), ((308, 330), 'blog.views.HotPostsView.as_view', 'HotPostsView....
#!/usr/bin/env python # Copyright 2019 The Kubernetes 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 appli...
[ "os.path.join", "yaml.load", "json.load", "os.path.dirname", "fnmatch.filter", "os.path.abspath", "os.walk" ]
[((1515, 1539), 'os.path.abspath', 'os.path.abspath', (['rootdir'], {}), '(rootdir)\n', (1530, 1539), False, 'import os\n'), ((1594, 1624), 'os.walk', 'os.walk', (["(rootdir + '/staging/')"], {}), "(rootdir + '/staging/')\n", (1601, 1624), False, 'import os\n'), ((1409, 1421), 'yaml.load', 'yaml.load', (['f'], {}), '(f...
import numpy as np from sklearn import model_selection from sklearn.metrics import confusion_matrix, mean_squared_error from sklearn import metrics from sklearn import model_selection, metrics #Additional sklearn functions from sklearn.metrics import accuracy_score,f1_score,roc_auc_score,log_loss from sklearn.metrics...
[ "numpy.mean", "sklearn.metrics.f1_score", "sklearn.metrics.median_absolute_error", "sklearn.metrics.mean_squared_error", "sklearn.metrics.roc_auc_score", "numpy.errstate", "numpy.lexsort", "sklearn.metrics.log_loss", "numpy.isnan", "sklearn.metrics.precision_score", "sklearn.metrics.recall_score...
[((1194, 1255), 'sklearn.metrics.confusion_matrix', 'confusion_matrix', (['y_true', 'y_pred'], {'sample_weight': 'sample_weight'}), '(y_true, y_pred, sample_weight=sample_weight)\n', (1210, 1255), False, 'from sklearn.metrics import confusion_matrix\n'), ((1523, 1541), 'numpy.mean', 'np.mean', (['per_class'], {}), '(pe...
import bisect from .scan import Scan from .curve import Curve, MIN_STEP from intervalpy import Interval class Extremas(Scan): # TODO: Extremas doesn't need to be a subclass of `Scan` as it only needs to find the local extrema about a point. def __init__(self, func, ref_func, min_deviation=0, min_step=MIN_STE...
[ "bisect.bisect", "intervalpy.Interval", "intervalpy.Interval.empty", "bisect.bisect_left" ]
[((506, 522), 'intervalpy.Interval.empty', 'Interval.empty', ([], {}), '()\n', (520, 522), False, 'from intervalpy import Interval\n'), ((1189, 1222), 'bisect.bisect', 'bisect.bisect', (['self.extrema_xs', 'x'], {}), '(self.extrema_xs, x)\n', (1202, 1222), False, 'import bisect\n'), ((5302, 5335), 'bisect.bisect', 'bis...
# -*- coding:utf-8 -*- import re import json import requests """ 目标APP:逗拍 目标url:APP视频分享链接 爬取思路: 1. 通过APP里的分享获取视频url 2. 对https://v2.doupai.cc/topic/XXXXXX.json发送post请求,获取json数据 """ class DouPai(object): def __init__(self, url): self.url = url self.session = requests.Session() def get_...
[ "re.findall", "json.dumps", "requests.Session", "re.compile" ]
[((288, 306), 'requests.Session', 'requests.Session', ([], {}), '()\n', (304, 306), False, 'import requests\n'), ((395, 435), 're.compile', 're.compile', (['"""(http[s]?://[^\\\\s]+)"""', 're.S'], {}), "('(http[s]?://[^\\\\s]+)', re.S)\n", (405, 435), False, 'import re\n'), ((458, 487), 're.findall', 're.findall', (['p...
from django import template from collections import Iterable from django.template.loader import render_to_string register = template.Library() @register.filter def format_result(value): if not isinstance(value, Iterable): value = [value] output = "" for result in value: if result.grade == "...
[ "django.template.loader.render_to_string", "django.template.Library" ]
[((124, 142), 'django.template.Library', 'template.Library', ([], {}), '()\n', (140, 142), False, 'from django import template\n'), ((3595, 3654), 'django.template.loader.render_to_string', 'render_to_string', (['"""includes/format_result.html"""', 'formatdict'], {}), "('includes/format_result.html', formatdict)\n", (3...
# # Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. # """ VNC management for kubernetes """ import gevent from gevent.queue import Empty import requests import argparse import uuid from cfgm_common import importutils from cfgm_common import vnc_cgitb from cfgm_common.vnc_amqp import VncAmqpHandle fro...
[ "gevent.sleep", "uuid.uuid4", "cfgm_common.importutils.import_object", "cfgm_common.vnc_amqp.VncAmqpHandle", "label_cache.LabelCache", "db.KubeNetworkManagerDB" ]
[((756, 803), 'db.KubeNetworkManagerDB', 'db.KubeNetworkManagerDB', (['self.args', 'self.logger'], {}), '(self.args, self.logger)\n', (779, 803), False, 'import db\n'), ((911, 998), 'cfgm_common.vnc_amqp.VncAmqpHandle', 'VncAmqpHandle', (['self.logger', 'DBBaseKM', 'REACTION_MAP', '"""kube_manager"""'], {'args': 'self....
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os.path import sys from ipaddress import ip_address from urllib.parse import urlsplit sys.path.append(os.path.join(os.path.dirname(__file__), '.')) import time from PyQt5.QtCore import QObject, pyqtSignal from constants import user_dir, log_File, masterno...
[ "constants.DEFAULT_RPC_CONF.copy", "PyQt5.QtCore.pyqtSignal", "ipaddress.ip_address", "urllib.parse.urlsplit", "PyQt5.QtCore.QObject.__init__", "requests.get", "sys._getframe", "simplejson.load", "time.sleep", "simplejson.dump", "time.time" ]
[((1120, 1213), 'requests.get', 'requests.get', (['"""https://raw.githubusercontent.com/project-qmc/QMT/master/src/version.txt"""'], {}), "(\n 'https://raw.githubusercontent.com/project-qmc/QMT/master/src/version.txt')\n", (1132, 1213), False, 'import requests\n'), ((7700, 7723), 'constants.DEFAULT_RPC_CONF.copy', '...
from datetime import date from decimal import Decimal from django.urls import reverse from prices import Money from saleor.discount import DiscountValueType, VoucherType from saleor.discount.models import Sale, Voucher def test_sales_list(admin_client, sale): url = reverse('dashboard:sale-list') response = ...
[ "django.urls.reverse", "prices.Money", "saleor.discount.models.Sale.objects.count", "datetime.date", "saleor.discount.models.Voucher.objects.all", "saleor.discount.models.Sale.objects.first", "decimal.Decimal" ]
[((274, 304), 'django.urls.reverse', 'reverse', (['"""dashboard:sale-list"""'], {}), "('dashboard:sale-list')\n", (281, 304), False, 'from django.urls import reverse\n'), ((440, 473), 'django.urls.reverse', 'reverse', (['"""dashboard:voucher-list"""'], {}), "('dashboard:voucher-list')\n", (447, 473), False, 'from djang...
"""Functions to read from and write to misc sources """ import os import json import pickle import csv import gzip from io import StringIO from py2store.stores.local_store import LocalBinaryStore from py2store.slib.s_zipfile import FilesOfZip from py2store.slib.s_configparser import ConfigReader, ConfigStore from py2...
[ "json.loads", "pickle.dumps", "py2store.stores.local_store.LocalBinaryStore", "csv.writer", "os.path.splitext", "py2store.examples.dropbox_w_urllib.bytes_from_dropbox", "json.dumps", "py2store.slib.s_configparser.ConfigReader.ExtendedInterpolation", "pickle.loads", "io.StringIO", "os.path.abspat...
[((443, 455), 'io.StringIO', 'StringIO', (['""""""'], {}), "('')\n", (451, 455), False, 'from io import StringIO\n'), ((469, 483), 'csv.writer', 'csv.writer', (['fp'], {}), '(fp)\n', (479, 483), False, 'import csv\n'), ((4451, 4490), 'py2store.util.imdict', 'imdict', (['dflt_incoming_val_trans_for_key'], {}), '(dflt_in...
import pytest from mixer.backend.django import mixer # We need to do this so that writing to the DB is possible in our tests. pytestmark = pytest.mark.django_db def test_message(): obj = mixer.blend('simple_app.Message') assert obj.pk > 0
[ "mixer.backend.django.mixer.blend" ]
[((194, 227), 'mixer.backend.django.mixer.blend', 'mixer.blend', (['"""simple_app.Message"""'], {}), "('simple_app.Message')\n", (205, 227), False, 'from mixer.backend.django import mixer\n')]
# importing Movie Model from app.model.movie import Movie # Movie Data movie_data = [ Movie("<NAME>", "Freedom forever", "http://upload.wikimedia.org/wikipedia/en/thumb/9/9f/Vforvendettamov.jpg/220px-Vforvendettamov.jpg", "https://www.youtube.com/watch?v=k_13fFIrhPk", "2005"), Movie("Matrix", "Freedom f...
[ "app.model.movie.Movie" ]
[((90, 289), 'app.model.movie.Movie', 'Movie', (['"""<NAME>"""', '"""Freedom forever"""', '"""http://upload.wikimedia.org/wikipedia/en/thumb/9/9f/Vforvendettamov.jpg/220px-Vforvendettamov.jpg"""', '"""https://www.youtube.com/watch?v=k_13fFIrhPk"""', '"""2005"""'], {}), "('<NAME>', 'Freedom forever',\n 'http://upload...
"""File containing links to data samples used (pointsource tracks). Path to local copy of point source tracks, downloaded from /data/ana .. /current with following README: This directory contains an update to version-002p02 which fixes the leap second bug for event MJDs in runs 120398 to 126377, inclusive. ...
[ "logging.getLogger", "flarestack.data.icecube.ic_season.IceCubeDataset", "numpy.radians", "flarestack.data.icecube.ps_tracks.get_ps_binning" ]
[((3990, 4017), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (4007, 4017), False, 'import logging\n'), ((4134, 4150), 'flarestack.data.icecube.ic_season.IceCubeDataset', 'IceCubeDataset', ([], {}), '()\n', (4148, 4150), False, 'from flarestack.data.icecube.ic_season import IceCubeDatase...
import smtplib from email.message import EmailMessage import os msg = EmailMessage() msg['from'] = sender = os.getenv('EMAIL_SENDER') msg['to'] = os.getenv('EMAIL_RECEIVER') msg['subject'] = 'Testing text email through python' msg.set_content('Hi! let us hope this works.') with smtplib.SMTP_SSL('smtp.gmail.com') as ...
[ "email.message.EmailMessage", "os.getenv", "smtplib.SMTP_SSL" ]
[((72, 86), 'email.message.EmailMessage', 'EmailMessage', ([], {}), '()\n', (84, 86), False, 'from email.message import EmailMessage\n'), ((110, 135), 'os.getenv', 'os.getenv', (['"""EMAIL_SENDER"""'], {}), "('EMAIL_SENDER')\n", (119, 135), False, 'import os\n'), ((148, 175), 'os.getenv', 'os.getenv', (['"""EMAIL_RECEI...
#!/usr/bin/env python3 import os from pathlib import Path import mimetypes import requests import json import uuid from urllib.parse import quote import hashlib # logger from logging import getLogger logger = getLogger(__name__) from .loadrc import KEY_GROWI_USERNAME def _set_proxy(proxy): if proxy is None: ...
[ "logging.getLogger", "requests.post", "pathlib.Path", "urllib.parse.quote", "requests.get", "mimetypes.guess_type" ]
[((211, 230), 'logging.getLogger', 'getLogger', (['__name__'], {}), '(__name__)\n', (220, 230), False, 'from logging import getLogger\n'), ((1267, 1281), 'pathlib.Path', 'Path', (['filename'], {}), '(filename)\n', (1271, 1281), False, 'from pathlib import Path\n'), ((2606, 2659), 'requests.get', 'requests.get', (["(url...
# Copyright (c) 2017, <NAME> <<EMAIL>> # All rights reserved # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of conditions and t...
[ "fspke.cwhash.CWHashFunction", "ecpy.point.Point", "ecpy.point.Generator.init", "fspke.rabinmiller.isPrime", "fspke.cwhash.CWHashFunction.deserialize" ]
[((3784, 3828), 'ecpy.point.Generator.init', 'Generator.init', (['G[0]', 'G[1]'], {'curve': 'self.curve'}), '(G[0], G[1], curve=self.curve)\n', (3798, 3828), False, 'from ecpy.point import Point, Generator\n'), ((4491, 4513), 'fspke.cwhash.CWHashFunction', 'CWHashFunction', (['self.q'], {}), '(self.q)\n', (4505, 4513),...
import json import xlwt import datetime # конвертирует json в таблицу toconvert="yamokat.txt" with open(toconvert, 'r') as r: readed = r.read().split('\n') infos = list(map(lambda x: json.loads(x), readed)) book = xlwt.Workbook(encoding="utf-8") sh = book.add_sheet() tabs = set() for i in infos: tabs....
[ "datetime.datetime.today", "json.loads", "xlwt.Workbook" ]
[((227, 258), 'xlwt.Workbook', 'xlwt.Workbook', ([], {'encoding': '"""utf-8"""'}), "(encoding='utf-8')\n", (240, 258), False, 'import xlwt\n'), ((194, 207), 'json.loads', 'json.loads', (['x'], {}), '(x)\n', (204, 207), False, 'import json\n'), ((533, 558), 'datetime.datetime.today', 'datetime.datetime.today', ([], {}),...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import sys if sys.version_info >= (3, 0, 0): from urllib.parse import urlparse else: from urlparse import urlparse if sys.version_info >= (3, 5, 0): def isclose(a, b, rel_tol=1e-09, abs_tol=0.0): return abs(a - b) <= max(rel_tol * ma...
[ "django.shortcuts.render", "django.contrib.auth.get_user_model", "appxs.account.models.user.Menu.objects.get", "spmo.common.Common", "appxs.account.models.user.Role.objects.get", "django.http.HttpResponse", "json.dumps", "django.shortcuts.get_object_or_404", "appxs.account.models.user.Menu", "spcc...
[((790, 806), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (804, 806), False, 'from django.contrib.auth import get_user_model\n'), ((1404, 1412), 'spmo.common.Common', 'Common', ([], {}), '()\n', (1410, 1412), False, 'from spmo.common import Common\n'), ((4216, 4272), 'django.shortcuts.rend...
# -*- coding: utf-8 -*- """ script for setting up pascal-like datasets copyright:kentaroy47 10/2/2018 """ import os import subprocess import argparse parser = argparse.ArgumentParser(description='Train a Fast R-CNN network') parser.add_argument('--dataset', dest='dataset', help='training datase...
[ "subprocess.call", "argparse.ArgumentParser" ]
[((162, 227), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Train a Fast R-CNN network"""'}), "(description='Train a Fast R-CNN network')\n", (185, 227), False, 'import argparse\n'), ((1226, 1262), 'subprocess.call', 'subprocess.call', (['command'], {'shell': '(True)'}), '(command, shel...
# Python Standard Library Imports import copy # Third Party (PyPI) Imports #import json #import requests import rollbar # HTK Imports from htk.utils import htk_setting def is_valid_alexa_skill_webhook_event(event, request): """Determines whether the Alexa skill webhook event is valid Mutates `event` by add...
[ "rollbar.report_exc_info", "htk.utils.general.resolve_method_dynamically", "htk.utils.htk_setting", "htk.utils.request.get_request_metadata" ]
[((668, 718), 'htk.utils.htk_setting', 'htk_setting', (['"""HTK_ALEXA_SKILL_EVENT_TYPE_RESOLVER"""'], {}), "('HTK_ALEXA_SKILL_EVENT_TYPE_RESOLVER')\n", (679, 718), False, 'from htk.utils import htk_setting\n'), ((806, 864), 'htk.utils.general.resolve_method_dynamically', 'resolve_method_dynamically', (['event_type_reso...
#!/usr/bin/env python3 import multiprocessing import os import shlex import shutil import subprocess import sys import tempfile import traceback class AsyncWorker(multiprocessing.Process): def __init__(self, out_q, path_src, path_script, args): super(AsyncWorker, self).__init__() self.out_q = out...
[ "subprocess.Popen", "traceback.print_exc", "tempfile.mkdtemp", "shutil.rmtree" ]
[((595, 720), 'subprocess.Popen', 'subprocess.Popen', (['args'], {'universal_newlines': '(True)', 'stdin': 'subprocess.DEVNULL', 'stdout': 'subprocess.PIPE', 'stderr': 'subprocess.PIPE'}), '(args, universal_newlines=True, stdin=subprocess.DEVNULL,\n stdout=subprocess.PIPE, stderr=subprocess.PIPE)\n', (611, 720), Fal...
# by protago90 from tictactoe.board import BoardAPI from abc import abstractmethod from typing import Callable, List, Optional, Tuple import random import time class PlayerAPI(): SIGNS = BoardAPI.SIGNS # TicTacToe's board hardcoded signs NAP = 0 ID = 'none' def __init__(self, sign: str) -> None: ...
[ "random.random", "time.sleep" ]
[((1284, 1304), 'time.sleep', 'time.sleep', (['self.nap'], {}), '(self.nap)\n', (1294, 1304), False, 'import time\n'), ((4654, 4669), 'random.random', 'random.random', ([], {}), '()\n', (4667, 4669), False, 'import random\n'), ((5429, 5444), 'random.random', 'random.random', ([], {}), '()\n', (5442, 5444), False, 'impo...
#!/usr/bin/env python3 """ Slithering Snakes I think the title is self explanatory. .................... Functions: - slithering_snake_12: Lights up then turns off the LEDs on arms 1 and 2 - slithering_snake_13: Lights up then turns off the LEDs on arms 1 and 3 - slithering_snake_21: Lights up then turns off the LED...
[ "logging.getLogger", "bfp_piglow_modules.print_header", "bfp_piglow_modules.check_log_directory", "logging.Formatter", "bfp_piglow_modules.stop", "bfp_piglow_modules.delete_empty_logs", "time.sleep", "logging.FileHandler", "PyGlow.PyGlow" ]
[((1544, 1552), 'PyGlow.PyGlow', 'PyGlow', ([], {}), '()\n', (1550, 1552), False, 'from PyGlow import PyGlow\n'), ((2003, 2021), 'time.sleep', 'sleep', (['sleep_speed'], {}), '(sleep_speed)\n', (2008, 2021), False, 'from time import sleep\n'), ((2049, 2067), 'time.sleep', 'sleep', (['sleep_speed'], {}), '(sleep_speed)\...
from copy import deepcopy from .announcement import Announcement as Ann from .base_as import AS from .incoming_anns import IncomingAnns from .relationships import Relationships class BGPAS(AS): __slots__ = [] def propogate_to_providers(self): """Propogates to providers""" send_rels = set([R...
[ "copy.deepcopy" ]
[((1563, 1576), 'copy.deepcopy', 'deepcopy', (['ann'], {}), '(ann)\n', (1571, 1576), False, 'from copy import deepcopy\n')]
from tempfile import NamedTemporaryFile import PyPDF4 import urllib import urllib.request import shutil import json import os import sys URL = 'http://ww11.doh.state.fl.us/comm/_partners/covid19_report_archive/cases-monitoring-and-pui-information/state-report/state_reports_latest.pdf' SER_URL = 'http://ww11.doh.state...
[ "shutil.copyfileobj", "urllib.request.Request", "os.path.join", "tempfile.NamedTemporaryFile", "urllib.request.urlopen", "PyPDF4.PdfFileReader" ]
[((3342, 3372), 'PyPDF4.PdfFileReader', 'PyPDF4.PdfFileReader', (['filepath'], {}), '(filepath)\n', (3362, 3372), False, 'import PyPDF4\n'), ((4078, 4105), 'urllib.request.Request', 'urllib.request.Request', (['url'], {}), '(url)\n', (4100, 4105), False, 'import urllib\n'), ((4119, 4146), 'urllib.request.urlopen', 'url...
import collections import openmlpimp from ConfigSpace.hyperparameters import UniformFloatHyperparameter, \ UniformIntegerHyperparameter, CategoricalHyperparameter from scipy.stats import gaussian_kde from sklearn.model_selection._search import BaseSearchCV from sklearn.model_selection._search import ParameterSam...
[ "sklearn.utils.validation.indexable", "math.ceil", "sklearn.externals.joblib.delayed", "numpy.average", "sklearn.base.clone", "sklearn.base.is_classifier", "numpy.flatnonzero", "sklearn.model_selection._search.ParameterSampler", "numpy.argsort", "numpy.array", "sklearn.utils.resample", "sklear...
[((1016, 1037), 'sklearn.base.clone', 'clone', (['self.estimator'], {}), '(self.estimator)\n', (1021, 1037), False, 'from sklearn.base import is_classifier, clone\n'), ((3683, 3736), 'numpy.array', 'np.array', (['test_sample_counts[:n_splits]'], {'dtype': 'np.int'}), '(test_sample_counts[:n_splits], dtype=np.int)\n', (...
# # usage: python k26.py {file name} {article title} {template name} # import sys import re from k20 import load_article from k25 import template2dict def remove_stress(dc): r = re.compile("'+") return {k:r.sub('', v) for k,v in dc.items()} if __name__ == '__main__': fn, title, template = sys.argv[1:] ...
[ "k20.load_article", "k25.template2dict", "re.compile" ]
[((184, 200), 're.compile', 're.compile', (['"""\'+"""'], {}), '("\'+")\n', (194, 200), False, 'import re\n'), ((332, 355), 'k20.load_article', 'load_article', (['fn', 'title'], {}), '(fn, title)\n', (344, 355), False, 'from k20 import load_article\n'), ((365, 397), 'k25.template2dict', 'template2dict', (['article', 't...
import os from pymongo import MongoClient try: from auth import MONGOLAB_URI except: MONGOLAB_URI = os.environ.get('MONGOLAB_URI') client = MongoClient(MONGOLAB_URI) db = client.get_default_database() dementia = db['dementia'] if __name__=="__main__": seed = [ { 'name' : 'imranariffin', 'contact' : '0123456...
[ "pymongo.MongoClient", "os.environ.get" ]
[((143, 168), 'pymongo.MongoClient', 'MongoClient', (['MONGOLAB_URI'], {}), '(MONGOLAB_URI)\n', (154, 168), False, 'from pymongo import MongoClient\n'), ((102, 132), 'os.environ.get', 'os.environ.get', (['"""MONGOLAB_URI"""'], {}), "('MONGOLAB_URI')\n", (116, 132), False, 'import os\n')]