code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import os
import re
from pyarrow import json, csv
import pyarrow.parquet as pq
from hdfs import InsecureClient
from tqdm import tqdm
# Define our global variables. TEMPORAL_DIR is the temporary landing zone where raw files will be placed that need
# to be processed PERSISTENT_DIR will be the location of files converte... | [
"re.split",
"os.path.exists",
"os.listdir",
"os.makedirs",
"pyarrow.json.read_json",
"pyarrow.csv.read_csv",
"hdfs.InsecureClient",
"pyarrow.parquet.write_table"
] | [((512, 564), 'hdfs.InsecureClient', 'InsecureClient', (['"""http://10.4.41.82:9870"""'], {'user': '"""bdm"""'}), "('http://10.4.41.82:9870', user='bdm')\n", (526, 564), False, 'from hdfs import InsecureClient\n'), ((1339, 1386), 'pyarrow.json.read_json', 'json.read_json', (['f"""{in_directory}/{in_filename}"""'], {}),... |
# Copyright 2015 TellApart, 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 writi... | [
"itertools.chain",
"tellapart.aurproxy.util.get_logger",
"tellapart.aurproxy.util.slugify"
] | [((678, 698), 'tellapart.aurproxy.util.get_logger', 'get_logger', (['__name__'], {}), '(__name__)\n', (688, 698), False, 'from tellapart.aurproxy.util import slugify, get_logger\n'), ((1996, 2049), 'itertools.chain', 'itertools.chain', (['*[r.blueprints for r in self.routes]'], {}), '(*[r.blueprints for r in self.route... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = '<NAME>'
import warnings
from random import shuffle
from time import time
import numpy as np
import pandas as pd
import xgboost as xgb
from xgboost.callback import reset_learning_rate
import lightgbm as lgb
from catboost import Pool, CatBoostClassifier
from it... | [
"lightgbm.train",
"gbm_utils.get_one_hot_data",
"lightgbm.Dataset",
"catboost.CatBoostClassifier",
"xgboost.DMatrix",
"pandas.HDFStore",
"gbm_utils.get_holdout_set",
"gbm_utils.factorize_cats",
"pandas.set_option",
"numpy.exp",
"numpy.random.seed",
"gbm_utils.OneStepTimeSeriesSplit",
"pandas... | [((561, 610), 'pandas.set_option', 'pd.set_option', (['"""display.expand_frame_repr"""', '(False)'], {}), "('display.expand_frame_repr', False)\n", (574, 610), True, 'import pandas as pd\n'), ((611, 644), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (634, 644), False, 'i... |
from decimal import Decimal
import json
from apps.fund.models import DonationStatuses, Donation
from apps.projects.models import ProjectPlan, ProjectCampaign
from django.test import TestCase, RequestFactory
from django.contrib.contenttypes.models import ContentType
from rest_framework import status
from bluebottle.blu... | [
"django.test.RequestFactory",
"django.contrib.contenttypes.models.ContentType.objects.get_for_model",
"json.dumps",
"apps.fund.models.Donation",
"apps.wallposts.models.TextWallPost",
"datetime.datetime.now",
"apps.projects.models.ProjectPlan",
"apps.projects.models.ProjectCampaign",
"datetime.timede... | [((3001, 3017), 'django.test.RequestFactory', 'RequestFactory', ([], {}), '()\n', (3015, 3017), False, 'from django.test import TestCase, RequestFactory\n'), ((2729, 2771), 'django.contrib.contenttypes.models.ContentType.objects.get_for_model', 'ContentType.objects.get_for_model', (['Project'], {}), '(Project)\n', (276... |
from pylaas_core.abstract.abstract_test_case import AbstractTestCase
from pylaas_core.pylaas_core import PylaasCore
class AbstractServiceIntegrationTest(AbstractTestCase):
_service = None
_service_id = None
def setup_method(self, method):
if not self._service_id:
raise RuntimeError('A... | [
"pylaas_core.pylaas_core.PylaasCore.get_service",
"pylaas_core.pylaas_core.PylaasCore.get_container"
] | [((476, 516), 'pylaas_core.pylaas_core.PylaasCore.get_service', 'PylaasCore.get_service', (['self._service_id'], {}), '(self._service_id)\n', (498, 516), False, 'from pylaas_core.pylaas_core import PylaasCore\n'), ((401, 427), 'pylaas_core.pylaas_core.PylaasCore.get_container', 'PylaasCore.get_container', ([], {}), '()... |
import discord
from discord.ext import commands
import octorest
class OctoPrint(commands.Cog):
def __init__(self, bot: commands.AutoShardedBot):
self.bot = bot
#bot.loop.create_task(self.connect_printer())
async def connect_printer(self):
await self.bot.wait_until_ready()
t... | [
"octorest.OctoRest"
] | [((345, 399), 'octorest.OctoRest', 'octorest.OctoRest', ([], {'url': '"""127.0.0.1:5000"""', 'apikey': 'apikey'}), "(url='127.0.0.1:5000', apikey=apikey)\n", (362, 399), False, 'import octorest\n')] |
#!/usr/bin/env python
'''
Only Alaska
'''
import sys, os, glob
varTypes = ["ws"]
regions = ['alaska']
for region in regions:
main_dir = f'/glade/p/ral/hap/mizukami/oconus_hydro/{region}_run/output/monthly'
if region == 'alaska':
wgt_nc = os.path.join('/glade/work/mizukami/py_mapping/alaska/map... | [
"os.system",
"os.path.exists",
"os.path.join",
"os.makedirs"
] | [((529, 575), 'os.path.join', 'os.path.join', (['main_dir', 'f"""basin_average/{obs}"""'], {}), "(main_dir, f'basin_average/{obs}')\n", (541, 575), False, 'import sys, os, glob\n'), ((264, 392), 'os.path.join', 'os.path.join', (['"""/glade/work/mizukami/py_mapping/alaska/mapping/spatialweights_grid_12km_to_MERIT_Hydro_... |
#!/usr/bin/env python
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without ... | [
"tests.unit.unittest.main",
"boto.dynamodb.layer2.Layer2",
"boto.dynamodb.table.Table",
"boto.dynamodb.batch.Batch",
"boto.dynamodb.batch.BatchList"
] | [((4057, 4072), 'tests.unit.unittest.main', 'unittest.main', ([], {}), '()\n', (4070, 4072), False, 'from tests.unit import unittest\n'), ((2493, 2527), 'boto.dynamodb.layer2.Layer2', 'Layer2', (['"""access_key"""', '"""secret_key"""'], {}), "('access_key', 'secret_key')\n", (2499, 2527), False, 'from boto.dynamodb.lay... |
import paddle
import paddle.fluid as fluid
from paddle.fluid.contrib import sparsity
import numpy as np
paddle.enable_static()
def main():
train_program = fluid.Program()
startup_prog = fluid.Program()
with fluid.program_guard(train_program, startup_prog):
input_data = fluid.layers.data(
... | [
"paddle.fluid.DataFeeder",
"paddle.fluid.contrib.sparsity.create_mask",
"paddle.fluid.Program",
"numpy.multiply",
"paddle.fluid.contrib.sparsity.check_mask_2d",
"paddle.fluid.layers.fc",
"paddle.fluid.contrib.sparsity.ASPHelper.replace_dense_to_sparse_op",
"paddle.fluid.global_scope",
"paddle.fluid.... | [((105, 127), 'paddle.enable_static', 'paddle.enable_static', ([], {}), '()\n', (125, 127), False, 'import paddle\n'), ((161, 176), 'paddle.fluid.Program', 'fluid.Program', ([], {}), '()\n', (174, 176), True, 'import paddle.fluid as fluid\n'), ((196, 211), 'paddle.fluid.Program', 'fluid.Program', ([], {}), '()\n', (209... |
# uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Server\sims\suntan\suntan_tracker.py
# Compiled at: 2019-05-17 03:05:15
# Size of source mod 2**32: 8535 by... | [
"distributor.rollback.ProtocolBufferRollback",
"random.choice",
"services.get_instance_manager",
"cas.cas.get_caspart_bodytype",
"sims4.tuning.tunable.TunableCasPart",
"sims4.tuning.tunable.TunableEnumEntry",
"protocolbuffers.SimObjectAttributes_pb2.PersistableSuntanTracker"
] | [((5213, 5263), 'protocolbuffers.SimObjectAttributes_pb2.PersistableSuntanTracker', 'SimObjectAttributes_pb2.PersistableSuntanTracker', ([], {}), '()\n', (5261, 5263), False, 'from protocolbuffers import SimObjectAttributes_pb2\n'), ((1006, 1063), 'services.get_instance_manager', 'services.get_instance_manager', (['sim... |
# coding=utf-8
import pytest
from hypothesis import given, strategies as st
from mockito import mock, verifyStubbedInvocationsAreUsed, when
from epab.utils import _next_version as nv
@pytest.mark.long
@given(
year=st.integers(min_value=1950, max_value=8000),
month=st.integers(min_value=1, max_value=12),
... | [
"mockito.verifyStubbedInvocationsAreUsed",
"mockito.mock",
"hypothesis.strategies.integers",
"mockito.when",
"epab.utils._next_version._get_calver"
] | [((410, 416), 'mockito.mock', 'mock', ([], {}), '()\n', (414, 416), False, 'from mockito import mock, verifyStubbedInvocationsAreUsed, when\n'), ((589, 622), 'mockito.verifyStubbedInvocationsAreUsed', 'verifyStubbedInvocationsAreUsed', ([], {}), '()\n', (620, 622), False, 'from mockito import mock, verifyStubbedInvocat... |
#!/usr/bin/env python
# license removed for brevity
import os
import sys
current_folder = os.path.dirname(os.path.realpath(__file__))
sys.path.append(current_folder)
main_folder = os.path.join(current_folder, "..")
sys.path.append(main_folder)
import numpy as np
import tensorflow as tf
from tensorflow impor... | [
"tensorflow.keras.layers.UpSampling2D",
"os.path.join",
"tensorflow.logging.set_verbosity",
"os.path.realpath",
"tensorflow.keras.layers.UpSampling3D",
"sys.path.append",
"tensorflow.keras.layers.UpSampling1D"
] | [((139, 170), 'sys.path.append', 'sys.path.append', (['current_folder'], {}), '(current_folder)\n', (154, 170), False, 'import sys\n'), ((186, 220), 'os.path.join', 'os.path.join', (['current_folder', '""".."""'], {}), "(current_folder, '..')\n", (198, 220), False, 'import os\n'), ((222, 250), 'sys.path.append', 'sys.p... |
#!/usr/bin/env python3
import curses
def main(stdscr):
print(curses.has_colors())
curses.start_color()
curses.use_default_colors()
for i in range(0, 255):
# (color index, font color number, background color number)
curses.init_pair(i + 1, i, -1)
try:
for i in range(0, 25... | [
"curses.color_pair",
"curses.wrapper",
"curses.start_color",
"curses.init_pair",
"curses.use_default_colors",
"curses.has_colors"
] | [((552, 572), 'curses.wrapper', 'curses.wrapper', (['main'], {}), '(main)\n', (566, 572), False, 'import curses\n'), ((94, 114), 'curses.start_color', 'curses.start_color', ([], {}), '()\n', (112, 114), False, 'import curses\n'), ((119, 146), 'curses.use_default_colors', 'curses.use_default_colors', ([], {}), '()\n', (... |
import torch
import torch.nn as nn
#==============================<Abstract Classes>==============================#
"""
Class that acts as the base building-blocks of ProgNets.
Includes a module (usually a single layer),
a set of lateral modules, and an activation.
"""
class ProgBlock(nn.Modul... | [
"torch.nn.ModuleList"
] | [((3126, 3150), 'torch.nn.ModuleList', 'nn.ModuleList', (['blockList'], {}), '(blockList)\n', (3139, 3150), True, 'import torch.nn as nn\n'), ((6208, 6223), 'torch.nn.ModuleList', 'nn.ModuleList', ([], {}), '()\n', (6221, 6223), True, 'import torch.nn as nn\n')] |
"""
# Isofill (Gfi) module
"""
#
#
# Module: isofill (Gfi) module #
#
# Copyright: 2000, Regents of the University of California #
# This software may not be distributed to others without #
# permission of the author. ... | [
"vcs.utils.dumpToJson",
"vcs.VCSDeprecationWarning",
"vcs.utils.process_range_from_old_scr",
"cdtime.reltime"
] | [((3771, 3816), 'vcs.utils.process_range_from_old_scr', 'vcs.utils.process_range_from_old_scr', (['code', 'g'], {}), '(code, g)\n', (3807, 3816), False, 'import vcs\n'), ((24563, 24626), 'vcs.VCSDeprecationWarning', 'vcs.VCSDeprecationWarning', (['"""scr script are no longer generated"""'], {}), "('scr script are no lo... |
# vim: et:ts=4:sw=4:fenc=utf-8
import math
import random
import subprocess
from abc import ABC, abstractmethod
from statistics import median
from PITE.register_allocation import Allocator
# This is the interface that a benchmark runner has to implement to be used in
# a benchmarking server.
class LowLevelEvaluator(A... | [
"PITE.register_allocation.Allocator"
] | [((7754, 7768), 'PITE.register_allocation.Allocator', 'Allocator', (['isa'], {}), '(isa)\n', (7763, 7768), False, 'from PITE.register_allocation import Allocator\n'), ((2876, 2895), 'PITE.register_allocation.Allocator', 'Allocator', (['self.isa'], {}), '(self.isa)\n', (2885, 2895), False, 'from PITE.register_allocation... |
from bs4 import BeautifulSoup
import pandas as pd
import numpy as np
import os
import re
import requests
## Dates for data from archive.org
dates = ['20180718125608', '20170713111636', '20160716091733', '20150706182249' ]
## Listing the football seasons from the dates the data was gathered
seasons = [int(i[:... | [
"requests.get",
"bs4.BeautifulSoup",
"pandas.DataFrame",
"os.path.abspath",
"re.search"
] | [((1038, 1067), 'pandas.DataFrame', 'pd.DataFrame', ([], {'columns': 'columns'}), '(columns=columns)\n', (1050, 1067), True, 'import pandas as pd\n'), ((1206, 1240), 'requests.get', 'requests.get', (['url'], {'headers': 'headers'}), '(url, headers=headers)\n', (1218, 1240), False, 'import requests\n'), ((1261, 1304), '... |
# -*- coding: utf-8 -*-
"""
@author : <NAME>
@github : https://github.com/tianpangji
@software : PyCharm
@file : routing.py
@create : 2020/7/29 20:21
"""
import os
import django
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'drf_admin.settings.dev')
from channels.routing import ProtocolTypeRouter, URLRo... | [
"os.environ.setdefault",
"django.urls.re_path",
"django.setup"
] | [((192, 265), 'os.environ.setdefault', 'os.environ.setdefault', (['"""DJANGO_SETTINGS_MODULE"""', '"""drf_admin.settings.dev"""'], {}), "('DJANGO_SETTINGS_MODULE', 'drf_admin.settings.dev')\n", (213, 265), False, 'import os\n'), ((470, 484), 'django.setup', 'django.setup', ([], {}), '()\n', (482, 484), False, 'import d... |
import os
import numpy as np
import argparse
import os.path as osp
import json
from tqdm import tqdm
from mmcv import mkdir_or_exist
def getFlying3dMetas(root, Type, data_type='clean'):
Metas = []
imgDir = 'flyingthings3d/frames_' + data_type + 'pass'
dispDir = 'flyingthings3d/disparity'
Parts = ['A'... | [
"os.path.exists",
"mmcv.mkdir_or_exist",
"os.listdir",
"argparse.ArgumentParser",
"tqdm.tqdm",
"os.path.join",
"json.dump"
] | [((4077, 4093), 'os.path.exists', 'osp.exists', (['root'], {}), '(root)\n', (4087, 4093), True, 'import os.path as osp\n'), ((4135, 4171), 'mmcv.mkdir_or_exist', 'mkdir_or_exist', (['save_annotation_root'], {}), '(save_annotation_root)\n', (4149, 4171), False, 'from mmcv import mkdir_or_exist\n'), ((4420, 4436), 'tqdm.... |
from unittest import TestCase
import numpy as np
from athena import NonlinearLevelSet, ForwardNet, BackwardNet, Normalizer
import torch
import os
from contextlib import contextmanager
import matplotlib.pyplot as plt
@contextmanager
def assert_plot_figures_added():
"""
Assert that the number of figures is high... | [
"os.path.exists",
"torch.as_tensor",
"athena.ForwardNet",
"numpy.ones",
"athena.NonlinearLevelSet",
"matplotlib.pyplot.gcf",
"athena.BackwardNet",
"athena.Normalizer",
"numpy.loadtxt"
] | [((1052, 1095), 'torch.as_tensor', 'torch.as_tensor', (['inputs'], {'dtype': 'torch.double'}), '(inputs, dtype=torch.double)\n', (1067, 1095), False, 'import torch\n'), ((1109, 1155), 'torch.as_tensor', 'torch.as_tensor', (['grad_lift'], {'dtype': 'torch.double'}), '(grad_lift, dtype=torch.double)\n', (1124, 1155), Fal... |
from abc import ABC
from common.StrUtils import isEmpty, isAnyEmpty
from common.TimeUtils import getTimeStr
from services.dao.SqliteDao import SqliteDao
from vo.AutoScaleSettingVO import AutoScaleSettingVO
from vo.LogVO import LogVO
'''
@Author Jiage
@Date 2022-02-09
@Function query auto scale and update scale
'''
... | [
"common.StrUtils.isEmpty",
"vo.AutoScaleSettingVO.AutoScaleSettingVO"
] | [((630, 650), 'vo.AutoScaleSettingVO.AutoScaleSettingVO', 'AutoScaleSettingVO', ([], {}), '()\n', (648, 650), False, 'from vo.AutoScaleSettingVO import AutoScaleSettingVO\n'), ((662, 678), 'common.StrUtils.isEmpty', 'isEmpty', (['records'], {}), '(records)\n', (669, 678), False, 'from common.StrUtils import isEmpty, is... |
#!/usr/bin/env python
"""
Created by howie.hu at 08/04/2018.
"""
import asyncio
import sys
import time
sys.path.append('../../')
from hproxy.database import DatabaseSetting
from hproxy.utils import logger
from hproxy.spider.proxy_tools import get_proxy_info
db_client = DatabaseSetting()
async def valid_proxies():... | [
"hproxy.database.DatabaseSetting",
"asyncio.wait",
"hproxy.spider.proxy_tools.get_proxy_info",
"time.time",
"asyncio.get_event_loop",
"sys.path.append"
] | [((105, 130), 'sys.path.append', 'sys.path.append', (['"""../../"""'], {}), "('../../')\n", (120, 130), False, 'import sys\n'), ((274, 291), 'hproxy.database.DatabaseSetting', 'DatabaseSetting', ([], {}), '()\n', (289, 291), False, 'from hproxy.database import DatabaseSetting\n'), ((373, 384), 'time.time', 'time.time',... |
# Copyright © 2017 <NAME>, All rights reserved
# http://github.com/omartinsky/pybor
from yc_helpers import *
from dateutil.relativedelta import relativedelta
from numpy import *
import dateutil.parser
import enum, calendar, datetime
class Tenor:
def __init__(self, s):
try:
assert... | [
"calendar.is_holiday",
"calendar.monthrange",
"dateutil.relativedelta.relativedelta",
"datetime.date"
] | [((1194, 1221), 'datetime.date', 'datetime.date', (['(1899)', '(12)', '(30)'], {}), '(1899, 12, 30)\n', (1207, 1221), False, 'import enum, calendar, datetime\n'), ((1627, 1648), 'dateutil.relativedelta.relativedelta', 'relativedelta', ([], {'days': 'd'}), '(days=d)\n', (1640, 1648), False, 'from dateutil.relativedelta ... |
"""
:codeauthor: <NAME> <<EMAIL>>
"""
import pytest
import salt.states.layman as layman
from tests.support.mock import MagicMock, patch
@pytest.fixture
def configure_loader_modules():
return {layman: {}}
def test_present():
"""
Test to verify that the overlay is present.
"""
name = "sunrise"... | [
"tests.support.mock.patch.dict",
"salt.states.layman.present",
"salt.states.layman.absent",
"tests.support.mock.MagicMock"
] | [((405, 440), 'tests.support.mock.MagicMock', 'MagicMock', ([], {'side_effect': '[[name], []]'}), '(side_effect=[[name], []])\n', (414, 440), False, 'from tests.support.mock import MagicMock, patch\n'), ((1063, 1098), 'tests.support.mock.MagicMock', 'MagicMock', ([], {'side_effect': '[[], [name]]'}), '(side_effect=[[],... |
from math import sin, cos, tan
angulo = float(input("Digite o valor do ângulo: "))
seno = sin(angulo)
cosseno = cos(angulo)
tangente = tan(angulo)
print(f'O seno, cosseno e tangente de {angulo}° são respectivamente {seno:.2f}, {cosseno:.2f}, {tangente:.2f}') | [
"math.cos",
"math.sin",
"math.tan"
] | [((90, 101), 'math.sin', 'sin', (['angulo'], {}), '(angulo)\n', (93, 101), False, 'from math import sin, cos, tan\n'), ((112, 123), 'math.cos', 'cos', (['angulo'], {}), '(angulo)\n', (115, 123), False, 'from math import sin, cos, tan\n'), ((135, 146), 'math.tan', 'tan', (['angulo'], {}), '(angulo)\n', (138, 146), False... |
"""
========
Circuits
========
Convert a Boolean circuit to an equivalent Boolean formula.
A Boolean circuit can be exponentially more expressive than an
equivalent formula in the worst case, since the circuit can reuse
subcircuits multiple times, whereas a formula cannot reuse subformulas
more than once. Thus creati... | [
"networkx.utils.arbitrary_element",
"networkx.dag_to_branching",
"networkx.DiGraph",
"networkx.draw_networkx",
"matplotlib.pyplot.figure",
"networkx.get_node_attributes",
"networkx.multipartite_layout",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.show"
] | [((2498, 2510), 'networkx.DiGraph', 'nx.DiGraph', ([], {}), '()\n', (2508, 2510), True, 'import networkx as nx\n'), ((3123, 3163), 'networkx.get_node_attributes', 'nx.get_node_attributes', (['circuit', '"""label"""'], {}), "(circuit, 'label')\n", (3145, 3163), True, 'import networkx as nx\n'), ((3287, 3313), 'matplotli... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
from distutils.core import setup
setup(name = 'foolnltk',
version = '0.0.8',
description = 'Fool Nature Language toolkit ',
author = 'wu.zheng',
author_email = '<EMAIL>',
url = 'https://github.com/rockyzhengwu/FoolNLTK',
packages = ['fool'],
p... | [
"distutils.core.setup"
] | [((82, 417), 'distutils.core.setup', 'setup', ([], {'name': '"""foolnltk"""', 'version': '"""0.0.8"""', 'description': '"""Fool Nature Language toolkit """', 'author': '"""wu.zheng"""', 'author_email': '"""<EMAIL>"""', 'url': '"""https://github.com/rockyzhengwu/FoolNLTK"""', 'packages': "['fool']", 'package_dir': "{'fo... |
# Copyright 2006-2014 by <NAME>. All rights reserved.
# Revisions copyright 2011 <NAME>. All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""Tests for Bio.AlignIO.MauveIO module.... | [
"os.path.join",
"os.path.realpath",
"Bio.AlignIO.MauveIO.MauveWriter",
"Bio.AlignIO.MauveIO.MauveIterator",
"Bio.SeqIO.parse",
"unittest.main",
"io.StringIO",
"unittest.TextTestRunner"
] | [((618, 666), 'os.path.join', 'os.path.join', (['MAUVE_TEST_DATA_DIR', '"""simple.xmfa"""'], {}), "(MAUVE_TEST_DATA_DIR, 'simple.xmfa')\n", (630, 666), False, 'import os\n'), ((683, 729), 'os.path.join', 'os.path.join', (['MAUVE_TEST_DATA_DIR', '"""simple.fa"""'], {}), "(MAUVE_TEST_DATA_DIR, 'simple.fa')\n", (695, 729)... |
# 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, ... | [
"numpy.clip",
"ldif.util.path_util.gaps_path",
"ldif.representation.structured_implicit_function.get_effective_element_count",
"tensorflow.linalg.inv",
"ldif.inference.extract_mesh.marching_cubes",
"tensorflow.gradients",
"ldif.util.file_util.log.verbose",
"numpy.arange",
"numpy.reshape",
"tensorf... | [((1619, 1649), 'importlib.reload', 'importlib.reload', (['extract_mesh'], {}), '(extract_mesh)\n', (1635, 1649), False, 'import importlib\n'), ((1650, 1696), 'importlib.reload', 'importlib.reload', (['structured_implicit_function'], {}), '(structured_implicit_function)\n', (1666, 1696), False, 'import importlib\n'), (... |
import os
import sys
import bokeh.layouts as bkl
import bokeh.palettes
import bokeh.plotting as bkp
import numpy as np
# make it so we can import models/etc from parent folder
sys.path.insert(1, os.path.join(sys.path[0], '../common'))
from plotting import *
fig_err_g = bkp.figure(y_axis_type='log', x_axis_type='log'... | [
"bokeh.plotting.figure",
"os.path.join",
"bokeh.layouts.gridplot",
"numpy.random.randint",
"numpy.percentile",
"numpy.load"
] | [((273, 434), 'bokeh.plotting.figure', 'bkp.figure', ([], {'y_axis_type': '"""log"""', 'x_axis_type': '"""log"""', 'y_axis_label': '"""Error"""', 'x_axis_label': '"""Coreset Construction Iterations"""', 'plot_width': '(1250)', 'plot_height': '(1250)'}), "(y_axis_type='log', x_axis_type='log', y_axis_label='Error',\n ... |
# Copyright 2020 Dragonchain, Inc.
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
# 6. Tr... | [
"dragonchain.webserver.request_authorizer.Authenticated",
"dragonchain.webserver.lib.misc.get_v1_status"
] | [((1809, 1911), 'dragonchain.webserver.request_authorizer.Authenticated', 'request_authorizer.Authenticated', ([], {'api_resource': '"""misc"""', 'api_operation': '"""read"""', 'api_name': '"""get_status"""'}), "(api_resource='misc', api_operation='read',\n api_name='get_status')\n", (1841, 1911), False, 'from drago... |
import numpy as np
import matplotlib.pyplot as plt
import datetime as dt
from sklearn.svm import SVR
from Helper_Functions import File_Ops as File_IO
from Helper_Functions import Dataset_Ops as Data
from Helper_Functions import Parameter_Tuning as Tuning
from Helper_Functions import Plotting_Ops as Plotter
def non_li... | [
"datetime.datetime",
"Helper_Functions.Parameter_Tuning.Hyper_parameter_tuning",
"Helper_Functions.Plotting_Ops.plot_svr_combined",
"Helper_Functions.File_Ops.read_single_file",
"Helper_Functions.File_Ops.save_model",
"Helper_Functions.Plotting_Ops.plot_svr",
"Helper_Functions.Dataset_Ops.split_pos_and_... | [((415, 427), 'sklearn.svm.SVR', 'SVR', ([], {'coef0': '(1)'}), '(coef0=1)\n', (418, 427), False, 'from sklearn.svm import SVR\n'), ((438, 497), 'Helper_Functions.Parameter_Tuning.Hyper_parameter_tuning', 'Tuning.Hyper_parameter_tuning', (['X', 'y', 'svr_estimator', 'configs'], {}), '(X, y, svr_estimator, configs)\n', ... |
from brachiograph import BrachioGraph
# Uncomment the definition you want to use.
# This is an example BrachioGraph definition. If you build a plotter as
# described in the "Get started" section of the documentation, this definition
# is likely to work well. However, you should work out your own servo
# angle/pulse-w... | [
"brachiograph.BrachioGraph"
] | [((769, 997), 'brachiograph.BrachioGraph', 'BrachioGraph', ([], {'inner_arm': '(8)', 'outer_arm': '(8)', 'bounds': '(-2, 6, 8, 13)', 'servo_1_angle_pws': 'servo_1_angle_pws', 'servo_2_angle_pws': 'servo_2_angle_pws', 'pw_up': '(1290)', 'pw_down': '(1420)', 'hysteresis_correction_1': '(0)', 'hysteresis_correction_2': '(... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Various tools for calculating statistics
"""
#-----------------------------------------------------------------------------
# Boilerplate
#-----------------------------------------------------------------------------
from __future__ import absolute_import, division, pri... | [
"numpy.insert",
"pygeostat.z_percentile",
"numpy.reshape",
"numpy.ones",
"scipy.stats.rankdata",
"numpy.average",
"rpy2.robjects.r.toString",
"rpy2.robjects.packages.importr",
"rpy2.robjects.r.matrix",
"numpy.array",
"numpy.var",
"numpy.concatenate",
"pandas.DataFrame",
"pygeostat.cdf",
... | [((619, 647), 'numpy.average', 'np.average', (['var'], {'weights': 'wts'}), '(var, weights=wts)\n', (629, 647), True, 'import numpy as np\n'), ((1749, 1760), 'scipy.stats.rankdata', 'rankdata', (['x'], {}), '(x)\n', (1757, 1760), False, 'from scipy.stats import rankdata\n'), ((1769, 1780), 'scipy.stats.rankdata', 'rank... |
# coding: utf-8
# http://sametmax.com/ecrire-des-logs-en-python/
import logging
from logging.handlers import RotatingFileHandler
from systemtools.system import *
from systemtools.basics import *
from systemtools.file import *
from enum import Enum
import traceback
LOGTYPE = Enum('LOGTYPE', 'error info warning')
de... | [
"logging.getLogger",
"traceback.format_exc",
"logging.StreamHandler",
"logging.Formatter",
"logging.handlers.RotatingFileHandler",
"enum.Enum"
] | [((278, 315), 'enum.Enum', 'Enum', (['"""LOGTYPE"""', '"""error info warning"""'], {}), "('LOGTYPE', 'error info warning')\n", (282, 315), False, 'from enum import Enum\n'), ((2759, 2793), 'logging.getLogger', 'logging.getLogger', (['self.randomName'], {}), '(self.randomName)\n', (2776, 2793), False, 'import logging\n'... |
import os
import os.path
import tempfile
import unittest
import xen.xend.XendOptions
xen.xend.XendOptions.XendOptions.config_default = '/dev/null'
import xen.xm.create
from xen.util import auxbin
class test_create(unittest.TestCase):
def assertEqualModuloNulls_(self, a, b):
for k, v in a.iteritems():
... | [
"os.close",
"unittest.makeSuite",
"os.write",
"xen.util.auxbin.xen_configdir",
"os.path.basename",
"tempfile.mkstemp"
] | [((6625, 6656), 'unittest.makeSuite', 'unittest.makeSuite', (['test_create'], {}), '(test_create)\n', (6643, 6656), False, 'import unittest\n'), ((884, 902), 'tempfile.mkstemp', 'tempfile.mkstemp', ([], {}), '()\n', (900, 902), False, 'import tempfile\n'), ((911, 923), 'os.close', 'os.close', (['fd'], {}), '(fd)\n', (9... |
# -*- coding: utf-8 -*-
# Copyright (c) 2018-2021, earthobservations developers.
# Distributed under the MIT License. See LICENSE for more info.
import re
import pytest
from tests.provider.dwd.radar import station_reference_pattern_unsorted
from wetterdienst.provider.dwd.radar import (
DwdRadarParameter,
DwdR... | [
"wetterdienst.provider.dwd.radar.DwdRadarValues",
"pytest.skip",
"h5py.File"
] | [((803, 1000), 'wetterdienst.provider.dwd.radar.DwdRadarValues', 'DwdRadarValues', ([], {'parameter': 'DwdRadarParameter.SWEEP_PCP_VELOCITY_H', 'start_date': 'DwdRadarDate.MOST_RECENT', 'site': 'DwdRadarSite.BOO', 'fmt': 'DwdRadarDataFormat.HDF5', 'subset': 'DwdRadarDataSubset.SIMPLE'}), '(parameter=DwdRadarParameter.S... |
import json
import sys
import requests
from django.contrib.auth.base_user import BaseUserManager
from django.contrib.auth.hashers import make_password
from django.http import (Http404, HttpResponseBadRequest,
HttpResponseForbidden, JsonResponse)
from rest_framework import parsers, renderers, ... | [
"rest_framework.authtoken.models.Token.objects.get",
"rest_framework.authtoken.models.Token.objects.get_or_create",
"rest_framework.response.Response",
"sys.stdout.flush",
"rest_framework.compat.coreschema.String"
] | [((1117, 1135), 'sys.stdout.flush', 'sys.stdout.flush', ([], {}), '()\n', (1133, 1135), False, 'import sys\n'), ((1575, 1638), 'rest_framework.response.Response', 'Response', (['serializer.errors'], {'status': 'status.HTTP_400_BAD_REQUEST'}), '(serializer.errors, status=status.HTTP_400_BAD_REQUEST)\n', (1583, 1638), Fa... |
#!/usr/bin/env python
from setuptools import setup
setup(
name='djangocms-ace',
version='0.3.4',
description='Ace Editor plugin for Django CMS',
author='<NAME>',
author_email='<EMAIL>',
url='https://github.com/TigerND/djangocms-ace',
packages=[
'djangocms_ace',
'djangocms_a... | [
"setuptools.setup"
] | [((53, 637), 'setuptools.setup', 'setup', ([], {'name': '"""djangocms-ace"""', 'version': '"""0.3.4"""', 'description': '"""Ace Editor plugin for Django CMS"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'url': '"""https://github.com/TigerND/djangocms-ace"""', 'packages': "['djangocms_ace', 'djangocms_... |
from setuptools import setup, Extension
# Compile *mysum.cpp* into a shared library
setup(
#...
ext_modules=[Extension('Addbook', ['Addbook.cpp'],),],
)
| [
"setuptools.Extension"
] | [((119, 156), 'setuptools.Extension', 'Extension', (['"""Addbook"""', "['Addbook.cpp']"], {}), "('Addbook', ['Addbook.cpp'])\n", (128, 156), False, 'from setuptools import setup, Extension\n')] |
import gym
from gym import error, spaces, utils
import numpy as np
from gym.utils import seeding
from ctypes import *
raisim_dll = CDLL("../gym_learn_wbc/envs/raisim_dll/build/libstoch3_raisim.so")
def init_raisim_dll_functions():
raisim_dll._sim.restype = None
raisim_dll._sim.argtypes = [c_double*10,c_long,c_double... | [
"numpy.clip",
"numpy.abs",
"numpy.absolute",
"gym.spaces.Box",
"numpy.exp",
"numpy.array"
] | [((1290, 1351), 'numpy.abs', 'np.abs', (['(self.target_velocity[0] - self.avg_velocity_limits[0])'], {}), '(self.target_velocity[0] - self.avg_velocity_limits[0])\n', (1296, 1351), True, 'import numpy as np\n'), ((1367, 1428), 'numpy.abs', 'np.abs', (['(self.target_velocity[0] - self.avg_velocity_limits[1])'], {}), '(s... |
import os
import logging
from boto3.session import Session
import boto3
def read_config():
return {
'region': os.getenv('S3_REGION')
, 'key': os.getenv('S3_KEY')
, 'secret': os.getenv('S3_SECRET')
, 'bucket': os.getenv('S3_BUCKET')
, 'filename': os.getenv('S3_FILE')
... | [
"boto3.resource",
"logging.info",
"os.getenv",
"os.getcwd"
] | [((523, 600), 'logging.info', 'logging.info', (['f"""Downloading {cfg[\'filename\']} fomr S3 Bucket {cfg[\'bucket\']}"""'], {}), '(f"Downloading {cfg[\'filename\']} fomr S3 Bucket {cfg[\'bucket\']}")\n', (535, 600), False, 'import logging\n'), ((611, 717), 'boto3.resource', 'boto3.resource', (['"""s3"""', "cfg['region'... |
#!/usr/bin/env python
import rospy
from move_bb8 import MoveBB8
from my_custom_srv_msg_pkg.srv import MyCustomServiceMessage, MyCustomServiceMessageResponse
def my_callback(request):
rospy.loginfo('Service has been called')
obj = MoveBB8()
obj.move_bb8(request.duration)
rospy.loginfo('Finished')
re... | [
"rospy.init_node",
"rospy.Service",
"my_custom_srv_msg_pkg.srv.MyCustomServiceMessageResponse",
"rospy.spin",
"move_bb8.MoveBB8",
"rospy.loginfo"
] | [((411, 444), 'rospy.init_node', 'rospy.init_node', (['"""service_server"""'], {}), "('service_server')\n", (426, 444), False, 'import rospy\n'), ((455, 528), 'rospy.Service', 'rospy.Service', (['"""/move_bb8_in_circle"""', 'MyCustomServiceMessage', 'my_callback'], {}), "('/move_bb8_in_circle', MyCustomServiceMessage, ... |
"""sigec URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based v... | [
"django.conf.urls.static.static",
"django.urls.path",
"django.urls.include"
] | [((919, 985), 'django.urls.path', 'path', (['"""create_offer/"""', 'saasviews.offer_create'], {'name': '"""offer_create"""'}), "('create_offer/', saasviews.offer_create, name='offer_create')\n", (923, 985), False, 'from django.urls import path, include, re_path\n'), ((1018, 1124), 'django.urls.path', 'path', (['"""get_... |
from distutils.core import setup
setup(
name = 'ImageSocket',
packages = ['ImageSocket'],
version = '1.0.0',
description = 'The python plugin to receive the image socket',
author = '<NAME>',
author_email = '<EMAIL>',
url = 'https://github.com/SunnerLi/ImageSocket_Python', # use the URL to the github repo
downlo... | [
"distutils.core.setup"
] | [((33, 425), 'distutils.core.setup', 'setup', ([], {'name': '"""ImageSocket"""', 'packages': "['ImageSocket']", 'version': '"""1.0.0"""', 'description': '"""The python plugin to receive the image socket"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'url': '"""https://github.com/SunnerLi/ImageSocket_Py... |
# This test code was written by the `hypothesis.extra.ghostwriter` module
# and is provided under the Creative Commons Zero public domain dedication.
import carvajal.aws
from collections import ChainMap
from hypothesis import given, strategies as st
from re import compile
# TODO: replace st.nothing() with appropriate... | [
"hypothesis.strategies.text",
"hypothesis.strategies.builds",
"hypothesis.strategies.sampled_from",
"hypothesis.strategies.none",
"hypothesis.strategies.integers",
"hypothesis.strategies.nothing"
] | [((349, 364), 'hypothesis.strategies.builds', 'st.builds', (['list'], {}), '(list)\n', (358, 364), True, 'from hypothesis import given, strategies as st\n'), ((947, 962), 'hypothesis.strategies.builds', 'st.builds', (['list'], {}), '(list)\n', (956, 962), True, 'from hypothesis import given, strategies as st\n'), ((974... |
from rest_framework import serializers
from rest_framework_gis import serializers
from rest_framework.serializers import CharField, IntegerField, BooleanField
from passenger_census_api.models import PassengerCensus, AnnualRouteRidership, OrCensusBlockPolygons, WaCensusBlockPolygons, AnnualCensusBlockRidership, Censu... | [
"rest_framework.serializers.IntegerField",
"rest_framework.serializers.BooleanField"
] | [((2056, 2070), 'rest_framework.serializers.IntegerField', 'IntegerField', ([], {}), '()\n', (2068, 2070), False, 'from rest_framework.serializers import CharField, IntegerField, BooleanField\n'), ((2097, 2111), 'rest_framework.serializers.IntegerField', 'IntegerField', ([], {}), '()\n', (2109, 2111), False, 'from rest... |
import pytest
from ..encryptor import Encryptor, Decryptor
from secrets import token_bytes, randbelow
@pytest.fixture
def private_key_bytes():
private_key_bytes = Decryptor.generate_private_key(
password=None
)
yield private_key_bytes
@pytest.fixture
def decryptor(private_key_bytes):
decryptor = Decrypt... | [
"secrets.randbelow"
] | [((572, 586), 'secrets.randbelow', 'randbelow', (['(512)'], {}), '(512)\n', (581, 586), False, 'from secrets import token_bytes, randbelow\n'), ((776, 790), 'secrets.randbelow', 'randbelow', (['(512)'], {}), '(512)\n', (785, 790), False, 'from secrets import token_bytes, randbelow\n')] |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2018-02-26 15:01
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0005_auto_20180226_0925'),
]
operations = [
migrations.RemoveFi... | [
"django.db.migrations.RemoveField",
"django.db.models.ManyToManyField"
] | [((301, 363), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""achievement"""', 'name': '"""users"""'}), "(model_name='achievement', name='users')\n", (323, 363), False, 'from django.db import migrations, models\n'), ((518, 589), 'django.db.models.ManyToManyField', 'models.ManyToMan... |
import properties as properties
from neo4j import GraphDatabase
from pypher.builder import Pypher
import pytest
from py2neo import Graph
def testPy2():
graph = Graph("bolt://localhost:7687", auth=("neo4j", "harry"))
res = graph.run("MATCH (n) return n")
data = res.data()
result_data = dict()
for ... | [
"neo4j.GraphDatabase.driver",
"py2neo.Graph"
] | [((166, 221), 'py2neo.Graph', 'Graph', (['"""bolt://localhost:7687"""'], {'auth': "('neo4j', 'harry')"}), "('bolt://localhost:7687', auth=('neo4j', 'harry'))\n", (171, 221), False, 'from py2neo import Graph\n'), ((470, 525), 'py2neo.Graph', 'Graph', (['"""bolt://localhost:7687"""'], {'auth': "('neo4j', 'harry')"}), "('... |
from django import forms
from django.core.validators import RegexValidator, EmailValidator, validate_ipv46_address
validate_hostname = RegexValidator(regex=r'[a-zA-Z0-9-_]*\.[a-zA-Z]{2,6}')
my_validator = RegexValidator(r'[a-zA-Z0-9-_]*\.[a-zA-Z]{2,6}', "Your string should contain letter A in it.")
class CacheCheck(f... | [
"django.core.validators.RegexValidator",
"django.forms.CharField"
] | [((135, 189), 'django.core.validators.RegexValidator', 'RegexValidator', ([], {'regex': '"""[a-zA-Z0-9-_]*\\\\.[a-zA-Z]{2,6}"""'}), "(regex='[a-zA-Z0-9-_]*\\\\.[a-zA-Z]{2,6}')\n", (149, 189), False, 'from django.core.validators import RegexValidator, EmailValidator, validate_ipv46_address\n'), ((206, 304), 'django.core... |
from functools import partial
from typing import Sequence
import pytest
from torch import Tensor, tensor
from tests.text.helpers import TextTester
from tests.text.inputs import _inputs_multiple_references, _inputs_single_sentence_multiple_references
from torchmetrics.functional.text.chrf import chrf_score
from torchm... | [
"torchmetrics.functional.text.chrf.chrf_score",
"sacrebleu.metrics.CHRF",
"pytest.mark.parametrize",
"torch.tensor",
"functools.partial",
"pytest.mark.skipif",
"torchmetrics.text.chrf.CHRFScore"
] | [((1071, 1287), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (["['char_order', 'word_order', 'lowercase', 'whitespace']", '[(6, 2, False, False), (6, 2, False, True), (4, 2, True, False), (6, 0, \n True, False), (6, 0, True, True), (4, 0, False, True)]'], {}), "(['char_order', 'word_order', 'lowercase',\n ... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 Centre National d'Etudes Spatiales (CNES)
#
# 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
#
# ... | [
"orchestrator.common.logger.maja_logging.configure_logger",
"orchestrator.common.xml_tools.get_only_value"
] | [((1734, 1760), 'orchestrator.common.logger.maja_logging.configure_logger', 'configure_logger', (['__name__'], {}), '(__name__)\n', (1750, 1760), False, 'from orchestrator.common.logger.maja_logging import configure_logger\n'), ((2182, 2223), 'orchestrator.common.xml_tools.get_only_value', 'get_only_value', (['root', '... |
import re
from django.contrib.staticfiles.templatetags.staticfiles import static
from markdown.extensions import Extension
from markdown.postprocessors import Postprocessor
assetRE = re.compile(r'{% static [\'"](.*?)[\'"] %}')
class DjangoStaticAssetsProcessor(Postprocessor):
def replacement(self, match):
... | [
"django.contrib.staticfiles.templatetags.staticfiles.static",
"re.compile"
] | [((186, 232), 're.compile', 're.compile', (['"""{% static [\\\\\'"](.*?)[\\\\\'"] %}"""'], {}), '(\'{% static [\\\\\\\'"](.*?)[\\\\\\\'"] %}\')\n', (196, 232), False, 'import re\n'), ((360, 372), 'django.contrib.staticfiles.templatetags.staticfiles.static', 'static', (['path'], {}), '(path)\n', (366, 372), False, 'from... |
# -*- coding: utf-8 -*-
"""
Example of sending data to Splunk.
Documentation related to the script is available in Cyberwatch: https://[CYBERWATCH_URL]/help/en/5_connect_cyberwatch_third_party/import_data_siem.md
"""
import requests
import os
from six.moves.configparser import ConfigParser
from cbw_api_toolbox.cbw_ap... | [
"os.path.dirname",
"requests.post",
"six.moves.configparser.ConfigParser"
] | [((667, 681), 'six.moves.configparser.ConfigParser', 'ConfigParser', ([], {}), '()\n', (679, 681), False, 'from six.moves.configparser import ConfigParser\n'), ((502, 569), 'requests.post', 'requests.post', ([], {'url': 'url', 'headers': 'headers', 'data': 'payload', 'verify': '(False)'}), '(url=url, headers=headers, d... |
from django.contrib import admin
from . import models
from common.admin import ApplicationAdminInline, PlayerInvitationAdminInline, TeamMemberAdminInline
from teams.admin import TeamAdminInline
class TeamsCaptainOfInline(TeamAdminInline):
fk_name = 'captain'
verbose_name = 'Team Captain Of'
verbose_name_... | [
"django.contrib.admin.site.register"
] | [((1874, 1921), 'django.contrib.admin.site.register', 'admin.site.register', (['models.Player', 'PlayerAdmin'], {}), '(models.Player, PlayerAdmin)\n', (1893, 1921), False, 'from django.contrib import admin\n')] |
from django.test import TestCase
from addressbase.models import UprnToCouncil, Address
from councils.tests.factories import CouncilFactory
from data_importers.tests.stubs import stub_addressimport
# High-level functional tests for import scripts
class ImporterTest(TestCase):
opts = {"nochecks": True, "verbosity"... | [
"addressbase.models.UprnToCouncil.objects.filter",
"addressbase.models.UprnToCouncil.objects.update_or_create",
"addressbase.models.Address.objects.update_or_create",
"councils.tests.factories.CouncilFactory",
"data_importers.tests.stubs.stub_addressimport.Command"
] | [((590, 641), 'councils.tests.factories.CouncilFactory', 'CouncilFactory', ([], {'pk': '"""ABC"""', 'identifiers': "['X01000000']"}), "(pk='ABC', identifiers=['X01000000'])\n", (604, 641), False, 'from councils.tests.factories import CouncilFactory\n'), ((657, 685), 'data_importers.tests.stubs.stub_addressimport.Comman... |
from getpass import getpass
def get_username() -> str:
u = input("UTORID: ")
return u
def get_password() -> str:
return getpass("Password: ")
"""Deprecated
def get_download_location() -> str:
loc = ""
while loc == "":
loc = input("Download Location \n(i.e. /Documents/textbooks): ")
re... | [
"getpass.getpass"
] | [((134, 155), 'getpass.getpass', 'getpass', (['"""Password: """'], {}), "('Password: ')\n", (141, 155), False, 'from getpass import getpass\n')] |
from django.db import connection
from usaspending_api.common.etl import ETLQuery, ETLTable
from usaspending_api.common.etl.operations import delete_obsolete_rows, insert_missing_rows, update_changed_rows
# This is basically the desired final state of the federal_account table. We can diff this against the
# actual f... | [
"usaspending_api.common.etl.ETLQuery",
"usaspending_api.common.etl.operations.update_changed_rows",
"usaspending_api.common.etl.operations.insert_missing_rows",
"usaspending_api.common.etl.ETLTable",
"django.db.connection.cursor",
"usaspending_api.common.etl.operations.delete_obsolete_rows"
] | [((1260, 1313), 'usaspending_api.common.etl.ETLQuery', 'ETLQuery', (['FEDERAL_ACCOUNTS_FROM_TREASURY_ACCOUNTS_SQL'], {}), '(FEDERAL_ACCOUNTS_FROM_TREASURY_ACCOUNTS_SQL)\n', (1268, 1313), False, 'from usaspending_api.common.etl import ETLQuery, ETLTable\n'), ((1350, 1439), 'usaspending_api.common.etl.ETLTable', 'ETLTabl... |
"""Core functionality for foamPy."""
from __future__ import division, print_function
import numpy as np
import os
import re
import datetime
import sys
import time
import subprocess
import pandas
import glob
from .dictionaries import *
from .templates import *
def gen_stripped_lines(fpath):
with open(fpath) as f:... | [
"time.sleep",
"numpy.array",
"numpy.sin",
"datetime.timedelta",
"os.listdir",
"numpy.asarray",
"numpy.linspace",
"subprocess.call",
"pandas.DataFrame",
"glob.glob",
"numpy.trapz",
"os.path.isfile",
"numpy.interp",
"re.findall",
"pandas.Series",
"os.path.join",
"os.getcwd",
"os.chdi... | [((776, 794), 'pandas.DataFrame', 'pandas.DataFrame', ([], {}), '()\n', (792, 794), False, 'import pandas\n'), ((2130, 2165), 're.findall', 're.findall', (['"""# Probe \\\\d.*\\\\n"""', 'txt'], {}), "('# Probe \\\\d.*\\\\n', txt)\n", (2140, 2165), False, 'import re\n'), ((2341, 2359), 'pandas.DataFrame', 'pandas.DataFr... |
#!/usr/bin/env python3
from __future__ import print_function
import os
import subprocess
import sys
SOURCE_ROOT = os.path.dirname(os.path.dirname(__file__))
cmd = "npm"
if sys.platform == "win32":
cmd += ".cmd"
args = [cmd, "run",
"--prefix",
SOURCE_ROOT
] + sys.argv[1:]
try:
subprocess.check_outpu... | [
"subprocess.check_output",
"os.path.dirname",
"sys.exit"
] | [((131, 156), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (146, 156), False, 'import os\n'), ((298, 353), 'subprocess.check_output', 'subprocess.check_output', (['args'], {'stderr': 'subprocess.STDOUT'}), '(args, stderr=subprocess.STDOUT)\n', (321, 353), False, 'import subprocess\n'), ((54... |
import torch
import torch.nn as nn
import torch.nn.functional as F
class ConvBNReLU(nn.Module):
def __init__(self, in_chan, out_chan, ks=3, stride=1, padding=1,
dilation=1, groups=1, bias=False):
super(ConvBNReLU, self).__init__()
self.conv = nn.Conv2d(
in_ch... | [
"torch.nn.ReLU",
"torch.nn.Dropout",
"torch.nn.Sequential",
"torch.nn.init.xavier_normal_",
"torch.nn.AvgPool2d",
"torch.nn.BatchNorm2d",
"torch.nn.ModuleList",
"torch.mean",
"torch.nn.functional.relu6",
"torch.matmul",
"torch.nn.AdaptiveAvgPool2d",
"torch.randn",
"torch.nn.PixelShuffle",
... | [((291, 416), 'torch.nn.Conv2d', 'nn.Conv2d', (['in_chan', 'out_chan'], {'kernel_size': 'ks', 'stride': 'stride', 'padding': 'padding', 'dilation': 'dilation', 'groups': 'groups', 'bias': 'bias'}), '(in_chan, out_chan, kernel_size=ks, stride=stride, padding=padding,\n dilation=dilation, groups=groups, bias=bias)\n',... |
import torch
import torch_geometric #torch_geometric == 2.5
import community
import numpy as np
import networkx
import argparse
from torch_geometric.datasets import TUDataset
from torch_geometric.data import DataLoader
from torch_geometric.data import Batch
from Sign_OPT import *
import torch_geometric.transforms as T
... | [
"numpy.abs",
"torch_geometric.datasets.TUDataset",
"argparse.ArgumentParser",
"torch.load",
"torch.tensor",
"torch.cuda.is_available",
"torch.save",
"Gin.GIN",
"torch_geometric.transforms.Constant",
"time.time",
"torch.device"
] | [((393, 495), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Pytorch graph isomorphism network for graph classification"""'}), "(description=\n 'Pytorch graph isomorphism network for graph classification')\n", (416, 495), False, 'import argparse\n'), ((6121, 6191), 'torch.save', 'torc... |
import os
import subprocess
from builtins import object
from collections import defaultdict
from bs4 import BeautifulSoup
from IPython.display import display
from wand.color import Color
from wand.drawing import Drawing
from wand.image import Image
class Visualizer(object):
"""
Object to display bounding box... | [
"IPython.display.display",
"wand.drawing.Drawing",
"os.path.join",
"bs4.BeautifulSoup",
"collections.defaultdict",
"wand.color.Color"
] | [((3440, 3482), 'bs4.BeautifulSoup', 'BeautifulSoup', (['html_content', '"""html.parser"""'], {}), "(html_content, 'html.parser')\n", (3453, 3482), False, 'from bs4 import BeautifulSoup\n'), ((888, 904), 'collections.defaultdict', 'defaultdict', (['int'], {}), '(int)\n', (899, 904), False, 'from collections import defa... |
import h5py
import os, sys, glob
import numpy as np
import plotly.offline as offline
from preprocessing import analysis_pp
from analysis.general_utils import aqua_utils, saving_utils, plotly_utils, general_utils, compare_astro_utils, correlation_utils, stat_utils
from scipy.stats.stats import power_divergence
from scip... | [
"analysis.general_utils.compare_astro_utils.get_fake_astrocyte_sample_from_areas",
"analysis.general_utils.saving_utils.save_pickle",
"analysis.general_utils.plotly_utils.apply_fun_axis_fig",
"analysis.general_utils.aqua_utils.get_event_subsets",
"analysis.general_utils.plotly_utils.plot_point_box_revised",... | [((9180, 9222), 'os.path.join', 'os.path.join', (['output_folder', 'experiment_id'], {}), '(output_folder, experiment_id)\n', (9192, 9222), False, 'import os, sys, glob\n'), ((10663, 10730), 'os.path.join', 'os.path.join', (['output_experiment_path', '"""plots"""', '"""behaviour_heatmaps"""'], {}), "(output_experiment_... |
"""invoice_details
Revision ID: <KEY>
Revises: <KEY>
Create Date: 2021-05-05 17:12:28.523093
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = '<KEY>'
branch_labels = None
depends_on = None
def ... | [
"sqlalchemy.Text",
"alembic.op.drop_column"
] | [((629, 666), 'alembic.op.drop_column', 'op.drop_column', (['"""invoices"""', '"""details"""'], {}), "('invoices', 'details')\n", (643, 666), False, 'from alembic import op\n'), ((477, 486), 'sqlalchemy.Text', 'sa.Text', ([], {}), '()\n', (484, 486), True, 'import sqlalchemy as sa\n')] |
# -*- coding: utf-8 -*-
import argparse
import json
import datetime
import re
import mmap
from mpi4py import MPI
TWITTER_FILE = None
GRID_FILE = None
SCORE_FILE = None
class Utils:
coordinates_pattern = re.compile(r'"coordinates":\[(.*?)]')
text_pattern = re.compile(r'"text":"(.*?)","loc')
punctuation_p... | [
"json.load",
"datetime.datetime.now",
"argparse.ArgumentParser",
"re.compile"
] | [((211, 248), 're.compile', 're.compile', (['""""coordinates":\\\\[(.*?)]"""'], {}), '(\'"coordinates":\\\\[(.*?)]\')\n', (221, 248), False, 'import re\n'), ((268, 301), 're.compile', 're.compile', (['""""text":"(.*?)","loc"""'], {}), '(\'"text":"(.*?)","loc\')\n', (278, 301), False, 'import re\n'), ((329, 356), 're.co... |
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import rhinoscriptsyntax as rs
from compas.geometry import distance_point_point
from compas.geometry import closest_point_in_cloud
from compas.geometry import Polyline
from compas_rhino.geometry import RhinoP... | [
"rhinoscriptsyntax.CurveParameter",
"rhinoscriptsyntax.AddPoint",
"compas.geometry.closest_point_in_cloud"
] | [((1418, 1436), 'rhinoscriptsyntax.AddPoint', 'rs.AddPoint', (['point'], {}), '(point)\n', (1429, 1436), True, 'import rhinoscriptsyntax as rs\n'), ((4449, 4483), 'rhinoscriptsyntax.CurveParameter', 'rs.CurveParameter', (['curve.guid', '(0.5)'], {}), '(curve.guid, 0.5)\n', (4466, 4483), True, 'import rhinoscriptsyntax ... |
# Copyright 2014 Google Inc. 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 applicable law or ... | [
"parent_child_models.PhoneNumber",
"parent_child_models.Contact",
"google.appengine.ext.ndb.delete_multi"
] | [((822, 847), 'parent_child_models.Contact', 'models.Contact', ([], {'name': 'NAME'}), '(name=NAME)\n', (836, 847), True, 'import parent_child_models as models\n'), ((2399, 2439), 'google.appengine.ext.ndb.delete_multi', 'ndb.delete_multi', (['[e.key for e in query]'], {}), '([e.key for e in query])\n', (2415, 2439), F... |
#!/usr/bin/env python2
'''
some programs like java are really picky about the EXACT directory
structure being replicated within cde-package. e.g., java will refuse
to start unless the directory structure is perfectly mimicked (since it
uses its true path to load start-up libraries). this means that CDE
Needs to be ... | [
"sys.path.insert"
] | [((823, 847), 'sys.path.insert', 'sys.path.insert', (['(0)', '""".."""'], {}), "(0, '..')\n", (838, 847), False, 'import sys\n')] |
from django.db import models
from django.core.files.storage import FileSystemStorage
from django.conf import settings
image_storage = FileSystemStorage(
# Physical file location ROOT
location=u'{0}'.format(settings.MEDIA_ROOT),
# Url for file
base_url=u'{0}'.format(settings.MEDIA_URL),
)
def image_di... | [
"django.db.models.ImageField",
"django.db.models.TextField",
"django.db.models.CharField"
] | [((508, 552), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)', 'default': '""""""'}), "(max_length=100, default='')\n", (524, 552), False, 'from django.db import models\n'), ((564, 582), 'django.db.models.TextField', 'models.TextField', ([], {}), '()\n', (580, 582), False, 'from django.db ... |
"""Exposed DJGUI REST API."""
import os
from .DJConnector import DJConnector
from . import __version__ as version
from typing import Callable
# Crypto libaries
from cryptography.hazmat.primitives import serialization as crypto_serialization
from cryptography.hazmat.primitives.asymmetric import rsa
from cryptography.ha... | [
"flask.request.args.get",
"flask.request.args.items",
"flask.Flask",
"os.environ.get",
"cryptography.hazmat.primitives.serialization.NoEncryption",
"flask.request.json.keys",
"jwt.encode",
"flask.request.headers.get",
"cryptography.hazmat.backends.default_backend"
] | [((487, 502), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (492, 502), False, 'from flask import Flask, request\n'), ((680, 709), 'os.environ.get', 'os.environ.get', (['"""PRIVATE_KEY"""'], {}), "('PRIVATE_KEY')\n", (694, 709), False, 'import os\n'), ((721, 749), 'os.environ.get', 'os.environ.get', (['""... |
# Copyright (c) 2016 <NAME>, <NAME>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distr... | [
"collections.OrderedDict"
] | [((2014, 2193), 'collections.OrderedDict', 'OrderedDict', (["(('@context', self.context_field), ('structures', self.structures_field), (\n 'sequences', self.sequences_field), ('viewingDirection', self.\n viewing_dir_field))"], {}), "((('@context', self.context_field), ('structures', self.\n structures_field), ... |
# Generated by Django 2.2.16 on 2020-11-04 08:00
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("traffic_control", "0037_migrate_plan_planners"),
]
operations = [
migrations.RemoveField(
model_name="plan",
name="planner_... | [
"django.db.migrations.RemoveField"
] | [((239, 303), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""plan"""', 'name': '"""planner_legacy"""'}), "(model_name='plan', name='planner_legacy')\n", (261, 303), False, 'from django.db import migrations\n')] |
from os.path import dirname, join, exists
from Products.PortalTransforms.interfaces import imimetype
from Products.PortalTransforms.utils import HAS_ZOPE
__revision__ = '$Id$'
class MimeTypeException(Exception): pass
class mimetype:
__implements__ = (imimetype,)
#XXX __slots__
def __init__(self, name=... | [
"os.path.dirname",
"os.path.join"
] | [((1820, 1837), 'os.path.dirname', 'dirname', (['__file__'], {}), '(__file__)\n', (1827, 1837), False, 'from os.path import dirname, join, exists\n'), ((2196, 2222), 'os.path.join', 'join', (['icons_dir', 'icon_path'], {}), '(icons_dir, icon_path)\n', (2200, 2222), False, 'from os.path import dirname, join, exists\n'),... |
#!/usr/bin/env python3
import argparse
import asyncio
import os
import sys
import discord
import numpy as np
import sounddevice as sd
class SoundDeviceSource(discord.AudioSource):
def __init__(self, device):
self.stream = sd.InputStream(samplerate=48000,
channels=1,
... | [
"sounddevice.InputStream",
"numpy.repeat",
"argparse.ArgumentParser",
"os.environ.get",
"sounddevice.query_devices",
"sys.exit",
"asyncio.get_running_loop"
] | [((3713, 3813), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Patch a pair of audio devices to a Discord voice channel"""'}), "(description=\n 'Patch a pair of audio devices to a Discord voice channel')\n", (3736, 3813), False, 'import argparse\n'), ((238, 331), 'sounddevice.InputStr... |
from collections import Mapping, Iterable
import copy as copy_
import numpy as np
import datetime as dt
from . import misc
def select_var(d, name, sel):
var_dims = list(d['.'][name]['.dims'])
d['.'][name]['.dims'] = var_dims
for key, value in sel.items():
if isinstance(value, Mapping):
if len(sel) > 1: raise V... | [
"datetime.datetime.strptime",
"numpy.take",
"numpy.stack",
"numpy.array",
"numpy.empty",
"numpy.concatenate",
"copy.deepcopy",
"numpy.nonzero"
] | [((2638, 2659), 'copy.deepcopy', 'copy_.deepcopy', (['meta0'], {}), '(meta0)\n', (2652, 2659), True, 'import copy as copy_\n'), ((4084, 4106), 'copy.deepcopy', 'copy_.deepcopy', (["d['.']"], {}), "(d['.'])\n", (4098, 4106), True, 'import copy as copy_\n'), ((1785, 1799), 'numpy.array', 'np.array', (['data'], {}), '(dat... |
from django.shortcuts import render,redirect
from django.db import models
from django.contrib.auth.models import User
import datetime as dt
from django.dispatch import receiver
from django.db.models.signals import post_save
from django.core.validators import MinValueValidator, MaxValueValidator
# Create your models he... | [
"django.core.validators.MaxValueValidator",
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.db.models.IntegerField",
"django.db.models.DateTimeField",
"django.db.models.ImageField",
"django.dispatch.receiver",
"django.db.models.CharField"
] | [((365, 408), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(50)', 'blank': '(True)'}), '(max_length=50, blank=True)\n', (381, 408), False, 'from django.db import models\n'), ((420, 459), 'django.db.models.ImageField', 'models.ImageField', ([], {'upload_to': '"""gallery/"""'}), "(upload_to='gal... |
from django.conf.urls import url
from . import views
app_name = "farms"
urlpatterns = [
url(r'^$', views.FarmList.as_view(), name="farm-list"),
url(r'^delete/(?P<pk>[0-9]+)', views.delete_farm,
name="delete-farm"),
url(r'^json/(?P<pk>[0-9]+)', views.json_farm, name="json-farm"),
url(r'^json_al... | [
"django.conf.urls.url"
] | [((154, 222), 'django.conf.urls.url', 'url', (['"""^delete/(?P<pk>[0-9]+)"""', 'views.delete_farm'], {'name': '"""delete-farm"""'}), "('^delete/(?P<pk>[0-9]+)', views.delete_farm, name='delete-farm')\n", (157, 222), False, 'from django.conf.urls import url\n'), ((237, 299), 'django.conf.urls.url', 'url', (['"""^json/(?... |
import os
import pandas as pd
import csv
import pickle
import numpy as np
import torch
import argparse
def write_answer_to_file(answer, args):
if not os.path.exists(args.output): os.mkdir(args.output)
file_path = os.path.join(args.output, "subtask2.csv")
# turn to Int
answer = answer.astype(int)
... | [
"os.path.exists",
"argparse.ArgumentParser",
"os.path.join",
"pickle.load",
"torch.tensor",
"os.mkdir",
"pandas.DataFrame",
"os.system",
"numpy.zeros_like"
] | [((225, 266), 'os.path.join', 'os.path.join', (['args.output', '"""subtask2.csv"""'], {}), "(args.output, 'subtask2.csv')\n", (237, 266), False, 'import os\n'), ((814, 848), 'numpy.zeros_like', 'np.zeros_like', (["answer[0]['answer']"], {}), "(answer[0]['answer'])\n", (827, 848), True, 'import numpy as np\n'), ((1052, ... |
# coding: utf8
import clinica.pipelines.engine as cpe
class T1FreeSurferLongitudinalCorrection(cpe.Pipeline):
"""FreeSurfer Longitudinal correction class
Returns:
A clinica pipeline object containing the T1FreeSurferLongitudinalCorrection pipeline
"""
def check_pipeline_parameters(self):
... | [
"nipype.interfaces.utility.Function",
"clinica.utils.inputs.clinica_file_reader",
"clinica.utils.exceptions.ClinicaException",
"clinica.utils.stream.cprint",
"os.path.join"
] | [((5172, 5210), 'os.path.join', 'os.path.join', (['self.base_dir', 'self.name'], {}), '(self.base_dir, self.name)\n', (5184, 5210), False, 'import os\n'), ((7409, 7459), 'os.path.join', 'os.path.join', (['self.base_dir', 'self.name', '"""ReconAll"""'], {}), "(self.base_dir, self.name, 'ReconAll')\n", (7421, 7459), Fals... |
#!/usr/bin/env python
import logging
from flask import Flask, jsonify, request
from log import startLog, LOGFILE
from models.persist import Persistent, download
from models import resnet
startLog(LOGFILE)
APP_LOG = logging.getLogger('root')
APP_LOG.info('Creating app...')
app = Flask(__name__)
APP_LOG.info('Creati... | [
"logging.getLogger",
"models.persist.download",
"flask.Flask",
"log.startLog",
"models.resnet.predict",
"flask.request.values.get",
"models.persist.Persistent",
"flask.jsonify"
] | [((191, 208), 'log.startLog', 'startLog', (['LOGFILE'], {}), '(LOGFILE)\n', (199, 208), False, 'from log import startLog, LOGFILE\n'), ((219, 244), 'logging.getLogger', 'logging.getLogger', (['"""root"""'], {}), "('root')\n", (236, 244), False, 'import logging\n'), ((284, 299), 'flask.Flask', 'Flask', (['__name__'], {}... |
"""Logic to handle custom_cards."""
import json
import os
from typing import IO, Any
import requests
from requests import RequestException
import yaml
from pyupdate.ha_custom import common
from pyupdate.log import Logger
class Loader(yaml.SafeLoader):
"""YAML Loader with `!include` constructor."""
def __ini... | [
"os.makedirs",
"pyupdate.ha_custom.common.download_file",
"pyupdate.log.Logger",
"os.path.splitext",
"yaml.load",
"yaml.add_constructor",
"os.path.split",
"os.path.isfile",
"requests.get",
"pyupdate.ha_custom.common.get_repo_data",
"json.load",
"pyupdate.ha_custom.common.check_remote_access",
... | [((1134, 1193), 'yaml.add_constructor', 'yaml.add_constructor', (['"""!include"""', 'construct_include', 'Loader'], {}), "('!include', construct_include, Loader)\n", (1154, 1193), False, 'import yaml\n'), ((1430, 1461), 'pyupdate.log.Logger', 'Logger', (['self.__class__.__name__'], {}), '(self.__class__.__name__)\n', (... |
# risk_scores_calculation/urls.py
from django.urls import include, path
from rest_framework import routers
from .views import RequestResultViewSet
router = routers.DefaultRouter()
urlpatterns = [
#path('', include(router.urls)),
# API endpoints
path('calculate-location-risk-score', RequestResultViewSet... | [
"django.urls.path",
"rest_framework.routers.DefaultRouter"
] | [((159, 182), 'rest_framework.routers.DefaultRouter', 'routers.DefaultRouter', ([], {}), '()\n', (180, 182), False, 'from rest_framework import routers\n'), ((262, 375), 'django.urls.path', 'path', (['"""calculate-location-risk-score"""', 'RequestResultViewSet.calculate_location_score'], {'name': '"""lis_calculation"""... |
from pipeline import Informer
from salience_basic_util import SEQ_TASK
# SST-2 (10,000 instances)
d = Informer.confidence_indication_serialized(
num_classes=2,
scores_path="serialized_data/SST-tiny-bert/lime/train_10k.json",
preds_path="serialized_data/SST-tiny-bert/predictions_train_10k.json"... | [
"pipeline.Informer.confidence_indication_serialized"
] | [((104, 340), 'pipeline.Informer.confidence_indication_serialized', 'Informer.confidence_indication_serialized', ([], {'num_classes': '(2)', 'scores_path': '"""serialized_data/SST-tiny-bert/lime/train_10k.json"""', 'preds_path': '"""serialized_data/SST-tiny-bert/predictions_train_10k.json"""', 'instance': '(False)', 'v... |
from nose.tools import istest, assert_equal
from mammoth.lists import unique
@istest
def unique_of_empty_list_is_empty_list():
assert_equal([], unique([]))
@istest
def unique_removes_duplicates_while_preserving_order():
assert_equal(["apple", "banana"], unique(["apple", "banana", "apple"]))
| [
"mammoth.lists.unique"
] | [((151, 161), 'mammoth.lists.unique', 'unique', (['[]'], {}), '([])\n', (157, 161), False, 'from mammoth.lists import unique\n'), ((267, 303), 'mammoth.lists.unique', 'unique', (["['apple', 'banana', 'apple']"], {}), "(['apple', 'banana', 'apple'])\n", (273, 303), False, 'from mammoth.lists import unique\n')] |
import struct
from abc import ABCMeta
from bxcommon import constants
from bxcommon.constants import MSG_NULL_BYTE
from bxcommon.messages.bloxroute.abstract_bloxroute_message import AbstractBloxrouteMessage
class AbstractBlockchainSyncMessage(AbstractBloxrouteMessage):
"""
Message type for requesting/receivin... | [
"struct.pack_into",
"struct.unpack_from"
] | [((679, 722), 'struct.pack_into', 'struct.pack_into', (['"""<12s"""', 'buf', 'off', 'command'], {}), "('<12s', buf, off, command)\n", (695, 722), False, 'import struct\n'), ((1285, 1326), 'struct.unpack_from', 'struct.unpack_from', (['"""<12s"""', 'self.buf', 'off'], {}), "('<12s', self.buf, off)\n", (1303, 1326), Fals... |
# -*- coding: utf-8 -*-
"""
Created on Thu May 20 15:49:11 2021
@author: ANalundasan
DTC - Categorical Naive Bayes
"""
from sklearn.naive_bayes import GaussianNB
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.naive_bayes import CategoricalNB
from ... | [
"numpy.abs",
"pandas.read_csv",
"sklearn.naive_bayes.CategoricalNB",
"sklearn.model_selection.train_test_split",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.title",
"sklearn.metrics.accuracy_score",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.show"
] | [((448, 510), 'pandas.read_csv', 'pd.read_csv', (['"""raw_data_numerical_target_features.csv"""'], {'sep': '""","""'}), "('raw_data_numerical_target_features.csv', sep=',')\n", (459, 510), True, 'import pandas as pd\n'), ((656, 693), 'sklearn.model_selection.train_test_split', 'train_test_split', (['X', 'Y'], {'test_si... |
"""
Color palette choices
=====================
"""
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
sns.set(style="white", context="talk")
rs = np.random.RandomState(7)
x = np.array(list("ABCDEFGHI"))
f, (ax1, ax2, ax3) = plt.subplots(3, 1, figsize=(8, 6), sharex=True)
y1 = np.arange(1, 10)... | [
"matplotlib.pyplot.setp",
"seaborn.set",
"seaborn.despine",
"numpy.arange",
"matplotlib.pyplot.tight_layout",
"seaborn.barplot",
"matplotlib.pyplot.subplots",
"numpy.random.RandomState"
] | [((126, 164), 'seaborn.set', 'sns.set', ([], {'style': '"""white"""', 'context': '"""talk"""'}), "(style='white', context='talk')\n", (133, 164), True, 'import seaborn as sns\n'), ((170, 194), 'numpy.random.RandomState', 'np.random.RandomState', (['(7)'], {}), '(7)\n', (191, 194), True, 'import numpy as np\n'), ((250, ... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2017-12-11 15:47
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('rider', '0001_initial'),
('drivers', '0003_driver_p... | [
"django.db.models.AutoField",
"django.db.models.ForeignKey"
] | [((471, 564), '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", (487, 564), False, 'from django.db import migrations, models\... |
import socket
TCP_IP = '127.0.0.1'
TCP_PORT = 5005
BUFFER_SIZE = 20 # Normally 1024, but we want fast response
s = None
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
def begin():
s.bind((TCP_IP, TCP_PORT))
s.listen(1)
conn, addr = s.accept()
print('Connection address:', addr)
while 1:
... | [
"socket.socket"
] | [((126, 175), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_STREAM'], {}), '(socket.AF_INET, socket.SOCK_STREAM)\n', (139, 175), False, 'import socket\n')] |
# -*- coding: utf-8 -*-
"""Module for the Annoy Nearest Neighbor Search algorithm"""
import logging
import numpy as np
from typing import AnyStr, Dict, List, Tuple
import annoy
from tqdm import tqdm
from nearest_neighbor.base import NearestNeighborSearch
from utils import time_logging
class Annoy(NearestNeighborS... | [
"tqdm.tqdm",
"utils.time_logging",
"logging.info",
"annoy.AnnoyIndex"
] | [((1014, 1075), 'utils.time_logging', 'time_logging', ([], {'log_message': '"""Building index and saving to disk"""'}), "(log_message='Building index and saving to disk')\n", (1026, 1075), False, 'from utils import time_logging\n'), ((1432, 1486), 'utils.time_logging', 'time_logging', ([], {'log_message': '"""Loading p... |
#!/usr/bin/env python
# Copyright 2016 Attic Labs, Inc. All rights reserved.
# Licensed under the Apache License, version 2.0:
# http://www.apache.org/licenses/LICENSE-2.0
# This tool updates the npm version of @attic/noms, @attic/eslintrc, etc in all package.json files.
#
# Run this whenever the version of an npm pa... | [
"subprocess.check_output",
"os.path.exists",
"os.path.split",
"sys.exit",
"json.load",
"json.dump"
] | [((1235, 1251), 'os.path.split', 'os.path.split', (['f'], {}), '(f)\n', (1248, 1251), False, 'import os\n'), ((1613, 1668), 'json.load', 'json.load', (['f'], {'object_pairs_hook': 'collections.OrderedDict'}), '(f, object_pairs_hook=collections.OrderedDict)\n', (1622, 1668), False, 'import json\n'), ((2184, 2240), 'json... |
import numpy as np
import io
from PIL import Image
import tensorflow as tf
from tensorflow.keras.models import load_model
from tensorflow.keras.preprocessing.image import img_to_array
import matplotlib.pyplot as plt
from flask import Flask,render_template,redirect,url_for,request
import urllib3
from tensorflow.keras.p... | [
"tensorflow.keras.preprocessing.image.load_img",
"matplotlib.pyplot.imshow",
"flask.Flask",
"os.path.join",
"os.getcwd",
"tensorflow.keras.models.load_model",
"numpy.expand_dims",
"matplotlib.pyplot.axis",
"tensorflow.keras.preprocessing.image.img_to_array",
"matplotlib.pyplot.show"
] | [((364, 379), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (369, 379), False, 'from flask import Flask, render_template, redirect, url_for, request\n'), ((389, 412), 'tensorflow.keras.models.load_model', 'load_model', (['"""shape2.h5"""'], {}), "('shape2.h5')\n", (399, 412), False, 'from tensorflow.keras... |
'''
This file is part of PM4Py (More Info: https://pm4py.fit.fraunhofer.de).
PM4Py is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any late... | [
"statistics.mean",
"pm4py.util.exec_utils.get_param_value"
] | [((2185, 2240), 'pm4py.util.exec_utils.get_param_value', 'exec_utils.get_param_value', (['Parameters.K', 'parameters', '(2)'], {}), '(Parameters.K, parameters, 2)\n', (2211, 2240), False, 'from pm4py.util import exec_utils\n'), ((2571, 2592), 'statistics.mean', 'mean', (['all_arc_degrees'], {}), '(all_arc_degrees)\n', ... |
from collections import defaultdict
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import random
from sklearn.decomposition import PCA
from sklearn.manifold import TSNE
import scipy
import scipy.spatial.distance
from scipy.stats import spearmanr
import torch
import utils
__author__... | [
"numpy.log",
"numpy.array",
"scipy.spatial.distance.cosine",
"sklearn.decomposition.PCA",
"torch.mean",
"sklearn.manifold.TSNE",
"numpy.dot",
"pandas.DataFrame",
"scipy.stats.spearmanr",
"numpy.isinf",
"numpy.maximum",
"matplotlib.pyplot.savefig",
"numpy.outer",
"numpy.linalg.svd",
"matp... | [((417, 455), 'scipy.spatial.distance.euclidean', 'scipy.spatial.distance.euclidean', (['u', 'v'], {}), '(u, v)\n', (449, 455), False, 'import scipy\n'), ((606, 641), 'scipy.spatial.distance.cosine', 'scipy.spatial.distance.cosine', (['u', 'v'], {}), '(u, v)\n', (635, 641), False, 'import scipy\n'), ((2434, 2458), 'num... |
import os, sys
from os import system
import tensorflow as tf
import numpy as np
np.set_printoptions(threshold=sys.maxsize)
##############################################################################
##############################################################################
## System Paths ##
path ... | [
"tensorflow.get_variable",
"sys.exit",
"os.listdir",
"tensorflow.placeholder",
"tensorflow.Session",
"tensorflow.concat",
"tensorflow.layers.dropout",
"tensorflow.matmul",
"tensorflow.square",
"tensorflow.ConfigProto",
"tensorflow.train.AdamOptimizer",
"tensorflow.nn.conv2d",
"tensorflow.var... | [((81, 123), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'threshold': 'sys.maxsize'}), '(threshold=sys.maxsize)\n', (100, 123), True, 'import numpy as np\n'), ((6996, 7012), 'tensorflow.ConfigProto', 'tf.ConfigProto', ([], {}), '()\n', (7010, 7012), True, 'import tensorflow as tf\n'), ((4940, 4983), 'numpy.z... |
from django.conf.urls import url, include
from rest_framework import routers
from backend.api import views
router = routers.DefaultRouter()
router.register(r'users', views.UserViewSet)
router.register(r'groups', views.GroupViewSet)
urlpatterns = [
url(r'^', include(router.urls)),
url(r'^api-auth/', include('r... | [
"django.conf.urls.include",
"rest_framework.routers.DefaultRouter"
] | [((117, 140), 'rest_framework.routers.DefaultRouter', 'routers.DefaultRouter', ([], {}), '()\n', (138, 140), False, 'from rest_framework import routers\n'), ((264, 284), 'django.conf.urls.include', 'include', (['router.urls'], {}), '(router.urls)\n', (271, 284), False, 'from django.conf.urls import url, include\n'), ((... |
# Copyright (c) 2021 PaddlePaddle 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 app... | [
"future.utils.with_metaclass"
] | [((832, 863), 'future.utils.with_metaclass', 'with_metaclass', (['ABCMeta', 'object'], {}), '(ABCMeta, object)\n', (846, 863), False, 'from future.utils import with_metaclass\n')] |
from classes.core.Model import Model
from classes.modules.Encoder import Encoder
class ModelEncoder(Model):
def __init__(self):
super().__init__()
self._network = Encoder()
def optimize(self, x):
pass
| [
"classes.modules.Encoder.Encoder"
] | [((186, 195), 'classes.modules.Encoder.Encoder', 'Encoder', ([], {}), '()\n', (193, 195), False, 'from classes.modules.Encoder import Encoder\n')] |