code stringlengths 20 1.04M | apis list | extract_api stringlengths 75 9.94M |
|---|---|---|
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.ios import run_commands
from ansible.module_utils.ios import ios_argument_spec, check_args
import re
def main():
""" main entry point for module execution
"""
argument_spec = dict(
count=dict(type="int"),
dest=d... | [
"ansible.module_utils.basic.AnsibleModule",
"re.compile",
"ansible.module_utils.ios.check_args",
"ansible.module_utils.ios.run_commands"
] | [((561, 603), 'ansible.module_utils.basic.AnsibleModule', 'AnsibleModule', ([], {'argument_spec': 'argument_spec'}), '(argument_spec=argument_spec)\n', (574, 603), False, 'from ansible.module_utils.basic import AnsibleModule\n'), ((768, 796), 'ansible.module_utils.ios.check_args', 'check_args', (['module', 'warnings'],... |
from unittest.mock import call, MagicMock, patch
import torch
from pytorch_lightning.loggers import AzureMlLogger
def test_azureml_logger():
mock_run = MagicMock()
with patch('azureml.core.Run.get_context', return_value=mock_run):
logger = AzureMlLogger()
assert logger.experiment is mock_run... | [
"torch.ones",
"unittest.mock.MagicMock",
"unittest.mock.patch",
"pytorch_lightning.loggers.AzureMlLogger",
"unittest.mock.call"
] | [((160, 171), 'unittest.mock.MagicMock', 'MagicMock', ([], {}), '()\n', (169, 171), False, 'from unittest.mock import call, MagicMock, patch\n'), ((473, 484), 'unittest.mock.MagicMock', 'MagicMock', ([], {}), '()\n', (482, 484), False, 'from unittest.mock import call, MagicMock, patch\n'), ((498, 521), 'pytorch_lightni... |
import time
import logging
import pulsar
LOGGER = logging.getLogger(__name__)
class PulseSecrets:
def __init__(self, url, admin_token, api_url, cert_file):
self.url = url
self.admin_token = admin_token
self.api_url = api_url
self.cert_file = cert_file
def send_message(pulsar_url... | [
"pulsar.AuthenticationToken",
"pulsar.Client",
"logging.getLogger",
"time.time"
] | [((51, 78), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (68, 78), False, 'import logging\n'), ((368, 401), 'pulsar.AuthenticationToken', 'pulsar.AuthenticationToken', (['token'], {}), '(token)\n', (394, 401), False, 'import pulsar\n'), ((415, 503), 'pulsar.Client', 'pulsar.Client', (['... |
# Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | [
"apex.amp.initialize"
] | [((1107, 1167), 'apex.amp.initialize', 'amp.initialize', (['self.network', 'self.optimizer'], {'opt_level': '"""O1"""'}), "(self.network, self.optimizer, opt_level='O1')\n", (1121, 1167), False, 'from apex import amp\n')] |
import os
import cv2
import mmcv
import numpy as np
from mmcv.image import imread, imwrite
from mmcv import color_val
from mmdet.apis import init_detector, inference_detector
config_file = 'configs_zhym/faster_rcnn_r50_fpn_1x_voc_handeonlytable.py'
checkpoint_file = 'work_dirs/faster_rcnn_r50_fpn_1x_handeonlytable/epo... | [
"os.listdir",
"numpy.full",
"cv2.putText",
"mmcv.image.imread",
"os.path.basename",
"mmdet.apis.init_detector",
"mmdet.apis.inference_detector",
"mmcv.color_val",
"mmcv.image.imwrite",
"cv2.rectangle",
"numpy.vstack",
"os.path.join",
"mmcv.imread",
"numpy.concatenate"
] | [((548, 608), 'mmdet.apis.init_detector', 'init_detector', (['config_file', 'checkpoint_file'], {'device': '"""cuda:0"""'}), "(config_file, checkpoint_file, device='cuda:0')\n", (561, 608), False, 'from mmdet.apis import init_detector, inference_detector\n'), ((1094, 1115), 'os.path.basename', 'os.path.basename', (['im... |
from mindstorms import MSHub, Motor, MotorPair, ColorSensor, DistanceSensor, App
from mindstorms.control import wait_for_seconds, wait_until, Timer
from mindstorms.operator import greater_than, greater_than_or_equal_to, less_than, less_than_or_equal_to, equal_to, not_equal_to
import math
# drawing a simple house with ... | [
"mindstorms.Motor",
"mindstorms.MSHub",
"mindstorms.MotorPair"
] | [((434, 441), 'mindstorms.MSHub', 'MSHub', ([], {}), '()\n', (439, 441), False, 'from mindstorms import MSHub, Motor, MotorPair, ColorSensor, DistanceSensor, App\n'), ((499, 509), 'mindstorms.Motor', 'Motor', (['"""C"""'], {}), "('C')\n", (504, 509), False, 'from mindstorms import MSHub, Motor, MotorPair, ColorSensor, ... |
from __future__ import print_function
import os
from tuple_generator.open_ie_api.main import stanford_ie
tmp_folder = '/tmp/open_ie_api/'
if not os.path.exists(tmp_folder):
os.makedirs(tmp_folder)
def texts_to_files(texts):
full_tmp_file_names = []
count = 0
for text in texts:
tmp_filename ... | [
"os.path.isfile",
"os.path.exists",
"os.makedirs",
"tuple_generator.open_ie_api.main.stanford_ie"
] | [((148, 174), 'os.path.exists', 'os.path.exists', (['tmp_folder'], {}), '(tmp_folder)\n', (162, 174), False, 'import os\n'), ((180, 203), 'os.makedirs', 'os.makedirs', (['tmp_folder'], {}), '(tmp_folder)\n', (191, 203), False, 'import os\n'), ((1144, 1164), 'os.path.isfile', 'os.path.isfile', (['text'], {}), '(text)\n'... |
# f = open('data/coco/val2017.txt', 'r')
# f1 = open('data/coco/val2017.shapes', 'r')
import os
imagedir = 'data/coco/images/train2017/'
newdir = 'data/coco/empty/train2017'
nonemptyfile = 0
imagelist = os.listdir(newdir)
with open('data/coco/train2017.txt', 'r') as r:
lines=r.readlines()
with open('data/coco/tra... | [
"os.listdir"
] | [((204, 222), 'os.listdir', 'os.listdir', (['newdir'], {}), '(newdir)\n', (214, 222), False, 'import os\n')] |
#!/usr/bin/env python3
# --------------------( LICENSE )--------------------
# Copyright (c) 2014-2021 Beartype authors.
# See "LICENSE" for further details.
"""
**Beartype Least Recently Used (LRU) caching utilities.**
This private submodule implements supplementary cache-specific utility
f... | [
"threading.Lock",
"beartype.roar._roarexc._BeartypeUtilLRUCacheException"
] | [((4260, 4266), 'threading.Lock', 'Lock', ([], {}), '()\n', (4264, 4266), False, 'from threading import Lock\n'), ((4093, 4167), 'beartype.roar._roarexc._BeartypeUtilLRUCacheException', '_BeartypeUtilLRUCacheException', (['f"""LRU cache capacity {size} not positive."""'], {}), "(f'LRU cache capacity {size} not positive... |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('phone', '0003_auto_20190405_1752'),
]
operations = [
migrations.AlterField(
model_name='synclogsql',
name='error_date',
field=models.DateTimeField(blank=... | [
"django.db.models.CharField",
"django.db.models.DateTimeField"
] | [((293, 336), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'blank': '(True)', 'null': '(True)'}), '(blank=True, null=True)\n', (313, 336), False, 'from django.db import migrations, models\n'), ((466, 569), 'django.db.models.CharField', 'models.CharField', ([], {'choices': "[('simplified', 'simplified... |
# -*- coding: utf-8 -*-
"""
Created on 2018/10/31
@author: gaoan
"""
import six
import pandas as pd
from tigeropen.common.response import TigerResponse
from tigeropen.common.util.string_utils import get_string
COLUMNS = ['identifier', 'symbol', 'expiry', 'strike', 'put_call', 'multiplier', 'ask_price', 'ask_size', 'b... | [
"pandas.DataFrame",
"tigeropen.common.util.string_utils.get_string"
] | [((2268, 2309), 'pandas.DataFrame', 'pd.DataFrame', (['chain_data'], {'columns': 'COLUMNS'}), '(chain_data, columns=COLUMNS)\n', (2280, 2309), True, 'import pandas as pd\n'), ((1865, 1882), 'tigeropen.common.util.string_utils.get_string', 'get_string', (['value'], {}), '(value)\n', (1875, 1882), False, 'from tigeropen.... |
import toga
from toga.style import Pack
from toga.constants import COLUMN, ROW
class ExampleMultilineTextInputApp(toga.App):
# Button callback functions
def enable_toggle_pressed(self, widget, **kwargs):
self.multiline_input.readonly = not self.multiline_input.readonly
def clear_pressed(self, wid... | [
"toga.style.Pack",
"toga.MainWindow"
] | [((424, 456), 'toga.MainWindow', 'toga.MainWindow', ([], {'title': 'self.name'}), '(title=self.name)\n', (439, 456), False, 'import toga\n'), ((615, 627), 'toga.style.Pack', 'Pack', ([], {'flex': '(1)'}), '(flex=1)\n', (619, 627), False, 'from toga.style import Pack\n'), ((781, 793), 'toga.style.Pack', 'Pack', ([], {'f... |
from rest_framework.views import APIView
from rest_framework.response import Response
from ..models import *
from ..serializers import *
class MessagesView(APIView):
def get(self, request):
if 'app_id' in request.query_params:
app_id = request.query_params['app_id']
messages = Me... | [
"rest_framework.response.Response"
] | [((486, 502), 'rest_framework.response.Response', 'Response', (['result'], {}), '(result)\n', (494, 502), False, 'from rest_framework.response import Response\n')] |
#!/usr/bin/env python
#
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import azure.functions as func
from onefuzztypes.enums import ErrorCode
from onefuzztypes.models import Error, FileEntry
from ..onefuzzlib.azure.containers import (
blob_exists,
container_exists,
get_file_sas_... | [
"onefuzztypes.models.Error"
] | [((653, 720), 'onefuzztypes.models.Error', 'Error', ([], {'code': 'ErrorCode.INVALID_REQUEST', 'errors': "['invalid container']"}), "(code=ErrorCode.INVALID_REQUEST, errors=['invalid container'])\n", (658, 720), False, 'from onefuzztypes.models import Error, FileEntry\n'), ((868, 934), 'onefuzztypes.models.Error', 'Err... |
import json
filename = 'numbers.json'
with open(f"txt_files/{filename}") as f:
numbers = json.load(f)
print(numbers) | [
"json.load"
] | [((95, 107), 'json.load', 'json.load', (['f'], {}), '(f)\n', (104, 107), False, 'import json\n')] |
"""
Python bindings for the HHsearch program. Capable of executing multiple
HHsearch jobs in parallel.
"""
import multiprocessing as mp
import csb.apps
import csb.io
import csb.bio.io
class ExitCodes(csb.apps.ExitCodes):
IO_ERROR = 2
INVALID_DATA = 3
EXT_TOOL_FAILURE = 4
class AppRunner(csb.a... | [
"multiprocessing.Pool",
"multiprocessing.cpu_count"
] | [((460, 474), 'multiprocessing.cpu_count', 'mp.cpu_count', ([], {}), '()\n', (472, 474), True, 'import multiprocessing as mp\n'), ((6926, 6940), 'multiprocessing.cpu_count', 'mp.cpu_count', ([], {}), '()\n', (6938, 6940), True, 'import multiprocessing as mp\n'), ((7140, 7156), 'multiprocessing.Pool', 'mp.Pool', (['work... |
## IvB May 2018
# Mask protein sequences to prepare motif detection
# Select best matching Pfam and mask it
# Input: HMMscan domain tblout, fasta file for OGs
# Outputs: Fasta file without Pfam repeats, chopped out
import sys, os
import csv
import operator
import re
import json
import pipeline_methods as pre
input_... | [
"pipeline_methods.write_chopped_file",
"pipeline_methods.read_fasta",
"pipeline_methods.parse_domtblout",
"pipeline_methods.get_best_hit"
] | [((927, 953), 'pipeline_methods.read_fasta', 'pre.read_fasta', (['fasta_file'], {}), '(fasta_file)\n', (941, 953), True, 'import pipeline_methods as pre\n'), ((986, 1015), 'pipeline_methods.parse_domtblout', 'pre.parse_domtblout', (['hmmr_tbl'], {}), '(hmmr_tbl)\n', (1005, 1015), True, 'import pipeline_methods as pre\n... |
# Standard library imports
from sqlalchemy.inspection import inspect
from datetime import datetime, timedelta
from pandas import isnull
# project imports
from PhosQuest_app.data_access.db_sessions import import_session_maker
from PhosQuest_app.data_access.class_functions import get_classes_key_attrs
# define null-typ... | [
"PhosQuest_app.data_access.class_functions.get_classes_key_attrs",
"pandas.isnull",
"datetime.datetime.now",
"datetime.timedelta",
"PhosQuest_app.data_access.db_sessions.import_session_maker"
] | [((5199, 5213), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (5211, 5213), False, 'from datetime import datetime, timedelta\n'), ((5727, 5763), 'PhosQuest_app.data_access.class_functions.get_classes_key_attrs', 'get_classes_key_attrs', (['classes_in_df'], {}), '(classes_in_df)\n', (5748, 5763), False, 'fr... |
import os
import hashlib
import stat
from .utils import SortableDict, verbose, INFO, DEBUG, WARNING, ERROR
# For Python < 3.3 support
import sys
if sys.version_info[1] < 3:
FileNotFoundError = OSError
class INodeFile(object):
"""
An file object with referce to an inode and not to an path.
More then... | [
"os.remove",
"hashlib.md5",
"stat.S_ISREG",
"hashlib.sha1",
"os.rename",
"os.walk",
"os.link",
"stat.S_ISDIR",
"os.path.join",
"os.lstat"
] | [((2937, 2951), 'os.lstat', 'os.lstat', (['path'], {}), '(path)\n', (2945, 2951), False, 'import os\n'), ((761, 780), 'os.lstat', 'os.lstat', (['firstfile'], {}), '(firstfile)\n', (769, 780), False, 'import os\n'), ((10115, 10133), 'stat.S_ISDIR', 'stat.S_ISDIR', (['mode'], {}), '(mode)\n', (10127, 10133), False, 'impo... |
# Generated by Django 2.1 on 2021-01-21 13:56
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('app', '0033_auto_20210120_1458'),
]
operations = [
migrations.RenameModel(
old_name='ListCompetence',
new_name='ListofCompeten... | [
"django.db.migrations.RenameModel"
] | [((221, 299), 'django.db.migrations.RenameModel', 'migrations.RenameModel', ([], {'old_name': '"""ListCompetence"""', 'new_name': '"""ListofCompetence"""'}), "(old_name='ListCompetence', new_name='ListofCompetence')\n", (243, 299), False, 'from django.db import migrations\n')] |
# -*- coding: utf-8 -*-
"""
INTRO
<NAME> (C)
Created on Sat May 4 14:07:49 2019
Aerodynamics, AE
TU Delft
"""
import numpy as np
from screws.freeze.main import FrozenOnly
class NumBasis(FrozenOnly):
""" """
def __init__(self, FS):
""" """
assert FS.ndim == 3, " <NumBasis> "
self.... | [
"numpy.sum",
"numpy.prod"
] | [((7655, 7681), 'numpy.sum', 'np.sum', (['_basis_components_'], {}), '(_basis_components_)\n', (7661, 7681), True, 'import numpy as np\n'), ((8013, 8039), 'numpy.sum', 'np.sum', (['_basis_components_'], {}), '(_basis_components_)\n', (8019, 8039), True, 'import numpy as np\n'), ((8165, 8185), 'numpy.prod', 'np.prod', (... |
#!/usr/bin/env python
# coding=utf-8
# aeneas is a Python/C library and a set of tools
# to automagically synchronize audio and text (aka forced alignment)
#
# Copyright (C) 2012-2013, <NAME> (www.albertopettarin.it)
# Copyright (C) 2013-2015, ReadBeyond Srl (www.readbeyond.it)
# Copyright (C) 2015-2017, <NAME> (www... | [
"subprocess.Popen",
"aeneas.globalfunctions.safe_bytes",
"aeneas.globalfunctions.tmp_file",
"aeneas.globalfunctions.delete_file",
"aeneas.exacttiming.TimeValue",
"aeneas.globalfunctions.safe_unicode",
"io.open"
] | [((3280, 3293), 'aeneas.globalfunctions.tmp_file', 'gf.tmp_file', ([], {}), '()\n', (3291, 3293), True, 'import aeneas.globalfunctions as gf\n'), ((3338, 3351), 'aeneas.globalfunctions.tmp_file', 'gf.tmp_file', ([], {}), '()\n', (3349, 3351), True, 'import aeneas.globalfunctions as gf\n'), ((4187, 4314), 'subprocess.Po... |
import sys
import subprocess
from vaurien.webserver import get_config
from gevent.pywsgi import WSGIServer
class FakeProxy(object):
"""Fake proxy object, to mock the proxy in the tests"""
def __init__(self, behaviors=None, backend=None):
self.behaviors = behaviors or ['default', 'blackout']
... | [
"subprocess.Popen",
"vaurien.webserver.get_config"
] | [((926, 938), 'vaurien.webserver.get_config', 'get_config', ([], {}), '()\n', (936, 938), False, 'from vaurien.webserver import get_config\n'), ((1237, 1306), 'subprocess.Popen', 'subprocess.Popen', (['cmd'], {'stdout': 'subprocess.PIPE', 'stderr': 'subprocess.PIPE'}), '(cmd, stdout=subprocess.PIPE, stderr=subprocess.P... |
import csv
from io import StringIO
from django import forms
from django import http
from django.conf import settings
from django.conf.urls import url as re_path
from django.contrib import admin, auth, messages
from django.contrib.admin.utils import quote
from django.contrib.auth.admin import UserAdmin
from django.cont... | [
"conference.invoicing.render_invoice_as_html",
"assopy.models.AssopyUser.objects.all",
"django.utils.safestring.mark_safe",
"assopy.models.Invoice.objects.get",
"django.http.HttpResponseRedirect",
"django.contrib.auth.login",
"django.contrib.admin.site.unregister",
"assopy.models.Order.objects.create"... | [((25390, 25417), 'django.contrib.admin.site.unregister', 'admin.site.unregister', (['User'], {}), '(User)\n', (25411, 25417), False, 'from django.contrib import admin, auth, messages\n'), ((25418, 25458), 'django.contrib.admin.site.register', 'admin.site.register', (['User', 'AuthUserAdmin'], {}), '(User, AuthUserAdmi... |
import pandas as pd
if __name__ == '__main__':
foods = pd.read_csv("data/raw/Release 1 - Food nutrient database.csv", skiprows=[1])
foods = foods.rename(columns={
"Public Food Key": "food_code",
"Food Name": "name",
"Classification": "group",
"Protein": "protein",
"Total... | [
"pandas.read_csv"
] | [((60, 136), 'pandas.read_csv', 'pd.read_csv', (['"""data/raw/Release 1 - Food nutrient database.csv"""'], {'skiprows': '[1]'}), "('data/raw/Release 1 - Food nutrient database.csv', skiprows=[1])\n", (71, 136), True, 'import pandas as pd\n')] |
# encoding: utf-8
"""
@author: weijian
@contact: <EMAIL>
"""
import argparse
import os
import sys
from os import mkdir
import torch
from torch.backends import cudnn
sys.path.append('.')
from config import cfg
from data import make_data_loader
from engine.inference import inference
from modeling import build_model
f... | [
"sys.path.append",
"os.mkdir",
"config.cfg.merge_from_list",
"argparse.ArgumentParser",
"os.path.basename",
"data.make_data_loader",
"config.cfg.freeze",
"torch.norm",
"config.cfg.merge_from_file",
"torch.load",
"torch.cat",
"os.path.exists",
"torch.FloatTensor",
"utils.logger.setup_logger... | [((169, 189), 'sys.path.append', 'sys.path.append', (['"""."""'], {}), "('.')\n", (184, 189), False, 'import sys\n'), ((1703, 1725), 'torch.cat', 'torch.cat', (['features', '(0)'], {}), '(features, 0)\n', (1712, 1725), False, 'import torch\n'), ((1864, 1926), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {... |
from capital_gains_loss import create_app
application = create_app()
| [
"capital_gains_loss.create_app"
] | [((57, 69), 'capital_gains_loss.create_app', 'create_app', ([], {}), '()\n', (67, 69), False, 'from capital_gains_loss import create_app\n')] |
"""
##############################################################################
PyDraw 1.1: simple canvas paint program and object mover/animator.
Uses time.sleep loops to implement object move loops, such that only
one move can be in progress at once; this is smooth and fast, but see
the widget.after and thread-ba... | [
"time.sleep"
] | [((4908, 4933), 'time.sleep', 'time.sleep', (['pickDelays[0]'], {}), '(pickDelays[0])\n', (4918, 4933), False, 'import time, sys\n'), ((5109, 5134), 'time.sleep', 'time.sleep', (['pickDelays[0]'], {}), '(pickDelays[0])\n', (5119, 5134), False, 'import time, sys\n')] |
import unittest
from crosshair.objectproxy import *
class ObjectWrap(ObjectProxy):
def __init__(self, obj):
object.__setattr__(self, '_o', obj)
def _wrapped(self):
return object.__getattribute__(self, '_o')
class ObjectProxyTest(unittest.TestCase):
def test_object_proxy(self) -> None:
... | [
"unittest.main"
] | [((655, 670), 'unittest.main', 'unittest.main', ([], {}), '()\n', (668, 670), False, 'import unittest\n')] |
# -*- coding: utf-8 -*-
import pandas as pd, numpy as np
from utils import _check_fit_input, _check_1d_inp, _check_X_input
from online import SeparateClassifiers
def evaluateRejectionSampling(policy, X, a, r, online=False, start_point_online='random', batch_size=10):
"""
Evaluate a policy using rejection samp... | [
"numpy.random.seed",
"numpy.random.beta",
"utils._check_1d_inp",
"numpy.floor",
"utils._check_fit_input",
"numpy.clip",
"numpy.append",
"numpy.min",
"numpy.random.randint",
"numpy.array",
"numpy.mean",
"numpy.arange",
"online.SeparateClassifiers",
"numpy.random.shuffle"
] | [((1833, 1858), 'utils._check_fit_input', '_check_fit_input', (['X', 'a', 'r'], {}), '(X, a, r)\n', (1849, 1858), False, 'from utils import _check_fit_input, _check_1d_inp, _check_X_input\n'), ((7383, 7408), 'utils._check_fit_input', '_check_fit_input', (['X', 'a', 'r'], {}), '(X, a, r)\n', (7399, 7408), False, 'from u... |
"""
Career builder web crawl with thread design
"""
from requests import get
from bs4 import BeautifulSoup
from threading import Thread
alldata={}
def get_career(url, role):
titles=[]
response = get(url, headers={'User-Agent': 'Mozilla/5.0'})
soup = BeautifulSoup(response.text, 'html.parser')
href_cont... | [
"bs4.BeautifulSoup",
"threading.Thread",
"requests.get"
] | [((204, 251), 'requests.get', 'get', (['url'], {'headers': "{'User-Agent': 'Mozilla/5.0'}"}), "(url, headers={'User-Agent': 'Mozilla/5.0'})\n", (207, 251), False, 'from requests import get\n'), ((263, 306), 'bs4.BeautifulSoup', 'BeautifulSoup', (['response.text', '"""html.parser"""'], {}), "(response.text, 'html.parser... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
-------------------------------------------------
@ Author : pengj
@ date : 2019/12/8 16:30
@ IDE : PyCharm
@ GitHub : https://github.com/JackyPJB
@ Contact : <EMAIL>
---------------------------------... | [
"requests.post",
"json.loads"
] | [((1162, 1206), 'requests.post', 'requests.post', (['cls.login_url'], {'params': 'payload'}), '(cls.login_url, params=payload)\n', (1175, 1206), False, 'import requests\n'), ((1501, 1567), 'requests.post', 'requests.post', (['cls.upload_url'], {'headers': 'upload_headers', 'files': 'files'}), '(cls.upload_url, headers=... |
import unittest
from statefun.request_reply_pb2 import Address
from statefun_tasks.types import Task, Group
from statefun_tasks import DefaultSerialiser, RetryPolicy
class PipelineSerialisationTests(unittest.TestCase):
def test_task_entry_serialisation(self):
serialiser = DefaultSerialiser(known_proto_ty... | [
"unittest.main",
"statefun_tasks.RetryPolicy",
"statefun_tasks.DefaultSerialiser",
"statefun_tasks.types.Task.from_fields",
"statefun_tasks.types.Group",
"statefun_tasks.types.Task.from_proto",
"statefun_tasks.types.Group.from_proto",
"statefun.request_reply_pb2.Address"
] | [((3527, 3542), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3540, 3542), False, 'import unittest\n'), ((288, 334), 'statefun_tasks.DefaultSerialiser', 'DefaultSerialiser', ([], {'known_proto_types': '[Address]'}), '(known_proto_types=[Address])\n', (305, 334), False, 'from statefun_tasks import DefaultSerialis... |
import timeit
from collections import Counter, defaultdict
def test(fruit_set):
_ = dict(Counter(fruit_set))
def test2(fruit_set):
counts = {}
for fruit in fruit_set:
if fruit in counts:
counts[fruit] += 1
else:
counts[fruit] = 1
def test3(fruit_set):
counts... | [
"collections.defaultdict",
"collections.Counter"
] | [((323, 339), 'collections.defaultdict', 'defaultdict', (['int'], {}), '(int)\n', (334, 339), False, 'from collections import Counter, defaultdict\n'), ((95, 113), 'collections.Counter', 'Counter', (['fruit_set'], {}), '(fruit_set)\n', (102, 113), False, 'from collections import Counter, defaultdict\n'), ((635, 653), '... |
# buttons.py For TFT driver.
# Adapted for (and requires) uasyncio V3
# Released under the MIT License (MIT). See LICENSE.
# Copyright (c) 2016-2020 <NAME>
# dropdown.py For TFT driver.
# Adapted for (and requires) uasyncio V3
# Released under the MIT License (MIT). See LICENSE.
# Copyright (c) 2016-2020 <NAME>
from... | [
"tft.driver.ugui.Screen.back",
"tft.driver.ugui.Screen.change",
"tft.driver.ugui.print_left"
] | [((1515, 1528), 'tft.driver.ugui.Screen.back', 'Screen.back', ([], {}), '()\n', (1526, 1528), False, 'from tft.driver.ugui import Screen, Aperture, Touchable, dolittle, print_left\n'), ((2525, 2626), 'tft.driver.ugui.print_left', 'print_left', (['tft', '(x + bw)', '(y + bw + 1)', 'self.elements[self._value]', 'self.fon... |
import os
from java.lang import System
from bitbucket.common.wrapper.User import User
class ProtocolHelper(object):
def __init__(self, test_data, user_dict):
self.base_url = test_data.base_url
self.user = User.from_dict(user_dict, os.path.join(System.getProperty("root"), "tmp"))
self.use... | [
"java.lang.System.getProperty"
] | [((268, 294), 'java.lang.System.getProperty', 'System.getProperty', (['"""root"""'], {}), "('root')\n", (286, 294), False, 'from java.lang import System\n')] |
# Copyright 2022 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | [
"tensorflow.python.platform.test.main",
"tensorflow.python.tpu.tpu_strategy_util.initialize_tpu_system",
"tensorflow.python.tpu.tpu_embedding_v2_utils.TableConfig",
"tensorflow.python.tpu.tpu_embedding_v2.cpu_embedding_lookup",
"tensorflow.python.framework.tensor_spec.TensorSpec",
"numpy.ones",
"absl.te... | [((12242, 12389), 'absl.testing.parameterized.parameters', 'parameterized.parameters', (['tpu_embedding_v2_utils.SGD', 'tpu_embedding_v2_utils.Adagrad', 'tpu_embedding_v2_utils.Adam', 'tpu_embedding_v2_utils.FTRL'], {}), '(tpu_embedding_v2_utils.SGD, tpu_embedding_v2_utils\n .Adagrad, tpu_embedding_v2_utils.Adam, tp... |
import numpy as np
import copy
from .mesh import *
from .events import *
from .species import *
class Model:
""" Contains all the static information about a biochemical model """
def __init__(self,mesh,systemSize):
self.mesh = mesh
self.systemSize = systemSize
self.dimension = 0
... | [
"numpy.zeros"
] | [((604, 631), 'numpy.zeros', 'np.zeros', (['self.mesh.Nvoxels'], {}), '(self.mesh.Nvoxels)\n', (612, 631), True, 'import numpy as np\n')] |
# -*- coding:utf-8 -*-
__author__ = 'Gvammer'
from django.db import models
from django.contrib.auth.models import User
from PManager.models.tasks import PM_Tracker, PM_ProjectRoles, PM_Role, PM_Project, RatingHistory, FineHistory
from PManager.models.achievements import PM_User_Achievement, PM_Project_Achievement
from ... | [
"PManager.models.achievements.PM_User_Achievement.objects.filter",
"django.db.models.ForeignKey",
"django.contrib.auth.models.User.objects.filter",
"django.contrib.auth.models.User.objects.create_user",
"PManager.models.tasks.PM_ProjectRoles.objects.get_or_create",
"django.contrib.auth.models.User.objects... | [((21201, 21245), 'django.db.models.signals.pre_delete.connect', 'pre_delete.connect', (['remove_keys'], {'sender': 'User'}), '(remove_keys, sender=User)\n', (21219, 21245), False, 'from django.db.models.signals import post_save, pre_delete\n'), ((21246, 21297), 'django.db.models.signals.post_save.connect', 'post_save.... |
# -*- coding: utf-8 -*-
import pygmsh
from helpers import compute_volume
def test():
geom = pygmsh.built_in.Geometry()
xmin = geom.define_constant("xmin", 0.0, 0.0, 1.0)
xmax = geom.define_constant("xmax", 1.0, 0.0, 1.0)
ymin = geom.define_constant("ymin", 0.0, 0.0, 1.0)
ymax = geom.define_const... | [
"pygmsh.generate_mesh",
"pygmsh.built_in.Geometry",
"helpers.compute_volume"
] | [((99, 125), 'pygmsh.built_in.Geometry', 'pygmsh.built_in.Geometry', ([], {}), '()\n', (123, 125), False, 'import pygmsh\n'), ((448, 496), 'pygmsh.generate_mesh', 'pygmsh.generate_mesh', (['geom'], {'mesh_file_type': '"""vtk"""'}), "(geom, mesh_file_type='vtk')\n", (468, 496), False, 'import pygmsh\n'), ((512, 541), 'h... |
# -*- coding: utf-8 -*-
"""
Created on Sat Apr 20 23:51:39 2019
@author: <NAME>
"""
import math
def computeRoot(a,b,det):
aux_first = -b + math.sqrt(det)
aux_second = -b - math.sqrt(det)
return aux_first/(2*a), aux_second/(2*a)
a = int(input("Please input value of a: "))
b = int(input("Please input value ... | [
"math.sqrt"
] | [((144, 158), 'math.sqrt', 'math.sqrt', (['det'], {}), '(det)\n', (153, 158), False, 'import math\n'), ((181, 195), 'math.sqrt', 'math.sqrt', (['det'], {}), '(det)\n', (190, 195), False, 'import math\n')] |
#!/usr/bin/env python
"""
.. module:: lheReader
:synopsis: Provides a class that creates SMSEvents from LHE files.
.. moduleauthor:: <NAME> <<EMAIL>>
"""
from smodels.tools.physicsUnits import TeV, pb
from smodels.theory.exceptions import SModelSTheoryError as SModelSError
from smodels.tools.smodelsLogging impor... | [
"smodels.theory.exceptions.SModelSTheoryError",
"smodels.tools.smodelsLogging.logger.error"
] | [((5631, 5687), 'smodels.tools.smodelsLogging.logger.error', 'logger.error', (['"""Number of mother particles %d != 2"""', 'imom'], {}), "('Number of mother particles %d != 2', imom)\n", (5643, 5687), False, 'from smodels.tools.smodelsLogging import logger\n'), ((5706, 5720), 'smodels.theory.exceptions.SModelSTheoryErr... |
"""Shared configurations for pytest.
See https://docs.pytest.org/en/6.2.x/fixture.html.
"""
import pytest
longrun = pytest.mark.skipif("not config.getoption('longrun')")
def pytest_addoption(parser):
"""Enable a command line flag for running tests decorated with @longrun."""
parser.addoption('--longrun',
... | [
"pytest.mark.skipif"
] | [((118, 171), 'pytest.mark.skipif', 'pytest.mark.skipif', (['"""not config.getoption(\'longrun\')"""'], {}), '("not config.getoption(\'longrun\')")\n', (136, 171), False, 'import pytest\n')] |
import json
from pytezos import pytezos, Key
class OracleServer:
def __init__(self, tezos_key, oracle_contract_address, environment):
self.oracle_contract_address = oracle_contract_address
self.pytezos_instance = pytezos.using(shell=environment, key=tezos_key)
def oracle_contract(self):
... | [
"pytezos.pytezos.using"
] | [((234, 281), 'pytezos.pytezos.using', 'pytezos.using', ([], {'shell': 'environment', 'key': 'tezos_key'}), '(shell=environment, key=tezos_key)\n', (247, 281), False, 'from pytezos import pytezos, Key\n')] |
#!/usr/bin/python
import aud, math, time
length = 0.5
fadelength = 0.05
device = aud.Device()
high = aud.Sound.sine(880).limit(0, length).fadein(0, fadelength).fadeout(length - fadelength, length)
low = aud.Sound.sine(700).limit(0, length).fadein(0, fadelength).fadeout(length - fadelength, length).volume(0.6)
sound = ... | [
"aud.Device",
"aud.Sound.sine",
"math.sin",
"time.time",
"math.cos"
] | [((82, 94), 'aud.Device', 'aud.Device', ([], {}), '()\n', (92, 94), False, 'import aud, math, time\n'), ((395, 406), 'time.time', 'time.time', ([], {}), '()\n', (404, 406), False, 'import aud, math, time\n'), ((414, 425), 'time.time', 'time.time', ([], {}), '()\n', (423, 425), False, 'import aud, math, time\n'), ((449,... |
import boto3
import logging
import os
redshift_cluster_identifier = os.environ['CLUSTER_IDENTIFIER']
redshift_database = os.environ['DATABASE_NAME']
redshift_user = os.environ['USERNAME']
rs_data = boto3.client("redshift-data")
logger = logging.getLogger()
logger.setLevel(logging.INFO)
def handler(event, context):... | [
"logging.getLogger",
"boto3.client"
] | [((200, 229), 'boto3.client', 'boto3.client', (['"""redshift-data"""'], {}), "('redshift-data')\n", (212, 229), False, 'import boto3\n'), ((240, 259), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (257, 259), False, 'import logging\n')] |
import time
from collections import defaultdict
class Block(object):
def __init__(self, size, time=time.time(), status="Free", data=None, piece=None):
self.size = size
self.status = status
self.pending = False
self.data = defaultdict(list)
self.time = time
self.piece... | [
"collections.defaultdict",
"time.time"
] | [((104, 115), 'time.time', 'time.time', ([], {}), '()\n', (113, 115), False, 'import time\n'), ((259, 276), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (270, 276), False, 'from collections import defaultdict\n'), ((748, 759), 'time.time', 'time.time', ([], {}), '()\n', (757, 759), False, 'impo... |
# Generated by Django 2.0.2 on 2020-01-07 23:38
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('recomendations', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='State',
fields=[
('... | [
"django.db.models.CharField",
"django.db.models.DateTimeField",
"django.db.models.ManyToManyField",
"django.db.models.AutoField"
] | [((844, 946), 'django.db.models.ManyToManyField', 'models.ManyToManyField', ([], {'related_name': '"""get_state"""', 'to': '"""recomendations.State"""', 'verbose_name': '"""Estado"""'}), "(related_name='get_state', to='recomendations.State',\n verbose_name='Estado')\n", (866, 946), False, 'from django.db import migr... |
# -*- coding: utf-8 -*-
"""
Created on Tue Jan 1 10:17:04 2019
@author: vrush
"""
import pandas
from sklearn import neighbors,cluster,preprocessing,svm,decomposition,model_selection,metrics,ensemble,feature_extraction,naive_bayes,linear_model
import numpy
import collections
import operator
import matplot... | [
"numpy.nanpercentile",
"seaborn.heatmap",
"sklearn.preprocessing.scale",
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"sklearn.metrics.classification_report",
"seaborn.regplot",
"seaborn.FacetGrid",
"seaborn.pointplot",
"sklearn.cluster.KMeans",
"collections.Counter",
"seabor... | [((405, 453), 'seaborn.set', 'seaborn.set', ([], {'rc': "{'figure.figsize': (11.7, 8.27)}"}), "(rc={'figure.figsize': (11.7, 8.27)})\n", (416, 453), False, 'import seaborn\n'), ((10990, 11023), 'seaborn.heatmap', 'seaborn.heatmap', (['corr'], {'annot': '(True)'}), '(corr, annot=True)\n', (11005, 11023), False, 'import ... |
# Generated by Django 2.1.2 on 2018-10-09 14:11
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Report',
fields=[
... | [
"django.db.models.CharField",
"django.db.models.DateTimeField",
"django.db.models.BooleanField",
"django.db.models.AutoField"
] | [((331, 424), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (347, 424), False, 'from django.db import migrations, models\... |
import myfinance
import time
import random
kospi = myfinance.get_tickers()
data = []
for i, code in enumerate(kospi):
dvr = myfinance.get_dvr(code)
data.append((code, dvr))
time.sleep(0.2)
print(i, len(kospi), code)
# 정렬하기
sorted_data = sorted(data, key=lambda x: x[1])
print(sorted_data[:10])
| [
"myfinance.get_tickers",
"myfinance.get_dvr",
"time.sleep"
] | [((52, 75), 'myfinance.get_tickers', 'myfinance.get_tickers', ([], {}), '()\n', (73, 75), False, 'import myfinance\n'), ((131, 154), 'myfinance.get_dvr', 'myfinance.get_dvr', (['code'], {}), '(code)\n', (148, 154), False, 'import myfinance\n'), ((189, 204), 'time.sleep', 'time.sleep', (['(0.2)'], {}), '(0.2)\n', (199, ... |
# coding: utf-8
# In[43]:
import pandas as pd
import numpy as np
permits = pd.read_csv("https://data.seattle.gov/api/views/76t5-zqzr/rows.csv?accessType=DOWNLOAD",
usecols=["PermitClass", "PermitClassMapped", "PermitTypeDesc"],
dtype=object)
permits.head()
# In[46]:
... | [
"pandas.read_csv",
"numpy.size"
] | [((80, 261), 'pandas.read_csv', 'pd.read_csv', (['"""https://data.seattle.gov/api/views/76t5-zqzr/rows.csv?accessType=DOWNLOAD"""'], {'usecols': "['PermitClass', 'PermitClassMapped', 'PermitTypeDesc']", 'dtype': 'object'}), "(\n 'https://data.seattle.gov/api/views/76t5-zqzr/rows.csv?accessType=DOWNLOAD'\n , useco... |
# Generated by Django 4.0 on 2022-03-29 11:29
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('product', '0006_product_image2'),
]
operations = [
migrations.AddField(
model_name='product',
name='image3',
... | [
"django.db.models.ImageField"
] | [((329, 388), 'django.db.models.ImageField', 'models.ImageField', ([], {'null': '(True)', 'upload_to': '"""uploads/products/"""'}), "(null=True, upload_to='uploads/products/')\n", (346, 388), False, 'from django.db import migrations, models\n'), ((509, 568), 'django.db.models.ImageField', 'models.ImageField', ([], {'nu... |
def hashed_float(s):
"""returns a float in the range [0, 1) based on a hash of the string.
A given string will always return the same value, but different strings
will return very different values."""
import md5, struct
[number] = struct.unpack("<H", md5.new(s).digest()[:2])
return number / floa... | [
"md5.new"
] | [((271, 281), 'md5.new', 'md5.new', (['s'], {}), '(s)\n', (278, 281), False, 'import md5, struct\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Plot convergence of stellar evolution quantities as a function of VPLanet's
timestepping parameter, dEta.
@author <NAME>, 2019
@email dflemin3 (at) uw (dot) edu
"""
import numpy as np
import os
import sys
import matplotlib as mpl
import matplotlib.pyplot as plt
#Typi... | [
"matplotlib.rc",
"numpy.fabs",
"matplotlib.pyplot.subplots",
"os.path.join"
] | [((483, 520), 'matplotlib.rc', 'mpl.rc', (['"""font"""'], {}), "('font', **{'family': 'serif'})\n", (489, 520), True, 'import matplotlib as mpl\n'), ((519, 546), 'matplotlib.rc', 'mpl.rc', (['"""text"""'], {'usetex': '(True)'}), "('text', usetex=True)\n", (525, 546), True, 'import matplotlib as mpl\n'), ((841, 879), 'm... |
import pygrank as pg
loader = list(pg.load_datasets_multiple_communities(["graph9", "bigraph", "citeseer"]))
algorithms = pg.create_variations(pg.create_many_filters(), pg.create_many_variation_types())
algorithms = pg.create_variations(algorithms, {"": pg.Normalize}) # add normalization to all algorithms
measures =... | [
"pygrank.create_many_filters",
"pygrank.LinkAssessment",
"pygrank.benchmark_print",
"pygrank.load_datasets_multiple_communities",
"pygrank.benchmark",
"pygrank.MultiUnsupervised",
"pygrank.SpearmanCorrelation",
"pygrank.MultiSupervised",
"pygrank.create_variations",
"pygrank.create_many_variation_... | [((217, 269), 'pygrank.create_variations', 'pg.create_variations', (['algorithms', "{'': pg.Normalize}"], {}), "(algorithms, {'': pg.Normalize})\n", (237, 269), True, 'import pygrank as pg\n'), ((1597, 1760), 'pygrank.benchmark_print', 'pg.benchmark_print', (["([('Measure', 'AUC corr', 'NDCG corr')] + [(measure, evalua... |
# Generated by Django 3.0.4 on 2020-04-01 18:01
from django.conf import settings
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('search', '0005_auto_20200401_1149'),
]
operations = [
... | [
"django.db.migrations.swappable_dependency",
"django.db.migrations.RenameModel"
] | [((186, 243), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (217, 243), False, 'from django.db import migrations\n'), ((326, 387), 'django.db.migrations.RenameModel', 'migrations.RenameModel', ([], {'old_name': '"""Aut... |
# coding=utf-8
"""
A module to easily render text on the screen.
"""
import os
import pygame
import tempfile
from random import randint
from pygame.locals import *
from GUI.locals import *
from GUI.draw import line
from GUI.font import DEFAULT_FONT
from GUI.base import BaseWidget
pygame.font.init()
class SimpleTe... | [
"GUI.draw.line",
"os.remove",
"pygame.image.load",
"tempfile.TemporaryDirectory",
"random.randint",
"pygame.Surface",
"pygame.font.init",
"GUI.gui_examples.text.gui"
] | [((285, 303), 'pygame.font.init', 'pygame.font.init', ([], {}), '()\n', (301, 303), False, 'import pygame\n'), ((15481, 15486), 'GUI.gui_examples.text.gui', 'gui', ([], {}), '()\n', (15484, 15486), False, 'from GUI.gui_examples.text import gui\n'), ((1202, 1224), 'pygame.Surface', 'pygame.Surface', (['(1, 1)'], {}), '(... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.9 on 2016-08-10 07:37
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
try:
from wagtail.core import blocks, fields
except ImportError:
from wagtail.wagtailcore import blocks, fields
import wagta... | [
"django.db.models.OneToOneField",
"wagtail.wagtailcore.blocks.CharBlock",
"wagtail.wagtailcore.blocks.RichTextBlock"
] | [((596, 766), 'django.db.models.OneToOneField', 'models.OneToOneField', ([], {'auto_created': '(True)', 'on_delete': 'django.db.models.deletion.CASCADE', 'parent_link': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'to': '"""wagtailcore.Page"""'}), "(auto_created=True, on_delete=django.db.models.deletion\n... |
import pytest
from unittest.mock import patch
from tests.test_utils import patched_request, sample_list
import moddb
DEFAULT = "https://www.moddb.com/platforms/pc"
@patch("moddb.utils.request", new=patched_request)
class TestPlatform:
@pytest.fixture(params=[DEFAULT], autouse=True)
def _get_object(self, re... | [
"unittest.mock.patch",
"tests.test_utils.sample_list",
"pytest.fixture",
"moddb.get_page"
] | [((170, 219), 'unittest.mock.patch', 'patch', (['"""moddb.utils.request"""'], {'new': 'patched_request'}), "('moddb.utils.request', new=patched_request)\n", (175, 219), False, 'from unittest.mock import patch\n'), ((245, 291), 'pytest.fixture', 'pytest.fixture', ([], {'params': '[DEFAULT]', 'autouse': '(True)'}), '(par... |
# @Auther : wuwuwu
# @Time : 2020/4/9
# @File : q12.py
# @Description : Motion 滤波
import cv2 as cv
import numpy as np
def motionFilter(img, kernel_size=3):
"""
Motion Filter 取对角线方向的像素平均值
:param img: 输入图片
:param kernel_size: 卷积和尺寸
:return: 输出图片
"""
kernel = np.eye(kernel_size, dtype=np.fl... | [
"numpy.sum",
"cv2.waitKey",
"cv2.destroyAllWindows",
"numpy.zeros",
"numpy.clip",
"cv2.imread",
"numpy.eye",
"cv2.imshow"
] | [((289, 326), 'numpy.eye', 'np.eye', (['kernel_size'], {'dtype': 'np.float32'}), '(kernel_size, dtype=np.float32)\n', (295, 326), True, 'import numpy as np\n'), ((440, 505), 'numpy.zeros', 'np.zeros', (['(H + padding * 2, W + padding * 2, C)'], {'dtype': 'np.float32'}), '((H + padding * 2, W + padding * 2, C), dtype=np... |
# -*- coding: utf-8 -*-
###############################################################################
# Copyright (c), Forschungszentrum Jülich GmbH, IAS-1/PGI-1, Germany. #
# All rights reserved. #
# This file is part of the AiiDA-FLEUR package. ... | [
"aiida_fleur.data.fleurinpmodifier.FleurinpModifier",
"os.path.abspath",
"aiida.orm.FolderData",
"aiida.orm.KpointsData",
"masci_tools.io.fleurxmlmodifier.ModifierTask",
"pytest.raises",
"os.path.join",
"pytest.deprecated_call"
] | [((1129, 1154), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (1144, 1154), False, 'import os\n'), ((1191, 1233), 'os.path.join', 'os.path.join', (['inpxmlfilefolder', 'file_path1'], {}), '(inpxmlfilefolder, file_path1)\n', (1203, 1233), False, 'import os\n'), ((1480, 1510), 'aiida_fleur.dat... |
""" class to test reading of various avro formats """
import os
import unittest
import avro_to_python
from avro_to_python.reader.read import AvscReader
from avro_to_python.utils.paths import get_joined_path
class AvroReaderTests(unittest.TestCase):
directory = os.path.abspath(avro_to_python.__file__) \
... | [
"os.path.abspath",
"avro_to_python.reader.read.AvscReader",
"avro_to_python.utils.paths.get_joined_path"
] | [((330, 378), 'avro_to_python.utils.paths.get_joined_path', 'get_joined_path', (['"""avro_to_python"""', '"""__init__.py"""'], {}), "('avro_to_python', '__init__.py')\n", (345, 378), False, 'from avro_to_python.utils.paths import get_joined_path\n'), ((572, 597), 'avro_to_python.reader.read.AvscReader', 'AvscReader', (... |
#!/usr/bin/env python
import os
import sys
sys.path.insert(0, os.pardir)
from testing_harness import TestHarness, PyAPITestHarness
import openmc
class ScoreDelayedNuFissionTestHarness(PyAPITestHarness):
def _build_inputs(self):
filt = openmc.Filter(type='cell', bins=(21, 22, 23, 27))
tallies = [o... | [
"os.remove",
"openmc.TalliesFile",
"os.getcwd",
"os.path.exists",
"sys.path.insert",
"openmc.Tally",
"openmc.Filter"
] | [((44, 73), 'sys.path.insert', 'sys.path.insert', (['(0)', 'os.pardir'], {}), '(0, os.pardir)\n', (59, 73), False, 'import sys\n'), ((250, 299), 'openmc.Filter', 'openmc.Filter', ([], {'type': '"""cell"""', 'bins': '(21, 22, 23, 27)'}), "(type='cell', bins=(21, 22, 23, 27))\n", (263, 299), False, 'import openmc\n'), ((... |
import numpy as np
import cv2, time
import matplotlib.pyplot as plt
import scipy.stats as st
class Kuramoto:
def __init__(self, size, mean, std, coupling):
"""
mean: float
The mean frequency of oscillators in hertz
"""
self.internal_freq = np.random.normal(mean, std, (1, s... | [
"numpy.pad",
"numpy.outer",
"numpy.roll",
"cv2.waitKey",
"numpy.random.rand",
"numpy.angle",
"numpy.zeros",
"scipy.stats.norm.cdf",
"numpy.vstack",
"numpy.sin",
"numpy.reshape",
"numpy.linspace",
"numpy.random.normal",
"cv2.normalize",
"numpy.eye",
"numpy.complex",
"cv2.namedWindow",... | [((1636, 1705), 'cv2.normalize', 'cv2.normalize', (['img', '(0)', '(1)'], {'norm_type': 'cv2.NORM_MINMAX', 'dtype': 'cv2.CV_32F'}), '(img, 0, 1, norm_type=cv2.NORM_MINMAX, dtype=cv2.CV_32F)\n', (1649, 1705), False, 'import cv2, time\n'), ((1830, 1901), 'numpy.linspace', 'np.linspace', (['(-nsig - interval / 2.0)', '(ns... |
"""Parsing search terms"""
__author__ = 'thorwhalen'
import functools
import ut.util.data_source as util_data_source
from serialize.data_accessor import DataAccessor
#from ut.pfile.accessor import Accessor
import ut.parse.google as parse_google
#import ut.aw.khan01_spike as khan_spike
#from ut.semantics.term_stats_ma... | [
"ut.pfile.accessor.for_local",
"ut.pfile.accessor.for_s3",
"ut.parse.gresult_info_retriever.GResultInfoRetriever.for_nres_words_domains",
"khan_utils.encoding.to_utf8_or_bust",
"serialize.data_accessor.DataAccessor",
"serialize.khan_logger.KhanLogger.default_log_path_with_unique_name",
"serialize.khan_l... | [((8820, 8855), 'ut.util.data_source.for_global_local', 'util_data_source.for_global_local', ([], {}), '()\n', (8853, 8855), True, 'import ut.util.data_source as util_data_source\n'), ((10364, 10499), 'serialize.data_accessor.DataAccessor', 'DataAccessor', ([], {'relative_root': 'html_folder', 'extension': '""""""', 'f... |
#
# Copyright 2018 Agilx, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | [
"apptuit.apptuit_client.Apptuit",
"pyformance.MetricsRegistry",
"time.time",
"os.environ.get",
"time.sleep",
"apptuit.apptuit_client.DataPoint",
"apptuit.apptuit_client.ApptuitSendException",
"socket.gethostname",
"apptuit.apptuit_client.TimeSeriesName.decode_metric",
"sys.stderr.write"
] | [((1883, 1904), 'sys.stderr.write', 'sys.stderr.write', (['msg'], {}), '(msg)\n', (1899, 1904), False, 'import sys\n'), ((5700, 5806), 'apptuit.apptuit_client.Apptuit', 'Apptuit', ([], {'token': 'token', 'api_endpoint': 'api_endpoint', 'ignore_environ_tags': '(True)', 'sanitize_mode': 'sanitize_mode'}), '(token=token, ... |
from functools import wraps
def func_logger(fn):
@wraps(fn)
def inner(*args, **kwargs):
result = fn(*args, **kwargs)
print(f'log: {fn.__qualname__}({args}, {kwargs}) = {result}')
return result
return inner
def class_logger(cls):
for name, obj in vars(cls).items():
... | [
"functools.wraps"
] | [((56, 65), 'functools.wraps', 'wraps', (['fn'], {}), '(fn)\n', (61, 65), False, 'from functools import wraps\n')] |
import os
import pprint
import httplib2
import apiclient.discovery
import apiclient.http
import oauth2client.client
import oauth2client.file
# OAuth 2.0 scope that will be authorized.
# Check https://developers.google.com/drive/scopes for all available scopes.
OAUTH2_SCOPE = 'https://www.googleapis.com/auth/drive'
#... | [
"httplib2.Http",
"pprint.pprint"
] | [((1245, 1260), 'httplib2.Http', 'httplib2.Http', ([], {}), '()\n', (1258, 1260), False, 'import httplib2\n'), ((1836, 1859), 'pprint.pprint', 'pprint.pprint', (['new_file'], {}), '(new_file)\n', (1849, 1859), False, 'import pprint\n')] |
"""Imports a frozen model graph uff file.
converts the model into RT engine
and saves the engine file for future inference
"""
# MIT License
#
# Copyright (c) 2019 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software... | [
"os.path.basename"
] | [((2742, 2769), 'os.path.basename', 'os.path.basename', (['test_case'], {}), '(test_case)\n', (2758, 2769), False, 'import os\n')] |
from nmcli._const import NetworkManagerState, NetworkConnectivity
from nmcli.data import General
def test_to_json():
state = NetworkManagerState.CONNECTED_GLOBAL
connectivity = NetworkConnectivity.FULL
wifi_hw = True
wifi = True
wwan_hw = True
wwan = True
g = General(state, connectivity, wi... | [
"nmcli.data.General",
"nmcli.data.General.parse"
] | [((289, 347), 'nmcli.data.General', 'General', (['state', 'connectivity', 'wifi_hw', 'wifi', 'wwan_hw', 'wwan'], {}), '(state, connectivity, wifi_hw, wifi, wwan_hw, wwan)\n', (296, 347), False, 'from nmcli.data import General\n'), ((649, 666), 'nmcli.data.General.parse', 'General.parse', (['d1'], {}), '(d1)\n', (662, 6... |
import os
import json
import subprocess
import socket
TIMEOUT = 5
import pytest
class TCPServer:
def __init__(self, bind_interface="0.0.0.0", bind_port=0):
self._sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self._sock.settimeout(TIMEOUT)
self._sock.bind((bind_interface, bind_port))
self.port = ... | [
"socket.socket",
"os.path.join",
"json.dumps",
"json.load"
] | [((670, 709), 'os.path.join', 'os.path.join', (['"""src"""', "manifest['script']"], {}), "('src', manifest['script'])\n", (682, 709), False, 'import os\n'), ((176, 225), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_STREAM'], {}), '(socket.AF_INET, socket.SOCK_STREAM)\n', (189, 225), False, 'import... |
from flask import flash
FLASH_MESSAGE_INFO = "info"
FLASH_MESSAGE_ERROR = "error"
FLASH_MESSAGE_WARNING = "warning"
def set_template(prefix, name, ext=".html"):
"""
This will return a safe template file path based on given params
:param prefix: template root for module
:param name: template name
... | [
"flask.flash"
] | [((592, 602), 'flask.flash', 'flash', (['msg'], {}), '(msg)\n', (597, 602), False, 'from flask import flash\n')] |
"""The allotmentclub portal"""
from setuptools import setup, find_packages
import glob
exec(open("src/sw/allotmentclub/version.py").read())
setup(
name='sw.allotmentclub',
version=__version__, # noqa
install_requires=[
'pyramid',
'fints',
],
extras_require={
'test': [
... | [
"setuptools.find_packages",
"glob.glob"
] | [((1614, 1634), 'setuptools.find_packages', 'find_packages', (['"""src"""'], {}), "('src')\n", (1627, 1634), False, 'from setuptools import setup, find_packages\n'), ((1717, 1735), 'glob.glob', 'glob.glob', (['"""*.rst"""'], {}), "('*.rst')\n", (1726, 1735), False, 'import glob\n')] |
# Copyright 2022 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | [
"tensorflow.test.main",
"tensorflow.ones",
"official.projects.detr.modeling.transformer.TransformerEncoder",
"official.projects.detr.modeling.transformer.TransformerEncoderBlock",
"tensorflow.shape",
"official.projects.detr.modeling.transformer.TransformerDecoderBlock",
"official.projects.detr.modeling.... | [((9241, 9255), 'tensorflow.test.main', 'tf.test.main', ([], {}), '()\n', (9253, 9255), True, 'import tensorflow as tf\n'), ((966, 1055), 'official.projects.detr.modeling.transformer.TransformerEncoderBlock', 'transformer.TransformerEncoderBlock', (['num_attention_heads', 'inner_dim', 'inner_activation'], {}), '(num_at... |
import tensorflow as tf
import numpy as np
from tensorflow.python.framework import ops
# from tensorflow.python.ops import array_ops
# from tensorflow.python.ops import sparse_ops
ani_mod = tf.load_op_library('ani.so');
@ops.RegisterGradient("AniCharge")
def _ani_charge_grad(op, grads):
"""The gradients for `ani... | [
"tensorflow.load_op_library",
"tensorflow.cumsum",
"tensorflow.Session",
"tensorflow.ones_like",
"tensorflow.ConfigProto",
"tensorflow.placeholder",
"numpy.array",
"tensorflow.python.framework.ops.RegisterGradient",
"tensorflow.gradients"
] | [((192, 220), 'tensorflow.load_op_library', 'tf.load_op_library', (['"""ani.so"""'], {}), "('ani.so')\n", (210, 220), True, 'import tensorflow as tf\n'), ((224, 257), 'tensorflow.python.framework.ops.RegisterGradient', 'ops.RegisterGradient', (['"""AniCharge"""'], {}), "('AniCharge')\n", (244, 257), False, 'from tensor... |
# ------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
# -------------------------------------------------------------------... | [
"InnerEye.Common.fixed_paths.repository_root_directory"
] | [((800, 827), 'InnerEye.Common.fixed_paths.repository_root_directory', 'repository_root_directory', ([], {}), '()\n', (825, 827), False, 'from InnerEye.Common.fixed_paths import repository_root_directory\n'), ((978, 1005), 'InnerEye.Common.fixed_paths.repository_root_directory', 'repository_root_directory', ([], {}), '... |
from treeopt.treeOpt import TreeOpt
import benchmark
import numpy as np
# Generates a TreeOpt object
opt = TreeOpt()
# Sets a name
opt.set_name("Benchmarking-problem")
# Sets Limis of the TreeOpt Object
limits = np.array([[-5, 5], [-5, 5]])
opt.set_limits(limits)
# Sets number of point in the initial sampling apace... | [
"treeopt.treeOpt.TreeOpt",
"numpy.array"
] | [((108, 117), 'treeopt.treeOpt.TreeOpt', 'TreeOpt', ([], {}), '()\n', (115, 117), False, 'from treeopt.treeOpt import TreeOpt\n'), ((215, 243), 'numpy.array', 'np.array', (['[[-5, 5], [-5, 5]]'], {}), '([[-5, 5], [-5, 5]])\n', (223, 243), True, 'import numpy as np\n')] |
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the License);
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, sof... | [
"rdfformat.generator.rdf_manager.Generate",
"absl.testing.absltest.main",
"rdflib.Literal",
"rdflib.URIRef"
] | [((8336, 8351), 'absl.testing.absltest.main', 'absltest.main', ([], {}), '()\n', (8349, 8351), False, 'from absl.testing import absltest\n'), ((1431, 1466), 'rdfformat.generator.rdf_manager.Generate', 'rdf_manager.Generate', (['resource_path'], {}), '(resource_path)\n', (1451, 1466), False, 'from rdfformat.generator im... |
import sys
from PyQt5.QtWidgets import *
from translate import Translator
### Author
# @<NAME>
class TranslateForm(QWidget):
def __init__(self):
super(TranslateForm, self).__init__()
self.setupUI()
def setupUI(self):
self.resize(415, 505)
self.move(300, 300)
self.se... | [
"translate.Translator"
] | [((2838, 2862), 'translate.Translator', 'Translator', ([], {'to_lang': '"""id"""'}), "(to_lang='id')\n", (2848, 2862), False, 'from translate import Translator\n'), ((2882, 2920), 'translate.Translator', 'Translator', ([], {'from_lang': 'lgF', 'to_lang': 'lgT'}), '(from_lang=lgF, to_lang=lgT)\n', (2892, 2920), False, '... |
# import os
import datetime
from sqlalchemy.schema import Column, ForeignKey
from sqlalchemy.types import Integer, String, DATETIME, Float
from sqlalchemy.orm import relationship
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class User(Base):
__tablename__ = 'appuser'
id =... | [
"sqlalchemy.schema.ForeignKey",
"sqlalchemy.types.String",
"sqlalchemy.ext.declarative.declarative_base",
"sqlalchemy.orm.relationship",
"sqlalchemy.schema.Column"
] | [((244, 262), 'sqlalchemy.ext.declarative.declarative_base', 'declarative_base', ([], {}), '()\n', (260, 262), False, 'from sqlalchemy.ext.declarative import declarative_base\n'), ((321, 354), 'sqlalchemy.schema.Column', 'Column', (['Integer'], {'primary_key': '(True)'}), '(Integer, primary_key=True)\n', (327, 354), Fa... |
import asyncio
import arrow
import puck.constants as const
import puck.parser as parser
from puck.teams import BannerTeam, GameStatsTeam
from puck.urls import Url
from puck.utils import request
class GameIDException(Exception):
def __init__(self, game_id):
super().__init__(f'The Game ID supplied ({game_... | [
"puck.utils.request",
"puck.parser.game"
] | [((5490, 5545), 'puck.utils.request', 'request', (['Url.SCHEDULE'], {'url_mods': 'url_mods', 'params': 'params'}), '(Url.SCHEDULE, url_mods=url_mods, params=params)\n', (5497, 5545), False, 'from puck.utils import request\n'), ((2572, 2589), 'puck.parser.game', 'parser.game', (['data'], {}), '(data)\n', (2583, 2589), T... |
# -*- coding: utf-8 -*-
import time
from datetime import datetime, timezone
import requests_mock
from chaoslib.notification import RunFlowEvent
from chaoshumio.notification import notify
def test_notify(humio_url: str):
payload = {
"msg": "hello"
}
timestamp = time.time()
isotimestamp = date... | [
"datetime.datetime.fromtimestamp",
"chaoshumio.notification.notify",
"requests_mock.mock",
"time.time"
] | [((285, 296), 'time.time', 'time.time', ([], {}), '()\n', (294, 296), False, 'import time\n'), ((1271, 1282), 'time.time', 'time.time', ([], {}), '()\n', (1280, 1282), False, 'import time\n'), ((537, 557), 'requests_mock.mock', 'requests_mock.mock', ([], {}), '()\n', (555, 557), False, 'import requests_mock\n'), ((1003... |
"""Tests for the `MonopileDesign` class."""
__author__ = "<NAME>"
__copyright__ = "Copyright 2020, National Renewable Energy Laboratory"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
from copy import deepcopy
from itertools import product
import pytest
from ORBIT.phases.design import MonopileDesign
base = {
... | [
"copy.deepcopy",
"ORBIT.phases.design.MonopileDesign"
] | [((1214, 1236), 'ORBIT.phases.design.MonopileDesign', 'MonopileDesign', (['config'], {}), '(config)\n', (1228, 1236), False, 'from ORBIT.phases.design import MonopileDesign\n'), ((2033, 2053), 'ORBIT.phases.design.MonopileDesign', 'MonopileDesign', (['base'], {}), '(base)\n', (2047, 2053), False, 'from ORBIT.phases.des... |
from __future__ import print_function
import argparse
from bs4 import BeautifulSoup, SoupStrainer
from datetime import datetime
import hashlib
import logging
import os
import ssl
import sys
from urllib.request import urlopen
import urllib.error
"""
MIT License
Copyright (c) 2017 <NAME>, <NAME>
Please share comments ... | [
"os.path.join",
"logging.FileHandler",
"os.makedirs",
"os.path.dirname",
"logging.StreamHandler",
"os.path.exists",
"urllib.request.urlopen",
"logging.Formatter",
"hashlib.sha256",
"bs4.SoupStrainer",
"sys.exit",
"ssl._create_unverified_context",
"logging.getLogger"
] | [((1576, 1603), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1593, 1603), False, 'import logging\n'), ((2029, 2061), 'ssl._create_unverified_context', 'ssl._create_unverified_context', ([], {}), '()\n', (2059, 2061), False, 'import ssl\n'), ((3870, 3886), 'hashlib.sha256', 'hashlib.sha... |
from starlette.requests import Request
from starlette.responses import JSONResponse
from rap.common.exceptions import BaseRapError
async def api_exception(request: Request, exc: Exception) -> JSONResponse:
if isinstance(exc, BaseRapError):
return JSONResponse({"code": exc.status_code, "msg": exc.message}... | [
"starlette.responses.JSONResponse"
] | [((262, 321), 'starlette.responses.JSONResponse', 'JSONResponse', (["{'code': exc.status_code, 'msg': exc.message}"], {}), "({'code': exc.status_code, 'msg': exc.message})\n", (274, 321), False, 'from starlette.responses import JSONResponse\n')] |
# -*- coding: utf-8 -*-
'''Custom exceptions for the framework.'''
import copy
import httplib as http
from flask import request
class FrameworkError(Exception):
"""Base class from which framework-related errors inherit."""
pass
class HTTPError(FrameworkError):
error_msgs = {
http.BAD_REQUEST: {
... | [
"copy.deepcopy"
] | [((2804, 2828), 'copy.deepcopy', 'copy.deepcopy', (['self.data'], {}), '(self.data)\n', (2817, 2828), False, 'import copy\n')] |
##lots of imports. Some are unnecessary but I left a lot just to be safe...
import matplotlib.pyplot as plt
import matplotlib
from astropy.io import fits
import numpy as np
import astropy.table as t
import matplotlib.image as img
from scipy.optimize import newton
from pathlib import Path
import math
import matplotlib.c... | [
"numpy.nanpercentile",
"numpy.ones",
"numpy.isnan",
"matplotlib.pyplot.figure",
"numpy.mean",
"matplotlib.pyplot.tight_layout",
"numpy.std",
"matplotlib.pyplot.imshow",
"matplotlib.rcParams.update",
"numpy.genfromtxt",
"matplotlib.pyplot.colorbar",
"numpy.max",
"math.log10",
"numpy.linspac... | [((6570, 6645), 'numpy.genfromtxt', 'np.genfromtxt', (['filename'], {'usecols': '(0)', 'skip_header': '(1)', 'dtype': 'str', 'delimiter': '""","""'}), "(filename, usecols=0, skip_header=1, dtype=str, delimiter=',')\n", (6583, 6645), True, 'import numpy as np\n'), ((1658, 1687), 'numpy.ma.array', 'np.ma.array', (['ew'],... |
from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class EyeConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = "cb_backend.eye"
verbose_name = _("Eyes")
def ready(self):
from cb_backend.eye import signals # noqa
| [
"django.utils.translation.gettext_lazy"
] | [((223, 232), 'django.utils.translation.gettext_lazy', '_', (['"""Eyes"""'], {}), "('Eyes')\n", (224, 232), True, 'from django.utils.translation import gettext_lazy as _\n')] |
import src.var as essl
def test(key, op, val):
if op == '==':
if essl.get_var(key) == essl.get_var(val):
return True
return False
elif op == '!=':
if essl.get_var(key) != essl.get_var(val):
return True
return False
elif op == '>':
if... | [
"src.var.get_var"
] | [((78, 95), 'src.var.get_var', 'essl.get_var', (['key'], {}), '(key)\n', (90, 95), True, 'import src.var as essl\n'), ((99, 116), 'src.var.get_var', 'essl.get_var', (['val'], {}), '(val)\n', (111, 116), True, 'import src.var as essl\n'), ((200, 217), 'src.var.get_var', 'essl.get_var', (['key'], {}), '(key)\n', (212, 21... |
# Rubick's Cube representation
# This representation will contain all child objects as well.
# Notes:
# White Side -> Front -> 0
# Red Side -> Top -> 1
# Blue Side -> Left -> 2
# Green Side -> Right -> 3
# Orange Side -> Bottom -> 4
# Yellow Side -> Back -> 5
#
# How si... | [
"copy.deepcopy",
"copy.copy"
] | [((4204, 4223), 'copy.deepcopy', 'copy.deepcopy', (['self'], {}), '(self)\n', (4217, 4223), False, 'import copy\n'), ((12367, 12387), 'copy.copy', 'copy.copy', (['self.face'], {}), '(self.face)\n', (12376, 12387), False, 'import copy\n')] |
# Script for developing multiple scaled sizes of the ROSS simulation engine
# <NAME>
# HPCL
# 4/16/19
# local.config will store each of the simulation model desired run time flags
import os
import sys
import json
import datetime
import stat
def openConfig():
models = []
with open("local-ross.config") as f:
... | [
"json.dump",
"datetime.datetime.today",
"os.stat",
"os.getcwd",
"os.system",
"datetime.datetime.now",
"os.path.isfile",
"os.chdir",
"os.path.join",
"os.listdir"
] | [((3211, 3222), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (3220, 3222), False, 'import os\n'), ((3223, 3251), 'os.system', 'os.system', (['"""mkdir logs-ross"""'], {}), "('mkdir logs-ross')\n", (3232, 3251), False, 'import os\n'), ((3262, 3292), 'os.path.join', 'os.path.join', (['pwd', '"""logs-ross"""'], {}), "(pwd,... |
"""Import-Related Tasks"""
import time
import uuid
from celery import shared_task
from django.conf import settings
from django.core.exceptions import ValidationError
import requests
import unicodecsv
import newrelic.agent
from accounts.utils_user import create_user
from mailer.mailserver import deliver
from user_impo... | [
"user_import.models.ImportRecord.objects.select_related",
"user_import.models.UserImport.objects.get",
"uuid.uuid4",
"user_import.models.ImportRecord.objects.bulk_create",
"accounts.utils_user.create_user",
"user_import.models.ImportRecordStatus",
"time.sleep",
"user_import.models.ImportRecord.objects... | [((1459, 1500), 'user_import.models.UserImport.objects.get', 'UserImport.objects.get', ([], {'pk': 'user_import_id'}), '(pk=user_import_id)\n', (1481, 1500), False, 'from user_import.models import UserImport, ImportRecord, ImportRecordStatus\n'), ((3344, 3385), 'user_import.models.UserImport.objects.get', 'UserImport.o... |
import numpy as np
def sample_mushroom(X, y,
n_mushrooms, # n_rounds (or time steps).
r_eat_good=5.0,
r_eat_bad_lucky=5.0,
r_eat_bad_unlucky=-35.0,
r_eat_bad_lucky_prob=0.5,
r_no_eat=0.0
... | [
"numpy.zeros",
"numpy.ones",
"numpy.hstack",
"numpy.arange",
"numpy.random.choice"
] | [((1863, 1884), 'numpy.zeros', 'np.zeros', (['n_mushrooms'], {}), '(n_mushrooms)\n', (1871, 1884), True, 'import numpy as np\n'), ((1991, 2120), 'numpy.random.choice', 'np.random.choice', (['[r_eat_bad_lucky, r_eat_bad_unlucky]'], {'p': '[r_eat_bad_lucky_prob, 1 - r_eat_bad_lucky_prob]', 'size': 'n_mushrooms'}), '([r_e... |
import datetime
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
# import pandas_datareader as web
import pymc3 as pm
from pymc3.distributions.timeseries import GaussianRandomWalk
import seaborn as sns
import pickle
import warnings
warnings.filterwarnings('ignore')
def obtain_plot_amz_dataset(s... | [
"pymc3.sample",
"pickle.dump",
"pymc3.Model",
"matplotlib.pyplot.show",
"numpy.log",
"matplotlib.pyplot.plot",
"warnings.filterwarnings",
"pandas.read_csv",
"pymc3.Exponential",
"datetime.datetime",
"pymc3.math.exp",
"numpy.array",
"numpy.exp",
"matplotlib.pyplot.ylabel",
"matplotlib.pyp... | [((255, 288), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (278, 288), False, 'import warnings\n'), ((353, 381), 'pandas.read_csv', 'pd.read_csv', (['"""data/amzn.csv"""'], {}), "('data/amzn.csv')\n", (364, 381), True, 'import pandas as pd\n'), ((559, 582), 'numpy.log', ... |
import struct
import time
import kafka.io
import kafka.request_type
class Consumer(kafka.io.IO):
CONSUME_REQUEST_TYPE = kafka.request_type.FETCH
MAX_SIZE = 1024 * 1024
# seconds.
DEFAULT_POLLING_INTERVAL = 2
def __init__(self, topic, partition=0, offset=0, host='localhost', port=9092):
kafka.io.IO._... | [
"struct.unpack",
"struct.pack",
"time.sleep"
] | [((1598, 1718), 'struct.pack', 'struct.pack', (["('>HH%dsiQi' % length)", 'self.request_type', 'length', 'self.topic', 'self.partition', 'self.offset', 'self.max_size'], {}), "('>HH%dsiQi' % length, self.request_type, length, self.topic,\n self.partition, self.offset, self.max_size)\n", (1609, 1718), False, 'import ... |
#
# Copyright 2016 University of Southern California
#
# 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... | [
"bdbag.get_typed_exception",
"importlib.import_module",
"logging.warning",
"logging.getLogger",
"bdbag.urlsplit",
"bdbag.fetch.auth.keychain.get_auth_entries",
"datetime.datetime.now",
"bdbag.fetch.auth.keychain.has_auth_attr"
] | [((978, 1005), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (995, 1005), False, 'import logging\n'), ((2093, 2132), 'bdbag.fetch.auth.keychain.get_auth_entries', 'kc.get_auth_entries', (['url', 'self.keychain'], {}), '(url, self.keychain)\n', (2112, 2132), True, 'from bdbag.fetch.auth i... |
from conans import ConanFile, Meson
class RangConan(ConanFile):
name = "rang"
version = "3.1.0"
license = "The Unlicense"
url = "https://github.com/agauniyal/rang"
description = "A Minimal, Header only Modern c++ library for colors in your terminal"
generators = "pkg_config"
build_requires... | [
"conans.Meson"
] | [((422, 433), 'conans.Meson', 'Meson', (['self'], {}), '(self)\n', (427, 433), False, 'from conans import ConanFile, Meson\n')] |
# @copyright@
# Copyright (c) 2006 - 2019 Teradata
# All rights reserved. Stacki(r) v5.x stacki.com
# https://github.com/Teradata/stacki/blob/master/LICENSE.txt
# @copyright@
#
# @rocks@
# Copyright (c) 2000 - 2010 The Regents of the University of California
# All rights reserved. Rocks(r) v5.4 www.rocksclusters.org
# ... | [
"stack.profile.FrameworkIterator",
"subprocess.Popen",
"stack.profile.GraphHandler",
"stack.cond.EvalCondExpr",
"stack.util.KickstartNodeError",
"os.path.isdir",
"os.path.realpath",
"stack.exception.ArgRequired",
"os.path.exists",
"xml.sax.saxutils.escape",
"stack.roll.Generator",
"os.path.spl... | [((5740, 5792), 'stack.profile.GraphHandler', 'stack.profile.GraphHandler', (['attrs'], {'directories': 'items'}), '(attrs, directories=items)\n', (5766, 5792), False, 'import stack\n'), ((3484, 3509), 'stack.exception.ArgRequired', 'ArgRequired', (['self', '"""node"""'], {}), "(self, 'node')\n", (3495, 3509), False, '... |
"""Test if an empirical (observed) distribution differs significantly from a theoretical (expected, Benfords) distribution."""
# --------------------------------------------------
# Name : benfordslaw.py
# Author : E.Taskesen
# Contact : <EMAIL>
# github : github.com/erdogant/benfordslaw.py
# Lice... | [
"scipy.stats.combine_pvalues",
"wget.filename_from_url",
"os.path.abspath",
"matplotlib.pyplot.show",
"os.makedirs",
"matplotlib.pyplot.plot",
"pandas.read_csv",
"os.path.isdir",
"numpy.zeros",
"wget.download",
"os.path.isfile",
"scipy.stats.ks_2samp",
"matplotlib.pyplot.subplots",
"scipy.... | [((3812, 3823), 'numpy.zeros', 'np.zeros', (['(9)'], {}), '(9)\n', (3820, 3823), True, 'import numpy as np\n'), ((4936, 4965), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'figsize': 'figsize'}), '(figsize=figsize)\n', (4948, 4965), True, 'import matplotlib.pyplot as plt\n'), ((5119, 5183), 'matplotlib.pyplot.pl... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.