code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
#
# Copyright (c) 2018, 2022 Oracle and/or its affiliates. All rights reserved.
#
# Licensed under the Universal Permissive License v 1.0 as shown at
# https://oss.oracle.com/licenses/upl/
#
from logging import DEBUG
from multiprocessing import pool
from platform import python_version
from requests import Session
fro... | [
"requests.Session",
"threading.Lock",
"multiprocessing.pool.ThreadPool",
"time.time",
"platform.python_version"
] | [((2401, 2410), 'requests.Session', 'Session', ([], {}), '()\n', (2408, 2410), False, 'from requests import Session\n'), ((3824, 3830), 'threading.Lock', 'Lock', ([], {}), '()\n', (3828, 3830), False, 'from threading import Lock\n'), ((3567, 3585), 'multiprocessing.pool.ThreadPool', 'pool.ThreadPool', (['(1)'], {}), '(... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
from tensorflow.python.framework import random_seed
from tensorflow.python.ops.ragged import ragged_tensor
from tfmiss.ops import tfmiss_ops
def cbow_context(source, window, empty, nam... | [
"tensorflow.python.ops.ragged.ragged_tensor.convert_to_tensor_or_ragged_tensor",
"tensorflow.python.ops.ragged.ragged_tensor.RaggedTensor.from_tensor",
"tensorflow.python.ops.ragged.ragged_tensor.is_ragged",
"tensorflow.RaggedTensor.from_row_splits",
"tfmiss.ops.tfmiss_ops.miss_spaces_after",
"tensorflow.... | [((820, 857), 'tensorflow.name_scope', 'tf.name_scope', (["(name or 'cbow_context')"], {}), "(name or 'cbow_context')\n", (833, 857), True, 'import tensorflow as tf\n'), ((876, 947), 'tensorflow.python.ops.ragged.ragged_tensor.convert_to_tensor_or_ragged_tensor', 'ragged_tensor.convert_to_tensor_or_ragged_tensor', (['s... |
import sys
from typing import NoReturn, Optional, Type
from traceback_with_variables.print import print_exc, Format
def global_print_exc(fmt: Optional[Format] = None) -> NoReturn:
sys.excepthook = lambda e_cls, e, tb: print_exc(e=e, fmt=fmt)
def global_print_exc_in_ipython(fmt: Optional[Format] = Non... | [
"traceback_with_variables.print.print_exc"
] | [((232, 255), 'traceback_with_variables.print.print_exc', 'print_exc', ([], {'e': 'e', 'fmt': 'fmt'}), '(e=e, fmt=fmt)\n', (241, 255), False, 'from traceback_with_variables.print import print_exc, Format\n'), ((561, 601), 'traceback_with_variables.print.print_exc', 'print_exc', ([], {'num_skipped_frames': '(1)', 'fmt':... |
"""This is the main module"""
import random
import webhandler
import sentimentanalyser
def main():
"""Run client"""
if not webhandler.API_KEY:
raise ValueError("Set your API_KEY in webhandler.py! Find it on https://devrecruitmentchallenge.com/account")
analyser = sentimentanalyser.SentimentAnalyse... | [
"webhandler.get_challenge",
"webhandler.get_challenge_list",
"webhandler.post_pertweet_submission",
"webhandler.post_aggregated_submission",
"sentimentanalyser.SentimentAnalyser"
] | [((286, 323), 'sentimentanalyser.SentimentAnalyser', 'sentimentanalyser.SentimentAnalyser', ([], {}), '()\n', (321, 323), False, 'import sentimentanalyser\n'), ((382, 413), 'webhandler.get_challenge_list', 'webhandler.get_challenge_list', ([], {}), '()\n', (411, 413), False, 'import webhandler\n'), ((1414, 1461), 'webh... |
from django import forms
class CreateListForm(forms.Form):
name = forms.CharField(label="Name ", max_length=300)
| [
"django.forms.CharField"
] | [((71, 117), 'django.forms.CharField', 'forms.CharField', ([], {'label': '"""Name """', 'max_length': '(300)'}), "(label='Name ', max_length=300)\n", (86, 117), False, 'from django import forms\n')] |
from services.rabbitmq_wrapper import RabbitMqWrapper
import yaml
def test_given_validRabbitConfigurations_when_openChannelCalled_then_expectSuccessfulConnection(configs):
wrapper = RabbitMqWrapper(configs["queue"])
channel = wrapper.open_channel()
opened = channel.is_open
wrapper.close_connection()
... | [
"services.rabbitmq_wrapper.RabbitMqWrapper"
] | [((187, 220), 'services.rabbitmq_wrapper.RabbitMqWrapper', 'RabbitMqWrapper', (["configs['queue']"], {}), "(configs['queue'])\n", (202, 220), False, 'from services.rabbitmq_wrapper import RabbitMqWrapper\n')] |
#!/usr/bin/env python
import os
import shutil
import sys
from setuptools import setup, find_packages
VERSION = '0.0.1'
long_description = """
Fast CPU/CUDA Solid Harmonic 3D Scattering implementation
Numpy + PyTorch + FFTW / cuFFT implementation
"""
setup_info = dict(
# Metadata
name='scatharm',
version... | [
"setuptools.find_packages",
"setuptools.setup"
] | [((739, 758), 'setuptools.setup', 'setup', ([], {}), '(**setup_info)\n', (744, 758), False, 'from setuptools import setup, find_packages\n'), ((621, 653), 'setuptools.find_packages', 'find_packages', ([], {'exclude': "('test',)"}), "(exclude=('test',))\n", (634, 653), False, 'from setuptools import setup, find_packages... |
import argparse
from aquosRemote.aquos import AquosTV
def main():
parser = argparse.ArgumentParser()
parser.add_argument("-i", "--ip-address", type=str,
help="IP address of AQUOS TV", required=True)
args = parser.parse_args()
# Example/Test
aquos = AquosTV(args.ip_address,... | [
"aquosRemote.aquos.AquosTV",
"argparse.ArgumentParser"
] | [((81, 106), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (104, 106), False, 'import argparse\n'), ((296, 346), 'aquosRemote.aquos.AquosTV', 'AquosTV', (['args.ip_address'], {'setup': '(True)', 'verbose': '(True)'}), '(args.ip_address, setup=True, verbose=True)\n', (303, 346), False, 'from aq... |
# For importing keys
import sys
sys.path.append("../")
sys.path.append("DONOTPUSH/")
import api_keys
# My modules
import database as db
# Libraries
import json
from time import sleep
# from github import Github
from alpha_vantage.timeseries import TimeSeries
import logging
# Constants
REPO_NAME = "My-All-Weather-Str... | [
"logging.basicConfig",
"database.write_balance",
"database.get_price_prev",
"database.get_balance_prev",
"time.sleep",
"database.write_asset_price",
"alpha_vantage.timeseries.TimeSeries",
"sys.path.append",
"logging.error"
] | [((32, 54), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (47, 54), False, 'import sys\n'), ((55, 84), 'sys.path.append', 'sys.path.append', (['"""DONOTPUSH/"""'], {}), "('DONOTPUSH/')\n", (70, 84), False, 'import sys\n'), ((1646, 1706), 'database.write_balance', 'db.write_balance', (['strateg... |
from apartment import Apartment, Apartments, Price, Area, Year, Vastike, Floor, Rooms, Zone, K, Parameter
import pytest
import unittest
class TestParameter(unittest.TestCase):
def test_K(self):
self.assertEqual(K, 1000)
def test_Parameter_Constructor_DefaultValues(self):
p = Parameter(150*K)
... | [
"apartment.Parameter",
"pytest.raises",
"apartment.Price"
] | [((302, 320), 'apartment.Parameter', 'Parameter', (['(150 * K)'], {}), '(150 * K)\n', (311, 320), False, 'from apartment import Apartment, Apartments, Price, Area, Year, Vastike, Floor, Rooms, Zone, K, Parameter\n'), ((904, 971), 'apartment.Parameter', 'Parameter', (['(120 * K)', '(False)', '"""euro"""', '"""price"""',... |
from trezor.crypto.hashlib import sha256
from apps.common import HARDENED
def get_address_from_public_key(pubkey):
pubkeyhash = sha256(pubkey).digest()
address = int.from_bytes(pubkeyhash[:8], "little")
return str(address) + "L"
def get_votes_count(votes):
plus, minus = 0, 0
for vote in votes:
... | [
"trezor.crypto.hashlib.sha256"
] | [((135, 149), 'trezor.crypto.hashlib.sha256', 'sha256', (['pubkey'], {}), '(pubkey)\n', (141, 149), False, 'from trezor.crypto.hashlib import sha256\n')] |
from torch import nn
import torch.nn.functional as F
from model.basic import DownSampling, SSnbt, APN
class LEDNet(nn.Module):
def __init__(self, nclass, drop=0.1):
super(LEDNet, self).__init__()
self.encoder = nn.Sequential(
DownSampling(3, 29), SSnbt(32, 1, 0.1 * drop), SSnbt(32, 1, ... | [
"model.basic.SSnbt",
"model.basic.APN",
"model.basic.DownSampling",
"torch.nn.functional.interpolate",
"torch.randn"
] | [((979, 1006), 'torch.randn', 'torch.randn', (['(2)', '(3)', '(554)', '(253)'], {}), '(2, 3, 554, 253)\n', (990, 1006), False, 'import torch\n'), ((692, 708), 'model.basic.APN', 'APN', (['(128)', 'nclass'], {}), '(128, nclass)\n', (695, 708), False, 'from model.basic import DownSampling, SSnbt, APN\n'), ((836, 902), 't... |
#!/usr/bin/env python
# Copyright (c) 2016 The UUV Simulator 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... | [
"rosunit.unitrun",
"uuv_manipulator_interfaces.ArmInterface",
"roslib.load_manifest"
] | [((728, 753), 'roslib.load_manifest', 'roslib.load_manifest', (['PKG'], {}), '(PKG)\n', (748, 753), False, 'import roslib\n'), ((3098, 3158), 'rosunit.unitrun', 'rosunit.unitrun', (['PKG', '"""test_arm_interface"""', 'TestArmInterface'], {}), "(PKG, 'test_arm_interface', TestArmInterface)\n", (3113, 3158), False, 'impo... |
"""
Feature Selection
Test 3
Random Forest, heatmap
"""
import matplotlib.pyplot as plt
from mlxtend.plotting import scatterplotmatrix
from sklearn.ensemble import RandomForestClassifier
from sklearn.feature_selection import SelectFromModel
from sklearn.model_selection import train_test_split
from mlxtend.plotting im... | [
"numpy.mean",
"matplotlib.pyplot.savefig",
"pandas.read_csv",
"sklearn.feature_selection.SelectFromModel",
"numpy.corrcoef",
"sklearn.ensemble.RandomForestClassifier",
"sklearn.preprocessing.StandardScaler",
"numpy.argsort",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.title",
"matplotli... | [((442, 475), 'pandas.read_csv', 'pd.read_csv', (['"""NewBioDegWCols.csv"""'], {}), "('NewBioDegWCols.csv')\n", (453, 475), True, 'import pandas as pd\n'), ((1183, 1199), 'sklearn.preprocessing.StandardScaler', 'StandardScaler', ([], {}), '()\n', (1197, 1199), False, 'from sklearn.preprocessing import StandardScaler\n'... |
"""
autograd package provides automatic differentiation for all operations on Tensors.
"""
import torch
from torch.autograd import Variable
"""
autograd.Variable wraps around Tensor and
supports (almost) all ops defined on it.
One can directly call .backward() and have
all gradients calculated automatically.
"""
x ... | [
"torch.FloatTensor",
"torch.autograd.Variable",
"torch.randn",
"torch.ones"
] | [((816, 830), 'torch.randn', 'torch.randn', (['(3)'], {}), '(3)\n', (827, 830), False, 'import torch\n'), ((835, 866), 'torch.autograd.Variable', 'Variable', (['x'], {'requires_grad': '(True)'}), '(x, requires_grad=True)\n', (843, 866), False, 'from torch.autograd import Variable\n'), ((943, 980), 'torch.FloatTensor', ... |
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.style as style
import numpy as np
import os
style.use('ggplot')
grid_list = ['grid.168010.e', 'grid.1032.0', 'grid.7177.6', 'grid.194645.b', 'grid.6571.5']
dirname = os.getcwd()
dirname = dirname + '/Data/'
df_ARWU2018 = pd.read_csv(dirname + 'AR... | [
"pandas.read_csv",
"numpy.absolute",
"os.getcwd",
"matplotlib.style.use",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show"
] | [((115, 134), 'matplotlib.style.use', 'style.use', (['"""ggplot"""'], {}), "('ggplot')\n", (124, 134), True, 'import matplotlib.style as style\n'), ((239, 250), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (248, 250), False, 'import os\n'), ((295, 350), 'pandas.read_csv', 'pd.read_csv', (["(dirname + 'ARWU/ARWURanking_2... |
from fest import utils
class SomeClass:
pass
def test_future():
fut = utils.Future(iter('abcdefg'))
ret = fut.filter(lambda x: x < 'e').execute()
exp = list('abcd')
assert ret == exp
def test_digest():
ret = {'fizz': 'buzz'}
assert utils.digest(ret) == 'f45195aef08daea1be5dbb1c7feb5763... | [
"fest.utils.digest",
"fest.utils.logger"
] | [((383, 400), 'fest.utils.logger', 'utils.logger', (['obj'], {}), '(obj)\n', (395, 400), False, 'from fest import utils\n'), ((266, 283), 'fest.utils.digest', 'utils.digest', (['ret'], {}), '(ret)\n', (278, 283), False, 'from fest import utils\n')] |
import asyncio
import fasmga
import os
client = fasmga.Client(os.getenv("FGA_TOKEN"))
@client.on("ready")
async def main():
url = await client.shorten("http://example.com", "your-url-id")
# change "your-url-id" with the url ID you want,
# or remove it if you want it to generate a random one.
print("Y... | [
"os.getenv",
"asyncio.sleep"
] | [((63, 85), 'os.getenv', 'os.getenv', (['"""FGA_TOKEN"""'], {}), "('FGA_TOKEN')\n", (72, 85), False, 'import os\n'), ((401, 418), 'asyncio.sleep', 'asyncio.sleep', (['(10)'], {}), '(10)\n', (414, 418), False, 'import asyncio\n')] |
#!/usr/bin/env python3
# -*- coding: utf-8-*-
"""\
Get CMIP6 Citation info and save as a JSON file.
---
This script gets Citation info from the citation service.
You have to specify MIP(`activity_id`), model(`source_id`),
institution(`institution_id`), and experiment(`experiment_id`) to get
info.
"""
from utils impo... | [
"json.dump",
"utils.getJSON",
"argparse.ArgumentParser"
] | [((770, 885), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'formatter_class': 'argparse.RawDescriptionHelpFormatter', 'description': 'desc', 'epilog': 'epilog'}), '(formatter_class=argparse.\n RawDescriptionHelpFormatter, description=desc, epilog=epilog)\n', (793, 885), False, 'import argparse\n'), ((... |
import time
from umqtt.robust import MQTTClient
def sub_cb(topic, msg):
print((topic, msg))
c = MQTTClient("umqtt_client", "localhost")
# Print diagnostic messages when retries/reconnects happens
c.DEBUG = True
c.set_callback(sub_cb)
# Connect to server, requesting not to clean session for this
# client. If the... | [
"umqtt.robust.MQTTClient"
] | [((104, 143), 'umqtt.robust.MQTTClient', 'MQTTClient', (['"""umqtt_client"""', '"""localhost"""'], {}), "('umqtt_client', 'localhost')\n", (114, 143), False, 'from umqtt.robust import MQTTClient\n')] |
from shutil import which
from typing import Optional
from wlanpi_core.models.validation_error import ValidationError
from .helpers import get_phy80211_interfaces, run_cli_async
async def executable_exists(name: str) -> bool:
"""
Check whether `name` is on PATH and marked as executable.
"""
return wh... | [
"shutil.which",
"wlanpi_core.models.validation_error.ValidationError"
] | [((318, 329), 'shutil.which', 'which', (['name'], {}), '(name)\n', (323, 329), False, 'from shutil import which\n'), ((3402, 3490), 'wlanpi_core.models.validation_error.ValidationError', 'ValidationError', ([], {'status_code': '(400)', 'error_msg': 'f"""wlan interface {interface} not found"""'}), "(status_code=400, err... |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT license.
import multiprocessing
from multiprocessing import cpu_count
import math
class ProcessorsScheduler(object):
process_num = cpu_count()
def __init__(self, cpu_num_workers=None):
if cpu_num_workers != None and ... | [
"math.ceil",
"multiprocessing.Pool",
"multiprocessing.cpu_count"
] | [((222, 233), 'multiprocessing.cpu_count', 'cpu_count', ([], {}), '()\n', (231, 233), False, 'from multiprocessing import cpu_count\n'), ((616, 654), 'multiprocessing.Pool', 'multiprocessing.Pool', (['self.process_num'], {}), '(self.process_num)\n', (636, 654), False, 'import multiprocessing\n'), ((702, 743), 'math.cei... |
#!/bin/python3
# encoding: utf-8
import sys
import numpy as np
from time import time
'''
x
[0, 2] => idx start 0, end 3
[3, 5] => idx start 3, end 6
[6, 8] => idx start 6, end 9
((0 + (r_idx // 3 * 3)): (3 + (r_idx // 3 * 3)), (0 + (c_idx // 3 * 3)): (3 + (c_idx // 3 * 3)))
np.random.randint(1, 10)
'''
sys.setrecu... | [
"sys.setrecursionlimit",
"numpy.array",
"time.time"
] | [((309, 339), 'sys.setrecursionlimit', 'sys.setrecursionlimit', (['(10 ** 7)'], {}), '(10 ** 7)\n', (330, 339), False, 'import sys\n'), ((2394, 2678), 'numpy.array', 'np.array', (['[[5, 3, 0, 0, 7, 0, 0, 0, 0], [6, 0, 0, 1, 9, 5, 0, 0, 0], [0, 9, 8, 0, 0, \n 0, 0, 6, 0], [8, 0, 0, 0, 6, 0, 0, 0, 3], [4, 0, 0, 8, 0, ... |
# Copyright 2019 <NAME>
#
# 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, softw... | [
"launch.substitutions.LaunchConfiguration",
"os.path.join",
"launch_ros.substitutions.FindPackageShare",
"launch.LaunchDescription",
"launch.actions.DeclareLaunchArgument"
] | [((1189, 1239), 'os.path.join', 'os.path.join', (['bringup_dir', '"""urdf"""', '"""pendulum.urdf"""'], {}), "(bringup_dir, 'urdf', 'pendulum.urdf')\n", (1201, 1239), False, 'import os\n'), ((1416, 1474), 'os.path.join', 'os.path.join', (['bringup_dir', '"""params"""', '"""pendulum.param.yaml"""'], {}), "(bringup_dir, '... |
# Generated by Django 2.1.15 on 2020-01-22 22:22
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('committees', '0008_auto_20200114_1807'),
]
operations = [
migrations.AlterField(
... | [
"django.db.models.ForeignKey"
] | [((391, 508), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'on_delete': 'django.db.models.deletion.CASCADE', 'related_name': '"""topics"""', 'to': '"""committees.Committee"""'}), "(on_delete=django.db.models.deletion.CASCADE, related_name\n ='topics', to='committees.Committee')\n", (408, 508), False, 'f... |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distribu... | [
"unittest.main",
"fermilib.transforms.jordan_wigner",
"fermilib.utils.MolecularData"
] | [((2101, 2116), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2114, 2116), False, 'import unittest\n'), ((1060, 1123), 'fermilib.utils.MolecularData', 'MolecularData', (['geometry', 'basis', 'multiplicity'], {'filename': 'filename'}), '(geometry, basis, multiplicity, filename=filename)\n', (1073, 1123), False, '... |
import sys
import asyncio
import zmq
import zmq.asyncio
from zmq.auth import Authenticator
from zmq.auth.thread import _inherit_docstrings, ThreadAuthenticator, \
AuthenticationThread
# Copying code from zqm classes since no way to inject these dependencies
class MultiZapAuthenticator(Authenticator):
"""
... | [
"asyncio.get_event_loop",
"zmq.asyncio.Poller",
"zmq.auth.thread.AuthenticationThread"
] | [((1674, 1800), 'zmq.auth.thread.AuthenticationThread', 'AuthenticationThread', (['self.context', 'self.pipe_endpoint'], {'encoding': 'self.encoding', 'log': 'self.log', 'authenticator': 'authenticator'}), '(self.context, self.pipe_endpoint, encoding=self.\n encoding, log=self.log, authenticator=authenticator)\n', (... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
**Project Name:** MakeHuman
**Product Home Page:** http://www.makehumancommunity.org/
**Github Code Home Page:** https://github.com/makehumancommunity/
**Authors:** <NAME>, <NAME>
**Copyright(c):** MakeHuman Team 2001-2019
**Licensing:** ... | [
"getpath.thoroughFindFile",
"transformations.affine_matrix_from_points",
"material.Material",
"io.open",
"numpy.array",
"makehuman.getAssetLicense",
"getpath.formatPath",
"animation.VertexBoneWeights.fromFile",
"os.remove",
"log.notice",
"numpy.asarray",
"time.perf_counter",
"os.path.split",... | [((1684, 1705), 'numpy.identity', 'np.identity', (['(3)', 'float'], {}), '(3, float)\n', (1695, 1705), True, 'import numpy as np\n'), ((20405, 20424), 'io.open', 'io.open', (['path', '"""wb"""'], {}), "(path, 'wb')\n", (20412, 20424), False, 'import io\n'), ((20649, 20670), 'os.path.dirname', 'os.path.dirname', (['path... |
import numpy as np
import unittest
import pytest
from pysph.base.particle_array import ParticleArray
import pysph.tools.mesh_tools as G
from pysph.base.utils import get_particle_array
# Data of a unit length cube
def cube_data():
points = np.array([[0., 0., 0.],
[0., 1., 0.],
... | [
"pysph.tools.mesh_tools.get_points_from_mgrid",
"numpy.ones",
"pysph.tools.mesh_tools.prism",
"pysph.tools.mesh_tools.surface_points",
"pysph.base.particle_array.ParticleArray",
"pysph.tools.mesh_tools.surf_points_uniform",
"pysph.tools.mesh_tools._get_surface_mesh",
"pysph.tools.mesh_tools._in_triang... | [((245, 396), 'numpy.array', 'np.array', (['[[0.0, 0.0, 0.0], [0.0, 1.0, 0.0], [1.0, 1.0, 0.0], [1.0, 0.0, 0.0], [0.0, \n 0.0, 1.0], [0.0, 1.0, 1.0], [1.0, 0.0, 1.0], [1.0, 1.0, 1.0]]'], {}), '([[0.0, 0.0, 0.0], [0.0, 1.0, 0.0], [1.0, 1.0, 0.0], [1.0, 0.0, 0.0\n ], [0.0, 0.0, 1.0], [0.0, 1.0, 1.0], [1.0, 0.0, 1.0... |
"""
CentralService.rest_api.dataservice
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module handles the interactions with the dataservice models. Takes care
of all the CRUD operations on dataservices. Each dataservice will have a list
of buildings and admins that belong to it.
@copyright: (c) 2016 SynergyLabs
@license: UCSD Lic... | [
"flask.request.get_json",
"flask.jsonify"
] | [((1504, 1535), 'flask.jsonify', 'jsonify', (['responses.success_true'], {}), '(responses.success_true)\n', (1511, 1535), False, 'from flask import request, jsonify\n'), ((2028, 2045), 'flask.jsonify', 'jsonify', (['response'], {}), '(response)\n', (2035, 2045), False, 'from flask import request, jsonify\n'), ((2417, 2... |
from django.contrib.gis.db import models
from django.db import connection
from uk_geo_utils.models import (
AbstractAddress,
AbstractAddressManager,
AbstractOnsudManager,
)
class AddressManager(AbstractAddressManager):
def postcodes_for_district(self, district):
qs = self.filter(location__with... | [
"uk_geo_utils.models.AbstractOnsudManager",
"django.db.connection.cursor",
"django.contrib.gis.db.models.CharField",
"django.contrib.gis.db.models.Index"
] | [((795, 817), 'uk_geo_utils.models.AbstractOnsudManager', 'AbstractOnsudManager', ([], {}), '()\n', (815, 817), False, 'from uk_geo_utils.models import AbstractAddress, AbstractAddressManager, AbstractOnsudManager\n'), ((830, 879), 'django.contrib.gis.db.models.CharField', 'models.CharField', ([], {'primary_key': '(Tru... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# MySQL Connector/Python - MySQL driver written in Python.
# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
# MySQL Connector/Python is licensed under the terms of the GPLv2
# <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
... | [
"logging.getLogger",
"logging.StreamHandler",
"tests.get_test_names",
"logging.Formatter",
"os.path.join",
"optparse.OptionParser",
"tests.printmsg",
"logging.FileHandler",
"sys.exit",
"os.path.abspath",
"unittest.TextTestRunner",
"unittest.TestLoader"
] | [((1966, 2002), 'logging.getLogger', 'logging.getLogger', (['tests.LOGGER_NAME'], {}), '(tests.LOGGER_NAME)\n', (1983, 2002), False, 'import logging\n'), ((5846, 5865), 'tests.printmsg', 'tests.printmsg', (['msg'], {}), '(msg)\n', (5860, 5865), False, 'import tests\n'), ((6029, 6043), 'optparse.OptionParser', 'OptionPa... |
import unittest
from solver import look_and_say
class TestSolver(unittest.TestCase):
def test_look_and_say(self):
self.assertEqual(look_and_say(1), "1")
self.assertEqual(look_and_say(2), "11")
self.assertEqual(look_and_say(3), "21")
self.assertEqual(look_and_say(4), "1211")
self.assertEqual(look_... | [
"unittest.main",
"solver.look_and_say"
] | [((374, 389), 'unittest.main', 'unittest.main', ([], {}), '()\n', (387, 389), False, 'import unittest\n'), ((138, 153), 'solver.look_and_say', 'look_and_say', (['(1)'], {}), '(1)\n', (150, 153), False, 'from solver import look_and_say\n'), ((181, 196), 'solver.look_and_say', 'look_and_say', (['(2)'], {}), '(2)\n', (193... |
from rest_framework import generics
from rest_framework.response import Response
from .serializers import CreatePostSerializer, ListPostSerializer
from .models import Post
class PostView(generics.GenericAPIView):
def post(self, request):
data = {**request.data, **{"user": request.user.id}}
seri... | [
"rest_framework.response.Response"
] | [((437, 474), 'rest_framework.response.Response', 'Response', (['serializer.data'], {'status': '(201)'}), '(serializer.data, status=201)\n', (445, 474), False, 'from rest_framework.response import Response\n')] |
from discord.ext import commands
import os
import sys
import asyncio
from ..core.cog_config import CogExtension
from typing import Tuple
# function for cogs management
def find_cog(bot, target_cog: str, mode: str) -> Tuple[bool, str]:
def load_ext(full_path: str):
if mode == 'load':
bot.load_e... | [
"os.listdir",
"asyncio.sleep",
"discord.ext.commands.group",
"sys.exit",
"discord.ext.commands.has_any_role",
"discord.ext.commands.command"
] | [((512, 536), 'os.listdir', 'os.listdir', (['"""./bot/cogs"""'], {}), "('./bot/cogs')\n", (522, 536), False, 'import os\n'), ((1264, 1280), 'discord.ext.commands.group', 'commands.group', ([], {}), '()\n', (1278, 1280), False, 'from discord.ext import commands\n'), ((1286, 1330), 'discord.ext.commands.has_any_role', 'c... |
"""
A copy from the existing FK code.
This is not a real/pure DG method, I mean, the demagnetisation fields including the magnetic
potential are not totally computed by DG methods, such as IP method or
the mixed form using BDM and DG space. The idea is actually even we use DG space
to represent the effective field an... | [
"dolfin.grad",
"finmag.util.timings.timed",
"dolfin.KrylovSolver",
"dolfin.Function",
"dolfin.VectorFunctionSpace",
"dolfin.dot",
"dolfin.BoundaryMesh",
"finmag.util.timings.Timings",
"dolfin.assemble",
"dolfin.TestFunction",
"dolfin.TrialFunction",
"dolfin.FunctionSpace",
"dolfin.Constant",... | [((946, 955), 'finmag.util.timings.Timings', 'Timings', ([], {}), '()\n', (953, 955), False, 'from finmag.util.timings import Timings, default_timer, timed, mtimed\n'), ((2898, 2919), 'finmag.util.timings.mtimed', 'mtimed', (['default_timer'], {}), '(default_timer)\n', (2904, 2919), False, 'from finmag.util.timings imp... |
from discord.ext import commands
from library.MessageContent import MessageContent
from library.Utils import getTeamInfo
from library.InputParser import InputParser
from library.SendList import SendList
class Commands(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.Cog.listener()
... | [
"discord.ext.commands.Cog.listener",
"library.SendList.SendList",
"library.InputParser.InputParser",
"library.MessageContent.MessageContent",
"library.Utils.getTeamInfo",
"discord.ext.commands.command"
] | [((293, 316), 'discord.ext.commands.Cog.listener', 'commands.Cog.listener', ([], {}), '()\n', (314, 316), False, 'from discord.ext import commands\n'), ((646, 664), 'discord.ext.commands.command', 'commands.command', ([], {}), '()\n', (662, 664), False, 'from discord.ext import commands\n'), ((798, 816), 'discord.ext.c... |
from typing import Dict
from .common import mean, ValueBuffer
from datetime import datetime, timezone, timedelta
class TemperatureGroup:
def __init__(self, name, time_read_sec=1):
self.name = name
self.data: Dict[str, ValueBuffer] = {}
self.last_update = datetime.now(tz=timezone.utc) - t... | [
"datetime.datetime.now",
"datetime.timedelta"
] | [((366, 398), 'datetime.timedelta', 'timedelta', ([], {'seconds': 'time_read_sec'}), '(seconds=time_read_sec)\n', (375, 398), False, 'from datetime import datetime, timezone, timedelta\n'), ((736, 762), 'datetime.datetime.now', 'datetime.now', (['timezone.utc'], {}), '(timezone.utc)\n', (748, 762), False, 'from datetim... |
import xarray as xr
import pandas as pd
import cartopy
import cartopy.crs as ccrs
import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotlib.cm import get_cmap
import numpy as np
from cartopy.mpl.gridliner import LONGITUDE_FORMATTER, LATITUDE_FORMATTER
import shapely.geometry as sgeom
import cartopy.featu... | [
"copy.copy",
"numpy.arange",
"numpy.multiply",
"numpy.linspace",
"matplotlib.cm.get_cmap",
"matplotlib.pyplot.savefig",
"numpy.amin",
"cartopy.crs.PlateCarree",
"shapely.geometry.LineString",
"matplotlib.colors.Normalize",
"matplotlib.pyplot.title",
"xarray.open_dataset",
"cartopy.crs.Geodet... | [((22322, 22367), 'xarray.open_dataset', 'xr.open_dataset', (["(path + 'pressure_anomaly.nc')"], {}), "(path + 'pressure_anomaly.nc')\n", (22337, 22367), True, 'import xarray as xr\n'), ((22465, 22526), 'xarray.open_dataset', 'xr.open_dataset', (['"""atms597_proj3/data/pressure_anomaly_new.nc"""'], {}), "('atms597_proj... |
#!/usr/bin/python
# coding: utf-8
import numpy as np
from .facet import Facet
class PosRegion():
"""
Implement the convex polytope
"""
def __init__(self, pos_samples):
"""
Params:
pos_samples (np.array): dim+1 positive samples to create the
(dim)-polytope... | [
"numpy.delete",
"numpy.vstack"
] | [((4221, 4259), 'numpy.delete', 'np.delete', (['self.vertices', 'to_remove', '(0)'], {}), '(self.vertices, to_remove, 0)\n', (4230, 4259), True, 'import numpy as np\n'), ((862, 905), 'numpy.delete', 'np.delete', (['self.vertices', 'sample_id'], {'axis': '(0)'}), '(self.vertices, sample_id, axis=0)\n', (871, 905), True,... |
# -*- coding: utf-8 -*-
import contextlib
import sys
import time
from django.db import models
from django.utils import timezone
from app.authentication.models import Workspace
from app.definitions.models import Datastore
from utils.mixins.models import UUIDModel
class Run(UUIDModel):
"""Represents scan and ref... | [
"django.db.models.TextField",
"django.db.models.IntegerField",
"django.db.models.ForeignKey",
"django.utils.timezone.now",
"django.db.models.DateTimeField",
"django.db.models.CharField"
] | [((477, 567), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'to': 'Workspace', 'on_delete': 'models.CASCADE', 'related_name': '"""run_history"""'}), "(to=Workspace, on_delete=models.CASCADE, related_name=\n 'run_history')\n", (494, 567), False, 'from django.db import models\n'), ((611, 701), 'django.db.m... |
# -*- coding: utf-8 -*-
import os
import json
import tccli.options_define as OptionsDefine
import tccli.format_output as FormatOutput
from tccli.nice_command import NiceCommand
import tccli.error_msg as ErrorMsg
import tccli.help_template as HelpTemplate
from tccli import __version__
from tccli.utils import Utils
from ... | [
"tencentcloud.common.credential.Credential",
"tccli.services.cme.v20191029.version.replace",
"json.loads",
"json.dumps",
"os.environ.get",
"os.path.join",
"tccli.nice_command.NiceCommand",
"tccli.configure.Configure",
"tccli.utils.Utils.split_str",
"tccli.format_output.output",
"tccli.utils.Util... | [((1312, 1405), 'tencentcloud.common.credential.Credential', 'credential.Credential', (['g_param[OptionsDefine.SecretId]', 'g_param[OptionsDefine.SecretKey]'], {}), '(g_param[OptionsDefine.SecretId], g_param[\n OptionsDefine.SecretKey])\n', (1333, 1405), False, 'from tencentcloud.common import credential\n'), ((1634... |
#!/usr/bin/env python
# Copyright 2017 IBM Corp.
#
# 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 require... | [
"tabulate.tabulate",
"sys.exit",
"pyghmi.ipmi.command.Command",
"time.sleep",
"get_dhcp_lease_info.GetDhcpLeases",
"lib.ipmi_power.IpmiPower",
"lib.inventory.Inventory",
"lib.logger.Logger",
"time.time"
] | [((7262, 7278), 'lib.logger.Logger', 'Logger', (['__file__'], {}), '(__file__)\n', (7268, 7278), False, 'from lib.logger import Logger\n'), ((1196, 1225), 'lib.inventory.Inventory', 'Inventory', (['self.log', 'inv_file'], {}), '(self.log, inv_file)\n', (1205, 1225), False, 'from lib.inventory import Inventory\n'), ((12... |
import logging
from silex_client.action.command_base import CommandBase
from silex_client.action.action_query import ActionQuery
class Save(CommandBase):
"""
Save current scene with context as path
"""
parameters = {
"file_path": {"label": "filename", "type": str},
}
@CommandBase.co... | [
"silex_client.action.command_base.CommandBase.conform_command"
] | [((306, 335), 'silex_client.action.command_base.CommandBase.conform_command', 'CommandBase.conform_command', ([], {}), '()\n', (333, 335), False, 'from silex_client.action.command_base import CommandBase\n')] |
from unittest import TestCase
from musicscore.musicxml.types.complextypes.attributes import Clef
from musicscore.musicxml.types.complextypes.clef import Sign
class Test(TestCase):
def setUp(self) -> None:
self.clef = Clef()
self.clef.add_child(Sign('F'))
def test_1(self):
clef = self... | [
"musicscore.musicxml.types.complextypes.clef.Sign",
"musicscore.musicxml.types.complextypes.attributes.Clef"
] | [((232, 238), 'musicscore.musicxml.types.complextypes.attributes.Clef', 'Clef', ([], {}), '()\n', (236, 238), False, 'from musicscore.musicxml.types.complextypes.attributes import Clef\n'), ((267, 276), 'musicscore.musicxml.types.complextypes.clef.Sign', 'Sign', (['"""F"""'], {}), "('F')\n", (271, 276), False, 'from mu... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import time
import torch
import numpy as np
from torch.cuda.amp import autocast, GradScaler
from src.opts import opt
from src.dataset import Dataset
from src.losses import CtdetLoss
from... | [
"torch.manual_seed",
"src.model.load_model",
"src.opts.opt.lr_step.index",
"torch.cuda.amp.GradScaler",
"src.dataset.Dataset",
"src.model.get_model",
"os.path.join",
"torch.nn.DataParallel",
"src.utils.logger.Logger",
"torch.cuda.amp.autocast",
"src.losses.CtdetLoss",
"torch.utils.data.DataLoa... | [((2877, 2899), 'torch.manual_seed', 'torch.manual_seed', (['(317)'], {}), '(317)\n', (2894, 2899), False, 'import torch\n'), ((2965, 2985), 'src.utils.logger.Logger', 'Logger', (['opt', '"""train"""'], {}), "(opt, 'train')\n", (2971, 2985), False, 'from src.utils.logger import Logger\n'), ((3004, 3022), 'src.utils.log... |
import fitz
import logging
from pathlib import Path
from typing import List, Dict
from .rvnstu import Rvnstu
from .ftoolbox import Ftoolbox
from .merger import Merger
logger = logging.getLogger(__name__)
class Mfitzer:
"""Class object who add function to fitz module
"""
def __init__(self, directory_path... | [
"logging.getLogger",
"pathlib.Path",
"fitz.open"
] | [((178, 205), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (195, 205), False, 'import logging\n'), ((582, 597), 'fitz.open', 'fitz.open', (['file'], {}), '(file)\n', (591, 597), False, 'import fitz\n'), ((1962, 1987), 'pathlib.Path', 'Path', (['self.directory_path'], {}), '(self.directo... |
from scvi.models import VAE, MeanVarianceVAE
from scvi.inference import UnsupervisedTrainer
from .de_model import DEModel
import numpy as np
class ScVIClassic(DEModel):
def __init__(self, dataset, reconstruction_loss, n_latent, full_cov=False,
do_mean_variance=False, name=''):
super().__... | [
"scvi.inference.UnsupervisedTrainer"
] | [((1241, 1360), 'scvi.inference.UnsupervisedTrainer', 'UnsupervisedTrainer', ([], {'model': 'self.model', 'gene_dataset': 'self.dataset', 'use_cuda': '(True)', 'train_size': '(0.7)', 'kl': '(1)', 'frequency': '(1)'}), '(model=self.model, gene_dataset=self.dataset, use_cuda=\n True, train_size=0.7, kl=1, frequency=1)... |
from flask import Flask,render_template,request,redirect
from pymongo import MongoClient
app=Flask(__name__)
client=MongoClient('mongodb://127.0.0.1:27017')
db=client['names']
collection=db.record
@app.route('/',methods=['GET','POST'])
def index():
if request.method=='POST':
firstname=request.form[... | [
"flask.render_template",
"pymongo.MongoClient",
"flask.Flask"
] | [((94, 109), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (99, 109), False, 'from flask import Flask, render_template, request, redirect\n'), ((117, 157), 'pymongo.MongoClient', 'MongoClient', (['"""mongodb://127.0.0.1:27017"""'], {}), "('mongodb://127.0.0.1:27017')\n", (128, 157), False, 'from pymongo i... |
import torch
import torch.nn as nn
import torch.nn.functional as F
class sub_pixel(nn.Module):
def __init__(self, scale, act=False):
super(sub_pixel, self).__init__()
modules = []
modules.append(nn.PixelShuffle(scale))
self.body = nn.Sequential(*modules)
def forward(self, x):
... | [
"torch.nn.PixelShuffle",
"torch.nn.Sequential",
"torch.nn.Conv2d",
"torch.nn.MaxPool2d",
"torch.nn.functional.relu",
"torch.nn.functional.pad",
"torch.nn.ConvTranspose2d",
"torch.cat"
] | [((3198, 3221), 'torch.nn.functional.pad', 'F.pad', (['to_crop', 'padding'], {}), '(to_crop, padding)\n', (3203, 3221), True, 'import torch.nn.functional as F\n'), ((3234, 3282), 'torch.cat', 'torch.cat', (['(cropped_to_crop, to_merge_to)'], {'dim': '(1)'}), '((cropped_to_crop, to_merge_to), dim=1)\n', (3243, 3282), Fa... |
import gym
import gym_sokoban
import torch
import numpy as np
import random
import time
from utilities.channelConverter import hwc2chw
from experts.utils import get_distance
from external_actions import get_astar_action
import warnings
warnings.simplefilter("ignore", UserWarning)
def test_the_agent(agent, data_path... | [
"external_actions.get_astar_action",
"experts.utils.get_distance",
"time.sleep",
"numpy.sum",
"utilities.channelConverter.hwc2chw",
"warnings.simplefilter",
"torch.no_grad",
"gym.make"
] | [((239, 283), 'warnings.simplefilter', 'warnings.simplefilter', (['"""ignore"""', 'UserWarning'], {}), "('ignore', UserWarning)\n", (260, 283), False, 'import warnings\n'), ((660, 714), 'gym.make', 'gym.make', (['"""Curriculum-Sokoban-v2"""'], {'data_path': 'data_path'}), "('Curriculum-Sokoban-v2', data_path=data_path)... |
import copy
from csv import DictReader
from sklearn.model_selection import KFold
from sklearn.pipeline import Pipeline
from sklearn.preprocessing.data import MinMaxScaler
from sklearn.svm import SVC
from features import SentenceLength, BagOfTfIDF, WordOverlap
from features import POS, NER
from features import ToMatri... | [
"features.ToMatrix",
"preprocess.TokenizedLemmas",
"copy.deepcopy",
"sklearn.model_selection.KFold",
"sklearn.preprocessing.data.MinMaxScaler",
"features.WordOverlap",
"sklearn.svm.SVC"
] | [((1867, 1902), 'sklearn.model_selection.KFold', 'KFold', ([], {'n_splits': '(10)', 'random_state': '(42)'}), '(n_splits=10, random_state=42)\n', (1872, 1902), False, 'from sklearn.model_selection import KFold\n'), ((3005, 3026), 'copy.deepcopy', 'copy.deepcopy', (['X_test'], {}), '(X_test)\n', (3018, 3026), False, 'im... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Constant settings for Cowbird application.
Constants defined with format ``COWBIRD_[VARIABLE_NAME]`` can be matched with corresponding
settings formatted as ``cowbird.[variable_name]`` in the ``cowbird.ini`` configuration file.
.. note::
Since the ``cowbird.ini`` ... | [
"cowbird.utils.get_settings_from_config_ini",
"pyramid.threadlocal.get_current_registry",
"os.getenv",
"re.compile",
"cowbird.utils.get_settings",
"os.path.join",
"os.environ.get",
"cowbird.utils.print_log",
"os.path.dirname"
] | [((1124, 1159), 'os.path.dirname', 'os.path.dirname', (['COWBIRD_MODULE_DIR'], {}), '(COWBIRD_MODULE_DIR)\n', (1139, 1159), False, 'import os\n'), ((1278, 1310), 'os.getenv', 'os.getenv', (['"""COWBIRD_CONFIG_PATH"""'], {}), "('COWBIRD_CONFIG_PATH')\n", (1287, 1310), False, 'import os\n'), ((2355, 2385), 'os.getenv', '... |
import logging
import os
class FifoFile:
"""
Fifo object that handles directory and file creation
"""
instance_counter = 1
"""Makes any fifo name unique"""
def __init__(self, fifo_path=None, filename_prefix = "smartbot"):
self.fifo_filename = "{}_{}.{}".format(filename_prefix, str(Fi... | [
"os.path.exists",
"os.makedirs",
"os.path.join",
"os.path.isdir",
"os.mkfifo",
"logging.info",
"os.remove"
] | [((688, 750), 'logging.info', 'logging.info', (['("Written \'" + command + "\' to " + self.full_path)'], {}), '("Written \'" + command + "\' to " + self.full_path)\n', (700, 750), False, 'import logging\n'), ((929, 957), 'os.path.join', 'os.path.join', (['path', 'filename'], {}), '(path, filename)\n', (941, 957), False... |
# Standard imports
import unittest
import json
import logging
from datetime import datetime, timedelta
# Our imports
from emission.core.get_database import get_db, get_mode_db, get_section_db
from emission.analysis.result.precompute import precompute_results
from emission.core.wrapper.user import User
from emission.co... | [
"emission.tests.common.configLogging",
"emission.core.get_database.get_db",
"emission.analysis.result.precompute.precompute_results.PrecomputeResults",
"emission.core.wrapper.user.User.register",
"emission.core.wrapper.client.Client",
"emission.core.wrapper.user.User.fromEmail",
"emission.core.get_datab... | [((3775, 3794), 'emission.tests.common.configLogging', 'etc.configLogging', ([], {}), '()\n', (3792, 3794), True, 'import emission.tests.common as etc\n'), ((3799, 3814), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3812, 3814), False, 'import unittest\n'), ((981, 994), 'emission.core.get_database.get_mode_db',... |
# coding=utf-8
# Copyright (c) 2015 The Pycroft Authors. See the AUTHORS file.
# This file is part of the Pycroft project and licensed under the terms of
# the Apache License, Version 2.0. See the LICENSE file for details.
import logging as std_logging
log = std_logging.getLogger('import')
import collections
import tim... | [
"logging.getLogger",
"time.time"
] | [((259, 290), 'logging.getLogger', 'std_logging.getLogger', (['"""import"""'], {}), "('import')\n", (280, 290), True, 'import logging as std_logging\n'), ((794, 805), 'time.time', 'time.time', ([], {}), '()\n', (803, 805), False, 'import time\n'), ((994, 1005), 'time.time', 'time.time', ([], {}), '()\n', (1003, 1005), ... |
'''https://practice.geeksforgeeks.org/problems/pairs-with-positive-negative-values/0'''
from collections import defaultdict
import heapq
import re
def pos_neg_pairs(A):
count = defaultdict(lambda: [0,0])
for i, n in enumerate(A):
if n < 0:
count[abs(n)][0] += 1
else:
c... | [
"heapq.heappop",
"heapq.heapify",
"collections.defaultdict"
] | [((183, 211), 'collections.defaultdict', 'defaultdict', (['(lambda : [0, 0])'], {}), '(lambda : [0, 0])\n', (194, 211), False, 'from collections import defaultdict\n'), ((485, 505), 'heapq.heapify', 'heapq.heapify', (['pairs'], {}), '(pairs)\n', (498, 505), False, 'import heapq\n'), ((519, 539), 'heapq.heappop', 'heapq... |
from __future__ import print_function
import time
from jobby import JobbyJob
with JobbyJob(dict()) as job:
print(time.time())
| [
"time.time"
] | [((120, 131), 'time.time', 'time.time', ([], {}), '()\n', (129, 131), False, 'import time\n')] |
#! /usr/bin/python3
# monitoring for expressvpn and restarting the connection everytime it wigs out
from os import environ
from time import sleep
from shutil import copyfile
from sys import exit
import subprocess, pexpect
def check_location(loc):
"""Makes sure the location is valid. I'm just going to list the big... | [
"subprocess.check_output",
"pexpect.spawn",
"os.environ.get",
"time.sleep",
"shutil.copyfile",
"subprocess.call",
"sys.exit"
] | [((883, 932), 'subprocess.check_output', 'subprocess.check_output', (["['expressvpn', 'status']"], {}), "(['expressvpn', 'status'])\n", (906, 932), False, 'import subprocess, pexpect\n'), ((1387, 1439), 'subprocess.call', 'subprocess.call', (["['expressvpn', 'connect', location]"], {}), "(['expressvpn', 'connect', loca... |
import datetime as d
import uuid
from django.utils import timezone
from draftHost import models
from json import JsonObject, JsonTime, EmailMasker
from performance import ReadOnlyCachedAttribute
import nfl, draft
class JsonFantasyRoster(JsonObject):
fields = ['slots',]
show_id = False
class JsonFantasyDraf... | [
"draft.PickBuilder",
"json.JsonTime",
"draftHost.models.FantasyTeam.objects.filter",
"django.utils.timezone.now",
"uuid.uuid4",
"draftHost.models.FantasyTeam.objects.get_or_create",
"datetime.datetime.now",
"nfl.JsonNflPlayer",
"draftHost.models.FantasyDraft.objects.get",
"json.EmailMasker",
"dr... | [((625, 680), 'draftHost.models.FantasyTeam.objects.filter', 'models.FantasyTeam.objects.filter', ([], {'draft': 'self.db_object'}), '(draft=self.db_object)\n', (658, 680), False, 'from draftHost import models\n'), ((1078, 1114), 'json.JsonTime', 'JsonTime', (['self.db_object.draft_start'], {}), '(self.db_object.draft_... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
(c) 2017 - Copyright Red Hat Inc
Authors:
<NAME> <<EMAIL>>
Tests for flake8 compliance of the code
"""
from __future__ import unicode_literals, absolute_import
import os
import subprocess
import sys
import unittest
import six
REPO_PATH = os.path.abspath(
... | [
"flake8.__version__.split",
"subprocess.Popen",
"unittest.skipIf",
"os.path.dirname",
"unittest.SkipTest",
"unittest.main"
] | [((1768, 1876), 'unittest.skipIf', 'unittest.skipIf', (['(not (six.PY3 and sys.version_info.minor >= 6))', '"""Black is only available in python 3.6+"""'], {}), "(not (six.PY3 and sys.version_info.minor >= 6),\n 'Black is only available in python 3.6+')\n", (1783, 1876), False, 'import unittest\n'), ((2872, 2898), '... |
"""
Test `sinethesizer.effects.equalizer` module.
Author: <NAME>
"""
from typing import Any, Dict, List
import numpy as np
import pytest
from scipy.signal import spectrogram
from sinethesizer.effects.equalizer import apply_equalizer
from sinethesizer.synth.core import Event
from sinethesizer.oscillators import gen... | [
"sinethesizer.effects.equalizer.apply_equalizer",
"numpy.ones",
"scipy.signal.spectrogram",
"numpy.testing.assert_almost_equal",
"numpy.array",
"numpy.vstack"
] | [((4672, 4697), 'numpy.vstack', 'np.vstack', (['(sound, sound)'], {}), '((sound, sound))\n', (4681, 4697), True, 'import numpy as np\n'), ((4920, 4965), 'sinethesizer.effects.equalizer.apply_equalizer', 'apply_equalizer', (['sound', 'event', 'kind'], {}), '(sound, event, kind, **kwargs)\n', (4935, 4965), False, 'from s... |
# -*- coding: utf-8 -*-
import os
import sys
import time
import socket
import psutil
import datetime
from collections import defaultdict
import lumbermill.utils.DictUtils as DictUtils
from lumbermill.BaseThreadedModule import BaseThreadedModule
from lumbermill.utils.Decorators import ModuleDocstringParser, setInterval... | [
"lumbermill.utils.Decorators.setInterval",
"lumbermill.utils.StatisticCollector.StatisticCollector",
"psutil.Process",
"lumbermill.BaseThreadedModule.BaseThreadedModule.shutDown",
"lumbermill.utils.StatisticCollector.MultiProcessStatisticCollector",
"sys.exc_info",
"collections.defaultdict",
"os.getpi... | [((1880, 1929), 'lumbermill.BaseThreadedModule.BaseThreadedModule.configure', 'BaseThreadedModule.configure', (['self', 'configuration'], {}), '(self, configuration)\n', (1908, 1929), False, 'from lumbermill.BaseThreadedModule import BaseThreadedModule\n'), ((2314, 2334), 'lumbermill.utils.StatisticCollector.StatisticC... |
"""empty message
Revision ID: <KEY>
Revises: <KEY>
Create Date: 2018-06-12 14:27:07.207294
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = '<KEY>'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated ... | [
"sqlalchemy.DateTime",
"alembic.op.drop_table",
"sqlalchemy.Boolean",
"sqlalchemy.PrimaryKeyConstraint",
"sqlalchemy.Integer",
"sqlalchemy.String"
] | [((1410, 1433), 'alembic.op.drop_table', 'op.drop_table', (['"""movies"""'], {}), "('movies')\n", (1423, 1433), False, 'from alembic import op\n'), ((1250, 1279), 'sqlalchemy.PrimaryKeyConstraint', 'sa.PrimaryKeyConstraint', (['"""id"""'], {}), "('id')\n", (1273, 1279), True, 'import sqlalchemy as sa\n'), ((402, 414), ... |
from __future__ import annotations
import datetime
import json
from abc import ABC, abstractmethod
from collections import defaultdict, deque, namedtuple
from typing import (
Any,
Deque,
Dict,
Iterator,
List,
Mapping,
Optional,
Set,
TextIO,
Tuple,
)
import numpy as np
import sc... | [
"collections.namedtuple",
"collections.deque",
"numpy.array",
"collections.defaultdict",
"datetime.date",
"json.load"
] | [((396, 442), 'collections.namedtuple', 'namedtuple', (['"""ColumnValue"""', "['column', 'value']"], {}), "('ColumnValue', ['column', 'value'])\n", (406, 442), False, 'from collections import defaultdict, deque, namedtuple\n'), ((6342, 6374), 'numpy.array', 'np.array', (['data'], {'dtype': 'np.float32'}), '(data, dtype... |
from datetime import datetime
import logging
import os
import sys
from typing import List
import requests
logging.basicConfig(format='%(asctime)s [%(levelname)s] %(message)s', level=logging.INFO)
required_environment_variables: List[str] = [
'RANCHER_BEARER_TOKEN',
'RANCHER_CLUSTER_ID',
'RANCH... | [
"logging.basicConfig",
"requests.post",
"os.environ.get",
"requests.get",
"datetime.datetime.now",
"requests.put",
"sys.exit",
"logging.info"
] | [((114, 208), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s [%(levelname)s] %(message)s"""', 'level': 'logging.INFO'}), "(format='%(asctime)s [%(levelname)s] %(message)s', level\n =logging.INFO)\n", (133, 208), False, 'import logging\n'), ((1791, 1836), 'os.environ.get', 'os.environ.g... |
from PyQt5.QtGui import QPixmap
from PyQt5.QtWidgets import QWidget, QLabel
from PyQt5.QtCore import Qt
from src.resources.base_containers import BaseVContainer
from src.backend.styling import load_stylesheet
from src.backend.config import ConfigFunctions
class SnowReport(BaseVContainer):
label: QLabel = None
... | [
"PyQt5.QtGui.QPixmap",
"PyQt5.QtWidgets.QLabel",
"src.backend.config.ConfigFunctions",
"src.backend.styling.load_stylesheet"
] | [((589, 614), 'PyQt5.QtWidgets.QLabel', 'QLabel', (['"""Today\'s Weather"""'], {}), '("Today\'s Weather")\n', (595, 614), False, 'from PyQt5.QtWidgets import QWidget, QLabel\n'), ((709, 723), 'PyQt5.QtWidgets.QLabel', 'QLabel', (['report'], {}), '(report)\n', (715, 723), False, 'from PyQt5.QtWidgets import QWidget, QLa... |
# Generated by Django 3.0.2 on 2020-01-12 13:11
from django.db import migrations
bootstrap_version = "4.4.1"
jquery_version = "3.3.1"
popover_version = "1.14.3"
fontawesome_version = "4.7.0"
urls_settings = [
{
"library": 4,
"version": bootstrap_version,
"url": f"https://stackpath.bootstra... | [
"django.db.migrations.RunPython"
] | [((3042, 3083), 'django.db.migrations.RunPython', 'migrations.RunPython', (['forwards', 'backwards'], {}), '(forwards, backwards)\n', (3062, 3083), False, 'from django.db import migrations\n')] |
#! /usr/bin/python3
#
# Copyright (c) 2019 <NAME> <<EMAIL>>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#... | [
"time.sleep"
] | [((3827, 3840), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (3837, 3840), False, 'import time\n')] |
import itertools
import sys
import tkinter
import tkursed
class ColorCycleExample(tkursed.SimpleTkursedWindow):
def __init__(self) -> None:
super().__init__()
self.color_cycle = itertools.cycle(
[
(255, 0, 0),
(0, 255, 0),
(0, 0, 255),
... | [
"itertools.cycle",
"sys.exit"
] | [((201, 257), 'itertools.cycle', 'itertools.cycle', (['[(255, 0, 0), (0, 255, 0), (0, 0, 255)]'], {}), '([(255, 0, 0), (0, 255, 0), (0, 0, 255)])\n', (216, 257), False, 'import itertools\n'), ((885, 896), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (893, 896), False, 'import sys\n')] |
import timm
import torch.nn as nn
import torch
from pytorch_lightning import LightningModule
import torchmetrics
from typing import Dict, Any
class EfficientNetB1(nn.Module):
def __init__(self):
super().__init__()
self.backbone = timm.create_model(
'efficientnet_b1', pretrained=True, ... | [
"timm.create_model",
"torch.nn.Linear",
"torch.nn.BCEWithLogitsLoss",
"torchmetrics.F1Score",
"torch.optim.lr_scheduler.CosineAnnealingWarmRestarts",
"torch.cat"
] | [((253, 338), 'timm.create_model', 'timm.create_model', (['"""efficientnet_b1"""'], {'pretrained': '(True)', 'num_classes': '(0)', 'in_chans': '(3)'}), "('efficientnet_b1', pretrained=True, num_classes=0, in_chans=3\n )\n", (270, 338), False, 'import timm\n'), ((426, 452), 'torch.nn.Linear', 'nn.Linear', (['num_feat... |
import unittest
import subprocess
import requests
PORT=8080
class TestHW1(unittest.TestCase):
def test1(self):
res = requests.get('http://localhost:'+str(PORT)+'/check')
self.assertEqual(res.text, 'This is a GET request', msg='Incorrect response to GET request to /check endpoint')
self.assertEqual... | [
"unittest.main"
] | [((1360, 1375), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1373, 1375), False, 'import unittest\n')] |
import lxml
import lxml.html
from collections import defaultdict
import voeventparse as vp
import datetime
import iso8601
from astropy.coordinates import SkyCoord
import astropy.units as u
from fourpisky.voevent import (
create_skeleton_4pisky_voevent,
asassn_alert_substream,
get_stream_ivorn_prefix,
)
fro... | [
"logging.getLogger",
"datetime.datetime",
"datetime.datetime.utcnow",
"lxml.html.fromstring",
"iso8601.parse_date",
"astropy.coordinates.SkyCoord",
"voeventparse.Group",
"fourpisky.voevent.get_stream_ivorn_prefix",
"voeventparse.add_where_when",
"voeventparse.Reference",
"voeventparse.Param",
... | [((388, 415), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (405, 415), False, 'import logging\n'), ((726, 758), 'iso8601.parse_date', 'iso8601.parse_date', (['"""2017-10-18"""'], {}), "('2017-10-18')\n", (744, 758), False, 'import iso8601\n'), ((952, 986), 'fourpisky.voevent.get_stream_... |
"""
Copyright (c) 2020 <NAME>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
di... | [
"os.path.exists",
"argparse.ArgumentParser"
] | [((906, 1004), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Process parquet file data"""', 'epilog': '"""Enjoy the program!"""'}), "(description='Process parquet file data', epilog=\n 'Enjoy the program!')\n", (929, 1004), False, 'import argparse\n'), ((3578, 3598), 'os.path.exists'... |
#!/usr/bin/env python
import vtk
import random
numTuples = 12
bitter = vtk.vtkFloatArray()
bitter.SetNumberOfTuples(numTuples)
crispy = vtk.vtkFloatArray()
crispy.SetNumberOfTuples(numTuples)
crunchy = vtk.vtkFloatArray()
crunchy.SetNumberOfTuples(numTuples)
salty = vtk.vtkFloatArray()
salty.SetNumberOfTuples(num... | [
"vtk.vtkRenderWindowInteractor",
"vtk.vtkRenderWindow",
"vtk.vtkRenderer",
"vtk.vtkSpiderPlotActor",
"vtk.vtkFloatArray",
"random.random",
"random.randint",
"vtk.vtkDataObject"
] | [((74, 93), 'vtk.vtkFloatArray', 'vtk.vtkFloatArray', ([], {}), '()\n', (91, 93), False, 'import vtk\n'), ((140, 159), 'vtk.vtkFloatArray', 'vtk.vtkFloatArray', ([], {}), '()\n', (157, 159), False, 'import vtk\n'), ((207, 226), 'vtk.vtkFloatArray', 'vtk.vtkFloatArray', ([], {}), '()\n', (224, 226), False, 'import vtk\n... |
class MyModel:
def get_model(self,input_h):
from keras.models import Sequential
from keras.layers import Conv2D, MaxPooling2D
from keras.layers import Activation, Dropout, Flatten, Dense
model = Sequential()
model.add(Conv2D(30, 5, padding='same',activation='relu',input_sha... | [
"keras.layers.Conv2D",
"keras.layers.Flatten",
"keras.layers.MaxPooling2D",
"keras.models.Sequential",
"keras.layers.Activation",
"keras.layers.Dense",
"keras.layers.Dropout"
] | [((232, 244), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (242, 244), False, 'from keras.models import Sequential\n'), ((263, 350), 'keras.layers.Conv2D', 'Conv2D', (['(30)', '(5)'], {'padding': '"""same"""', 'activation': '"""relu"""', 'input_shape': '(input_h, input_h, 3)'}), "(30, 5, padding='same', a... |
from django.urls import reverse
from django_webtest import WebTest
from webtest import Text
from openpersonen.api.tests.factory_models import PersoonFactory, UserFactory
from openpersonen.contrib.demo.models import Kind, Ouder, Persoon
class TestPersoonAdmin(WebTest):
def setUp(self):
super().setUp()
... | [
"webtest.Text",
"openpersonen.contrib.demo.models.Kind.objects.filter",
"openpersonen.contrib.demo.models.Ouder.objects.filter",
"openpersonen.contrib.demo.models.Persoon.objects.filter",
"openpersonen.api.tests.factory_models.UserFactory",
"django.urls.reverse",
"openpersonen.api.tests.factory_models.P... | [((341, 559), 'openpersonen.api.tests.factory_models.PersoonFactory.create', 'PersoonFactory.create', ([], {'burgerservicenummer_persoon': '(123456789)', 'voornamen_persoon': '"""persoon_voornamen"""', 'geslachtsnaam_persoon': '"""geslachtsnaam_persoon"""', 'geboortedatum_persoon': '"""20200929"""', 'geslachtsaanduidin... |
import os
import itertools
import re
from typing import List, Optional, Tuple, Dict, Callable, Any, NamedTuple
from string import Template
from typing import List
from tokenizers import Tokenizer, Encoding
dirname = os.path.dirname(__file__)
css_filename = os.path.join(dirname, "visualizer-styles.css")
with open(css_... | [
"os.path.dirname",
"os.path.join",
"IPython.core.display.HTML",
"re.compile"
] | [((218, 243), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (233, 243), False, 'import os\n'), ((259, 305), 'os.path.join', 'os.path.join', (['dirname', '"""visualizer-styles.css"""'], {}), "(dirname, 'visualizer-styles.css')\n", (271, 305), False, 'import os\n'), ((1857, 1923), 're.compile'... |
from django.contrib import admin
from .models import (
ChatGroup,
GroupMembership,
GroupMessage,
GroupMessageInfo,
)
admin.site.register(ChatGroup)
admin.site.register(GroupMembership)
admin.site.register(GroupMessage)
admin.site.register(GroupMessageInfo)
| [
"django.contrib.admin.site.register"
] | [((135, 165), 'django.contrib.admin.site.register', 'admin.site.register', (['ChatGroup'], {}), '(ChatGroup)\n', (154, 165), False, 'from django.contrib import admin\n'), ((166, 202), 'django.contrib.admin.site.register', 'admin.site.register', (['GroupMembership'], {}), '(GroupMembership)\n', (185, 202), False, 'from ... |
from successor.skaters.scalarskaters.scalarskaterfactory import scaler_skater_factory
def suc_tsa_p2_d0_q1(y,s,k,a=None,t=None,e=None,r=None):
return scaler_skater_factory(y=y,s=s,k=k,skater_name='tsa_p2_d0_q1',n_input=160)
SCALAR_TSA_SKATERS = [suc_tsa_p2_d0_q1]
| [
"successor.skaters.scalarskaters.scalarskaterfactory.scaler_skater_factory"
] | [((156, 233), 'successor.skaters.scalarskaters.scalarskaterfactory.scaler_skater_factory', 'scaler_skater_factory', ([], {'y': 'y', 's': 's', 'k': 'k', 'skater_name': '"""tsa_p2_d0_q1"""', 'n_input': '(160)'}), "(y=y, s=s, k=k, skater_name='tsa_p2_d0_q1', n_input=160)\n", (177, 233), False, 'from successor.skaters.scal... |
#!/usr/bin/env python2.7
"Run a regresion test the library cells for DRC"
import unittest
from testutils import header
import sys,os
sys.path.append(os.path.join(sys.path[0],"../.."))
sys.path.append(os.path.join(sys.path[0],".."))
import globals
import debug
import calibre
OPTS = globals.OPTS
class big_test(unittes... | [
"globals.end_openram",
"design.hierarchy_spice.spice.__init__",
"os.path.join",
"router.router",
"calibre.run_drc",
"os.path.realpath",
"testutils.header",
"globals.parse_args",
"unittest.main",
"design.hierarchy_layout.layout.__init__",
"design.design.__init__",
"os.remove"
] | [((150, 184), 'os.path.join', 'os.path.join', (['sys.path[0]', '"""../.."""'], {}), "(sys.path[0], '../..')\n", (162, 184), False, 'import sys, os\n'), ((201, 232), 'os.path.join', 'os.path.join', (['sys.path[0]', '""".."""'], {}), "(sys.path[0], '..')\n", (213, 232), False, 'import sys, os\n'), ((3896, 3916), 'globals... |
# Copyright 2016 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.ops.array_ops.shape"
] | [((1559, 1577), 'tensorflow.python.ops.array_ops.shape', 'array_ops.shape', (['z'], {}), '(z)\n', (1574, 1577), False, 'from tensorflow.python.ops import array_ops\n')] |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import numpy as np
alpha = np.random.rand(7)
alpha /= np.linalg.norm(alpha, 1)
n = 40
def index_to_position(index):
p = 0
a, b, c, d, e, f = index
index = [a, d, b, e, c, f]
for i in index:
p = p * n + i
return p
if __name__ == "__main__":
... | [
"numpy.random.rand",
"numpy.linalg.norm"
] | [((76, 93), 'numpy.random.rand', 'np.random.rand', (['(7)'], {}), '(7)\n', (90, 93), True, 'import numpy as np\n'), ((103, 127), 'numpy.linalg.norm', 'np.linalg.norm', (['alpha', '(1)'], {}), '(alpha, 1)\n', (117, 127), True, 'import numpy as np\n'), ((476, 493), 'numpy.random.rand', 'np.random.rand', (['(7)'], {}), '(... |
# Generated by Django 3.1 on 2021-02-24 22:42
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("measures", "0004_rename_condition_component_measurement"),
]
operations = [
migrations.AlterModelOptions(
name="measurecondition",
... | [
"django.db.migrations.AlterModelOptions"
] | [((246, 356), 'django.db.migrations.AlterModelOptions', 'migrations.AlterModelOptions', ([], {'name': '"""measurecondition"""', 'options': "{'ordering': ['component_sequence_number']}"}), "(name='measurecondition', options={'ordering':\n ['component_sequence_number']})\n", (274, 356), False, 'from django.db import m... |
# -----------------------------------------------------------------------------
# WSDM Cup 2017 Classification and Evaluation
#
# Copyright (c) 2017 <NAME>, <NAME>, <NAME>, <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ... | [
"logging.getLogger",
"src.storage.dump_clf",
"itertools.groupby",
"src.evaluationutils.evaluate",
"src.evaluationutils.predict",
"src.classifiers.multipleinstance.SingleInstanceClassifier",
"src.classifiers.multipleinstance.SimpleMultipleInstanceClassifier",
"src.pipeline.optimization.get_default_rand... | [((1536, 1555), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (1553, 1555), False, 'import logging\n'), ((1836, 1876), 'src.pipeline.optimization.get_default_random_forest', 'optimization.get_default_random_forest', ([], {}), '()\n', (1874, 1876), False, 'from src.pipeline import optimization\n'), ((2022,... |
import os
import re
import pyblish.api
from avalon import aftereffects
class CollectExtensionVersion(pyblish.api.ContextPlugin):
""" Pulls and compares version of installed extension.
It is recommended to use same extension as in provided Openpype code.
Please use Anastasiy’s Extension Manager ... | [
"os.path.dirname",
"re.findall",
"os.path.exists",
"avalon.aftereffects.stub"
] | [((1087, 1125), 'os.path.dirname', 'os.path.dirname', (['aftereffects.__file__'], {}), '(aftereffects.__file__)\n', (1102, 1125), False, 'import os\n'), ((1216, 1244), 'os.path.exists', 'os.path.exists', (['manifest_url'], {}), '(manifest_url)\n', (1230, 1244), False, 'import os\n'), ((1469, 1532), 're.findall', 're.fi... |
"""
Authors: <NAME>, <NAME>
Contact: <EMAIL>
Unit tests for the gbdxtools.Idaho class
"""
import os
from gbdxtools import Interface
from gbdxtools.idaho import Idaho
from auth_mock import get_mock_gbdx_session
import vcr
import tempfile
import unittest
def force(r1, r2):
return True
my_vcr = vcr.VCR()
my_vcr.... | [
"auth_mock.get_mock_gbdx_session",
"gbdxtools.Interface",
"os.path.join",
"gbdxtools.idaho.Idaho",
"vcr.VCR",
"tempfile.mkdtemp"
] | [((303, 312), 'vcr.VCR', 'vcr.VCR', ([], {}), '()\n', (310, 312), False, 'import vcr\n'), ((511, 557), 'auth_mock.get_mock_gbdx_session', 'get_mock_gbdx_session', ([], {'token': '"""<PASSWORD>token"""'}), "(token='<PASSWORD>token')\n", (532, 557), False, 'from auth_mock import get_mock_gbdx_session\n'), ((577, 621), 'g... |
import unittest
from main import Polski
class PolskiTest(unittest.TestCase):
def setUp(self):
self.polski = Polski()
| [
"main.Polski"
] | [((123, 131), 'main.Polski', 'Polski', ([], {}), '()\n', (129, 131), False, 'from main import Polski\n')] |
# Generated by Django 2.0.9 on 2018-12-13 09:36
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('branch', '0016_hoststude... | [
"django.db.models.ForeignKey",
"django.db.models.FileField",
"django.db.models.AutoField",
"django.db.models.DateTimeField",
"django.db.migrations.swappable_dependency",
"django.db.models.CharField"
] | [((227, 284), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (258, 284), False, 'from django.db import migrations, models\n'), ((478, 571), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)... |
from random import randint
# Remove o ponto e hífen do CPF.
def removerFormatacaoCpf(cpf):
resultado = cpf.replace(".", "")
resultado = resultado.replace("-", "")
return resultado
# Adiciona o ponto e hífen no CPF.
def adicionarFormatacaoCpf(cpf):
cpfFormatado = ''
cpfFormatado += cpf[:3]
c... | [
"random.randint"
] | [((1311, 1324), 'random.randint', 'randint', (['(0)', '(9)'], {}), '(0, 9)\n', (1318, 1324), False, 'from random import randint\n')] |
from typing import List
from .controls import ACTION_TYPE, ExecutionControl, Logger
from .processor import Processor
import curses
import datetime
FRAME_WIDTH = 100
APP_NAME = 'RhProcessor'
proc_map = None
class Slot():
def __init__(self, node_dict: dict, logger: Logger, execution_control: ExecutionControl, ids: ... | [
"datetime.datetime.now",
"curses.endwin",
"curses.initscr"
] | [((3339, 3355), 'curses.initscr', 'curses.initscr', ([], {}), '()\n', (3353, 3355), False, 'import curses\n'), ((6187, 6202), 'curses.endwin', 'curses.endwin', ([], {}), '()\n', (6200, 6202), False, 'import curses\n'), ((1034, 1057), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (1055, 1057), Fals... |
import torch
import torch.optim as optim
from torch import autograd
import numpy as np
from tqdm import trange
import trimesh
from skimage import measure
import warnings
import time
from pipelines.utils.point_utils import sample_points_from_ray, np_get_occupied_idx, occupancy_sparse_to_dense
from pipelines.utils.postpr... | [
"skimage.measure.marching_cubes_lewiner",
"numpy.isin",
"torch.from_numpy",
"numpy.array",
"numpy.arange",
"pipelines.utils.point_utils.sample_points_from_ray",
"pipelines.utils.postprocess_utils.remove_backface",
"numpy.max",
"numpy.stack",
"numpy.linspace",
"numpy.concatenate",
"numpy.min",
... | [((2985, 3015), 'numpy.concatenate', 'np.concatenate', (['[v, n]'], {'axis': '(1)'}), '([v, n], axis=1)\n', (2999, 3015), True, 'import numpy as np\n'), ((3032, 3049), 'numpy.min', 'np.min', (['v'], {'axis': '(0)'}), '(v, axis=0)\n', (3038, 3049), True, 'import numpy as np\n'), ((3065, 3082), 'numpy.max', 'np.max', (['... |
import sys
import time
import json
import traceback
from six.moves import cStringIO
from pysmt.shortcuts import Solver
from pysmt.smtlib.parser import SmtLibParser
def process_data(data):
try:
data = json.loads(data)
atime = float(data["time"])
if 'smt_script' in data.keys():
d... | [
"json.loads",
"pysmt.smtlib.parser.SmtLibParser",
"pysmt.shortcuts.Solver",
"six.moves.cStringIO",
"sys.stdout.flush",
"traceback.print_exc",
"time.time"
] | [((1176, 1213), 'pysmt.shortcuts.Solver', 'Solver', ([], {'name': 'solver_name', 'logic': '"""BVt"""'}), "(name=solver_name, logic='BVt')\n", (1182, 1213), False, 'from pysmt.shortcuts import Solver\n'), ((1227, 1241), 'pysmt.smtlib.parser.SmtLibParser', 'SmtLibParser', ([], {}), '()\n', (1239, 1241), False, 'from pysm... |
#!/us/bin/env python3
import time
class timer (object):
def __enter__(self):
self.start = time.time()
print('Timer starts at: %s' % self.start)
return self
def __exit__(self, type, value, traceback):
self.stop = time.time()
print('Timer stops at: %s' % sel... | [
"time.time"
] | [((111, 122), 'time.time', 'time.time', ([], {}), '()\n', (120, 122), False, 'import time\n'), ((267, 278), 'time.time', 'time.time', ([], {}), '()\n', (276, 278), False, 'import time\n')] |
from __future__ import absolute_import, unicode_literals
import logging
from django import forms
from django.core.exceptions import PermissionDenied
from django.utils.translation import ugettext_lazy as _
from acls.models import AccessEntry
from permissions.models import Permission
from .models import Folder
from .... | [
"logging.getLogger",
"permissions.models.Permission.objects.check_permissions",
"django.utils.translation.ugettext_lazy",
"acls.models.AccessEntry.objects.filter_objects_by_access"
] | [((372, 399), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (389, 399), False, 'import logging\n'), ((788, 856), 'permissions.models.Permission.objects.check_permissions', 'Permission.objects.check_permissions', (['user', '[PERMISSION_FOLDER_VIEW]'], {}), '(user, [PERMISSION_FOLDER_VIEW]... |
import pybullet as sim
import time
pc = sim.connect(sim.GUI)
sim.setGravity(0, 0, -9.8)
path = "path to your URDF file"
armID = sim.loadURDF(path, basePosition=[0, 0, 0], useFixedBase=True)
while pc != 0:
sim.stepSimulation()
time.sleep(0.01)
| [
"pybullet.connect",
"time.sleep",
"pybullet.setGravity",
"pybullet.stepSimulation",
"pybullet.loadURDF"
] | [((42, 62), 'pybullet.connect', 'sim.connect', (['sim.GUI'], {}), '(sim.GUI)\n', (53, 62), True, 'import pybullet as sim\n'), ((63, 89), 'pybullet.setGravity', 'sim.setGravity', (['(0)', '(0)', '(-9.8)'], {}), '(0, 0, -9.8)\n', (77, 89), True, 'import pybullet as sim\n'), ((132, 193), 'pybullet.loadURDF', 'sim.loadURDF... |
import requests
url = 'http://127.0.0.1:9000/api/comments'
resp = requests.post(
url,
data={
"name": "wnn",
"email": "<EMAIL>",
"comments": "comment",
"page_id":"2"
}
)
print(resp.text)
| [
"requests.post"
] | [((66, 169), 'requests.post', 'requests.post', (['url'], {'data': "{'name': 'wnn', 'email': '<EMAIL>', 'comments': 'comment', 'page_id': '2'}"}), "(url, data={'name': 'wnn', 'email': '<EMAIL>', 'comments':\n 'comment', 'page_id': '2'})\n", (79, 169), False, 'import requests\n')] |
from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, BooleanField, SubmitField, TextAreaField
from wtforms.validators import DataRequired, Length
class LoginForm(FlaskForm):
username = StringField('Username', validators=[DataRequired(), Length(5, 20)])
password = PasswordField('Passw... | [
"wtforms.validators.Length",
"wtforms.BooleanField",
"wtforms.validators.DataRequired",
"wtforms.SubmitField"
] | [((385, 412), 'wtforms.BooleanField', 'BooleanField', (['"""Remember me"""'], {}), "('Remember me')\n", (397, 412), False, 'from wtforms import StringField, PasswordField, BooleanField, SubmitField, TextAreaField\n'), ((426, 447), 'wtforms.SubmitField', 'SubmitField', (['"""Log in"""'], {}), "('Log in')\n", (437, 447),... |
import numpy as np
from time import time
from typing import List, Tuple
from tsp_heuristics.heuristics.utils import get_tour_distance
def nn_algo(
dist_matrix: np.array,
start: int = 0
) -> Tuple[List, float]:
"""
From a start city index, get an Tour according to the Nearest Neighbor
algorithm from... | [
"numpy.argmin",
"time.time",
"tsp_heuristics.heuristics.utils.get_tour_distance"
] | [((666, 672), 'time.time', 'time', ([], {}), '()\n', (670, 672), False, 'from time import time\n'), ((994, 1026), 'numpy.argmin', 'np.argmin', (['dist_matrix[Tour[-1]]'], {}), '(dist_matrix[Tour[-1]])\n', (1003, 1026), True, 'import numpy as np\n'), ((1266, 1302), 'tsp_heuristics.heuristics.utils.get_tour_distance', 'g... |
#!/usr/bin/env python
import json
import time
import random
from sys import argv, exit
from elasticsearch import Elasticsearch, helpers
es = Elasticsearch([{'host': 'localhost', 'port': 9200}])
service_index = "masscan_services"
host_index = "nweb_hosts"
if len(argv)!=2:
exit("usage: nweb_upload.py <filename>")
fi... | [
"elasticsearch.helpers.bulk",
"elasticsearch.Elasticsearch",
"random.randint",
"sys.exit"
] | [((141, 193), 'elasticsearch.Elasticsearch', 'Elasticsearch', (["[{'host': 'localhost', 'port': 9200}]"], {}), "([{'host': 'localhost', 'port': 9200}])\n", (154, 193), False, 'from elasticsearch import Elasticsearch, helpers\n'), ((2272, 2343), 'elasticsearch.helpers.bulk', 'helpers.bulk', (['es', 'service_actions'], {... |