code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
from trackbelt import decompose_query
def test_basic_query():
query = decompose_query('tricky - forget')
assert query['artist'] == 'tricky'
assert query['title'] == 'forget'
def test_remix_query():
query = decompose_query('Evvy - Collide (Keljet Remix)')
assert query['artist'] == 'Evvy'
asser... | [
"trackbelt.decompose_query"
] | [((76, 110), 'trackbelt.decompose_query', 'decompose_query', (['"""tricky - forget"""'], {}), "('tricky - forget')\n", (91, 110), False, 'from trackbelt import decompose_query\n'), ((225, 273), 'trackbelt.decompose_query', 'decompose_query', (['"""Evvy - Collide (Keljet Remix)"""'], {}), "('Evvy - Collide (Keljet Remix... |
""" This module loads the Slicer Module Logic vtk classes into its namespace."""
# Import the CLI logic
# HACK Ideally constant from vtkSlicerConfigure should be wrapped,
# that way the following try/except could be avoided.
try:
from qSlicerBaseQTCLIPython import vtkSlicerCLIModuleLogic
except: pass
from __ma... | [
"slicer.util.importVTKClassesFromDirectory",
"os.path.join",
"__main__._qSlicerCoreApplicationInstance.commandOptions"
] | [((698, 772), 'os.path.join', 'path.join', (['app.slicerHome', 'slicer_qt_loadable_modules_lib_subdir', '"""Python"""'], {}), "(app.slicerHome, slicer_qt_loadable_modules_lib_subdir, 'Python')\n", (707, 772), False, 'from os import path\n'), ((591, 646), 'os.path.join', 'path.join', (['"""lib"""', '"""Slicer-%d.%d"""',... |
"""Library of functions used to work with netbox.
"""
import pynetbox
import os
# Common mappings for device types and roles
device_roles = {
"CSR1000v": "router",
"ASAv": "firewall",
"NX-OSv 9000": "switch",
"IOSvL2": "switch",
"OTHER": "other",
}
# Constants for Interface Form Factor IDs
FF_100... | [
"pynetbox.api",
"os.getenv"
] | [((440, 465), 'os.getenv', 'os.getenv', (['"""NETBOX_TOKEN"""'], {}), "('NETBOX_TOKEN')\n", (449, 465), False, 'import os\n'), ((479, 502), 'os.getenv', 'os.getenv', (['"""NETBOX_URL"""'], {}), "('NETBOX_URL')\n", (488, 502), False, 'import os\n'), ((522, 546), 'os.getenv', 'os.getenv', (['"""NETBOX_SITE"""'], {}), "('... |
#!/usr/bin/env python3
import math
import torch
from gpytorch.variational.cholesky_variational_distribution import CholeskyVariationalDistribution
from .. import settings
from ..distributions import MultivariateNormal
from ..lazy import (
CholLazyTensor,
DiagLazyTensor,
PsdSumLazyTensor,
RootLazyTen... | [
"gpytorch.lazy.DiagLazyTensor",
"torch.add",
"torch.equal",
"torch.cat"
] | [((5089, 5120), 'torch.equal', 'torch.equal', (['x', 'inducing_points'], {}), '(x, inducing_points)\n', (5100, 5120), False, 'import torch\n'), ((5425, 5464), 'torch.cat', 'torch.cat', (['[inducing_points, x]'], {'dim': '(-2)'}), '([inducing_points, x], dim=-2)\n', (5434, 5464), False, 'import torch\n'), ((8244, 8289),... |
# AUTOGENERATED! DO NOT EDIT! File to edit: annotation-multi_category_adapter.ipynb (unless otherwise specified).
__all__ = ['DEFAULT_ANNOTATIONS_FILE', 'CSV_FIELDNAMES', 'logger', 'MultiCategoryAnnotationAdapter']
# Cell
import csv
import shutil
import logging
from os.path import join, basename, isfile, splitext
fr... | [
"logging.getLogger",
"csv.DictWriter",
"csv.DictReader",
"shutil.copy2",
"os.path.splitext",
"os.path.join",
"os.path.isfile",
"os.path.basename"
] | [((571, 598), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (588, 598), False, 'import logging\n'), ((2420, 2458), 'os.path.join', 'join', (['self.path', 'annotations_file_name'], {}), '(self.path, annotations_file_name)\n', (2424, 2458), False, 'from os.path import join, basename, isfil... |
#!/usr/bin/env python
"""
Worker example from the 2nd tutorial
"""
import asyncio
import aioamqp
import sys
@asyncio.coroutine
def callback(channel, body, envelope, properties):
print(" [x] Received %r" % body)
yield from asyncio.sleep(body.count(b'.'))
print(" [x] Done")
yield from channel.basic... | [
"asyncio.get_event_loop",
"aioamqp.connect"
] | [((875, 899), 'asyncio.get_event_loop', 'asyncio.get_event_loop', ([], {}), '()\n', (897, 899), False, 'import asyncio\n'), ((453, 487), 'aioamqp.connect', 'aioamqp.connect', (['"""localhost"""', '(5672)'], {}), "('localhost', 5672)\n", (468, 487), False, 'import aioamqp\n')] |
# Program to make NXT brick beep using NXT Python with Bluetooth socket
#
# <NAME> CSCI 250 Washington and Lee University April 2011
# Change this ID to match the one on your brick. You can find the ID by doing Settings / NXT Version.
# You will have to put a colon between each pair of digits.
ID = '00:16:53:... | [
"nxt.bluesock.BlueSock"
] | [((496, 508), 'nxt.bluesock.BlueSock', 'BlueSock', (['ID'], {}), '(ID)\n', (504, 508), False, 'from nxt.bluesock import BlueSock\n')] |
import numpy as np
def fg_bg_data(labels,fg_labels):
'''
given cifar data convert into fg and background data
inputs : original cifar labels as list, foreground labels as list
returns cifar labels as binary labels with foreground data as class 0 and background data as class 1
'''
labels =... | [
"numpy.array",
"numpy.logical_not",
"numpy.logical_or",
"numpy.max"
] | [((321, 337), 'numpy.array', 'np.array', (['labels'], {}), '(labels)\n', (329, 337), True, 'import numpy as np\n'), ((462, 488), 'numpy.logical_not', 'np.logical_not', (['fg_indices'], {}), '(fg_indices)\n', (476, 488), True, 'import numpy as np\n'), ((837, 853), 'numpy.array', 'np.array', (['labels'], {}), '(labels)\n... |
# encoding: utf-8
from distutils.core import setup
import os.path
version = 'devel'
version_txt = os.path.join(os.path.dirname(os.path.abspath(__file__)),
'json_store', 'version.txt')
if os.path.exists(version_txt):
with open(version_txt) as v:
version = v.readline().strip()
pac... | [
"distutils.core.setup"
] | [((1451, 1472), 'distutils.core.setup', 'setup', ([], {}), '(**package_info)\n', (1456, 1472), False, 'from distutils.core import setup\n')] |
from django.core.management.base import BaseCommand
from ._sparrow_rabbitmq_consumer import rabbitmq_consumer
import logging
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = 'sparrow_rabbitmq_consumer'
def add_arguments(self, parser):
parser.add_argument('--queue', dest="queue... | [
"logging.getLogger",
"pdb.set_trace"
] | [((135, 162), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (152, 162), False, 'import logging\n'), ((404, 419), 'pdb.set_trace', 'pdb.set_trace', ([], {}), '()\n', (417, 419), False, 'import pdb\n')] |
# Copyright 2017 Battelle Energy Alliance, 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | [
"warnings.simplefilter",
"os.kill",
"collections.deque"
] | [((828, 880), 'warnings.simplefilter', 'warnings.simplefilter', (['"""default"""', 'DeprecationWarning'], {}), "('default', DeprecationWarning)\n", (849, 880), False, 'import warnings\n'), ((3517, 3536), 'collections.deque', 'collections.deque', ([], {}), '()\n', (3534, 3536), False, 'import collections\n'), ((5708, 57... |
__all__ = ["show_results", "interp"]
from icevision.imports import *
from icevision.utils import *
from icevision.core import *
from icevision.data import *
from icevision.models.base_show_results import base_show_results
from icevision.models.ultralytics.yolov5.dataloaders import (
build_infer_batch,
valid_dl... | [
"icevision.models.interpretation.Interpretation",
"yolov5.utils.loss.ComputeLoss",
"icevision.models.interpretation._move_to_device",
"icevision.core.record_components.LossesRecordComponent",
"icevision.models.base_show_results.base_show_results"
] | [((2177, 2283), 'icevision.models.interpretation.Interpretation', 'Interpretation', ([], {'losses_dict': '_LOSSES_DICT', 'valid_dl': 'valid_dl', 'infer_dl': 'infer_dl', 'predict_dl': 'predict_dl'}), '(losses_dict=_LOSSES_DICT, valid_dl=valid_dl, infer_dl=\n infer_dl, predict_dl=predict_dl)\n', (2191, 2283), False, '... |
from word_processor import count_words
def test_corpus(get_text_from_file):
"""
testing a fixture
:param get_text_from_file: name of the function
:return: None
"""
assert count_words(get_text_from_file) > 10 | [
"word_processor.count_words"
] | [((196, 227), 'word_processor.count_words', 'count_words', (['get_text_from_file'], {}), '(get_text_from_file)\n', (207, 227), False, 'from word_processor import count_words\n')] |
from setuptools import setup
setup(name='seleniumapis',
version='0.1',
description='Query Vanguard and other sites using the Selenium API',
author='<NAME>',
author_email='<EMAIL>',
packages=['vanguard'],
install_requires=[
'selenium',
'nose'
],
zip_sa... | [
"setuptools.setup"
] | [((30, 273), 'setuptools.setup', 'setup', ([], {'name': '"""seleniumapis"""', 'version': '"""0.1"""', 'description': '"""Query Vanguard and other sites using the Selenium API"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'packages': "['vanguard']", 'install_requires': "['selenium', 'nose']", 'zip_safe... |
from collections import defaultdict
import math
import copy
import inspect
import itertools as it
# representation for our graph of transactions
# u ---w---> v means: u owes v the amount of w dollars
class Graph:
def __init__(self, vertices, balances={}):
self.vertices = vertices
self.graph = defaultdict(l... | [
"itertools.combinations",
"collections.defaultdict",
"inspect.stack",
"copy.deepcopy"
] | [((2696, 2726), 'copy.deepcopy', 'copy.deepcopy', (['working_g.edges'], {}), '(working_g.edges)\n', (2709, 2726), False, 'import copy\n'), ((3989, 4014), 'copy.deepcopy', 'copy.deepcopy', (['components'], {}), '(components)\n', (4002, 4014), False, 'import copy\n'), ((307, 324), 'collections.defaultdict', 'defaultdict'... |
import dcase_util
data = dcase_util.utils.Example.feature_container()
data_aggregator = dcase_util.data.Aggregator(
recipe=['flatten'],
win_length_frames=10,
hop_length_frames=1,
)
data_aggregator.aggregate(data)
data.plot() | [
"dcase_util.data.Aggregator",
"dcase_util.utils.Example.feature_container"
] | [((25, 69), 'dcase_util.utils.Example.feature_container', 'dcase_util.utils.Example.feature_container', ([], {}), '()\n', (67, 69), False, 'import dcase_util\n'), ((88, 181), 'dcase_util.data.Aggregator', 'dcase_util.data.Aggregator', ([], {'recipe': "['flatten']", 'win_length_frames': '(10)', 'hop_length_frames': '(1)... |
from keras.layers import Input, Convolution2D, MaxPooling2D, Flatten, Dense
from keras.models import Model
def VGG10(weights=None, input_shape=(128, 128, 3)):
input_img = Input(shape=input_shape)
x = Convolution2D(32, 3, 3, activation='relu', border_mode='same', name='B1_C1')(input_img)
x = Convolution2D... | [
"keras.layers.Convolution2D",
"keras.layers.Flatten",
"keras.layers.MaxPooling2D",
"keras.layers.Input",
"keras.models.Model",
"keras.layers.Dense"
] | [((177, 201), 'keras.layers.Input', 'Input', ([], {'shape': 'input_shape'}), '(shape=input_shape)\n', (182, 201), False, 'from keras.layers import Input, Convolution2D, MaxPooling2D, Flatten, Dense\n'), ((1222, 1254), 'keras.models.Model', 'Model', ([], {'input': 'input_img', 'output': 'x'}), '(input=input_img, output=... |
from importlib import import_module
from shutil import copytree
from datetime import date
from logging import Logger
from foliant.utils import spinner
class BaseBackend():
'''Base backend. All backends must inherit from this one.'''
targets = ()
required_preprocessors_before = ()
required_preprocess... | [
"shutil.copytree",
"datetime.date.today",
"importlib.import_module",
"foliant.utils.spinner"
] | [((3001, 3037), 'shutil.copytree', 'copytree', (['src_path', 'self.working_dir'], {}), '(src_path, self.working_dir)\n', (3009, 3037), False, 'from shutil import copytree\n'), ((1756, 1851), 'foliant.utils.spinner', 'spinner', (['f"""Applying preprocessor {preprocessor_name}"""', 'self.logger', 'self.quiet', 'self.debu... |
from fp.fp import FreeProxy
from scholarly import scholarly
class Scholarly:
def __init__(self):
proxy = FreeProxy(rand=True, timeout=1, country_id=['US', 'CA']).get()
scholarly.use_proxy(http=proxy, https=proxy)
def get_author_details(self, name):
"""
:return:
"""
... | [
"fp.fp.FreeProxy",
"scholarly.scholarly.use_proxy",
"scholarly.scholarly.search_author"
] | [((191, 235), 'scholarly.scholarly.use_proxy', 'scholarly.use_proxy', ([], {'http': 'proxy', 'https': 'proxy'}), '(http=proxy, https=proxy)\n', (210, 235), False, 'from scholarly import scholarly\n'), ((341, 370), 'scholarly.scholarly.search_author', 'scholarly.search_author', (['name'], {}), '(name)\n', (364, 370), Fa... |
import unittest
from design_patterns.recent_counter import RecentCounter
class RecentCounterTest(unittest.TestCase):
def test_3_calls(self):
recent_counter = RecentCounter()
actual_ping_1 = recent_counter.ping(1)
self.assertEquals(actual_ping_1, 1)
actual_ping_100 = recent_count... | [
"unittest.main",
"design_patterns.recent_counter.RecentCounter"
] | [((614, 629), 'unittest.main', 'unittest.main', ([], {}), '()\n', (627, 629), False, 'import unittest\n'), ((173, 188), 'design_patterns.recent_counter.RecentCounter', 'RecentCounter', ([], {}), '()\n', (186, 188), False, 'from design_patterns.recent_counter import RecentCounter\n')] |
#!/usr/bin/env python3
"""
Argus Terminal Monitor 0.1
Monitor a single set of data from one provider in a console.
Usage:
terminal-monitor.py <provider_id> [--run_once]
terminal-monitor.py --help | -h
terminal-monitor.py --version
Options:
-h --help Show this screen
... | [
"pprint.pprint",
"argus.common.PostgresConnection.PostgresConnection",
"os.system",
"sys.path.append",
"docopt.docopt"
] | [((3858, 3881), 'sys.path.append', 'sys.path.append', (['"""/app"""'], {}), "('/app')\n", (3873, 3881), False, 'import os, sys\n'), ((3893, 3946), 'docopt.docopt', 'docopt', (['__doc__'], {'version': '"""Argus Terminal Monitor 0.1"""'}), "(__doc__, version='Argus Terminal Monitor 0.1')\n", (3899, 3946), False, 'from do... |
"""
References
------------
1. https://www.baeldung.com/cs/svm-multiclass-classification
2. https://shomy.top/2017/02/20/svm04-soft-margin/
3. http://people.csail.mit.edu/dsontag/courses/ml13/slides/lecture6.pdf
"""
import pandas as pd
import numpy as np
class MulticlassSVM:
"""
Simply use one-vs-rest
""... | [
"pandas.read_csv",
"numpy.where",
"numpy.argmax",
"numpy.zeros",
"numpy.full"
] | [((890, 927), 'numpy.zeros', 'np.zeros', (['(self.n_classes, n_samples)'], {}), '((self.n_classes, n_samples))\n', (898, 927), True, 'import numpy as np\n'), ((1956, 1983), 'numpy.zeros', 'np.zeros', (['(self.n_classes,)'], {}), '((self.n_classes,))\n', (1964, 1983), True, 'import numpy as np\n'), ((2360, 2379), 'numpy... |
import factory
from datetime import timedelta
from faker import Factory
from random import randint
from zeus import models
from zeus.utils import timezone
from .base import ModelFactory
from .types import GUIDFactory
faker = Factory.create()
class ChangeRequestFactory(ModelFactory):
id = GUIDFactory()
mes... | [
"factory.SubFactory",
"random.randint",
"zeus.utils.timezone.now",
"factory.faker.Faker",
"faker.Factory.create",
"datetime.timedelta",
"factory.SelfAttribute"
] | [((229, 245), 'faker.Factory.create', 'Factory.create', ([], {}), '()\n', (243, 245), False, 'from faker import Factory\n'), ((327, 358), 'factory.faker.Faker', 'factory.faker.Faker', (['"""sentence"""'], {}), "('sentence')\n", (346, 358), False, 'import factory\n'), ((503, 537), 'factory.SelfAttribute', 'factory.SelfA... |
# Copyright 2016 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 agree... | [
"pipeline.tasks.protoc_tasks.GoLangUpdateImportsTask"
] | [((716, 760), 'pipeline.tasks.protoc_tasks.GoLangUpdateImportsTask', 'protoc_tasks.GoLangUpdateImportsTask', (['"""test"""'], {}), "('test')\n", (752, 760), False, 'from pipeline.tasks import protoc_tasks\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function
from flask.ext.script import Manager, Server, Shell
from test_pay_site import create_app
manager = Manager(create_app)
manager.add_option('-e', '--env', dest='env', default='dev', required=False)
def make_shell_co... | [
"flask.ext.script.Server",
"flask.ext.script.Manager",
"flask.ext.script.Shell"
] | [((204, 223), 'flask.ext.script.Manager', 'Manager', (['create_app'], {}), '(create_app)\n', (211, 223), False, 'from flask.ext.script import Manager, Server, Shell\n'), ((543, 576), 'flask.ext.script.Server', 'Server', ([], {'host': '"""0.0.0.0"""', 'port': '(8090)'}), "(host='0.0.0.0', port=8090)\n", (549, 576), Fals... |
"""
A management command which deletes expired invitation keys from the database.
Calls ``Invitation.objects.delete_expired_keys()``, which contains the actual
logic for determining which accounts are deleted.
"""
from django.core.management.base import NoArgsCommand
from invitation.models import Invitation
class ... | [
"invitation.models.Invitation.objects.delete_expired_keys"
] | [((455, 495), 'invitation.models.Invitation.objects.delete_expired_keys', 'Invitation.objects.delete_expired_keys', ([], {}), '()\n', (493, 495), False, 'from invitation.models import Invitation\n')] |
import numpy as np
from ..utils.dictionary import get_lambda_max
def simulate_data(n_times, n_times_atom, n_atoms, n_channels, noise_level,
random_state=None):
rng = np.random.RandomState(random_state)
rho = n_atoms / (n_channels * n_times_atom)
D = rng.normal(scale=10.0, size=(n_atoms,... | [
"numpy.array",
"numpy.convolve",
"numpy.random.RandomState"
] | [((191, 226), 'numpy.random.RandomState', 'np.random.RandomState', (['random_state'], {}), '(random_state)\n', (212, 226), True, 'import numpy as np\n'), ((356, 367), 'numpy.array', 'np.array', (['D'], {}), '(D)\n', (364, 367), True, 'import numpy as np\n'), ((644, 671), 'numpy.convolve', 'np.convolve', (['zk', 'dk', '... |
import rsa
import json
class LazyUser(object):
def __init__(self):
self.pub, self.priv = rsa.newkeys(512)
def sign(self, transaction):
message = json.dumps(transaction.to_dict(), sort_keys=True).encode('utf-8')
signature = rsa.sign(message, self.priv, 'SHA-256')
return (messag... | [
"rsa.newkeys",
"rsa.sign"
] | [((103, 119), 'rsa.newkeys', 'rsa.newkeys', (['(512)'], {}), '(512)\n', (114, 119), False, 'import rsa\n'), ((258, 297), 'rsa.sign', 'rsa.sign', (['message', 'self.priv', '"""SHA-256"""'], {}), "(message, self.priv, 'SHA-256')\n", (266, 297), False, 'import rsa\n')] |
RAOdir = r'C:\full\filepath\to\WDRT\examples\data\RAO_data'
outputDir = r'C:\full\filepath\to\WDRT\examples\data\TestData'
import WDRT.mler.mler as mler
# Create the object
Test = mler.mler(H=9.0, T=15.1, numFreq=500)
Test.sim.setup()
# Setup the wave information
Test.waves.setup()
print(Test.waves)
Test.waves... | [
"WDRT.mler.mler.mler"
] | [((188, 225), 'WDRT.mler.mler.mler', 'mler.mler', ([], {'H': '(9.0)', 'T': '(15.1)', 'numFreq': '(500)'}), '(H=9.0, T=15.1, numFreq=500)\n', (197, 225), True, 'import WDRT.mler.mler as mler\n')] |
"""empty message
Revision ID: <KEY>
Revises:
Create Date: 2018-05-03 18:18:27.470606
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alemb... | [
"sqlalchemy.ForeignKeyConstraint",
"sqlalchemy.text",
"sqlalchemy.DateTime",
"alembic.op.drop_table",
"sqlalchemy.PrimaryKeyConstraint",
"sqlalchemy.Integer",
"sqlalchemy.UniqueConstraint",
"sqlalchemy.String"
] | [((6239, 6273), 'alembic.op.drop_table', 'op.drop_table', (['"""ResponseAssertion"""'], {}), "('ResponseAssertion')\n", (6252, 6273), False, 'from alembic import op\n'), ((6278, 6303), 'alembic.op.drop_table', 'op.drop_table', (['"""Response"""'], {}), "('Response')\n", (6291, 6303), False, 'from alembic import op\n'),... |
from dfplt import examplegallery
from pyqtgraph.Qt import QtCore
def test_lineplot_zoom_pan_cursors(qtbot):
eg = examplegallery.Examplegallery()
qtbot.addWidget(eg)
eg.be.setCurrentText("dfplt")
with qtbot.waitSignal(eg.plotReady) as _:
eg.ex.setCurrentText("examples_stepresponse1")
# ope... | [
"pyqtgraph.Qt.QtCore.QPoint",
"dfplt.examplegallery.Examplegallery"
] | [((119, 150), 'dfplt.examplegallery.Examplegallery', 'examplegallery.Examplegallery', ([], {}), '()\n', (148, 150), False, 'from dfplt import examplegallery\n'), ((1593, 1624), 'dfplt.examplegallery.Examplegallery', 'examplegallery.Examplegallery', ([], {}), '()\n', (1622, 1624), False, 'from dfplt import examplegaller... |
# Generated by Django 2.1.1 on 2018-09-30 15:16
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='PawnTransaction',
fields=[
('id', models.Au... | [
"django.db.models.FloatField",
"django.db.models.TextField",
"django.db.models.IntegerField",
"django.db.models.AutoField",
"django.db.models.DateTimeField",
"django.db.models.CharField"
] | [((311, 404), '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", (327, 404), False, 'from django.db import migrations, models\... |
import json
import urllib.parse as urlparse
import threading
import time
from urllib.parse import urlparse
from urllib.parse import parse_qs
from http.server import ThreadingHTTPServer, SimpleHTTPRequestHandler
events = {}
active = False
lock = threading.Lock()
class MyRequestHandler(SimpleHTTPRequestHandler):
d... | [
"json.loads",
"urllib.parse.urlparse",
"threading.Lock",
"json.dumps",
"http.server.SimpleHTTPRequestHandler.end_headers",
"time.sleep",
"urllib.parse.parse_qs"
] | [((247, 263), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (261, 263), False, 'import threading\n'), ((542, 584), 'http.server.SimpleHTTPRequestHandler.end_headers', 'SimpleHTTPRequestHandler.end_headers', (['self'], {}), '(self)\n', (578, 584), False, 'from http.server import ThreadingHTTPServer, SimpleHTTPRe... |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Import
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Import Standard libraries
import joblib # to load and save sklearn models
import os
import tensorflow as tf
import gdown
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Constant... | [
"tensorflow.keras.models.load_model",
"gdown.download",
"joblib.load"
] | [((1550, 1618), 'gdown.download', 'gdown.download', (['(DFLT_MODEL_PATH + self.filepath)', 'output'], {'quiet': '(False)'}), '(DFLT_MODEL_PATH + self.filepath, output, quiet=False)\n', (1564, 1618), False, 'import gdown\n'), ((1652, 1707), 'tensorflow.keras.models.load_model', 'tf.keras.models.load_model', ([], {'filep... |
from flask import request, render_template_string, session, abort, Response
import pathlib
from io import StringIO
class Watch_HTML():
endpoints = ["/webwatch"]
endpoint_name = "page_webwatch_html"
endpoint_access_level = 0
def __init__(self, fhdhr, plugin_utils):
self.fhdhr = fhdhr
... | [
"flask.request.args.get",
"pathlib.Path",
"flask.Response",
"flask.abort",
"io.StringIO"
] | [((482, 492), 'io.StringIO', 'StringIO', ([], {}), '()\n', (490, 492), False, 'from io import StringIO\n'), ((809, 852), 'flask.request.args.get', 'request.args.get', (['"""channel"""', 'None'], {'type': 'str'}), "('channel', None, type=str)\n", (825, 852), False, 'from flask import request, render_template_string, ses... |
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from layers import GraphAttentionLayer
class GAT(nn.Module):
def __init__(self,nfeat,nhid,nclass,dropout,alpha,nheads):
super(GAT,self).__init__()
self.dropout = dropout
self.attentions = [GraphAttentionL... | [
"torch.nn.functional.dropout",
"torch.nn.functional.log_softmax",
"layers.GraphAttentionLayer"
] | [((593, 683), 'layers.GraphAttentionLayer', 'GraphAttentionLayer', (['(nhid * nheads)', 'nclass'], {'dropout': 'dropout', 'alpha': 'alpha', 'concat': '(False)'}), '(nhid * nheads, nclass, dropout=dropout, alpha=alpha,\n concat=False)\n', (612, 683), False, 'from layers import GraphAttentionLayer\n'), ((761, 811), 't... |
import QueueLinkedList as queue
class AVLNode:
def __init__(self, data) -> None:
self.data = data
self.leftChild = None
self.rightChild = None
self.height = 1
def preOrderTraversal(rootNode):
if not rootNode:
return
print(rootNode.data)
preOrderTraversal(rootN... | [
"QueueLinkedList.Queue"
] | [((845, 858), 'QueueLinkedList.Queue', 'queue.Queue', ([], {}), '()\n', (856, 858), True, 'import QueueLinkedList as queue\n')] |
from time import sleep
from machine import Pin, PWM
led = Pin(25, Pin.OUT)
motorD1 = PWM(Pin(6, Pin.OUT))
motorD2 = PWM(Pin(7, Pin.OUT))
motorE1 = PWM(Pin(8, Pin.OUT))
motorE2 = PWM(Pin(9, Pin.OUT))
button = Pin(22, Pin.IN, Pin.PULL_DOWN)
FD = Pin(12, Pin.IN, Pin.PULL_DOWN)
D = Pin(13, Pin.IN, Pin.PULL_DOWN)
E = Pin(... | [
"time.sleep",
"machine.Pin"
] | [((59, 75), 'machine.Pin', 'Pin', (['(25)', 'Pin.OUT'], {}), '(25, Pin.OUT)\n', (62, 75), False, 'from machine import Pin, PWM\n'), ((210, 240), 'machine.Pin', 'Pin', (['(22)', 'Pin.IN', 'Pin.PULL_DOWN'], {}), '(22, Pin.IN, Pin.PULL_DOWN)\n', (213, 240), False, 'from machine import Pin, PWM\n'), ((246, 276), 'machine.P... |
from django import forms
from workflow.models import Workflow
from django.db.models.query import EmptyQuerySet
from django.utils.translation import ugettext_lazy as _
from organization.models import Organization
class WorkflowForm(forms.ModelForm):
class Meta:
model = Workflow
exclude = ('user','data','slug','... | [
"django.forms.CheckboxSelectMultiple",
"django.utils.translation.ugettext_lazy",
"django.db.models.query.EmptyQuerySet",
"django.forms.TextInput"
] | [((485, 502), 'django.forms.TextInput', 'forms.TextInput', ([], {}), '()\n', (500, 502), False, 'from django import forms\n'), ((569, 584), 'django.db.models.query.EmptyQuerySet', 'EmptyQuerySet', ([], {}), '()\n', (582, 584), False, 'from django.db.models.query import EmptyQuerySet\n'), ((592, 606), 'django.utils.tran... |
import os, re, requests
from bs4 import BeautifulSoup
from totalimpact.providers import provider
from totalimpact.providers.provider import Provider, ProviderContentMalformedError, ProviderRateLimitError
import logging
logger = logging.getLogger('ti.providers.linkedin')
class Linkedin(Provider):
example_id = ... | [
"logging.getLogger",
"bs4.BeautifulSoup",
"requests.get"
] | [((230, 272), 'logging.getLogger', 'logging.getLogger', (['"""ti.providers.linkedin"""'], {}), "('ti.providers.linkedin')\n", (247, 272), False, 'import logging\n'), ((2040, 2061), 'bs4.BeautifulSoup', 'BeautifulSoup', (['r.text'], {}), '(r.text)\n', (2053, 2061), False, 'from bs4 import BeautifulSoup\n'), ((1910, 1948... |
'''This project is for getting familiar with spotipy. The data gathered from here will be used for
EDA in the notebook in the same directory as this file.'''
'''Following the example in the docs, we'll pull the names of all the albums created by the
artist Birdy.'''
# spotipy, meant to make integrating requests to th... | [
"os.getenv",
"dotenv.load_dotenv",
"collections.defaultdict",
"spotipy.oauth2.SpotifyOAuth",
"pandas.DataFrame"
] | [((665, 678), 'dotenv.load_dotenv', 'load_dotenv', ([], {}), '()\n', (676, 678), False, 'from dotenv import load_dotenv\n'), ((745, 775), 'os.getenv', 'os.getenv', (['"""SPOTIPY_CLIENT_ID"""'], {}), "('SPOTIPY_CLIENT_ID')\n", (754, 775), False, 'import os\n'), ((800, 825), 'os.getenv', 'os.getenv', (['"""CLIENTSECRET""... |
import subprocess
from new_pytest_needle.engines.base import EngineBase
from PIL import Image
class Engine(EngineBase):
compare_path = "magick compare"
compare_command = (
"{compare} -metric rmse -subimage-search -dissimilarity-threshold 1 {baseline} {new} {diff}"
)
def assertSameFiles(self, ... | [
"subprocess.Popen",
"PIL.Image.open"
] | [((384, 407), 'PIL.Image.open', 'Image.open', (['output_file'], {}), '(output_file)\n', (394, 407), False, 'from PIL import Image\n'), ((431, 456), 'PIL.Image.open', 'Image.open', (['baseline_file'], {}), '(baseline_file)\n', (441, 456), False, 'from PIL import Image\n'), ((1094, 1188), 'subprocess.Popen', 'subprocess.... |
import sys
import os
import re
import logging
import pkgutil
import importlib
import traceback
from collections import OrderedDict
from importlib import import_module
import optparse
from getpass import getpass
from substance import Shell
from substance.exceptions import InvalidCommandError
logger = logging.getLogg... | [
"logging.getLogger",
"traceback.format_exc",
"collections.OrderedDict",
"importlib.import_module",
"optparse.OptionParser._process_long_opt",
"re.match",
"getpass.getpass",
"optparse.OptionParser._process_short_opts",
"sys.exit"
] | [((305, 335), 'logging.getLogger', 'logging.getLogger', (['"""substance"""'], {}), "('substance')\n", (322, 335), False, 'import logging\n'), ((3486, 3498), 'getpass.getpass', 'getpass', (['msg'], {}), '(msg)\n', (3493, 3498), False, 'from getpass import getpass\n'), ((3548, 3567), 'getpass.getpass', 'getpass', (["(msg... |
from __future__ import absolute_import
from textwrap import dedent
class UserError(Exception):
def __init__(self, msg):
self.msg = dedent(msg).strip()
def __unicode__(self):
return self.msg
| [
"textwrap.dedent"
] | [((145, 156), 'textwrap.dedent', 'dedent', (['msg'], {}), '(msg)\n', (151, 156), False, 'from textwrap import dedent\n')] |
import os
import sys
import copy
#import fcntl
import pty
import threading
import subprocess
from lxml import etree
try:
# py2.x
from urllib import pathname2url
from urllib import url2pathname
from urllib import quote
pass
except ImportError:
# py3.x
from urllib.request import pathname2ur... | [
"buttontextareastep.buttontextareastep.__init__",
"gtk.gdk.display_get_default",
"buttontextareastep.buttontextareastep.resetchecklist",
"gtk.Button",
"os.close",
"buttontextareastep.buttontextareastep.do_get_property",
"buttontextareastep.buttontextareastep.do_set_property",
"gobject.timeout_add",
... | [((24850, 24886), 'gobject.type_register', 'gobject.type_register', (['runscriptstep'], {}), '(runscriptstep)\n', (24871, 24886), False, 'import gobject\n'), ((720, 752), 'gi.require_version', 'gi.require_version', (['"""Gtk"""', '"""3.0"""'], {}), "('Gtk', '3.0')\n", (738, 752), False, 'import gi\n'), ((5083, 5142), '... |
from django.test import TestCase, RequestFactory
from .mixins import TwoUserMixin, ProposalGroupMixin, ViewMixin
from consensus_engine.views import EditProposalGroupView
from consensus_engine.forms import ProposalGroupForm
from consensus_engine.models import ProposalGroup
from django.core.exceptions import PermissionDe... | [
"django.test.RequestFactory",
"consensus_engine.models.ProposalGroup.objects.count",
"consensus_engine.models.ProposalGroup.objects.filter"
] | [((591, 607), 'django.test.RequestFactory', 'RequestFactory', ([], {}), '()\n', (605, 607), False, 'from django.test import TestCase, RequestFactory\n'), ((1151, 1204), 'consensus_engine.models.ProposalGroup.objects.filter', 'ProposalGroup.objects.filter', ([], {'group_name': '"""test group"""'}), "(group_name='test gr... |
import numpy as np
#https://github.com/Robonchu/PythonSimpleManipulation
def skew_mat(vector):
mat = np.zeros((3, 3))
mat[0, 1] = -vector[2]
mat[0, 2] = vector[1]
mat[1, 0] = vector[2]
mat[1, 2] = -vector[0]
mat[2, 0] = -vector[1]
mat[2, 1] = vector[0]
return mat
def rodrigues_mat(vec... | [
"numpy.sin",
"numpy.eye",
"numpy.zeros",
"numpy.cos"
] | [((107, 123), 'numpy.zeros', 'np.zeros', (['(3, 3)'], {}), '((3, 3))\n', (115, 123), True, 'import numpy as np\n'), ((572, 581), 'numpy.eye', 'np.eye', (['(3)'], {}), '(3)\n', (578, 581), True, 'import numpy as np\n'), ((597, 619), 'numpy.zeros', 'np.zeros', (['(dof + 2, 3)'], {}), '((dof + 2, 3))\n', (605, 619), True,... |
import json
import os
import sys
import time
import RPi.GPIO as GPIO
GPIO.setwarnings(False)
with open(os.path.abspath('../config/pumps.json')) as f:
pump_config = json.load(f)
GPIO.setmode(GPIO.BCM)
for i, config in enumerate(pump_config):
GPIO.setup(config['pin'], GPIO.OUT, initial=GPIO.HIGH)
pump_i = int... | [
"RPi.GPIO.output",
"RPi.GPIO.setup",
"RPi.GPIO.setwarnings",
"time.sleep",
"json.load",
"os.path.abspath",
"RPi.GPIO.setmode"
] | [((70, 93), 'RPi.GPIO.setwarnings', 'GPIO.setwarnings', (['(False)'], {}), '(False)\n', (86, 93), True, 'import RPi.GPIO as GPIO\n'), ((184, 206), 'RPi.GPIO.setmode', 'GPIO.setmode', (['GPIO.BCM'], {}), '(GPIO.BCM)\n', (196, 206), True, 'import RPi.GPIO as GPIO\n'), ((587, 613), 'RPi.GPIO.output', 'GPIO.output', (['pin... |
# -*- coding: utf-8 -*-
from django import forms
from django.contrib.auth.models import Group
from guardian.shortcuts import get_perms_for_model
from apps.dashboard.forms import HTML5RequiredMixin
from apps.dashboard.widgets import (
DatePickerInput,
DatetimePickerInput,
multiple_widget_generator,
)
from ... | [
"apps.dashboard.widgets.multiple_widget_generator",
"apps.feedback.models.Feedback.objects.filter",
"django.contrib.auth.models.Group.objects.filter",
"guardian.shortcuts.get_perms_for_model"
] | [((2068, 2105), 'apps.dashboard.widgets.multiple_widget_generator', 'multiple_widget_generator', (['widgetlist'], {}), '(widgetlist)\n', (2093, 2105), False, 'from apps.dashboard.widgets import DatePickerInput, DatetimePickerInput, multiple_widget_generator\n'), ((2912, 2949), 'apps.dashboard.widgets.multiple_widget_ge... |
# -*- coding: utf-8 -*-
import numpy as np
def Chapman(Q, b_LH, a, return_exceed=False):
"""Chapman filter (Chapman, 1991)
Args:
Q (np.array): streamflow
a (float): recession coefficient
"""
b = [b_LH[0]]
x = b_LH[0]
for i in range(Q.shape[0] - 1):
x = (3 * a - 1) / (3... | [
"numpy.count_nonzero",
"numpy.array"
] | [((398, 409), 'numpy.array', 'np.array', (['b'], {}), '(b)\n', (406, 409), True, 'import numpy as np\n'), ((515, 537), 'numpy.count_nonzero', 'np.count_nonzero', (['mask'], {}), '(mask)\n', (531, 537), True, 'import numpy as np\n')] |
import os.path
from bt_utils.console import Console
from bt_utils.get_content import content_dir
SHL = Console("BundestagsBot Template Command") # Use SHL.output(text) for all console based output!
settings = {
'name': 'template', # name/invoke of your command
'mod_cmd': True, # if this cmd is only useabl... | [
"bt_utils.console.Console"
] | [((105, 146), 'bt_utils.console.Console', 'Console', (['"""BundestagsBot Template Command"""'], {}), "('BundestagsBot Template Command')\n", (112, 146), False, 'from bt_utils.console import Console\n')] |
#!/usr/bin/env python
# Copyright 2020 Johns Hopkins University (Author: <NAME>)
# Apache 2.0
# This script is based on the Bayesian HMM-based xvector clustering
# code released by BUTSpeech at: https://github.com/BUTSpeechFIT/VBx.
# Note that this assumes that the provided labels are for a single
# recording. So this... | [
"re.split",
"numpy.sqrt",
"numpy.ones",
"argparse.ArgumentParser",
"kaldi_io.read_plda",
"kaldi_io.read_vec_flt_ark",
"numpy.max",
"numpy.argsort",
"numpy.array",
"numpy.zeros",
"VB_diarization.VB_diarization",
"scipy.special.softmax"
] | [((679, 881), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""This script performs Bayesian HMM-based\n clustering of x-vectors for one recording"""', 'formatter_class': 'argparse.ArgumentDefaultsHelpFormatter'}), '(description=\n """This script performs Bayesian HMM-based\n... |
# encoding: utf-8
# Project: iNatExchangeTools
# Credits: <NAME>, <NAME>
# © NatureServe Canada 2021 under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)
# Program: iNatExchangeUtils.py
# Code shared by ArcGIS Python tools in the iNatExchange Tools Python Toolbox
import arcpy
prov_dict = {'AC': 'Atlanti... | [
"arcpy.Describe"
] | [((1857, 1878), 'arcpy.Describe', 'arcpy.Describe', (['table'], {}), '(table)\n', (1871, 1878), False, 'import arcpy\n'), ((2034, 2055), 'arcpy.Describe', 'arcpy.Describe', (['table'], {}), '(table)\n', (2048, 2055), False, 'import arcpy\n')] |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Sep 11 15:30:58 2020
@author: apple
"""
import torch
from torch.autograd import Variable
tensor = torch.FloatTensor([[1,2],[3,4]])
variable = Variable(tensor,requires_grad=True)
print(tensor)
print(variable)
| [
"torch.autograd.Variable",
"torch.FloatTensor"
] | [((167, 202), 'torch.FloatTensor', 'torch.FloatTensor', (['[[1, 2], [3, 4]]'], {}), '([[1, 2], [3, 4]])\n', (184, 202), False, 'import torch\n'), ((211, 247), 'torch.autograd.Variable', 'Variable', (['tensor'], {'requires_grad': '(True)'}), '(tensor, requires_grad=True)\n', (219, 247), False, 'from torch.autograd impor... |
from copy import copy
import numpy as np
from gym_chess import ChessEnvV1
from gym_chess.envs.chess_v1 import (
KING_ID,
QUEEN_ID,
ROOK_ID,
BISHOP_ID,
KNIGHT_ID,
PAWN_ID,
)
from gym_chess.test.utils import run_test_funcs
# Blank board
BASIC_BOARD = np.array([[0] * 8] * 8, dtype=np.int8)
# Pa... | [
"gym_chess.test.utils.run_test_funcs",
"numpy.array",
"copy.copy",
"gym_chess.ChessEnvV1"
] | [((276, 314), 'numpy.array', 'np.array', (['([[0] * 8] * 8)'], {'dtype': 'np.int8'}), '([[0] * 8] * 8, dtype=np.int8)\n', (284, 314), True, 'import numpy as np\n'), ((380, 397), 'copy.copy', 'copy', (['BASIC_BOARD'], {}), '(BASIC_BOARD)\n', (384, 397), False, 'from copy import copy\n'), ((461, 509), 'gym_chess.ChessEnv... |
from arcgis import GIS
from arcgis.features import GeoAccessor, GeoSeriesAccessor
import arcpy
from arcpy import env
from arcpy.sa import *
import numpy as np
import os
import pandas as pd
#####
arcpy.env.overwriteOutput = True
arcpy.CheckOutExtension("Spatial")
def select_feature_by_attributes_arcgis(input,Attri_NM... | [
"numpy.logical_and",
"arcpy.Select_analysis",
"arcpy.CheckOutExtension",
"pandas.merge",
"os.path.join",
"numpy.isin",
"pandas.DataFrame.spatial.from_featureclass"
] | [((230, 264), 'arcpy.CheckOutExtension', 'arcpy.CheckOutExtension', (['"""Spatial"""'], {}), "('Spatial')\n", (253, 264), False, 'import arcpy\n'), ((659, 709), 'arcpy.Select_analysis', 'arcpy.Select_analysis', (['input', 'output', 'where_clause'], {}), '(input, output, where_clause)\n', (680, 709), False, 'import arcp... |
#!/usr/bin/env python2
import tempfile
import sys
import os.path
import ssg.shims
svg_benchmark = """<?xml version="1.0"?>
<Benchmark xmlns="http://checklists.nist.gov/xccdf/1.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
id="RHEL-6" resolved="1" xml:lang="en-US">
<status date="20... | [
"sys.exit",
"tempfile.NamedTemporaryFile"
] | [((1180, 1209), 'tempfile.NamedTemporaryFile', 'tempfile.NamedTemporaryFile', ([], {}), '()\n', (1207, 1209), False, 'import tempfile\n'), ((1471, 1508), 'sys.exit', 'sys.exit', (["(0 if 'circle' in out else 1)"], {}), "(0 if 'circle' in out else 1)\n", (1479, 1508), False, 'import sys\n')] |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.utils import weight_norm
from Models.AutoEncoder import create_layer
def create_encoder_block(in_channels, out_channels, kernel_size, wn=True, bn=True,
activation=nn.ReLU, layers=2):
encoder = []
for i in range(l... | [
"torch.nn.Sequential",
"torch.nn.functional.avg_pool2d",
"Models.AutoEncoder.create_layer",
"torch.nn.functional.interpolate",
"torch.cat"
] | [((535, 558), 'torch.nn.Sequential', 'nn.Sequential', (['*encoder'], {}), '(*encoder)\n', (548, 558), True, 'import torch.nn as nn\n'), ((1177, 1200), 'torch.nn.Sequential', 'nn.Sequential', (['*decoder'], {}), '(*decoder)\n', (1190, 1200), True, 'import torch.nn as nn\n'), ((1676, 1699), 'torch.nn.Sequential', 'nn.Seq... |
from contextlib import closing
from datetime import timedelta
from http import HTTPStatus
from http.server import BaseHTTPRequestHandler, HTTPServer
import json
import re
import socket
from threading import Thread
TEST_ACCESS_TOKEN = '<PASSWORD>access_token'
class MockSpotifyRequestHandler(BaseHTTPRequestHandler):
... | [
"socket.socket",
"re.compile",
"json.dumps",
"http.server.HTTPServer",
"threading.Thread",
"datetime.timedelta",
"re.search"
] | [((339, 363), 're.compile', 're.compile', (['"""/api/token"""'], {}), "('/api/token')\n", (349, 363), False, 'import re\n'), ((1266, 1306), 'http.server.HTTPServer', 'HTTPServer', (["('localhost', port)", 'handler'], {}), "(('localhost', port), handler)\n", (1276, 1306), False, 'from http.server import BaseHTTPRequestH... |
from breidablik.interpolate.spectra import Spectra
import numpy as np
import pytest
import warnings
try:
Spectra()
flag = False
except:
flag = True
# skip these tests if the trained models are not present
pytestmark = pytest.mark.skipif(flag, reason = 'No trained Spectra model')
class Test_find_abund:
... | [
"warnings.catch_warnings",
"breidablik.interpolate.spectra.Spectra",
"numpy.linspace",
"pytest.raises",
"pytest.mark.skipif",
"warnings.simplefilter"
] | [((231, 290), 'pytest.mark.skipif', 'pytest.mark.skipif', (['flag'], {'reason': '"""No trained Spectra model"""'}), "(flag, reason='No trained Spectra model')\n", (249, 290), False, 'import pytest\n'), ((110, 119), 'breidablik.interpolate.spectra.Spectra', 'Spectra', ([], {}), '()\n', (117, 119), False, 'from breidabli... |
import asyncio
import threading
import time
import os
import matplotlib.pyplot as plt
import numpy as np
from matplotlib import colors
from matplotlib.ticker import PercentFormatter
import plotly.plotly as py
import pandas as pd
from dquant.scripts.basic_units import cm, inch
import copy
curPath = os.path.abspath(os.p... | [
"os.sys.path.append",
"os.path.split",
"os.path.dirname",
"matplotlib.pyplot.tight_layout",
"copy.deepcopy",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show"
] | [((418, 446), 'os.sys.path.append', 'os.sys.path.append', (['rootPath'], {}), '(rootPath)\n', (436, 446), False, 'import os\n'), ((316, 341), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (331, 341), False, 'import os\n'), ((354, 376), 'os.path.split', 'os.path.split', (['curPath'], {}), '(c... |
# -*- encoding: utf8 -*-
import glob
import io
import re
from os.path import basename
from os.path import dirname
from os.path import join
from os.path import splitext
from setuptools import find_packages
from setuptools import setup
def read(*names, **kwargs):
return io.open(
join(dirname(__file__), *nam... | [
"os.path.dirname",
"setuptools.find_packages",
"os.path.basename",
"glob.glob"
] | [((771, 791), 'setuptools.find_packages', 'find_packages', (['"""src"""'], {}), "('src')\n", (784, 791), False, 'from setuptools import find_packages\n'), ((872, 893), 'glob.glob', 'glob.glob', (['"""src/*.py"""'], {}), "('src/*.py')\n", (881, 893), False, 'import glob\n'), ((297, 314), 'os.path.dirname', 'dirname', ([... |
import cv2
from glfw.GLFW import *
from OpenGL.GL import *
from PIL import Image
from model.loader import *
from model.model import *
from shader import *
from tool.gui import *
from tool.mmath import *
from tool.color import *
shaderProp = {
'renderprop': DProp({
'isvisible': True,
'img': 0,
... | [
"PIL.Image.fromarray",
"cv2.VideoCapture",
"cv2.cvtColor"
] | [((1148, 1167), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (1164, 1167), False, 'import cv2\n'), ((4603, 4642), 'cv2.cvtColor', 'cv2.cvtColor', (['frame', 'cv2.COLOR_BGR2RGBA'], {}), '(frame, cv2.COLOR_BGR2RGBA)\n', (4615, 4642), False, 'import cv2\n'), ((4662, 4682), 'PIL.Image.fromarray', 'Image.... |
from scipy.signal import butter
from helper import ULogHelper
class DiagnoseFailure:
def __init__(self, ulog):
data_parser = ULogHelper(ulog)
data_parser.extractRequiredMessages(['estimator_status', 'vehicle_status'])
def change_diagnose(self, timestamps, flags, flag_type):
if fl... | [
"helper.ULogHelper"
] | [((140, 156), 'helper.ULogHelper', 'ULogHelper', (['ulog'], {}), '(ulog)\n', (150, 156), False, 'from helper import ULogHelper\n'), ((3233, 3249), 'helper.ULogHelper', 'ULogHelper', (['ulog'], {}), '(ulog)\n', (3243, 3249), False, 'from helper import ULogHelper\n')] |
import pickle
import readline
with open('data/table.pkl', 'rb') as f:
table = pickle.load(f)
with open('data/freq.pkl', 'rb') as f:
freq = pickle.load(f)
with open('data/rev.pkl', 'rb') as f:
rev = pickle.load(f)
def query_keys(keys):
if keys[0] == 'r':
keys = keys[1:]
if keys in re... | [
"pickle.load"
] | [((83, 97), 'pickle.load', 'pickle.load', (['f'], {}), '(f)\n', (94, 97), False, 'import pickle\n'), ((149, 163), 'pickle.load', 'pickle.load', (['f'], {}), '(f)\n', (160, 163), False, 'import pickle\n'), ((213, 227), 'pickle.load', 'pickle.load', (['f'], {}), '(f)\n', (224, 227), False, 'import pickle\n')] |
# https://leetcode.com/problems/palindrome-partitioning-ii/description/
#
# algorithms
# Hard (25.94%)
# Total Accepted: 91k
# Total Submissions: 350.8k
# beats 27.12% of python submissions
# 我自己是用BFS,去记录每一个回文串,直到触达str尾部
from collections import deque
class Solution(object):
def minCut(self, s):
"""
... | [
"collections.deque"
] | [((483, 498), 'collections.deque', 'deque', (['[(0, 0)]'], {}), '([(0, 0)])\n', (488, 498), False, 'from collections import deque\n')] |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: AddressBook.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _r... | [
"google.protobuf.symbol_database.Default",
"google.protobuf.descriptor.FieldDescriptor",
"google.protobuf.descriptor.EnumValueDescriptor"
] | [((484, 510), 'google.protobuf.symbol_database.Default', '_symbol_database.Default', ([], {}), '()\n', (508, 510), True, 'from google.protobuf import symbol_database as _symbol_database\n'), ((1576, 1672), 'google.protobuf.descriptor.EnumValueDescriptor', '_descriptor.EnumValueDescriptor', ([], {'name': '"""PT_NONE"""'... |
import pyperclip
import string
import secrets
global user_list
class User:
'''
class that will create accounts for users
'''
user_list = []
def __init__(self, login_name, password):
self.login_name = login_name
self.password = password
def save_user(self):
'''
... | [
"secrets.choice"
] | [((885, 909), 'secrets.choice', 'secrets.choice', (['alphabet'], {}), '(alphabet)\n', (899, 909), False, 'import secrets\n')] |
"""Test coordinates module."""
from pyvims.coordinates import salt, slat, slon, slon_e, slon_w
def test_lon():
"""Test longitude string."""
assert slon(0) == slon(.001) == slon(-.001) == slon(360) == '0°'
assert slon(180) == slon(180.001) == slon(-180) == '180°'
assert slon(90) == slon(-270) == '90°W... | [
"pyvims.coordinates.slon_w",
"pyvims.coordinates.salt",
"pyvims.coordinates.slon_e",
"pyvims.coordinates.slon",
"pyvims.coordinates.slat"
] | [((158, 165), 'pyvims.coordinates.slon', 'slon', (['(0)'], {}), '(0)\n', (162, 165), False, 'from pyvims.coordinates import salt, slat, slon, slon_e, slon_w\n'), ((169, 180), 'pyvims.coordinates.slon', 'slon', (['(0.001)'], {}), '(0.001)\n', (173, 180), False, 'from pyvims.coordinates import salt, slat, slon, slon_e, s... |
# Copyright (c) 2017 OpenStack Foundation.
#
# 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 ... | [
"re.compile"
] | [((1183, 1295), 're.compile', 're.compile', (['"""(.)*assertTrue\\\\(isinstance\\\\((\\\\w|\\\\.|\\\\\'|\\\\"|\\\\[|\\\\])+, (\\\\w|\\\\.|\'|"|\\\\[|\\\\])+\\\\)\\\\)"""'], {}), '(\n \'(.)*assertTrue\\\\(isinstance\\\\((\\\\w|\\\\.|\\\\\\\'|\\\\"|\\\\[|\\\\])+, (\\\\w|\\\\.|\\\'|"|\\\\[|\\\\])+\\\\)\\\\)\'\n )\n'... |
from bench_db import get_timings_by_id
from bench_graphs import do_warmup_plot
num_iter = 7
color_copy_by_ref = 'green'
name = 'native-'
def warmup_all_plots():
warmup_plot_fannkuch()
warmup_plot_spectralnorm()
warmup_plot_bintree()
def warmup_plot_fannkuch():
ids = [
100 # fannkuchredux-... | [
"bench_graphs.do_warmup_plot",
"bench_db.get_timings_by_id"
] | [((968, 1076), 'bench_graphs.do_warmup_plot', 'do_warmup_plot', (['"""fannkuchredux \ncopy-by-val"""', 'runs'], {'num_iter': 'num_iter', 'subtitle': '""""""', 'file_prefix': 'name'}), '("""fannkuchredux \ncopy-by-val""", runs, num_iter=num_iter,\n subtitle=\'\', file_prefix=name)\n', (982, 1076), False, 'from bench_... |
import sys
sys.path.append('.')
import pandas as pd
def date_str_func(suffix):
return f"./data/ticker-news_data_{suffix}.csv"
def data_pull(date_var):
filename = date_str_func(date_var)
data_crypto_news = pd.read_csv(filename)
data_crypto_news = data_crypto_news[data_crypto_news["tickers"].... | [
"pandas.to_datetime",
"sys.path.append",
"pandas.read_csv"
] | [((11, 31), 'sys.path.append', 'sys.path.append', (['"""."""'], {}), "('.')\n", (26, 31), False, 'import sys\n'), ((230, 251), 'pandas.read_csv', 'pd.read_csv', (['filename'], {}), '(filename)\n', (241, 251), True, 'import pandas as pd\n'), ((361, 439), 'pandas.to_datetime', 'pd.to_datetime', (["data_crypto_news['date'... |
import os
from django.db import transaction
import csv
from django.core.management.base import BaseCommand, CommandError
from api.models import Country
def get_bool(value):
if value == 't':
return True
elif value == 'f':
return False
else:
return None
def get_int(value):
# pri... | [
"os.path.exists",
"csv.DictReader",
"api.models.Country.objects.all",
"api.models.Country.objects.get",
"api.models.Country"
] | [((1507, 1531), 'os.path.exists', 'os.path.exists', (['filename'], {}), '(filename)\n', (1521, 1531), False, 'import os\n'), ((1692, 1715), 'csv.DictReader', 'csv.DictReader', (['csvfile'], {}), '(csvfile)\n', (1706, 1715), False, 'import csv\n'), ((2746, 2780), 'api.models.Country.objects.get', 'Country.objects.get', ... |
#!/usr/bin/env python
'''
API入口
不包含任何业务逻辑
'''
from datetime import timedelta
from os import environ
from flask_jwt_extended import JWTManager
from model.db import (database, User, Demand, Release, Activity,
ActivityMember, Project, ProjectMember, TestCase,
TestSet, Case_Set,... | [
"model.db.database.close",
"flask_jwt_extended.JWTManager",
"model.db.database.connect",
"connexion.App",
"flask_graphql.GraphQLView.as_view",
"model.db.database.create_tables",
"datetime.timedelta",
"model.db.database.is_closed",
"flask.jsonify"
] | [((575, 627), 'connexion.App', 'connexion.App', (['__name__'], {'specification_dir': '"""../docs"""'}), "(__name__, specification_dir='../docs')\n", (588, 627), False, 'import connexion\n'), ((1231, 1248), 'datetime.timedelta', 'timedelta', ([], {'days': '(7)'}), '(days=7)\n', (1240, 1248), False, 'from datetime import... |
import pysolr
import requests
import logging
import ctypes
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger(__name__)
def doc_key(dataset_id, file_name):
return ctypes.c_size_t(hash(f'{dataset_id}{file_name}')).value
class DatasetIngestionHistorySolr:
_solr = None
_collection_name =... | [
"logging.basicConfig",
"pysolr.Solr",
"logging.getLogger",
"requests.session"
] | [((61, 101), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG'}), '(level=logging.DEBUG)\n', (80, 101), False, 'import logging\n'), ((111, 138), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (128, 138), False, 'import logging\n'), ((550, 600), 'pysolr.Solr', 'p... |
from django import forms
from django.views.generic.list import MultipleObjectMixin
from django.utils.translation import gettext as _
from selia_templates.views.search_filter import SearchFilter
class SearchForm(forms.Form):
search = forms.CharField(
label=_('search'),
max_length=100,
requ... | [
"django.utils.translation.gettext"
] | [((271, 282), 'django.utils.translation.gettext', '_', (['"""search"""'], {}), "('search')\n", (272, 282), True, 'from django.utils.translation import gettext as _\n'), ((2369, 2382), 'django.utils.translation.gettext', '_', (['"""ordering"""'], {}), "('ordering')\n", (2370, 2382), True, 'from django.utils.translation ... |
def main():
H, W = map(int, input().split())
C = []
for i in range(H):
row = list(input())
C.append(row)
for i in range(H):
for j in range(W):
if C[i][j] == "s":
sx = i
sy = j
if C[i][j] == "g":
gx = i
... | [
"collections.deque"
] | [((389, 396), 'collections.deque', 'deque', ([], {}), '()\n', (394, 396), False, 'from collections import deque\n')] |
#!/usr/bin/env python3
from __future__ import print_function
import os
import pythondata_cpu_cv32e41p
print("Found cv32e41p @ version", pythondata_cpu_cv32e41p.version_str, "(with data", pythondata_cpu_cv32e41p.data_version_str, ")")
print()
print("Data is in", pythondata_cpu_cv32e41p.data_location)
assert os.path.... | [
"os.path.exists",
"os.path.join",
"os.walk"
] | [((312, 365), 'os.path.exists', 'os.path.exists', (['pythondata_cpu_cv32e41p.data_location'], {}), '(pythondata_cpu_cv32e41p.data_location)\n', (326, 365), False, 'import os\n'), ((599, 645), 'os.walk', 'os.walk', (['pythondata_cpu_cv32e41p.data_location'], {}), '(pythondata_cpu_cv32e41p.data_location)\n', (606, 645), ... |
""" Git Feed views """
from app.logic.httpcommon import res
from app.logic.gitrepo.models.GitProjectModel import GitProjectEntry
from app.logic.gitrepo.models.GitBranchModel import GitBranchEntry
from app.logic.gitrepo.models.GitCommitModel import GitCommitEntry
from app.logic.gitrepo.models.GitBranchMergeTargetModel ... | [
"app.logic.gitrepo.models.GitBranchModel.GitBranchEntry.objects.filter",
"app.logic.gitrepo.models.GitProjectModel.GitProjectEntry.objects.filter",
"app.logic.gitrepo.models.GitCommitModel.GitCommitEntry.objects.filter",
"app.logic.httpcommon.res.get_response",
"app.logic.gitrepo.models.GitBranchMergeTarget... | [((1235, 1263), 'app.logic.httpcommon.res.get_only_get_allowed', 'res.get_only_get_allowed', (['{}'], {}), '({})\n', (1259, 1263), False, 'from app.logic.httpcommon import res\n'), ((1793, 1821), 'app.logic.httpcommon.res.get_only_get_allowed', 'res.get_only_get_allowed', (['{}'], {}), '({})\n', (1817, 1821), False, 'f... |
# -*- coding: utf-8 -*-
import pytest
@pytest.fixture(scope="module")
def master_of_masters(request, salt_factories):
"""
This is the master of all masters, top of the chain
"""
return salt_factories.spawn_master(request, "master-of-masters", order_masters=True)
@pytest.fixture(scope="module")
def m... | [
"pytest.fixture",
"pytest.mark.skip"
] | [((41, 71), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (55, 71), False, 'import pytest\n'), ((284, 314), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (298, 314), False, 'import pytest\n'), ((582, 612), 'pytest.fixture', 'pytes... |
import os
import sys
import cv2
import math
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import scipy.misc as sic
class Cube2Equirec(nn.Module):
def __init__(self, cube_length, equ_h):
super().__init__()
self.cube_length =... | [
"numpy.tile",
"torch.nn.functional.grid_sample",
"numpy.asarray",
"numpy.min",
"torch.FloatTensor",
"numpy.array",
"numpy.dot",
"cv2.Rodrigues",
"numpy.cos",
"numpy.concatenate",
"numpy.argmin",
"numpy.sin",
"numpy.meshgrid",
"torch.BoolTensor",
"torch.zeros",
"numpy.arange",
"matplo... | [((3423, 3433), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (3431, 3433), True, 'import matplotlib.pyplot as plt\n'), ((566, 589), 'numpy.meshgrid', 'np.meshgrid', (['theta', 'phi'], {}), '(theta, phi)\n', (577, 589), True, 'import numpy as np\n'), ((642, 653), 'numpy.sin', 'np.sin', (['phi'], {}), '(phi)\n... |
# -*- coding: utf-8 -*-
from karlooper.config import get_global_conf
from karlooper.web.request import Request
__author__ = "<EMAIL>"
class MessageHandler(Request):
def get(self):
redis_manager = get_global_conf("redis")
value = redis_manager.get_value()
result = {
"status": ... | [
"karlooper.config.get_global_conf"
] | [((212, 236), 'karlooper.config.get_global_conf', 'get_global_conf', (['"""redis"""'], {}), "('redis')\n", (227, 236), False, 'from karlooper.config import get_global_conf\n'), ((625, 649), 'karlooper.config.get_global_conf', 'get_global_conf', (['"""redis"""'], {}), "('redis')\n", (640, 649), False, 'from karlooper.co... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2018-02-05 20:05
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
replaces = [
("oauth2", "0004_application_allow_access_by_email_suffix"),
("oauth2", "0005_auto_2018020... | [
"django.db.models.CharField"
] | [((582, 908), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'help_text': '"""A comma separated list of email domains, e.g. "mobile.ukti.gov.uk, trade.gsi.gov.uk, fco.gov.uk" User\'s with an email in this list will be given access. NOTE: all user emails are checked - including aliases."""',... |
# Author: <NAME> 2020 (<EMAIL>)
# Author: <NAME> 2020 (<EMAIL>)
# Author: <NAME> 2020 (<EMAIL>)
# Author: <NAME> 2020 (<EMAIL>)
# Copyright (c) 2020- Max Planck Institute of Molecular Physiology
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this program and associated documentati... | [
"os.path.exists",
"argparse.ArgumentParser",
"pandas.read_csv",
"re.match",
"re.findall",
"re.finditer",
"io.StringIO",
"pandas.concat",
"re.search"
] | [((21610, 21635), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (21633, 21635), False, 'import argparse\n'), ((5603, 5620), 'io.StringIO', 'StringIO', (['content'], {}), '(content)\n', (5611, 5620), False, 'from io import StringIO\n'), ((6263, 6313), 're.finditer', 're.finditer', (['"""^data_(... |
#!/usr/bin/env python3
import pytest
import sys
import fileinput
from os.path import splitext, abspath
F_NAME = splitext(abspath(__file__))[0][:-1]
def print_boards(boards):
for b in boards:
print_board(b)
def print_board(b):
for i in range(5):
print(' '.join(f'{c:>2}' for c in b[i*5:(i*5)+5]))... | [
"os.path.abspath",
"fileinput.input"
] | [((2400, 2433), 'fileinput.input', 'fileinput.input', (["(F_NAME + '.test')"], {}), "(F_NAME + '.test')\n", (2415, 2433), False, 'import fileinput\n'), ((2553, 2587), 'fileinput.input', 'fileinput.input', (["(F_NAME + '.input')"], {}), "(F_NAME + '.input')\n", (2568, 2587), False, 'import fileinput\n'), ((121, 138), 'o... |
# Python stdlib
import os
# our imports
from dsrt.config import Configuration
from dsrt.config.defaults import DataConfig, ModelConfig, ConversationConfig
from dsrt.config.validation import DataConfigValidator, ModelConfigValidator, ConversationConfigValidator
class ConfigurationLoader:
def __init__(self, path):
... | [
"dsrt.config.defaults.DataConfig",
"os.path.exists",
"dsrt.config.validation.ConversationConfigValidator",
"os.path.splitext",
"dsrt.config.defaults.ModelConfig",
"dsrt.config.validation.ModelConfigValidator",
"dsrt.config.Configuration",
"dsrt.config.validation.DataConfigValidator",
"dsrt.config.de... | [((377, 389), 'dsrt.config.defaults.DataConfig', 'DataConfig', ([], {}), '()\n', (387, 389), False, 'from dsrt.config.defaults import DataConfig, ModelConfig, ConversationConfig\n'), ((418, 431), 'dsrt.config.defaults.ModelConfig', 'ModelConfig', ([], {}), '()\n', (429, 431), False, 'from dsrt.config.defaults import Da... |
import pytest
import threading
import asyncio
from opentrons.hardware_control.emulation.app import run
@pytest.fixture(scope="session")
def emulation_app():
"""Run the emulators"""
def runit():
asyncio.run(run())
# TODO 20210219
# The emulators must be run in a separate thread because our ser... | [
"pytest.fixture",
"threading.Thread",
"opentrons.hardware_control.emulation.app.run"
] | [((106, 137), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (120, 137), False, 'import pytest\n'), ((425, 455), 'threading.Thread', 'threading.Thread', ([], {'target': 'runit'}), '(target=runit)\n', (441, 455), False, 'import threading\n'), ((224, 229), 'opentrons.hardware... |
from KEYWORDS.KEYVAR import VAR_STACK
import os
class b:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKCYAN = '\033[96m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
class LENGTH:
# number of items list
de... | [
"os._exit"
] | [((598, 609), 'os._exit', 'os._exit', (['(0)'], {}), '(0)\n', (606, 609), False, 'import os\n')] |
#!/usr/bin/env python3
import os
import sys
import textwrap
MAIN_HEADER = """
+----------------------------------+---------------------------------------------------------+--------------------+
| parameter | description | default value |
+=======... | [
"os.path.dirname",
"os.walk"
] | [((3519, 3535), 'os.walk', 'os.walk', (['top_dir'], {}), '(top_dir)\n', (3526, 3535), False, 'import os\n'), ((1166, 1185), 'os.path.dirname', 'os.path.dirname', (['pf'], {}), '(pf)\n', (1181, 1185), False, 'import os\n')] |
import math
import re
import os
import numpy as np
from torch.utils.data import Dataset
class SutskeverDataset(Dataset):
"""
Loads from folder 'path' the dataset generated with 'dataset_generation.py'
as numpy.ndarray.
Expects one .npy file for sequence and returns numpy.ndarrays with shape
(tim... | [
"os.path.exists",
"os.listdir",
"re.compile",
"os.path.join",
"math.sqrt",
"os.path.isdir",
"numpy.load"
] | [((810, 826), 'os.listdir', 'os.listdir', (['path'], {}), '(path)\n', (820, 826), False, 'import os\n'), ((1037, 1063), 're.compile', 're.compile', (['filename_regex'], {}), '(filename_regex)\n', (1047, 1063), False, 'import re\n'), ((1382, 1424), 'os.path.join', 'os.path.join', (['self._path', 'self._files[key]'], {})... |
#!/usr/bin/python3
# misc imports
# import pprint
import os
import csv
import json
import logging
import datetime
from django.utils import timezone
from app.stock_utils import StockUtils
# db imports
from app.models import stocks_held
from app.models import options_held
from app.models import portfolio_summary
from a... | [
"app.models.options_held.objects.all",
"django.utils.timezone.timedelta",
"app.models.robinhood_stock_split_events.objects.filter",
"app.stock_utils.StockUtils.getHistoryData",
"datetime.timedelta",
"logging.error",
"app.stock_utils.StockUtils.is_market_holiday",
"app.models.stocks_held.objects.all",
... | [((645, 708), 'logging.basicConfig', 'logging.basicConfig', ([], {'filename': 'LOG_FILENAME', 'level': 'logging.ERROR'}), '(filename=LOG_FILENAME, level=logging.ERROR)\n', (664, 708), False, 'import logging\n'), ((1186, 1217), 'app.models.portfolio_summary.objects.all', 'portfolio_summary.objects.all', ([], {}), '()\n'... |
"""
Plots figure S5:
yt correlation of zonal-mean downward long wave radiation at the surface (top)
and longwave cloud radiative forcing at the surface (bottom)
with vertically and zonally integrated eddy moisture transport at 70N for
(left) reanalysis data (left) and aquaplanet control simulation data (right).
"""
... | [
"matplotlib.pyplot.savefig",
"numpy.arange",
"numpy.swapaxes",
"numpy.array",
"xarray.open_dataset",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.show"
] | [((1001, 1027), 'xarray.open_dataset', 'xr.open_dataset', (['filename1'], {}), '(filename1)\n', (1016, 1027), True, 'import xarray as xr\n'), ((1042, 1068), 'xarray.open_dataset', 'xr.open_dataset', (['filename2'], {}), '(filename2)\n', (1057, 1068), True, 'import xarray as xr\n'), ((1600, 1626), 'xarray.open_dataset',... |
# Sprite classes for platform game
import pygame
import random
from settings import *
vec = pygame.math.Vector2
class Spritesheet1:
# Utility class for loading and parsing spritesheets
def __init__(self, filename):
self.spritesheet1 = pygame.image.load(filename).convert()
def get_image(self, x, ... | [
"pygame.transform.flip",
"random.choice",
"pygame.time.get_ticks",
"pygame.sprite.spritecollide",
"pygame.Surface",
"pygame.mask.from_surface",
"pygame.sprite.Sprite.__init__",
"random.randrange",
"pygame.key.get_pressed",
"pygame.image.load",
"pygame.font.Font",
"pygame.transform.scale"
] | [((766, 844), 'pygame.transform.scale', 'pygame.transform.scale', (['image', '(width // resize_ratio, height // resize_ratio)'], {}), '(image, (width // resize_ratio, height // resize_ratio))\n', (788, 844), False, 'import pygame\n'), ((400, 431), 'pygame.Surface', 'pygame.Surface', (['(width, height)'], {}), '((width,... |
# Generated by Django 2.0.7 on 2018-08-05 08:19
from django.conf import settings
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('benkyo', '0005_review'),
]
operations = [
migrat... | [
"django.db.migrations.AlterUniqueTogether",
"django.db.migrations.swappable_dependency"
] | [((186, 243), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (217, 243), False, 'from django.db import migrations\n'), ((314, 399), 'django.db.migrations.AlterUniqueTogether', 'migrations.AlterUniqueTogether', ([], {'na... |
# Copyright 2020 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file acc... | [
"sagemaker.cli.compatibility.v2.modifiers.airflow.ModelConfigArgModifier",
"pasta.dump",
"tests.unit.sagemaker.cli.compatibility.v2.modifiers.ast_converter.ast_call",
"sagemaker.cli.compatibility.v2.modifiers.airflow.ModelConfigImageURIRenamer"
] | [((1244, 1276), 'sagemaker.cli.compatibility.v2.modifiers.airflow.ModelConfigArgModifier', 'airflow.ModelConfigArgModifier', ([], {}), '()\n', (1274, 1276), False, 'from sagemaker.cli.compatibility.v2.modifiers import airflow\n'), ((1543, 1575), 'sagemaker.cli.compatibility.v2.modifiers.airflow.ModelConfigArgModifier',... |
from django.contrib import admin
from .models import Artist, ArtistData, Highlights, Journey
# Register your models here.
admin.site.register(Artist)
admin.site.register(ArtistData)
admin.site.register(Highlights)
admin.site.register(Journey)
| [
"django.contrib.admin.site.register"
] | [((123, 150), 'django.contrib.admin.site.register', 'admin.site.register', (['Artist'], {}), '(Artist)\n', (142, 150), False, 'from django.contrib import admin\n'), ((151, 182), 'django.contrib.admin.site.register', 'admin.site.register', (['ArtistData'], {}), '(ArtistData)\n', (170, 182), False, 'from django.contrib i... |
from django.urls import path
from products.api.views import ProductViewSet
from rest_framework.routers import DefaultRouter
router = DefaultRouter()
router.register(r'', ProductViewSet, basename='products')
urlpatterns = router.urls | [
"rest_framework.routers.DefaultRouter"
] | [((135, 150), 'rest_framework.routers.DefaultRouter', 'DefaultRouter', ([], {}), '()\n', (148, 150), False, 'from rest_framework.routers import DefaultRouter\n')] |
#!/usr/bin/env python
# Algo used
#Step 1 - Create a arp request to broadcast mac to get ip
#Step 2 - Send the packet, recieve the respose
#Step 3 - Analyse the response
#Step 4 - Print the result
#For python 3 you have to download the module scapy to run this file(pip install scapy-python3)
#optparse is depre... | [
"argparse.ArgumentParser",
"pyfiglet.Figlet",
"scapy.all.ARP",
"scapy.all.srp",
"scapy.all.Ether"
] | [((545, 565), 'pyfiglet.Figlet', 'Figlet', ([], {'font': '"""greek"""'}), "(font='greek')\n", (551, 565), False, 'from pyfiglet import Figlet\n'), ((702, 727), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (725, 727), False, 'import argparse\n'), ((1011, 1029), 'scapy.all.ARP', 'scapy.ARP', ([... |
import os
from pickle import load as pik
from sqlalchemy import create_engine
from pandas import DataFrame
import psycopg2
def unpickle():
"""Unpickle the bot token"""
with open('token.pickle', 'rb') as file:
token = pik(file)
return token
def bkp(backup: list) -> None:
uri = os.getenv("DATA... | [
"psycopg2.connect",
"os.getenv",
"sqlalchemy.create_engine",
"os.environ.get",
"pickle.load",
"pandas.DataFrame"
] | [((305, 330), 'os.getenv', 'os.getenv', (['"""DATABASE_URL"""'], {}), "('DATABASE_URL')\n", (314, 330), False, 'import os\n'), ((476, 506), 'sqlalchemy.create_engine', 'create_engine', (['uri'], {'echo': '(False)'}), '(uri, echo=False)\n', (489, 506), False, 'from sqlalchemy import create_engine\n'), ((573, 590), 'pand... |
from setuptools import setup, find_packages
from build_framework.extensions import Extension
setup(
name='wxAnimation',
version='0.0.1a',
url='https://github.com/kdschlosser/wxAnimation',
packages=find_packages(include=['webp', 'webp.*', 'webp_build']),
package_data={'webp_build': ['*.h', '*.c'... | [
"setuptools.find_packages"
] | [((218, 273), 'setuptools.find_packages', 'find_packages', ([], {'include': "['webp', 'webp.*', 'webp_build']"}), "(include=['webp', 'webp.*', 'webp_build'])\n", (231, 273), False, 'from setuptools import setup, find_packages\n')] |