code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import os
import sys
from flask import Flask, send_file
sys.path.insert(1, ".")
from flask_discord_interactions import DiscordInteractions # noqa: E402
app = Flask(__name__)
discord = DiscordInteractions(app)
app.config["DISCORD_CLIENT_ID"] = os.environ["DISCORD_CLIENT_ID"]
app.config["DISCORD_PUBLIC_KEY"] = os.... | [
"flask.send_file",
"sys.path.insert",
"flask_discord_interactions.DiscordInteractions",
"flask.Flask"
] | [((58, 81), 'sys.path.insert', 'sys.path.insert', (['(1)', '"""."""'], {}), "(1, '.')\n", (73, 81), False, 'import sys\n'), ((164, 179), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (169, 179), False, 'from flask import Flask, send_file\n'), ((190, 214), 'flask_discord_interactions.DiscordInteractions', ... |
"""
Django settings for wissenslandkarte project.
Generated by 'django-admin startproject' using Django 3.1.7.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
fro... | [
"django.core.management.utils.get_random_secret_key",
"os.getenv",
"pathlib.Path"
] | [((5521, 5557), 'os.getenv', 'os.getenv', (['"""COLLECTSTATIC_DIR"""', 'None'], {}), "('COLLECTSTATIC_DIR', None)\n", (5530, 5557), False, 'import os\n'), ((1484, 1507), 'django.core.management.utils.get_random_secret_key', 'get_random_secret_key', ([], {}), '()\n', (1505, 1507), False, 'from django.core.management.uti... |
#!/usr/bin/env python3
#
# Copyright Soramitsu Co., Ltd. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
#
import csv
import rst
import glossary
import os
perm_type = category = perm = ""
MATRIX_PATH = 'permissions/matrix.csv'
result = ['.. DON\'T MODIFY THE CONTENTS MANUALLY.',
' THIS IS AUT... | [
"csv.DictReader",
"rst.header",
"rst.reference",
"rst.permissions_list",
"rst.listing",
"glossary.read_titles",
"rst.example",
"rst.hint",
"rst.excerpt",
"rst.note",
"rst.linkify"
] | [((574, 602), 'rst.header', 'rst.header', (['"""Permissions"""', '(0)'], {}), "('Permissions', 0)\n", (584, 602), False, 'import rst\n'), ((646, 668), 'glossary.read_titles', 'glossary.read_titles', ([], {}), '()\n', (666, 668), False, 'import glossary\n'), ((858, 894), 'rst.header', 'rst.header', (['"""List of Permiss... |
'''
MIT License
Copyright (c) 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, including without limitation the rights
to use, copy, modify, merge, publish, distri... | [
"pandas.pivot_table",
"pandas.read_csv",
"model.auxiliary.percentile",
"model.auxiliary.parse_scenario_name",
"pandas.concat",
"pandas.read_excel",
"pandas.DataFrame",
"time.time"
] | [((1632, 1664), 'pandas.read_csv', 'pd.read_csv', (['intermediate_result'], {}), '(intermediate_result)\n', (1643, 1664), True, 'import pandas as pd\n'), ((1882, 1896), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (1894, 1896), True, 'import pandas as pd\n'), ((5460, 5579), 'pandas.pivot_table', 'pd.pivot_tabl... |
# Copyright (c) 2015 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | [
"sahara.utils.openstack.nova.client",
"mock.patch"
] | [((888, 954), 'mock.patch', 'mock.patch', (['"""sahara.utils.openstack.base.url_for"""'], {'return_value': '""""""'}), "('sahara.utils.openstack.base.url_for', return_value='')\n", (898, 954), False, 'import mock\n'), ((1185, 1270), 'mock.patch', 'mock.patch', (['"""novaclient.v1_1.images.ImageManager.list"""'], {'retu... |
# This python script creates a fruit database that will
# be used by the flask application
import sqlite3
from sqlite3 import Error
def create_connection():
try:
connection = sqlite3.connect('fruits.db')
return connection
except Error:
print(Error)
def create_table(connection):
cu... | [
"sqlite3.connect"
] | [((189, 217), 'sqlite3.connect', 'sqlite3.connect', (['"""fruits.db"""'], {}), "('fruits.db')\n", (204, 217), False, 'import sqlite3\n')] |
import sys
import random
def printList(a):
strn=''
for item in a:
strn+=str(item)+' '
return strn
def swap(a,p1,p2):
a[p1],a[p2]=a[p2],a[p1]
return a
def Partition(a,p,q):
x=a[q]
i=p-1
for j in range(p,q):
if a[j]<=x:
i=i+1
swap(a,i,j)
swap(a,i+1,q)
return i+1
def RandomPartition(a,p,q):
r=ra... | [
"sys.stdin.readlines",
"random.randrange"
] | [((502, 523), 'sys.stdin.readlines', 'sys.stdin.readlines', ([], {}), '()\n', (521, 523), False, 'import sys\n'), ((318, 340), 'random.randrange', 'random.randrange', (['p', 'q'], {}), '(p, q)\n', (334, 340), False, 'import random\n')] |
from colorama import Fore, Style #for styling and coloring
import socket #for communication
soc = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) #TCP socket initiation
port = 1025 ... | [
"socket.socket"
] | [((179, 227), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_DGRAM'], {}), '(socket.AF_INET, socket.SOCK_DGRAM)\n', (192, 227), False, 'import socket\n')] |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-11-15 19:06
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('peeldb', '0040_auto_201711... | [
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.db.models.BooleanField",
"django.db.models.AutoField",
"django.db.models.DateTimeField"
] | [((468, 561), '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", (484, 561), False, 'from django.db import migrations, models\... |
from dataclasses import dataclass
from typing import Tuple
from manim import config
from manim import DEFAULT_MOBJECT_TO_EDGE_BUFFER
from manim import DEFAULT_MOBJECT_TO_MOBJECT_BUFFER
from manim import DOWN
from manim import LEFT
from manim import Mobject
from manim import np
from manim import ORIGIN
from manim impor... | [
"manim.np.array",
"manim.Polygon"
] | [((865, 908), 'manim.Polygon', 'Polygon', (['self.ul', 'self.ur', 'self.dr', 'self.dl'], {}), '(self.ul, self.ur, self.dr, self.dl)\n', (872, 908), False, 'from manim import Polygon\n'), ((2251, 2270), 'manim.np.array', 'np.array', (['[1, 1, 1]'], {}), '([1, 1, 1])\n', (2259, 2270), False, 'from manim import np\n'), ((... |
import smart_imports
smart_imports.all()
settings = utils_app_settings.app_settings('PLACES',
MAX_DESCRIPTION_LENGTH=1000,
CHRONICLE_RECORDS_NUMBER=10,
START_PLACE_SAFETY_PERCENTAGE=0.3... | [
"smart_imports.all"
] | [((23, 42), 'smart_imports.all', 'smart_imports.all', ([], {}), '()\n', (40, 42), False, 'import smart_imports\n')] |
"""
Cordis to Neo4j
===============
Task for piping Cordis data from SQL to Neo4j.
"""
from nesta.core.orms.cordis_orm import Base
from nesta.core.orms.orm_utils import db_session_query, get_mysql_engine
from nesta.core.orms.orm_utils import graph_session
from nesta.core.luigihacks.luigi_logging import set_log_level
... | [
"eurito_daps.packages.cordis.cordis_neo4j.orm_to_neo4j",
"nesta.core.orms.orm_utils.get_mysql_engine",
"nesta.core.orms.orm_utils.graph_session",
"luigi.BoolParameter",
"nesta.core.luigihacks.misctools.get_config",
"nesta.core.luigihacks.mysqldb.MySqlTarget",
"nesta.core.luigihacks.luigi_logging.set_log... | [((780, 813), 'luigi.BoolParameter', 'luigi.BoolParameter', ([], {'default': '(True)'}), '(default=True)\n', (799, 813), False, 'import luigi\n'), ((4012, 4046), 'luigi.BoolParameter', 'luigi.BoolParameter', ([], {'default': '(False)'}), '(default=False)\n', (4031, 4046), False, 'import luigi\n'), ((1088, 1132), 'nesta... |
# coding=utf-8
import os
from flask import Flask
app = Flask(__name__)
conf = type('Config', (), {})()
conf.DEBUG = True
conf.SQLALCHEMY_DATABASE_URI = \
os.environ.get(
'SQLALCHEMY_DATABASE_URI',
'sqlite:///{}'.format(os.path.join(app.root_path, 'project.db')))
conf.SQLALCHEMY_TRACK_MODIFICAT... | [
"os.path.join",
"flask.Flask"
] | [((58, 73), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (63, 73), False, 'from flask import Flask\n'), ((244, 285), 'os.path.join', 'os.path.join', (['app.root_path', '"""project.db"""'], {}), "(app.root_path, 'project.db')\n", (256, 285), False, 'import os\n')] |
import numpy as np
from neural import LSTM_WindTurbine
from neural import LSTM_PvSystem
from neural import LSTM_LedSystem
from neural import LSTM_LoadStationSystem
from neural.example import LSTM
# WIND TURBINE SYSTEM functions
def predictPw(forecastHours, visualize):
val = LSTM_WindTurbine.LSTM_RUN(
"dat... | [
"numpy.random.rand",
"neural.example.LSTM.LSTM_RUN",
"neural.LSTM_PvSystem.LSTM_RUN",
"neural.LSTM_LoadStationSystem.LSTM_RUN",
"neural.LSTM_LedSystem.LSTM_RUN",
"numpy.random.randint",
"neural.LSTM_WindTurbine.LSTM_RUN"
] | [((281, 366), 'neural.LSTM_WindTurbine.LSTM_RUN', 'LSTM_WindTurbine.LSTM_RUN', (['"""data/dummy/WindTurbine.csv"""', 'forecastHours', 'visualize'], {}), "('data/dummy/WindTurbine.csv', forecastHours,\n visualize)\n", (306, 366), False, 'from neural import LSTM_WindTurbine\n'), ((430, 485), 'neural.LSTM_WindTurbine.L... |
import unittest
import numpy as np
from audiomentations.augmentations.transforms import Mp3Compression
from audiomentations.core.composition import Compose
class TestMp3Compression(unittest.TestCase):
def test_apply_mp3_compression_pydub(self):
sample_len = 44100
samples_in = np.random.normal(0,... | [
"audiomentations.augmentations.transforms.Mp3Compression",
"numpy.random.normal"
] | [((2606, 2654), 'audiomentations.augmentations.transforms.Mp3Compression', 'Mp3Compression', ([], {'min_bitrate': '(400)', 'max_bitrate': '(800)'}), '(min_bitrate=400, max_bitrate=800)\n', (2620, 2654), False, 'from audiomentations.augmentations.transforms import Mp3Compression\n'), ((2720, 2764), 'audiomentations.augm... |
# -*- coding: utf-8 -*-
u"""Where external resources are stored
:copyright: Copyright (c) 2015 Bivio Software, Inc. All Rights Reserved.
:license: http://www.apache.org/licenses/LICENSE-2.0.html
"""
from __future__ import absolute_import, division, print_function
# Root module: Import only builtin packages so avoid ... | [
"pykern.pkio.py_path",
"importlib.import_module",
"glob.glob",
"pykern.pkinspect.caller_module"
] | [((2336, 2351), 'pykern.pkio.py_path', 'pkio.py_path', (['f'], {}), '(f)\n', (2348, 2351), False, 'from pykern import pkio\n'), ((2310, 2322), 'glob.glob', 'glob.glob', (['f'], {}), '(f)\n', (2319, 2322), False, 'import glob\n'), ((2634, 2660), 'importlib.import_module', 'importlib.import_module', (['m'], {}), '(m)\n',... |
import numpy as np
import tensorflow as tf
class Model:
"""Model class
Used for storing methods that generalize to all models.
"""
def __init__(
self,
initial_conditions=None,
model_parameters=None,
final_time=None,
time_steps=None):
... | [
"tensorflow.unstack",
"tensorflow.tensor",
"tensorflow.tanh",
"tensorflow.Session",
"numpy.array",
"numpy.linspace",
"tensorflow.constant",
"tensorflow.cosh",
"tensorflow.exp",
"tensorflow.stack"
] | [((1080, 1115), 'tensorflow.constant', 'tf.constant', (['arg1'], {'dtype': 'tf.float64'}), '(arg1, dtype=tf.float64)\n', (1091, 1115), True, 'import tensorflow as tf\n'), ((2002, 2054), 'numpy.linspace', 'np.linspace', (['(0)', 'self.final_time'], {'num': 'self.time_steps'}), '(0, self.final_time, num=self.time_steps)\... |
import numpy as np
def load_synth_spectra(regridded=True, small=False, npca=10,\
noise=False, SN=10, datapath=None,\
wave_split=None, boss=False, hetsced=False,
bossnoise=False, test=False):
if datapath is None:
datapath = "/net/vdesk/d... | [
"sklearn.model_selection.train_test_split",
"numpy.median",
"numpy.load",
"numpy.zeros"
] | [((5769, 5786), 'numpy.load', 'np.load', (['filename'], {}), '(filename)\n', (5776, 5786), True, 'import numpy as np\n'), ((6135, 6209), 'sklearn.model_selection.train_test_split', 'train_test_split', (['attributes', 'targets'], {'test_size': 'rest_size', 'random_state': '(0)'}), '(attributes, targets, test_size=rest_s... |
# Copyright 2014 Hewlett-Packard Development Company, L.P.
#
# 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 requir... | [
"oslo_utils.timeutils.utcnow",
"six.moves.queue.PriorityQueue"
] | [((5392, 5413), 'six.moves.queue.PriorityQueue', 'Queue.PriorityQueue', ([], {}), '()\n', (5411, 5413), True, 'from six.moves import queue as Queue\n'), ((1312, 1330), 'oslo_utils.timeutils.utcnow', 'timeutils.utcnow', ([], {}), '()\n', (1328, 1330), False, 'from oslo_utils import timeutils\n'), ((3552, 3575), 'six.mov... |
# -*- coding: UTF-8 -*-
""""
Created on 04.12.21
:author: <NAME>
"""
import multiprocessing
import os
import unittest
from multiprocessing.queues import Queue
from windpyutils.parallel.own_proc_pools import FunctorPool, FunctorWorker, T, R
class MockWorker(FunctorWorker):
def __init__(self):
super(... | [
"unittest.main",
"os.cpu_count",
"windpyutils.parallel.own_proc_pools.FunctorPool",
"multiprocessing.Event"
] | [((3992, 4007), 'unittest.main', 'unittest.main', ([], {}), '()\n', (4005, 4007), False, 'import unittest\n'), ((388, 411), 'multiprocessing.Event', 'multiprocessing.Event', ([], {}), '()\n', (409, 411), False, 'import multiprocessing\n'), ((438, 461), 'multiprocessing.Event', 'multiprocessing.Event', ([], {}), '()\n',... |
import unittest
from iterable_collections import collect
class TestContains(unittest.TestCase):
def test_list(self):
c = collect([1, 2, 3, 4, 5])
self.assertTrue(c.contains(1))
self.assertFalse(c.contains('a'))
def test_set(self):
c = collect({1, 2, 3, 4, 5})
self.as... | [
"iterable_collections.collect"
] | [((137, 161), 'iterable_collections.collect', 'collect', (['[1, 2, 3, 4, 5]'], {}), '([1, 2, 3, 4, 5])\n', (144, 161), False, 'from iterable_collections import collect\n'), ((280, 304), 'iterable_collections.collect', 'collect', (['{1, 2, 3, 4, 5}'], {}), '({1, 2, 3, 4, 5})\n', (287, 304), False, 'from iterable_collect... |
from django.urls import path
from . import views
from .views import PostListView, PostDetailView, PostCreateView, PostUpdateView, PostDeleteView
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
urlpatterns = [
path("", PostListView.as_view(), name="Blog-Home"),
path("post/<int:pk>/", PostDe... | [
"django.contrib.staticfiles.urls.staticfiles_urlpatterns",
"django.urls.path"
] | [((715, 740), 'django.contrib.staticfiles.urls.staticfiles_urlpatterns', 'staticfiles_urlpatterns', ([], {}), '()\n', (738, 740), False, 'from django.contrib.staticfiles.urls import staticfiles_urlpatterns\n'), ((593, 639), 'django.urls.path', 'path', (['"""about/"""', 'views.about'], {'name': '"""Blog-About"""'}), "('... |
# -*- coding: utf-8 -*-
from rq import Connection, Worker
from tracim.command import AppContextCommand
class MailSenderCommend(AppContextCommand):
def get_description(self):
return '''Run rq worker for mail sending'''
def take_action(self, parsed_args):
super().take_action(parsed_args)
... | [
"rq.Connection",
"rq.Worker"
] | [((329, 341), 'rq.Connection', 'Connection', ([], {}), '()\n', (339, 341), False, 'from rq import Connection, Worker\n'), ((359, 382), 'rq.Worker', 'Worker', (["['mail_sender']"], {}), "(['mail_sender'])\n", (365, 382), False, 'from rq import Connection, Worker\n')] |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow as tf
from tensorflow.keras import layers
import json
import os
import glob
import sys
class NN(tf.keras.Model):
def __init__(self, tf_inputs, args):
super(NN,... | [
"tensorflow.keras.metrics.Accuracy",
"tensorflow.train.Checkpoint",
"tensorflow.keras.Model",
"tensorflow.shape",
"tensorflow.keras.optimizers.schedules.ExponentialDecay",
"tensorflow.keras.metrics.CategoricalCrossentropy",
"tensorflow.keras.optimizers.Adam",
"tensorflow.GradientTape",
"tensorflow.a... | [((1760, 1832), 'tensorflow.keras.losses.CategoricalCrossentropy', 'tf.keras.losses.CategoricalCrossentropy', ([], {'label_smoothing': 'label_smoothing'}), '(label_smoothing=label_smoothing)\n', (1799, 1832), True, 'import tensorflow as tf\n'), ((1873, 1900), 'tensorflow.keras.metrics.Accuracy', 'tf.keras.metrics.Accur... |
import torch
from difflr import CONFIG
from difflr.utils import plot_information_transfer
from difflr.models import LinearClassifierDSC
from difflr.data import MNISTDataset, CIFARDataset, FashionMNISTDataset
from torch_pruning import prune_linear
CONFIG.DRY_RUN = False
def epoch_end_hook(model:LinearClassifierDSC):
... | [
"torch.manual_seed",
"torch.sigmoid",
"difflr.utils.plot_information_transfer",
"difflr.models.LinearClassifierDSC"
] | [((483, 529), 'difflr.utils.plot_information_transfer', 'plot_information_transfer', (['model', 'edge_weights'], {}), '(model, edge_weights)\n', (508, 529), False, 'from difflr.utils import plot_information_transfer\n'), ((695, 715), 'torch.manual_seed', 'torch.manual_seed', (['(0)'], {}), '(0)\n', (712, 715), False, '... |
from __future__ import absolute_import
import six
from abc import abstractmethod
import logging
from django.db.models import Prefetch
from django.core import exceptions as django_exceptions
from clims.services.exceptions import DoesNotExist
from clims.models.extensible import ExtensibleProperty
from clims.models impor... | [
"logging.getLogger",
"clims.models.extensible.ExtensibleProperty.objects.filter",
"django.db.models.Prefetch",
"clims.models.ResultIterator",
"six.text_type"
] | [((586, 628), 'logging.getLogger', 'logging.getLogger', (['self.__class__.__name__'], {}), '(self.__class__.__name__)\n', (603, 628), False, 'import logging\n'), ((2984, 3019), 'clims.models.ResultIterator', 'ResultIterator', (['qs', 'self.to_wrapper'], {}), '(qs, self.to_wrapper)\n', (2998, 3019), False, 'from clims.m... |
import argparse
import configparser
import torch
import os
import numpy as np
import matplotlib.animation as animation
import matplotlib.pyplot as plt
from model import ValueNetwork
from env import ENV
from train import run_one_episode
def visualize(model_config, env_config, weight_path, case, save):
state_dim = ... | [
"matplotlib.pyplot.Rectangle",
"matplotlib.pyplot.Circle",
"matplotlib.pyplot.show",
"argparse.ArgumentParser",
"train.run_one_episode",
"torch.load",
"numpy.sin",
"os.path.join",
"env.ENV",
"matplotlib.pyplot.Line2D",
"numpy.cos",
"model.ValueNetwork",
"configparser.RawConfigParser",
"mat... | [((1020, 1039), 'torch.device', 'torch.device', (['"""cpu"""'], {}), "('cpu')\n", (1032, 1039), False, 'import torch\n'), ((1055, 1091), 'env.ENV', 'ENV', ([], {'config': 'env_config', 'phase': '"""test"""'}), "(config=env_config, phase='test')\n", (1058, 1091), False, 'from env import ENV\n'), ((1129, 1215), 'model.Va... |
# coding: utf-8
from apps import app
from .views import *
url_prefix = "/abc/123"
app.add_url_rule("/index", view_func=index1, methods=['GET', ], strict_slashes=False)
app.add_url_rule("/app", view_func=Task.as_view("apps"), strict_slashes=False)
| [
"apps.app.add_url_rule"
] | [((83, 170), 'apps.app.add_url_rule', 'app.add_url_rule', (['"""/index"""'], {'view_func': 'index1', 'methods': "['GET']", 'strict_slashes': '(False)'}), "('/index', view_func=index1, methods=['GET'],\n strict_slashes=False)\n", (99, 170), False, 'from apps import app\n')] |
from parlai.agents.programr.parser.exceptions import ParserException
from parlai.agents.programr.parser.pattern.nodes.base import PatternNode
# from parlai.agents.programr.utils.logging.ylogger import YLogger
import parlai.utils.logging as logging
class PatternTopicNode(PatternNode):
def __init__(self, userid='*'... | [
"parlai.agents.programr.parser.exceptions.ParserException",
"parlai.agents.programr.parser.pattern.nodes.base.PatternNode.__init__",
"parlai.utils.logging.error"
] | [((331, 365), 'parlai.agents.programr.parser.pattern.nodes.base.PatternNode.__init__', 'PatternNode.__init__', (['self', 'userid'], {}), '(self, userid)\n', (351, 365), False, 'from parlai.agents.programr.parser.pattern.nodes.base import PatternNode\n'), ((988, 1041), 'parlai.agents.programr.parser.exceptions.ParserExc... |
"""Author: <NAME>, Copyright 2019, MIT License"""
from multiarchy.loggers.logger import Logger
import tensorflow as tf
class TensorboardInterface(Logger):
def __init__(
self,
replay_buffer,
logging_dir,
):
# create a separate tensor board logging thread
self.replay_b... | [
"tensorflow.shape",
"tensorflow.summary.create_file_writer",
"tensorflow.io.gfile.makedirs",
"tensorflow.expand_dims",
"tensorflow.summary.scalar",
"tensorflow.summary.image"
] | [((459, 492), 'tensorflow.io.gfile.makedirs', 'tf.io.gfile.makedirs', (['logging_dir'], {}), '(logging_dir)\n', (479, 492), True, 'import tensorflow as tf\n'), ((515, 557), 'tensorflow.summary.create_file_writer', 'tf.summary.create_file_writer', (['logging_dir'], {}), '(logging_dir)\n', (544, 557), True, 'import tenso... |
import ast
from amqp import ChannelError
from kombu import Connection
from kombu.common import uuid, maybe_declare
from mock import patch, ANY
from cell.actors import Actor, ActorProxy
from cell.exceptions import WrongNumberOfArguments
from cell.results import AsyncResult
from cell.tests.utils import Case, Mock, with_... | [
"kombu.Connection",
"kombu.entity.Exchange",
"mock.patch",
"mock.patch.object",
"kombu.common.maybe_declare",
"cell.tests.utils.Mock",
"kombu.common.uuid",
"cell.utils.qualname"
] | [((12955, 12980), 'mock.patch', 'patch', (['"""cell.actors.uuid"""'], {}), "('cell.actors.uuid')\n", (12960, 12980), False, 'from mock import patch, ANY\n'), ((13848, 13901), 'mock.patch', 'patch', (['"""kombu.transport.memory.Channel.basic_publish"""'], {}), "('kombu.transport.memory.Channel.basic_publish')\n", (13853... |
'''
Created on Jan 16, 2017
@author: bardya
'''
import pandas as pd
import numpy as np
import scipy.stats as stats
import argparse
import statsmodels.sandbox.stats.multicomp as sm
import seaborn as sns
import os
def parse_args(args):
parser = argparse.ArgumentParser(description='From a set of multi fasta files i... | [
"pandas.Series",
"statsmodels.sandbox.stats.multicomp.multipletests",
"argparse.ArgumentParser",
"pandas.read_csv",
"scipy.stats.fisher_exact",
"os.path.join",
"pandas.DataFrame"
] | [((250, 414), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""From a set of multi fasta files in the input-directory extract 1 or more representative sequences randomly for each"""'}), "(description=\n 'From a set of multi fasta files in the input-directory extract 1 or more representa... |
#!/usr/bin/env python3
import sys
import os
import subprocess
from dsrlib.meta import Meta
class SudoNotFound(Exception):
pass
class SudoError(Exception):
def __init__(self, code, errData):
self.code = code
self.stderr = errData
super().__init__()
def sudoLaunch(*args):
for p... | [
"os.path.exists",
"dsrlib.meta.Meta.isFrozen",
"os.path.join",
"os.path.dirname",
"dsrlib.meta.Meta.decodePlatformString"
] | [((505, 520), 'dsrlib.meta.Meta.isFrozen', 'Meta.isFrozen', ([], {}), '()\n', (518, 520), False, 'from dsrlib.meta import Meta\n'), ((380, 406), 'os.path.join', 'os.path.join', (['path', '"""sudo"""'], {}), "(path, 'sudo')\n", (392, 406), False, 'import os\n'), ((418, 438), 'os.path.exists', 'os.path.exists', (['sudo']... |
from __future__ import absolute_import, unicode_literals
from pyfondy import utils
from .tests_helper import TestCase
class UtilTest(TestCase):
def setUp(self):
self.data = self.get_dummy_data()
def test_to_xml(self):
xml = utils.to_xml(self.data['checkout_data'])
self.assertEqual(xml... | [
"pyfondy.utils.join_url",
"pyfondy.utils.from_form",
"pyfondy.utils.to_xml",
"pyfondy.utils.to_form",
"pyfondy.utils.from_xml"
] | [((251, 291), 'pyfondy.utils.to_xml', 'utils.to_xml', (["self.data['checkout_data']"], {}), "(self.data['checkout_data'])\n", (263, 291), False, 'from pyfondy import utils\n'), ((452, 501), 'pyfondy.utils.to_xml', 'utils.to_xml', (["{'req': self.data['checkout_data']}"], {}), "({'req': self.data['checkout_data']})\n", ... |
#!/usr/bin/env python3
import os
import signal
import threading
from . import ntp
import core.potloader as potloader
import core.utils as utils
from .dblogger import DBThread
class NTPot(potloader.PotLoader):
""" Implementation of NTP honeypot that responds to NTP messages type 3, 6 and 7.
"""
def name... | [
"signal.signal",
"signal.pause",
"core.utils.format_unit",
"os.path.dirname",
"core.utils.sep_thousand",
"threading.Thread"
] | [((2668, 2702), 'threading.Thread', 'threading.Thread', ([], {'target': 'ntpot.run'}), '(target=ntpot.run)\n', (2684, 2702), False, 'import threading\n'), ((2745, 2804), 'signal.signal', 'signal.signal', (['signal.SIGINT', 'ntpot.shutdown_signal_wrapper'], {}), '(signal.SIGINT, ntpot.shutdown_signal_wrapper)\n', (2758,... |
import re
import csv
"""
This reads in all the files from the Kaggle test.csv file and generates a file
listing all the filtered words encountered along with a basic count
"""
def run(kaggleTestFile,testCountOutputFile):
results = {}
words = []
lineCount = 0
with open(kaggleTestFile, mode='r')... | [
"re.sub",
"csv.DictReader"
] | [((352, 376), 'csv.DictReader', 'csv.DictReader', (['csv_file'], {}), '(csv_file)\n', (366, 376), False, 'import csv\n'), ((501, 550), 're.sub', 're.sub', (['"""[^a-zA-Z0-9]+"""', '""" """', "row['comment_text']"], {}), "('[^a-zA-Z0-9]+', ' ', row['comment_text'])\n", (507, 550), False, 'import re\n'), ((597, 637), 're... |
# author: leisurexi
# date: 2021-01-17 20:08
# Python 对象的比较和拷贝
import copy
# 浅拷贝,是指重新分配一块内存,创建一个新的对象,里面的元素是原对象中子对象的引用。因此,如果原对象中的元素不可变,那倒无所谓;但如果元素可变,浅拷贝通常会带来一些副作用
def shallow_copy():
l1 = [1, 2, 3]
l2 = list(l1)
l3 = l1[:]
print('=======================浅拷贝=======================')
print(l1 == l2)
... | [
"copy.copy",
"copy.deepcopy"
] | [((538, 551), 'copy.copy', 'copy.copy', (['l1'], {}), '(l1)\n', (547, 551), False, 'import copy\n'), ((1239, 1256), 'copy.deepcopy', 'copy.deepcopy', (['l1'], {}), '(l1)\n', (1252, 1256), False, 'import copy\n'), ((1424, 1440), 'copy.deepcopy', 'copy.deepcopy', (['x'], {}), '(x)\n', (1437, 1440), False, 'import copy\n'... |
import sdl2
from entity_types import EntityType
class Textures:
"""Contains and manages the application's textures and layers.
"""
# Number of layers the user can choose from
NUM_LAYERS = 4
def get(self, texture):
"""Returns the SDL texture designated by the texture enum.
:param ... | [
"sdl2.SDL_DestroyTexture",
"sdl2.SDL_RenderClear",
"sdl2.sdlimage.IMG_LoadTexture",
"sdl2.SDL_CreateTexture",
"sdl2.SDL_SetRenderTarget",
"sdl2.SDL_SetRenderDrawColor",
"sdl2.SDL_RendererInfo",
"sdl2.SDL_GetRendererInfo"
] | [((1070, 1119), 'sdl2.sdlimage.IMG_LoadTexture', 'sdl2.sdlimage.IMG_LoadTexture', (['renderer', 'filename'], {}), '(renderer, filename)\n', (1099, 1119), False, 'import sdl2\n'), ((5271, 5294), 'sdl2.SDL_RendererInfo', 'sdl2.SDL_RendererInfo', ([], {}), '()\n', (5292, 5294), False, 'import sdl2\n'), ((5303, 5343), 'sdl... |
# -*- coding: utf-8 -*-
"""
Created on Tue 26 March 18:44:45 2020
@author: Mnemosyne
Vocal learning model results (plots of)
"""
import os
import time
import glob
import pickle
import numpy as np
import matplotlib
import librosa
from matplotlib import rcParams, cm, colors
import matplotlib.pyplot as plt
import matpl... | [
"numpy.sqrt",
"matplotlib.pyplot.ylabel",
"numpy.sin",
"numpy.arange",
"librosa.load",
"numpy.mean",
"numpy.histogram",
"argparse.ArgumentParser",
"numpy.where",
"matplotlib.pyplot.xlabel",
"songbird_data_analysis.Song_functions.smooth_data",
"numpy.max",
"matplotlib.pyplot.close",
"numpy.... | [((661, 703), 'numpy.sqrt', 'np.sqrt', (['(v[0] ** 2 + v[1] ** 2 + v[2] ** 2)'], {}), '(v[0] ** 2 + v[1] ** 2 + v[2] ** 2)\n', (668, 703), True, 'import numpy as np\n'), ((859, 901), 'numpy.sqrt', 'np.sqrt', (['(v[0] ** 2 + v[1] ** 2 + v[2] ** 2)'], {}), '(v[0] ** 2 + v[1] ** 2 + v[2] ** 2)\n', (866, 901), True, 'impor... |
# Generated by Django 3.2.8 on 2021-10-09 20:02
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("authentik_stages_authenticator_sms", "0001_initial"),
]
operations = [
migrations.AddField(
model_name="authenticatorsmsstage",
... | [
"django.db.models.TextField"
] | [((370, 398), 'django.db.models.TextField', 'models.TextField', ([], {'default': '""""""'}), "(default='')\n", (386, 398), False, 'from django.db import migrations, models\n')] |
from unittest import TestCase
from wcctrl.hardware.sensor.brightness.bh1750 import *
import smbus
class TestBH1750(TestCase):
def __init__(self):
# bus = smbus.SMBus(0) # Rev 1 Pi uses 0
self.bus = smbus.SMBus(1) # Rev 2 Pi uses 1
self.sensor = BH1750(self.bus)
def test_sensor(self... | [
"smbus.SMBus"
] | [((222, 236), 'smbus.SMBus', 'smbus.SMBus', (['(1)'], {}), '(1)\n', (233, 236), False, 'import smbus\n')] |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, division
import os
import itertools
import pyfasta
import allel
import petl as etl
import h5py
import pandas
import zarr
import seaborn as sns
title = 'Phase 2 AR1 release'
pop_ids = (
'AOcol',
'GHcol',
'BFcol',
'CIcol'... | [
"itertools.chain",
"os.path.exists",
"petl.fromtsv",
"seaborn.color_palette",
"pandas.read_csv",
"os.path.join",
"h5py.File",
"allel.FeatureTable.from_gff3",
"zarr.open_group",
"petl.empty"
] | [((1042, 1070), 'seaborn.color_palette', 'sns.color_palette', (['"""Reds"""', '(5)'], {}), "('Reds', 5)\n", (1059, 1070), True, 'import seaborn as sns\n'), ((1079, 1108), 'seaborn.color_palette', 'sns.color_palette', (['"""Blues"""', '(4)'], {}), "('Blues', 4)\n", (1096, 1108), True, 'import seaborn as sns\n'), ((1118,... |
#!/usr/bin/python
#
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | [
"time.time"
] | [((1021, 1032), 'time.time', 'time.time', ([], {}), '()\n', (1030, 1032), False, 'import time\n')] |
# Author : <NAME>
# Date : July 1st, 2010
# last update: $Date: 2010/03/17 18:17:34 $ by $Author: mussgill $
import FWCore.ParameterSet.Config as cms
#_________________________________HLT bits___________________________________________
import HLTrigger.HLTfilters.hltHighLevel_cfi
ALCARECOTkAlCosmicsInCollis... | [
"FWCore.ParameterSet.Config.Sequence",
"FWCore.ParameterSet.Config.vstring",
"FWCore.ParameterSet.Config.untracked.bool",
"FWCore.ParameterSet.Config.bool"
] | [((2175, 2324), 'FWCore.ParameterSet.Config.Sequence', 'cms.Sequence', (['(cosmicDCTracksSeq * ALCARECOTkAlCosmicsInCollisionsHLT +\n ALCARECOTkAlCosmicsInCollisionsDCSFilter + ALCARECOTkAlCosmicsInCollisions)'], {}), '(cosmicDCTracksSeq * ALCARECOTkAlCosmicsInCollisionsHLT +\n ALCARECOTkAlCosmicsInCollisionsDCSF... |
from collections import Counter, defaultdict
from functools import reduce
from operator import mul
from utils import prime_factors
if __name__ == '__main__':
d = defaultdict(int)
counters = (Counter(prime_factors(i)) for i in range(1, 21))
for c in counters:
d.update({k: max(v, d[k]) for k, v in c... | [
"collections.defaultdict",
"utils.prime_factors"
] | [((168, 184), 'collections.defaultdict', 'defaultdict', (['int'], {}), '(int)\n', (179, 184), False, 'from collections import Counter, defaultdict\n'), ((209, 225), 'utils.prime_factors', 'prime_factors', (['i'], {}), '(i)\n', (222, 225), False, 'from utils import prime_factors\n')] |
import random
class NotecardPseudoSensor:
def __init__(self, card):
self.card = card
# Read the temperature from the Notecard’s temperature
# sensor. The Notecard captures a new temperature sample every
# five minutes.
def temp(self):
temp_req = {"req": "card.temp"}
temp_rsp = self.card.Transact... | [
"random.uniform"
] | [((490, 512), 'random.uniform', 'random.uniform', (['(45)', '(50)'], {}), '(45, 50)\n', (504, 512), False, 'import random\n')] |
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision.models as models
def _upsample_like(src, tar):
src = F.interpolate(src, size=tar.shape[2:],
mode='bilinear',
align_corners=True)
return src
class ConvBNReLU(nn.Module):
... | [
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.ModuleList",
"torch.nn.Conv2d",
"torch.cat",
"torch.nn.functional.interpolate",
"torchvision.models.resnet50",
"torch.nn.functional.max_pool2d",
"torch.rand"
] | [((145, 220), 'torch.nn.functional.interpolate', 'F.interpolate', (['src'], {'size': 'tar.shape[2:]', 'mode': '"""bilinear"""', 'align_corners': '(True)'}), "(src, size=tar.shape[2:], mode='bilinear', align_corners=True)\n", (158, 220), True, 'import torch.nn.functional as F\n'), ((9792, 9819), 'torch.rand', 'torch.ran... |
from __future__ import print_function
import sys
import os
from . import session
if sys.version_info < (2,7):
import unittest2 as unittest
else:
import unittest
class Test_ITree(session.make_sessions_mixin([('otherrods', 'rods')], []), unittest.TestCase):
def setUp(self):
super(Test_ITree, self... | [
"os.path.join",
"os.path.basename"
] | [((2691, 2738), 'os.path.basename', 'os.path.basename', (['self.admin.session_collection'], {}), '(self.admin.session_collection)\n', (2707, 2738), False, 'import os\n'), ((2784, 2819), 'os.path.join', 'os.path.join', (['""".."""', 'collection_name'], {}), "('..', collection_name)\n", (2796, 2819), False, 'import os\n'... |
import cv2
from darcyai.perceptor.coral.people_perceptor import PeoplePerceptor
from darcyai.input.camera_stream import CameraStream
from darcyai.output.live_feed_stream import LiveFeedStream
from darcyai.pipeline import Pipeline
#Create a callback function for handling the input that is about to pass to the People P... | [
"darcyai.input.camera_stream.CameraStream",
"darcyai.output.live_feed_stream.LiveFeedStream",
"darcyai.perceptor.coral.people_perceptor.PeoplePerceptor",
"darcyai.pipeline.Pipeline"
] | [((1999, 2047), 'darcyai.input.camera_stream.CameraStream', 'CameraStream', ([], {'video_device': '"""/dev/video0"""', 'fps': '(20)'}), "(video_device='/dev/video0', fps=20)\n", (2011, 2047), False, 'from darcyai.input.camera_stream import CameraStream\n'), ((2157, 2186), 'darcyai.pipeline.Pipeline', 'Pipeline', ([], {... |
from datetime import datetime
from mongoengine import DateTimeField, Document, UUIDField
from mongoengine.fields import DictField, ListField, ReferenceField
from vim_adaptor.models.vims import BaseVim
class ServiceInstance(Document):
"""
Document class to store data related to a service instance
"""
... | [
"mongoengine.fields.DictField",
"mongoengine.fields.ReferenceField",
"mongoengine.UUIDField",
"mongoengine.DateTimeField"
] | [((327, 354), 'mongoengine.UUIDField', 'UUIDField', ([], {'primary_key': '(True)'}), '(primary_key=True)\n', (336, 354), False, 'from mongoengine import DateTimeField, Document, UUIDField\n'), ((372, 410), 'mongoengine.DateTimeField', 'DateTimeField', ([], {'default': 'datetime.utcnow'}), '(default=datetime.utcnow)\n',... |
#
# Copyright (C) 2015 <NAME>
#
# Full copyright notice can be found in LICENSE.
#
from collections import OrderedDict
__author__ = '<NAME>'
class SearchTask(object):
"""A search task consisting of multiple search sessions."""
def __init__(self, task):
self._task = task
self.search_sessions... | [
"collections.OrderedDict"
] | [((788, 801), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (799, 801), False, 'from collections import OrderedDict\n')] |
# Copyright 2020 IBM Corp. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | [
"platform.python_implementation",
"platform.release",
"platform.system",
"sys.exit",
"platform.machine",
"platform.python_version",
"ctypes.sizeof"
] | [((1790, 1807), 'platform.system', 'platform.system', ([], {}), '()\n', (1805, 1807), False, 'import platform\n'), ((1839, 1857), 'platform.release', 'platform.release', ([], {}), '()\n', (1855, 1857), False, 'import platform\n'), ((1888, 1906), 'platform.machine', 'platform.machine', ([], {}), '()\n', (1904, 1906), Fa... |
import cv2
import mediapipe as mp
mp_drawing = mp.solutions.drawing_utils
mp_drawing_styles = mp.solutions.drawing_styles
mp_hands = mp.solutions.hands
capture = cv2.VideoCapture("videos/sign_language.mp4")
frame_width = int(capture.get(3))
frame_height = int(capture.get(4))
size = (frame_width, frame_height)
result =... | [
"cv2.imshow",
"cv2.destroyAllWindows",
"cv2.VideoCapture",
"cv2.VideoWriter_fourcc",
"cv2.cvtColor",
"cv2.waitKey"
] | [((163, 207), 'cv2.VideoCapture', 'cv2.VideoCapture', (['"""videos/sign_language.mp4"""'], {}), "('videos/sign_language.mp4')\n", (179, 207), False, 'import cv2\n'), ((1172, 1195), 'cv2.destroyAllWindows', 'cv2.destroyAllWindows', ([], {}), '()\n', (1193, 1195), False, 'import cv2\n'), ((370, 401), 'cv2.VideoWriter_fou... |
from __future__ import print_function
from collections import defaultdict
from docopt import docopt
import pyNastran
class IGES(object):
supported = [106, 110, 112, 114, 124, 126, 128, 142, 144,]
maybe_supported = [100]
def __init__(self):
"""
http://www.transcendata.com/support/cadfix/faq/... | [
"collections.defaultdict",
"docopt.docopt"
] | [((3657, 3681), 'docopt.docopt', 'docopt', (['msg'], {'version': 'ver'}), '(msg, version=ver)\n', (3663, 3681), False, 'from docopt import docopt\n'), ((3215, 3231), 'collections.defaultdict', 'defaultdict', (['str'], {}), '(str)\n', (3226, 3231), False, 'from collections import defaultdict\n')] |
# -*- coding: utf-8 -*-
from django.db import DatabaseError
from django.http import HttpResponse
from explorer.exporters import get_exporter_class
from explorer.utils import url_get_params
def _export(request, query, download=True):
_fmt = request.GET.get('format', 'csv')
exporter_class = get_exporter_class... | [
"django.http.HttpResponse",
"explorer.utils.url_get_params",
"explorer.exporters.get_exporter_class"
] | [((302, 326), 'explorer.exporters.get_exporter_class', 'get_exporter_class', (['_fmt'], {}), '(_fmt)\n', (320, 326), False, 'from explorer.exporters import get_exporter_class\n'), ((346, 369), 'explorer.utils.url_get_params', 'url_get_params', (['request'], {}), '(request)\n', (360, 369), False, 'from explorer.utils im... |
# -*- coding: utf-8 -*-
import time
import json
import logging
import requests
import hashlib
from odoo import api, fields, models
from odoo.exceptions import UserError
_logger = logging.getLogger(__name__)
class GetAliDinDinToken(models.TransientModel):
_description = '获取钉钉token值'
_name = 'ali.dindin.get.to... | [
"logging.getLogger",
"json.loads",
"logging.info",
"requests.get"
] | [((180, 207), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (197, 207), False, 'import logging\n'), ((1088, 1140), 'requests.get', 'requests.get', ([], {'url': 'token_url', 'params': 'data', 'timeout': '(10)'}), '(url=token_url, params=data, timeout=10)\n', (1100, 1140), False, 'import r... |
import binascii
import hashlib
import json
import os
import time
import bencode
import bitmath
from assemblyline_v4_service.common.base import ServiceBase
from assemblyline_v4_service.common.result import Result, ResultSection, BODY_FORMAT
class TorrentSlicer(ServiceBase):
def __init__(self, config=None):
... | [
"binascii.hexlify",
"json.dump",
"os.path.join",
"bencode.bencode",
"assemblyline_v4_service.common.result.ResultSection",
"time.localtime",
"bencode.bdecode",
"assemblyline_v4_service.common.result.Result",
"bitmath.Byte"
] | [((7680, 7717), 'assemblyline_v4_service.common.result.ResultSection', 'ResultSection', (['"""Torrent File Details"""'], {}), "('Torrent File Details')\n", (7693, 7717), False, 'from assemblyline_v4_service.common.result import Result, ResultSection, BODY_FORMAT\n'), ((8211, 8297), 'assemblyline_v4_service.common.resul... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.db.models.deletion
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('employee... | [
"django.db.models.DateField",
"django.db.models.FloatField",
"django.db.models.ForeignKey",
"django.db.models.IntegerField",
"django.db.models.AutoField",
"django.db.models.DateTimeField",
"django.db.migrations.swappable_dependency",
"django.db.models.CharField"
] | [((243, 300), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (274, 300), False, 'from django.db import models, migrations\n'), ((531, 624), 'django.db.models.AutoField', 'models.AutoField', ([], {'verbose_name': '"""ID"... |
import pygame
class Window:
def __init__(self, screen, rect):
self.screen = screen
self.children = []
self.rect = rect
self.surface = screen.subsurface(rect)
self.background_color = None
def add_child(self, child):
self.children.append(child)
def render(se... | [
"pygame.font.Font",
"pygame.font.get_default_font",
"pygame.Rect"
] | [((844, 861), 'pygame.Rect', 'pygame.Rect', (['rect'], {}), '(rect)\n', (855, 861), False, 'import pygame\n'), ((980, 1010), 'pygame.font.get_default_font', 'pygame.font.get_default_font', ([], {}), '()\n', (1008, 1010), False, 'import pygame\n'), ((1032, 1066), 'pygame.font.Font', 'pygame.font.Font', (['default_font',... |
from flask import Flask, redirect, abort, url_for
app = Flask(__name__)
app.debug = True
@app.route('/')
def index():
return redirect(url_for('login'))
@app.route('/login')
def login():
abort(401)
this_is_never_executed()
if __name__ == '__main__':
app.run()
| [
"flask.abort",
"flask.url_for",
"flask.Flask"
] | [((56, 71), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (61, 71), False, 'from flask import Flask, redirect, abort, url_for\n'), ((196, 206), 'flask.abort', 'abort', (['(401)'], {}), '(401)\n', (201, 206), False, 'from flask import Flask, redirect, abort, url_for\n'), ((139, 155), 'flask.url_for', 'url_... |
from django.contrib import admin
# Register your models here.
from api import models
admin.register(models.User)
admin.register(models.Video)
admin.register(models.Coffer)
admin.register(models.Trash)
admin.register(models.Radio)
admin.register(models.Note)
admin.register(models.Doc)
admin.register(models.Img) | [
"django.contrib.admin.register"
] | [((87, 114), 'django.contrib.admin.register', 'admin.register', (['models.User'], {}), '(models.User)\n', (101, 114), False, 'from django.contrib import admin\n'), ((115, 143), 'django.contrib.admin.register', 'admin.register', (['models.Video'], {}), '(models.Video)\n', (129, 143), False, 'from django.contrib import a... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Oct 8 17:13:10 2018
@author: quinn
"""
import h5py
import json
import numpy as np
from model import model
## Section on reading weights
def read_weights(weights):
out = {}
if isinstance(weights, h5py.Dataset):
return np.asarray(wei... | [
"numpy.asarray",
"model.model",
"argparse.ArgumentParser",
"h5py.File"
] | [((1473, 1484), 'model.model', 'model', (['name'], {}), '(name)\n', (1478, 1484), False, 'from model import model\n'), ((1496, 1515), 'h5py.File', 'h5py.File', (['filename'], {}), '(filename)\n', (1505, 1515), False, 'import h5py\n'), ((2758, 2869), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'descripti... |
from django import forms
from django.core import validators
from .models import User
from django.contrib.auth import get_user_model
class SignupForm(forms.ModelForm):
first_name = forms.CharField(
max_length=254,
widget=forms.TextInput(attrs={'id':'inputFirstname', 'class':'form-control form-con... | [
"django.contrib.auth.get_user_model",
"django.forms.PasswordInput",
"django.forms.EmailInput",
"django.forms.TextInput"
] | [((999, 1015), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (1013, 1015), False, 'from django.contrib.auth import get_user_model\n'), ((244, 370), 'django.forms.TextInput', 'forms.TextInput', ([], {'attrs': "{'id': 'inputFirstname', 'class': 'form-control form-control-rounded',\n 'placeh... |
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
# Copyright (C) <NAME> <<EMAIL>>
#
# 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 rig... | [
"logging.getLogger",
"os.walk",
"os.path.join",
"apps.kb.models.Procedure.objects.get_or_create",
"os.path.splitext",
"apps.kb.models.Procedure.objects.get",
"apps.kb.models.Procedure.objects.count",
"os.path.basename",
"os.path.abspath",
"apps.kb.models.Procedure.objects.all",
"django.db.transa... | [((1514, 1549), 'logging.getLogger', 'logging.getLogger', (['"""jobs.update-kb"""'], {}), "('jobs.update-kb')\n", (1531, 1549), False, 'import logging\n'), ((2263, 2299), 'os.walk', 'os.walk', (['settings.DOKUWIKI_PAGES_DIR'], {}), '(settings.DOKUWIKI_PAGES_DIR)\n', (2270, 2299), False, 'import os\n'), ((2995, 3026), '... |
from django.contrib import admin
from .models import Play, Reservation
admin.register(Play)
admin.register(Reservation)
| [
"django.contrib.admin.register"
] | [((74, 94), 'django.contrib.admin.register', 'admin.register', (['Play'], {}), '(Play)\n', (88, 94), False, 'from django.contrib import admin\n'), ((95, 122), 'django.contrib.admin.register', 'admin.register', (['Reservation'], {}), '(Reservation)\n', (109, 122), False, 'from django.contrib import admin\n')] |
import base64
import urllib2
import json
import os
import logging
from celery import task
from django.conf import settings
from django.utils.timezone import now
from github.GithubObject import NotSet
from github import Github, GithubException, InputGitTreeElement
from ide.git import git_auth_check, get_github
from id... | [
"logging.getLogger",
"ide.utils.sdk.generate_manifest",
"base64.b64encode",
"ide.utils.git.git_sha",
"ide.models.project.Project.objects.select_related",
"ide.tasks.run_compile",
"urllib2.urlopen",
"ide.utils.sdk.manifest_name_for_project",
"celery.task",
"ide.git.get_github",
"django.utils.time... | [((796, 823), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (813, 823), False, 'import logging\n'), ((827, 847), 'celery.task', 'task', ([], {'acks_late': '(True)'}), '(acks_late=True)\n', (831, 847), False, 'from celery import task\n'), ((1970, 1990), 'urllib2.Request', 'urllib2.Request... |
import os
from easydict import EasyDict as edict
import torch
import torch.utils.model_zoo as model_zoo
#from torchvision.models.resnet import model_urls
from common_pytorch.base_modules.deconv_head import DeconvHead
from common_pytorch.base_modules.resnet import resnet_spec, ResnetBackbone
from common_pytorch.base_m... | [
"os.path.exists",
"common_pytorch.base_modules.architecture.PoseNet_2branch",
"common_pytorch.base_modules.deconv_head.DeconvHead",
"torch.load",
"os.path.join",
"easydict.EasyDict",
"os.path.dirname",
"common_pytorch.base_modules.resnet.ResnetBackbone",
"common_pytorch.base_modules.architecture.Pos... | [((428, 435), 'easydict.EasyDict', 'edict', ([], {}), '()\n', (433, 435), True, 'from easydict import EasyDict as edict\n'), ((2286, 2347), 'common_pytorch.base_modules.resnet.ResnetBackbone', 'ResnetBackbone', (['block_type', 'layers', 'network_cfg.input_channel'], {}), '(block_type, layers, network_cfg.input_channel)... |
import abc
import copy
import re
import pandas as pd
class Feature(metaclass=abc.ABCMeta):
def __init__(self, name, path):
self.name = name
self.path = path
self._data = None
def data(self):
if self._data is None:
self.load_data()
return self._data
@... | [
"pandas.Series",
"re.compile",
"pandas.merge",
"copy.deepcopy",
"pandas.concat"
] | [((1200, 1232), 'pandas.Series', 'pd.Series', (['shard'], {'index': 'df.index'}), '(shard, index=df.index)\n', (1209, 1232), True, 'import pandas as pd\n'), ((1374, 1422), 'pandas.concat', 'pd.concat', (['shards'], {'ignore_index': '(True)', 'copy': '(False)'}), '(shards, ignore_index=True, copy=False)\n', (1383, 1422)... |
from __future__ import annotations
import random
from typing import Callable, Mapping, Set, Union
from itertools import product
import attr
from dfa.dfa import Letter, State
Action = Letter
@attr.s(frozen=True, auto_attribs=True)
class ExplicitDistribution:
"""Object representing a discrete distribution over... | [
"random.choices",
"attr.s"
] | [((198, 236), 'attr.s', 'attr.s', ([], {'frozen': '(True)', 'auto_attribs': '(True)'}), '(frozen=True, auto_attribs=True)\n', (204, 236), False, 'import attr\n'), ((824, 862), 'attr.s', 'attr.s', ([], {'frozen': '(True)', 'auto_attribs': '(True)'}), '(frozen=True, auto_attribs=True)\n', (830, 862), False, 'import attr\... |
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
#
# This file is part of S4D.
#
# SD4 is a python package for speaker diarization based on SIDEKIT.
# S4D home page: http://www-lium.univ-lemans.fr/s4d/
# SIDEKIT home page: http://www-lium.univ-lemans.fr/sidekit/
#
# S4D is free software: you can redistribute it and/or m... | [
"numpy.ones",
"os.path.splitext",
"sidekit.features_server.FeaturesServer",
"os.path.dirname",
"os.path.basename",
"re.sub",
"sidekit.features_extractor.FeaturesExtractor",
"logging.info",
"logging.error"
] | [((1528, 1551), 're.sub', 're.sub', (['"""_+"""', '"""_"""', 'name'], {}), "('_+', '_', name)\n", (1534, 1551), False, 'import re\n'), ((1764, 1790), 'os.path.splitext', 'os.path.splitext', (['fullpath'], {}), '(fullpath)\n', (1780, 1790), False, 'import os\n'), ((1981, 1999), 'os.path.dirname', 'os.path.dirname', (['p... |
from enum import Enum
from typing import TypeVar, Type
from swift.data_base_provider import * # ficar esperto porque tem aqui coisa do provedor db que ta errado no cursor
T = TypeVar('T')
class RowType(Enum):
Multiple = 1,
Single = 2,
SingleOrDefault = 3
class SwiftSqlMapper(object):
__poolConnect... | [
"typing.TypeVar"
] | [((177, 189), 'typing.TypeVar', 'TypeVar', (['"""T"""'], {}), "('T')\n", (184, 189), False, 'from typing import TypeVar, Type\n')] |
#!/usr/bin/env pytest
# -*- coding: utf-8 -*-
__author__ = "<NAME>"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
__copyright__ = "Copyright (C) 2020, Nokia"
__license__ = "BSD-3"
from gold_inference.gold_observation_table import GoldObservationTable
def test_gold_observation_table_check_input_consistency():
... | [
"gold_inference.gold_observation_table.GoldObservationTable"
] | [((390, 434), 'gold_inference.gold_observation_table.GoldObservationTable', 'GoldObservationTable', (['s_plus', 's_minus', 'sigma'], {}), '(s_plus, s_minus, sigma)\n', (410, 434), False, 'from gold_inference.gold_observation_table import GoldObservationTable\n'), ((606, 650), 'gold_inference.gold_observation_table.Gold... |
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from a2c_ppo_acktr.distributions import Bernoulli, Categorical, DiagGaussian
from a2c_ppo_acktr.utils import init
class Flatten(nn.Module):
def forward(self, x):
return x.view(x.size(0), -1)
class Policy(nn.Module):
... | [
"torch.nn.ReLU",
"torch.nn.linear",
"numpy.sqrt",
"torch.nn.Tanh",
"torch.nn.init.constant_",
"torch.nn.ModuleList",
"a2c_ppo_acktr.distributions.Bernoulli",
"torch.nn.Conv2d",
"torch.nn.init.orthogonal_",
"a2c_ppo_acktr.distributions.Categorical",
"torch.nn.MaxPool2d",
"torch.nn.Linear",
"t... | [((8491, 8500), 'torch.nn.ReLU', 'nn.ReLU', ([], {}), '()\n', (8498, 8500), True, 'import torch.nn as nn\n'), ((10155, 10175), 'torch.nn.MaxPool2d', 'nn.MaxPool2d', (['(2, 2)'], {}), '((2, 2))\n', (10167, 10175), True, 'import torch.nn as nn\n'), ((10523, 10540), 'torch.nn.ModuleList', 'nn.ModuleList', (['[]'], {}), '(... |
# MIT License
#
# Copyright (C) 2021. Huawei Technologies Co., Ltd. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation th... | [
"ray.rllib.agents.ppo.PPOTrainer",
"ray.rllib.agents.ppo.DEFAULT_CONFIG.copy",
"ray.rllib.agents.ddpg.TD3Trainer",
"ray.rllib.agents.ddpg.DDPGTrainer",
"ray.rllib.agents.ddpg.DEFAULT_CONFIG.copy"
] | [((1633, 1702), 'ray.rllib.agents.ppo.PPOTrainer', 'ppo.PPOTrainer', ([], {'env': 'env', 'config': 'config', 'logger_creator': 'logger_creator'}), '(env=env, config=config, logger_creator=logger_creator)\n', (1647, 1702), True, 'import ray.rllib.agents.ppo as ppo\n'), ((2853, 2878), 'ray.rllib.agents.ppo.DEFAULT_CONFIG... |
from enum import Enum
import os
import pygame
import pygame.gfxdraw
import pygame.ftfont
import pygame.image
import pygame.transform
import numpy as np
import game_logic as game
from square_rect import SquareRect
from config import config
SQUARESIZE = 100
HALF_SQUARE = int(SQUARESIZE / 2)
RADIUS = int(HALF_SQUARE - ... | [
"numpy.flip",
"pygame.display.set_mode",
"square_rect.SquareRect",
"os.environ.get",
"pygame.image.load",
"pygame.draw.rect",
"pygame.ftfont.init",
"square_rect.SquareRect.from_rect"
] | [((641, 661), 'pygame.ftfont.init', 'pygame.ftfont.init', ([], {}), '()\n', (659, 661), False, 'import pygame\n'), ((666, 694), 'os.environ.get', 'os.environ.get', (['"""FULLSCREEN"""'], {}), "('FULLSCREEN')\n", (680, 694), False, 'import os\n'), ((709, 757), 'pygame.display.set_mode', 'pygame.display.set_mode', (['siz... |
"""
Fit zero-mean GPCSD to baseline period of auditory LFP recordings.
Investigate power and extract phases for coupling analysis in Matlab.
Creates Figure 2 in the paper.
"""
# %% Imports
import autograd.numpy as np
from scipy import signal
import matplotlib.pyplot as plt
import scipy.io
import pickle
import os.path... | [
"matplotlib.pyplot.grid",
"autograd.numpy.arange",
"matplotlib.pyplot.ylabel",
"scipy.signal.filtfilt",
"autograd.numpy.random.choice",
"matplotlib.pyplot.imshow",
"autograd.numpy.logical_and",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"autograd.numpy.loadtxt",
"autograd.numpy.abs",
... | [((559, 576), 'autograd.numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (573, 576), True, 'import autograd.numpy as np\n'), ((1689, 1702), 'autograd.numpy.array', 'np.array', (['lfp'], {}), '(lfp)\n', (1697, 1702), True, 'import autograd.numpy as np\n'), ((1780, 1810), 'autograd.numpy.mean', 'np.mean', ([... |
import pandas as pd
def opsd():
return pd.read_csv('https://raw.githubusercontent.com/jenfly/opsd/master/opsd_germany_daily.csv', sep=",")
def presidents():
return pd.read_csv('https://sololearn.com/uploads/files/president_heights_party.csv', index_col='name')
def sacramento_crime():
return pd... | [
"pandas.read_table",
"pandas.read_json",
"pandas.read_csv"
] | [((49, 158), 'pandas.read_csv', 'pd.read_csv', (['"""https://raw.githubusercontent.com/jenfly/opsd/master/opsd_germany_daily.csv"""'], {'sep': '""","""'}), "(\n 'https://raw.githubusercontent.com/jenfly/opsd/master/opsd_germany_daily.csv'\n , sep=',')\n", (60, 158), True, 'import pandas as pd\n'), ((182, 282), 'p... |
#!/usr/bin/env python
# ___INFO__MARK_BEGIN__
#######################################################################################
# Copyright 2008-2021 Univa Corporation (acquired and owned by Altair Engineering Inc.)
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file exc... | [
"drmaa2.JobSession",
"drmaa2.JobTemplate"
] | [((1040, 1059), 'drmaa2.JobSession', 'JobSession', (['"""js-01"""'], {}), "('js-01')\n", (1050, 1059), False, 'from drmaa2 import JobSession\n'), ((1312, 1374), 'drmaa2.JobTemplate', 'JobTemplate', (["{'remote_command': '/bin/sleep', 'args': ['100']}"], {}), "({'remote_command': '/bin/sleep', 'args': ['100']})\n", (132... |
import unittest
import os
from translator import utils
class TestUtils(unittest.TestCase):
def test_project_root_path(self):
self.assertEqual(os.path.dirname(os.path.dirname(__file__)), utils.get_project_root_path())
def test_get_random_int(self):
self.assertIn(utils.get_random_int(0, 1), [0,... | [
"translator.utils.generate_random_subnet",
"translator.utils.str_dots_to_dict",
"translator.utils.get_project_root_path",
"translator.utils.deep_update_dict",
"translator.utils.tosca_type_parse",
"os.path.dirname",
"translator.utils.str_dots_to_arr",
"unittest.main",
"translator.utils.get_random_int... | [((3080, 3095), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3093, 3095), False, 'import unittest\n'), ((404, 449), 'translator.utils.tosca_type_parse', 'utils.tosca_type_parse', (['"""tosca.nodes.Compute"""'], {}), "('tosca.nodes.Compute')\n", (426, 449), False, 'from translator import utils\n'), ((627, 680), ... |
from atrax.common.crawl_job import CrawlJob
crawl_job = CrawlJob('siemens17042013')
domain = crawl_job.crawled_urls
attribute_names = set()
next_token = None
try:
while True:
query = "select * from `%s`" % domain.name
items = domain.select(query, next_token=next_token)
numItems = 0
... | [
"atrax.common.crawl_job.CrawlJob"
] | [((57, 84), 'atrax.common.crawl_job.CrawlJob', 'CrawlJob', (['"""siemens17042013"""'], {}), "('siemens17042013')\n", (65, 84), False, 'from atrax.common.crawl_job import CrawlJob\n')] |
"""Extend length of Platform.identifier field
Revision ID: 39b90ad3675e
Revises: <KEY>
Create Date: 2021-12-01 21:08:52.761161+00:00
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "39b90ad3675e"
down_revision = "<KEY>"
branch_labels = None
depends_on = None
d... | [
"sqlalchemy.VARCHAR",
"sqlalchemy.String"
] | [((486, 507), 'sqlalchemy.VARCHAR', 'sa.VARCHAR', ([], {'length': '(30)'}), '(length=30)\n', (496, 507), True, 'import sqlalchemy as sa\n'), ((523, 543), 'sqlalchemy.String', 'sa.String', ([], {'length': '(50)'}), '(length=50)\n', (532, 543), True, 'import sqlalchemy as sa\n'), ((814, 834), 'sqlalchemy.String', 'sa.Str... |
# -*- coding: utf-8 -*-
""""
ニューラルネットワーク・サンプル
"""
import os
import sys
import numpy as np
def main():
sys.path.append(os.path.join(os.getcwd(), 'src', 'lib'))
from neuralnetwork import NeuralNetwork
import utils
seed_value = 8976
# 学習データの作成 (評価にも利用)
X_train = np.array([
... | [
"os.getcwd",
"utils.plot_error_log",
"numpy.array",
"neuralnetwork.NeuralNetwork",
"utils.print_accuracy_rate"
] | [((309, 369), 'numpy.array', 'np.array', (['[[0, 0], [0, 1], [1, 0], [1, 1]]'], {'dtype': 'np.float32'}), '([[0, 0], [0, 1], [1, 0], [1, 1]], dtype=np.float32)\n', (317, 369), True, 'import numpy as np\n'), ((428, 488), 'numpy.array', 'np.array', (['[[1, 0], [0, 1], [0, 1], [1, 0]]'], {'dtype': 'np.float32'}), '([[1, 0... |
import json
import sys
def main():
argv_file = sys.argv[1]
with open(argv_file, "wt") as fp:
json.dump(sys.argv, fp)
sys.exit(0)
if __name__ == "__main__":
main()
| [
"json.dump",
"sys.exit"
] | [((140, 151), 'sys.exit', 'sys.exit', (['(0)'], {}), '(0)\n', (148, 151), False, 'import sys\n'), ((111, 134), 'json.dump', 'json.dump', (['sys.argv', 'fp'], {}), '(sys.argv, fp)\n', (120, 134), False, 'import json\n')] |
import asyncio
import json
import signal
from callosum.rpc import Peer
from callosum.ordering import (
KeySerializedAsyncScheduler,
)
from callosum.lower.zeromq import ZeroMQAddress, ZeroMQRPCTransport
async def handle_echo(request):
print('echo start')
await asyncio.sleep(1)
print('echo done')
r... | [
"json.loads",
"callosum.ordering.KeySerializedAsyncScheduler",
"callosum.lower.zeromq.ZeroMQAddress",
"json.dumps",
"asyncio.sleep",
"asyncio.get_running_loop"
] | [((1250, 1276), 'asyncio.get_running_loop', 'asyncio.get_running_loop', ([], {}), '()\n', (1274, 1276), False, 'import asyncio\n'), ((275, 291), 'asyncio.sleep', 'asyncio.sleep', (['(1)'], {}), '(1)\n', (288, 291), False, 'import asyncio\n'), ((442, 460), 'asyncio.sleep', 'asyncio.sleep', (['(0.5)'], {}), '(0.5)\n', (4... |
import json
import variables as var
default_lang_dict = {}
lang_dict = {}
def load_lang(lang):
global lang_dict, default_lang_dict
with open("lang/en_US.json", "r") as f:
default_lang_dict = json.load(f)
with open(f"lang/{lang}.json", "r") as f:
lang_dict = json.load(f)
def tr_cli(opti... | [
"json.load",
"variables.config.get"
] | [((211, 223), 'json.load', 'json.load', (['f'], {}), '(f)\n', (220, 223), False, 'import json\n'), ((290, 302), 'json.load', 'json.load', (['f'], {}), '(f)\n', (299, 302), False, 'import json\n'), ((1707, 1742), 'variables.config.get', 'var.config.get', (['"""commands"""', 'command'], {}), "('commands', command)\n", (1... |
"""
The Sims 4 Community Library is licensed under the Creative Commons Attribution 4.0 International public license (CC BY 4.0).
https://creativecommons.org/licenses/by/4.0/
https://creativecommons.org/licenses/by/4.0/legalcode
Copyright (c) COLONOLNUTTY
"""
from typing import Any
from sims4communitylib.events.build... | [
"sims4communitylib.events.build_buy.events.build_buy_enter.S4CLBuildBuyEnterEvent",
"sims4communitylib.events.event_handling.common_event_registry.CommonEventRegistry.get",
"sims4communitylib.modinfo.ModInfo.get_identity",
"sims4communitylib.events.build_buy.events.build_buy_exit.S4CLBuildBuyExitEvent"
] | [((1370, 1392), 'sims4communitylib.modinfo.ModInfo.get_identity', 'ModInfo.get_identity', ([], {}), '()\n', (1390, 1392), False, 'from sims4communitylib.modinfo import ModInfo\n'), ((1699, 1721), 'sims4communitylib.modinfo.ModInfo.get_identity', 'ModInfo.get_identity', ([], {}), '()\n', (1719, 1721), False, 'from sims4... |
#!/usr/bin/env python
from dictlearn.extractive_qa_training import train_extractive_qa
from dictlearn.extractive_qa_configs import qa_config_registry
from dictlearn.main import main
if __name__ == "__main__":
main(qa_config_registry, train_extractive_qa)
| [
"dictlearn.main.main"
] | [((215, 260), 'dictlearn.main.main', 'main', (['qa_config_registry', 'train_extractive_qa'], {}), '(qa_config_registry, train_extractive_qa)\n', (219, 260), False, 'from dictlearn.main import main\n')] |
import smtplib
import schedule
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.mime.image import MIMEImage
from email.header import Header
import time
import json
# 设置smtplib所需的参数
# 下面的发件人,收件人是用于邮件传输的。
class pymail:
with open('service.json', 'r', enc... | [
"smtplib.SMTP",
"smtplib.SMTP_SSL",
"email.mime.multipart.MIMEMultipart",
"json.load",
"email.mime.text.MIMEText"
] | [((632, 654), 'email.mime.multipart.MIMEMultipart', 'MIMEMultipart', (['"""mixed"""'], {}), "('mixed')\n", (645, 654), False, 'from email.mime.multipart import MIMEMultipart\n'), ((775, 807), 'email.mime.text.MIMEText', 'MIMEText', (['text', '"""plain"""', '"""utf-8"""'], {}), "(text, 'plain', 'utf-8')\n", (783, 807), ... |
# -*- coding: utf-8 -*-
from django.contrib import admin
from django.db import models
from django.forms import CheckboxSelectMultiple
from ..models import MultipleChoiceAnswer
@admin.register(MultipleChoiceAnswer)
class MultipleChoiceAnswerAdmin(admin.ModelAdmin):
list_display = ('id', 'user', 'question')
li... | [
"django.contrib.admin.register"
] | [((180, 216), 'django.contrib.admin.register', 'admin.register', (['MultipleChoiceAnswer'], {}), '(MultipleChoiceAnswer)\n', (194, 216), False, 'from django.contrib import admin\n')] |
import os
dirname = os.path.dirname(__file__)
filename = os.path.join(dirname, "day_07.data")
with open(filename) as f:
print('reading file...')
lines = map(lambda x: (x.strip()), f.readlines())
bag_rules = list(map(lambda x: (tuple(x.split('contain'))), lines))
def contains(bag):
containing_... | [
"os.path.dirname",
"os.path.join"
] | [((21, 46), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (36, 46), False, 'import os\n'), ((58, 94), 'os.path.join', 'os.path.join', (['dirname', '"""day_07.data"""'], {}), "(dirname, 'day_07.data')\n", (70, 94), False, 'import os\n')] |
from flask import render_template, make_response
from flask_restful import Resource, reqparse, fields, marshal_with
#from db import Database
from datetime import datetime
#from bson.objectid import ObjectId
#from flask_bcrypt import Bcrypt
#from flask_jwt_extended import (
# JWTManager,
# jwt_required,
# creat... | [
"flask_restful.reqparse.RequestParser"
] | [((764, 788), 'flask_restful.reqparse.RequestParser', 'reqparse.RequestParser', ([], {}), '()\n', (786, 788), False, 'from flask_restful import Resource, reqparse, fields, marshal_with\n')] |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Jul 1 16:58:25 2018
@author: suliat16
"""
import os
from consScore import aminoCons as am
import biskit.test
class test_amino_conservation(biskit.test.BiskitTest):
"""
Test suite testing the behaviour of the aminoCons module
"""
TAGS... | [
"os.path.exists",
"consScore.aminoCons.Rate4Site",
"os.getcwd",
"consScore.aminoCons.get_alpha",
"consScore.aminoCons.build_alignment",
"consScore.aminoCons.clean_alignment",
"consScore.aminoCons.MAFFT"
] | [((639, 702), 'consScore.aminoCons.build_alignment', 'am.build_alignment', (["(self.filepath + os.sep + 'multiFasta.fasta')"], {}), "(self.filepath + os.sep + 'multiFasta.fasta')\n", (657, 702), True, 'from consScore import aminoCons as am\n'), ((761, 803), 'consScore.aminoCons.clean_alignment', 'am.clean_alignment', (... |
# -*- coding: utf-8 -*-
import sublime, sublime_plugin
import json
import re
import os
import sys
import time
import subprocess
import threading
import functools
if sublime.version().startswith('3'):
from .sublime_cakephp_find_inflector import Inflector
elif sublime.version().startswith('2'):
from subl... | [
"sublime_cakephp_find_inflector.Inflector",
"sys.platform.startswith",
"time.sleep",
"os.startfile",
"sublime.packages_path",
"re.search",
"threading.Thread.__init__",
"os.path.exists",
"os.listdir",
"os.path.normpath",
"os.path.isdir",
"subprocess.call",
"sublime.error_message",
"re.match... | [((177, 194), 'sublime.version', 'sublime.version', ([], {}), '()\n', (192, 194), False, 'import sublime, sublime_plugin\n'), ((786, 803), 'sublime.version', 'sublime.version', ([], {}), '()\n', (801, 803), False, 'import sublime, sublime_plugin\n'), ((1149, 1180), 'threading.Thread.__init__', 'threading.Thread.__init_... |
import json
import uuid
from enum import Enum
from allauth.socialaccount.models import SocialAccount
from django.contrib.auth.models import AbstractUser
from django.db import models
from rest_framework import serializers
class EmailSocialAccount(SocialAccount):
class Meta:
proxy = True
def __str__(s... | [
"django.db.models.UUIDField",
"json.loads",
"rest_framework.serializers.SerializerMethodField",
"django.db.models.TextField",
"django.db.models.UniqueConstraint",
"django.db.models.ForeignKey",
"rest_framework.serializers.ValidationError",
"django.db.models.ManyToManyField",
"rest_framework.serializ... | [((625, 688), 'django.db.models.ForeignKey', 'models.ForeignKey', (['EmailSocialAccount'], {'on_delete': 'models.CASCADE'}), '(EmailSocialAccount, on_delete=models.CASCADE)\n', (642, 688), False, 'from django.db import models\n'), ((701, 737), 'django.db.models.UUIDField', 'models.UUIDField', ([], {'default': 'uuid.uui... |
''' matchmaker serializer '''
from rest_framework import serializers
from matchmaker.models import Match, Participation, Category
class MatchSerializer(serializers.ModelSerializer):
''' match serializer '''
num_participants = serializers.SerializerMethodField('_num_participants')
host = serializers.Relate... | [
"rest_framework.serializers.RelatedField",
"matchmaker.models.Participation.objects.filter",
"rest_framework.serializers.SerializerMethodField",
"rest_framework.serializers.IntegerField"
] | [((236, 290), 'rest_framework.serializers.SerializerMethodField', 'serializers.SerializerMethodField', (['"""_num_participants"""'], {}), "('_num_participants')\n", (269, 290), False, 'from rest_framework import serializers\n'), ((302, 342), 'rest_framework.serializers.RelatedField', 'serializers.RelatedField', ([], {'... |
import cv2
import numpy as np
import time
last_save_time = time.time()
class DrawingClass(object):
def __init__(self):
self.draw_command = 'None'
self.frame_count = 0
def drawing(self, frame, fps, num_egg, htc_egg, state, time_delta,
shiny_number):
cv2.putText(frame,
... | [
"cv2.circle",
"time.time",
"cv2.putText"
] | [((60, 71), 'time.time', 'time.time', ([], {}), '()\n', (69, 71), False, 'import time\n'), ((3468, 3528), 'cv2.circle', 'cv2.circle', (['frame', '(1000, 490)', '(50)', '(0, 0, 255)'], {'thickness': '(2)'}), '(frame, (1000, 490), 50, (0, 0, 255), thickness=2)\n', (3478, 3528), False, 'import cv2\n'), ((2849, 2909), 'cv2... |
from typing import Dict
from summer import Stratification
from autumn.models.covid_19.parameters import Parameters
from autumn.models.covid_19.constants import COMPARTMENTS, History, HISTORY_STRATA
from autumn.models.covid_19.stratifications.vaccination import apply_immunity_to_strat
def get_history_strat(params: P... | [
"autumn.models.covid_19.stratifications.vaccination.apply_immunity_to_strat",
"summer.Stratification"
] | [((858, 913), 'summer.Stratification', 'Stratification', (['"""history"""', 'HISTORY_STRATA', 'COMPARTMENTS'], {}), "('history', HISTORY_STRATA, COMPARTMENTS)\n", (872, 913), False, 'from summer import Stratification\n'), ((1168, 1255), 'autumn.models.covid_19.stratifications.vaccination.apply_immunity_to_strat', 'appl... |
from django.contrib import admin
from .. import models
@admin.register(models.Rule)
class RuleAdmin(admin.ModelAdmin):
"""
규칙 정보
"""
list_display = ['id', 'type', 'name']
class Meta:
model = models.Rule | [
"django.contrib.admin.register"
] | [((58, 85), 'django.contrib.admin.register', 'admin.register', (['models.Rule'], {}), '(models.Rule)\n', (72, 85), False, 'from django.contrib import admin\n')] |
import curses
import random
import time
"""
Based on C ncurses version
http://rosettacode.org/wiki/Matrix_Digital_Rain#NCURSES_version
"""
"""
Time between row updates in seconds
Controls the speed of the digital rain effect.
"""
ROW_DELAY=.0001
def get_rand_in_range(min, max):
return random.randrange(min,ma... | [
"curses.color_pair",
"curses.start_color",
"random.randrange",
"curses.init_pair",
"curses.endwin",
"time.sleep",
"curses.curs_set",
"curses.noecho",
"curses.initscr"
] | [((297, 327), 'random.randrange', 'random.randrange', (['min', '(max + 1)'], {}), '(min, max + 1)\n', (313, 327), False, 'import random\n'), ((508, 524), 'curses.initscr', 'curses.initscr', ([], {}), '()\n', (522, 524), False, 'import curses\n'), ((529, 544), 'curses.noecho', 'curses.noecho', ([], {}), '()\n', (542, 54... |
# (c) 2018, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' unit test template for ONTAP Ansible module '''
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
import pytest
from ansible.module_utils import ... | [
"ansible_collections.netapp.ontap.tests.unit.compat.mock.patch.multiple",
"pytest.mark.skip",
"json.dumps",
"ansible_collections.netapp.ontap.tests.unit.compat.mock.call",
"ansible_collections.netapp.ontap.plugins.modules.na_ontap_svm.NetAppOntapSVM",
"ansible_collections.netapp.ontap.plugins.module_utils... | [((755, 784), 'ansible_collections.netapp.ontap.plugins.module_utils.netapp.has_netapp_lib', 'netapp_utils.has_netapp_lib', ([], {}), '()\n', (782, 784), True, 'import ansible_collections.netapp.ontap.plugins.module_utils.netapp as netapp_utils\n'), ((803, 862), 'pytest.mark.skip', 'pytest.mark.skip', (['"""skipping as... |