code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import gym
from connect_four.agents import RandomAgent
from connect_four.evaluation.board import Board
from connect_four.evaluation.incremental_victor.solution.victor_solution_manager import VictorSolutionManager
env = gym.make('connect_four-v0')
for _ in range(0):
obs = env.reset()
env.render()
random_... | [
"connect_four.evaluation.incremental_victor.solution.victor_solution_manager.VictorSolutionManager",
"connect_four.evaluation.board.Board",
"gym.make",
"connect_four.agents.RandomAgent"
] | [((221, 248), 'gym.make', 'gym.make', (['"""connect_four-v0"""'], {}), "('connect_four-v0')\n", (229, 248), False, 'import gym\n'), ((328, 341), 'connect_four.agents.RandomAgent', 'RandomAgent', ([], {}), '()\n', (339, 341), False, 'from connect_four.agents import RandomAgent\n'), ((352, 406), 'connect_four.evaluation.... |
#!/usr/bin/env python
import itertools as it
import operator as op
# 364 since the longest word has 14 letters, 14*26 (assuming worst case -> all z)
TRIANGLE_NUMBERS = list(it.takewhile(lambda x: x<364, it.imap(lambda n: n*(n+1)/2, it.count(1))))
with open('words.txt') as wordfile:
words = wordfile.read().replace('... | [
"itertools.count"
] | [((234, 245), 'itertools.count', 'it.count', (['(1)'], {}), '(1)\n', (242, 245), True, 'import itertools as it\n')] |
import numpy as np
import scipy.signal
import matplotlib.pyplot as plt
def compare_filters(iir_b, iir_a, fir_b, fs=1):
# compute response for IIR filter
w_iir, h_iir = scipy.signal.freqz(iir_b, iir_a, fs=fs, worN=2048)
# compute response for FIR filter
w_fir, h_fir = scipy.signal.freqz(fir_b, fs=fs)... | [
"matplotlib.pyplot.xscale",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.show",
"numpy.abs",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.grid"
] | [((426, 471), 'matplotlib.pyplot.plot', 'plt.plot', (['w_iir', 'h_iir_db'], {'label': '"""IIR filter"""'}), "(w_iir, h_iir_db, label='IIR filter')\n", (434, 471), True, 'import matplotlib.pyplot as plt\n'), ((476, 529), 'matplotlib.pyplot.plot', 'plt.plot', (['w_fir', 'h_fir_db'], {'label': '"""FIR approx. filter"""'})... |
import random
import paho.mqtt.client as paho
client = paho.Client()
temperature = random.randint(18,34)
client.connect("0.0.0.0", 1883)
client.publish("homeassistant/sensor1/temperature", temperature, qos=1, retain=1)
# print temperature
client.disconnect()
client.connect("0.0.0.0", 1883)
temperature = random.randint(... | [
"paho.mqtt.client.Client",
"random.randint"
] | [((55, 68), 'paho.mqtt.client.Client', 'paho.Client', ([], {}), '()\n', (66, 68), True, 'import paho.mqtt.client as paho\n'), ((83, 105), 'random.randint', 'random.randint', (['(18)', '(34)'], {}), '(18, 34)\n', (97, 105), False, 'import random\n'), ((305, 327), 'random.randint', 'random.randint', (['(18)', '(34)'], {}... |
"""
Tests for the protocol definitions in the bonsai3 library
"""
#pyright: strict
from bonsai3.simulator_protocol import SimulatorEvent, SimulatorInterface
_MOCK_REGISTRATION_RESPONSE = {
"sessionId": "0123",
"interface": {},
"simulatorContext": {},
"registrationTime": "2020-01-01T17:24:34.186309100... | [
"bonsai3.simulator_protocol.SimulatorInterface",
"bonsai3.simulator_protocol.SimulatorEvent"
] | [((1355, 1398), 'bonsai3.simulator_protocol.SimulatorEvent', 'SimulatorEvent', (['_MOCK_REGISTRATION_RESPONSE'], {}), '(_MOCK_REGISTRATION_RESPONSE)\n', (1369, 1398), False, 'from bonsai3.simulator_protocol import SimulatorEvent, SimulatorInterface\n'), ((1853, 1888), 'bonsai3.simulator_protocol.SimulatorEvent', 'Simul... |
"""Home Assistant control object."""
import asyncio
import logging
from pathlib import Path
from tempfile import TemporaryDirectory
import aiohttp
from .coresys import CoreSysAttributes
from .docker.supervisor import DockerSupervisor
from .const import URL_HASSIO_APPARMOR
from .exceptions import HostAppArmorError
_L... | [
"pathlib.Path",
"tempfile.TemporaryDirectory",
"logging.getLogger"
] | [((328, 355), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (345, 355), False, 'import logging\n'), ((1993, 2041), 'tempfile.TemporaryDirectory', 'TemporaryDirectory', ([], {'dir': 'self.sys_config.path_tmp'}), '(dir=self.sys_config.path_tmp)\n', (2011, 2041), False, 'from tempfile impor... |
# coding: utf-8
# In[ ]:
#### 標準化などの処理
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from sklearn.preprocessing import StandardScaler, MinMaxScaler, RobustScaler, Normalizer
def get_standardized( X_train, X_test = None ) :
#あとで dataframeに変換するときむけの列名
X_colu... | [
"pandas.DataFrame",
"sklearn.preprocessing.StandardScaler",
"sklearn.preprocessing.RobustScaler",
"sklearn.preprocessing.MinMaxScaler",
"sklearn.preprocessing.Normalizer"
] | [((360, 376), 'sklearn.preprocessing.StandardScaler', 'StandardScaler', ([], {}), '()\n', (374, 376), False, 'from sklearn.preprocessing import StandardScaler, MinMaxScaler, RobustScaler, Normalizer\n'), ((581, 621), 'pandas.DataFrame', 'pd.DataFrame', (['X_train'], {'columns': 'X_columns'}), '(X_train, columns=X_colum... |
from fjord.base.tests import (
LocalizingClient,
reverse,
TestCase,
)
from fjord.feedback.tests import ResponseFactory
from fjord.redirector import build_redirect_url
from fjord.redirector.tests import RedirectorTestMixin
from fjord.suggest.providers.trigger.provider import (
format_redirect,
interp... | [
"fjord.feedback.tests.ResponseFactory",
"fjord.base.tests.reverse",
"fjord.suggest.providers.trigger.provider.interpolate_url",
"fjord.suggest.providers.trigger.provider.format_redirect",
"fjord.suggest.providers.trigger.tests.TriggerRuleFactory"
] | [((575, 592), 'fjord.feedback.tests.ResponseFactory', 'ResponseFactory', ([], {}), '()\n', (590, 592), False, 'from fjord.feedback.tests import ResponseFactory\n'), ((607, 650), 'fjord.suggest.providers.trigger.provider.interpolate_url', 'interpolate_url', (['"""http://example.com"""', 'resp'], {}), "('http://example.c... |
import json
import math
# Store input numbers
total_lexis = int(input('How many lexis: '))
# Display the sum
print(f"Wait while we do some quik maffs for {total_lexis} lexis")
minimum_lexis = 15
extra_lexis = total_lexis - minimum_lexis
bonus_garlic = math.ceil(extra_lexis/5)
bonus_wildcards = math.floor(extra_lexis/... | [
"math.floor",
"json.dumps",
"math.ceil"
] | [((254, 280), 'math.ceil', 'math.ceil', (['(extra_lexis / 5)'], {}), '(extra_lexis / 5)\n', (263, 280), False, 'import math\n'), ((297, 324), 'math.floor', 'math.floor', (['(extra_lexis / 8)'], {}), '(extra_lexis / 8)\n', (307, 324), False, 'import math\n'), ((337, 366), 'math.ceil', 'math.ceil', (['(extra_lexis * 0.75... |
"""`Aggregate` provider example."""
from dependency_injector import containers, providers
class ConfigReader:
def __init__(self, path):
self._path = path
def read(self):
print(f"Parsing {self._path} with {self.__class__.__name__}")
...
class YamlReader(ConfigReader):
...
cla... | [
"dependency_injector.providers.Factory"
] | [((465, 494), 'dependency_injector.providers.Factory', 'providers.Factory', (['YamlReader'], {}), '(YamlReader)\n', (482, 494), False, 'from dependency_injector import containers, providers\n'), ((509, 538), 'dependency_injector.providers.Factory', 'providers.Factory', (['JsonReader'], {}), '(JsonReader)\n', (526, 538)... |
import torch.nn as nn
import torch
import torch.nn.functional as F
class FastText(nn.Module):
def __init__(self, vocab_size, embedding_dim, output_dim, pad_idx):
super().__init__()
self.embedding = nn.Embedding(vocab_size, embedding_dim, padding_idx=pad_idx)
self.fc = nn.Linear(embedding_di... | [
"torch.nn.Dropout",
"torch.nn.functional.avg_pool2d",
"torch.nn.Embedding",
"torch.nn.Conv2d",
"torch.cat",
"torch.nn.Linear",
"torch.nn.functional.max_pool1d",
"torch.nn.utils.rnn.pad_packed_sequence",
"torch.nn.utils.rnn.pack_padded_sequence",
"torch.nn.LSTM"
] | [((219, 279), 'torch.nn.Embedding', 'nn.Embedding', (['vocab_size', 'embedding_dim'], {'padding_idx': 'pad_idx'}), '(vocab_size, embedding_dim, padding_idx=pad_idx)\n', (231, 279), True, 'import torch.nn as nn\n'), ((298, 334), 'torch.nn.Linear', 'nn.Linear', (['embedding_dim', 'output_dim'], {}), '(embedding_dim, outp... |
from .petitradtrans import petitRADTRANSModel
import numpy as np
from taurex.exceptions import InvalidModelException
from taurex.core import fitparam
class DirectImageRADTRANS(petitRADTRANSModel):
@classmethod
def input_keywords(self):
return ['directimage-petitrad', 'direct-petitrad', ]
de... | [
"astropy.units.spectral_density",
"numpy.zeros",
"numpy.isnan"
] | [((1719, 1741), 'numpy.isnan', 'np.isnan', (['petit_flux_W'], {}), '(petit_flux_W)\n', (1727, 1741), True, 'import numpy as np\n'), ((1814, 1861), 'numpy.zeros', 'np.zeros', ([], {'shape': '(self.nLayers, wngrid.shape[0])'}), '(shape=(self.nLayers, wngrid.shape[0]))\n', (1822, 1861), True, 'import numpy as np\n'), ((14... |
# -*- coding: utf-8 -*-
from mockdown.mockdown import Mockdown
class TestMockdown:
def test_exists(self, tmpdir):
m = Mockdown(tmpdir.strpath)
assert m.exists("a.txt") is False
tmpdir.join("a.txt").write("hello")
assert m.exists("a.txt") is True
def read_yaml_file(self, tmpdir... | [
"mockdown.mockdown.Mockdown"
] | [((131, 155), 'mockdown.mockdown.Mockdown', 'Mockdown', (['tmpdir.strpath'], {}), '(tmpdir.strpath)\n', (139, 155), False, 'from mockdown.mockdown import Mockdown\n'), ((335, 359), 'mockdown.mockdown.Mockdown', 'Mockdown', (['tmpdir.strpath'], {}), '(tmpdir.strpath)\n', (343, 359), False, 'from mockdown.mockdown import... |
#-*- coding: utf-8 -*-
import argparse
import numpy as np
parser = argparse.ArgumentParser(description='Configuration file')
arg_lists = []
def add_argument_group(name):
arg = parser.add_argument_group(name)
arg_lists.append(arg)
return arg
def str2bool(v):
return v.lower() in ('true', '1')
# Network
net... | [
"argparse.ArgumentParser"
] | [((68, 125), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Configuration file"""'}), "(description='Configuration file')\n", (91, 125), False, 'import argparse\n')] |
# Copyright 2016-19 <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, so... | [
"unittest.main",
"scriptbase.curry.Remove",
"scriptbase.curry.Before",
"scriptbase.curry.After",
"scriptbase.curry.Tweak"
] | [((2704, 2719), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2717, 2719), False, 'import unittest\n'), ((1228, 1248), 'scriptbase.curry.Before', 'Before', (['foo', '(1)', '(2)', '(3)'], {}), '(foo, 1, 2, 3)\n', (1234, 1248), False, 'from scriptbase.curry import Before, After, Remove, Tweak\n'), ((1373, 1392), '... |
from datetime import datetime
def time_generator():
str = datetime.now().strftime('%Y-%m-%d %A')
return str
| [
"datetime.datetime.now"
] | [((60, 74), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (72, 74), False, 'from datetime import datetime\n')] |
#!/usr/bin/env python
"""
This is an example application of how to make use of Bottle to provide
sub-request authentication with NGINX, particularly with a Gitea
SQLite3 database.
Copyright (c) 2019, <NAME>/Cope Systems.
License: Apache (see LICENSE file)
"""
from vendor import bottle
from sqlite3 import dbapi2 as sql... | [
"argparse.ArgumentParser",
"binascii.hexlify",
"logging.StreamHandler",
"sqlite3.dbapi2.connect",
"vendor.bottle.auth_basic",
"vendor.bottle.Bottle",
"datetime.datetime.now",
"vendor.bottle.HTTPResponse",
"logging.getLogger"
] | [((446, 462), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (460, 462), False, 'from argparse import ArgumentParser\n'), ((863, 884), 'logging.getLogger', 'logging.getLogger', (['""""""'], {}), "('')\n", (880, 884), False, 'import logging\n'), ((896, 919), 'datetime.datetime.now', 'datetime.datetime.no... |
""" Base Configuration """
import os
PROJECT_DIR = os.path.dirname(os.path.abspath(__name__))
APP_DIR = os.path.abspath(os.path.dirname(__file__))
PROJECT_ROOT = os.path.abspath(os.path.join(APP_DIR, os.pardir))
SECRET_KEY = '4ku 4n4k s3h4t'
ASSETS_DEBUG = False
CACHE_TYPE = 'simple'
# SECURITY CONFIG
SECURITY_REGI... | [
"os.path.abspath",
"os.path.dirname",
"os.path.join"
] | [((69, 94), 'os.path.abspath', 'os.path.abspath', (['__name__'], {}), '(__name__)\n', (84, 94), False, 'import os\n'), ((122, 147), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (137, 147), False, 'import os\n'), ((180, 212), 'os.path.join', 'os.path.join', (['APP_DIR', 'os.pardir'], {}), '(... |
import unittest
import numpy as np
from utils import gaussian_mixture, add_outliers
class MyTestCase(unittest.TestCase):
def test_gaussian_mixture(self):
X = gaussian_mixture(n_samples=100, n_clusters=4,
n_outliers=10, n_features=2,
means=np.array... | [
"unittest.main",
"utils.add_outliers",
"numpy.linalg.norm",
"numpy.array"
] | [((1339, 1354), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1352, 1354), False, 'import unittest\n'), ((1109, 1175), 'utils.add_outliers', 'add_outliers', (['X'], {'n_outliers': '(10)', 'dist_factor': '(100)', 'return_index': '(True)'}), '(X, n_outliers=10, dist_factor=100, return_index=True)\n', (1121, 1175),... |
from pygments.lexers.python import Python3Lexer
from pygments.token import Name, Keyword
class NANDLexer(Python3Lexer):
name = 'NAND'
aliases = ['nand']
EXTRA_KEYWORDS = ['NAND', 'X', 'Y','Xvalid','Yvalid','loop','i']
def get_tokens_unprocessed(self, text):
for index, token, value in Python... | [
"pygments.lexers.python.Python3Lexer.get_tokens_unprocessed"
] | [((314, 361), 'pygments.lexers.python.Python3Lexer.get_tokens_unprocessed', 'Python3Lexer.get_tokens_unprocessed', (['self', 'text'], {}), '(self, text)\n', (349, 361), False, 'from pygments.lexers.python import Python3Lexer\n')] |
import logging
from typing import Callable
from src.models_embedding.base_model import BaseModel
class ModelFactory:
""" The factory class for creating various models_embedding. """
# internal registry for available models_embedding
registry = {}
# logger for status information
logger = logging.... | [
"logging.getLogger"
] | [((312, 339), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (329, 339), False, 'import logging\n')] |
from discord import Member, Member
from discord.ext.commands import Context
from discord.utils import get
from protobot.roles.utils import get_role
async def can_give_friend(ctx: Context):
return any(get_role(ctx, name=role) in ctx.author.roles for role in ("Admin", "Member"))
def can_grant_friend(ctx: Context, ... | [
"protobot.roles.utils.get_role"
] | [((494, 523), 'protobot.roles.utils.get_role', 'get_role', (['ctx'], {'name': '"""Friends"""'}), "(ctx, name='Friends')\n", (502, 523), False, 'from protobot.roles.utils import get_role\n'), ((206, 230), 'protobot.roles.utils.get_role', 'get_role', (['ctx'], {'name': 'role'}), '(ctx, name=role)\n', (214, 230), False, '... |
import sys
import ZhihuZhuanlan2Hugo
if __name__ == "__main__":
ZhihuZhuanlan2Hugo.main(*sys.argv)
| [
"ZhihuZhuanlan2Hugo.main"
] | [((70, 104), 'ZhihuZhuanlan2Hugo.main', 'ZhihuZhuanlan2Hugo.main', (['*sys.argv'], {}), '(*sys.argv)\n', (93, 104), False, 'import ZhihuZhuanlan2Hugo\n')] |
# Generated by Django 2.2.13 on 2020-09-08 16:50
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [("hierarchy", "0006_chapter_last_updated")]
operations = [
migrations.CreateModel(
name="NomenclatureTree",
... | [
"django.db.models.ForeignKey",
"django.db.models.CharField",
"django.db.models.DateField",
"django.db.models.AutoField"
] | [((949, 1059), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'null': '(True)', 'on_delete': 'django.db.models.deletion.CASCADE', 'to': '"""hierarchy.NomenclatureTree"""'}), "(null=True, on_delete=django.db.models.deletion.CASCADE,\n to='hierarchy.NomenclatureTree')\n", (966, 1059), False, 'from django.db... |
"""TEsting functions
"""
import numpy as np
from energy_demand.basic import basic_functions
from energy_demand.basic import lookup_tables
def test_if_minus_value_in_array(arraytotest):#, tolerance_min_max=0.00000000001):
"""Test if array has negative value according to a tolerance
criteria
Arguments
... | [
"energy_demand.basic.lookup_tables.basic_lookups",
"energy_demand.basic.basic_functions.test_if_sector",
"numpy.sum",
"numpy.min"
] | [((5408, 5437), 'energy_demand.basic.lookup_tables.basic_lookups', 'lookup_tables.basic_lookups', ([], {}), '()\n', (5435, 5437), False, 'from energy_demand.basic import lookup_tables\n'), ((3401, 3461), 'energy_demand.basic.basic_functions.test_if_sector', 'basic_functions.test_if_sector', (['fuel_tech_fueltype_p[endu... |
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
import pathlib
here = pathlib.Path(__file__).parent.resolve()
long_description = (here / 'README.md').read_text(encoding='utf-8')
setup(
name='json_expand_o_matic',
version='0.1.3',
description='Expand a dict into a ... | [
"pathlib.Path",
"setuptools.find_packages"
] | [((1397, 1423), 'setuptools.find_packages', 'find_packages', ([], {'where': '"""src"""'}), "(where='src')\n", (1410, 1423), False, 'from setuptools import setup, find_packages\n'), ((110, 132), 'pathlib.Path', 'pathlib.Path', (['__file__'], {}), '(__file__)\n', (122, 132), False, 'import pathlib\n')] |
#!/usr/bin/python3
"""This script that takes in a URL, sends a request to the URL and
displays the value of the variable X-Request-Id in the response header.
"""
import requests
from sys import argv
if __name__ == "__main__":
r = requests.get(argv[1])
print(r.headers.get('X-Request-Id'))
| [
"requests.get"
] | [((240, 261), 'requests.get', 'requests.get', (['argv[1]'], {}), '(argv[1])\n', (252, 261), False, 'import requests\n')] |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2013 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | [
"redhat_support_tool.tools.pyparsing.Regex",
"redhat_support_tool.tools.pyparsing.Suppress",
"redhat_support_tool.tools.pyparsing.Literal",
"redhat_support_tool.helpers.confighelper._"
] | [((1174, 1196), 'redhat_support_tool.tools.pyparsing.Literal', 'Literal', (['"""crash> quit"""'], {}), "('crash> quit')\n", (1181, 1196), False, 'from redhat_support_tool.tools.pyparsing import Word, Suppress, Combine, SkipTo, Regex, Literal\n'), ((1528, 1579), 'redhat_support_tool.helpers.confighelper._', '_', (['"""T... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'sheets_print_template.ui'
#
# Created by: PyQt4 UI code generator 4.11.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _... | [
"PyQt4.QtGui.QGroupBox",
"PyQt4.QtGui.QApplication.translate",
"PyQt4.QtGui.QHBoxLayout",
"PyQt4.QtGui.QLabel",
"PyQt4.QtGui.QGridLayout",
"PyQt4.QtGui.QCheckBox",
"PyQt4.QtGui.QLineEdit",
"PyQt4.QtCore.QMetaObject.connectSlotsByName",
"PyQt4.QtGui.QVBoxLayout",
"PyQt4.QtGui.QToolButton",
"PyQt4... | [((465, 529), 'PyQt4.QtGui.QApplication.translate', 'QtGui.QApplication.translate', (['context', 'text', 'disambig', '_encoding'], {}), '(context, text, disambig, _encoding)\n', (493, 529), False, 'from PyQt4 import QtCore, QtGui\n'), ((841, 866), 'PyQt4.QtGui.QHBoxLayout', 'QtGui.QHBoxLayout', (['Dialog'], {}), '(Dial... |
import os
import traceback
import json
AUDIO_DIR = os.path.join(os.path.dirname(__file__), "audio")
BACKING_TRACK_UPLOAD_FNAME = os.path.join(AUDIO_DIR, "User Upload")
IMAGE_UPLOAD_FNAME = os.path.join(
os.path.dirname(__file__), "html", "user-upload-image")
def die500(start_response, e):
# This is slightly s... | [
"os.path.dirname",
"os.path.join",
"traceback.format_exc"
] | [((130, 168), 'os.path.join', 'os.path.join', (['AUDIO_DIR', '"""User Upload"""'], {}), "(AUDIO_DIR, 'User Upload')\n", (142, 168), False, 'import os\n'), ((65, 90), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (80, 90), False, 'import os\n'), ((208, 233), 'os.path.dirname', 'os.path.dirnam... |
# Code generated by lark_sdk_gen. DO NOT EDIT.
from pylark.lark_request import RawRequestReq, _new_method_option
from pylark import lark_type, lark_type_sheet, lark_type_approval
import attr
import typing
import io
@attr.s
class DeleteTaskCommentReq(object):
task_id: str = attr.ib(
default="", metadata={... | [
"pylark.lark_request._new_method_option",
"attr.ib"
] | [((281, 349), 'attr.ib', 'attr.ib', ([], {'default': '""""""', 'metadata': "{'req_type': 'path', 'key': 'task_id'}"}), "(default='', metadata={'req_type': 'path', 'key': 'task_id'})\n", (288, 349), False, 'import attr\n'), ((438, 509), 'attr.ib', 'attr.ib', ([], {'default': '""""""', 'metadata': "{'req_type': 'path', '... |
# RVR servo example for raspberry pico
import time
import board
import pwmio
import digitalio
from adafruit_motor import servo
led = digitalio.DigitalInOut(board.LED)
led.direction = digitalio.Direction.OUTPUT
# create a PWMOut object on Pin A2.
pwm = pwmio.PWMOut(board.GP28, duty_cycle=2 ** 15, frequency=50)
# Cre... | [
"pwmio.PWMOut",
"adafruit_motor.servo.Servo",
"digitalio.DigitalInOut",
"time.sleep"
] | [((135, 168), 'digitalio.DigitalInOut', 'digitalio.DigitalInOut', (['board.LED'], {}), '(board.LED)\n', (157, 168), False, 'import digitalio\n'), ((255, 313), 'pwmio.PWMOut', 'pwmio.PWMOut', (['board.GP28'], {'duty_cycle': '(2 ** 15)', 'frequency': '(50)'}), '(board.GP28, duty_cycle=2 ** 15, frequency=50)\n', (267, 313... |
import os
import time
spaces = []
avail_spaces = 0
total_spaces = 0
rows = 0
space_count = 0
border = ""
linux = 0
class Vehicle:
def __init__(self, v_type, plate):
self.type = v_type
self.plate = plate
self.entry_time = time.time()
def get_type(self):
return self.ty... | [
"time.time",
"os.system",
"time.sleep"
] | [((3944, 3957), 'time.sleep', 'time.sleep', (['(2)'], {}), '(2)\n', (3954, 3957), False, 'import time\n'), ((4889, 4902), 'time.sleep', 'time.sleep', (['(2)'], {}), '(2)\n', (4899, 4902), False, 'import time\n'), ((257, 268), 'time.time', 'time.time', ([], {}), '()\n', (266, 268), False, 'import time\n'), ((1987, 2005)... |
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | [
"unittest.main",
"functools.partial",
"program_config.OpConfig",
"hypothesis.strategies.sampled_from",
"hypothesis.strategies.booleans",
"numpy.random.random",
"hypothesis.strategies.integers"
] | [((5410, 5425), 'unittest.main', 'unittest.main', ([], {}), '()\n', (5423, 5425), False, 'import unittest\n'), ((3732, 4092), 'program_config.OpConfig', 'OpConfig', ([], {'type': '"""matmul_v2"""', 'inputs': "{'X': ['input_data1'], 'Y': ['input_data2']}", 'outputs': "{'Out': ['matmul_output']}", 'attrs': "{'trans_x': k... |
#ZADANIE 1
#Napisz program realizujacy poszukiwanie miejsc zerowych
#powyzszych funkcji z punktu a) i b). Wykorzystaj metode graficzna,
#liniowej inkrementacji i bisekcji. Stworz odpowiednie funkcje
#implementujace wymienione metody poszukiwania miejsc zerowych.
#Dobierz odpowiednio obszary wyszukiwania. Wykonaj analiz... | [
"numpy.absolute",
"matplotlib.pyplot.show",
"numpy.arange",
"matplotlib.pyplot.grid"
] | [((1245, 1266), 'numpy.arange', 'np.arange', (['(-3)', '(3)', '(0.1)'], {}), '(-3, 3, 0.1)\n', (1254, 1266), True, 'import numpy as np\n'), ((1293, 1307), 'matplotlib.pyplot.grid', 'plt.grid', (['(True)'], {}), '(True)\n', (1301, 1307), True, 'import matplotlib.pyplot as plt\n'), ((1308, 1318), 'matplotlib.pyplot.show'... |
import os
import wx
from PIL import Image # Pil
import Plugins.tama_drawer.ImgConv # wxImage <==> PilImage
#------------------------------------------------------------------------------
def CreateMaskBitmapFromPilImage( pilImage, useTransparency=True, threshold=128 ) :
"""
Return a binary mask w... | [
"PIL.Image.new",
"wx.EmptyBitmap",
"PIL.Image.open",
"os._exit",
"wx.Pen",
"wx.Brush",
"wx.Font",
"wx.MemoryDC"
] | [((3163, 3188), 'PIL.Image.open', 'Image.open', (['imageFilename'], {}), '(imageFilename)\n', (3173, 3188), False, 'from PIL import Image\n'), ((9188, 9225), 'PIL.Image.new', 'Image.new', (['"""L"""', 'combinedSize'], {'color': '(0)'}), "('L', combinedSize, color=0)\n", (9197, 9225), False, 'from PIL import Image\n'), ... |
import rsa
import socket
import platform
import os, time
# get OS so i can clear the terminal correctly
print("Getting OS..")
print(platform.system())
os_platform = platform.system()
if platform.system() == "linux" or "darwin": # linux, darwin == macos
clear_cmd = "clear"
print("clear_cmd = 'clear'.")
elif... | [
"platform.system",
"rsa.newkeys"
] | [((168, 185), 'platform.system', 'platform.system', ([], {}), '()\n', (183, 185), False, 'import platform\n'), ((571, 600), 'rsa.newkeys', 'rsa.newkeys', (['(2048)'], {'poolsize': '(8)'}), '(2048, poolsize=8)\n', (582, 600), False, 'import rsa\n'), ((135, 152), 'platform.system', 'platform.system', ([], {}), '()\n', (1... |
import setuptools
with open("README.md", "rt") as f:
long_description = f.read()
setuptools.setup(
name="scleradmin",
version="1.0-beta-3",
author="<NAME>.",
author_email="<EMAIL>",
description="Sclera Platform Administration Tool",
long_description=long_description,
long_description_c... | [
"setuptools.setup"
] | [((87, 1144), 'setuptools.setup', 'setuptools.setup', ([], {'name': '"""scleradmin"""', 'version': '"""1.0-beta-3"""', 'author': '"""<NAME>."""', 'author_email': '"""<EMAIL>"""', 'description': '"""Sclera Platform Administration Tool"""', 'long_description': 'long_description', 'long_description_content_type': '"""text... |
# importing datetime module
import datetime
def calculateAge(year, month, day):
# Using now() to get current time
current_date = datetime.datetime.now()
birth_date = datetime.datetime(year, month, day)
# Calculating difference from current time and birth date
diff = current_date - birth_da... | [
"datetime.datetime.now",
"datetime.datetime"
] | [((141, 164), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (162, 164), False, 'import datetime\n'), ((183, 218), 'datetime.datetime', 'datetime.datetime', (['year', 'month', 'day'], {}), '(year, month, day)\n', (200, 218), False, 'import datetime\n')] |
from textblob import TextBlob
import json
import sqlite3
from textblob.sentiments import NaiveBayesAnalyzer
with open("news.json", "r") as f:
data = json.load(f)
conn = sqlite3.connect('db.sqlite')
c = conn.cursor()
c.execute("SELECT * FROM `politicians`")
politicians = c.fetchall()
aid = 0
'''for article in ... | [
"json.load",
"sqlite3.connect",
"textblob.sentiments.NaiveBayesAnalyzer"
] | [((176, 204), 'sqlite3.connect', 'sqlite3.connect', (['"""db.sqlite"""'], {}), "('db.sqlite')\n", (191, 204), False, 'import sqlite3\n'), ((155, 167), 'json.load', 'json.load', (['f'], {}), '(f)\n', (164, 167), False, 'import json\n'), ((638, 658), 'textblob.sentiments.NaiveBayesAnalyzer', 'NaiveBayesAnalyzer', ([], {}... |
from config_generator import configurator
import numpy as np
from random import uniform, randint
algorithms = ['xstream']
TuningMode = True
if TuningMode is False:
names = []
for i in range(24):
name = input()
names.append(name)
for algo in algorithms:
if(algo == 'xstrea... | [
"numpy.dstack",
"numpy.meshgrid",
"numpy.concatenate",
"config_generator.configurator"
] | [((1594, 1616), 'numpy.meshgrid', 'np.meshgrid', (['chains', 'k'], {}), '(chains, k)\n', (1605, 1616), True, 'import numpy as np\n'), ((1633, 1652), 'numpy.dstack', 'np.dstack', (['[xs, ys]'], {}), '([xs, ys])\n', (1642, 1652), True, 'import numpy as np\n'), ((1770, 1806), 'numpy.concatenate', 'np.concatenate', (['(tmp... |
# Generated by Django 3.1.1 on 2020-09-19 20:14
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('backend', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='movie',
name='movieDbId',
f... | [
"django.db.models.IntegerField"
] | [((325, 355), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'default': '(1)'}), '(default=1)\n', (344, 355), False, 'from django.db import migrations, models\n')] |
from sklearn import preprocessing
from sklearn.cluster import KMeans
from sklearn.decomposition import PCA
import seaborn as sns
import numpy as np
import pandas as pd
def loudness_scaled(songs):
loudness = songs[['loudness']].values
min_max_scaler = preprocessing.MinMaxScaler()
loudness_scaled =... | [
"pandas.DataFrame",
"sklearn.cluster.KMeans",
"sklearn.preprocessing.MinMaxScaler"
] | [((269, 297), 'sklearn.preprocessing.MinMaxScaler', 'preprocessing.MinMaxScaler', ([], {}), '()\n', (295, 297), False, 'from sklearn import preprocessing\n'), ((385, 414), 'pandas.DataFrame', 'pd.DataFrame', (['loudness_scaled'], {}), '(loudness_scaled)\n', (397, 414), True, 'import pandas as pd\n'), ((679, 699), 'skle... |
import numpy as np
def swap(arr, i, j):
"""
Swap two elements in an array
Parameters
----------
arr: list
The array
i: int
Index of first element
j: int
Index of second element
"""
temp = arr[i]
arr[i] = arr[j]
arr[j] = temp
def merge(x, y, i1, ... | [
"numpy.random.randint",
"numpy.random.seed"
] | [((1759, 1776), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (1773, 1776), True, 'import numpy as np\n'), ((1781, 1810), 'numpy.random.randint', 'np.random.randint', (['(0)', '(100)', '(20)'], {}), '(0, 100, 20)\n', (1798, 1810), True, 'import numpy as np\n')] |
import paddle
from ppdet.core.workspace import load_config, merge_config
from ppdet.engine import Trainer, init_parallel_env
from ppdet.slim import build_slim_model
from ppdet.utils.check import check_gpu, check_version, check_config
from ppdet.utils.logger import setup_logger
from utils import ArgsParser
logger = se... | [
"ppdet.utils.check.check_version",
"ppdet.utils.logger.setup_logger",
"ppdet.utils.check.check_config",
"ppdet.core.workspace.load_config",
"ppdet.slim.build_slim_model",
"ppdet.engine.init_parallel_env",
"paddle.set_device",
"ppdet.utils.check.check_gpu",
"ppdet.engine.Trainer",
"ppdet.core.works... | [((318, 338), 'ppdet.utils.logger.setup_logger', 'setup_logger', (['"""eval"""'], {}), "('eval')\n", (330, 338), False, 'from ppdet.utils.logger import setup_logger\n'), ((372, 384), 'utils.ArgsParser', 'ArgsParser', ([], {}), '()\n', (382, 384), False, 'from utils import ArgsParser\n'), ((1178, 1197), 'ppdet.engine.in... |
from django.db import models
from django.conf import settings
from django.utils.html import mark_safe
from django.utils.translation import gettext as _
from django.contrib.gis.db import models as geo_models
from django.urls import reverse
from simple_history.models import HistoricalRecords
from behaviors.models impor... | [
"django.utils.translation.gettext",
"django.db.models.ForeignKey",
"django.contrib.gis.db.models.PointField",
"django.urls.reverse",
"simple_history.models.HistoricalRecords",
"django.utils.html.mark_safe",
"django.db.models.DateTimeField",
"logging.getLogger"
] | [((458, 485), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (475, 485), False, 'import logging\n'), ((2019, 2063), 'django.contrib.gis.db.models.PointField', 'geo_models.PointField', ([], {'null': '(True)', 'blank': '(True)'}), '(null=True, blank=True)\n', (2040, 2063), True, 'from djang... |
import re
from typing import Any, Sequence
def to_underscore(name):
"""
>>> to_underscore('ADC')
'adc'
>>> to_underscore('FizzBuzz')
'fizz_buzz'
"""
s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', name)
return re.sub('([a-z0-9])([A-Z])', r'\1_\2', s1).lower()
def chevron_list_mark_last(dat... | [
"re.sub",
"re.compile"
] | [((1886, 1941), 're.compile', 're.compile', (['"""^([ \\\\t]*\\\\S[^\\\\n]*)$"""'], {'flags': 're.MULTILINE'}), "('^([ \\\\t]*\\\\S[^\\\\n]*)$', flags=re.MULTILINE)\n", (1896, 1941), False, 'import re\n'), ((2294, 2336), 're.compile', 're.compile', (['"""[ \\\\t]+$"""'], {'flags': 're.MULTILINE'}), "('[ \\\\t]+$', flag... |
import plotly.offline as offline
import plotly.graph_objs as go
offline.init_notebook_mode()
offline.iplot({'data': [{'y': [4, 2, 3, 4]}],
'layout': {'title': 'Test Plot',
'font': dict(size=16)}},
image='png') | [
"plotly.offline.init_notebook_mode"
] | [((65, 93), 'plotly.offline.init_notebook_mode', 'offline.init_notebook_mode', ([], {}), '()\n', (91, 93), True, 'import plotly.offline as offline\n')] |
#!/usr/bin/env python
import sys
def main(args):
broken_ids = set()
dim = args.dim
# get broken lines and remove from embedding file
with open(args.emb) as f_orig, open(args.emb_out, 'w') as f_dest:
for i, line in enumerate(f_orig):
line_strip = line.strip()
es = line... | [
"argparse.ArgumentParser"
] | [((1044, 1143), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Remove lines with missing dimensions of word2vec files."""'}), "(description=\n 'Remove lines with missing dimensions of word2vec files.')\n", (1067, 1143), False, 'import argparse\n')] |
import binascii
import gzip
import json
import logging
import os
import glob
import fnmatch
import shutil
import time
import zlib
import io
import pickle
import tempfile
import re
from abc import ABC, abstractmethod
from collections import OrderedDict
from functools import total_ordering
from typing ... | [
"dpu_utils.utils.dataloading.save_json_gz",
"numpy.load",
"os.remove",
"pickle.dump",
"os.unlink",
"dpu_utils.utils.dataloading.save_jsonl_gz",
"os.path.isfile",
"pickle.load",
"azure.storage.blob.ContainerClient.from_container_url",
"azure.identity.DefaultAzureCredential",
"azure.storage.blob.C... | [((833, 872), 'logging.getLogger', 'logging.getLogger', (['"""azure.storage.blob"""'], {}), "('azure.storage.blob')\n", (850, 872), False, 'import logging\n'), ((898, 929), 'logging.getLogger', 'logging.getLogger', (['"""azure.core"""'], {}), "('azure.core')\n", (915, 929), False, 'import logging\n'), ((12008, 12032), ... |
r"""optics_trace.py in tinybee-aligner/tinybee, pypi\tinybee-aligner\wuch3_pad.py."""
from typing import Any, List, Tuple, Union
import webbrowser
# import os
# import numpy as np
import matplotlib.pyplot as plt
from sklearn.cluster import OPTICS
from logzero import logger
# pylint: disable=invalid-name
colors = "bg... | [
"webbrowser.open",
"matplotlib.pyplot.show",
"matplotlib.pyplot.close",
"logzero.logger.info",
"matplotlib.pyplot.ion",
"matplotlib.pyplot.figure",
"logzero.logger.debug",
"sklearn.cluster.OPTICS",
"matplotlib.pyplot.savefig",
"logzero.logger.error"
] | [((2383, 2410), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(10, 7)'}), '(figsize=(10, 7))\n', (2393, 2410), True, 'import matplotlib.pyplot as plt\n'), ((2092, 2130), 'sklearn.cluster.OPTICS', 'OPTICS', ([], {'min_samples': 'min_samples', 'xi': 'xi'}), '(min_samples=min_samples, xi=xi)\n', (2098, 2130)... |
"""add is_admin column to user table
Revision ID: <KEY>
Revises: <PASSWORD>
Create Date: 2019-04-18 10:04:29.019762
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.sql import expression
# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = '<PASSWORD>'
branch_labels = None
d... | [
"alembic.op.drop_column",
"sqlalchemy.Boolean",
"sqlalchemy.sql.expression.false"
] | [((512, 554), 'alembic.op.drop_column', 'op.drop_column', (['"""user_account"""', '"""is_admin"""'], {}), "('user_account', 'is_admin')\n", (526, 554), False, 'from alembic import op\n'), ((418, 430), 'sqlalchemy.Boolean', 'sa.Boolean', ([], {}), '()\n', (428, 430), True, 'import sqlalchemy as sa\n'), ((463, 481), 'sql... |
from manager import *
from engine.actions import LEXER, INTERPRETER
from sys import argv
from engine import util, VERSION
import shell
# Constants
ARGS = {
'manage': ('--manage', '-m'),
'shell': ('--shell', '-s'),
'simpleshell': ('--simple-shell', '-ss'),
'command': ('--command', '-c'),
'version': ... | [
"engine.util.interpret",
"shell.print_header",
"shell.get",
"shell.print_hint",
"shell.print_info"
] | [((728, 828), 'shell.print_header', 'shell.print_header', (['f"""Lyon {VERSION} <https://marc-dantas.github.io/lyon/>"""', '"""Interactive SHELL"""'], {}), "(f'Lyon {VERSION} <https://marc-dantas.github.io/lyon/>',\n 'Interactive SHELL')\n", (746, 828), False, 'import shell\n'), ((829, 876), 'shell.print_hint', 'she... |
"""
This is the config file for fintrist_ds, containing various parameters the user may
wish to modify.
"""
import os
from dotenv import load_dotenv
load_dotenv()
class ConfigObj():
APIKEY_AV = os.getenv('APIKEY_AV')
APIKEY_TIINGO = os.getenv('APIKEY_TIINGO')
TZ = os.getenv('TIMEZONE') or 'UTC'
Config = ... | [
"dotenv.load_dotenv",
"os.getenv"
] | [((150, 163), 'dotenv.load_dotenv', 'load_dotenv', ([], {}), '()\n', (161, 163), False, 'from dotenv import load_dotenv\n'), ((200, 222), 'os.getenv', 'os.getenv', (['"""APIKEY_AV"""'], {}), "('APIKEY_AV')\n", (209, 222), False, 'import os\n'), ((243, 269), 'os.getenv', 'os.getenv', (['"""APIKEY_TIINGO"""'], {}), "('AP... |
import io
import math
import cairocffi as cairo
import lxml.etree as et
import pangocairocffi
from PIL import Image
from ....text.textstyle import TextStyle
from ....utils.geom import Rect, find_centroid
from ..rcontext import RenderingContext
from .draw import (
apply_viewbox,
ctx_scope,
fill_shape,
... | [
"pangocairocffi.show_layout",
"io.BytesIO",
"lxml.etree.fromstring",
"cairocffi.Context",
"pangocairocffi.create_context",
"cairocffi.ImageSurface",
"lxml.etree.tostring",
"cairocffi.PDFSurface"
] | [((2297, 2346), 'pangocairocffi.create_context', 'pangocairocffi.create_context', (['self.reference_ctx'], {}), '(self.reference_ctx)\n', (2326, 2346), False, 'import pangocairocffi\n'), ((7031, 7121), 'cairocffi.ImageSurface', 'cairo.ImageSurface', (['cairo.FORMAT_ARGB32'], {'width': 'img_width', 'height': 'img_height... |
#!/usr/bin/python3
import tkinter as tk
import tkinter.font as tkFont
import tkinter.ttk as ttk
'''
Copyright <2020> <<NAME>>
Permission is hereby granted, free of charge,
to any person obtaining a copy of this software
and associated documentation files (the "Software"),
to deal in the Software without restriction,
... | [
"tkinter.Label",
"tkinter.Checkbutton",
"tkinter.Text",
"tkinter.Button",
"tkinter.Entry",
"tkinter.font.Font",
"tkinter.ttk.Combobox",
"tkinter.Radiobutton",
"tkinter.Toplevel",
"tkinter.Scale",
"tkinter.Frame",
"tkinter.IntVar",
"tkinter.LabelFrame"
] | [((1467, 1514), 'tkinter.Toplevel', 'tk.Toplevel', (['parent.root'], {'width': '(800)', 'height': '(480)'}), '(parent.root, width=800, height=480)\n', (1478, 1514), True, 'import tkinter as tk\n'), ((1657, 1675), 'tkinter.Frame', 'tk.Frame', (['self.top'], {}), '(self.top)\n', (1665, 1675), True, 'import tkinter as tk\... |
# Generated by Django 2.2.17 on 2021-03-02 15:18
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cdo', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='availablebidders',
name='status',
... | [
"django.db.models.CharField"
] | [((332, 487), 'django.db.models.CharField', 'models.CharField', ([], {'choices': "[('UA', 'Unassigned'), ('IT', 'In-Transit'), ('OC', 'Over-Complement'), (\n 'AWOL', 'AWOL'), ('', '')]", 'default': '""""""', 'max_length': '(4)'}), "(choices=[('UA', 'Unassigned'), ('IT', 'In-Transit'), ('OC',\n 'Over-Complement'),... |
import logging
import collections
from yawf.permissions import BasePermissionChecker, OrChecker
from yawf.config import INITIAL_STATE
logger = logging.getLogger(__name__)
__all__ = ['Handler', 'SimpleStateTransition', 'ComplexStateTransition',
'EditHandler', 'SerializibleHandlerResult']
class Handler(objec... | [
"yawf.permissions.OrChecker",
"logging.getLogger"
] | [((145, 172), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (162, 172), False, 'import logging\n'), ((2780, 2815), 'yawf.permissions.OrChecker', 'OrChecker', (['*self.permission_checker'], {}), '(*self.permission_checker)\n', (2789, 2815), False, 'from yawf.permissions import BasePermiss... |
from django.core.exceptions import PermissionDenied
from metashare.settings import REST_API_KEY
from metashare.repository.models import resourceInfoType_model
from metashare.storage.models import PUBLISHED
from metashare.repository import model_utils
import sys
TEST = 'test' in sys.argv
def _intersecti... | [
"metashare.repository.models.resourceInfoType_model.objects.get",
"django.core.exceptions.PermissionDenied"
] | [((1925, 2012), 'metashare.repository.models.resourceInfoType_model.objects.get', 'resourceInfoType_model.objects.get', ([], {'storage_object__identifier': "kwargs['object_id']"}), "(storage_object__identifier=kwargs[\n 'object_id'])\n", (1959, 2012), False, 'from metashare.repository.models import resourceInfoType_... |
# Generated by Django 2.2.5 on 2021-01-15 16:49
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('datatable_examples', '0004_person_title'),
]
operations = [
migrations.CreateModel(
name='TagsDirect',
fields=[
... | [
"django.db.models.CharField",
"django.db.models.ManyToManyField",
"django.db.models.AutoField"
] | [((634, 692), 'django.db.models.ManyToManyField', 'models.ManyToManyField', ([], {'to': '"""datatable_examples.TagsDirect"""'}), "(to='datatable_examples.TagsDirect')\n", (656, 692), False, 'from django.db import migrations, models\n'), ((339, 432), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created'... |
import logging
import json
import boto3
from json import JSONDecodeError
from sqstaskmaster import local
logger = logging.getLogger(__name__)
class TaskManager:
def __init__(self, sqs_url, notify=None, queue_constructor=None, sender_name=None):
self.url = sqs_url
self.sender_name = sender_name
... | [
"boto3.resource",
"json.loads",
"logging.getLogger"
] | [((116, 143), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (133, 143), False, 'import logging\n'), ((381, 402), 'boto3.resource', 'boto3.resource', (['"""sqs"""'], {}), "('sqs')\n", (395, 402), False, 'import boto3\n'), ((4731, 4755), 'json.loads', 'json.loads', (['message.body'], {}), ... |
# -*- coding: utf-8 -*-
# Author: github.com/madhavajay
import ast
import os
import sys
from pathlib import Path
from typing import Set
from flake8_kwarger import Plugin
def _results(s: str) -> Set[str]:
tree = ast.parse(s)
plugin = Plugin(tree)
return {f"{line}:{col + 1} {msg}" for line, col, msg, _ in... | [
"ast.parse",
"os.path.dirname",
"flake8_kwarger.Plugin"
] | [((219, 231), 'ast.parse', 'ast.parse', (['s'], {}), '(s)\n', (228, 231), False, 'import ast\n'), ((245, 257), 'flake8_kwarger.Plugin', 'Plugin', (['tree'], {}), '(tree)\n', (251, 257), False, 'from flake8_kwarger import Plugin\n'), ((448, 473), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', ... |
import pytest
import pandas as pd
import numpy as np
from numpy.testing import assert_almost_equal, assert_array_almost_equal
import sys
sys.path.append('..')
from table_evaluator.metrics import *
from table_evaluator.utils import load_data
from dython.nominal import compute_associations, numerical_encoding
from pathli... | [
"sys.path.append",
"pandas.testing.assert_frame_equal",
"table_evaluator.utils.load_data",
"pandas.read_csv",
"pathlib.Path",
"dython.nominal.numerical_encoding",
"dython.nominal.compute_associations"
] | [((137, 158), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (152, 158), False, 'import sys\n'), ((349, 361), 'pathlib.Path', 'Path', (['"""data"""'], {}), "('data')\n", (353, 361), False, 'from pathlib import Path\n'), ((381, 399), 'pathlib.Path', 'Path', (['"""data/tests"""'], {}), "('data/test... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Aug 5 13:06:14 2021
@author: dnootana
"""
import math
def divisors1(integer):
div_low = [i for i in range(2,int(math.sqrt(integer)) + 1) if integer%i==0]
divs = div_low + [integer//i for i in div_low[::-1] if i!=integer//i]
if not divs:
... | [
"math.sqrt"
] | [((622, 640), 'math.sqrt', 'math.sqrt', (['integer'], {}), '(integer)\n', (631, 640), False, 'import math\n'), ((184, 202), 'math.sqrt', 'math.sqrt', (['integer'], {}), '(integer)\n', (193, 202), False, 'import math\n')] |
from flask import Flask, request, current_app
from flask_bootstrap import Bootstrap
from flask_dropzone import Dropzone
from flask_uploads import UploadSet, configure_uploads, IMAGES, \
patch_request_class
from flask_wtf.csrf import CSRFProtect
from config import Config
bootstrap = Bootstrap()
dropzone = Dropzone... | [
"flask.Flask",
"flask_bootstrap.Bootstrap",
"flask_wtf.csrf.CSRFProtect",
"flask_dropzone.Dropzone"
] | [((289, 300), 'flask_bootstrap.Bootstrap', 'Bootstrap', ([], {}), '()\n', (298, 300), False, 'from flask_bootstrap import Bootstrap\n'), ((312, 322), 'flask_dropzone.Dropzone', 'Dropzone', ([], {}), '()\n', (320, 322), False, 'from flask_dropzone import Dropzone\n'), ((330, 343), 'flask_wtf.csrf.CSRFProtect', 'CSRFProt... |
#!/usr/bin/env python
#coding=utf-8
'''
Copyright (c) 2012 chine <<EMAIL>>
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... | [
"hashlib.md5",
"errors.CloudBackupLibError",
"hmac.new",
"time.time",
"mimetypes.guess_type"
] | [((1104, 1134), 'hmac.new', 'hmac.new', (['secret', 'data', 'sha256'], {}), '(secret, data, sha256)\n', (1112, 1134), False, 'import hmac\n'), ((2080, 2110), 'mimetypes.guess_type', 'mimetypes.guess_type', (['filename'], {}), '(filename)\n', (2100, 2110), False, 'import mimetypes\n'), ((1198, 1226), 'hmac.new', 'hmac.n... |
# 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
# d... | [
"dragonflow.db.field_types.IpAddressField",
"dragonflow.db.field_types.ReferenceField",
"dragonflow.db.field_types.MacAddressField"
] | [((945, 971), 'dragonflow.db.field_types.IpAddressField', 'df_fields.IpAddressField', ([], {}), '()\n', (969, 971), True, 'import dragonflow.db.field_types as df_fields\n'), ((986, 1028), 'dragonflow.db.field_types.ReferenceField', 'df_fields.ReferenceField', (['l2.LogicalSwitch'], {}), '(l2.LogicalSwitch)\n', (1010, 1... |
import numpy as np
import itertools
import time
import argparse
import torch
from torch.autograd import Variable
from torch.autograd import grad as torchgrad
import torch.nn.functional as F
from utils.ais import ais_trajectory
from utils.simulate import simulate_data
from utils.hparams import HParams
from utils.math_... | [
"numpy.flip",
"argparse.ArgumentParser",
"utils.ais.ais_trajectory",
"torch.load",
"utils.simulate.simulate_data",
"numpy.mean",
"torch.cuda.is_available",
"utils.math_ops.sigmoidial_schedule",
"numpy.linspace",
"itertools.tee",
"utils.hparams.HParams"
] | [((397, 452), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""bidirectional_mc"""'}), "(description='bidirectional_mc')\n", (420, 452), False, 'import argparse\n'), ((2198, 2223), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (2221, 2223), False, 'import torch\n'... |
"""Module containing the :class:`pirec.artefacts.Artefact` base class and subclasses."""
from __future__ import absolute_import
import os
import tarfile
import tempfile
from .utils import file_sha1sum
class Artefact(object):
"""Base class for Pirec artefacts (files consumed by and generated by processes).
A... | [
"os.path.abspath",
"tempfile.mkstemp",
"os.path.basename",
"os.fdopen",
"os.path.dirname",
"os.path.exists",
"tarfile.open",
"os.path.join"
] | [((4341, 4388), 'tempfile.mkstemp', 'tempfile.mkstemp', ([], {'suffix': 'artefact_cls.extension'}), '(suffix=artefact_cls.extension)\n', (4357, 4388), False, 'import tempfile\n'), ((1159, 1184), 'os.path.abspath', 'os.path.abspath', (['filename'], {}), '(filename)\n', (1174, 1184), False, 'import os\n'), ((1414, 1443),... |
from common.botmain import BotMain
from common.jobwithquery import JobWithQuery
NAME = "Delete page"
DESCRIPTION = "This script deletes all the pages from the given query with the given protection level"
REASON = "Juzgado en VPB"
class MassDelete(JobWithQuery):
def __init__(self):
super().__init__()
... | [
"common.botmain.BotMain",
"sys.exit"
] | [((996, 1016), 'common.botmain.BotMain', 'BotMain', (['DESCRIPTION'], {}), '(DESCRIPTION)\n', (1003, 1016), False, 'from common.botmain import BotMain\n'), ((583, 594), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (591, 594), False, 'import sys\n')] |
import argparse
import gzip
import logging
import multiprocessing
import os
import pathlib
import traceback
from itertools import repeat
import numpy as np
from CONFIG.FOLDER_STRUCTURE import TARGET_DB_NAME, ATOMS, SEQUENCES, STRUCTURE_FILES_PATH, SEQ_ATOMS_DATASET_PATH, MMSEQS_DATABASES_PATH
from CONFIG.RUNTIME_PARA... | [
"itertools.repeat",
"utils.mmseqs_utils.mmseqs_createdb",
"utils.utils.create_unix_time_folder",
"CPP_lib.libAtomDistanceIO.initialize",
"argparse.ArgumentParser",
"utils.mmseqs_utils.mmseqs_createindex",
"gzip.open",
"utils.structure_files_parsers.parse_mmcif.parse_mmcif",
"utils.structure_files_pa... | [((859, 1061), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Read structure files from -i to extract sequence and atom positions. Save them in -o as .faa and .bin files. Create and index new MMSEQS2 database in -db"""'}), "(description=\n 'Read structure files from -i to extract sequ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
from PyQt5.QtWidgets import QApplication
from PyQt5.QtCore import QUrl
from PyQt5.QtWebEngineWidgets import QWebEnginePage
class Client(QWebEnginePage):
def __init__(self, urls):
self.app = QApplication([])
super().__init__... | [
"PyQt5.QtWidgets.QApplication",
"PyQt5.QtCore.QUrl"
] | [((278, 294), 'PyQt5.QtWidgets.QApplication', 'QApplication', (['[]'], {}), '([])\n', (290, 294), False, 'from PyQt5.QtWidgets import QApplication\n'), ((462, 471), 'PyQt5.QtCore.QUrl', 'QUrl', (['url'], {}), '(url)\n', (466, 471), False, 'from PyQt5.QtCore import QUrl\n')] |
import pygame as pg
class DropDown():
def __init__(self, color_menu, color_option, x, y, w, h, font, main, options):
self.color_menu = color_menu
self.color_option = color_option
self.rect = pg.Rect(x, y, w, h)
self.font = font
self.main = main
self.options = options... | [
"pygame.draw.rect",
"pygame.mouse.get_pos",
"pygame.Rect"
] | [((220, 239), 'pygame.Rect', 'pg.Rect', (['x', 'y', 'w', 'h'], {}), '(x, y, w, h)\n', (227, 239), True, 'import pygame as pg\n'), ((452, 519), 'pygame.draw.rect', 'pg.draw.rect', (['surf', 'self.color_menu[self.menu_active]', 'self.rect', '(0)'], {}), '(surf, self.color_menu[self.menu_active], self.rect, 0)\n', (464, 5... |
from typing import TYPE_CHECKING, Callable, TypeVar
from returns.interfaces.specific.result import ResultLikeN
from returns.primitives.hkt import KindN, kinded
if TYPE_CHECKING:
from returns.result import Result # noqa: WPS433
_FirstType = TypeVar('_FirstType')
_SecondType = TypeVar('_SecondType')
_ThirdType = ... | [
"typing.TypeVar",
"returns.primitives.hkt.kinded"
] | [((248, 269), 'typing.TypeVar', 'TypeVar', (['"""_FirstType"""'], {}), "('_FirstType')\n", (255, 269), False, 'from typing import TYPE_CHECKING, Callable, TypeVar\n'), ((284, 306), 'typing.TypeVar', 'TypeVar', (['"""_SecondType"""'], {}), "('_SecondType')\n", (291, 306), False, 'from typing import TYPE_CHECKING, Callab... |
# Generated by Django 2.2.12 on 2020-06-03 17:36
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0002_auto_20200305_0106'),
]
operations = [
migrations.RemoveField(
model_name='user',
name='organization',
... | [
"django.db.migrations.RemoveField"
] | [((225, 287), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""user"""', 'name': '"""organization"""'}), "(model_name='user', name='organization')\n", (247, 287), False, 'from django.db import migrations\n')] |
#!/usr/bin/env python3
# import packages/modules
from gpiozero import LED
from time import sleep
# "Create" a LED at GPIO pin #4
led = LED(4)
# do the following infinitely
while True:
print("led on")
# turn the LED on
led.on()
# wait 4 seconds
sleep(4)
print("led off")
# turn the LED off... | [
"gpiozero.LED",
"time.sleep"
] | [((138, 144), 'gpiozero.LED', 'LED', (['(4)'], {}), '(4)\n', (141, 144), False, 'from gpiozero import LED\n'), ((268, 276), 'time.sleep', 'sleep', (['(4)'], {}), '(4)\n', (273, 276), False, 'from time import sleep\n'), ((360, 368), 'time.sleep', 'sleep', (['(4)'], {}), '(4)\n', (365, 368), False, 'from time import slee... |
"""Experiment to quantify the correlation between the streamline
distance (MAM or MDF) against the Euclidean distance on the
corresponding dissimilarity representation embedding of the
streamlines.
"""
import numpy as np
import nibabel as nib
from euclidean_embeddings import dissimilarity
from functools import partial... | [
"matplotlib.pyplot.title",
"numpy.random.seed",
"matplotlib.pyplot.figure",
"numpy.linalg.norm",
"os.path.exists",
"nibabel.streamlines.load",
"numpy.minimum",
"numpy.corrcoef",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.ion",
"dipy.tracking.streamline.set_number_of_points",
"numpy.random.... | [((4344, 4375), 'numpy.concatenate', 'np.concatenate', (['streamline1_idx'], {}), '(streamline1_idx)\n', (4358, 4375), True, 'import numpy as np\n'), ((4398, 4429), 'numpy.concatenate', 'np.concatenate', (['streamline2_idx'], {}), '(streamline2_idx)\n', (4412, 4429), True, 'import numpy as np\n'), ((4454, 4487), 'numpy... |
from netCDF4 import Dataset
import numpy as np
import pandas as pd
import canyon_tools.readout_tools as rout
#from MITgcmutils import rdmds # cant make it work
#CGrid = '/data/kramosmu/results/TracerExperiments/CNTDIFF/run38/gridGlob.nc' #
#phiHyd = '/data/kramosmu/results/TracerExperiments/CNTDIFF/run38/phiHydGlob.n... | [
"netCDF4.Dataset",
"pandas.DataFrame",
"numpy.zeros",
"numpy.expand_dims",
"numpy.shape",
"numpy.ma.array",
"canyon_tools.readout_tools.getMask",
"canyon_tools.readout_tools.getField"
] | [((509, 524), 'netCDF4.Dataset', 'Dataset', (['phiHyd'], {}), '(phiHyd)\n', (516, 524), False, 'from netCDF4 import Dataset\n'), ((536, 550), 'netCDF4.Dataset', 'Dataset', (['CGrid'], {}), '(CGrid)\n', (543, 550), False, 'from netCDF4 import Dataset\n'), ((660, 686), 'canyon_tools.readout_tools.getField', 'rout.getFiel... |
from argparse import ArgumentParser
from benchmark_utils import PATH
from benchmarker import Benchmarker
from platform import system
"""
Image capture benchmarks
"""
def granular():
output = "| Test | FPS |\n| --- | --- |\n"
rows = []
b.start()
rows.append(b.run(boxes=True, images... | [
"argparse.ArgumentParser",
"benchmarker.Benchmarker",
"benchmark_utils.PATH.write_text",
"benchmark_utils.PATH.read_text",
"platform.system"
] | [((2079, 2095), 'benchmark_utils.PATH.read_text', 'PATH.read_text', ([], {}), '()\n', (2093, 2095), False, 'from benchmark_utils import PATH\n'), ((2282, 2302), 'benchmark_utils.PATH.write_text', 'PATH.write_text', (['txt'], {}), '(txt)\n', (2297, 2302), False, 'from benchmark_utils import PATH\n'), ((2349, 2365), 'arg... |
# Copyright 2020 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 a... | [
"flask.request.files.get",
"flask.jsonify",
"timesketch.lib.tasks.build_index_pipeline",
"os.path.join",
"timesketch.api.v1.utils.update_sketch_last_activity",
"codecs.decode",
"flask.abort",
"timesketch.models.sketch.Timeline.query.filter_by",
"timesketch.models.db_session.add",
"os.path.getsize"... | [((1505, 1547), 'logging.getLogger', 'logging.getLogger', (['"""timesketch.api_upload"""'], {}), "('timesketch.api_upload')\n", (1522, 1547), False, 'import logging\n'), ((3662, 3770), 'timesketch.models.sketch.SearchIndex.get_or_create', 'SearchIndex.get_or_create', ([], {'name': 'name', 'index_name': 'index_name', 'd... |
# -*- coding: utf-8 -*-
"""Register and get the sensor data to the database.
Copyright (c) 2017 <NAME> <<EMAIL>>
EnOceanのセンサーデータをデータベースに登録と取得を行います。
初めて利用する時は、setup_db.shを実行してテーブルを作成してください。
'SENSORLOGS'テーブルの定義は以下のとおりです。
The sensor data of EnOcean get and registered in the database.
The first time you use, please cre... | [
"config.cmConfig",
"sqlite3.connect",
"datetime.datetime.today",
"datetime.timedelta"
] | [((1445, 1455), 'config.cmConfig', 'cmConfig', ([], {}), '()\n', (1453, 1455), False, 'from config import cmConfig\n'), ((1706, 1735), 'sqlite3.connect', 'sqlite3.connect', (['self.db_file'], {}), '(self.db_file)\n', (1721, 1735), False, 'import sqlite3\n'), ((3178, 3203), 'datetime.datetime.today', 'datetime.datetime.... |
import os
from os import path
from wordcloud import WordCloud
d = path.dirname(__file__) if "__file__" in locals() else os.getcwd()
text = open(path.join(d, 'summarization.txt')).read()
wordcloud = WordCloud().generate(text)
import matplotlib.pyplot as plt
plt.figure()
plt.imshow(wordcloud, interpolation="bilinea... | [
"matplotlib.pyplot.show",
"os.getcwd",
"matplotlib.pyplot.imshow",
"os.path.dirname",
"wordcloud.WordCloud",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.figure",
"os.path.join",
"matplotlib.pyplot.savefig"
] | [((263, 275), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (273, 275), True, 'import matplotlib.pyplot as plt\n'), ((276, 323), 'matplotlib.pyplot.imshow', 'plt.imshow', (['wordcloud'], {'interpolation': '"""bilinear"""'}), "(wordcloud, interpolation='bilinear')\n", (286, 323), True, 'import matplotlib.p... |
"""
Interface with github gists with tagging.
This file should have no knowledge of notebooks and only deal with
gists and tagging.
"""
import github
import nbx.compat as compat
def _hashtags(desc):
if not desc:
return []
tags = [tag for tag in desc.split(" ") if tag.startswith("#")]
return tags
... | [
"github.InputFileContent",
"github.Github"
] | [((6672, 6719), 'github.Github', 'github.Github', (['user', 'password'], {'user_agent': '"""nbx"""'}), "(user, password, user_agent='nbx')\n", (6685, 6719), False, 'import github\n'), ((6379, 6411), 'github.InputFileContent', 'github.InputFileContent', (['content'], {}), '(content)\n', (6402, 6411), False, 'import gith... |
# Copyright 2015: Mirantis 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 ap... | [
"asyncio.set_event_loop",
"socket.socket",
"rallyci.services.status.Class",
"mock.Mock",
"aiohttp.request",
"asyncio.new_event_loop"
] | [((767, 816), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_STREAM'], {}), '(socket.AF_INET, socket.SOCK_STREAM)\n', (780, 816), False, 'import socket\n'), ((989, 1013), 'asyncio.new_event_loop', 'asyncio.new_event_loop', ([], {}), '()\n', (1011, 1013), False, 'import asyncio\n'), ((1022, 1050), 'a... |
from .CarDEC_optimization import grad_reconstruction as grad, MSEloss
from .CarDEC_dataloaders import simpleloader, aeloader
import tensorflow as tf
from tensorflow.keras import Model, Sequential
from tensorflow.keras.layers import Dense, concatenate
from tensorflow.keras.optimizers import Adam
from tensorflow.keras.b... | [
"tensorflow.random.set_seed",
"os.mkdir",
"numpy.random.seed",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.metrics.Mean",
"os.path.isdir",
"tensorflow.keras.backend.clear_session",
"numpy.zeros",
"time.time",
"tensorflow.zeros",
"tensorflow.keras.optimizers.Adam",
"random.seed",
"tens... | [((444, 465), 'tensorflow.keras.backend.set_floatx', 'set_floatx', (['"""float32"""'], {}), "('float32')\n", (454, 465), False, 'from tensorflow.keras.backend import set_floatx\n'), ((645, 651), 'tensorflow.keras.optimizers.Adam', 'Adam', ([], {}), '()\n', (649, 651), False, 'from tensorflow.keras.optimizers import Ada... |
# Copyright (C) 2012 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribut... | [
"pml.utils.errors.UnsupportedPlotTypeError",
"matplotlib.pyplot.show"
] | [((1692, 1702), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (1700, 1702), True, 'import matplotlib.pyplot as plt\n'), ((2439, 2449), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (2447, 2449), True, 'import matplotlib.pyplot as plt\n'), ((3029, 3093), 'pml.utils.errors.UnsupportedPlotTypeError', '... |
import logging
from typing import List, Dict, Any, Tuple, Callable
import math
import numpy as np
from scipy.special import logit
from fiesta.util import belief_calc
logger = logging.getLogger(__name__)
def TTTS(data: List[Dict[str, Any]],
model_functions: List[Callable[[List[Dict[str, Any]],
... | [
"fiesta.util.belief_calc",
"numpy.random.uniform",
"numpy.argmax",
"numpy.log2",
"numpy.zeros",
"math.floor",
"numpy.argmin",
"scipy.special.logit",
"numpy.mean",
"numpy.var",
"logging.getLogger"
] | [((178, 205), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (195, 205), False, 'import logging\n'), ((3504, 3524), 'numpy.zeros', 'np.zeros', (['num_models'], {}), '(num_models)\n', (3512, 3524), True, 'import numpy as np\n'), ((3545, 3565), 'numpy.zeros', 'np.zeros', (['num_models'], {}... |
from datetime import datetime
from sqlalchemy import desc
from flask_login import UserMixin
from werkzeug.security import check_password_hash, generate_password_hash
from realtime_er import db
class User(db.Model, UserMixin):
user_id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String(8... | [
"realtime_er.db.ForeignKey",
"realtime_er.db.relationship",
"realtime_er.db.String",
"realtime_er.db.DateTime",
"werkzeug.security.check_password_hash",
"realtime_er.db.Column",
"werkzeug.security.generate_password_hash"
] | [((244, 283), 'realtime_er.db.Column', 'db.Column', (['db.Integer'], {'primary_key': '(True)'}), '(db.Integer, primary_key=True)\n', (253, 283), False, 'from realtime_er import db\n'), ((524, 545), 'realtime_er.db.Column', 'db.Column', (['db.Integer'], {}), '(db.Integer)\n', (533, 545), False, 'from realtime_er import ... |
import grequests
import json
import datetime as dt
import logging
import pytz
SERVERS = {
'test': 'https://api-test.jh.edu/internal/v2/clinical',
'stage': 'https://api-stage.jh.edu/internal/v2/clinical',
'prod': 'https://api.jh.edu/internal/v2/clinical',
# POST-only internal servers
'internal-test... | [
"grequests.get",
"grequests.post",
"logging.warn",
"logging.info",
"datetime.datetime.utcnow",
"pytz.timezone",
"grequests.map"
] | [((2330, 2349), 'grequests.map', 'grequests.map', (['reqs'], {}), '(reqs)\n', (2343, 2349), False, 'import grequests\n'), ((2927, 2946), 'grequests.map', 'grequests.map', (['reqs'], {}), '(reqs)\n', (2940, 2946), False, 'import grequests\n'), ((1202, 1239), 'logging.warn', 'logging.warn', (['"""No patients passed in"""... |
import uuid
from django.db import models
from django.utils.translation import gettext_lazy as _
class TimeStampedModel(models.Model):
created = models.DateTimeField(auto_now_add=True)
modified = models.DateTimeField(auto_now=True)
class Meta:
abstract = True
class UUIDModel(models.Model):
"... | [
"django.db.models.DateTimeField",
"django.db.models.UUIDField",
"django.db.models.BooleanField"
] | [((150, 189), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'auto_now_add': '(True)'}), '(auto_now_add=True)\n', (170, 189), False, 'from django.db import models\n'), ((205, 240), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'auto_now': '(True)'}), '(auto_now=True)\n', (225, 240), F... |
# -*- coding: utf-8 -*-
"""
Created on Fri Feb 28 09:53:14 2020
@author: JP
"""
# Basic Plotting libraries
import matplotlib.pyplot as plt
import matplotlib
import seaborn as sns
from mpl_toolkits.axes_grid1.inset_locator import inset_axes
# Math / Science Libraries
import pandas as pd
import numpy as np
import sci... | [
"ana.HandleMeasurements",
"logging.basicConfig",
"matplotlib.pyplot.plot",
"matplotlib.rcParams.update",
"matplotlib.pyplot.subplots",
"ana.Hloop_Measurement"
] | [((357, 399), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.WARNING'}), '(level=logging.WARNING)\n', (376, 399), False, 'import logging\n'), ((651, 685), 'matplotlib.rcParams.update', 'matplotlib.rcParams.update', (['params'], {}), '(params)\n', (677, 685), False, 'import matplotlib\n'), ((705, ... |
import pandas as pd
import numpy as np
import time
from components.binary_conway_forward_prop_fn import BinaryConwayForwardPropFn
# Randomly take a row in the data and verify the numbers are correct.
def sample_verify(data):
conway = BinaryConwayForwardPropFn(numpy_mode=True)
nrows = len(data)
# Randomly t... | [
"pandas.read_csv",
"components.binary_conway_forward_prop_fn.BinaryConwayForwardPropFn",
"pandas.DataFrame",
"time.time"
] | [((239, 281), 'components.binary_conway_forward_prop_fn.BinaryConwayForwardPropFn', 'BinaryConwayForwardPropFn', ([], {'numpy_mode': '(True)'}), '(numpy_mode=True)\n', (264, 281), False, 'from components.binary_conway_forward_prop_fn import BinaryConwayForwardPropFn\n'), ((2122, 2174), 'pandas.read_csv', 'pd.read_csv',... |
import json
import pathlib
__version__ = json.loads((pathlib.Path(__file__).parent / "VERSION").read_text())["version"]
from .resource_io import (
export_resource_package,
load_raw_resource_description,
load_resource_description,
save_raw_resource_description,
serialize_raw_resource_description,
)... | [
"pathlib.Path"
] | [((54, 76), 'pathlib.Path', 'pathlib.Path', (['__file__'], {}), '(__file__)\n', (66, 76), False, 'import pathlib\n')] |
"""
Copyright (c) 2021, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
"""
import argparse
from collections import Counter, OrderedDict
from components.utils import *
from ... | [
"components.expr_parser.tokenize_s_expr",
"argparse.ArgumentParser",
"executor.logic_form_util.same_logical_form",
"executor.cached_enumeration.CacheBackend.exit_cache_backend",
"components.expr_parser.parse_s_expr",
"executor.cached_enumeration.OntologyInfo.init_ontology_info",
"components.expr_parser.... | [((7917, 7945), 'collections.Counter', 'Counter', (['required_entity_num'], {}), '(required_entity_num)\n', (7924, 7945), False, 'from collections import Counter, OrderedDict\n'), ((8983, 8998), 'components.expr_parser.parse_s_expr', 'parse_s_expr', (['x'], {}), '(x)\n', (8995, 8998), False, 'from components.expr_parse... |
import network
import re
import subprocess
class NetworkCommands:
def __init__(self):
if network.is_windows():
self.commands = NetworkCommandsWindows()
pass
def find_gateway(self):
return self.commands.find_gateway()
def set_ipv4_forwarding(self, enabled):
re... | [
"subprocess.check_output",
"network.is_windows"
] | [((104, 124), 'network.is_windows', 'network.is_windows', ([], {}), '()\n', (122, 124), False, 'import network\n'), ((657, 694), 'subprocess.check_output', 'subprocess.check_output', (["['ipconfig']"], {}), "(['ipconfig'])\n", (680, 694), False, 'import subprocess\n'), ((1102, 1179), 'subprocess.check_output', 'subproc... |
# -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/items.html
from scrapy import Item, Field
class ZapItem(Item):
# Extraídos do Json
id = Field()
title = Field()
action = Field()
type = Field()
country =... | [
"scrapy.Field"
] | [((239, 246), 'scrapy.Field', 'Field', ([], {}), '()\n', (244, 246), False, 'from scrapy import Item, Field\n'), ((259, 266), 'scrapy.Field', 'Field', ([], {}), '()\n', (264, 266), False, 'from scrapy import Item, Field\n'), ((280, 287), 'scrapy.Field', 'Field', ([], {}), '()\n', (285, 287), False, 'from scrapy import ... |
import os
import shutil
import numpy as np
import pytest
import matchzoo as mz
@pytest.fixture(scope='module')
def train_data():
return mz.datasets.toy.load_data()
@pytest.fixture(scope='module')
def test_data():
return mz.datasets.toy.load_data(stage='test')
@pytest.fixture(scope='module')
def task(req... | [
"matchzoo.DataGenerator",
"matchzoo.load_model",
"pytest.fixture",
"matchzoo.tasks.Ranking",
"matchzoo.datasets.toy.load_data",
"matchzoo.models.DSSM",
"shutil.rmtree",
"matchzoo.preprocessors.DSSMPreprocessor"
] | [((84, 114), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (98, 114), False, 'import pytest\n'), ((175, 205), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (189, 205), False, 'import pytest\n'), ((277, 307), 'pytest.fixture', 'pyt... |
#!/usr/bin/python
import paho.mqtt.client as paho
import os
import ssl
import sys
import picamera
import RPi.GPIO as GPIO
import time
import logging
from PIL import Image
from time import sleep
from boto.s3.connection import S3Connection
from boto.s3.key import Key
from w1thermsensor import W1ThermSensor
## Local im... | [
"sys.stdout.write",
"RPi.GPIO.setmode",
"boto.s3.key.Key",
"os.remove",
"RPi.GPIO.setup",
"w1thermsensor.W1ThermSensor",
"time.strftime",
"RPi.GPIO.add_event_detect",
"logging.Formatter",
"time.sleep",
"PIL.Image.open",
"sys.stdout.flush",
"ConfigMap.configSectionMap",
"paho.mqtt.client.Cl... | [((554, 573), 'picamera.PiCamera', 'picamera.PiCamera', ([], {}), '()\n', (571, 573), False, 'import picamera\n'), ((604, 617), 'paho.mqtt.client.Client', 'paho.Client', ([], {}), '()\n', (615, 617), True, 'import paho.mqtt.client as paho\n'), ((627, 642), 'w1thermsensor.W1ThermSensor', 'W1ThermSensor', ([], {}), '()\n... |
import os
import random
import time
import json
from locust import HttpLocust, TaskSet, task
from lib.baseTaskSet import baseTaskSet
# TODO - make these config-driven
from lib.openstack.keystone import get_auth_token
from lib.openstack.nova import list_servers
from lib.openstack.nova import list_servers_detail
from ... | [
"lib.openstack.nova.list_servers_detail",
"json.loads",
"lib.openstack.nova.revert_resize_server",
"lib.openstack.nova.delete_server",
"lib.openstack.nova.confirm_resize_server",
"lib.openstack.nova.list_servers",
"random.choice",
"lib.openstack.nova.resize_server",
"time.sleep",
"lib.openstack.no... | [((949, 957), 'locust.task', 'task', (['(10)'], {}), '(10)\n', (953, 957), False, 'from locust import HttpLocust, TaskSet, task\n'), ((1579, 1586), 'locust.task', 'task', (['(4)'], {}), '(4)\n', (1583, 1586), False, 'from locust import HttpLocust, TaskSet, task\n'), ((2063, 2070), 'locust.task', 'task', (['(1)'], {}), ... |
from flask_wtf import Form
from wtforms.fields import StringField
from flask.ext.wtf.html5 import URLField
from wtforms.validators import DataRequired, url
class BookmarkForm(Form):
url = URLField('The URL for your bookmark', validators=[DataRequired(), url()])
description = StringField('Add an optional descr... | [
"flask_wtf.Form.validate",
"wtforms.fields.StringField",
"wtforms.validators.DataRequired",
"wtforms.validators.url"
] | [((286, 328), 'wtforms.fields.StringField', 'StringField', (['"""Add an optional description"""'], {}), "('Add an optional description')\n", (297, 328), False, 'from wtforms.fields import StringField\n'), ((534, 553), 'flask_wtf.Form.validate', 'Form.validate', (['self'], {}), '(self)\n', (547, 553), False, 'from flask... |