code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import os, csv
import numpy as np
import pandas as pd
from pathlib import Path
from sklearn.model_selection import train_test_split
from scipy import signal
class ProcessSignalData(object):
def __init__(self):
# path to video data from signal_output.py
self.dir = './processed_new/videos'
s... | [
"pandas.DataFrame",
"numpy.abs",
"scipy.signal.welch",
"numpy.argmax",
"numpy.std",
"sklearn.model_selection.train_test_split",
"pandas.read_csv",
"os.walk",
"numpy.asarray",
"numpy.array",
"os.path.join",
"scipy.signal.csd",
"numpy.concatenate"
] | [((364, 378), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (376, 378), True, 'import pandas as pd\n'), ((404, 418), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (416, 418), True, 'import pandas as pd\n'), ((444, 458), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (456, 458), True, 'import pand... |
import autokeras as ak
import tensorflow as tf
from tensorflow.keras.preprocessing import image
from tensorflow.keras.callbacks import ModelCheckpoint, TensorBoard
EPOCHS = 50
BATCH = 5
NAME = "autokeras_classification"
DATASET_PATH = "/hdd/4celebs_training_set"
def build_train_set(image_size):
def make_train_ge... | [
"tensorflow.keras.preprocessing.image.ImageDataGenerator",
"autokeras.ImageClassifier",
"tensorflow.keras.callbacks.ModelCheckpoint",
"tensorflow.data.Dataset.from_generator",
"tensorflow.keras.callbacks.TensorBoard"
] | [((1107, 1185), 'tensorflow.data.Dataset.from_generator', 'tf.data.Dataset.from_generator', (['make_train_generator', '(tf.float16, tf.float16)'], {}), '(make_train_generator, (tf.float16, tf.float16))\n', (1137, 1185), True, 'import tensorflow as tf\n'), ((1646, 1722), 'tensorflow.data.Dataset.from_generator', 'tf.dat... |
import asyncio
import io
import os
import sys
from actions_toolkit import core
from actions_toolkit.utils import to_command_properties, AnnotationProperties
test_env_vars = {
'my var': '',
'special char var \r\n];': '',
'my var2': '',
'my secret': '',
'special char secret \r\n];': '',
'my secr... | [
"sys.stdout.write",
"actions_toolkit.core.get_multiline_input",
"os.unlink",
"actions_toolkit.core.get_input",
"actions_toolkit.core.add_path",
"os.environ.pop",
"os.path.join",
"actions_toolkit.core.group",
"actions_toolkit.core.is_debug",
"actions_toolkit.utils.to_command_properties",
"actions... | [((2701, 2742), 'actions_toolkit.core.export_variable', 'core.export_variable', (['"""my var"""', '"""var val"""'], {}), "('my var', 'var val')\n", (2721, 2742), False, 'from actions_toolkit import core\n'), ((2993, 3029), 'actions_toolkit.core.export_variable', 'core.export_variable', (['"""my var"""', '(True)'], {}),... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2017-07-17 19:38
from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
... | [
"django.db.models.CharField",
"django.db.models.DateTimeField",
"django.db.models.ForeignKey",
"django.db.models.AutoField"
] | [((512, 563), 'django.db.models.AutoField', 'models.AutoField', ([], {'primary_key': '(True)', 'serialize': '(False)'}), '(primary_key=True, serialize=False)\n', (528, 563), False, 'from django.db import migrations, models\n'), ((595, 649), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'max... |
#!/usr/bin/env python3
import matplotlib.pyplot as plt
import argparse
from lelantos import tomographic_objects
parser = argparse.ArgumentParser(description='Plot the QSO catalog')
parser.add_argument('-i',
'--input', help='Input QSO catalog',required=True)
parser.add_argument('-bins', help='Output... | [
"lelantos.tomographic_objects.QSOCatalog.init_from_fits",
"matplotlib.pyplot.show",
"argparse.ArgumentParser",
"matplotlib.pyplot.colorbar"
] | [((122, 181), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Plot the QSO catalog"""'}), "(description='Plot the QSO catalog')\n", (145, 181), False, 'import argparse\n'), ((528, 630), 'lelantos.tomographic_objects.QSOCatalog.init_from_fits', 'tomographic_objects.QSOCatalog.init_from_fit... |
import unittest
from streamlink.plugins.dplay import Dplay
class TestPluginDplay(unittest.TestCase):
def test_can_handle_url(self):
should_match = [
'https://www.dplay.dk/videoer/studie-5/season-2-episode-1',
'https://www.dplay.no/videoer/danskebaten/sesong-1-episode-1',
... | [
"streamlink.plugins.dplay.Dplay.can_handle_url"
] | [((475, 500), 'streamlink.plugins.dplay.Dplay.can_handle_url', 'Dplay.can_handle_url', (['url'], {}), '(url)\n', (495, 500), False, 'from streamlink.plugins.dplay import Dplay\n'), ((698, 723), 'streamlink.plugins.dplay.Dplay.can_handle_url', 'Dplay.can_handle_url', (['url'], {}), '(url)\n', (718, 723), False, 'from st... |
"""
SPDX-License-Identifier: BSD-3-Clause
Copyright (c) 2020 Deutsches Elektronen-Synchrotron DESY.
See LICENSE.txt for license details.
"""
import unittest
from frugy.types import FixedField, StringField, StringFmt, GuidField, ArrayField, FruAreaBase
class TestString(unittest.TestCase):
def test_null(self):
... | [
"unittest.main",
"frugy.types.StringField",
"frugy.types.ArrayField",
"frugy.types.GuidField"
] | [((3340, 3355), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3353, 3355), False, 'import unittest\n'), ((332, 345), 'frugy.types.StringField', 'StringField', ([], {}), '()\n', (343, 345), False, 'from frugy.types import FixedField, StringField, StringFmt, GuidField, ArrayField, FruAreaBase\n'), ((457, 470), 'fr... |
import cv2
import numpy as np
from utils.test_images_generator.generator_config import AVAILABLE_SHAPES_DICT
from utils.test_images_generator.generator_utils import generate_random_color, generate_random_image_points
def generate_random_image(width, height):
# ToDo generate white image
# https://numpy.org/do... | [
"numpy.zeros"
] | [((385, 429), 'numpy.zeros', 'np.zeros', (['(height, width, 3)'], {'dtype': 'np.uint8'}), '((height, width, 3), dtype=np.uint8)\n', (393, 429), True, 'import numpy as np\n')] |
# MIT License
# Copyright (c) 2017 MassChallenge, Inc.
from __future__ import unicode_literals
from datetime import (
datetime,
timedelta,
)
import swapper
from factory import SubFactory
from factory.django import DjangoModelFactory
from pytz import utc
from accelerator.tests.factories.application_type_fact... | [
"swapper.load_model",
"factory.SubFactory",
"datetime.datetime.now",
"datetime.timedelta"
] | [((626, 674), 'swapper.load_model', 'swapper.load_model', (['"""accelerator"""', '"""Application"""'], {}), "('accelerator', 'Application')\n", (644, 674), False, 'import swapper\n'), ((780, 811), 'factory.SubFactory', 'SubFactory', (['ProgramCycleFactory'], {}), '(ProgramCycleFactory)\n', (790, 811), False, 'from fact... |
"""
WSGI config for etd_drop project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "etd_drop.settings")
#Attempt to set... | [
"os.environ.get",
"os.environ.setdefault",
"django.core.wsgi.get_wsgi_application",
"dotenv.read_dotenv"
] | [((234, 302), 'os.environ.setdefault', 'os.environ.setdefault', (['"""DJANGO_SETTINGS_MODULE"""', '"""etd_drop.settings"""'], {}), "('DJANGO_SETTINGS_MODULE', 'etd_drop.settings')\n", (255, 302), False, 'import os\n'), ((401, 431), 'os.environ.get', 'os.environ.get', (['"""DOTENV"""', 'None'], {}), "('DOTENV', None)\n"... |
"""
Copyright 2015, University of Freiburg.
<NAME> <<EMAIL>>
"""
import re
def normalize_entity_name(name):
name = name.lower()
name = name.replace('!', '')
name = name.replace('.', '')
name = name.replace(',', '')
name = name.replace('-', '')
name = name.replace('_', '')
name = name.repl... | [
"re.match"
] | [((1304, 1335), 're.match', 're.match', (['""".*( #[0-9]+)$"""', 'name'], {}), "('.*( #[0-9]+)$', name)\n", (1312, 1335), False, 'import re\n'), ((1479, 1519), 're.match', 're.match', (['""".*( \\\\([^\\\\(\\\\)]+\\\\))$"""', 'name'], {}), "('.*( \\\\([^\\\\(\\\\)]+\\\\))$', name)\n", (1487, 1519), False, 'import re\n'... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jan 19 11:30:56 2022
@author: adowa
"""
import numpy as np
import tensorflow as tf
from utils import (build_logistic_regression,
compile_logistic_regression)
from tensorflow.keras import regularizers
from sklearn.datasets import make_... | [
"tensorflow.random.set_seed",
"sklearn.model_selection.train_test_split",
"tensorflow.keras.backend.clear_session",
"sklearn.datasets.make_classification",
"tensorflow.keras.regularizers.L1",
"numpy.hstack",
"sklearn.metrics.roc_auc_score",
"tensorflow.keras.regularizers.L2",
"numpy.concatenate",
... | [((557, 589), 'tensorflow.keras.backend.clear_session', 'tf.keras.backend.clear_session', ([], {}), '()\n', (587, 589), True, 'import tensorflow as tf\n'), ((632, 823), 'sklearn.datasets.make_classification', 'make_classification', ([], {'n_samples': '(150)', 'n_features': '(100)', 'n_informative': '(3)', 'n_redundant'... |
import datetime
mynow = datetime.datetime.now()
print("My datetime is " , mynow)
mynumber = 10
mytext = "Hello"
print(mynumber, mytext)
x = 10
y = "10"
z = 10.1
sum1 = x+x
sum2 = y+y
print(sum1 , sum2)
print(type(x), type(y), type(z))
## List Type
grade = [9.5,8.5,6.45]
## range - We can use ragne to create lis... | [
"datetime.datetime.now"
] | [((25, 48), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (46, 48), False, 'import datetime\n')] |
#!/usr/bin/env python3
import argparse
import logging
import os
import stat
import subprocess
import sys
import time
import yaml
import paramiko
'''
config-agent: {}
nsr_name: ccore_testbed_nsd
parameter: {}
vnfr:
1:
connection_point:
- ip_address: 172.16.58.3
name: homesteadprov_vnfd/sigport
mgmt_i... | [
"yaml.load",
"os.chmod",
"paramiko.SSHClient",
"argparse.ArgumentParser",
"logging.basicConfig",
"os.makedirs",
"logging.StreamHandler",
"os.path.exists",
"time.strftime",
"time.sleep",
"logging.Formatter",
"subprocess.call",
"os.path.join",
"paramiko.AutoAddPolicy",
"logging.getLogger",... | [((2261, 2281), 'paramiko.SSHClient', 'paramiko.SSHClient', ([], {}), '()\n', (2279, 2281), False, 'import paramiko\n'), ((4834, 4865), 'os.chmod', 'os.chmod', (['sh_file', 'stat.S_IRWXU'], {}), '(sh_file, stat.S_IRWXU)\n', (4842, 4865), False, 'import os\n'), ((4971, 5003), 'subprocess.call', 'subprocess.call', (['cmd... |
import scipy
import scipy.sparse.csgraph
import wall_generation, mesh
import mesh_operations
import utils
import triangulation, filters
from mesh_utilities import SurfaceSampler, tubeRemesh
import numpy as np
def meshComponents(m, cutEdges):
"""
Get the connected components of triangles of a mesh cut along the... | [
"mesh_utilities.tubeRemesh",
"numpy.empty",
"utils.freshPath",
"numpy.arange",
"scipy.sparse.csgraph.connected_components",
"numpy.linalg.norm",
"numpy.unique",
"numpy.pad",
"utils.bbox_dims",
"field_sampler.FieldSampler",
"numpy.transpose",
"mesh.Mesh",
"mesh_utilities.SurfaceSampler",
"n... | [((1304, 1350), 'scipy.sparse.csgraph.connected_components', 'scipy.sparse.csgraph.connected_components', (['adj'], {}), '(adj)\n', (1345, 1350), False, 'import scipy\n'), ((1983, 2029), 'scipy.sparse.csgraph.connected_components', 'scipy.sparse.csgraph.connected_components', (['adj'], {}), '(adj)\n', (2024, 2029), Fal... |
import numpy as np
from sklearn import linear_model
np.random.seed(123)
np.set_printoptions(suppress=True, linewidth=120)
X = np.random.random([10, 5]).astype(np.float)
y = np.random.random(10).astype(np.float)
# sklearn
linear = linear_model.LinearRegression()
linear.fit(X, y)
# Pure Python
X = np.hstack([np.ones(... | [
"numpy.set_printoptions",
"numpy.random.seed",
"numpy.ones",
"sklearn.linear_model.LinearRegression",
"numpy.random.random",
"numpy.matmul"
] | [((53, 72), 'numpy.random.seed', 'np.random.seed', (['(123)'], {}), '(123)\n', (67, 72), True, 'import numpy as np\n'), ((73, 122), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'suppress': '(True)', 'linewidth': '(120)'}), '(suppress=True, linewidth=120)\n', (92, 122), True, 'import numpy as np\n'), ((233, 26... |
import lzhw
from sys import getsizeof
from random import sample, choices
import pandas as pd
def test_weather():
weather = ["Sunny", "Sunny", "Overcast", "Rain", "Rain", "Rain", "Overcast", "Sunny", "Sunny",
"Rain", "Sunny", "Overcast", "Overcast", "Rain", "Rain", "Sunny", "Sunny"]
comp_weather... | [
"pandas.DataFrame",
"lzhw.CompressedFromCSV",
"lzhw.decompress_df_from_file",
"lzhw.decompress_from_file",
"lzhw.LZHW",
"sys.getsizeof",
"lzhw.CompressedDF"
] | [((323, 341), 'lzhw.LZHW', 'lzhw.LZHW', (['weather'], {}), '(weather)\n', (332, 341), False, 'import lzhw\n'), ((362, 398), 'lzhw.LZHW', 'lzhw.LZHW', (['weather'], {'sliding_window': '(5)'}), '(weather, sliding_window=5)\n', (371, 398), False, 'import lzhw\n'), ((645, 663), 'lzhw.LZHW', 'lzhw.LZHW', (['numbers'], {}), ... |
"""
The Netio switch component.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/switch.netio/
"""
import logging
from collections import namedtuple
from datetime import timedelta
from homeassistant import util
from homeassistant.components.http import Hom... | [
"homeassistant.helpers.validate_config",
"datetime.timedelta",
"homeassistant.util.Throttle",
"collections.namedtuple",
"logging.getLogger"
] | [((578, 605), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (595, 605), False, 'import logging\n'), ((987, 1030), 'collections.namedtuple', 'namedtuple', (['"""device"""', "['netio', 'entities']"], {}), "('device', ['netio', 'entities'])\n", (997, 1030), False, 'from collections import n... |
import os
image_dir ="H:/Python Space/Hard_Hat _Detection/images"
label_dir= "H:/Python Space/Hard_Hat _Detection/labels"
print("No. of Training images", len(os.listdir(image_dir + "/train")))
print("No. of Training labels", len(os.listdir(label_dir + "/train")))
print("No. of valid images", len(os.listdir(image_dir... | [
"os.listdir"
] | [((160, 192), 'os.listdir', 'os.listdir', (["(image_dir + '/train')"], {}), "(image_dir + '/train')\n", (170, 192), False, 'import os\n'), ((231, 263), 'os.listdir', 'os.listdir', (["(label_dir + '/train')"], {}), "(label_dir + '/train')\n", (241, 263), False, 'import os\n'), ((300, 330), 'os.listdir', 'os.listdir', ([... |
import numpy as np
import ray
import pyspiel
from open_spiel.python.algorithms.psro_v2.ars_ray.shared_noise import *
from open_spiel.python.algorithms.psro_v2.ars_ray.utils import rewards_combinator
from open_spiel.python.algorithms.psro_v2 import rl_policy
from open_spiel.python import rl_environment
import tens... | [
"pyspiel.GameParameter",
"open_spiel.python.algorithms.psro_v2.ars_ray.utils.rewards_combinator",
"numpy.cumsum",
"tensorflow.compat.v1.Session",
"random.random",
"numpy.array",
"open_spiel.python.rl_environment.Environment",
"tensorflow.compat.v1.get_default_session"
] | [((1739, 1771), 'open_spiel.python.rl_environment.Environment', 'rl_environment.Environment', (['game'], {}), '(game)\n', (1765, 1771), False, 'from open_spiel.python import rl_environment\n'), ((2240, 2264), 'tensorflow.compat.v1.get_default_session', 'tf.get_default_session', ([], {}), '()\n', (2262, 2264), True, 'im... |
import clusters as c
import tensorflow as tf
import pandas as pd
import re
def one_hot(i, n):
""" Makes a one-hot vector of length n with 1 in position i. """
one_hot = [0 for x in range(n)]
one_hot[i] = 1
return one_hot
datasets = c.datasets
data_type = 'metaphlan_bugs_list'
body_site = 'stool'
df,... | [
"tensorflow.feature_column.numeric_column",
"clusters.get_labels",
"pandas.Series",
"clusters.__load_data",
"tensorflow.estimator.inputs.pandas_input_fn",
"re.sub",
"tensorflow.estimator.DNNClassifier"
] | [((344, 389), 'clusters.__load_data', 'c.__load_data', (['datasets', 'data_type', 'body_site'], {}), '(datasets, data_type, body_site)\n', (357, 389), True, 'import clusters as c\n'), ((484, 533), 'clusters.get_labels', 'c.get_labels', (['dataframes', 'body_site', 'key_sets', 'df'], {}), '(dataframes, body_site, key_se... |
# credit card default dataset: https://archive.ics.uci.edu/ml/datasets/default+of+credit+card+clients
# kaggle link: https://www.kaggle.com/uciml/default-of-credit-card-clients-dataset
import pandas as pd
from fim import fpgrowth#,fim
import numpy as np
#import math
#from itertools import chain, combinations
import it... | [
"numpy.sum",
"random.sample",
"sklearn.model_selection.train_test_split",
"sklearn.metrics.accuracy_score",
"numpy.argsort",
"numpy.mean",
"numpy.exp",
"numpy.multiply",
"fim.fpgrowth",
"numpy.insert",
"numpy.logical_xor",
"pandas.concat",
"sklearn.ensemble.RandomForestClassifier",
"pandas... | [((29338, 29423), 'pandas.read_excel', 'pd.read_excel', (['"""default of credit card clients.xls"""'], {'sheet_name': '"""Data"""', 'header': '(1)'}), "('default of credit card clients.xls', sheet_name='Data', header=1\n )\n", (29351, 29423), True, 'import pandas as pd\n'), ((30790, 30830), 'pandas.get_dummies', 'pd... |
import os
import enum
import functools
import itertools
import collections
import concurrent.futures as cf
from . import errors
from . import utils
from . import exceptions
from .models import (
ParallelJob,
ParallelArg,
ParallelStatus,
FailedTask,
SequentialMapResult,
NamedMapResult,
)
# __... | [
"os.cpu_count",
"itertools.chain.from_iterable"
] | [((6253, 6291), 'itertools.chain.from_iterable', 'itertools.chain.from_iterable', (['results'], {}), '(results)\n', (6282, 6291), False, 'import itertools\n'), ((5805, 5819), 'os.cpu_count', 'os.cpu_count', ([], {}), '()\n', (5817, 5819), False, 'import os\n')] |
"""
twominutejournal.journal
~~~~~~~~~~~~~~~~~~~~~~~~
A daily gratitude journal library.
"""
import uuid
import datetime
from .errors import EntryAlreadyExistsError
def create_prompt(question: str, responses: int) -> dict:
'''Create a new journal prompt.'''
if not isinstance(question, str):
... | [
"uuid.uuid4",
"datetime.datetime.today"
] | [((885, 910), 'datetime.datetime.today', 'datetime.datetime.today', ([], {}), '()\n', (908, 910), False, 'import datetime\n'), ((1359, 1384), 'datetime.datetime.today', 'datetime.datetime.today', ([], {}), '()\n', (1382, 1384), False, 'import datetime\n'), ((1325, 1337), 'uuid.uuid4', 'uuid.uuid4', ([], {}), '()\n', (1... |
#!/usr/bin/python
# ex:set fileencoding=utf-8:
from __future__ import unicode_literals
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
from djangobmf.workflows import Workflow, State, Transition
from djangobmf.settings import CONTRIB_TIMESHEET
from djangobmf... | [
"django.utils.translation.ugettext_lazy",
"djangobmf.utils.model_from_name.model_from_name"
] | [((4424, 4458), 'djangobmf.utils.model_from_name.model_from_name', 'model_from_name', (['CONTRIB_TIMESHEET'], {}), '(CONTRIB_TIMESHEET)\n', (4439, 4458), False, 'from djangobmf.utils.model_from_name import model_from_name\n'), ((5092, 5126), 'djangobmf.utils.model_from_name.model_from_name', 'model_from_name', (['CONTR... |
# -*- coding: utf-8 -*-
import numpy
import warnings
import operator
import collections
from sagar.crystal.structure import Cell
from sagar.element.base import get_symbol
def read_vasp(filename='POSCAR'):
"""
Import POSCAR/CONTCAR or filename with .vasp suffix
parameter:
filename: string, the filena... | [
"sagar.crystal.structure.Cell",
"numpy.argsort",
"sagar.element.base.get_symbol",
"numpy.linalg.det",
"numpy.array",
"numpy.linalg.inv",
"collections.Counter",
"operator.itemgetter",
"warnings.warn"
] | [((996, 1016), 'numpy.array', 'numpy.array', (['lattice'], {}), '(lattice)\n', (1007, 1016), False, 'import numpy\n'), ((3122, 3153), 'sagar.crystal.structure.Cell', 'Cell', (['lattice', 'positions', 'atoms'], {}), '(lattice, positions, atoms)\n', (3126, 3153), False, 'from sagar.crystal.structure import Cell\n'), ((42... |
# SPDX-License-Identifier: MIT
# Copyright (c) 2016-2020 <NAME>, <NAME>, <NAME>, <NAME>
import sys
import os
from models.de import DE
sys.path.append(os.path.join(os.path.dirname(__file__), '../common/'))
from common.pg_search import PGsearch
sys.path.append(os.path.join(os.path.dirname(__file__), '../../'))
from ... | [
"os.path.dirname",
"models.de.DE"
] | [((167, 192), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (182, 192), False, 'import os\n'), ((277, 302), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (292, 302), False, 'import os\n'), ((1619, 1673), 'models.de.DE', 'DE', (['self.cache', 'self.ps', 'self.assem... |
import discord
from discord.ext import commands
import league
import matplotlib.pyplot as plt
import seaborn as sns
import os
client = commands.Bot(command_prefix='?')
token = os.environ.get('DISCORD_TOKEN')
@client.event
async def on_ready():
print('Bot is ready.')
@client.command()
async def rank(ctx, name, r... | [
"os.remove",
"discord.File",
"matplotlib.pyplot.legend",
"league.Summoner",
"os.environ.get",
"seaborn.countplot",
"discord.ext.commands.Bot",
"seaborn.set"
] | [((136, 168), 'discord.ext.commands.Bot', 'commands.Bot', ([], {'command_prefix': '"""?"""'}), "(command_prefix='?')\n", (148, 168), False, 'from discord.ext import commands\n'), ((177, 208), 'os.environ.get', 'os.environ.get', (['"""DISCORD_TOKEN"""'], {}), "('DISCORD_TOKEN')\n", (191, 208), False, 'import os\n'), ((3... |
import logging
import dill
from sklearn.metrics import calinski_harabasz_score
from topicnet.cooking_machine import Dataset
from topicnet.cooking_machine.models import (
BaseScore as BaseTopicNetScore,
TopicModel
)
from .base_custom_score import BaseCustomScore
_Logger = logging.getLogger()
class Calinsk... | [
"topicnet.cooking_machine.Dataset",
"sklearn.metrics.calinski_harabasz_score",
"dill.load",
"dill.dump",
"logging.getLogger"
] | [((285, 304), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (302, 304), False, 'import logging\n'), ((1516, 1573), 'sklearn.metrics.calinski_harabasz_score', 'calinski_harabasz_score', (['theta.T.values', 'objects_clusters'], {}), '(theta.T.values, objects_clusters)\n', (1539, 1573), False, 'from sklearn.... |
from crum import get_current_user
from django.views.generic import TemplateView
from apps.quotas.models import UsageLimitations, Quota, Plans
class PlanOverview(TemplateView):
template_name = "plans_overview.html"
def get_context_data(self, **kwargs):
context = super(PlanOverview, self).get_context_d... | [
"apps.quotas.models.Quota.objects.get",
"crum.get_current_user"
] | [((349, 367), 'crum.get_current_user', 'get_current_user', ([], {}), '()\n', (365, 367), False, 'from crum import get_current_user\n'), ((505, 541), 'apps.quotas.models.Quota.objects.get', 'Quota.objects.get', ([], {'pk': 'current_org.pk'}), '(pk=current_org.pk)\n', (522, 541), False, 'from apps.quotas.models import Us... |
#!/usr/bin/env python3.8
# You might want to change the line above to generic python, however, it does require python 3.8 or above to run correctly.
# You MIGHT get away with older versions... but... no warranty here.
import os, sys, io, re
import argparse
import json, csv
import requests
from datetime import dateti... | [
"py_helper.DbgMsg",
"os.makedirs",
"argparse.ArgumentParser",
"csv.DictReader",
"os.path.exists",
"csv.Sniffer",
"py_helper.DownloadContent",
"os.environ.get",
"datetime.timedelta",
"os.path.getmtime",
"time.localtime",
"py_helper.Msg",
"os.path.join",
"py_helper.DebugMode",
"py_helper.C... | [((3696, 3715), 're.compile', 're.compile', (['MACExpr'], {}), '(MACExpr)\n', (3706, 3715), False, 'import os, sys, io, re\n'), ((3729, 3748), 're.compile', 're.compile', (['OUIExpr'], {}), '(OUIExpr)\n', (3739, 3748), False, 'import os, sys, io, re\n'), ((2872, 2901), 'os.environ.get', 'os.environ.get', (['"""tmp"""',... |
"""
:copyright: (c)Copyright 2013, Intel Corporation All Rights Reserved.
The source code contained or described here in and all documents related
to the source code ("Material") are owned by Intel Corporation or its
suppliers or licensors. Title to the Material remains with Intel Corporation
or its suppliers and licen... | [
"yaml.load",
"acs.ErrorHandling.AcsConfigException.AcsConfigException",
"os.walk",
"os.path.isfile",
"lxml.etree.parse",
"os.path.join"
] | [((5600, 5625), 'lxml.etree.parse', 'etree.parse', (['catalog_file'], {}), '(catalog_file)\n', (5611, 5625), False, 'from lxml import etree\n'), ((11979, 12090), 'acs.ErrorHandling.AcsConfigException.AcsConfigException', 'AcsConfigException', (['AcsConfigException.FEATURE_NOT_IMPLEMENTED', '"""\'parse_catalog_file\' is... |
from rest_framework import serializers
from .models import Category, Comment, Genre, Review, Title
class CategorySerializer(serializers.ModelSerializer):
'''Serializer for Category model'''
class Meta:
fields = ('name', 'slug')
model = Category
lookup_field = 'slug'
class GenreSeri... | [
"rest_framework.serializers.SlugRelatedField",
"rest_framework.serializers.EmailField",
"rest_framework.serializers.ValidationError"
] | [((1583, 1650), 'rest_framework.serializers.SlugRelatedField', 'serializers.SlugRelatedField', ([], {'slug_field': '"""username"""', 'read_only': '(True)'}), "(slug_field='username', read_only=True)\n", (1611, 1650), False, 'from rest_framework import serializers\n'), ((2563, 2630), 'rest_framework.serializers.SlugRela... |
from PyQt4 import uic
import uuid
import os
class OTModule(object):
"""
Module abstract class implementation
"""
def __init__(self, name):
self._unique_id = uuid.uuid1() #: Module name
self._name = name #: Module unique identifier
def save(self, saver):
... | [
"uuid.uuid1"
] | [((184, 196), 'uuid.uuid1', 'uuid.uuid1', ([], {}), '()\n', (194, 196), False, 'import uuid\n')] |
from datetime import datetime
from sklearn.ensemble import RandomForestClassifier
from sklearn.tree import DecisionTreeClassifier
from sklearn.model_selection import cross_val_score
from sklearn.metrics import classification_report, confusion_matrix
from sklearn.model_selection import train_test_split
import src.confi... | [
"sklearn.ensemble.RandomForestClassifier",
"pandas.DataFrame",
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"sklearn.model_selection.cross_val_score",
"sklearn.metrics.classification_report",
"numpy.array",
"sklearn.metrics.confusion_matrix",
"datetime.datetime.now"
] | [((636, 661), 'pandas.read_csv', 'pd.read_csv', (['features_csv'], {}), '(features_csv)\n', (647, 661), True, 'import pandas as pd\n'), ((675, 703), 'numpy.array', 'np.array', (["features_df['VPN']"], {}), "(features_df['VPN'])\n", (683, 703), True, 'import numpy as np\n'), ((1911, 1935), 'numpy.array', 'np.array', (['... |
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2019 Fetch.AI Limited
#
# 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 ... | [
"typing.cast",
"typing.TypeVar",
"re.findall",
"re.match"
] | [((1292, 1304), 'typing.TypeVar', 'TypeVar', (['"""T"""'], {}), "('T')\n", (1299, 1304), False, 'from typing import Dict, Generic, List, Optional, Set, Tuple, TypeVar, Union, cast\n'), ((23671, 23703), 'typing.cast', 'cast', (['Set[PublicId]', 'connections'], {}), '(Set[PublicId], connections)\n', (23675, 23703), False... |
# ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.6.0
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# %% [markdown]
# # First look at our dataset
#
# In ... | [
"pandas.read_csv",
"pandas.crosstab",
"seaborn.pairplot"
] | [((1160, 1203), 'pandas.read_csv', 'pd.read_csv', (['"""../datasets/adult-census.csv"""'], {}), "('../datasets/adult-census.csv')\n", (1171, 1203), True, 'import pandas as pd\n'), ((6502, 6590), 'pandas.crosstab', 'pd.crosstab', ([], {'index': "adult_census['education']", 'columns': "adult_census['education-num']"}), "... |
import pygame
# Constantes de jeu
MAX_TIRS = 10 # nombre maximum de boulets sur l'ecran
MAX_ALIEN = 10
PROBA_ALIEN = 22 # probabilit茅 qu'un alien apparaisse
NOUVEL_ALIEN = 12 # Rafraichissement de l'ecran entre chaque alien
ECRAN = pygame.Rect(0, 0, 1825, 900)
SONS = True # Mettre a True si on veut activer le so... | [
"pygame.Rect"
] | [((238, 266), 'pygame.Rect', 'pygame.Rect', (['(0)', '(0)', '(1825)', '(900)'], {}), '(0, 0, 1825, 900)\n', (249, 266), False, 'import pygame\n')] |
# -*- coding: utf-8 -*-
"""
Read Noise Calculation Class
============================
This software has the ReadNoiseCalc class. This class calculates the read noise
of the SPARC4 EMCCDs as a function of their operation mode. The calculations
are done based on a series of characterization of the SPARC4 cameras. For th... | [
"scipy.interpolate.interp1d",
"openpyxl.load_workbook"
] | [((3817, 3855), 'scipy.interpolate.interp1d', 'interp1d', (['column_em_gain', 'column_noise'], {}), '(column_em_gain, column_noise)\n', (3825, 3855), False, 'from scipy.interpolate import interp1d\n'), ((3198, 3226), 'openpyxl.load_workbook', 'openpyxl.load_workbook', (['path'], {}), '(path)\n', (3220, 3226), False, 'i... |
#!/usr/bin/python3
import sys
while True:
for line in sys.stdin:
lline = line.lower()
sys.stdout.write(lline)
sys.stdout.write("\n")
break | [
"sys.stdout.write"
] | [((116, 138), 'sys.stdout.write', 'sys.stdout.write', (['"""\n"""'], {}), "('\\n')\n", (132, 138), False, 'import sys\n'), ((91, 114), 'sys.stdout.write', 'sys.stdout.write', (['lline'], {}), '(lline)\n', (107, 114), False, 'import sys\n')] |
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/stable/config
# -- Path setup ------------------------------------------------------------... | [
"os.path.split"
] | [((946, 969), 'os.path.split', 'os.path.split', (['__file__'], {}), '(__file__)\n', (959, 969), False, 'import os\n')] |
import math
K = int(input())
ans = 0
for i in range(1, K+1):
for j in range(i, K+1):
for k in range(j, K+1):
if (i == j) and (j == k):
ans += math.gcd(i, math.gcd(j, k))
elif (i == j) or (j == k):
ans += 3 * math.gcd(i, math.gcd(j, k))
else... | [
"math.gcd"
] | [((194, 208), 'math.gcd', 'math.gcd', (['j', 'k'], {}), '(j, k)\n', (202, 208), False, 'import math\n'), ((288, 302), 'math.gcd', 'math.gcd', (['j', 'k'], {}), '(j, k)\n', (296, 302), False, 'import math\n'), ((361, 375), 'math.gcd', 'math.gcd', (['j', 'k'], {}), '(j, k)\n', (369, 375), False, 'import math\n')] |
from . import models
from django.http import HttpResponse
from django.shortcuts import render, redirect
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.models import User
import json
from django.views.decorators.csrf import csrf_exempt
# Create your views here.
#Se define endp... | [
"django.shortcuts.render"
] | [((635, 673), 'django.shortcuts.render', 'render', (['request', '"""index.html"""', 'context'], {}), "(request, 'index.html', context)\n", (641, 673), False, 'from django.shortcuts import render, redirect\n'), ((784, 825), 'django.shortcuts.render', 'render', (['request', '"""registro.html"""', 'context'], {}), "(reque... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from threading import Thread
from Parsers.Common import *
class Parser(Thread):
def __init__(self):
"""
Initialize a Parser thread.
"""
Thread.__init__(self)
self.deamon = True
self.result = None
def run(self):
""... | [
"threading.Thread.__init__"
] | [((214, 235), 'threading.Thread.__init__', 'Thread.__init__', (['self'], {}), '(self)\n', (229, 235), False, 'from threading import Thread\n')] |
import random
targetNumber = 6
def throwDie():
print("rolling...")
rand = random.randint(1, 6)
print(str(rand) + "!")
return rand
# roll a 6-sided die until the given target number comes up.
# Return the total number of throws.
def rollDieUntilTarget(target):
print("Rolling until a " + str(target... | [
"random.randint"
] | [((84, 104), 'random.randint', 'random.randint', (['(1)', '(6)'], {}), '(1, 6)\n', (98, 104), False, 'import random\n')] |
# Generated by Django 3.2 on 2021-05-30 18:47
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('scrapers', '0011_alter_retsinfosentences_document'),
('documents', '0001_initial'),
]
operations = [
migrations.RenameModel(
old_n... | [
"django.db.migrations.RenameModel"
] | [((279, 367), 'django.db.migrations.RenameModel', 'migrations.RenameModel', ([], {'old_name': '"""DocumentEmbeddings"""', 'new_name': '"""DocumentEmbedding"""'}), "(old_name='DocumentEmbeddings', new_name=\n 'DocumentEmbedding')\n", (301, 367), False, 'from django.db import migrations\n')] |
# -*- coding: utf-8 -*-
"""
Created on Wed May 03 15:01:31 2017
@author: jdkern
"""
import pandas as pd
import numpy as np
#read generator parameters into DataFrame
df_gen = pd.read_excel('NEISO_data_file/generators.xlsx',header=0)
#read transmission path parameters into DataFrame
df_paths = pd.read_csv('NEISO_data... | [
"pandas.DataFrame",
"numpy.sum",
"os.makedirs",
"pandas.read_csv",
"numpy.ones",
"pandas.read_excel",
"numpy.column_stack",
"pathlib.Path.cwd",
"shutil.copy"
] | [((177, 235), 'pandas.read_excel', 'pd.read_excel', (['"""NEISO_data_file/generators.xlsx"""'], {'header': '(0)'}), "('NEISO_data_file/generators.xlsx', header=0)\n", (190, 235), True, 'import pandas as pd\n'), ((297, 347), 'pandas.read_csv', 'pd.read_csv', (['"""NEISO_data_file/paths.csv"""'], {'header': '(0)'}), "('N... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from bs4 import BeautifulSoup
from django.http import QueryDict
from cms.api import add_plugin
from cms.utils.plugins import build_plugin_tree
from cmsplugin_cascade.models import CascadeElement
from cmsplugin_cascade.bootstrap3.container import (Bootstra... | [
"cmsplugin_cascade.bootstrap3.container.BootstrapRowForm",
"cms.utils.plugins.build_plugin_tree",
"cms.api.add_plugin",
"django.http.QueryDict",
"cmsplugin_cascade.models.CascadeElement.objects.filter"
] | [((719, 831), 'cms.api.add_plugin', 'add_plugin', (['self.placeholder', 'BootstrapContainerPlugin', '"""en"""'], {'glossary': "{'breakpoints': BS3_BREAKPOINT_KEYS}"}), "(self.placeholder, BootstrapContainerPlugin, 'en', glossary={\n 'breakpoints': BS3_BREAKPOINT_KEYS})\n", (729, 831), False, 'from cms.api import add... |
from specter.runner import activate
activate()
| [
"specter.runner.activate"
] | [((36, 46), 'specter.runner.activate', 'activate', ([], {}), '()\n', (44, 46), False, 'from specter.runner import activate\n')] |
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/00_core.ipynb (unless otherwise specified).
__all__ = ['XLAOptimProxy', 'DeviceMoverTransform', 'isAffineCoordTfm', 'isDeviceMoverTransform', 'has_affinecoord_tfm',
'has_devicemover_tfm', 'get_last_affinecoord_tfm_idx', 'insert_batch_tfm', 'XLAOptCallback']
#... | [
"torch_xla.core.xla_model.xla_device",
"torch_xla.core.xla_model.optimizer_step",
"fastcore.basics.store_attr",
"torch.device"
] | [((5669, 5688), 'torch.device', 'torch.device', (['"""cpu"""'], {}), "('cpu')\n", (5681, 5688), False, 'import torch\n'), ((1260, 1310), 'torch_xla.core.xla_model.optimizer_step', 'xm.optimizer_step', (['self.opt'], {'barrier': 'self._barrier'}), '(self.opt, barrier=self._barrier)\n', (1277, 1310), True, 'import torch_... |
import pandas as pd
import plotly.express as px
from django.views.generic.base import TemplateView
from plotly.offline import plot
from sars_dashboard.calls.models import PangolinCall
from sars_dashboard.projects.models import Project
from sars_dashboard.samples.models import Sample
from sars_dashboard.voc_definitions... | [
"pandas.DataFrame",
"sars_dashboard.calls.models.PangolinCall.objects.filter",
"plotly.offline.plot",
"sars_dashboard.samples.models.Sample.objects.filter",
"plotly.express.bar",
"sars_dashboard.voc_definitions.VOCS.items",
"plotly.express.pie",
"sars_dashboard.projects.models.Project.objects.first",
... | [((584, 607), 'sars_dashboard.projects.models.Project.objects.first', 'Project.objects.first', ([], {}), '()\n', (605, 607), False, 'from sars_dashboard.projects.models import Project\n'), ((801, 845), 'sars_dashboard.samples.models.Sample.objects.filter', 'Sample.objects.filter', ([], {'project': 'first_project'}), '(... |
import os
import glob
import sys
import error_handle as eh
###########################################################################################################################
def initialize():
###########################################################################################################... | [
"os.path.dirname",
"os.remove",
"error_handle.display_error",
"glob.glob"
] | [((5236, 5286), 'glob.glob', 'glob.glob', (["(PREPATH + '/SUBCIRCUITS_USER_DEFINED/*')"], {}), "(PREPATH + '/SUBCIRCUITS_USER_DEFINED/*')\n", (5245, 5286), False, 'import glob\n'), ((3072, 3101), 'error_handle.display_error', 'eh.display_error', (['(0)', '(0)', '(-4)', '(0)'], {}), '(0, 0, -4, 0)\n', (3088, 3101), True... |
from slackapptk.request.any import AnyRequest
from slackapptk.web.classes.view import View
__all__ = [
'AnyRequest',
'ViewRequest',
'View'
]
class ViewRequest(AnyRequest):
def __init__(
self,
app,
payload
):
super().__init__(
app=app,
rqst_t... | [
"slackapptk.web.classes.view.View.from_view"
] | [((444, 480), 'slackapptk.web.classes.view.View.from_view', 'View.from_view', ([], {'view': "payload['view']"}), "(view=payload['view'])\n", (458, 480), False, 'from slackapptk.web.classes.view import View\n')] |
from packaging import version as version_parser
from deps_report.models import Dependency
from deps_report.models.results import VersionResult
def get_display_output_for_dependency(dependency: Dependency) -> str:
"""Get display name for dependency with some details (transitive, dev-only...)."""
properties = ... | [
"packaging.version.parse"
] | [((801, 844), 'packaging.version.parse', 'version_parser.parse', (['result.latest_version'], {}), '(result.latest_version)\n', (821, 844), True, 'from packaging import version as version_parser\n'), ((873, 919), 'packaging.version.parse', 'version_parser.parse', (['result.installed_version'], {}), '(result.installed_ve... |
""" Module of realisation choice relevant information in articles """
import langdetect
import openpyxl
import pandas as pd
import modules.pytextrank.pytextrank.pytextrank as pyt
from nltk.corpus import wordnet
from modules.kku.trans.mtranslate.mtranslate import translate
class Article:
""" Class of articles """... | [
"modules.kku.trans.mtranslate.mtranslate.translate",
"nltk.corpus.wordnet.synsets",
"openpyxl.load_workbook",
"pandas.read_excel",
"modules.pytextrank.pytextrank.pytextrank.top_keywords_sentences",
"langdetect.detect",
"pandas.set_option"
] | [((6125, 6167), 'pandas.read_excel', 'pd.read_excel', (['"""articles_with_punkts.xlsx"""'], {}), "('articles_with_punkts.xlsx')\n", (6138, 6167), True, 'import pandas as pd\n'), ((6172, 6208), 'pandas.set_option', 'pd.set_option', (['"""display.width"""', 'None'], {}), "('display.width', None)\n", (6185, 6208), True, '... |
import numpy as np
# dictionary describing options available to tune this algorithm
options = {
"peak_size": {"purpose": "Estimate of the peak size, in pixels. If 'auto', attempts to determine automatically. Otherwise, this should be an integer.",
"default": "auto",
"type": "i... | [
"numpy.zeros"
] | [((750, 766), 'numpy.zeros', 'np.zeros', (['(4, 2)'], {}), '((4, 2))\n', (758, 766), True, 'import numpy as np\n')] |
import os
import typing
from sqlalchemy.orm import Session
import const
from database import models
from database.database import SessionLocal
from db.api_key import add_initial_api_key_for_admin
from db.wireguard import server_add_on_init
from script.wireguard import is_installed, start_interface, is_running, load_e... | [
"script.wireguard.load_environment_clients",
"script.wireguard.start_interface",
"script.wireguard.is_running",
"database.database.SessionLocal",
"script.wireguard.is_installed",
"db.api_key.add_initial_api_key_for_admin",
"os.getenv",
"db.wireguard.server_add_on_init"
] | [((382, 396), 'database.database.SessionLocal', 'SessionLocal', ([], {}), '()\n', (394, 396), False, 'from database.database import SessionLocal\n'), ((728, 757), 'script.wireguard.load_environment_clients', 'load_environment_clients', (['_db'], {}), '(_db)\n', (752, 757), False, 'from script.wireguard import is_instal... |
import hashlib
import logging
import os
import shutil
import struct
import tempfile
import falcon
from datalad_service.common.stream import update_file
from datalad_service.handlers.git import _check_git_access, _handle_failed_access
def hashdirmixed(key):
"""Python implementation of git-annex hashing for non-b... | [
"os.remove",
"os.path.dirname",
"struct.unpack",
"os.path.exists",
"datalad_service.handlers.git._handle_failed_access",
"datalad_service.common.stream.update_file",
"datalad_service.handlers.git._check_git_access",
"logging.getLogger"
] | [((459, 490), 'struct.unpack', 'struct.unpack', (['"""<I"""', 'digest[:4]'], {}), "('<I', digest[:4])\n", (472, 490), False, 'import struct\n'), ((1129, 1177), 'logging.getLogger', 'logging.getLogger', (["('datalad_service.' + __name__)"], {}), "('datalad_service.' + __name__)\n", (1146, 1177), False, 'import logging\n... |
from plume.perceptron import PerceptronClassifier
import numpy as np
x_train = np.array([[3, 3], [4, 3], [1, 1]])
y_train = np.array([1, 1, -1])
clf = PerceptronClassifier(dual=False)
clf.fit(x_train, y_train)
print(clf.get_model())
print(clf.predict(x_train))
clf1 = PerceptronClassifier()
clf1.fit(x_train, y_trai... | [
"plume.perceptron.PerceptronClassifier",
"numpy.array"
] | [((80, 114), 'numpy.array', 'np.array', (['[[3, 3], [4, 3], [1, 1]]'], {}), '([[3, 3], [4, 3], [1, 1]])\n', (88, 114), True, 'import numpy as np\n'), ((125, 145), 'numpy.array', 'np.array', (['[1, 1, -1]'], {}), '([1, 1, -1])\n', (133, 145), True, 'import numpy as np\n'), ((153, 185), 'plume.perceptron.PerceptronClassi... |
from transformers import BertForTokenClassification
import torch
from transformers import BertTokenizer
import numpy as np
import nltk.data
nltk.download('punkt')
import torch
from torch.utils.data import TensorDataset, DataLoader, RandomSampler, SequentialSampler
from transformers import BertTokenizer, BertConfig, Au... | [
"matplotlib.pyplot.title",
"seqeval.metrics.accuracy_score",
"torch.utils.data.RandomSampler",
"numpy.argmax",
"sklearn.metrics.classification_report",
"matplotlib.pyplot.figure",
"sklearn.metrics.f1_score",
"torch.utils.data.TensorDataset",
"torch.device",
"torch.no_grad",
"torch.utils.data.Dat... | [((1162, 1182), 'torch.device', 'torch.device', (['"""cuda"""'], {}), "('cuda')\n", (1174, 1182), False, 'import torch\n'), ((2192, 2233), 'os.path.exists', 'os.path.exists', (['"""Models/BERT_epoch-10.pt"""'], {}), "('Models/BERT_epoch-10.pt')\n", (2206, 2233), False, 'import os\n'), ((3178, 3197), 'nltk.tokenize.sent... |
import sys
import requests
from urllib.parse import urljoin
JFROG_API_KEY_HEADER_NAME = 'X-JFrog-Art-Api'
class DockerRegistryPagination:
def __init__(self, concatenating_key):
self.concatenating_key = concatenating_key
def __call__(self, url, *args, **kwargs):
response = requests.get(url, *... | [
"urllib.parse.urljoin",
"requests.get"
] | [((301, 335), 'requests.get', 'requests.get', (['url', '*args'], {}), '(url, *args, **kwargs)\n', (313, 335), False, 'import requests\n'), ((513, 556), 'urllib.parse.urljoin', 'urljoin', (['url', "response.links['next']['url']"], {}), "(url, response.links['next']['url'])\n", (520, 556), False, 'from urllib.parse impor... |
import pytest, fastai
from fastai.utils.mem import *
from math import isclose
# Important: When modifying this test module, make sure to validate that it runs w/o
# GPU, by running: CUDA_VISIBLE_DEVICES="" pytest
# most tests are run regardless of cuda available or not, we just get zeros when gpu is not available
if t... | [
"pytest.mark.skipif",
"math.isclose"
] | [((2163, 2220), 'pytest.mark.skipif', 'pytest.mark.skipif', (['(not have_cuda)'], {'reason': '"""requires cuda"""'}), "(not have_cuda, reason='requires cuda')\n", (2181, 2220), False, 'import pytest, fastai\n'), ((2951, 3004), 'math.isclose', 'isclose', (['used_before', 'used_after_reclaimed'], {'abs_tol': '(2)'}), '(u... |
'''
The Normal CDF
100xp
Now that you have a feel for how the Normal PDF looks, let's consider its CDF. Using the
samples you generated in the last exercise (in your namespace as samples_std1, samples_std3,
and samples_std10), generate and plot the CDFs.
Instructions
-Use your ecdf() function to generate x and y value... | [
"numpy.random.seed",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.margins",
"matplotlib.pyplot.legend",
"numpy.sort",
"numpy.arange",
"numpy.random.normal"
] | [((1123, 1141), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (1137, 1141), True, 'import numpy as np\n'), ((1274, 1310), 'numpy.random.normal', 'np.random.normal', (['(20)', '(1)'], {'size': '(100000)'}), '(20, 1, size=100000)\n', (1290, 1310), True, 'import numpy as np\n'), ((1326, 1362), 'numpy.ra... |
import sys
a="hello"
def myfunc():
print("xxxx")
a="du"
print (a)
myfunc()
print(a)
x="xxxxx\""
print(x, x[3:9])
print (str.format("abc {}",a))
for x in range(10):
if x%2 == 0:
print(x)
else:
pass
# while True:
# print(a)
powOf = lambda a : a*a
print(powOf(4))
def lbdIn... | [
"datetime.datetime.now",
"json.dumps"
] | [((639, 661), 'json.dumps', 'json.dumps', (["{'A': 'a'}"], {}), "({'A': 'a'})\n", (649, 661), False, 'import json\n'), ((669, 691), 'json.dumps', 'json.dumps', (["('a', 'b')"], {}), "(('a', 'b'))\n", (679, 691), False, 'import json\n'), ((699, 719), 'json.dumps', 'json.dumps', (["[1, 'a']"], {}), "([1, 'a'])\n", (709, ... |
# -*- coding: utf-8 -*-
"""
Description
-----------
This module defines the :obj:`ParaMol.Tasks.parametrization.Parametrization` class, which is a ParaMol task that performs force field parametrization.
"""
import numpy as np
import logging
# ParaMol libraries
from .task import *
from ..Optimizers.optimizer import *
f... | [
"logging.info",
"scipy.optimize.LinearConstraint",
"numpy.sum",
"numpy.asarray"
] | [((12519, 12562), 'logging.info', 'logging.info', (['"""Applying charge correction."""'], {}), "('Applying charge correction.')\n", (12531, 12562), False, 'import logging\n'), ((13266, 13313), 'logging.info', 'logging.info', (['"""Not applying charge correction."""'], {}), "('Not applying charge correction.')\n", (1327... |
import sys
from flask import Flask
import telegram
import spotipy
import spotipy.util as util
from spotipy.oauth2 import SpotifyClientCredentials
from config import config
bot = None
spotify = None
def create_app(config_name):
global bot
global spotify
app = Flask(__name__)
app.config.from_object... | [
"flask.Flask",
"telegram.Bot",
"spotipy.Spotify",
"spotipy.oauth2.SpotifyClientCredentials",
"sys.exit"
] | [((278, 293), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (283, 293), False, 'from flask import Flask\n'), ((353, 405), 'telegram.Bot', 'telegram.Bot', (['config[config_name].TELEGRAM_API_TOKEN'], {}), '(config[config_name].TELEGRAM_API_TOKEN)\n', (365, 405), False, 'import telegram\n'), ((694, 805), 's... |
import json
import os
import random
import bottle
from api import ping_response, start_response, move_response, end_response
@bottle.route('/')
def index():
return '''
Battlesnake documentation can be found at
<a href="https://docs.battlesnake.com">https://docs.battlesnake.com</a>.
'''
@bottle.route('/stati... | [
"api.ping_response",
"bottle.default_app",
"bottle.static_file",
"json.dumps",
"bottle.route",
"api.start_response",
"api.move_response",
"api.end_response",
"os.getenv",
"bottle.post"
] | [((129, 146), 'bottle.route', 'bottle.route', (['"""/"""'], {}), "('/')\n", (141, 146), False, 'import bottle\n'), ((300, 335), 'bottle.route', 'bottle.route', (['"""/static/<path:path>"""'], {}), "('/static/<path:path>')\n", (312, 335), False, 'import bottle\n'), ((562, 582), 'bottle.post', 'bottle.post', (['"""/ping"... |
#!/usr/bin/env python3
import site
import configs
SOURCE_CODE_FILEPATH = '/home/jovyan/work/src'
def set_import_path(import_path=configs.SOURCE_CODE_FILEPATH):
site.addsitedir(import_path)
print("Added the following path to the import paths "
"list:\n{}".format(import_path))
if __name__ == '__mai... | [
"site.addsitedir"
] | [((168, 196), 'site.addsitedir', 'site.addsitedir', (['import_path'], {}), '(import_path)\n', (183, 196), False, 'import site\n')] |
from setuptools import setup
setup(
name="tf-ffcv",
version="0.0.2",
packages=["tf_ffcv"],
description='Utilitaries to integrate tensorflow to FFCV',
author='MadryLab',
author_email='<EMAIL>',
)
| [
"setuptools.setup"
] | [((30, 201), 'setuptools.setup', 'setup', ([], {'name': '"""tf-ffcv"""', 'version': '"""0.0.2"""', 'packages': "['tf_ffcv']", 'description': '"""Utilitaries to integrate tensorflow to FFCV"""', 'author': '"""MadryLab"""', 'author_email': '"""<EMAIL>"""'}), "(name='tf-ffcv', version='0.0.2', packages=['tf_ffcv'], descri... |
# Copyright (c) 2011-2017 Berkeley Model United Nations. All rights reserved.
# Use of this source code is governed by a BSD License (see LICENSE).
from django.urls import reverse
from django.test import TestCase
from huxley.utils.test import models
class RegistrationAdminTest(TestCase):
fixtures = ['conferenc... | [
"django.urls.reverse",
"huxley.utils.test.models.new_superuser",
"huxley.utils.test.models.new_registration"
] | [((457, 482), 'huxley.utils.test.models.new_registration', 'models.new_registration', ([], {}), '()\n', (480, 482), False, 'from huxley.utils.test import models\n'), ((492, 557), 'huxley.utils.test.models.new_superuser', 'models.new_superuser', ([], {'username': '"""superuser"""', 'password': '"""<PASSWORD>"""'}), "(us... |
import sys
sys.path.append('../')
import torchnet as tnt
from torch.autograd import Variable
import torch.nn.functional as F
from model_utils.load_utils import load_model, SAVE_ROOT
from model_utils.model_utils import get_layer_names
MODEL_NAME='mobilenetv2_imagenet'
model_init,model = load_model(MO... | [
"sys.path.append",
"tensor_compression.get_compressed_model",
"copy.deepcopy",
"os.makedirs",
"torch.autograd.Variable",
"flopco.FlopCo",
"os.path.exists",
"torchnet.meter.AverageValueMeter",
"torch.nn.functional.cross_entropy",
"model_utils.model_utils.get_layer_names",
"torch.save",
"collect... | [((16, 38), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (31, 38), False, 'import sys\n'), ((307, 329), 'model_utils.load_utils.load_model', 'load_model', (['MODEL_NAME'], {}), '(MODEL_NAME)\n', (317, 329), False, 'from model_utils.load_utils import load_model, SAVE_ROOT\n'), ((364, 394), 'mo... |
"""Example program to show how to read a multi-channel time series from LSL."""
import math
import threading
# import pygame
from random import random
from sklearn.preprocessing import OneHotEncoder
from pylsl import StreamInlet, resolve_stream
import numpy as np
import pandas as pd
import time
from sklearn import m... | [
"motor_bci_game.Game",
"numpy.load",
"models.CNN2",
"sklearn.metrics.accuracy_score",
"models.RNN",
"models.LDA",
"pandas.DataFrame",
"models.KNN",
"numpy.fft.fft",
"pylsl.resolve_stream",
"pylsl.StreamInlet",
"numpy.append",
"threading.Thread",
"numpy.save",
"datetime.datetime.today",
... | [((592, 624), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""error"""'], {}), "('error')\n", (615, 624), False, 'import warnings\n'), ((1244, 1260), 'numpy.zeros', 'np.zeros', (['(0, 3)'], {}), '((0, 3))\n', (1252, 1260), True, 'import numpy as np\n'), ((1889, 1900), 'numpy.array', 'np.array', (['x'], {}),... |
import itertools
from .database import Database
class Connection(object):
_CONNECTION_ID = itertools.count()
def __init__(self, host = None, port = None, max_pool_size = 10,
network_timeout = None, document_class = dict,
tz_aware = False, _connect = True, **kwargs):
... | [
"itertools.count"
] | [((97, 114), 'itertools.count', 'itertools.count', ([], {}), '()\n', (112, 114), False, 'import itertools\n')] |
"""
Tests brusselator
"""
import numpy as np
from pymgrit.brusselator.brusselator import Brusselator
from pymgrit.brusselator.brusselator import VectorBrusselator
def test_brusselator_constructor():
"""
Test constructor
"""
brusselator = Brusselator(t_start=0, t_stop=1, nt=11)
np.testing.assert_... | [
"numpy.zeros",
"numpy.ones",
"numpy.array",
"numpy.testing.assert_equal",
"pymgrit.brusselator.brusselator.VectorBrusselator",
"pymgrit.brusselator.brusselator.Brusselator"
] | [((257, 296), 'pymgrit.brusselator.brusselator.Brusselator', 'Brusselator', ([], {'t_start': '(0)', 't_stop': '(1)', 'nt': '(11)'}), '(t_start=0, t_stop=1, nt=11)\n', (268, 296), False, 'from pymgrit.brusselator.brusselator import Brusselator\n'), ((302, 343), 'numpy.testing.assert_equal', 'np.testing.assert_equal', ([... |
from keras import layers
from keras import models
def cnn_model(shape=(80,80,3),dropout=0.5,last_activation='softmax'):
model=models.Sequential()
model.add(layers.Conv2D(64,(3,3),activation='relu',input_shape=shape))
model.add(layers.MaxPool2D((2,2)))
model.add(layers.Conv2D(64,(3,3),act... | [
"keras.layers.Dropout",
"keras.layers.MaxPool2D",
"keras.layers.Flatten",
"keras.layers.Dense",
"keras.layers.Conv2D",
"keras.models.Sequential"
] | [((143, 162), 'keras.models.Sequential', 'models.Sequential', ([], {}), '()\n', (160, 162), False, 'from keras import models\n'), ((787, 806), 'keras.models.Sequential', 'models.Sequential', ([], {}), '()\n', (804, 806), False, 'from keras import models\n'), ((178, 241), 'keras.layers.Conv2D', 'layers.Conv2D', (['(64)'... |
import govee_api.device as dev
import abc
class _AbstractGoveeDeviceFactory(abc.ABC):
""" Declare an interface for operations that create abstract Govee devices """
@abc.abstractmethod
def build(self, govee, identifier, topic, sku, name, connected):
""" Build Govee device """
pass
clas... | [
"govee_api.device.GoveeWhiteBulb",
"govee_api.device.GoveeBulb",
"govee_api.device.GoveeLedStrip"
] | [((928, 993), 'govee_api.device.GoveeLedStrip', 'dev.GoveeLedStrip', (['govee', 'identifier', 'topic', 'sku', 'name', 'connected'], {}), '(govee, identifier, topic, sku, name, connected)\n', (945, 993), True, 'import govee_api.device as dev\n'), ((551, 617), 'govee_api.device.GoveeWhiteBulb', 'dev.GoveeWhiteBulb', (['g... |
import subprocess
import pytest
def test_cli_meta():
assert subprocess.call(["pytest-check-links", "--version"]) == 0
assert subprocess.call(["pytest-check-links", "--help"]) == 0
@pytest.mark.parametrize("example,rc,expected,unexpected", [
["httpbin.md", 0, [" 6 passed"], [" failed"]],
["rst.rst", ... | [
"pytest.mark.parametrize",
"subprocess.Popen",
"subprocess.call"
] | [((193, 365), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""example,rc,expected,unexpected"""', "[['httpbin.md', 0, [' 6 passed'], [' failed']], ['rst.rst', 1, [' 2 failed',\n ' 7 passed'], [' warning']]]"], {}), "('example,rc,expected,unexpected', [['httpbin.md', 0,\n [' 6 passed'], [' failed']], [... |
#!/usr/bin/env python
import numpy as np
import mixem
from mixem.distribution import MultivariateNormalDistribution
def generate_data():
dist_params = [
(np.array([4]), np.diag([1])),
(np.array([1]), np.diag([0.5]))
]
weights = [0.3, 0.7]
n_data = 5000
data = np.zeros((n_data, 1... | [
"numpy.zeros",
"mixem.distribution.MultivariateNormalDistribution",
"numpy.mean",
"numpy.array",
"numpy.random.multivariate_normal",
"numpy.diag",
"numpy.var"
] | [((301, 322), 'numpy.zeros', 'np.zeros', (['(n_data, 1)'], {}), '((n_data, 1))\n', (309, 322), True, 'import numpy as np\n'), ((558, 571), 'numpy.mean', 'np.mean', (['data'], {}), '(data)\n', (565, 571), True, 'import numpy as np\n'), ((584, 596), 'numpy.var', 'np.var', (['data'], {}), '(data)\n', (590, 596), True, 'im... |
from sqlalchemy.sql.expression import null, text
from sqlalchemy.sql.sqltypes import TIMESTAMP
from .database import Base
from sqlalchemy import Column, Integer, String, Boolean
class Post(Base):
__tablename__ = "user_posts"
id = Column(Integer, primary_key=True, nullable=False)
title = Column(String, nul... | [
"sqlalchemy.sql.expression.text",
"sqlalchemy.sql.sqltypes.TIMESTAMP",
"sqlalchemy.Column"
] | [((240, 289), 'sqlalchemy.Column', 'Column', (['Integer'], {'primary_key': '(True)', 'nullable': '(False)'}), '(Integer, primary_key=True, nullable=False)\n', (246, 289), False, 'from sqlalchemy import Column, Integer, String, Boolean\n'), ((302, 332), 'sqlalchemy.Column', 'Column', (['String'], {'nullable': '(False)'}... |
import struct
from pymaginopolis.chunkyfile import model as model
from pymaginopolis.chunkyfile.model import Endianness, CharacterSet
GRPB_HEADER_SIZE = 20
CHARACTER_SETS = {
model.CharacterSet.ANSI: "latin1",
model.CharacterSet.UTF16LE: "utf-16le"
}
def get_string_size_format(characterset):
# FUTURE: ... | [
"pymaginopolis.chunkyfile.model.Endianness",
"struct.unpack",
"pymaginopolis.chunkyfile.model.CharacterSet"
] | [((800, 833), 'pymaginopolis.chunkyfile.model.CharacterSet', 'model.CharacterSet', (['character_set'], {}), '(character_set)\n', (818, 833), True, 'from pymaginopolis.chunkyfile import model as model\n'), ((2672, 2698), 'struct.unpack', 'struct.unpack', (['"""<2H"""', 'data'], {}), "('<2H', data)\n", (2685, 2698), Fals... |
#
# This file is part of pyasn1-alt-modules software.
#
# Created by <NAME> with assistance from asn1ate v.0.6.0.
# Modified by <NAME> to add maps for use with opentypes.
# Modified by <NAME> to include the opentypemap manager.
#
# Copyright (c) 2019-2022, Vigil Security, LLC
# License: http://vigilsec.com/pyasn1-alt-m... | [
"pyasn1.type.namedval.NamedValues",
"pyasn1_alt_modules.opentypemap.get",
"pyasn1.type.constraint.ValueSizeConstraint",
"pyasn1.type.univ.ObjectIdentifier"
] | [((712, 755), 'pyasn1_alt_modules.opentypemap.get', 'opentypemap.get', (['"""certificateExtensionsMap"""'], {}), "('certificateExtensionsMap')\n", (727, 755), False, 'from pyasn1_alt_modules import opentypemap\n'), ((882, 932), 'pyasn1.type.univ.ObjectIdentifier', 'univ.ObjectIdentifier', (['"""1.2.840.113549.1.9.16.1.... |
import unittest
import numpy as np
from quasimodo.assertion_fusion.gaussian_nb_with_missing_values import GaussianNBWithMissingValues
class TestFilterObject(unittest.TestCase):
def test_gaussian2(self):
std = -0.1339048038303071
mean = -0.1339048038303071
x = 150.10086283379565
... | [
"unittest.main",
"quasimodo.assertion_fusion.gaussian_nb_with_missing_values.GaussianNBWithMissingValues",
"numpy.array"
] | [((4045, 4060), 'unittest.main', 'unittest.main', ([], {}), '()\n', (4058, 4060), False, 'import unittest\n'), ((450, 478), 'numpy.array', 'np.array', (['([1] * 10 + [0] * 5)'], {}), '([1] * 10 + [0] * 5)\n', (458, 478), True, 'import numpy as np\n'), ((928, 939), 'numpy.array', 'np.array', (['x'], {}), '(x)\n', (936, ... |
from itertools import cycle
import numpy as np
from scipy import sparse
import h5py
from evaluation import load_nuswide, normalize
rng = np.random.RandomState(1701)
transformer = []
batch_size = 100
def load():
_, label, _, label_name, _, data = load_nuswide('nuswide-decaf.npz', 'train')
data = data.toarray()
d... | [
"h5py.File",
"gensim.models.Word2Vec.load_word2vec_format",
"numpy.tensordot",
"evaluation.normalize",
"numpy.asarray",
"numpy.zeros",
"numpy.random.RandomState",
"numpy.linalg.norm",
"numpy.dot",
"evaluation.load_nuswide"
] | [((138, 165), 'numpy.random.RandomState', 'np.random.RandomState', (['(1701)'], {}), '(1701)\n', (159, 165), True, 'import numpy as np\n'), ((250, 292), 'evaluation.load_nuswide', 'load_nuswide', (['"""nuswide-decaf.npz"""', '"""train"""'], {}), "('nuswide-decaf.npz', 'train')\n", (262, 292), False, 'from evaluation im... |
import numpy as np
from ..AShape import AShape, AShape
class TileInfo:
"""
Tile info.
arguments
shape AShape
tiles Iterable of ints
errors during the construction:
ValueError
result:
.o_shape AShape
.axes_slices list of slice() to fetch origi... | [
"numpy.prod"
] | [((738, 752), 'numpy.prod', 'np.prod', (['tiles'], {}), '(tiles)\n', (745, 752), True, 'import numpy as np\n')] |
import random
import pickle
import numpy as np
import torch
M = 2**32 - 1
def init_fn(worker):
seed = torch.LongTensor(1).random_().item()
seed = (seed + worker) % M
np.random.seed(seed)
random.seed(seed)
def add_mask(x, mask, dim=1):
mask = mask.unsqueeze(dim)
shape = list(x.shape); shape[di... | [
"numpy.random.seed",
"torch.LongTensor",
"pickle.load",
"numpy.array",
"random.seed",
"numpy.arange",
"torch.tensor"
] | [((1122, 1139), 'torch.tensor', 'torch.tensor', (['[0]'], {}), '([0])\n', (1134, 1139), False, 'import torch\n'), ((180, 200), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (194, 200), True, 'import numpy as np\n'), ((205, 222), 'random.seed', 'random.seed', (['seed'], {}), '(seed)\n', (216, 222), ... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-06-07 15:03
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('smartshark', '0005_auto_20160607_1657'),
]
operatio... | [
"django.db.models.ForeignKey",
"django.db.models.URLField",
"django.db.models.CharField",
"django.db.models.AutoField"
] | [((770, 875), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'default': 'None', 'on_delete': 'django.db.models.deletion.CASCADE', 'to': '"""smartshark.Project"""'}), "(default=None, on_delete=django.db.models.deletion.CASCADE,\n to='smartshark.Project')\n", (787, 875), False, 'from django.db import migrat... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
Requires python3 package for influxDB to import InfluxDBClient:
sudo apt install python3-influxdb
API documentation for python InfluxDBClient:
https://influxdb-python.readthedocs.io/en/latest/api-documentation.html#
users = db_client.get_list_users()
print (users)
... | [
"influxdb.InfluxDBClient",
"argparse.ArgumentParser",
"json.loads"
] | [((639, 774), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""This application reads json from std in,\n\t\tand pushes received data to an InfluxDB"""'}), '(description=\n """This application reads json from std in,\n\t\tand pushes received data to an InfluxDB"""\n )\n', (662, 774),... |
# -*- coding: utf-8 -*-
import pytest
from fintopics.data.pipeline.regex import RegexExtractionPipeline
@pytest.fixture()
def regex_pipeline():
"""Creates a RegexExtractionPipeline fixture."""
return RegexExtractionPipeline()
@pytest.mark.asyncio
async def test_header_removal(datadir, regex_pipeline):
... | [
"fintopics.data.pipeline.regex.RegexExtractionPipeline",
"pytest.fixture"
] | [((109, 125), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (123, 125), False, 'import pytest\n'), ((212, 237), 'fintopics.data.pipeline.regex.RegexExtractionPipeline', 'RegexExtractionPipeline', ([], {}), '()\n', (235, 237), False, 'from fintopics.data.pipeline.regex import RegexExtractionPipeline\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date : 2021-01-05 14:57:15
# @Author : <NAME> (<EMAIL>)
import os
import json
import time
from backend import keras
class TrainingCallbacks(keras.callbacks.Callback):
def __init__(self, task_path='', log_name='training'):
self.task_path = task_path
... | [
"os.remove",
"time.localtime"
] | [((958, 999), 'os.remove', 'os.remove', (['f"""{self.task_path}/state.json"""'], {}), "(f'{self.task_path}/state.json')\n", (967, 999), False, 'import os\n'), ((2837, 2878), 'os.remove', 'os.remove', (['f"""{self.task_path}/state.json"""'], {}), "(f'{self.task_path}/state.json')\n", (2846, 2878), False, 'import os\n'),... |
"""Provide the constant elasticity of substitution function."""
import numpy as np
from copulpy.config_copulpy import IS_DEBUG
from copulpy.clsMeta import MetaCls
class CESCls(MetaCls):
"""CES class."""
def __init__(self, alpha, y_weight, discount_factor):
"""Initialize class."""
self.attr =... | [
"numpy.all",
"numpy.testing.assert_equal"
] | [((1094, 1135), 'numpy.testing.assert_equal', 'np.testing.assert_equal', (['(alpha >= 0)', '(True)'], {}), '(alpha >= 0, True)\n', (1117, 1135), True, 'import numpy as np\n'), ((1168, 1190), 'numpy.all', 'np.all', (['(y_weights >= 0)'], {}), '(y_weights >= 0)\n', (1174, 1190), True, 'import numpy as np\n'), ((1230, 125... |
#!/usr/bin/python
from SimpleCV import *
from numpy import linspace
from scipy.interpolate import UnivariateSpline
import sys, time, socket
#settings for the project)
srcImg = "../../sampleimages/orson_welles.jpg"
font_size = 20
sleep_for = 3 #seconds to sleep for
draw_color = Color.RED
while True:
image = Im... | [
"time.sleep"
] | [((434, 455), 'time.sleep', 'time.sleep', (['sleep_for'], {}), '(sleep_for)\n', (444, 455), False, 'import sys, time, socket\n'), ((591, 612), 'time.sleep', 'time.sleep', (['sleep_for'], {}), '(sleep_for)\n', (601, 612), False, 'import sys, time, socket\n'), ((770, 791), 'time.sleep', 'time.sleep', (['sleep_for'], {}),... |
#!/usr/bin/env python3
import struct, sys, traceback;
if (len(sys.argv) < 4):
print("Usage: %s ANK16.FNT KANJI16.FNT FONT.BMP"%sys.argv[0]);
exit(1);
ank16 = None;
with open(sys.argv[1], 'rb') as f:
data = f.read();
ank16 = [data[i:i+16] for i in range(0, 256*16, 16)];
kanji16 = None;
charTable = {}... | [
"traceback.print_exc",
"struct.pack"
] | [((2921, 2942), 'traceback.print_exc', 'traceback.print_exc', ([], {}), '()\n', (2940, 2942), False, 'import struct, sys, traceback\n'), ((1700, 1726), 'struct.pack', 'struct.pack', (['"""B"""', '(~d & 255)'], {}), "('B', ~d & 255)\n", (1711, 1726), False, 'import struct, sys, traceback\n'), ((1804, 1830), 'struct.pack... |
from UtilGp import UtilGp
from dBase import ndb
from TranData import DbTranData
from frmPageShop import Shop
class Report:
@staticmethod
def show():
UtilGp.Login(Report.reportMenu, ndb.loadTranByItem,'Reports (Login)')
@staticmethod
def showDateRange():
UtilGp.sleep(2);UtilGp.clear();Uti... | [
"frmPageShop.Shop.showFailure",
"TranData.DbTranData.queryAll",
"UtilGp.UtilGp.Login",
"TranData.DbTranData.queryByDateRange",
"UtilGp.UtilGp.title",
"TranData.DbTranData.printTran",
"TranData.DbTranData.queryByAmount",
"TranData.DbTranData.queryByCategory",
"UtilGp.UtilGp.printCaptionData",
"Util... | [((165, 235), 'UtilGp.UtilGp.Login', 'UtilGp.Login', (['Report.reportMenu', 'ndb.loadTranByItem', '"""Reports (Login)"""'], {}), "(Report.reportMenu, ndb.loadTranByItem, 'Reports (Login)')\n", (177, 235), False, 'from UtilGp import UtilGp\n'), ((286, 301), 'UtilGp.UtilGp.sleep', 'UtilGp.sleep', (['(2)'], {}), '(2)\n', ... |
import os
import logging
from six.moves.urllib.parse import urljoin
import six
from pelican import signals
from pelican.utils import pelican_open
if not six.PY3:
from codecs import open
logger = logging.getLogger(__name__)
source_files = []
PROCESS = ['articles', 'pages', 'drafts']
def link_source_files(generato... | [
"six.moves.urllib.parse.urljoin",
"codecs.open",
"os.path.join",
"pelican.signals.article_generator_finalized.connect",
"pelican.signals.page_generator_finalized.connect",
"os.path.split",
"pelican.utils.pelican_open",
"logging.getLogger",
"pelican.signals.page_writer_finalized.connect"
] | [((201, 228), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (218, 228), False, 'import logging\n'), ((3080, 3142), 'pelican.signals.article_generator_finalized.connect', 'signals.article_generator_finalized.connect', (['link_source_files'], {}), '(link_source_files)\n', (3123, 3142), Fal... |
import torch
import torch.nn as nn
from torch.nn import functional as F
from .base import ASPP, get_syncbn
class dec_deeplabv3(nn.Module):
def __init__(
self,
in_planes,
num_classes=19,
inner_planes=256,
sync_bn=False,
dilations=(12, 24, 36),
):
super(d... | [
"torch.nn.Dropout2d",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.cat",
"torch.nn.functional.interpolate"
] | [((3355, 3428), 'torch.nn.functional.interpolate', 'F.interpolate', (['aspp_out'], {'size': '(h, w)', 'mode': '"""bilinear"""', 'align_corners': '(True)'}), "(aspp_out, size=(h, w), mode='bilinear', align_corners=True)\n", (3368, 3428), True, 'from torch.nn import functional as F\n'), ((3470, 3508), 'torch.cat', 'torch... |
import argparse
import os
from process_utils import clean_reviews, make_sentences, clean_sentences
# Set script arguments
parser = argparse.ArgumentParser()
parser.add_argument('-g', '--goodreads', action='store_true', help='Set collection to GoodReads (as opposed to UCSD)')
args = parser.parse_args()
# Set whether t... | [
"os.mkdir",
"process_utils.clean_reviews",
"argparse.ArgumentParser",
"os.path.isdir",
"process_utils.make_sentences",
"process_utils.clean_sentences",
"os.listdir"
] | [((132, 157), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (155, 157), False, 'import argparse\n'), ((625, 649), 'os.path.isdir', 'os.path.isdir', (['write_dir'], {}), '(write_dir)\n', (638, 649), False, 'import os\n'), ((655, 674), 'os.mkdir', 'os.mkdir', (['write_dir'], {}), '(write_dir)\n'... |
import os
import numpy as np
import tensorrt as trt
from .utils import common, calibrator
class TRTModel:
def __init__(self, onnx_path, plan_path, mode="fp16", calibration_cache="calibration.cache",
calibration_dataset="", calibration_image_size="",
calibration_mean=[], calibra... | [
"tensorrt.Logger",
"tensorrt.OnnxParser",
"os.path.exists",
"tensorrt.Builder",
"numpy.array",
"tensorrt.Runtime"
] | [((862, 874), 'tensorrt.Logger', 'trt.Logger', ([], {}), '()\n', (872, 874), True, 'import tensorrt as trt\n'), ((4532, 4562), 'os.path.exists', 'os.path.exists', (['self.plan_path'], {}), '(self.plan_path)\n', (4546, 4562), False, 'import os\n'), ((1538, 1561), 'os.path.exists', 'os.path.exists', (['dataset'], {}), '(... |
"""empty message
Revision ID: 324666fdfa8a
Revises: <PASSWORD>
Create Date: 2016-08-04 13:45:37.492317
"""
# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = '<PASSWORD>'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - please adju... | [
"alembic.op.create_foreign_key",
"alembic.op.drop_constraint"
] | [((332, 447), 'alembic.op.drop_constraint', 'op.drop_constraint', (['u"""prod_process_association_product_id_fkey"""', '"""prod_process_association"""'], {'type_': '"""foreignkey"""'}), "(u'prod_process_association_product_id_fkey',\n 'prod_process_association', type_='foreignkey')\n", (350, 447), False, 'from alemb... |
from typing import Union
from attr import define
from cbor2 import decoder
from .cose import COSECRV, COSEKTY, COSEAlgorithmIdentifier, COSEKey
from .exceptions import InvalidPublicKeyStructure, UnsupportedPublicKeyType
@define
class DecodedOKPPublicKey:
kty: COSEKTY
alg: COSEAlgorithmIdentifier
crv: CO... | [
"cbor2.decoder.loads"
] | [((1595, 1613), 'cbor2.decoder.loads', 'decoder.loads', (['key'], {}), '(key)\n', (1608, 1613), False, 'from cbor2 import decoder\n')] |
from Instrucciones.TablaSimbolos.Instruccion import Instruccion
from Instrucciones.TablaSimbolos.Tipo import Tipo_Dato
from Instrucciones.Excepcion import Excepcion
class If(Instruccion):
'''
Esta clase representa la instrucci贸n if.
La instrucci贸n if recibe como par谩metro una expresi贸n l贸gica y la ... | [
"Instrucciones.Excepcion.Excepcion",
"Instrucciones.TablaSimbolos.Instruccion.Instruccion.__init__"
] | [((496, 562), 'Instrucciones.TablaSimbolos.Instruccion.Instruccion.__init__', 'Instruccion.__init__', (['self', 'None', 'linea', 'columna', 'strGram', 'strSent'], {}), '(self, None, linea, columna, strGram, strSent)\n', (516, 562), False, 'from Instrucciones.TablaSimbolos.Instruccion import Instruccion\n'), ((2768, 283... |