code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import logging
from rasa_core.agent import Agent
from rasa_core.policies.keras_policy import KerasPolicy
from rasa_core.policies.memoization import MemoizationPolicy
def run_faq(domain_file="config/faq_dom... | [
"logging.basicConfig",
"rasa_core.policies.keras_policy.KerasPolicy",
"rasa_core.policies.memoization.MemoizationPolicy"
] | [((700, 733), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': '"""INFO"""'}), "(level='INFO')\n", (719, 733), False, 'import logging\n'), ((440, 472), 'rasa_core.policies.memoization.MemoizationPolicy', 'MemoizationPolicy', ([], {'max_history': '(2)'}), '(max_history=2)\n', (457, 472), False, 'from rasa_co... |
# fmt: off
import logging
from pathlib import Path
from farm.data_handler.data_silo import DataSilo
from farm.data_handler.processor import RegressionProcessor, TextPairClassificationProcessor
from farm.experiment import initialize_optimizer
from farm.infer import Inferencer
from farm.modeling.adaptive_model import Ad... | [
"logging.basicConfig",
"farm.data_handler.data_silo.DataSilo",
"farm.utils.reformat_msmarco_dev",
"pathlib.Path",
"farm.utils.write_msmarco_results",
"farm.utils.set_all_seeds",
"farm.evaluation.msmarco_passage_farm.msmarco_evaluation",
"farm.infer.Inferencer.load",
"farm.modeling.tokenization.Token... | [((802, 945), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s - %(levelname)s - %(name)s - %(message)s"""', 'datefmt': '"""%m/%d/%Y %H:%M:%S"""', 'level': 'logging.INFO'}), "(format=\n '%(asctime)s - %(levelname)s - %(name)s - %(message)s', datefmt=\n '%m/%d/%Y %H:%M:%S', level=l... |
#!/usr/bin/env python
import numpy as np
import pandas as pd
import json
import pytz
def _get_data(file):
return pd.read_csv(file)
def _get_prices(data):
df = data
rome_tz = pytz.timezone('Europe/Rome')
df['time'] = pd.to_datetime(df['Timestamp'], unit='s')
df['time'].dt.tz_localize(pytz.UTC... | [
"pytz.timezone",
"pandas.to_datetime",
"pandas.read_csv"
] | [((120, 137), 'pandas.read_csv', 'pd.read_csv', (['file'], {}), '(file)\n', (131, 137), True, 'import pandas as pd\n'), ((193, 221), 'pytz.timezone', 'pytz.timezone', (['"""Europe/Rome"""'], {}), "('Europe/Rome')\n", (206, 221), False, 'import pytz\n'), ((240, 281), 'pandas.to_datetime', 'pd.to_datetime', (["df['Timest... |
import sys
from django.core.management import CommandError, call_command
from django.test import TestCase
from .side_effects import bad_database_check
try:
from unittest.mock import patch
except ImportError:
from mock import patch
# Python 2.7 support
if sys.version_info > (3, 0):
from io import StringI... | [
"mock.patch",
"io.BytesIO",
"django.core.management.call_command"
] | [((444, 454), 'io.BytesIO', 'StringIO', ([], {}), '()\n', (452, 454), True, 'from io import BytesIO as StringIO\n'), ((463, 502), 'django.core.management.call_command', 'call_command', (['"""healthcheck"""'], {'stdout': 'out'}), "('healthcheck', stdout=out)\n", (475, 502), False, 'from django.core.management import Com... |
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
# importing the modules
import os.path
import shutil
import datetime
import time
import re
# getting the current working directory
src_dir = os.getcwd()
# printing current directory
print("########## File-backup started ######... | [
"re.compile",
"time.sleep",
"datetime.datetime.now",
"shutil.copy",
"watchdog.observers.Observer",
"re.search"
] | [((2328, 2338), 'watchdog.observers.Observer', 'Observer', ([], {}), '()\n', (2336, 2338), False, 'from watchdog.observers import Observer\n'), ((1495, 1519), 'shutil.copy', 'shutil.copy', (['src', 'target'], {}), '(src, target)\n', (1506, 1519), False, 'import shutil\n'), ((1912, 1947), 're.compile', 're.compile', (['... |
import os
import pytest
import torch
import torch.distributed as dist
from ignite.distributed.comp_models import has_native_dist_support
if not has_native_dist_support:
pytest.skip("Skip if no native dist support", allow_module_level=True)
else:
from ignite.distributed.comp_models.native import _expand_hostl... | [
"torch.distributed.destroy_process_group",
"torch.cuda.device_count",
"torch.cuda.is_available",
"datetime.timedelta",
"torch.distributed.is_available",
"ignite.distributed.utils._model.get_world_size",
"torch.distributed.barrier",
"ignite.distributed.comp_models.native._setup_ddp_vars_from_slurm_env"... | [((468, 2074), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""hostlist, expected"""', "[('localhost', 'localhost'), ('compute!:b24_[1-2].r',\n 'compute!:b24_1.r,compute!:b24_2.r'), ('quartz[4-8]',\n 'quartz4,quartz5,quartz6,quartz7,quartz8'), ('c1001a-[11,17]',\n 'c1001a-11,c1001a-17'), ('c1001a-s... |
import pandas as pd
from .apriori_opt import apriori as apriori_opt
from .apriori_basic import apriori as apriori_basic
# from memory_profiler import profile
from .utils import log
def get_frequent_items_in_time(tweets, s, r, a, start=None, end=None, basic=False):
if tweets.empty:
return []
if not st... | [
"pandas.Grouper"
] | [((634, 684), 'pandas.Grouper', 'pd.Grouper', ([], {'key': '"""time"""', 'origin': 'start', 'freq': 'f"""{a}s"""'}), "(key='time', origin=start, freq=f'{a}s')\n", (644, 684), True, 'import pandas as pd\n')] |
# Import modules
from __future__ import print_function
import sys
import numpy as np
from polytope import box2poly
from tulip import hybrid
from tulip.abstract import prop2part, discretize
import Interface.DSL as DSL
from Interface import Statechart as dumpsmach
from Interface.Reduce import *
from Interface.Transfor... | [
"tulip.hybrid.LtiSysDyn",
"Interface.Statechart.tulip_to_xmi",
"tulip.abstract.prop2part",
"polytope.box2poly",
"numpy.array",
"sys.stdout.flush",
"tulip.abstract.discretize"
] | [((769, 845), 'numpy.array', 'np.array', (['[[1.0, 0, 2.0, 0], [0, 1.0, 0, 2], [0, 0, 0.5, 0], [0, 0, 0, 0.5]]'], {}), '([[1.0, 0, 2.0, 0], [0, 1.0, 0, 2], [0, 0, 0.5, 0], [0, 0, 0, 0.5]])\n', (777, 845), True, 'import numpy as np\n'), ((847, 915), 'numpy.array', 'np.array', (['[[0, 0, 0, 0], [0, 0, 0, 0], [5, -5, 0, 0... |
from open_publishing.core import SequenceItem, SequenceField, SequenceItemProperty
from open_publishing.core import FieldDescriptor, DatabaseObjectField, SimpleField
from open_publishing.user import User
from open_publishing.core.enums import ValueStatus
from open_publishing.core.enums import ProvisionRuleRole, Provisi... | [
"open_publishing.core.enums.ProvisionChannelBase.from_id",
"open_publishing.core.FieldDescriptor",
"open_publishing.core.SequenceItemProperty",
"open_publishing.core.enums.ProvisionChannelType.from_id",
"open_publishing.core.DatabaseObjectField",
"open_publishing.core.SimpleField"
] | [((782, 815), 'open_publishing.core.SequenceItemProperty', 'SequenceItemProperty', (['"""threshold"""'], {}), "('threshold')\n", (802, 815), False, 'from open_publishing.core import SequenceItem, SequenceField, SequenceItemProperty\n'), ((827, 855), 'open_publishing.core.SequenceItemProperty', 'SequenceItemProperty', (... |
import re
from typing import Dict, Tuple, List, NamedTuple, Optional
from lib.utils.decorators import with_exception_retry
from .helpers.common import (
split_hostport,
get_parsed_variables,
merge_hostport,
random_choice,
)
from .helpers.zookeeper import get_hostname_and_port_from_zk
# TODO: make thes... | [
"re.search"
] | [((1058, 1298), 're.search', 're.search', (['"""^(?:jdbc:)?hive2:\\\\/\\\\/([\\\\w.-]+(?:\\\\:\\\\d+)?(?:,[\\\\w.-]+(?:\\\\:\\\\d+)?)*)\\\\/(\\\\w*)((?:;[\\\\w.-]+=[\\\\w.-]+)*)(\\\\?[\\\\w.-]+=[\\\\w.-]+(?:;[\\\\w.-]+=[\\\\w.-]+)*)?(\\\\#[\\\\w.-]+=[\\\\w.-]+(?:;[\\\\w.-]+=[\\\\w.-]+)*)?$"""', 'connection_string'], {}... |
import argparse
import json
from data_management.DatasetFactory import datasetFactory
from config import cfg
import numpy as np
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Calculates metrics from output of a Classification network.' +
... | [
"argparse.ArgumentParser",
"config.cfg.freeze",
"config.cfg.merge_from_file",
"numpy.sum",
"numpy.zeros",
"data_management.DatasetFactory.datasetFactory",
"json.load",
"config.cfg.merge_from_list"
] | [((171, 325), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': "('Calculates metrics from output of a Classification network.' +\n ' Run `run_network.py <config> test` first.')"}), "(description=\n 'Calculates metrics from output of a Classification network.' +\n ' Run `run_network.py... |
# Copyright 2002-2018 MarkLogic Corporation. All Rights Reserved.
import boto3
import botocore
import logging
import hashlib
import json
import time
from botocore.exceptions import ClientError
log = logging.getLogger()
log.setLevel(logging.INFO)
# global variables
ec2_client = boto3.client('ec2')
asg_client = boto3... | [
"logging.getLogger",
"json.loads",
"boto3.client",
"json.dumps",
"time.sleep",
"boto3.resource"
] | [((202, 221), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (219, 221), False, 'import logging\n'), ((282, 301), 'boto3.client', 'boto3.client', (['"""ec2"""'], {}), "('ec2')\n", (294, 301), False, 'import boto3\n'), ((315, 342), 'boto3.client', 'boto3.client', (['"""autoscaling"""'], {}), "('autoscaling'... |
import unittest
from xsertion.layers import *
from keras.layers import Input, MaxPooling2D, Convolution2D, Activation, merge, Dense, Flatten
from keras.models import Model
import json
def desc(model : Model):
base_model_disc = json.loads(model.to_json())
return base_model_disc['config']
def topo_check(layer... | [
"keras.layers.Convolution2D",
"keras.layers.Flatten",
"keras.layers.merge",
"keras.layers.Dense",
"keras.layers.Input",
"keras.models.Model",
"keras.layers.Activation",
"unittest.main"
] | [((18754, 18769), 'unittest.main', 'unittest.main', ([], {}), '()\n', (18767, 18769), False, 'import unittest\n'), ((769, 811), 'keras.layers.Input', 'Input', ([], {'shape': '(3, 32, 32)', 'name': '"""TestInput"""'}), "(shape=(3, 32, 32), name='TestInput')\n", (774, 811), False, 'from keras.layers import Input, MaxPool... |
import time
from annotypes import Anno, add_call_types
from malcolm.core import PartRegistrar
from malcolm.modules import builtin
# Pull re-used annotypes into our namespace in case we are subclassed
APartName = builtin.parts.APartName
AMri = builtin.parts.AMri
with Anno("The demand value to move our counter motor ... | [
"malcolm.modules.builtin.util.no_save",
"annotypes.Anno",
"time.time"
] | [((585, 616), 'malcolm.modules.builtin.util.no_save', 'builtin.util.no_save', (['"""counter"""'], {}), "('counter')\n", (605, 616), False, 'from malcolm.modules import builtin\n'), ((271, 324), 'annotypes.Anno', 'Anno', (['"""The demand value to move our counter motor to"""'], {}), "('The demand value to move our count... |
# Copyright 2021 JD.com, Inc., JD AI
"""
@author: <NAME>
@contact: <EMAIL>
"""
import torch
import torch.nn as nn
__all__ = ["AttentionPooler"]
class AttentionPooler(nn.Module):
def __init__(
self,
*,
hidden_size: int,
output_size: int,
dropout: float,
use_bn: boo... | [
"torch.nn.ReLU",
"torch.nn.Dropout",
"torch.nn.Softmax",
"torch.nn.BatchNorm1d",
"torch.nn.Linear"
] | [((599, 634), 'torch.nn.Linear', 'nn.Linear', (['hidden_size', 'output_size'], {}), '(hidden_size, output_size)\n', (608, 634), True, 'import torch.nn as nn\n'), ((658, 676), 'torch.nn.Softmax', 'nn.Softmax', ([], {'dim': '(-1)'}), '(dim=-1)\n', (668, 676), True, 'import torch.nn as nn\n'), ((423, 458), 'torch.nn.Linea... |
"""
Signal endpoints that can be used in testbenches
"""
import textwrap
from typing import Dict
import sonar.base_types as base
class Endpoint(base.SonarObject):
"""
Endpoint class
"""
arguments: Dict[str, int] = {}
@classmethod
def instantiate(cls, _indent):
"""
Instantia... | [
"textwrap.dedent"
] | [((2842, 3153), 'textwrap.dedent', 'textwrap.dedent', (['f""" initial begin\n {name}_endpoint[$$endpointIndex] = {initial_value};\n forever begin\n #({period}/2) {name}_endpoint[$$endpointIndex] <= ~{name}_endpoint[$$endpointIndex];\n end\n ... |
#!/usr/bin/env python
"""
Generate the file classes_to_be_wrapped.hpp, which contains includes,
instantiation and naming typedefs for all classes that are to be
automatically wrapped.
"""
import os
import ntpath
class CppHeaderCollectionWriter():
"""
This class manages generation of the header collection f... | [
"os.path.exists",
"ntpath.basename",
"os.makedirs"
] | [((1194, 1233), 'os.path.exists', 'os.path.exists', (["(self.wrapper_root + '/')"], {}), "(self.wrapper_root + '/')\n", (1208, 1233), False, 'import os\n'), ((1247, 1283), 'os.makedirs', 'os.makedirs', (["(self.wrapper_root + '/')"], {}), "(self.wrapper_root + '/')\n", (1258, 1283), False, 'import os\n'), ((2358, 2383)... |
"""add separate reported and deleted tables
Revision ID: 491383f70589
Revises: <PASSWORD>
Create Date: 2020-06-26 05:23:30.267933
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = '491383f70589'
down_revision = '<PASSWORD... | [
"sqlalchemy.ForeignKeyConstraint",
"alembic.op.drop_table",
"alembic.op.f",
"alembic.op.drop_column",
"sqlalchemy.PrimaryKeyConstraint",
"sqlalchemy.VARCHAR",
"sqlalchemy.Integer",
"sqlalchemy.Text",
"sqlalchemy.TIMESTAMP",
"sqlalchemy.dialects.postgresql.ENUM"
] | [((1548, 1586), 'alembic.op.drop_column', 'op.drop_column', (['"""suspended"""', '"""comment"""'], {}), "('suspended', 'comment')\n", (1562, 1586), False, 'from alembic import op\n'), ((1591, 1634), 'alembic.op.drop_column', 'op.drop_column', (['"""suspended"""', '"""suspend_type"""'], {}), "('suspended', 'suspend_type... |
"""Test the viscous fluid helper functions."""
__copyright__ = """
Copyright (C) 2021 University of Illinois Board of Trustees
"""
__license__ = """
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 Softwar... | [
"logging.getLogger",
"mirgecom.transport.PowerLawTransport",
"mirgecom.viscous.conductive_heat_flux",
"grudge.op.nodal_min",
"pytools.convergence.EOCRecorder",
"numpy.array",
"grudge.op.local_grad",
"mirgecom.flux.gradient_flux_central",
"pytools.obj_array.make_obj_array",
"grudge.dt_utils.h_max_f... | [((1839, 1866), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1856, 1866), False, 'import logging\n'), ((1870, 1920), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""transport_model"""', '[0, 1]'], {}), "('transport_model', [0, 1])\n", (1893, 1920), False, 'import pytest\n')... |
# x_3_4
#
# mathモジュールからfloor関数だけインポートして切り捨て計算を行ってください
from statistics import mean
data = [7, 4, 3, 9]
print(mean(data))
| [
"statistics.mean"
] | [((111, 121), 'statistics.mean', 'mean', (['data'], {}), '(data)\n', (115, 121), False, 'from statistics import mean\n')] |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-06-30 23:29
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('widget_def', '0058_auto_20160617_1124'),
]
operations = [
migrations.AlterUn... | [
"django.db.migrations.DeleteModel",
"django.db.migrations.RemoveField",
"django.db.models.CharField"
] | [((432, 506), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""geodatasetdeclaration"""', 'name': '"""dataset"""'}), "(model_name='geodatasetdeclaration', name='dataset')\n", (454, 506), False, 'from django.db import migrations, models\n'), ((551, 627), 'django.db.migrations.RemoveF... |
# ******************************************************************************
# Copyright 2017-2021 Intel Corporation
#
# 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.apa... | [
"numpy.uint8",
"numpy.random.rand",
"numpy.int32",
"numpy.array",
"numpy.arange",
"numpy.int8",
"numpy.int64",
"numpy.reshape",
"ngraph.concat",
"pytest.mark.xfail",
"numpy.float64",
"numpy.uint64",
"numpy.uint32",
"numpy.empty",
"numpy.random.seed",
"numpy.concatenate",
"ngraph.para... | [((3265, 3515), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""val_type, range_start, range_end"""', '[(np.int8, -8, 8), (np.int16, -64, 64), (np.int32, -1024, 1024), (np.int64,\n -16383, 16383), (np.uint8, 0, 8), (np.uint16, 0, 64), (np.uint32, 0, \n 1024), (np.uint64, 0, 16383)]'], {}), "('val_type... |
# Copyright (c) 2013 Red Hat, Inc.
# Copyright 2014 Catalyst IT Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | [
"zaqar.storage.sqlalchemy.controllers.PoolsController",
"zaqar.common.decorators.lazy_property",
"zaqar.storage.sqlalchemy.controllers.CatalogueController",
"zaqar.storage.sqlalchemy.controllers.QueueController",
"oslo_db.sqlalchemy.engines.create_engine",
"zaqar.storage.sqlalchemy.controllers.FlavorsCont... | [((1585, 1622), 'zaqar.common.decorators.lazy_property', 'decorators.lazy_property', ([], {'write': '(False)'}), '(write=False)\n', (1609, 1622), False, 'from zaqar.common import decorators\n'), ((1701, 1743), 'oslo_db.sqlalchemy.engines.create_engine', 'engines.create_engine', (['uri'], {'sqlite_fk': '(True)'}), '(uri... |
### this works on linux only
try:
import fcntl
import subprocess
import signal
import os
except:
session.flash='sorry, only on Unix systems'
redirect(URL(request.application,'default','site'))
forever=10**8
def kill():
p = cache.ram('gae_upload',lambda:None,forever)
if not p or p.poll... | [
"os.path.exists",
"os.kill"
] | [((356, 386), 'os.kill', 'os.kill', (['p.pid', 'signal.SIGKILL'], {}), '(p.pid, signal.SIGKILL)\n', (363, 386), False, 'import os\n'), ((456, 482), 'os.path.exists', 'os.path.exists', (['GAE_APPCFG'], {}), '(GAE_APPCFG)\n', (470, 482), False, 'import os\n')] |
import torch
import torch.nn as nn
from basicts.archs.AGCRN_arch.AGCN import AVWGCN
class AGCRNCell(nn.Module):
def __init__(self, node_num, dim_in, dim_out, cheb_k, embed_dim):
super(AGCRNCell, self).__init__()
self.node_num = node_num
self.hidden_dim = dim_out
self.gate ... | [
"torch.split",
"basicts.archs.AGCRN_arch.AGCN.AVWGCN",
"torch.zeros",
"torch.cat"
] | [((322, 386), 'basicts.archs.AGCRN_arch.AGCN.AVWGCN', 'AVWGCN', (['(dim_in + self.hidden_dim)', '(2 * dim_out)', 'cheb_k', 'embed_dim'], {}), '(dim_in + self.hidden_dim, 2 * dim_out, cheb_k, embed_dim)\n', (328, 386), False, 'from basicts.archs.AGCRN_arch.AGCN import AVWGCN\n'), ((406, 466), 'basicts.archs.AGCRN_arch.A... |
from numpy import log10, isnan
def signOfFeasible(p):
r = '-'
if p.isFeas(p.xk): r = '+'
return r
textOutputDict = {\
'objFunVal': lambda p: p.iterObjFunTextFormat % (-p.Fk if p.invertObjFunc else p.Fk),
'log10(maxResidual)': lambda p: '%0.2f' % log10(p.rk+1e-100),
'log10(MaxResidual/ConTol)':lambda p: '... | [
"numpy.log10",
"numpy.isnan"
] | [((260, 280), 'numpy.log10', 'log10', (['(p.rk + 1e-100)'], {}), '(p.rk + 1e-100)\n', (265, 280), False, 'from numpy import log10, isnan\n'), ((759, 784), 'numpy.isnan', 'isnan', (['p.f_bound_distance'], {}), '(p.f_bound_distance)\n', (764, 784), False, 'from numpy import log10, isnan\n'), ((884, 911), 'numpy.isnan', '... |
import os
from main import main
from pprint import pprint
def parse(lines):
# world bounds
wx = int(lines[0].split()[0])
wy = int(lines[0].split()[0])
# initial position
x = int(lines[1].split()[0])
y = int(lines[1].split()[1])
cmds = []
# command / step pair
it = iter(lines[2].... | [
"main.main",
"os.path.splitext",
"pprint.pprint"
] | [((1713, 1723), 'main.main', 'main', (['data'], {}), '(data)\n', (1717, 1723), False, 'from main import main\n'), ((1736, 1750), 'pprint.pprint', 'pprint', (['result'], {}), '(result)\n', (1742, 1750), False, 'from pprint import pprint\n'), ((1449, 1477), 'os.path.splitext', 'os.path.splitext', (['input_file'], {}), '(... |
import numpy as np
import matplotlib.pyplot as plt
import os
path = "/Users/petermarinov/msci project/electrode data/test data/data/"
filenames = []
for f in os.listdir(path):
if not f.startswith('.'):
filenames.append(f)
i=-12
data = np.genfromtxt(path + filenames[i])
V = np.zeros((200,20... | [
"os.listdir",
"matplotlib.pyplot.grid",
"numpy.float",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"numpy.zeros",
"matplotlib.pyplot.title",
"numpy.genfromtxt",
"matplotlib.pyplot.show"
] | [((167, 183), 'os.listdir', 'os.listdir', (['path'], {}), '(path)\n', (177, 183), False, 'import os\n'), ((264, 298), 'numpy.genfromtxt', 'np.genfromtxt', (['(path + filenames[i])'], {}), '(path + filenames[i])\n', (277, 298), True, 'import numpy as np\n'), ((304, 324), 'numpy.zeros', 'np.zeros', (['(200, 200)'], {}), ... |
from data_reader.reader import CsvReader
from util import *
import numpy as np
import matplotlib.pyplot as plt
class LogisticRegression(object):
def __init__(self, learning_rate=0.01, epochs=50):
self.__epochs= epochs
self.__learning_rate = learning_rate
def fit(self, X, y):
self.w_ =... | [
"numpy.log10",
"matplotlib.pyplot.ylabel",
"data_reader.reader.CsvReader",
"matplotlib.pyplot.xlabel",
"numpy.log",
"numpy.asarray",
"numpy.exp",
"numpy.zeros",
"numpy.dot",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.title",
"matplotlib.pyplot.show"
] | [((1601, 1629), 'data_reader.reader.CsvReader', 'CsvReader', (['"""./data/Iris.csv"""'], {}), "('./data/Iris.csv')\n", (1610, 1629), False, 'from data_reader.reader import CsvReader\n'), ((2608, 2628), 'matplotlib.pyplot.xlabel', 'plt.xlabel', (['"""Epochs"""'], {}), "('Epochs')\n", (2618, 2628), True, 'import matplotl... |
from wavefront_reader.wavefront_classes.objfile import ObjFile
from .readface import read_face
def read_objfile(fname):
"""Takes .obj filename and return an ObjFile class."""
obj_file = ObjFile()
with open(fname) as f:
lines = f.read().splitlines()
if 'OBJ' not in lines[0]:
raise Valu... | [
"wavefront_reader.wavefront_classes.objfile.ObjFile"
] | [((195, 204), 'wavefront_reader.wavefront_classes.objfile.ObjFile', 'ObjFile', ([], {}), '()\n', (202, 204), False, 'from wavefront_reader.wavefront_classes.objfile import ObjFile\n')] |
#!/usr/bin/env python3
"""
Created on March 18 2020
@author: <NAME>
@description: Extract the taxonomy ID from an SBML file
"""
import argparse
import tempfile
import os
import logging
import shutil
import docker
def main(inputfile, output):
"""Call the extractTaxonomy docker to return the JSON file
:param... | [
"tempfile.TemporaryDirectory",
"os.path.exists",
"argparse.ArgumentParser",
"logging.warning",
"docker.from_env",
"shutil.copy"
] | [((519, 536), 'docker.from_env', 'docker.from_env', ([], {}), '()\n', (534, 536), False, 'import docker\n'), ((2485, 2525), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (['"""Extract the t"""'], {}), "('Extract the t')\n", (2508, 2525), False, 'import argparse\n'), ((1017, 1046), 'tempfile.TemporaryDirectory',... |
import os
import sys
import posthoganalytics
from django.apps import AppConfig
from django.conf import settings
from posthog.utils import get_git_branch, get_git_commit, get_machine_id
from posthog.version import VERSION
class PostHogConfig(AppConfig):
name = "posthog"
verbose_name = "PostHog"
def read... | [
"os.getenv",
"posthog.utils.get_git_branch",
"posthog.utils.get_git_commit",
"posthog.utils.get_machine_id",
"posthog.plugins.sync_plugin_config",
"os.environ.get"
] | [((416, 458), 'os.environ.get', 'os.environ.get', (['"""POSTHOG_PERSONAL_API_KEY"""'], {}), "('POSTHOG_PERSONAL_API_KEY')\n", (430, 458), False, 'import os\n'), ((971, 991), 'posthog.plugins.sync_plugin_config', 'sync_plugin_config', ([], {}), '()\n', (989, 991), False, 'from posthog.plugins import sync_plugin_config\n... |
import os
import json
import time
from datetime import timedelta
class TaskTimer:
def __init__(self):
self.time_performance = {}
self.start_times = {}
def start(self, task):
self.start_times[task] = time.time()
print('--- [{}] Start "{}"'.format(time.ctime(self.start_times[ta... | [
"time.ctime",
"os.path.join",
"datetime.timedelta",
"time.time",
"json.dump"
] | [((235, 246), 'time.time', 'time.time', ([], {}), '()\n', (244, 246), False, 'import time\n'), ((380, 391), 'time.time', 'time.time', ([], {}), '()\n', (389, 391), False, 'import time\n'), ((447, 501), 'datetime.timedelta', 'timedelta', ([], {'seconds': '(saving_end - self.start_times[task])'}), '(seconds=saving_end - ... |
import datetime
import os, sys
import pprint
import requests
from pandas.io.json import json_normalize
import pandas as pd
URL = 'https://wsn.latice.eu/api/query/v2/'
#URL = 'http://localhost:8000/wsn/api/query/v2/'
#TOKEN = os.getenv('WSN_TOKEN')
TOKEN = os.getenv('WSN_TOKEN')
path = os.getcwd()
def query(
limi... | [
"datetime.datetime",
"pandas.read_csv",
"os.getenv",
"pandas.to_datetime",
"requests.get",
"os.getcwd",
"sys.exit",
"pprint.pprint",
"pandas.io.json.json_normalize"
] | [((257, 279), 'os.getenv', 'os.getenv', (['"""WSN_TOKEN"""'], {}), "('WSN_TOKEN')\n", (266, 279), False, 'import os, sys\n'), ((288, 299), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (297, 299), False, 'import os, sys\n'), ((1447, 1496), 'requests.get', 'requests.get', (['URL'], {'headers': 'headers', 'params': 'params... |
from __future__ import annotations
import elasticache_auto_discovery
from pymemcache.client.hash import HashClient
# elasticache settings
elasticache_config_endpoint = "your-elasticache-cluster-endpoint:port"
nodes = elasticache_auto_discovery.discover(elasticache_config_endpoint)
nodes = map(lambda x: (x[1], int(x[2... | [
"elasticache_auto_discovery.discover",
"pymemcache.client.hash.HashClient"
] | [((219, 283), 'elasticache_auto_discovery.discover', 'elasticache_auto_discovery.discover', (['elasticache_config_endpoint'], {}), '(elasticache_config_endpoint)\n', (254, 283), False, 'import elasticache_auto_discovery\n'), ((350, 367), 'pymemcache.client.hash.HashClient', 'HashClient', (['nodes'], {}), '(nodes)\n', (... |
from django.contrib import admin
from proposals.models import Proposal, ProposalSessionType
admin.site.register(ProposalSessionType)
admin.site.register(Proposal,
list_display = ["title", "session_type", "audience_level", "cancelled", "extreme_pycon", "invited"]
) | [
"django.contrib.admin.site.register"
] | [((95, 135), 'django.contrib.admin.site.register', 'admin.site.register', (['ProposalSessionType'], {}), '(ProposalSessionType)\n', (114, 135), False, 'from django.contrib import admin\n'), ((136, 268), 'django.contrib.admin.site.register', 'admin.site.register', (['Proposal'], {'list_display': "['title', 'session_type... |
import random
# Ex. takes in 2d20 and outputs the string Rolling 2 d20
def roll_str(rolls):
numDice = rolls.split('d')[0]
diceVal = rolls.split('d')[1]
if numDice == '':
numDice = int(1)
return "Rolling %s d%s" % (numDice, diceVal)
# Ex. takes in 2d20 and outputs resultString = 11, 19 result... | [
"random.randint"
] | [((700, 724), 'random.randint', 'random.randint', (['(1)', 'limit'], {}), '(1, limit)\n', (714, 724), False, 'import random\n')] |
#
# Copyright (C) 2013 - 2017 <NAME> <<EMAIL>>
# License: MIT
#
# pylint: disable=missing-docstring,invalid-name,too-few-public-methods
# pylint: disable=ungrouped-imports
from __future__ import absolute_import
import anyconfig.backend.configobj as TT
import tests.backend.common as TBC
from anyconfig.compat import Or... | [
"anyconfig.compat.OrderedDict",
"anyconfig.backend.configobj.Parser"
] | [((1892, 1903), 'anyconfig.backend.configobj.Parser', 'TT.Parser', ([], {}), '()\n', (1901, 1903), True, 'import anyconfig.backend.configobj as TT\n'), ((1776, 1833), 'anyconfig.compat.OrderedDict', 'ODict', (["(('keyword8', 'value 9'), ('keyword9', 'value10'))"], {}), "((('keyword8', 'value 9'), ('keyword9', 'value10'... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
"""
===================
prospect.viewer.cds
===================
Class containing all bokeh's ColumnDataSource objects needed in viewer.py
"""
import numpy as np
from pkg_resources import resource_filename
import bokeh.plotting a... | [
"numpy.median",
"numpy.sqrt",
"numpy.log10",
"numpy.where",
"numpy.any",
"numpy.zeros",
"bokeh.models.ColumnDataSource",
"numpy.isnan",
"numpy.all"
] | [((3960, 3985), 'bokeh.models.ColumnDataSource', 'ColumnDataSource', (['cdsdata'], {}), '(cdsdata)\n', (3976, 3985), False, 'from bokeh.models import ColumnDataSource\n'), ((4801, 4836), 'bokeh.models.ColumnDataSource', 'ColumnDataSource', (['cds_coaddcam_data'], {}), '(cds_coaddcam_data)\n', (4817, 4836), False, 'from... |
# -*- coding: latin-1 -*-
import json
import pytest
from oidcendpoint.endpoint_context import EndpointContext
from oidcendpoint.oidc.authorization import Authorization
from oidcendpoint.oidc.read_registration import RegistrationRead
from oidcendpoint.oidc.registration import Registration
from oidcendpoint.oidc.token i... | [
"pytest.fixture",
"json.loads",
"oidcmsg.oidc.RegistrationRequest",
"oidcendpoint.endpoint_context.EndpointContext"
] | [((1798, 1824), 'oidcmsg.oidc.RegistrationRequest', 'RegistrationRequest', ([], {}), '(**msg)\n', (1817, 1824), False, 'from oidcmsg.oidc import RegistrationRequest\n'), ((1860, 1888), 'pytest.fixture', 'pytest.fixture', ([], {'autouse': '(True)'}), '(autouse=True)\n', (1874, 1888), False, 'import pytest\n'), ((3548, 3... |
from django.contrib import admin
from modelapp.models import Project
# Register your models here.
class Projectadmin(admin.ModelAdmin):
list_display = ['startdate','enddate','name','assignedto','priority']
admin.site.register(Project,Projectadmin) | [
"django.contrib.admin.site.register"
] | [((212, 254), 'django.contrib.admin.site.register', 'admin.site.register', (['Project', 'Projectadmin'], {}), '(Project, Projectadmin)\n', (231, 254), False, 'from django.contrib import admin\n')] |
import logging
import time
import numpy as np
from eda import ma_data, tx_data
from sir_fitting_us import seir_experiment, make_csv_from_tx_traj
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
logger.info("Fitting model.")
# initial values taken from previous fit, used to seed MH sampler efficie... | [
"logging.getLogger",
"numpy.mean",
"time.ctime",
"sir_fitting_us.make_csv_from_tx_traj",
"numpy.array",
"sir_fitting_us.seir_experiment"
] | [((157, 184), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (174, 184), False, 'import logging\n'), ((331, 381), 'numpy.array', 'np.array', (['[0.393, -2.586, -3.241, -5.874, -24.999]'], {}), '([0.393, -2.586, -3.241, -5.874, -24.999])\n', (339, 381), True, 'import numpy as np\n'), ((456... |
import csv
import re
import unicodedata
import bs4
import wikia
from modules import utils
from modules.config import Config
class WikiaHandler():
def __init__(self):
config = Config()
self.scraping_config = config.get_scraping_config()
self.parsing_config = config.get_parsing_config()
... | [
"csv.DictWriter",
"modules.config.Config",
"wikia.page",
"re.compile",
"modules.utils.get_selection_from_content",
"bs4.BeautifulSoup",
"unicodedata.normalize",
"re.sub",
"csv.reader",
"modules.utils.get_sections_for_tag"
] | [((191, 199), 'modules.config.Config', 'Config', ([], {}), '()\n', (197, 199), False, 'from modules.config import Config\n'), ((2687, 2713), 're.compile', 're.compile', (['"""\\\\d{4,}(?=-)"""'], {}), "('\\\\d{4,}(?=-)')\n", (2697, 2713), False, 'import re\n'), ((2834, 2890), 'wikia.page', 'wikia.page', (["self.scrapin... |
import mod
def foo():
return 1
try:
mod.foo = foo
except RuntimeError:
print("RuntimeError1")
print(mod.foo())
try:
mod.foo = 1
except RuntimeError:
print("RuntimeError2")
print(mod.foo)
try:
mod.foo = 2
except RuntimeError:
print("RuntimeError3")
print(mod.foo)
def __main__():
... | [
"mod.foo"
] | [((117, 126), 'mod.foo', 'mod.foo', ([], {}), '()\n', (124, 126), False, 'import mod\n')] |
import json
import os
from setuptools import find_packages, setup
PACKAGE_NAMESPACE_NAME = 'aistorms'
METADATA_FILE_NAME = 'metadata.json'
REQUIREMENTS_FILE_NAME = 'requirements.txt'
_metadata = \
json.load(
open(os.path.join(
os.path.dirname(__file__),
PACKAGE_NAMESPAC... | [
"os.path.dirname",
"setuptools.find_packages"
] | [((683, 698), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (696, 698), False, 'from setuptools import find_packages, setup\n'), ((261, 286), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (276, 286), False, 'import os\n')] |
import argparse
import logging
import os
import pathlib
import time
import log
import onenote_auth
import onenote
import pipeline
logger = logging.getLogger()
def main():
args = parse_args()
if args.verbose:
log.setup_logging(logging.DEBUG)
else:
log.setup_logging(logging.INFO)
# Al... | [
"logging.getLogger",
"argparse.ArgumentParser",
"pathlib.Path",
"onenote.get_notebook_pages",
"time.perf_counter",
"onenote_auth.get_session",
"pipeline.Pipeline",
"log.setup_logging"
] | [((141, 160), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (158, 160), False, 'import logging\n'), ((451, 493), 'onenote_auth.get_session', 'onenote_auth.get_session', (['args.new_session'], {}), '(args.new_session)\n', (475, 493), False, 'import onenote_auth\n'), ((512, 541), 'pathlib.Path', 'pathlib.Pa... |
# (c) 2017 Red Hat Inc.
#
# This file is part of Ansible
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import collections
import os
import json
import p... | [
"ansible_collections.community.aws.plugins.modules.data_pipeline.build_unique_id",
"ansible_collections.community.aws.plugins.modules.data_pipeline.check_dp_status",
"collections.namedtuple",
"ansible_collections.community.aws.plugins.modules.data_pipeline.delete_pipeline",
"os.getenv",
"ansible_collectio... | [((839, 867), 'pytest.importorskip', 'pytest.importorskip', (['"""boto3"""'], {}), "('boto3')\n", (858, 867), False, 'import pytest\n'), ((871, 901), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (885, 901), False, 'import pytest\n'), ((1136, 1221), 'collections.namedtuple',... |
import math
import requests
from pygitbucket.exceptions import (
UnknownError,
InvalidIDError,
NotFoundIDError,
NotAuthenticatedError,
PermissionError,
)
class Client:
BASE_URL = "https://api.bitbucket.org/"
def __init__(self, user: str, password: str, owner=None):
"""Initial ses... | [
"requests.post",
"math.ceil",
"pygitbucket.exceptions.PermissionError",
"requests.get",
"requests.delete",
"pygitbucket.exceptions.NotAuthenticatedError",
"pygitbucket.exceptions.NotFoundIDError",
"requests.put",
"pygitbucket.exceptions.InvalidIDError",
"pygitbucket.exceptions.UnknownError"
] | [((3363, 3392), 'math.ceil', 'math.ceil', (['(num_pipelines / 10)'], {}), '(num_pipelines / 10)\n', (3372, 3392), False, 'import math\n'), ((4033, 4062), 'math.ceil', 'math.ceil', (['(num_pipelines / 10)'], {}), '(num_pipelines / 10)\n', (4042, 4062), False, 'import math\n'), ((12627, 12718), 'requests.get', 'requests.... |
"""
@file
@brief Test for :epkg:`cartopy`.
"""
import numpy
import numba
@numba.jit(nopython=True, parallel=True)
def logistic_regression(Y, X, w, iterations):
"Fits a logistic regression."
for _ in range(iterations):
w -= numpy.dot(((1.0 / (1.0 + numpy.exp(-Y * numpy.dot(X, w))) - 1.0) * Y), X)
r... | [
"numpy.dot",
"numba.jit",
"numpy.random.rand"
] | [((76, 115), 'numba.jit', 'numba.jit', ([], {'nopython': '(True)', 'parallel': '(True)'}), '(nopython=True, parallel=True)\n', (85, 115), False, 'import numba\n'), ((411, 432), 'numpy.random.rand', 'numpy.random.rand', (['(10)'], {}), '(10)\n', (428, 432), False, 'import numpy\n'), ((462, 486), 'numpy.random.rand', 'nu... |
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 2.0.11
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info
if version_info >= (2,6,0):
def swig_import_helper():
from os.path impo... | [
"__block.gsl_vector_short_fscanf",
"__block.gsl_matrix_short_min_index",
"__block.gsl_vector_short_max_index",
"__block.gsl_matrix_int_diagonal",
"__block.gsl_matrix_fwrite",
"__block.gsl_vector_char_set_basis",
"__block.gsl_matrix_float_transpose",
"__block.gsl_vector_complex_fwrite",
"__block.gsl_... | [((2136, 2180), '__block.gsl_vector_set_zero', '__block.gsl_vector_set_zero', (['*args'], {}), '(*args, **kwargs)\n', (2163, 2180), False, 'import __block\n'), ((2282, 2325), '__block.gsl_vector_set_all', '__block.gsl_vector_set_all', (['*args'], {}), '(*args, **kwargs)\n', (2308, 2325), False, 'import __block\n'), ((2... |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
import pytest
import logging
import json
import threading
from utils import get_random_dict
logger = logging.getLogger(__name__)
logger.setLevel(level=logging.INF... | [
"logging.getLogger",
"pytest.mark.describe",
"utils.get_random_dict",
"threading.Event",
"pytest.mark.it"
] | [((259, 286), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (276, 286), False, 'import logging\n'), ((474, 508), 'pytest.mark.describe', 'pytest.mark.describe', (['"""Client C2d"""'], {}), "('Client C2d')\n", (494, 508), False, 'import pytest\n'), ((544, 577), 'pytest.mark.it', 'pytest.m... |
# GPLv3 License
#
# Copyright (C) 2020 Ubisoft
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# This program is dis... | [
"bpy.data.worlds.remove",
"mixer.blender_data.diff.BpyBlendDiff",
"bpy.data.worlds.new",
"mixer.blender_data.bpy_data_proxy.BpyDataProxy"
] | [((1115, 1129), 'mixer.blender_data.bpy_data_proxy.BpyDataProxy', 'BpyDataProxy', ([], {}), '()\n', (1127, 1129), False, 'from mixer.blender_data.bpy_data_proxy import BpyDataProxy\n'), ((1372, 1386), 'mixer.blender_data.diff.BpyBlendDiff', 'BpyBlendDiff', ([], {}), '()\n', (1384, 1386), False, 'from mixer.blender_data... |
import numpy as np
from plots import plots_for_predictions as pp
from utilss import distinct_colours as dc
import matplotlib.pyplot as plt
c = dc.get_distinct(4)
path = '/Users/luisals/Documents/deep_halos_files/mass_range_13.4/random_20sims_200k/lr5e-5/'
p1 = np.load(path + "seed_20/predicted_sim_6_epoch_09.npy")
t1... | [
"plots.plots_for_predictions.plot_histogram_predictions",
"numpy.load",
"matplotlib.pyplot.savefig",
"utilss.distinct_colours.get_distinct"
] | [((144, 162), 'utilss.distinct_colours.get_distinct', 'dc.get_distinct', (['(4)'], {}), '(4)\n', (159, 162), True, 'from utilss import distinct_colours as dc\n'), ((263, 317), 'numpy.load', 'np.load', (["(path + 'seed_20/predicted_sim_6_epoch_09.npy')"], {}), "(path + 'seed_20/predicted_sim_6_epoch_09.npy')\n", (270, 3... |
from copy import deepcopy
from inspect import getfullargspec
import importlib
import json
import os
import logging
logger = logging.getLogger(__name__)
from torch.optim.optimizer import Optimizer
from paragen.optim.optimizer import Optimizer
from paragen.utils.rate_schedulers import create_rate_scheduler
from paragen... | [
"logging.getLogger",
"paragen.utils.runtime.Environment",
"horovod.torch.broadcast_optimizer_state",
"os.listdir",
"paragen.utils.registry.setup_registry",
"importlib.import_module",
"json.dumps",
"os.path.join",
"inspect.getfullargspec",
"os.path.dirname",
"apex.amp.initialize",
"os.path.isdi... | [((124, 151), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (141, 151), False, 'import logging\n'), ((446, 500), 'paragen.utils.registry.setup_registry', 'setup_registry', (['"""optim"""', 'Optimizer'], {'force_extend': '(False)'}), "('optim', Optimizer, force_extend=False)\n", (460, 500... |
# State tracking for WireGuard protocol operations.
# Author: <NAME> <<EMAIL>>
# Licensed under the MIT license <http://opensource.org/licenses/MIT>.
import base64
import hashlib
import inspect
import socket
import traceback
from noise_wg import NoiseWG, crypto_scalarmult_base, aead_encrypt, aead_decrypt
def calc_m... | [
"noise_wg.NoiseWG",
"hashlib.blake2s",
"socket.socket",
"traceback.print_stack",
"base64.b64encode",
"inspect.signature",
"base64.b64decode",
"noise_wg.aead_encrypt",
"noise_wg.crypto_scalarmult_base",
"noise_wg.aead_decrypt"
] | [((935, 957), 'base64.b64decode', 'base64.b64decode', (['data'], {}), '(data)\n', (951, 957), False, 'import base64\n'), ((1207, 1230), 'traceback.print_stack', 'traceback.print_stack', ([], {}), '()\n', (1228, 1230), False, 'import traceback\n'), ((5328, 5337), 'noise_wg.NoiseWG', 'NoiseWG', ([], {}), '()\n', (5335, 5... |
from common import Modules, data_strings, load_yara_rules, AndroidParseModule, ModuleMetadata
from base64 import b64decode
from string import printable
class dendroid(AndroidParseModule):
def __init__(self):
md = ModuleMetadata(
module_name="dendroid",
bot_name="Dendroid",
... | [
"common.load_yara_rules",
"common.data_strings",
"common.AndroidParseModule.__init__",
"common.ModuleMetadata",
"base64.b64decode"
] | [((227, 415), 'common.ModuleMetadata', 'ModuleMetadata', ([], {'module_name': '"""dendroid"""', 'bot_name': '"""Dendroid"""', 'description': '"""Android RAT"""', 'authors': "['<NAME> (@botnet_hunter)']", 'version': '"""1.0.0"""', 'date': '"""August 18, 2014"""', 'references': '[]'}), "(module_name='dendroid', bot_name=... |
all
import tweepy, config, users, re, groupy
from tweepy import OAuthHandler
from tweepy import API
print(tweepy.__version__)
auth = OAuthHandler(config.consumer_key, config.consumer_secret)
auth.set_access_token(config.access_token,config.access_token_secret)
api = tweepy.API(auth)
from groupy.client import Client
cli... | [
"re.findall",
"tweepy.API",
"groupy.client.Client.from_token",
"tweepy.OAuthHandler"
] | [((133, 190), 'tweepy.OAuthHandler', 'OAuthHandler', (['config.consumer_key', 'config.consumer_secret'], {}), '(config.consumer_key, config.consumer_secret)\n', (145, 190), False, 'from tweepy import OAuthHandler\n'), ((267, 283), 'tweepy.API', 'tweepy.API', (['auth'], {}), '(auth)\n', (277, 283), False, 'import tweepy... |
"""
---OK---
"""
from collections import OrderedDict
import copy
import numpy as np
from crystalpy.examples.Values import Interval
class PlotData1D(object):
"""
Represents a 1D plot. The graph data together with related information.
"""
def __init__(self, title, title_x_axis, title_y_axis):
... | [
"collections.OrderedDict",
"numpy.unwrap",
"numpy.asarray",
"numpy.deg2rad",
"copy.deepcopy",
"crystalpy.examples.Values.Interval",
"numpy.rad2deg"
] | [((926, 939), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (937, 939), False, 'from collections import OrderedDict\n'), ((3999, 4014), 'numpy.unwrap', 'np.unwrap', (['temp'], {}), '(temp)\n', (4008, 4014), True, 'import numpy as np\n'), ((5549, 5575), 'crystalpy.examples.Values.Interval', 'Interval', (['... |
import unittest
from iptree import IPNode
class TestIPNode(unittest.TestCase):
def test_node_ipv4(self):
node = IPNode('0.0.0.0/0')
node.add(IPNode('127.0.0.1/32'))
assert '127.0.0.1/32' in node
assert '192.0.2.1/32' not in node
def test_node_ipv6(self):
node = IPNode... | [
"iptree.IPNode"
] | [((127, 146), 'iptree.IPNode', 'IPNode', (['"""0.0.0.0/0"""'], {}), "('0.0.0.0/0')\n", (133, 146), False, 'from iptree import IPNode\n'), ((314, 328), 'iptree.IPNode', 'IPNode', (['"""::/0"""'], {}), "('::/0')\n", (320, 328), False, 'from iptree import IPNode\n'), ((494, 508), 'iptree.IPNode', 'IPNode', (['"""::/0"""']... |
# Copyright 2021 The ParallelAccel Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | [
"json.loads",
"marshmallow.ValidationError",
"marshmallow_enum.EnumField",
"marshmallow_dataclass.class_schema",
"linear_algebra.to_json",
"marshmallow.validate.Range",
"json.dumps",
"marshmallow_dataclass.NewType",
"time.time",
"dataclasses.field"
] | [((5580, 5672), 'marshmallow_dataclass.NewType', 'marshmallow_dataclass.NewType', (['"""Graph"""', 'linear_algebra.Graph'], {'field': '_LinearAlgebraField'}), "('Graph', linear_algebra.Graph, field=\n _LinearAlgebraField)\n", (5609, 5672), False, 'import marshmallow_dataclass\n'), ((5686, 5771), 'marshmallow_datacla... |
import collections
def cal(num):
i=1
f=factor[num]
while i*i<=num:
if num%i==0 and i<=max(n,m) and num//i<=max(n,m):
f.append(i)
i+=1
return num
def dfs(i,j):
if i==m-1 and j==n-1:
return True
if i>=m and j>=n or grid[i][j] in factor:
... | [
"collections.defaultdict"
] | [((615, 644), 'collections.defaultdict', 'collections.defaultdict', (['list'], {}), '(list)\n', (638, 644), False, 'import collections\n')] |
# uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Server\tunable_utils\create_object.py
# Compiled at: 2020-05-07 00:26:47
# Size of source mod 2**32: 4106 b... | [
"services.get_instance_manager",
"sims4.log.Logger",
"services.definition_manager",
"objects.system.create_object",
"sims4.tuning.tunable.TunableRange",
"objects.components.state.TunableStateValueReference",
"sims4.random.weighted_random_item",
"crafting.crafting_interactions.create_craftable"
] | [((755, 787), 'sims4.log.Logger', 'sims4.log.Logger', (['"""CreateObject"""'], {}), "('CreateObject')\n", (771, 787), False, 'import crafting, services, sims4\n'), ((1437, 1477), 'objects.system.create_object', 'create_object', (['self.definition'], {}), '(self.definition, **kwargs)\n', (1450, 1477), False, 'from objec... |
import Sofa
import random
from cmath import *
############################################################################################
# this is a PythonScriptController example script
############################################################################################
###################################... | [
"random.uniform",
"random.randint"
] | [((1025, 1050), 'random.uniform', 'random.uniform', (['(-0.5)', '(0.5)'], {}), '(-0.5, 0.5)\n', (1039, 1050), False, 'import random\n'), ((1058, 1083), 'random.uniform', 'random.uniform', (['(-0.5)', '(0.5)'], {}), '(-0.5, 0.5)\n', (1072, 1083), False, 'import random\n'), ((1091, 1116), 'random.uniform', 'random.unifor... |
import pytest
import rasterio as rio
from rasterio.io import DatasetWriter
from cog_worker import Manager
from rasterio import MemoryFile, crs
TEST_COG = "tests/roads_cog.tif"
@pytest.fixture
def molleweide_manager():
return Manager(
proj="+proj=moll",
scale=50000,
)
@pytest.fixture
def sam... | [
"cog_worker.Manager",
"rasterio.open",
"rasterio.MemoryFile",
"rasterio.crs.CRS.from_string"
] | [((232, 271), 'cog_worker.Manager', 'Manager', ([], {'proj': '"""+proj=moll"""', 'scale': '(50000)'}), "(proj='+proj=moll', scale=50000)\n", (239, 271), False, 'from cog_worker import Manager\n'), ((1311, 1323), 'rasterio.MemoryFile', 'MemoryFile', ([], {}), '()\n', (1321, 1323), False, 'from rasterio import MemoryFile... |
from train import train_model
from utils import *
import os
import sys
pwd = os.environ.get('CLIP_DIR')
DATA_DIR = "%s/data/processed/" % pwd
exp_name = "non_multilabel"
run_name = "sentence_structurel_with_crf"
train_file_name = "MIMIC_train_binary.csv"
dev_file_name = "MIMIC_val_binary.csv"
test_file_name = "test_b... | [
"os.path.join",
"os.environ.get"
] | [((78, 104), 'os.environ.get', 'os.environ.get', (['"""CLIP_DIR"""'], {}), "('CLIP_DIR')\n", (92, 104), False, 'import os\n'), ((391, 430), 'os.path.join', 'os.path.join', (['DATA_DIR', 'train_file_name'], {}), '(DATA_DIR, train_file_name)\n', (403, 430), False, 'import os\n'), ((462, 499), 'os.path.join', 'os.path.joi... |
from django.urls import path
from . import views
app_name = 'persons'
urlpatterns = [
path('', views.PersonsTableView.as_view(),name='persons_list'),
path('persons_details/<int:pk>',views.PersonsUpdateView.as_view(),name='persons_details_edit'),
path('persons_details/create',views.PersonsCreateView.as_vie... | [
"django.urls.path"
] | [((466, 525), 'django.urls.path', 'path', (['"""persons_details/sort"""', 'views.event_gate'], {'name': '"""sort"""'}), "('persons_details/sort', views.event_gate, name='sort')\n", (470, 525), False, 'from django.urls import path\n')] |
from hytra.pluginsystem import transition_feature_vector_construction_plugin
import numpy as np
from compiler.ast import flatten
class TransitionFeaturesSubtraction(
transition_feature_vector_construction_plugin.TransitionFeatureVectorConstructionPlugin
):
"""
Computes the subtraction of features in the f... | [
"numpy.array"
] | [((1564, 1582), 'numpy.array', 'np.array', (['features'], {}), '(features)\n', (1572, 1582), True, 'import numpy as np\n')] |
# -*- coding: utf-8 -*-
from django.db import models
from datetime import datetime
# Create your models here.
class IP_Address(models.Model):
ip = models.GenericIPAddressField(verbose_name=u"IP地址")
gateway = models.GenericIPAddressField(verbose_name=u"网关")
network = models.GenericIPAddressField(verbose_name... | [
"django.db.models.GenericIPAddressField",
"datetime.datetime.now",
"django.db.models.CharField"
] | [((151, 201), 'django.db.models.GenericIPAddressField', 'models.GenericIPAddressField', ([], {'verbose_name': 'u"""IP地址"""'}), "(verbose_name=u'IP地址')\n", (179, 201), False, 'from django.db import models\n'), ((216, 264), 'django.db.models.GenericIPAddressField', 'models.GenericIPAddressField', ([], {'verbose_name': 'u... |
import time
import logging
try:
from pypylon import pylon
except:
pylon = None
from . input import Input
log = logging.getLogger(__name__)
# writes the framenumber to the 8-11 bytes of the image as a big-endian set of octets
def encode_framenumber(np_image, n):
for i in range(4):
np_image[0][i+7]... | [
"logging.getLogger",
"pypylon.pylon.TlFactory.GetInstance",
"time.time"
] | [((121, 148), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (138, 148), False, 'import logging\n'), ((2296, 2325), 'pypylon.pylon.TlFactory.GetInstance', 'pylon.TlFactory.GetInstance', ([], {}), '()\n', (2323, 2325), False, 'from pypylon import pylon\n'), ((2894, 2905), 'time.time', 'tim... |
# -*- coding: utf-8 -*-
# Copyright (c) 2021. Distributed under the terms of the MIT License.
from phonopy.interface.calculator import read_crystal_structure
from phonopy.structure.atoms import PhonopyAtoms
from vise.util.phonopy.phonopy_input import structure_to_phonopy_atoms
import numpy as np
def assert_same_phon... | [
"numpy.array",
"phonopy.interface.calculator.read_crystal_structure",
"phonopy.structure.atoms.PhonopyAtoms",
"vise.util.phonopy.phonopy_input.structure_to_phonopy_atoms"
] | [((822, 854), 'phonopy.interface.calculator.read_crystal_structure', 'read_crystal_structure', (['"""POSCAR"""'], {}), "('POSCAR')\n", (844, 854), False, 'from phonopy.interface.calculator import read_crystal_structure\n'), ((863, 884), 'phonopy.structure.atoms.PhonopyAtoms', 'PhonopyAtoms', ([], {'atoms': 'a'}), '(ato... |
"""
2020 Day 15
https://adventofcode.com/2020/day/15
"""
from collections import deque
from typing import Dict, Iterable, Optional
import aocd # type: ignore
class ElfMemoryGame:
def __init__(self, starting_numbers: Iterable[int]):
self.appearances: Dict[int, deque[int]] = {}
self.length = 0
... | [
"collections.deque",
"aocd.get_data"
] | [((1175, 1207), 'aocd.get_data', 'aocd.get_data', ([], {'year': '(2020)', 'day': '(15)'}), '(year=2020, day=15)\n', (1188, 1207), False, 'import aocd\n'), ((957, 1000), 'collections.deque', 'deque', (['[self.length, self.length]'], {'maxlen': '(2)'}), '([self.length, self.length], maxlen=2)\n', (962, 1000), False, 'fro... |
# -*- coding: utf-8 -*-
# Copyright (C) 2019, QuantStack
# SPDX-License-Identifier: BSD-3-Clause
from conda.base.constants import DepsModifier, UpdateModifier
from conda._vendor.boltons.setutils import IndexedSet
from conda.core.prefix_data import PrefixData
from conda.models.prefix_graph import PrefixGraph
from conda... | [
"conda._vendor.boltons.setutils.IndexedSet",
"conda.models.match_spec.MatchSpec",
"conda.models.prefix_graph.PrefixGraph"
] | [((1540, 1636), 'conda._vendor.boltons.setutils.IndexedSet', 'IndexedSet', (['(prec for prec in _no_deps_solution if prec.name not in\n remove_before_adding_back)'], {}), '(prec for prec in _no_deps_solution if prec.name not in\n remove_before_adding_back)\n', (1550, 1636), False, 'from conda._vendor.boltons.setu... |
#!/usr/bin/env python
import unittest
import logging
import importlib
import copy
import os
from mock import patch
from nose.tools import raises
logging.disable(logging.CRITICAL)
ciftify_recon_all = importlib.import_module('ciftify.bin.ciftify_recon_all')
class ConvertFreesurferSurface(unittest.TestCase):
meshe... | [
"mock.patch",
"importlib.import_module",
"os.path.dirname",
"nose.tools.raises",
"copy.deepcopy",
"logging.disable"
] | [((147, 180), 'logging.disable', 'logging.disable', (['logging.CRITICAL'], {}), '(logging.CRITICAL)\n', (162, 180), False, 'import logging\n'), ((202, 258), 'importlib.import_module', 'importlib.import_module', (['"""ciftify.bin.ciftify_recon_all"""'], {}), "('ciftify.bin.ciftify_recon_all')\n", (225, 258), False, 'imp... |
from django.db import models
"""
ShipmentModels have a one to many relationship with boxes and aliquot
Aliquot and Box foreign keys to a ShipmentModel determine manifest contents
for shipping purposes (resolved in schema return for manifest view)
"""
class ShipmentModel(models.Model):
carrier = model... | [
"django.db.models.DateTimeField",
"django.db.models.CharField",
"django.db.models.ForeignKey"
] | [((315, 402), 'django.db.models.ForeignKey', 'models.ForeignKey', (['"""CarrierModel"""'], {'on_delete': 'models.SET_NULL', 'blank': '(True)', 'null': '(True)'}), "('CarrierModel', on_delete=models.SET_NULL, blank=True,\n null=True)\n", (332, 402), False, 'from django.db import models\n'), ((517, 572), 'django.db.mo... |
"""
Consuming Iterator manually
"""
from collections import namedtuple
def cast(data_type, value):
"""Cast the value into a correct data type"""
if data_type == 'DOUBLE':
return float(value)
elif data_type == 'STRING':
return str(value)
elif data_type == 'INT':
return int(value... | [
"collections.namedtuple"
] | [((1608, 1634), 'collections.namedtuple', 'namedtuple', (['"""Car"""', 'headers'], {}), "('Car', headers)\n", (1618, 1634), False, 'from collections import namedtuple\n')] |
import numpy as np
import math
import logging
from termcolor import colored
# Check a matrix for: negative eigenvalues, asymmetry and negative diagonal values
def positive_definite(M,epsilon = 0.000001,verbose=False):
# Symmetrization
Mt = np.transpose(M)
M = (M + Mt)/2
eigenvalues = np.linalg.eigvals(... | [
"numpy.linalg.eigvals",
"numpy.transpose",
"logging.error"
] | [((249, 264), 'numpy.transpose', 'np.transpose', (['M'], {}), '(M)\n', (261, 264), True, 'import numpy as np\n'), ((302, 322), 'numpy.linalg.eigvals', 'np.linalg.eigvals', (['M'], {}), '(M)\n', (319, 322), True, 'import numpy as np\n'), ((439, 476), 'logging.error', 'logging.error', (['"""Negative eigenvalues"""'], {})... |
"""This module contains a function for validating a scratch config entry."""
import re
from idact.detail.config.validation.validation_error_message import \
validation_error_message
VALID_SCRATCH_DESCRIPTION = 'Non-empty absolute path, or environment' \
' variable name.'
VALID_SCRATC... | [
"idact.detail.config.validation.validation_error_message.validation_error_message",
"re.compile"
] | [((419, 458), 're.compile', 're.compile', ([], {'pattern': 'VALID_SCRATCH_REGEX'}), '(pattern=VALID_SCRATCH_REGEX)\n', (429, 458), False, 'import re\n'), ((860, 984), 'idact.detail.config.validation.validation_error_message.validation_error_message', 'validation_error_message', ([], {'label': '"""scratch"""', 'value': ... |
import warnings
from typing import Callable, List, Optional, Union
import mpmath
import numpy as np
import paramak
import sympy as sp
from paramak import RotateMixedShape, diff_between_angles
from paramak.parametric_components.tokamak_plasma_plasmaboundaries import \
PlasmaBoundaries
from scipy.interpolate import... | [
"numpy.radians",
"numpy.flip",
"sympy.Symbol",
"scipy.interpolate.interp1d",
"numpy.array",
"numpy.linspace",
"mpmath.radians",
"sympy.diff",
"warnings.warn"
] | [((8042, 8060), 'sympy.Symbol', 'sp.Symbol', (['"""theta"""'], {}), "('theta')\n", (8051, 8060), True, 'import sympy as sp\n'), ((8142, 8165), 'sympy.diff', 'sp.diff', (['R_sp', 'theta_sp'], {}), '(R_sp, theta_sp)\n', (8149, 8165), True, 'import sympy as sp\n'), ((8189, 8212), 'sympy.diff', 'sp.diff', (['Z_sp', 'theta_... |
#
# Copyright (c) 2021 Airbyte, Inc., all rights reserved.
#
import datetime
import json
from typing import Any, Iterable, List, Mapping, MutableMapping, Optional, Tuple, Union
import plaid
from airbyte_cdk.logger import AirbyteLogger
from airbyte_cdk.models import SyncMode
from airbyte_cdk.sources import AbstractSou... | [
"plaid.model.accounts_balance_get_request.AccountsBalanceGetRequest",
"plaid.api.plaid_api.PlaidApi",
"json.loads",
"datetime.datetime.utcnow",
"datetime.date.fromtimestamp",
"plaid.Configuration",
"datetime.date.fromisoformat",
"plaid.ApiClient"
] | [((826, 970), 'plaid.Configuration', 'plaid.Configuration', ([], {'host': "SPEC_ENV_TO_PLAID_ENV[config['plaid_env']]", 'api_key': "{'clientId': config['client_id'], 'secret': config['api_key']}"}), "(host=SPEC_ENV_TO_PLAID_ENV[config['plaid_env']],\n api_key={'clientId': config['client_id'], 'secret': config['api_k... |
import torch
import torch.nn.functional as F
from torch.autograd import Variable
import numpy as np
import os
import math
from utils import logger
use_cuda = torch.cuda.is_available()
# utility
def to_var(x, dtype=None):
if type(x) is np.ndarray:
x = torch.from_numpy(x)
elif type(x) is list:
... | [
"torch.log",
"torch.mean",
"math.pow",
"torch.nn.functional.binary_cross_entropy",
"os.path.join",
"torch.from_numpy",
"numpy.array",
"torch.cuda.is_available",
"utils.logger.info",
"torch.sum",
"torch.autograd.Variable",
"torch.clamp"
] | [((160, 185), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (183, 185), False, 'import torch\n'), ((419, 430), 'torch.autograd.Variable', 'Variable', (['x'], {}), '(x)\n', (427, 430), False, 'from torch.autograd import Variable\n'), ((4962, 5004), 'torch.nn.functional.binary_cross_entropy', 'F... |
from dataclasses import field
from marshmallow import Schema, ValidationError, post_load, schema
from marshmallow.validate import OneOf, Length
from marshmallow.fields import Bool, Str, List, Nested, Email
from flask_rebar import ResponseSchema, RequestSchema, errors
from ecosante.inscription.models import Inscription
... | [
"flask_rebar.errors.NotFound",
"marshmallow.ValidationError",
"flask.request.view_args.get",
"marshmallow.fields.Nested",
"marshmallow.fields.Str",
"ecosante.inscription.models.Inscription",
"flask_rebar.errors.Conflict",
"marshmallow.validate.OneOf",
"marshmallow.fields.Bool",
"ecosante.inscripti... | [((896, 950), 'marshmallow.fields.Nested', 'Nested', (['CommuneSchema'], {'required': '(False)', 'allow_none': '(True)'}), '(CommuneSchema, required=False, allow_none=True)\n', (902, 950), False, 'from marshmallow.fields import Bool, Str, List, Nested, Email\n'), ((961, 980), 'marshmallow.fields.Str', 'Str', ([], {'dum... |
import logging
from thespian.actors import *
from eventsourcing.application.process import ProcessApplication, Prompt
from eventsourcing.application.system import System, SystemRunner
from eventsourcing.domain.model.events import subscribe, unsubscribe
from eventsourcing.interface.notificationlog import RecordManager... | [
"logging.getLogger",
"eventsourcing.domain.model.events.unsubscribe",
"eventsourcing.domain.model.events.subscribe"
] | [((346, 365), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (363, 365), False, 'import logging\n'), ((2431, 2495), 'eventsourcing.domain.model.events.subscribe', 'subscribe', ([], {'handler': 'self.forward_prompt', 'predicate': 'self.is_prompt'}), '(handler=self.forward_prompt, predicate=self.is_prompt)\n... |
from rest_framework import mixins, viewsets, status
from rest_framework.permissions import (
AllowAny,
IsAuthenticated
)
from apps.transmissions.models import Transmission
from apps.transmissions.serializers import TransmissionModelSerializer, CommentModelserializer
from django_filters import rest_framework a... | [
"apps.transmissions.models.Transmission.objects.all"
] | [((540, 566), 'apps.transmissions.models.Transmission.objects.all', 'Transmission.objects.all', ([], {}), '()\n', (564, 566), False, 'from apps.transmissions.models import Transmission\n')] |
import h5py
from ont_fast5_api.conversion_tools import multi_to_single_fast5
from ont_fast5_api import fast5_interface
import SequenceGenerator.align as align
import SignalExtractor.Nanopolish as events
from testFiles.test_commands import *
import os, sys
import subprocess
#todo get basecall data
def bas... | [
"os.listdir",
"subprocess.run",
"os.path.join",
"os.getcwd",
"SignalExtractor.Nanopolish.nanopolish_events",
"SequenceGenerator.align.minimapAligner",
"ont_fast5_api.fast5_interface.check_file_type",
"sys.exit",
"os.stat",
"os.system",
"os.walk"
] | [((355, 382), 'os.listdir', 'os.listdir', (['"""Data/basecall"""'], {}), "('Data/basecall')\n", (365, 382), False, 'import os, sys\n'), ((6056, 6077), 'os.listdir', 'os.listdir', (['"""./Data/"""'], {}), "('./Data/')\n", (6066, 6077), False, 'import os, sys\n'), ((8588, 8606), 'os.listdir', 'os.listdir', (['"""Data"""'... |
from setuptools import setup
setup(
name='potnanny-api',
version='0.2.6',
packages=['potnanny_api'],
include_package_data=True,
description='Part of the Potnanny greenhouse controller application. Contains Flask REST API and basic web interface.',
author='<NAME>',
author_email='<EMAIL>',
... | [
"setuptools.setup"
] | [((30, 528), 'setuptools.setup', 'setup', ([], {'name': '"""potnanny-api"""', 'version': '"""0.2.6"""', 'packages': "['potnanny_api']", 'include_package_data': '(True)', 'description': '"""Part of the Potnanny greenhouse controller application. Contains Flask REST API and basic web interface."""', 'author': '"""<NAME>"... |
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 4.0.0
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info as _swig_python_version_info
if _swig_python_version_info < (2, 7, 0):
raise Runtime... | [
"_envcpp.vectord_begin",
"_envcpp.vectori_end",
"_envcpp.vectors_capacity",
"_envcpp.SwigPyIterator_swigregister",
"_envcpp.SwigPyIterator_incr",
"_envcpp.vectori___getitem__",
"_envcpp.vectors_empty",
"_envcpp.vectors_back",
"_envcpp.vectors_size",
"_envcpp.vectord_resize",
"_envcpp.SwigPyItera... | [((4694, 4745), '_envcpp.SwigPyIterator_swigregister', '_envcpp.SwigPyIterator_swigregister', (['SwigPyIterator'], {}), '(SwigPyIterator)\n', (4729, 4745), False, 'import _envcpp\n'), ((7443, 7480), '_envcpp.vectori_swigregister', '_envcpp.vectori_swigregister', (['vectori'], {}), '(vectori)\n', (7471, 7480), False, 'i... |
import click
import aiohttp
import asyncio
import re
import json
from typing import Optional, Tuple, Iterable, Union, List
from blspy import G2Element, AugSchemeMPL
from chia.cmds.wallet_funcs import get_wallet
from chia.rpc.wallet_rpc_client import WalletRpcClient
from chia.util.default_root import DEFAULT_ROOT_PATH... | [
"chia.wallet.cc_wallet.cc_utils.unsigned_spend_bundle_for_spendable_ccs",
"chia.util.bech32m.decode_puzzle_hash",
"re.compile",
"click.option",
"asyncio.get_event_loop",
"chia.util.config.load_config",
"clvm_tools.binutils.assemble",
"chia.cmds.wallet_funcs.get_wallet",
"chia.util.byte_types.hexstr_... | [((3581, 3596), 'click.command', 'click.command', ([], {}), '()\n', (3594, 3596), False, 'import click\n'), ((3618, 3715), 'click.option', 'click.option', (['"""-l"""', '"""--tail"""'], {'required': '(True)', 'help': '"""The TAIL program to launch this CAT with"""'}), "('-l', '--tail', required=True, help=\n 'The TA... |
# -*- coding: utf-8 -*-
# Author: <NAME>
# Date: 2019-4-28
import tensorflow as tf
from tensorflow import placeholder, glorot_normal_initializer, zeros_initializer
from tensorflow.nn import dropout
import numpy as np
n_z = 3584
n_y = 300
MSVD_PATH = None
MSRVTT_PATH = None
MSVD_GT_PATH = None
MSRVTT_GT_PATH = None
ma... | [
"tensorflow.Graph",
"tensorflow.equal",
"tensorflow.reduce_sum",
"tensorflow.placeholder",
"tensorflow.nn.dropout",
"tensorflow.matmul",
"tensorflow.zeros_initializer",
"tensorflow.reduce_mean",
"tensorflow.cast",
"tensorflow.log",
"tensorflow.glorot_normal_initializer"
] | [((461, 471), 'tensorflow.Graph', 'tf.Graph', ([], {}), '()\n', (469, 471), True, 'import tensorflow as tf\n'), ((531, 567), 'tensorflow.placeholder', 'placeholder', (['tf.float32', '[None, n_y]'], {}), '(tf.float32, [None, n_y])\n', (542, 567), False, 'from tensorflow import placeholder, glorot_normal_initializer, zer... |
"""
Explore raw composites based on indices from predicted testing data and
showing all the difference OHC levels for OBSERVATIONS
Author : <NAME>
Date : 21 September 2021
Version : 2 (mostly for testing)
"""
### Import packages
import sys
import matplotlib.pyplot as plt
import numpy as np
import calc_Ut... | [
"calc_dataFunctions.getRegion",
"numpy.nanmean",
"sys.exit",
"numpy.genfromtxt",
"numpy.arange",
"numpy.where",
"numpy.asarray",
"numpy.meshgrid",
"calc_Utilities.regions",
"numpy.nanstd",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.title",
"calc_Stats.remove_trend_obs",
"matplotlib.py... | [((566, 593), 'matplotlib.pyplot.rc', 'plt.rc', (['"""text"""'], {'usetex': '(True)'}), "('text', usetex=True)\n", (572, 593), True, 'import matplotlib.pyplot as plt\n'), ((593, 666), 'matplotlib.pyplot.rc', 'plt.rc', (['"""font"""'], {}), "('font', **{'family': 'sans-serif', 'sans-serif': ['Avant Garde']})\n", (599, 6... |
from setuptools import setup, find_packages
from os import path
from time import time
here = path.abspath(path.dirname(__file__))
if path.exists("VERSION.txt"):
# this file can be written by CI tools (e.g. Travis)
with open("VERSION.txt") as version_file:
version = version_file.read().strip().strip("v... | [
"os.path.dirname",
"os.path.exists",
"setuptools.find_packages",
"time.time"
] | [((135, 161), 'os.path.exists', 'path.exists', (['"""VERSION.txt"""'], {}), "('VERSION.txt')\n", (146, 161), False, 'from os import path\n'), ((107, 129), 'os.path.dirname', 'path.dirname', (['__file__'], {}), '(__file__)\n', (119, 129), False, 'from os import path\n'), ((347, 353), 'time.time', 'time', ([], {}), '()\n... |
import os
import os.path
def activate(ipython, venv):
"""
Shortcut to run execfile() on `venv`/bin/activate_this.py
"""
venv = os.path.abspath(venv)
venv_activate = os.path.join(venv, 'bin', 'activate_this.py')
if not os.path.exists(venv_activate):
print('Not a virtualenv: {}'.format(... | [
"os.path.abspath",
"os.path.exists",
"os.putenv",
"os.path.join"
] | [((145, 166), 'os.path.abspath', 'os.path.abspath', (['venv'], {}), '(venv)\n', (160, 166), False, 'import os\n'), ((187, 232), 'os.path.join', 'os.path.join', (['venv', '"""bin"""', '"""activate_this.py"""'], {}), "(venv, 'bin', 'activate_this.py')\n", (199, 232), False, 'import os\n'), ((455, 485), 'os.putenv', 'os.p... |
from django.test import TestCase
from django_hosts import reverse
from util.test_utils import Get, assert_requesting_paths_succeeds
class UrlTests(TestCase):
def test_all_get_request_paths_succeed(self):
path_predicates = [
Get(reverse('skills_present_list'), public=True),
Get(re... | [
"django_hosts.reverse",
"util.test_utils.assert_requesting_paths_succeeds"
] | [((422, 477), 'util.test_utils.assert_requesting_paths_succeeds', 'assert_requesting_paths_succeeds', (['self', 'path_predicates'], {}), '(self, path_predicates)\n', (454, 477), False, 'from util.test_utils import Get, assert_requesting_paths_succeeds\n'), ((256, 286), 'django_hosts.reverse', 'reverse', (['"""skills_pr... |
from django.contrib import admin
# Register your models here.
from .models import WorkOrder
admin.site.register(WorkOrder)
| [
"django.contrib.admin.site.register"
] | [((94, 124), 'django.contrib.admin.site.register', 'admin.site.register', (['WorkOrder'], {}), '(WorkOrder)\n', (113, 124), False, 'from django.contrib import admin\n')] |
import torch
import numpy as np
import torch.nn.functional as F
from torch.nn.utils.clip_grad import clip_grad_norm_
from mpi_utils.mpi_utils import sync_grads
def update_entropy(alpha, log_alpha, target_entropy, log_pi, alpha_optim, cfg):
if cfg.automatic_entropy_tuning:
alpha_loss = -(log_alpha * (log_p... | [
"torch.nn.functional.mse_loss",
"torch.min",
"torch.tensor",
"numpy.concatenate",
"mpi_utils.mpi_utils.sync_grads",
"torch.no_grad"
] | [((889, 940), 'numpy.concatenate', 'np.concatenate', (['[obs_norm, ag_norm, g_norm]'], {'axis': '(1)'}), '([obs_norm, ag_norm, g_norm], axis=1)\n', (903, 940), True, 'import numpy as np\n'), ((964, 1020), 'numpy.concatenate', 'np.concatenate', (['[obs_next_norm, ag_norm, g_norm]'], {'axis': '(1)'}), '([obs_next_norm, a... |
# -*- coding: utf-8 -*-
"""
plot acc loss
@author: atpandey
"""
#%%
import matplotlib.pyplot as plt
#%%
ff='./to_laptop/trg_file.txt'
with open(ff,'r') as trgf:
listidx=[]
listloss=[]
listacc=[]
ctr=0
for line in trgf:
if(ctr>0):
ll=line.split(',')
listidx.append... | [
"matplotlib.pyplot.figure",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.show"
] | [((592, 604), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (602, 604), True, 'import matplotlib.pyplot as plt\n'), ((606, 672), 'matplotlib.pyplot.subplots_adjust', 'plt.subplots_adjust', ([], {'top': '(0.99)', 'bottom': '(0.05)', 'hspace': '(0.5)', 'wspace': '(0.4)'}), '(top=0.99, bottom=0.05, hspace=0.... |
##--------------------------------Main file------------------------------------
##
## Copyright (C) 2020 by <NAME> (<EMAIL>)
## June, 2020
## <EMAIL>
##-----------------------------------------------------------------------------
# Variables aleatorias múltiples
# Se consideran dos bases de datos las ... | [
"scipy.optimize.curve_fit",
"matplotlib.pyplot.savefig",
"collections.OrderedDict.fromkeys",
"pandas.read_csv",
"numpy.sqrt",
"scipy.stats.norm",
"numpy.exp",
"numpy.array",
"matplotlib.pyplot.bar",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.axes",
"numpy.meshgrid",
"matplotlib.pyplot.cl... | [((4558, 4647), 'pandas.read_csv', 'pd.read_csv', (['"""/Users/belindabrown/Desktop/VA_multiples/data_base/xy.csv"""'], {'index_col': '(0)'}), "('/Users/belindabrown/Desktop/VA_multiples/data_base/xy.csv',\n index_col=0)\n", (4569, 4647), True, 'import pandas as pd\n'), ((4655, 4728), 'pandas.read_csv', 'pd.read_csv... |
# -*- coding:UTF-8 -*-
import pandas as pd
from minepy import MINE
import seaborn as sns
import matplotlib.pyplot as plt
from sklearn.ensemble import ExtraTreesClassifier
import xgboost as xgb
import operator
from sklearn.utils import shuffle
from Common.ModelCommon import ModelCV
from sklearn import svm
import numpy a... | [
"xgboost.DMatrix",
"sklearn.ensemble.ExtraTreesClassifier",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xticks",
"xgboost.train",
"matplotlib.pyplot.xlabel",
"xgboost.plot_importance",
"seaborn.diverging_palette",
"sklearn.svm.LinearSVC",
"seaborn.heatmap",
"operator.itemgetter",
"numpy.whe... | [((2446, 2510), 'pandas.DataFrame', 'pd.DataFrame', (["{'feat': df.columns, 'valueCount': valueCountList}"], {}), "({'feat': df.columns, 'valueCount': valueCountList})\n", (2458, 2510), True, 'import pandas as pd\n'), ((2653, 2659), 'minepy.MINE', 'MINE', ([], {}), '()\n', (2657, 2659), False, 'from minepy import MINE\... |
# -*- coding: utf-8 -*-
"""
Perform Bluetooth LE Scan.
Based on https://github.com/hbldh/bleak/blob/master/bleak/backends/dotnet/discovery.py by
Created by hbldh <<EMAIL>>
"""
import logging
logger = logging.getLogger('bleak_scanner')
import asyncio
import queue
from bleak.backends.device import BLEDevice
# Import ... | [
"logging.getLogger",
"Windows.Devices.Bluetooth.Advertisement.BluetoothLEAdvertisementWatcher",
"Windows.Storage.Streams.IBuffer",
"asyncio.sleep",
"bleak.backends.device.BLEDevice",
"queue.Queue",
"System.Array.CreateInstance",
"Windows.Storage.Streams.DataReader.FromBuffer"
] | [((202, 236), 'logging.getLogger', 'logging.getLogger', (['"""bleak_scanner"""'], {}), "('bleak_scanner')\n", (219, 236), False, 'import logging\n'), ((1065, 1098), 'Windows.Devices.Bluetooth.Advertisement.BluetoothLEAdvertisementWatcher', 'BluetoothLEAdvertisementWatcher', ([], {}), '()\n', (1096, 1098), False, 'from ... |
#Desafio019 ( aplicação randomica para determinar que aluno vai no quadro.
import random
al01 = str('joao'),('maria'),('pédro'),('paula')
print(random.choice(al01))
| [
"random.choice"
] | [((145, 164), 'random.choice', 'random.choice', (['al01'], {}), '(al01)\n', (158, 164), False, 'import random\n')] |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | [
"google.cloud.networkmanagement_v1beta1.types.reachability.RerunConnectivityTestRequest",
"google.cloud.networkmanagement_v1beta1.types.reachability.CreateConnectivityTestRequest",
"google.cloud.networkmanagement_v1beta1.types.reachability.GetConnectivityTestRequest",
"google.api_core.gapic_v1.method_async.wr... | [((9369, 9419), 'google.cloud.networkmanagement_v1beta1.types.reachability.ListConnectivityTestsRequest', 'reachability.ListConnectivityTestsRequest', (['request'], {}), '(request)\n', (9410, 9419), False, 'from google.cloud.networkmanagement_v1beta1.types import reachability\n'), ((9546, 9693), 'google.api_core.gapic_... |