code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import torch
from cnsproject.network.neural_populations import LIFPopulation, ELIFPopulation, AELIFPopulation
from cnsproject.network.monitors import Monitor
from cnsproject.network.connections import DenseConnection, RandomConnection
from cnsproject.plotting.plotting import plot_current, raster, population_activi... | [
"cnsproject.network.neural_populations.AELIFPopulation",
"torch.manual_seed",
"cnsproject.network.neural_populations.LIFPopulation",
"cnsproject.network.connections.DenseConnection",
"torch.cat",
"cnsproject.plotting.plotting.population_activity",
"cnsproject.network.monitors.Monitor",
"torch.empty",
... | [((814, 835), 'torch.manual_seed', 'torch.manual_seed', (['(16)'], {}), '(16)\n', (831, 835), False, 'import torch\n'), ((1158, 1175), 'torch.Tensor', 'torch.Tensor', (['[0]'], {}), '([0])\n', (1170, 1175), False, 'import torch\n'), ((1189, 1206), 'torch.cat', 'torch.cat', (['(y, x)'], {}), '((y, x))\n', (1198, 1206), ... |
from bank_account_app.models import BankAccount
from bank_account_app.permissions import (CanChangeBankAccount,
CanViewBankAccount)
from bank_account_app.serializers import (BankAccountDetailsSerializer,
BankAccountShortDetailsSerialize... | [
"bank_account_app.models.BankAccount.objects.get",
"bank_account_app.models.BankAccount.objects.all",
"rest_framework.validators.ValidationError",
"django.db.models.F",
"rest_framework.decorators.action",
"django.db.transaction.atomic"
] | [((1686, 1731), 'rest_framework.decorators.action', 'action', ([], {'methods': "['PUT', 'PATCH']", 'detail': '(True)'}), "(methods=['PUT', 'PATCH'], detail=True)\n", (1692, 1731), False, 'from rest_framework.decorators import action\n'), ((754, 779), 'bank_account_app.models.BankAccount.objects.all', 'BankAccount.objec... |
"""
Classes and functions for path exploration on semantic graphs.
"""
#import pdb
import re
import warnings
from collections import deque, defaultdict
from itertools import product
from .components import (Pred, links, var_sort)
from .util import powerset
from .config import IVARG_ROLE
from delphin.exceptions import... | [
"delphin.mrs.Node",
"delphin.mrs.Pred.stringpred",
"collections.defaultdict",
"warnings.warn",
"delphin.mrs.Link",
"re.compile"
] | [((19406, 19647), 're.compile', 're.compile', (['"""(?P<string>"[^"\\\\\\\\]*(?:\\\\\\\\.[^"\\\\\\\\]*)*"|\\\\\'[^ \\\\\\\\]*(?:\\\\\\\\.[^ \\\\\\\\]*)*)|(?P<axis>[<:][^/]*/(?:[HN]?EQ|H)(?:&[^/]*/(?:[HN]?EQ|H))*[:>])|(?P<symbol>[^\\\\s#:><@=()\\\\[\\\\]&|]+)|(?P<nodeid>#\\\\d+)|(?P<punc>[@=()\\\\[\\\\]&|])"""'], {}), '... |
# for building the exe:
# python setup.py py2exe --includes sip
from distutils.core import setup
from py2exe.build_exe import py2exe
from glob import glob
import py2exe
import sys
sys.path.append("C:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\redist\\x86\\Microsoft.VC90.CRT")
data_files = [("Mic... | [
"sys.path.append",
"glob.glob",
"distutils.core.setup"
] | [((191, 309), 'sys.path.append', 'sys.path.append', (['"""C:\\\\Program Files (x86)\\\\Microsoft Visual Studio 9.0\\\\VC\\\\redist\\\\x86\\\\Microsoft.VC90.CRT"""'], {}), "(\n 'C:\\\\Program Files (x86)\\\\Microsoft Visual Studio 9.0\\\\VC\\\\redist\\\\x86\\\\Microsoft.VC90.CRT'\n )\n", (206, 309), False, 'import... |
import os
import tempfile
import unittest
import logging
from pyidf import ValidationLevel
import pyidf
from pyidf.idf import IDF
from pyidf.natural_ventilation_and_duct_leakage import AirflowNetworkDistributionComponentDuct
log = logging.getLogger(__name__)
class TestAirflowNetworkDistributionComponentDuct(unittest.... | [
"os.remove",
"tempfile.mkstemp",
"pyidf.idf.IDF",
"pyidf.natural_ventilation_and_duct_leakage.AirflowNetworkDistributionComponentDuct",
"logging.getLogger"
] | [((232, 259), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (249, 259), False, 'import logging\n'), ((382, 400), 'tempfile.mkstemp', 'tempfile.mkstemp', ([], {}), '()\n', (398, 400), False, 'import tempfile\n'), ((434, 454), 'os.remove', 'os.remove', (['self.path'], {}), '(self.path)\n',... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('syntacticframes', '0006_auto_20141103_0939'),
]
operations = [
migrations.AlterModelOptions(
name='verbnetclass'... | [
"django.db.migrations.AlterModelOptions",
"django.db.models.PositiveSmallIntegerField"
] | [((259, 360), 'django.db.migrations.AlterModelOptions', 'migrations.AlterModelOptions', ([], {'name': '"""verbnetclass"""', 'options': "{'ordering': ['levin_class', 'name']}"}), "(name='verbnetclass', options={'ordering': [\n 'levin_class', 'name']})\n", (287, 360), False, 'from django.db import models, migrations\n... |
import nose.tools as nt
import numpy as np
import theano
import theano.tensor as T
import treeano
import treeano.nodes as tn
from treeano.sandbox.nodes import wta_sparisty as wta
fX = theano.config.floatX
def test_wta_spatial_sparsity_node_serialization():
tn.check_serialization(wta.WTASpatialSparsityNode("a"... | [
"treeano.sandbox.nodes.wta_sparisty.WTASparsityNode",
"treeano.sandbox.nodes.wta_sparisty.WTASpatialSparsityNode",
"treeano.nodes.InputNode",
"numpy.arange",
"numpy.testing.assert_allclose"
] | [((1234, 1270), 'numpy.testing.assert_allclose', 'np.testing.assert_allclose', (['res', 'ans'], {}), '(res, ans)\n', (1260, 1270), True, 'import numpy as np\n'), ((290, 321), 'treeano.sandbox.nodes.wta_sparisty.WTASpatialSparsityNode', 'wta.WTASpatialSparsityNode', (['"""a"""'], {}), "('a')\n", (316, 321), True, 'from ... |
# Copyright (c) 2021-2022, <NAME>, Jonxslays
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditi... | [
"len8.Checker.from_config",
"len8.Checker",
"pytest.fixture",
"pytest.fail",
"pathlib.Path",
"pytest.raises",
"len8.Config"
] | [((1876, 1892), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (1890, 1892), False, 'import pytest\n'), ((1977, 1993), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (1991, 1993), False, 'import pytest\n'), ((2151, 2167), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (2165, 2167), False, 'import p... |
"""
this is a program contains Test Class for HW04
Written by <NAME>
"""
import unittest as ut
import HW04_Qi_Zhao as HW04
class TestFraction(ut.TestCase):
#Test cases class with extended test cases.
def test_simplify(self):
self.assertEqual(HW04.Fraction(9, 27).simplify(),HW04.Fraction(1,3))
... | [
"unittest.main",
"HW04_Qi_Zhao.Fraction",
"HW04_Qi_Zhao.count_vowels",
"HW04_Qi_Zhao.last_occurrence",
"HW04_Qi_Zhao.my_enumerate"
] | [((1651, 1683), 'unittest.main', 'ut.main', ([], {'exit': '(False)', 'verbosity': '(2)'}), '(exit=False, verbosity=2)\n', (1658, 1683), True, 'import unittest as ut\n'), ((296, 315), 'HW04_Qi_Zhao.Fraction', 'HW04.Fraction', (['(1)', '(3)'], {}), '(1, 3)\n', (309, 315), True, 'import HW04_Qi_Zhao as HW04\n'), ((374, 39... |
import os
class DocumentFile:
def __init__(self, fmtdirstr, file_name, media_root):
self.fmtdirstr = fmtdirstr
self.file_name = file_name
self.media_root = media_root
@property
def dir_path(self):
return os.path.join(
self.media_root,
self.fmtdirstr... | [
"os.path.join",
"os.path.splitext",
"os.path.exists",
"os.path.basename"
] | [((251, 296), 'os.path.join', 'os.path.join', (['self.media_root', 'self.fmtdirstr'], {}), '(self.media_root, self.fmtdirstr)\n', (263, 296), False, 'import os\n'), ((850, 893), 'os.path.join', 'os.path.join', (['self.dir_path', 'self.file_name'], {}), '(self.dir_path, self.file_name)\n', (862, 893), False, 'import os\... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import json
import requests
from v2ex_daily_mission.notifier.abc import Notifier, NotificationSendFailedException
class SlackNotifier(Notifier):
def __init__(self, config):
self.config = config
def send_notificati... | [
"json.dumps"
] | [((526, 542), 'json.dumps', 'json.dumps', (['data'], {}), '(data)\n', (536, 542), False, 'import json\n')] |
# -*- coding: utf-8 -*-
# tab level: 4
#!/usr/bin/env python3
"""this module will control all settings
"""
import logging
import logging.config
import logging.handlers
import json
import os
from pathlib import Path
from mytemplate.errorclass import CustomError as customerr
logger = logging.getLogger(__name__)
logge... | [
"json.load",
"json.loads",
"logging.basicConfig",
"pathlib.Path",
"logging.config.dictConfig",
"os.getenv",
"logging.getLogger"
] | [((287, 314), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (304, 314), False, 'import logging\n'), ((833, 860), 'os.getenv', 'os.getenv', (['"""PY_SERVER_CONF"""'], {}), "('PY_SERVER_CONF')\n", (842, 860), False, 'import os\n'), ((1775, 1795), 'pathlib.Path', 'Path', (['log_locate_abs']... |
# -*- coding: utf-8 -*-
"""
@author: <NAME>
@description: Graceful stopping condition
@contact: <EMAIL>
"""
import signal
import time
import subprocess
from pathlib import Path
class GracefulKiller:
kill_now = False
def __init__(self):
signal.signal(signal.SIGINT, self.exit_gracefully)
signal.... | [
"signal.signal",
"pathlib.Path.cwd",
"time.sleep"
] | [((254, 304), 'signal.signal', 'signal.signal', (['signal.SIGINT', 'self.exit_gracefully'], {}), '(signal.SIGINT, self.exit_gracefully)\n', (267, 304), False, 'import signal\n'), ((313, 364), 'signal.signal', 'signal.signal', (['signal.SIGTERM', 'self.exit_gracefully'], {}), '(signal.SIGTERM, self.exit_gracefully)\n', ... |
#!/usr/bin/env python
# Roobert V2 - second version of home robot project
# ________ ______ _____
# ___ __ \______________ /_______________ /_
# __ /_/ / __ \ __ \_ __ \ _ \_ ___/ __/
# _ _, _// /_/ / /_/ / /_/ / __/ / / /_
# /_/ |_| \____/\____//... | [
"atexit.register",
"os.path.abspath",
"SmartServoManager.SmartServoManager",
"sys.path.insert",
"RgbLeds.RgbLeds",
"time.sleep",
"Neck.Neck",
"Arms.Arms",
"LX16AServos.LX16AServos"
] | [((1831, 1856), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (1846, 1856), False, 'import time, os, sys\n'), ((1902, 1935), 'sys.path.insert', 'sys.path.insert', (['(0)', "(my_path + '/')"], {}), "(0, my_path + '/')\n", (1917, 1935), False, 'import time, os, sys\n'), ((1937, 2008), 'sys.pat... |
from logging import getLogger
from libcity.executor.abstract_tradition_executor import AbstractTraditionExecutor
from libcity.utils import get_evaluator
class MapMatchingExecutor(AbstractTraditionExecutor):
def __init__(self, config, model):
self.model = model
self.config = config
self.ev... | [
"libcity.utils.get_evaluator",
"logging.getLogger"
] | [((330, 351), 'libcity.utils.get_evaluator', 'get_evaluator', (['config'], {}), '(config)\n', (343, 351), False, 'from libcity.utils import get_evaluator\n'), ((595, 606), 'logging.getLogger', 'getLogger', ([], {}), '()\n', (604, 606), False, 'from logging import getLogger\n')] |
# Create program to read email from Gmail account and perform a sentiment analysis on the email.
import imaplib
import email
import email.message
import email.utils
import re
import datetime
import sys
import os
# import pandas as pd
# import numpy as np
# import matplotlib.pyplot as plt
# from matplotlib.b... | [
"imaplib.IMAP4_SSL",
"datetime.datetime.strptime"
] | [((1128, 1163), 'imaplib.IMAP4_SSL', 'imaplib.IMAP4_SSL', (['"""imap.gmail.com"""'], {}), "('imap.gmail.com')\n", (1145, 1163), False, 'import imaplib\n'), ((1908, 1959), 'datetime.datetime.strptime', 'datetime.datetime.strptime', (['email_date', 'date_format'], {}), '(email_date, date_format)\n', (1934, 1959), False, ... |
import setuptools
with open('README.md') as f:
long_desc = f.read()
setuptools.setup(
name='asyncping3',
use_scm_version={"version_scheme": "guess-next-dev", "local_scheme": "dirty-tag"},
setup_requires=["setuptools_scm"],
description='A pure python3 version of ICMP ping implementation using raw s... | [
"setuptools.setup"
] | [((74, 1092), 'setuptools.setup', 'setuptools.setup', ([], {'name': '"""asyncping3"""', 'use_scm_version': "{'version_scheme': 'guess-next-dev', 'local_scheme': 'dirty-tag'}", 'setup_requires': "['setuptools_scm']", 'description': '"""A pure python3 version of ICMP ping implementation using raw socket."""', 'long_descr... |
# Copyright (c) 2016-2019 <NAME>
#
# This file is part of XL-mHG.
"""Contains the `mHGResult` class."""
import sys
import hashlib
import logging
import numpy as np
try:
# This is a duct-tape fix for the Google App Engine, on which importing
# the C extension fails.
from . import mhg_cython
except Import... | [
"hashlib.md5",
"numpy.sum",
"numpy.zeros",
"logging.getLogger",
"numpy.issubdtype"
] | [((473, 500), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (490, 500), False, 'import logging\n'), ((4035, 4067), 'numpy.zeros', 'np.zeros', (['self.N'], {'dtype': 'np.uint8'}), '(self.N, dtype=np.uint8)\n', (4043, 4067), True, 'import numpy as np\n'), ((2366, 2405), 'numpy.issubdtype',... |
"""
Extend napoleon to provide a `Members` section for C structs and unions
similar to the `Attributes` section in python objects.
"""
from functools import partial
from typing import Optional, Any, List, Union, Dict, Callable
from sphinx.config import Config
from sphinx.ext.autodoc import Options
from sphinx.applica... | [
"functools.partial"
] | [((1928, 1972), 'functools.partial', 'partial', (['self._parse_admonition', '"""attention"""'], {}), "(self._parse_admonition, 'attention')\n", (1935, 1972), False, 'from functools import partial\n'), ((2055, 2097), 'functools.partial', 'partial', (['self._parse_admonition', '"""caution"""'], {}), "(self._parse_admonit... |
import ctypes
DWORD = ctypes.c_ulong
MAX_PATH = ctypes.c_int(260)
MAX_PATH_NULL = int(MAX_PATH.value) + 1
def decode(s):
if isinstance(s, unicode):
return s
return s.decode('mbcs')
def GetModuleFileName(handle):
r = 0
if hasattr(ctypes.windll.kernel32, "GetModuleFileNameW"):
name = ... | [
"ctypes.c_int",
"ctypes.byref",
"ctypes.windll.kernel32.GetModuleFileNameW",
"ctypes.windll.kernel32.GetModuleFileNameA",
"ctypes.create_string_buffer",
"ctypes.create_unicode_buffer",
"ctypes.windll.kernel32.GetTempPathW",
"ctypes.windll.kernel32.GetTempPathA"
] | [((49, 66), 'ctypes.c_int', 'ctypes.c_int', (['(260)'], {}), '(260)\n', (61, 66), False, 'import ctypes\n'), ((320, 363), 'ctypes.create_unicode_buffer', 'ctypes.create_unicode_buffer', (['MAX_PATH_NULL'], {}), '(MAX_PATH_NULL)\n', (348, 363), False, 'import ctypes\n'), ((376, 446), 'ctypes.windll.kernel32.GetModuleFil... |
import numpy as np
import pytest
from dnnv.nn.converters.tensorflow import *
from dnnv.nn.operations import *
def test_Reshape():
original_shape = [0, 3, 4]
data = np.random.random_sample(original_shape).astype(np.float32)
new_shape = np.array([3, 4, 0], dtype=np.int64)
y = np.reshape(data, new_shape... | [
"numpy.random.random_sample",
"numpy.allclose",
"numpy.dtype",
"numpy.array",
"numpy.reshape"
] | [((250, 285), 'numpy.array', 'np.array', (['[3, 4, 0]'], {'dtype': 'np.int64'}), '([3, 4, 0], dtype=np.int64)\n', (258, 285), True, 'import numpy as np\n'), ((294, 321), 'numpy.reshape', 'np.reshape', (['data', 'new_shape'], {}), '(data, new_shape)\n', (304, 321), True, 'import numpy as np\n'), ((457, 479), 'numpy.allc... |
#!/usr/bin/python
import sys, platform, os
import matplotlib.patches as mpatches
import matplotlib.pyplot as plt
from matplotlib import pyplot
import numpy as np
from matplotlib.patches import Ellipse
import camb
from camb import model, initialpower
from pysm.nominal import models
import healpy as hp
import site
plt.... | [
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.yscale",
"matplotlib.pyplot.fill_between",
"numpy.arctan2",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.legend",
"matplotlib.patches.Patch",
"matplotlib.pyplot.text",
"numpy.linalg.eigh",
"matplotlib.pyplot.gca",
"matplotl... | [((831, 897), 'matplotlib.patches.Ellipse', 'Ellipse', ([], {'xy': 'pos', 'width': 'width', 'height': 'height', 'angle': 'theta'}), '(xy=pos, width=width, height=height, angle=theta, **kwargs)\n', (838, 897), False, 'from matplotlib.patches import Ellipse\n'), ((1348, 1473), 'matplotlib.pyplot.legend', 'plt.legend', ([... |
from io import StringIO
from tests.src.lsf_config import Config
class TestBool:
def test_empty_returns_false(self):
config = Config({})
assert not config
def test_non_empty_returns_true(self):
config = Config({1: 1})
assert config
class TestDefaultConstructor:
def test... | [
"tests.src.lsf_config.Config.args_to_dict",
"io.StringIO",
"tests.src.lsf_config.Config.from_stream",
"tests.src.lsf_config.Config",
"tests.src.lsf_config.Config.concatenate_params"
] | [((5180, 5205), 'tests.src.lsf_config.Config.args_to_dict', 'Config.args_to_dict', (['args'], {}), '(args)\n', (5199, 5205), False, 'from tests.src.lsf_config import Config\n'), ((139, 149), 'tests.src.lsf_config.Config', 'Config', (['{}'], {}), '({})\n', (145, 149), False, 'from tests.src.lsf_config import Config\n'),... |
import numpy as np
from base.RecommenderUtils import check_matrix
from base.BaseRecommender import RecommenderSystem
from tqdm import tqdm
import models.MF.Cython.MF_RMSE as mf
class IALS_numpy(RecommenderSystem):
'''
binary Alternating Least Squares model (or Weighed Regularized Matrix Factorization)
Re... | [
"base.RecommenderUtils.check_matrix",
"numpy.outer",
"numpy.random.seed",
"numpy.log",
"numpy.eye",
"numpy.zeros",
"numpy.random.normal",
"numpy.dot",
"numpy.linalg.solve",
"numpy.diag",
"numpy.in1d"
] | [((2790, 2819), 'numpy.random.seed', 'np.random.seed', (['self.rnd_seed'], {}), '(self.rnd_seed)\n', (2804, 2819), True, 'import numpy as np\n'), ((2877, 2952), 'numpy.random.normal', 'np.random.normal', (['self.init_mean', 'self.init_std'], {'size': '(M, self.num_factors)'}), '(self.init_mean, self.init_std, size=(M, ... |
import os,unittest, json
from app import create_app
from instance.config import app_config
from app.connect import QuestionerDB
app = create_app(app_config['testing'])
class UserTestCases(unittest.TestCase):
""" Base test class """
def setUp(self):
""" Defining test variables """
self.app = ... | [
"unittest.main",
"json.loads",
"app.connect.QuestionerDB.drop_tables",
"json.dumps",
"app.create_app"
] | [((137, 170), 'app.create_app', 'create_app', (["app_config['testing']"], {}), "(app_config['testing'])\n", (147, 170), False, 'from app import create_app\n'), ((5796, 5811), 'unittest.main', 'unittest.main', ([], {}), '()\n', (5809, 5811), False, 'import os, unittest, json\n'), ((320, 353), 'app.create_app', 'create_a... |
import numpy as np
import heapq
import math
import time
import pygame
class Node:
def __init__(self, state=None, cost=float('inf'), costToCome=float('inf'), parent=None, collision=None):
self.state = state
self.parent = parent
self.cost = cost
self.costToCome = costToCome
s... | [
"numpy.load",
"pygame.draw.line",
"heapq.heappush",
"math.atan2",
"pygame.event.get",
"pygame.display.update",
"pygame.font.SysFont",
"math.radians",
"pygame.display.set_mode",
"math.cos",
"pygame.display.set_caption",
"pygame.quit",
"math.sqrt",
"pygame.init",
"math.sin",
"pygame.draw... | [((4574, 4593), 'math.floor', 'math.floor', (['(800 / r)'], {}), '(800 / r)\n', (4584, 4593), False, 'import math\n'), ((4604, 4623), 'math.floor', 'math.floor', (['(800 / r)'], {}), '(800 / r)\n', (4614, 4623), False, 'import math\n'), ((5885, 5927), 'math.sqrt', 'math.sqrt', (['((gx - sx) ** 2 + (gy - sy) ** 2)'], {}... |
import goless
from goless.backends import current as be
from . import BaseTests
class RecvCaseTests(BaseTests):
chansize = 1
def setUp(self):
BaseTests.setUp(self)
self.ch = goless.chan(self.chansize)
self.ca = goless.rcase(self.ch)
def test_ready(self):
self.assertFalse(... | [
"goless.dcase",
"goless.scase",
"goless.rcase",
"goless.backends.current.run",
"goless.chan",
"goless.backends.current.yield_",
"goless.select"
] | [((201, 227), 'goless.chan', 'goless.chan', (['self.chansize'], {}), '(self.chansize)\n', (212, 227), False, 'import goless\n'), ((246, 267), 'goless.rcase', 'goless.rcase', (['self.ch'], {}), '(self.ch)\n', (258, 267), False, 'import goless\n'), ((345, 368), 'goless.backends.current.run', 'be.run', (['self.ch.send', '... |
"""
cuTENSOR Wrapper
Use `cupy_backends.cuda.libs.cutensor` directly in CuPy codebase.
"""
available = True
try:
from cupy_backends.cuda.libs.cutensor import * # NOQA
except ImportError as e:
available = False
from cupy._environment import _preload_warning
_preload_warning('cutensor', e)
| [
"cupy._environment._preload_warning"
] | [((277, 308), 'cupy._environment._preload_warning', '_preload_warning', (['"""cutensor"""', 'e'], {}), "('cutensor', e)\n", (293, 308), False, 'from cupy._environment import _preload_warning\n')] |
# -*- coding: utf-8 -*-
"""
Created on Fri Apr 9 20:00:55 2021
@author: oscar
"""
import numpy as np
import math
def bin_MUA_data(MUA,bin_res):
counter = 0
binned_MUA = np.zeros([math.ceil(len(MUA[:,1])/bin_res),len(MUA[1,:])])
for bin in range(math.ceil(len(MUA[:,1])/bin_res)):
if... | [
"numpy.sum",
"numpy.flip",
"numpy.argmax",
"numpy.argsort",
"numpy.arange",
"numpy.delete"
] | [((2571, 2586), 'numpy.argmax', 'np.argmax', (['hist'], {}), '(hist)\n', (2580, 2586), True, 'import numpy as np\n'), ((3054, 3069), 'numpy.argsort', 'np.argsort', (['idx'], {}), '(idx)\n', (3064, 3069), True, 'import numpy as np\n'), ((2778, 2799), 'numpy.delete', 'np.delete', (['idx', 'right'], {}), '(idx, right)\n',... |
# Copyright 2016-2020 Blue Marble Analytics 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 ag... | [
"gridpath.auxiliary.auxiliary.subset_init_by_param_value",
"csv.reader",
"csv.writer",
"gridpath.auxiliary.db_interface.determine_table_subset_by_start_and_column",
"gridpath.auxiliary.db_interface.update_prj_zone_column",
"pyomo.environ.Param",
"pyomo.environ.Set",
"gridpath.auxiliary.validations.val... | [((3938, 3960), 'pyomo.environ.Set', 'Set', ([], {'within': 'm.PROJECTS'}), '(within=m.PROJECTS)\n', (3941, 3960), False, 'from pyomo.environ import Param, Set\n'), ((4086, 4131), 'pyomo.environ.Param', 'Param', (['m.CRBN_PRJS'], {'within': 'm.CARBON_CAP_ZONES'}), '(m.CRBN_PRJS, within=m.CARBON_CAP_ZONES)\n', (4091, 41... |
# -*- coding: utf-8 -*-
from django.db import models
from django.utils.translation import ugettext_lazy as _
from webtopay.signals import payment_was_successful, payment_was_flagged
class WebToPayResponse(models.Model):
# Non-webtopay params
def __unicode__(self):
amount = self.amount / 100 if self.... | [
"django.db.models.TextField",
"webtopay.signals.payment_was_flagged.send",
"django.db.models.BigIntegerField",
"django.db.models.IPAddressField",
"django.db.models.CharField",
"django.db.models.BooleanField",
"django.db.models.SmallIntegerField",
"django.db.models.IntegerField",
"django.utils.transl... | [((398, 426), 'django.db.models.TextField', 'models.TextField', ([], {'blank': '(True)'}), '(blank=True)\n', (414, 426), False, 'from django.db import models\n'), ((443, 476), 'django.db.models.IPAddressField', 'models.IPAddressField', ([], {'blank': '(True)'}), '(blank=True)\n', (464, 476), False, 'from django.db impo... |
from array_shift import insert_shift_array
# def test_insert_to_middle():
# expected = [1, 2, 3]
# actual = insert_shift_array([1, 3], 2)
# assert expected == actual
def test_insert_to_middle():
expected = [1, 2, 3, 4, 5, 6]
actual = insert_shift_array([1, 2, 3, 5, 6], 4)
assert ... | [
"array_shift.insert_shift_array"
] | [((269, 307), 'array_shift.insert_shift_array', 'insert_shift_array', (['[1, 2, 3, 5, 6]', '(4)'], {}), '([1, 2, 3, 5, 6], 4)\n', (287, 307), False, 'from array_shift import insert_shift_array\n')] |
from collections import OrderedDict
import numpy as np
import torch
import torch.optim as optim
from torch import nn as nn
from torch import autograd
from torch.autograd import Variable
import torch.nn.functional as F
from rlkit.core import logger
import rlkit.torch.pytorch_util as ptu
from rlkit.core.eval_util impo... | [
"torch.cat",
"rlkit.torch.pytorch_util.from_numpy",
"numpy.random.randint",
"numpy.linalg.norm",
"numpy.random.normal",
"torch.exp",
"rlkit.torch.distributions.ReparamMultivariateNormalDiag",
"numpy.random.choice",
"torch.nn.Linear",
"torch.log",
"torch.nn.BCEWithLogitsLoss",
"rlkit.torch.pyto... | [((1297, 1373), 'numpy.random.choice', 'np.random.choice', (['traj_len'], {'size': 'num_samples', 'replace': '(traj_len < num_samples)'}), '(traj_len, size=num_samples, replace=traj_len < num_samples)\n', (1313, 1373), True, 'import numpy as np\n'), ((2060, 2085), 'torch.nn.Linear', 'nn.Linear', (['hid_dim', 'z_dim'], ... |
# Generated by Django 3.2 on 2021-04-12 13:54
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('movie', '0006_alter_movie_rating'),
]
operations = [
migrations.AlterField(
model_name='movie',
name='photo',
... | [
"django.db.models.ImageField"
] | [((330, 366), 'django.db.models.ImageField', 'models.ImageField', ([], {'upload_to': '"""media"""'}), "(upload_to='media')\n", (347, 366), False, 'from django.db import migrations, models\n')] |
from builtins import int, range
from pyinfrabox import ValidationError
from pyinfrabox.utils import *
def check_version(v, path):
if not isinstance(v, int):
raise ValidationError(path, "must be an int")
if v != 1:
raise ValidationError(path, "unsupported version")
def parse_measurement(d, pa... | [
"pyinfrabox.ValidationError"
] | [((177, 216), 'pyinfrabox.ValidationError', 'ValidationError', (['path', '"""must be an int"""'], {}), "(path, 'must be an int')\n", (192, 216), False, 'from pyinfrabox import ValidationError\n'), ((247, 291), 'pyinfrabox.ValidationError', 'ValidationError', (['path', '"""unsupported version"""'], {}), "(path, 'unsuppo... |
import numpy as np
from plantcv.plantcv.visualize import colorize_label_img
def test_colorize_label_img():
"""Test for PlantCV."""
label_img = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]])
colored_img = colorize_label_img(label_img)
assert (colored_img.shape[0:-1] == label_img.shape) and colored_img.sha... | [
"numpy.array",
"plantcv.plantcv.visualize.colorize_label_img"
] | [((153, 196), 'numpy.array', 'np.array', (['[[1, 2, 3], [4, 5, 6], [7, 8, 9]]'], {}), '([[1, 2, 3], [4, 5, 6], [7, 8, 9]])\n', (161, 196), True, 'import numpy as np\n'), ((215, 244), 'plantcv.plantcv.visualize.colorize_label_img', 'colorize_label_img', (['label_img'], {}), '(label_img)\n', (233, 244), False, 'from plan... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import io
import os
import sys
from shutil import rmtree
from setuptools import find_packages, setup, Command
NAME = 'substrate-utils'
VERSION = '0.1'
DESCRIPTION = ''
URL = 'https://github.com/stakelink/substrate-utils'
EMAIL = '<EMAIL>'
AUTHOR = 'STAKELINK'
REQUIRES_PY... | [
"os.path.dirname",
"os.path.join",
"setuptools.setup"
] | [((720, 1367), 'setuptools.setup', 'setup', ([], {'name': 'NAME', 'version': "about['__version__']", 'description': 'DESCRIPTION', 'long_description': 'LONG_DESCRIPTION', 'long_description_content_type': '"""text/markdown"""', 'author': 'AUTHOR', 'author_email': 'EMAIL', 'python_requires': 'REQUIRES_PYTHON', 'url': 'UR... |
from matplotlib import pyplot
import numpy
x = numpy.linspace(-1, 1, 1000)
y1 = numpy.exp(-x**2 * 10) * (1 + 0.05 * numpy.random.rand(len(x)))
y2 = (numpy.exp(10*(-(x-0.3)**2 - 0.75*x**4 - 0.25*x**6)) + numpy.piecewise(x, [x < 0.3, x >= 0.3], [lambda x: -(x-0.3)*numpy.sqrt(1+x), 0])) * (1 + 0.05 * numpy.random.rand(le... | [
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.plot",
"numpy.argmax",
"matplotlib.pyplot.axes",
"numpy.exp",
"numpy.linspace",
"matplotlib.pyplot.arrow",
"numpy.sqrt"
] | [((48, 75), 'numpy.linspace', 'numpy.linspace', (['(-1)', '(1)', '(1000)'], {}), '(-1, 1, 1000)\n', (62, 75), False, 'import numpy\n'), ((81, 104), 'numpy.exp', 'numpy.exp', (['(-x ** 2 * 10)'], {}), '(-x ** 2 * 10)\n', (90, 104), False, 'import numpy\n'), ((431, 448), 'matplotlib.pyplot.plot', 'pyplot.plot', (['x', 'y... |
#!/usr/bin/python
# -*- coding: ascii -*-
# Author: @harvie <NAME>
# Date: 25 sept 2018
__author__ = "@harvie <NAME>"
#__email__ = ""
__name__ = _("DragKnife")
__version__ = "0.3.0"
import math
import os.path
import re
from CNC import CNC,Block
from bmath import Vector
from bpath import eq, Path, Segment
from Tool... | [
"bpath.eq",
"ToolsPage.Plugin.__init__",
"math.sqrt",
"bpath.Segment",
"bmath.Vector"
] | [((599, 641), 'ToolsPage.Plugin.__init__', 'Plugin.__init__', (['self', 'master', '"""DragKnife"""'], {}), "(self, master, 'DragKnife')\n", (614, 641), False, 'from ToolsPage import Plugin\n'), ((3732, 3750), 'bmath.Vector', 'Vector', (['P[0]', 'P[1]'], {}), '(P[0], P[1])\n', (3738, 3750), False, 'from bmath import Vec... |
#Dependencies
from bs4 import BeautifulSoup as bs
import requests
from webdriver_manager.chrome import ChromeDriverManager
from splinter import Browser
import pandas as pd
import os
def init_browser():
executable_path = {'executable_path': ChromeDriverManager().install()}
return Browser("chrome", **executable... | [
"bs4.BeautifulSoup",
"splinter.Browser",
"pandas.read_html",
"webdriver_manager.chrome.ChromeDriverManager"
] | [((290, 342), 'splinter.Browser', 'Browser', (['"""chrome"""'], {'headless': '(False)'}), "('chrome', **executable_path, headless=False)\n", (297, 342), False, 'from splinter import Browser\n'), ((622, 645), 'bs4.BeautifulSoup', 'bs', (['html', '"""html.parser"""'], {}), "(html, 'html.parser')\n", (624, 645), True, 'fr... |
# coding: utf-8
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
import sys
import unittest
import datadog_api_client.v2
from datadog... | [
"unittest.main"
] | [((1302, 1317), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1315, 1317), False, 'import unittest\n')] |
import tensorflow as tf
import cnn_denoiser.input_data as input_data
import glob
import os
# Parameters
channels = 1
dataset_path = 'data/pretraining'
image_width = 270
image_height = 90
batch_size = 64
image_data = input_data.load_images(dataset_path, image_width, image_height)
pretrain_steps_first_layer = 1000
pr... | [
"os.remove",
"tensorflow.square",
"tensorflow.nn.tanh",
"tensorflow.get_collection",
"tensorflow.global_variables_initializer",
"tensorflow.layers.dropout",
"tensorflow.variable_scope",
"tensorflow.get_default_graph",
"tensorflow.transpose",
"tensorflow.ConfigProto",
"tensorflow.Variable",
"gl... | [((219, 282), 'cnn_denoiser.input_data.load_images', 'input_data.load_images', (['dataset_path', 'image_width', 'image_height'], {}), '(dataset_path, image_width, image_height)\n', (241, 282), True, 'import cnn_denoiser.input_data as input_data\n'), ((452, 483), 'tensorflow.Variable', 'tf.Variable', (['(0)'], {'trainab... |
import cv2
im = cv2.imread('data/src/lena_square_half.png')
th, im_th = cv2.threshold(im, 128, 255, cv2.THRESH_BINARY)
print(th)
# 128.0
cv2.imwrite('data/dst/opencv_th.jpg', im_th)
# True
th, im_th_tz = cv2.threshold(im, 128, 255, cv2.THRESH_TOZERO)
print(th)
# 128.0
cv2.imwrite('data/dst/opencv_th_tz.jpg', im_... | [
"cv2.cvtColor",
"cv2.imread",
"cv2.threshold",
"cv2.imwrite"
] | [((17, 60), 'cv2.imread', 'cv2.imread', (['"""data/src/lena_square_half.png"""'], {}), "('data/src/lena_square_half.png')\n", (27, 60), False, 'import cv2\n'), ((74, 120), 'cv2.threshold', 'cv2.threshold', (['im', '(128)', '(255)', 'cv2.THRESH_BINARY'], {}), '(im, 128, 255, cv2.THRESH_BINARY)\n', (87, 120), False, 'imp... |
import numpy as np
def cgls(A, b):
height, width = A.shape
x = np.zeros((height))
while(True):
sumA = A.sum()
if (sumA < 100):
break
if (np.linalg.det(A) < 1):
A = A + np.eye(height, width) * sumA * 0.000000005
else:
x = np.linalg.inv(A).d... | [
"numpy.linalg.det",
"numpy.linalg.inv",
"numpy.zeros",
"numpy.eye"
] | [((72, 88), 'numpy.zeros', 'np.zeros', (['height'], {}), '(height)\n', (80, 88), True, 'import numpy as np\n'), ((186, 202), 'numpy.linalg.det', 'np.linalg.det', (['A'], {}), '(A)\n', (199, 202), True, 'import numpy as np\n'), ((302, 318), 'numpy.linalg.inv', 'np.linalg.inv', (['A'], {}), '(A)\n', (315, 318), True, 'im... |
# Licensed Materials - Property of IBM
# Copyright IBM Corp. 2016
import unittest
import sys
import itertools
import threading
from streamsx.topology.topology import *
from streamsx.topology.tester import Tester
from streamsx.topology import schema
import streamsx.topology.context
from streamsx.topology.context import... | [
"streamsx.spl.op.Map",
"streamsx.topology.context.JobConfig",
"streamsx.topology.tester.Tester.setup_distributed",
"streamsx.topology.tester.Tester.setup_standalone",
"streamsx.topology.tester.Tester",
"threading.Lock",
"streamsx.spl.op.Source"
] | [((710, 739), 'streamsx.topology.tester.Tester.setup_standalone', 'Tester.setup_standalone', (['self'], {}), '(self)\n', (733, 739), False, 'from streamsx.topology.tester import Tester\n'), ((2828, 2919), 'streamsx.spl.op.Source', 'op.Source', (['topo', '"""spl.utility::Beacon"""', '"""tuple<uint64 seq>"""'], {'params'... |
from pampy import match, _
from dataclasses import dataclass
from typing import TypeVar, Generic
T = TypeVar('T')
class Matcher:
def __init__(self):
self.pattern = []
def __setitem__(self, pat, method):
self.pattern.append(pat)
self.pattern.append(method)
def __call__(... | [
"typing.TypeVar",
"pampy.match"
] | [((101, 113), 'typing.TypeVar', 'TypeVar', (['"""T"""'], {}), "('T')\n", (108, 113), False, 'from typing import TypeVar, Generic\n'), ((389, 412), 'pampy.match', 'match', (['x', '*self.pattern'], {}), '(x, *self.pattern)\n', (394, 412), False, 'from pampy import match, _\n')] |
import nltk
import os
from flask_script import Manager
from app import app
from app.dynamodb.utils import create_dynamo_table
from app.models.review import Review
from app.models.game import Game
from app.models.tag import Tag
manager = Manager(app)
@manager.command
def create_tables():
create_dynamo_table(Revie... | [
"flask_script.Manager",
"nltk.download",
"app.dynamodb.utils.create_dynamo_table"
] | [((239, 251), 'flask_script.Manager', 'Manager', (['app'], {}), '(app)\n', (246, 251), False, 'from flask_script import Manager\n'), ((295, 322), 'app.dynamodb.utils.create_dynamo_table', 'create_dynamo_table', (['Review'], {}), '(Review)\n', (314, 322), False, 'from app.dynamodb.utils import create_dynamo_table\n'), (... |
#!/usr/bin/env python
"""
@file route.py
@author <NAME>
@date 2013-10-23
@version $Id$
Route helper functions.
SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
Copyright (C) 2009-2017 DLR (http://www.dlr.de/) and contributors
This file is part of SUMO.
SUMO is free software; you can redistribute it... | [
"os.path.abspath",
"os.path.join"
] | [((685, 717), 'os.path.join', 'os.path.join', (['SUMO_HOME', '"""tools"""'], {}), "(SUMO_HOME, 'tools')\n", (697, 717), False, 'import os\n'), ((628, 653), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (643, 653), False, 'import os\n')] |
import numpy as np
from abc import abstractmethod
from init_args_serializer import Serializable
from rcsenv import RcsSimEnv, JointLimitException
import pyrado
from pyrado.environments.sim_base import SimEnv
from pyrado.spaces.base import Space
from pyrado.spaces.box import BoxSpace
from pyrado.spaces.empty import Emp... | [
"pyrado.spaces.box.BoxSpace",
"pyrado.ShapeErr",
"pyrado.utils.data_types.RenderMode",
"pyrado.TypeErr",
"pyrado.ValueErr",
"rcsenv.RcsSimEnv"
] | [((737, 787), 'pyrado.spaces.box.BoxSpace', 'BoxSpace', (['space.min', 'space.max'], {'labels': 'space.names'}), '(space.min, space.max, labels=space.names)\n', (745, 787), False, 'from pyrado.spaces.box import BoxSpace\n'), ((2669, 2759), 'rcsenv.RcsSimEnv', 'RcsSimEnv', ([], {'dt': 'dt', 'envType': 'envType', 'checkJ... |
import requests
from django.conf import settings
from django_ilmoitin.models import NotificationTemplate
from django_ilmoitin.utils import render_notification_template
NOTIFICATION_SERVICE_API_URL = "NOTIFICATION_SERVICE_API_URL"
NOTIFICATION_SERVICE_SENDER_NAME = "NOTIFICATION_SERVICE_SENDER_NAME"
NOTIFICATION_SERVIC... | [
"requests.post",
"django_ilmoitin.models.NotificationTemplate.objects.get",
"django_ilmoitin.utils.render_notification_template"
] | [((1349, 1405), 'django_ilmoitin.models.NotificationTemplate.objects.get', 'NotificationTemplate.objects.get', ([], {'type': 'notification_type'}), '(type=notification_type)\n', (1381, 1405), False, 'from django_ilmoitin.models import NotificationTemplate\n'), ((2267, 2340), 'requests.post', 'requests.post', (['f"""{se... |
# Generated by Django 3.1.5 on 2021-09-04 23:52
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Security_Alert',
fields=[
('id', models.Aut... | [
"django.db.models.CharField",
"django.db.models.FloatField",
"django.db.models.AutoField",
"django.db.models.ImageField",
"django.db.models.DateTimeField"
] | [((310, 403), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (326, 403), False, 'from django.db import migrations, models\... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of Karesansui.
#
# Copyright (C) 2012 HDE, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, incl... | [
"karesansui.lib.utils.base64_decode",
"karesansui.lib.utils.load_locale",
"ksscommand.KssCommandException",
"optparse.OptionParser",
"re.compile",
"karesansui.db.access.machine.findby1uniquekey",
"os.path.isdir",
"sys.stdout.fileno",
"karesansui.lib.virt.snapshot.KaresansuiVirtSnapshot",
"karesans... | [((2097, 2110), 'karesansui.lib.utils.load_locale', 'load_locale', ([], {}), '()\n', (2108, 2110), False, 'from karesansui.lib.utils import load_locale, preprint_r, base64_decode\n'), ((2165, 2211), 'optparse.OptionParser', 'OptionParser', ([], {'usage': 'usage', 'version': '__version__'}), '(usage=usage, version=__ver... |
import jax.numpy as jnp
from jax.api import jit
@jit
def x_rotz(theta):
c = jnp.cos(theta)
s = jnp.sin(theta)
x = jnp.array([[c, s, 0.0, 0.0, 0.0, 0.0],
[-s, c, 0.0, 0.0, 0.0, 0.0],
[0.0, 0.0, 1.0, 0.0, 0.0, 0.0],
[0.0, 0.0, 0.0, c, s, 0.0],
... | [
"jax.numpy.array",
"jax.numpy.cos",
"jax.make_jaxpr",
"jax.numpy.sin"
] | [((82, 96), 'jax.numpy.cos', 'jnp.cos', (['theta'], {}), '(theta)\n', (89, 96), True, 'import jax.numpy as jnp\n'), ((105, 119), 'jax.numpy.sin', 'jnp.sin', (['theta'], {}), '(theta)\n', (112, 119), True, 'import jax.numpy as jnp\n'), ((128, 327), 'jax.numpy.array', 'jnp.array', (['[[c, s, 0.0, 0.0, 0.0, 0.0], [-s, c, ... |
'''
Created on 19 Nov 2017
@author: Simon
'''
from fipy import Variable, FaceVariable, CellVariable, TransientTerm, DiffusionTerm
import numpy as np
import datetime
import pickle
from scipy.interpolate import interp1d
from boundary import BoundaryConditionCollection1D
from diagnostic import DiagnosticModu... | [
"fipy.CellVariable",
"numpy.abs",
"numpy.copy",
"fipy.DiffusionTerm",
"boundary.BoundaryConditionCollection1D",
"numpy.interp",
"datetime.datetime",
"numpy.mean",
"diagnostic.DiagnosticModule",
"numpy.array",
"fipy.Variable",
"datetime.timedelta",
"fipy.FaceVariable",
"scipy.interpolate.in... | [((858, 875), 'fipy.Variable', 'Variable', ([], {'value': '(0)'}), '(value=0)\n', (866, 875), False, 'from fipy import Variable, FaceVariable, CellVariable, TransientTerm, DiffusionTerm\n'), ((2770, 2832), 'fipy.CellVariable', 'CellVariable', ([], {'name': 'source_name', 'mesh': 'self.mesh.mesh', 'value': '(0.0)'}), '(... |
#
# Copyright (c) 2022 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, so... | [
"fnmatch.filter",
"os.path.isdir",
"os.walk",
"os.path.exists",
"logging.NullHandler",
"vpp_papi.VPPApiClient",
"os.path.join",
"socket.ntohl",
"logging.getLogger"
] | [((1155, 1189), 'logging.getLogger', 'logging.getLogger', (['"""vppcfg.vppapi"""'], {}), "('vppcfg.vppapi')\n", (1172, 1189), False, 'import logging\n'), ((2054, 2080), 'os.walk', 'os.walk', (['self.vpp_json_dir'], {}), '(self.vpp_json_dir)\n', (2061, 2080), False, 'import os\n'), ((2343, 2411), 'vpp_papi.VPPApiClient'... |
#!/usr/bin/python3.6
import datetime
import time
import requests
from twilio.rest import Client
from config import settings
class EventbriteWatcher(object):
"""
This class is used to watch Eventbrite for new events at a specified
organization.
"""
def __init__(self, watch_time, organizer_id, key... | [
"datetime.datetime.now",
"datetime.timedelta",
"time.sleep"
] | [((1749, 1772), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (1770, 1772), False, 'import datetime\n'), ((1789, 1827), 'datetime.timedelta', 'datetime.timedelta', ([], {'minutes': 'watch_time'}), '(minutes=watch_time)\n', (1807, 1827), False, 'import datetime\n'), ((2986, 3001), 'time.sleep', 'ti... |
from rubrix import _client_instance as client
from rubrix.metrics import helpers
from rubrix.metrics.models import MetricSummary
def f1(name: str) -> MetricSummary:
"""Computes the single label f1 metric for a dataset
Args:
name:
The dataset name.
Returns:
The f1 metric summa... | [
"rubrix._client_instance",
"rubrix.metrics.helpers.bar"
] | [((602, 610), 'rubrix._client_instance', 'client', ([], {}), '()\n', (608, 610), True, 'from rubrix import _client_instance as client\n'), ((1380, 1388), 'rubrix._client_instance', 'client', ([], {}), '()\n', (1386, 1388), True, 'from rubrix import _client_instance as client\n'), ((773, 826), 'rubrix.metrics.helpers.ba... |
import FWCore.ParameterSet.Config as cms
from Configuration.Eras.Modifier_run2_miniAOD_80XLegacy_cff import run2_miniAOD_80XLegacy
from Configuration.Eras.Modifier_run2_nanoAOD_94X2016_cff import run2_nanoAOD_94X2016
from PhysicsTools.NanoAOD.common_cff import Var, P4Vars
from PhysicsTools.NanoAOD.jets_cff import jet... | [
"FWCore.ParameterSet.Config.string",
"copy.deepcopy",
"FWCore.ParameterSet.Config.bool",
"FWCore.ParameterSet.Config.PSet",
"FWCore.ParameterSet.Config.double",
"PhysicsTools.PatAlgos.tools.jetCollectionTools.RecoJetAdder",
"PhysicsTools.PatAlgos.tools.jetCollectionTools.GenJetAdder",
"PhysicsTools.Na... | [((10283, 10396), 'PhysicsTools.NanoAOD.common_cff.Var', 'Var', (['"""?isPFJet()?chargedHadronEnergyFraction():-1"""', 'float'], {'doc': '"""charged Hadron Energy Fraction"""', 'precision': '(6)'}), "('?isPFJet()?chargedHadronEnergyFraction():-1', float, doc=\n 'charged Hadron Energy Fraction', precision=6)\n", (102... |
# Generated by Django 4.0.3 on 2022-03-13 15:43
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('transactions', '0009_wallets_date_created'),
]
operations = [
migrations.RenameField(
model_name='transactions',
old_name='d... | [
"django.db.migrations.RenameField"
] | [((234, 331), 'django.db.migrations.RenameField', 'migrations.RenameField', ([], {'model_name': '"""transactions"""', 'old_name': '"""date"""', 'new_name': '"""date_provided"""'}), "(model_name='transactions', old_name='date', new_name\n ='date_provided')\n", (256, 331), False, 'from django.db import migrations\n')] |
import pytest
from sciwing.datasets.seq_labeling.conll_yago_dataset import ConllYagoDatasetsManager
from sciwing.datasets.seq_labeling.conll_yago_dataset import ConllYagoDataset
import sciwing.constants as constants
import pathlib
from sciwing.tokenizers.word_tokenizer import WordTokenizer
PATHS = constants.PATHS
DATA... | [
"pathlib.Path",
"pytest.fail",
"pytest.fixture",
"sciwing.tokenizers.word_tokenizer.WordTokenizer"
] | [((356, 378), 'pathlib.Path', 'pathlib.Path', (['DATA_DIR'], {}), '(DATA_DIR)\n', (368, 378), False, 'import pathlib\n'), ((382, 495), 'pytest.fixture', 'pytest.fixture', ([], {'params': "['conll_yago_ner.train', 'conll_yago_ner.dev', 'conll_yago_ner.test']", 'scope': '"""session"""'}), "(params=['conll_yago_ner.train'... |
from django.conf.urls import include, url
from django.views.generic import RedirectView
from pgweb.util.signals import register_basic_signal_handlers
import pgweb.contributors.views
import pgweb.core.views
import pgweb.docs.views
import pgweb.downloads.views
import pgweb.events.views
import pgweb.featurematrix.views
... | [
"django.contrib.admin.autodiscover",
"django.conf.urls.include",
"pgweb.core.feeds.VersionFeed",
"pgweb.events.feeds.EventFeed",
"django.conf.urls.url",
"pgweb.util.signals.register_basic_signal_handlers",
"pgweb.news.feeds.NewsFeed",
"django.views.generic.RedirectView.as_view"
] | [((789, 809), 'django.contrib.admin.autodiscover', 'admin.autodiscover', ([], {}), '()\n', (807, 809), False, 'from django.contrib import admin\n'), ((847, 879), 'pgweb.util.signals.register_basic_signal_handlers', 'register_basic_signal_handlers', ([], {}), '()\n', (877, 879), False, 'from pgweb.util.signals import re... |
import json
import os
import socket
import base64
import logging
import subprocess
import re
from pathlib import Path
import pyroute2
from pyroute2 import IPDB, WireGuard, NetlinkError
from nacl.public import PrivateKey
from platform_agent.cmd.iptables import add_iptable_rules, delete_iptable_rules, add_iptables_forw... | [
"nacl.public.PrivateKey.generate",
"socket.socket",
"pyroute2.IPDB",
"platform_agent.files.tmp_files.get_peer_metadata",
"pathlib.Path",
"platform_agent.wireguard.helpers.find_free_port",
"platform_agent.cmd.wg_show.get_wg_listen_port",
"platform_agent.cmd.iptables.add_iptables_forward",
"platform_a... | [((695, 714), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (712, 714), False, 'import logging\n'), ((796, 886), 'subprocess.run', 'subprocess.run', (["['ip', 'link', 'del', ifname]"], {'check': '(False)', 'stderr': 'subprocess.DEVNULL'}), "(['ip', 'link', 'del', ifname], check=False, stderr=\n subproc... |
import discord
from discord.ext import commands, tasks
from discord.voice_client import VoiceClient
import youtube_dl
import urllib.parse, urllib.request
import re
import json
from random import choice
youtube_dl.utils.bug_reports_message = lambda: ''
ytdl_format_options = {
'format': 'bestaudio/best',
'outtm... | [
"discord.utils.get",
"random.choice",
"json.dumps",
"discord.ext.tasks.loop",
"youtube_dl.YoutubeDL",
"discord.FFmpegPCMAudio",
"discord.ext.commands.Bot"
] | [((679, 720), 'youtube_dl.YoutubeDL', 'youtube_dl.YoutubeDL', (['ytdl_format_options'], {}), '(ytdl_format_options)\n', (699, 720), False, 'import youtube_dl\n'), ((1476, 1514), 'discord.ext.commands.Bot', 'commands.Bot', ([], {'command_prefix': '"""seulgi """'}), "(command_prefix='seulgi ')\n", (1488, 1514), False, 'f... |
# Copyright (c) 2019, Bosch Engineering Center Cluj and BFMC organizers
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice, ... | [
"functools.partial"
] | [((3234, 3265), 'functools.partial', 'partial', (["kwargs['target']", 'self'], {}), "(kwargs['target'], self)\n", (3241, 3265), False, 'from functools import partial\n')] |
#!/usr/bin/env python
import numpy as np
from typing import Callable
def rectangle(a: float, b: float, f: Callable[[np.array], np.array],
h: float) -> float:
return h * np.sum(f(np.arange(a + h / 2, b + h / 2, h)))
def trapezoid(a: float, b: float, f: Callable[[np.array], np.array],
h: float) ... | [
"numpy.arange"
] | [((193, 227), 'numpy.arange', 'np.arange', (['(a + h / 2)', '(b + h / 2)', 'h'], {}), '(a + h / 2, b + h / 2, h)\n', (202, 227), True, 'import numpy as np\n'), ((370, 392), 'numpy.arange', 'np.arange', (['(a + h)', 'b', 'h'], {}), '(a + h, b, h)\n', (379, 392), True, 'import numpy as np\n'), ((590, 624), 'numpy.arange'... |
"""Views"""
import json
from math import log2
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.decorators import login_required
from django.views.decorators.csrf import csrf_exempt
from django.shortcuts import render
from django.db import IntegrityError
from django.http import Json... | [
"django.contrib.auth.decorators.login_required",
"json.loads",
"django.http.JsonResponse",
"django.urls.reverse",
"django.contrib.auth.logout",
"django.contrib.auth.authenticate",
"django.shortcuts.render",
"math.log2",
"django.contrib.auth.login"
] | [((753, 795), 'django.contrib.auth.decorators.login_required', 'login_required', ([], {'login_url': '"""game:loginUser"""'}), "(login_url='game:loginUser')\n", (767, 795), False, 'from django.contrib.auth.decorators import login_required\n'), ((1032, 1074), 'django.contrib.auth.decorators.login_required', 'login_requir... |
# -*- coding: utf-8 -*-
import os
from phaxio import PhaxioApi
from xero import Xero
from xero.auth import PrivateCredentials
# Setup the Xero Private App
# Ensure your private key is listed in your .gitignore, so you doesn't end up in your repo.
# Xero API Consumer Key is retrieved via an environmental variable
# Ens... | [
"xero.Xero",
"os.getenv"
] | [((596, 613), 'xero.Xero', 'Xero', (['credentials'], {}), '(credentials)\n', (600, 613), False, 'from xero import Xero\n'), ((541, 578), 'os.getenv', 'os.getenv', (['"""XERO_CONSUMER_KEY_PHAXIO"""'], {}), "('XERO_CONSUMER_KEY_PHAXIO')\n", (550, 578), False, 'import os\n'), ((819, 846), 'os.getenv', 'os.getenv', (['"""P... |
from dateutil.relativedelta import relativedelta
from custom.icds_reports.const import AGG_AVAILING_SERVICES_TABLE
from custom.icds_reports.utils.aggregation_helpers import month_formatter
from custom.icds_reports.utils.aggregation_helpers.distributed.base import (
StateBasedAggregationDistributedHelper,
)
class... | [
"custom.icds_reports.utils.aggregation_helpers.month_formatter",
"dateutil.relativedelta.relativedelta"
] | [((674, 701), 'custom.icds_reports.utils.aggregation_helpers.month_formatter', 'month_formatter', (['self.month'], {}), '(self.month)\n', (689, 701), False, 'from custom.icds_reports.utils.aggregation_helpers import month_formatter\n'), ((830, 852), 'custom.icds_reports.utils.aggregation_helpers.month_formatter', 'mont... |
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | [
"django.conf.urls.url"
] | [((1137, 1236), 'django.conf.urls.url', 're_path', (['"""^query/create_notebook/?$"""', 'api_public.create_notebook'], {'name': '"""query_create_notebook"""'}), "('^query/create_notebook/?$', api_public.create_notebook, name=\n 'query_create_notebook')\n", (1144, 1236), True, 'from django.conf.urls import url as re_... |
#
# Autogenerated by Thrift Compiler (0.9.2)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py
#
from thrift.Thrift import TType, TMessageType, TException, TApplicationException
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol, TProtocol
tr... | [
"thrift.protocol.TProtocol.TProtocolException",
"thrift.protocol.fastbinary.encode_binary",
"thrift.protocol.fastbinary.decode_binary"
] | [((1479, 1558), 'thrift.protocol.fastbinary.decode_binary', 'fastbinary.decode_binary', (['self', 'iprot.trans', '(self.__class__, self.thrift_spec)'], {}), '(self, iprot.trans, (self.__class__, self.thrift_spec))\n', (1503, 1558), False, 'from thrift.protocol import fastbinary\n'), ((5948, 6027), 'thrift.protocol.fast... |
import unittest
from test.std_test_utils import STDIOTest
from teagles_advent_2021.day_10.pt1 import main
TEST_INPUT = """[({(<(())[]>[[{[]{<()<>>
[(()[<>])]({[<{<<[]>>(
{([(<{}[<>[]}>{[]{[(<()>
(((({<>}<{<{<>}{[]{[]{}
[[<[([]))<([[{}[[()]]]
[{[{({}]{}}([{[{{{}}([]
{<[[]]>}<{[{[{[]{()[[[]
[<(<(<(<{}))><([]([]()
<{([(... | [
"unittest.main"
] | [((534, 549), 'unittest.main', 'unittest.main', ([], {}), '()\n', (547, 549), False, 'import unittest\n')] |
# -*- coding: utf-8 -*- {{{
# vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et:
#
# Copyright (c) 2015, Battelle Memorial Institute
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistrib... | [
"master_driver.interfaces.fakedriver.Interface"
] | [((3297, 3308), 'master_driver.interfaces.fakedriver.Interface', 'Interface', ([], {}), '()\n', (3306, 3308), False, 'from master_driver.interfaces.fakedriver import Interface\n'), ((3711, 3722), 'master_driver.interfaces.fakedriver.Interface', 'Interface', ([], {}), '()\n', (3720, 3722), False, 'from master_driver.int... |
from conexiones.auth_client import AuthClient
from conexiones.hub_client import HubClient
from conexiones.game_client import GameClient
"""
Clase LogicaCliente es un clase con metodos estaticos.
Es la clase que lleva la logica y la que se comunica con la capa de datos.
"""
class LogicaCliente:
""" Reg... | [
"conexiones.game_client.GameClient",
"conexiones.auth_client.AuthClient.instance",
"conexiones.hub_client.HubClient.instance"
] | [((1852, 1924), 'conexiones.game_client.GameClient', 'GameClient', (["servidor_seleccionado['host']", "servidor_seleccionado['port']"], {}), "(servidor_seleccionado['host'], servidor_seleccionado['port'])\n", (1862, 1924), False, 'from conexiones.game_client import GameClient\n'), ((648, 669), 'conexiones.auth_client.A... |
import pandas as pd
import numpy as np
class Packing(object):
def getMappedFitness(self, chromosome):
mappedChromosome = self.items[chromosome]
spaces = np.zeros(len(mappedChromosome), dtype=int)
result = np.cumsum(mappedChromosome) - self.BIN_CAPACITY
index_of_old_bin = 0
b... | [
"pandas.DataFrame",
"numpy.abs",
"numpy.ndenumerate",
"numpy.argmax",
"pandas.read_csv",
"numpy.flipud",
"numpy.argmin",
"numpy.insert",
"numpy.cumsum",
"numpy.max",
"numpy.random.randint",
"numpy.array",
"numpy.arange",
"numpy.where",
"numpy.random.rand",
"numpy.delete",
"numpy.rand... | [((2352, 2383), 'numpy.ndenumerate', 'np.ndenumerate', (['random_indicies'], {}), '(random_indicies)\n', (2366, 2383), True, 'import numpy as np\n'), ((2591, 2608), 'numpy.array', 'np.array', (['results'], {}), '(results)\n', (2599, 2608), True, 'import numpy as np\n'), ((2876, 2924), 'numpy.random.randint', 'np.random... |
import click
from .. import __version__
@click.command()
@click.option("--count", default=1, help="Number of greetings.")
@click.version_option(version=__version__)
def main(count):
print(count)
click.echo("Hello, Xbot!")
| [
"click.version_option",
"click.option",
"click.echo",
"click.command"
] | [((44, 59), 'click.command', 'click.command', ([], {}), '()\n', (57, 59), False, 'import click\n'), ((61, 124), 'click.option', 'click.option', (['"""--count"""'], {'default': '(1)', 'help': '"""Number of greetings."""'}), "('--count', default=1, help='Number of greetings.')\n", (73, 124), False, 'import click\n'), ((1... |
import xmltodict, json, collections, typing, random, time
f = open("kotus-sanalista_v1.xml")
kotus_ = f.read()
f.close()
kotus = xmltodict.parse(kotus_)
def toTn(tn):
pass
def toLine(item):
if "s" not in item or "t" not in item:
return (item["s"], -1,"_")
word = item["s"]
type_ = item["t"]
... | [
"random.sample",
"json.dumps",
"time.time",
"collections.defaultdict",
"xmltodict.parse"
] | [((131, 154), 'xmltodict.parse', 'xmltodict.parse', (['kotus_'], {}), '(kotus_)\n', (146, 154), False, 'import xmltodict, json, collections, typing, random, time\n'), ((1172, 1201), 'collections.defaultdict', 'collections.defaultdict', (['list'], {}), '(list)\n', (1195, 1201), False, 'import xmltodict, json, collection... |
from rest_framework import serializers
class CodeCoverageSerializer(serializers.Serializer):
entry = serializers.CharField()
# id = serializers.CharField()
# inputs = serializers.ListField()
# expectedOutputs = serializers.ListField(required=False)
| [
"rest_framework.serializers.CharField"
] | [((107, 130), 'rest_framework.serializers.CharField', 'serializers.CharField', ([], {}), '()\n', (128, 130), False, 'from rest_framework import serializers\n')] |
from part1 import (
gamma_board,
gamma_busy_fields,
gamma_delete,
gamma_free_fields,
gamma_golden_move,
gamma_golden_possible,
gamma_move,
gamma_new,
)
"""
scenario: test_random_actions
uuid: 507857314
"""
"""
random actions, total chaos
"""
board = gamma_new(5, 4, 4, 3)
assert board is... | [
"part1.gamma_new",
"part1.gamma_busy_fields",
"part1.gamma_golden_move",
"part1.gamma_golden_possible",
"part1.gamma_move",
"part1.gamma_board",
"part1.gamma_free_fields",
"part1.gamma_delete"
] | [((283, 304), 'part1.gamma_new', 'gamma_new', (['(5)', '(4)', '(4)', '(3)'], {}), '(5, 4, 4, 3)\n', (292, 304), False, 'from part1 import gamma_board, gamma_busy_fields, gamma_delete, gamma_free_fields, gamma_golden_move, gamma_golden_possible, gamma_move, gamma_new\n'), ((471, 489), 'part1.gamma_board', 'gamma_board',... |
import threading
import time
import logging
import pyroute2
import ipaddress
import json
import re
from pyroute2 import WireGuard
from platform_agent.cmd.lsmod import module_loaded
from platform_agent.cmd.wg_info import WireGuardRead
from platform_agent.files.tmp_files import read_tmp_file
from platform_agent.routes ... | [
"platform_agent.cmd.lsmod.module_loaded",
"pyroute2.WireGuard",
"platform_agent.lib.ctime.now",
"pyroute2.IPDB",
"re.match",
"platform_agent.cmd.wg_info.WireGuardRead",
"platform_agent.wireguard.helpers.get_peer_info_all",
"time.time",
"threading.Event",
"platform_agent.wireguard.helpers.ping_inte... | [((485, 504), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (502, 504), False, 'import logging\n'), ((600, 637), 'platform_agent.files.tmp_files.read_tmp_file', 'read_tmp_file', ([], {'file_type': '"""iface_info"""'}), "(file_type='iface_info')\n", (613, 637), False, 'from platform_agent.files.tmp_files i... |
import os
import json
import sys
import PTMCIM_A
import PTMCIM_B
import PTMCIM_C
print(sys.path)
class parameters:
def __init__(self):
# Spin lattice parameters
self.M = 300 # Number of rows
self.N = 300 # Number of cols
self.J = 1 # Coupling between locations
self.mu ... | [
"os.mkdir",
"json.dump",
"PTMCIM_B.routine",
"os.getcwd",
"PTMCIM_A.routine",
"os.chdir",
"PTMCIM_C.routine"
] | [((931, 950), 'os.mkdir', 'os.mkdir', (['case_name'], {}), '(case_name)\n', (939, 950), False, 'import os\n'), ((959, 978), 'os.chdir', 'os.chdir', (['case_name'], {}), '(case_name)\n', (967, 978), False, 'import os\n'), ((1108, 1130), 'os.mkdir', 'os.mkdir', (['trial_folder'], {}), '(trial_folder)\n', (1116, 1130), Fa... |
#!/usr/bin/env python3
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
df = pd.read_csv('../results/var_wifi_load.tsv', sep='\t', index_col=False, header=0)
nodes = [1, 2, 5, 10]
num_carriers = 20
for n in nodes:
data = df[(df['numEnbs'] == n)]
plt.cla()
for wifi_carriers in [5, ... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"pandas.read_csv",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.errorbar",
"matplotlib.pyplot.cla",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.savefig"
] | [((101, 186), 'pandas.read_csv', 'pd.read_csv', (['"""../results/var_wifi_load.tsv"""'], {'sep': '"""\t"""', 'index_col': '(False)', 'header': '(0)'}), "('../results/var_wifi_load.tsv', sep='\\t', index_col=False, header=0\n )\n", (112, 186), True, 'import pandas as pd\n'), ((281, 290), 'matplotlib.pyplot.cla', 'plt... |
'''
Munivariate statistics exercises
================================
'''
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
#%matplotlib inline
np.random.seed(seed=42) # make the example reproducible
'''
### Dot product and Euclidean norm
'''
a = np.array([2,1])
b = np.array([1,1])
def euclidia... | [
"numpy.random.seed",
"numpy.random.randn",
"numpy.mean",
"numpy.array",
"numpy.random.multivariate_normal",
"numpy.linalg.inv",
"numpy.dot"
] | [((165, 188), 'numpy.random.seed', 'np.random.seed', ([], {'seed': '(42)'}), '(seed=42)\n', (179, 188), True, 'import numpy as np\n'), ((271, 287), 'numpy.array', 'np.array', (['[2, 1]'], {}), '([2, 1])\n', (279, 287), True, 'import numpy as np\n'), ((291, 307), 'numpy.array', 'np.array', (['[1, 1]'], {}), '([1, 1])\n'... |
"""
Finds the amount of reversible numbers below limit_n
Author: <NAME>
"""
import math
from time import time
# Iterator to create values to run in the algorithm
class Range_reverse:
def __init__(self, start,limit_n):
self.current_value = start
self.limit = 10**7
self.maximum = limit_n
... | [
"time.time"
] | [((1061, 1067), 'time.time', 'time', ([], {}), '()\n', (1065, 1067), False, 'from time import time\n'), ((1648, 1654), 'time.time', 'time', ([], {}), '()\n', (1652, 1654), False, 'from time import time\n')] |
import logging
import sys
LOG_FORMAT = "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
def get_logger(name, log_format=LOG_FORMAT):
logger = logging.getLogger(name)
handler = logging.StreamHandler(stream=sys.stdout)
handler.setFormatter(logging.Formatter(log_format))
logger.addHandler(handler)... | [
"logging.Formatter",
"logging.StreamHandler",
"logging.getLogger"
] | [((155, 178), 'logging.getLogger', 'logging.getLogger', (['name'], {}), '(name)\n', (172, 178), False, 'import logging\n'), ((193, 233), 'logging.StreamHandler', 'logging.StreamHandler', ([], {'stream': 'sys.stdout'}), '(stream=sys.stdout)\n', (214, 233), False, 'import logging\n'), ((259, 288), 'logging.Formatter', 'l... |
# -*- coding: utf-8 -*-
# Builtin Modules
import json
import time
import traceback
# 3rd-party Modules
import memcache
import six
# Project Modules
from worker.utils import toolkit
from worker.utils.log_helper import LogHelper
def get_config(c):
servers = c.get('servers') or None
if servers and isinstance(s... | [
"worker.utils.toolkit.as_array",
"traceback.format_exc",
"worker.utils.toolkit.json_dumps"
] | [((459, 484), 'worker.utils.toolkit.as_array', 'toolkit.as_array', (['servers'], {}), '(servers)\n', (475, 484), False, 'from worker.utils import toolkit\n'), ((1137, 1158), 'worker.utils.toolkit.json_dumps', 'toolkit.json_dumps', (['x'], {}), '(x)\n', (1155, 1158), False, 'from worker.utils import toolkit\n'), ((1593,... |
import re
from .sentinel import Sentinel
def kleene(parser):
def parse_many(text):
text = text.lstrip()
if len(text) > 0:
for item, text1 in parser(text):
for items, text2 in parse_many(text1):
yield ([item] + items, text2)
else:
... | [
"re.compile"
] | [((2000, 2023), 're.compile', 're.compile', (['"""^([0-9]+)"""'], {}), "('^([0-9]+)')\n", (2010, 2023), False, 'import re\n')] |
import platform
if platform.system() == "Windows":
import os
import sys
shared_lib_paths = [os.path.join(os.path.dirname(__file__), 'shared_libs')] # cf setup.py
lk_path = os.environ.get("LIBKRIGING_DLL_PATH")
if lk_path:
for path in lk_path.split(os.pathsep):
shared_lib_paths... | [
"os.path.isdir",
"os.path.dirname",
"os.environ.get",
"os.add_dll_directory",
"platform.system"
] | [((20, 37), 'platform.system', 'platform.system', ([], {}), '()\n', (35, 37), False, 'import platform\n'), ((191, 228), 'os.environ.get', 'os.environ.get', (['"""LIBKRIGING_DLL_PATH"""'], {}), "('LIBKRIGING_DLL_PATH')\n", (205, 228), False, 'import os\n'), ((119, 144), 'os.path.dirname', 'os.path.dirname', (['__file__'... |
# this handles all the reading from file + creating dictionaries
# everything is separated by tabs
import os
def open_table(path, hunting=False):
if hunting:
_bullshit = "hunting/" + path
else:
_bullshit = path
file_path = "loot_tables"
num_tables = sum(len(files) for f, f... | [
"os.walk"
] | [((331, 367), 'os.walk', 'os.walk', (["(file_path + '/' + _bullshit)"], {}), "(file_path + '/' + _bullshit)\n", (338, 367), False, 'import os\n')] |
import unittest
from unittest import mock
from tethys_apps.templatetags import tags as t
class TestTags(unittest.TestCase):
def setUp(self):
# app_list
self.app_names = ['app1', 'app2', 'app3', 'app4', 'app5', 'app6']
self.tag_names = ['tag1', 'tag_2', 'tag 3', 'tag four', 'Tag Five', 'tag... | [
"tethys_apps.templatetags.tags.get_tag_class",
"tethys_apps.templatetags.tags.get_tags_from_apps",
"unittest.mock.MagicMock"
] | [((1321, 1377), 'tethys_apps.templatetags.tags.get_tag_class', 't.get_tag_class', (["self.mock_object_apps['configured'][-1]"], {}), "(self.mock_object_apps['configured'][-1])\n", (1336, 1377), True, 'from tethys_apps.templatetags import tags as t\n'), ((1559, 1613), 'tethys_apps.templatetags.tags.get_tag_class', 't.ge... |
import tensorflow as tf
import tensorflow.keras as keras
import lib_stylegan
def get_random_noise(batch_size=8):
random_noise = tf.random.normal(shape=(batch_size, 8))
return random_noise[:,:3], random_noise[:,3:6], random_noise[:,6], random_noise[:,7]
def make_seed_standard(model):
start_dim = mod... | [
"tensorflow.keras.layers.Reshape",
"lib_stylegan.lib_3d.layers.CameraStd",
"tensorflow.keras.layers.Dense",
"tensorflow.random.normal",
"tensorflow.stop_gradient",
"tensorflow.keras.models.Model",
"tensorflow.shape",
"tensorflow.keras.layers.Input",
"lib_stylegan.lib_3d.layers.RayTracer",
"lib_sty... | [((135, 174), 'tensorflow.random.normal', 'tf.random.normal', ([], {'shape': '(batch_size, 8)'}), '(shape=(batch_size, 8))\n', (151, 174), True, 'import tensorflow as tf\n'), ((392, 447), 'tensorflow.keras.layers.Input', 'keras.layers.Input', (['[model.n_layers, model.latent_size]'], {}), '([model.n_layers, model.laten... |
from typing import List, Dict
from pydantic import BaseModel, Field
from models.domain.resource import ResourceType
from models.domain.resource_template import ResourceTemplate, Property
def get_sample_workspace_template_object(template_name: str = "tre-workspace-vanilla") -> ResourceTemplate:
return ResourceTem... | [
"models.domain.resource_template.Property",
"pydantic.Field"
] | [((1730, 1771), 'pydantic.Field', 'Field', ([], {'title': '"""Name of workspace template"""'}), "(title='Name of workspace template')\n", (1735, 1771), False, 'from pydantic import BaseModel, Field\n'), ((1791, 1835), 'pydantic.Field', 'Field', ([], {'title': '"""Version of workspace template"""'}), "(title='Version of... |
import click
from rich.console import Console
from rich.table import Table
from .cmd_group import listener_cmds
@click.command("scan", help="scan for Nodes")
def scan_and_print():
from HiveMind_presence import LocalDiscovery
table = Table(title="HiveMind Devices")
table.add_column("Name", justify="cente... | [
"rich.console.Console",
"HiveMind_presence.LocalDiscovery",
"rich.table.Table",
"click.command"
] | [((116, 160), 'click.command', 'click.command', (['"""scan"""'], {'help': '"""scan for Nodes"""'}), "('scan', help='scan for Nodes')\n", (129, 160), False, 'import click\n'), ((244, 275), 'rich.table.Table', 'Table', ([], {'title': '"""HiveMind Devices"""'}), "(title='HiveMind Devices')\n", (249, 275), False, 'from ric... |
s = b'Hello World'
import binascii
h = binascii.b2a_hex( s )
print( h )
print( binascii.a2b_hex( h ))
import base64
h = base64.b16encode( s )
print( h )
print( base64.b16decode( h ) )
print( h.decode('ascii')) | [
"binascii.a2b_hex",
"base64.b16encode",
"base64.b16decode",
"binascii.b2a_hex"
] | [((41, 60), 'binascii.b2a_hex', 'binascii.b2a_hex', (['s'], {}), '(s)\n', (57, 60), False, 'import binascii\n'), ((126, 145), 'base64.b16encode', 'base64.b16encode', (['s'], {}), '(s)\n', (142, 145), False, 'import base64\n'), ((82, 101), 'binascii.a2b_hex', 'binascii.a2b_hex', (['h'], {}), '(h)\n', (98, 101), False, '... |
import taichi as ti
from taichi_course01_final.Types import HitResult, HittableObject, HittableObjectType, MaterialType
import taichi_course01_final.HittableObject.Sphere as Sphere
import taichi_course01_final.HittableObject.Plane as Plane
import taichi_course01_final.HittableObject.Ellipse as Ellipse
@ti.data_orien... | [
"taichi.field",
"taichi_course01_final.Types.HittableObject.field",
"taichi_course01_final.HittableObject.Plane.hit",
"taichi.Vector",
"taichi_course01_final.HittableObject.Ellipse.hit",
"taichi_course01_final.HittableObject.Sphere.hit"
] | [((407, 451), 'taichi_course01_final.Types.HittableObject.field', 'HittableObject.field', ([], {'shape': 'self.MAX_OBJECTS'}), '(shape=self.MAX_OBJECTS)\n', (427, 451), False, 'from taichi_course01_final.Types import HitResult, HittableObject, HittableObjectType, MaterialType\n'), ((478, 510), 'taichi.field', 'ti.field... |
from kafka import KafkaConsumer
import time
Topic ='pi_test'
consumer = KafkaConsumer(Topic,auto_offset_reset='earliest', enable_auto_commit=False)
i=0
DATA_DICT = {"u","v","t","s"}
for message in consumer:
text = message.value.decode("utf-8")
text = text.translate('b')
print (message.topic, text)
appen... | [
"kafka.KafkaConsumer",
"time.sleep"
] | [((72, 148), 'kafka.KafkaConsumer', 'KafkaConsumer', (['Topic'], {'auto_offset_reset': '"""earliest"""', 'enable_auto_commit': '(False)'}), "(Topic, auto_offset_reset='earliest', enable_auto_commit=False)\n", (85, 148), False, 'from kafka import KafkaConsumer\n'), ((960, 975), 'time.sleep', 'time.sleep', (['(0.1)'], {}... |
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import itertools
from memory import State
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
class DRRN(torch.nn.Module):
"""
Deep Reinforcement Relevance Network - He et al. '16
"""
def __i... | [
"torch.nn.Embedding",
"torch.cat",
"numpy.ones",
"torch.nn.utils.rnn.pad_packed_sequence",
"torch.no_grad",
"numpy.max",
"torch.nn.Linear",
"torch.nn.GRU",
"torch.logsumexp",
"torch.autograd.Variable",
"numpy.asarray",
"torch.cuda.is_available",
"torch.rand",
"torch.sort",
"torch.from_nu... | [((5580, 5595), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (5593, 5595), False, 'import torch\n'), ((162, 187), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (185, 187), False, 'import torch\n'), ((434, 473), 'torch.nn.Embedding', 'nn.Embedding', (['vocab_size', 'embedding_dim'], {}),... |
import test.xcursor_test as xcursor_test
import test.toolbox.parameters_test as parameters_test
import test.helper_test as helper_test
if __name__ == "__main__":
xcursor_test.run_tests()
parameters_test.run_tests()
helper_test.run_tests()
| [
"test.helper_test.run_tests",
"test.xcursor_test.run_tests",
"test.toolbox.parameters_test.run_tests"
] | [((169, 193), 'test.xcursor_test.run_tests', 'xcursor_test.run_tests', ([], {}), '()\n', (191, 193), True, 'import test.xcursor_test as xcursor_test\n'), ((198, 225), 'test.toolbox.parameters_test.run_tests', 'parameters_test.run_tests', ([], {}), '()\n', (223, 225), True, 'import test.toolbox.parameters_test as parame... |
# Generated by Django 3.1 on 2020-09-16 06:52
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('package', '0006_auto_20200916_1440'),
]
operations = [
migrations.RenameField(
model_name='packageline',
old_nam... | [
"django.db.migrations.RenameField"
] | [((237, 344), 'django.db.migrations.RenameField', 'migrations.RenameField', ([], {'model_name': '"""packageline"""', 'old_name': '"""fulfilmentline"""', 'new_name': '"""fulfillmentline"""'}), "(model_name='packageline', old_name='fulfilmentline',\n new_name='fulfillmentline')\n", (259, 344), False, 'from django.db i... |
from plane import Plane
def test_create():
assert Plane() is not None
assert Plane().points_count == 0
assert Plane().maximum_distance_between_points == 0
def test_add_first_point():
plane = Plane()
plane.add_point((1,2))
assert plane.points_count == 1
assert plane.maximum_dis... | [
"plane.Plane"
] | [((219, 226), 'plane.Plane', 'Plane', ([], {}), '()\n', (224, 226), False, 'from plane import Plane\n'), ((667, 674), 'plane.Plane', 'Plane', ([], {}), '()\n', (672, 674), False, 'from plane import Plane\n'), ((929, 936), 'plane.Plane', 'Plane', ([], {}), '()\n', (934, 936), False, 'from plane import Plane\n'), ((1574,... |
import sqlite3
def sql_insert_now(sql_datensatz):
dsatz = sql_datensatz
vorname = dsatz[0]
nachname = dsatz[1]
gruppenleiter = dsatz[2]
bearbeitet = dsatz[3]
grund = dsatz[4]
abwesend_seit = dsatz[5]
gemeldet = dsatz[6]
gemeldet_time =dsatz[7]
meldepflicht = dsatz[8]
meldep... | [
"sqlite3.connect"
] | [((517, 562), 'sqlite3.connect', 'sqlite3.connect', (['"""datenbank/abwesenheiten.db"""'], {}), "('datenbank/abwesenheiten.db')\n", (532, 562), False, 'import sqlite3\n')] |