code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
from subsumed_architecture.states.implementations import MoveForward, AvoidCrash, LookForGoalLeft, \
LookForGoalLeftFull, LookForGoalRight, LookForGoalRightFull,\
LocateGoal, MoveToGoal, Stop, Loo... | [
"utils.movements.is_goal_close",
"utils.movements.is_obstacle_close"
] | [((468, 490), 'utils.movements.is_obstacle_close', 'is_obstacle_close', (['bot'], {}), '(bot)\n', (485, 490), False, 'from utils.movements import is_obstacle_close, is_goal_close\n'), ((623, 645), 'utils.movements.is_obstacle_close', 'is_obstacle_close', (['bot'], {}), '(bot)\n', (640, 645), False, 'from utils.movement... |
import sys
import argparse
from datetime import date
from .file_utils import get_index_file_URL, get_local_index_path, \
stream_download
this_year = date.today().year
INDEXED_YEARS = [str(i) for i in range(2011, this_year+1)]
def get_cli_index_parser():
parser = argparse.ArgumentParser("Irsreader")
parse... | [
"datetime.date.today",
"argparse.ArgumentParser"
] | [((154, 166), 'datetime.date.today', 'date.today', ([], {}), '()\n', (164, 166), False, 'from datetime import date\n'), ((274, 310), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (['"""Irsreader"""'], {}), "('Irsreader')\n", (297, 310), False, 'import argparse\n')] |
import json
from datetime import date, timedelta
from kitsune.dashboards.models import METRIC_CODE_CHOICES
from kitsune.dashboards.tests import WikiMetricFactory
from kitsune.products.tests import ProductFactory
from kitsune.sumo.templatetags.jinja_helpers import urlparams
from kitsune.sumo.tests import TestCase
from ... | [
"json.loads",
"kitsune.dashboards.tests.WikiMetricFactory",
"datetime.date.today",
"datetime.timedelta",
"kitsune.sumo.urlresolvers.reverse",
"kitsune.products.tests.ProductFactory"
] | [((499, 511), 'datetime.date.today', 'date.today', ([], {}), '()\n', (509, 511), False, 'from datetime import date, timedelta\n'), ((1476, 1488), 'datetime.date.today', 'date.today', ([], {}), '()\n', (1486, 1488), False, 'from datetime import date, timedelta\n'), ((1558, 1574), 'kitsune.products.tests.ProductFactory',... |
import os
import sys
import time
from threading import Thread
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtMultimedia import *
from PyQt5.QtWidgets import *
from module import Header, Mainlist, Navigation, PlayWidgets
class Window(QWidget):
def __init__(self):
super(Window, self).__... | [
"module.Mainlist",
"threading.Thread",
"module.Header",
"module.Navigation",
"module.PlayWidgets"
] | [((576, 588), 'module.Header', 'Header', (['self'], {}), '(self)\n', (582, 588), False, 'from module import Header, Mainlist, Navigation, PlayWidgets\n'), ((615, 631), 'module.Navigation', 'Navigation', (['self'], {}), '(self)\n', (625, 631), False, 'from module import Header, Mainlist, Navigation, PlayWidgets\n'), ((6... |
"""Provide a CLI for aiomysensors."""
import logging
import click
from aiomysensors import __version__
from .gateway_mqtt import mqtt_gateway
from .gateway_serial import serial_gateway
from .gateway_tcp import tcp_gateway
SETTINGS = dict(help_option_names=["-h", "--help"])
@click.group(
options_metavar="", su... | [
"click.version_option",
"click.group",
"click.option",
"logging.basicConfig"
] | [((281, 375), 'click.group', 'click.group', ([], {'options_metavar': '""""""', 'subcommand_metavar': '"""<command>"""', 'context_settings': 'SETTINGS'}), "(options_metavar='', subcommand_metavar='<command>',\n context_settings=SETTINGS)\n", (292, 375), False, 'import click\n'), ((379, 458), 'click.option', 'click.op... |
# This file is part of the Hotwire Shell user interface.
#
# Copyright (C) 2007 <NAME> <<EMAIL>>
#
# 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 yo... | [
"logging.getLogger"
] | [((998, 1038), 'logging.getLogger', 'logging.getLogger', (['"""hotwire.AboutDialog"""'], {}), "('hotwire.AboutDialog')\n", (1015, 1038), False, 'import os, sys, logging, StringIO, traceback\n')] |
"""
Extrude Rotation
~~~~~~~~~~~~~~~~
Sweep polygonal data creating "skirt" from free edges and lines, and
lines from vertices.
This takes polygonal data as input and generates polygonal data on
output. The input dataset is swept around the z-axis to create
new polygonal primitives. These primitives form a "skirt" or
... | [
"pyvista.PolyData",
"pyvista.Plotter",
"pyvista.Line"
] | [((526, 588), 'pyvista.Line', 'pyvista.Line', ([], {'pointa': '(0, 0, 0)', 'pointb': '(1, 0, 0)', 'resolution': '(2)'}), '(pointa=(0, 0, 0), pointb=(1, 0, 0), resolution=2)\n', (538, 588), False, 'import pyvista\n'), ((786, 815), 'pyvista.Plotter', 'pyvista.Plotter', ([], {'shape': '(2, 1)'}), '(shape=(2, 1))\n', (801,... |
import unittest
from katas.kyu_7.summing_a_numbers_digits import sumDigits
class SumDigitsTestCase(unittest.TestCase):
def test_equals(self):
self.assertEqual(sumDigits(10), 1)
def test_equals_2(self):
self.assertEqual(sumDigits(99), 18)
def test_equals_3(self):
self.assertEqual... | [
"katas.kyu_7.summing_a_numbers_digits.sumDigits"
] | [((174, 187), 'katas.kyu_7.summing_a_numbers_digits.sumDigits', 'sumDigits', (['(10)'], {}), '(10)\n', (183, 187), False, 'from katas.kyu_7.summing_a_numbers_digits import sumDigits\n'), ((247, 260), 'katas.kyu_7.summing_a_numbers_digits.sumDigits', 'sumDigits', (['(99)'], {}), '(99)\n', (256, 260), False, 'from katas.... |
# generated by appcreator
from django.contrib.auth.decorators import login_required
from django.core.exceptions import ObjectDoesNotExist
from django.utils.decorators import method_decorator
from django.urls import reverse_lazy
from django.views.generic.edit import DeleteView
from django.http import JsonResponse
from d... | [
"django.shortcuts.get_object_or_404",
"django.urls.reverse_lazy",
"django.utils.decorators.method_decorator",
"django.http.JsonResponse"
] | [((1441, 1473), 'django.utils.decorators.method_decorator', 'method_decorator', (['login_required'], {}), '(login_required)\n', (1457, 1473), False, 'from django.utils.decorators import method_decorator\n'), ((1678, 1710), 'django.utils.decorators.method_decorator', 'method_decorator', (['login_required'], {}), '(login... |
import tensorflow as tf
from tensorflow.python.framework import graph_util
sess = tf.InteractiveSession()
t1=tf.constant([1., 2.], dtype=tf.float32)
t2=tf.constant([3., 4.], dtype=tf.float32)
target = tf.concat([t1, t2], axis=0).eval()
print("=============[2],[2] axis=0 ==> [4]=========")
print(target)
#2,2,2,1
#t... | [
"tensorflow.gfile.FastGFile",
"tensorflow.concat",
"tensorflow.constant",
"tensorflow.python.framework.graph_util.convert_variables_to_constants",
"tensorflow.InteractiveSession"
] | [((83, 106), 'tensorflow.InteractiveSession', 'tf.InteractiveSession', ([], {}), '()\n', (104, 106), True, 'import tensorflow as tf\n'), ((111, 152), 'tensorflow.constant', 'tf.constant', (['[1.0, 2.0]'], {'dtype': 'tf.float32'}), '([1.0, 2.0], dtype=tf.float32)\n', (122, 152), True, 'import tensorflow as tf\n'), ((154... |
# Copyright (c) <NAME>, <NAME>
#
# All rights reserved.
#
# This code is licensed under the MIT 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 Software without restriction, including withou... | [
"pickle.dump",
"os.path.abspath",
"os.makedirs",
"os.path.basename",
"pickle.load",
"glob.glob",
"collections.OrderedDict",
"os.path.join"
] | [((1395, 1425), 'os.path.join', 'os.path.join', (['_assert_dir', 'key'], {}), '(_assert_dir, key)\n', (1407, 1425), False, 'import os\n'), ((1442, 1491), 'os.path.join', 'os.path.join', (['outpath', "(framework_name + '.pickle')"], {}), "(outpath, framework_name + '.pickle')\n", (1454, 1491), False, 'import os\n'), ((1... |
import asyncio
import pytest
from sanic_testing.testing import SanicTestClient
from sanic.blueprints import Blueprint
def test_routes_with_host(app):
@app.route("/", name="hostindex", host="example.com")
@app.route("/path", name="hostpath", host="path.example.com")
def index(request):
pass
... | [
"sanic_testing.testing.SanicTestClient",
"asyncio.Event",
"pytest.raises",
"pytest.mark.parametrize",
"sanic.blueprints.Blueprint"
] | [((2469, 2624), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""path,strict,expected"""', "(('/foo', False, '/foo'), ('/foo/', False, '/foo'), ('/foo', True, '/foo'),\n ('/foo/', True, '/foo/'))"], {}), "('path,strict,expected', (('/foo', False, '/foo'), (\n '/foo/', False, '/foo'), ('/foo', True, '/f... |
from sys import stdin
def sol():
N, M = map(int, stdin.readline().rstrip().split())
pokemon = {}
reverse_pokemon = {}
for i in range(N):
name = stdin.readline().rstrip()
pokemon[i + 1] = name
reverse_pokemon[name] = (i + 1)
for i in range(M):
user_input = stdin.read... | [
"sys.stdin.readline"
] | [((170, 186), 'sys.stdin.readline', 'stdin.readline', ([], {}), '()\n', (184, 186), False, 'from sys import stdin\n'), ((310, 326), 'sys.stdin.readline', 'stdin.readline', ([], {}), '()\n', (324, 326), False, 'from sys import stdin\n'), ((55, 71), 'sys.stdin.readline', 'stdin.readline', ([], {}), '()\n', (69, 71), Fals... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | [
"azure.cli.core.commands.client_factory.get_mgmt_service_client"
] | [((583, 632), 'azure.cli.core.commands.client_factory.get_mgmt_service_client', 'get_mgmt_service_client', (['ResourceManagementClient'], {}), '(ResourceManagementClient)\n', (606, 632), False, 'from azure.cli.core.commands.client_factory import get_mgmt_service_client\n'), ((794, 844), 'azure.cli.core.commands.client_... |
from __future__ import (absolute_import, division, print_function)
import unittest
class Factory(object):
_registry = {}
@classmethod
def factory(cls, class_name):
try:
return cls._registry[class_name]
except:
raise ValueError(
"Unknown class {} from factory {}".format(class_name... | [
"unittest.main"
] | [((1171, 1186), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1184, 1186), False, 'import unittest\n')] |
from tests.base.mixins import UserTestUtils, NailsTestUtils
from tests.base.tests import NailsProjectTestCase
from django.urls import reverse
class SingInViewTest(NailsTestUtils, UserTestUtils,NailsProjectTestCase):
def test_singInVieName_and_templateName(self):
response = self.client.get(reverse('sign i... | [
"django.urls.reverse"
] | [((305, 328), 'django.urls.reverse', 'reverse', (['"""sign in user"""'], {}), "('sign in user')\n", (312, 328), False, 'from django.urls import reverse\n'), ((668, 691), 'django.urls.reverse', 'reverse', (['"""sign in user"""'], {}), "('sign in user')\n", (675, 691), False, 'from django.urls import reverse\n'), ((1096,... |
#!/usr/bin/env python3
import logging
import socket
import sys
import time
# Don't freak out if pyserial isn't installed - unless they actually
# try to instantiate a SerialReader
try:
import serial
SERIAL_MODULE_FOUND = True
except ModuleNotFoundError:
SERIAL_MODULE_FOUND = False
sys.path.append('.')
from lo... | [
"sys.path.append",
"serial.Serial"
] | [((291, 311), 'sys.path.append', 'sys.path.append', (['"""."""'], {}), "('.')\n", (306, 311), False, 'import sys\n'), ((1365, 1629), 'serial.Serial', 'serial.Serial', ([], {'port': 'port', 'baudrate': 'baudrate', 'bytesize': 'bytesize', 'parity': 'parity', 'stopbits': 'stopbits', 'timeout': 'timeout', 'xonxoff': 'xonxo... |
import pytest
from app.integrations.s3 import AppS3
pytestmark = [pytest.mark.django_db]
def test_client_init():
client = AppS3().client
assert 'botocore.client.S3' in str(client.__class__)
| [
"app.integrations.s3.AppS3"
] | [((130, 137), 'app.integrations.s3.AppS3', 'AppS3', ([], {}), '()\n', (135, 137), False, 'from app.integrations.s3 import AppS3\n')] |
""" This file defines the PI2-based trajectory optimization method. """
import copy
import numpy as np
from gps.algorithm.algorithm import Algorithm
from gps.algorithm.config import ALG_PI2
class AlgorithmTrajOptPI2(Algorithm):
""" Sample-based trajectory optimization with PI2. """
def __init__(self, hyperpa... | [
"copy.deepcopy",
"gps.algorithm.algorithm.Algorithm.__init__"
] | [((344, 366), 'copy.deepcopy', 'copy.deepcopy', (['ALG_PI2'], {}), '(ALG_PI2)\n', (357, 366), False, 'import copy\n'), ((410, 442), 'gps.algorithm.algorithm.Algorithm.__init__', 'Algorithm.__init__', (['self', 'config'], {}), '(self, config)\n', (428, 442), False, 'from gps.algorithm.algorithm import Algorithm\n')] |
# -*- coding: utf-8 -*-
# Copyright 2021 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
"""
The Snmp_server parser templates file. This contains
a list of parser definitions a... | [
"re.compile"
] | [((11777, 11920), 're.compile', 're.compile', (['"""\n ^snmp-server\n (\\\\s+chassis-id\\\\s(?P<chassis_id>\\\\S+))\n $"""', 're.VERBOSE'], {}), '(\n """\n ^snmp-server\n (\\\\s+chassis-id\\\\s(?P<chassis_id>\\\\S+))\n $"""\n ... |
"""
distance.py
============
Contains class for distance measurement
"""
import math
from typing import Any, Tuple, Dict
from .point import TwoDimensionalPoint
from .abc import Measurement, Point, Standard, NullStandard
from ..globals import PointType
class Distance(Measurement):
"""Distance class that represe... | [
"math.sqrt"
] | [((1401, 1429), 'math.sqrt', 'math.sqrt', (['(dx ** 2 + dy ** 2)'], {}), '(dx ** 2 + dy ** 2)\n', (1410, 1429), False, 'import math\n')] |
# -*- coding: utf-8 -*-
'''
由于alfred-workflow 支持Python 2.6 and 2.7,请使用安装python2.7
感谢以下的项目,排名不分先后
execjs: https://github.com/doloopwhile/PyExecJS
workflow: https://github.com/deanishe/alfred-workflow
'''
import sys
import time
import urllib
from workflow import Workflow, web
from gen_tk import GenTK
reload(s... | [
"workflow.Workflow",
"time.sleep",
"sys.setdefaultencoding",
"gen_tk.GenTK",
"workflow.web.get"
] | [((324, 355), 'sys.setdefaultencoding', 'sys.setdefaultencoding', (['"""utf-8"""'], {}), "('utf-8')\n", (346, 355), False, 'import sys\n'), ((1003, 1010), 'gen_tk.GenTK', 'GenTK', ([], {}), '()\n', (1008, 1010), False, 'from gen_tk import GenTK\n'), ((1439, 1468), 'workflow.web.get', 'web.get', (['url'], {'headers': 'H... |
from bs4 import BeautifulSoup
import requests
URL_PREFIX = "https://sg.gymshack.com/search?q="
URL_PRODUCT_PREFIX = "https://sg.gymshack.com"
REPLACE_SPACE_STRING = "+"
def generate_url(search_str):
return URL_PREFIX + search_str.replace(" ", REPLACE_SPACE_STRING)
# The website uses a postfix to lead to their catal... | [
"bs4.BeautifulSoup"
] | [((689, 732), 'bs4.BeautifulSoup', 'BeautifulSoup', (['html_doc.text', '"""html.parser"""'], {}), "(html_doc.text, 'html.parser')\n", (702, 732), False, 'from bs4 import BeautifulSoup\n')] |
import os
import environ
import requests
import json
from .models import SentenceAnalysis, SubmissionAnalysis, CommentAnalysis, TagMeAnalysis, TagMeSentenceAnalysis
from scraper.models import Comments, Submission
from textblob import TextBlob
import time
from django.core.cache import cache
import re
env = environ.Env(... | [
"json.loads",
"os.path.dirname",
"environ.Env.read_env",
"textblob.TextBlob",
"environ.Env"
] | [((308, 321), 'environ.Env', 'environ.Env', ([], {}), '()\n', (319, 321), False, 'import environ\n'), ((398, 427), 'environ.Env.read_env', 'environ.Env.read_env', (['ENV_DIR'], {}), '(ENV_DIR)\n', (418, 427), False, 'import environ\n'), ((362, 387), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\... |
from __future__ import print_function
import logging
import re
import sys
from argparse import (
SUPPRESS,
Action,
_AppendAction,
_AppendConstAction,
_CountAction,
_HelpAction,
_StoreConstAction,
_VersionAction,
)
from collections import defaultdict
from functools import total_ordering
... | [
"string.Template",
"collections.defaultdict",
"setuptools_scm.get_version",
"logging.getLogger",
"re.compile"
] | [((767, 794), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (784, 794), False, 'import logging\n'), ((1352, 1382), 're.compile', 're.compile', (['"""([^\\\\w\\\\s.,()-])"""'], {}), "('([^\\\\w\\\\s.,()-])')\n", (1362, 1382), False, 'import re\n'), ((21366, 21383), 'collections.defaultdic... |
# -*- coding:utf-8 -*-
"""Strassen算法求矩阵乘法
"""
import numpy as np
def strassen(A, B):
"""Strassen算法求矩阵乘法
Args:
A(np.array): 矩阵1
B(np.array): 矩阵2
Return:
C(np.array): 矩阵乘法结果
"""
n, _ = A.shape
if n == 1:
C = np.array(A[0, 0] * B[0, 0])
return C
el... | [
"numpy.array",
"numpy.hstack"
] | [((1254, 1320), 'numpy.array', 'np.array', (['[[1, 2, 3, 4], [4, 3, 2, 1], [1, 3, 5, 7], [7, 5, 3, 1]]'], {}), '([[1, 2, 3, 4], [4, 3, 2, 1], [1, 3, 5, 7], [7, 5, 3, 1]])\n', (1262, 1320), True, 'import numpy as np\n'), ((1368, 1434), 'numpy.array', 'np.array', (['[[2, 4, 6, 8], [8, 6, 4, 2], [1, 2, 3, 4], [4, 3, 2, 1]... |
import random
userinput= input("Rock,paper, or scissors?")
game=["Rock","paper","scissors"]
try:
if userinput==game[0]:
print("Rock")
computer=random.choice(game)
print(computer)
elif userinput==game[1]:
print("paper")
computer=random.choice(game)
print(computer)... | [
"random.choice"
] | [((164, 183), 'random.choice', 'random.choice', (['game'], {}), '(game)\n', (177, 183), False, 'import random\n'), ((277, 296), 'random.choice', 'random.choice', (['game'], {}), '(game)\n', (290, 296), False, 'import random\n'), ((393, 412), 'random.choice', 'random.choice', (['game'], {}), '(game)\n', (406, 412), Fals... |
def combine_data(dict_in):
"""
Combine data from all cameras on the column 'frame'
This ensures data matches and is the same length
It will add the file name to the column names to distinguish from where the data came. So the file name needs to
contain the camera name (this will be how later fu... | [
"pandas.merge",
"pixel2world.convert_data.combine_data",
"os.path.split",
"os.path.join"
] | [((3199, 3219), 'pixel2world.convert_data.combine_data', 'combine_data', (['df_all'], {}), '(df_all)\n', (3211, 3219), False, 'from pixel2world.convert_data import combine_data\n'), ((5457, 5477), 'pixel2world.convert_data.combine_data', 'combine_data', (['df_all'], {}), '(df_all)\n', (5469, 5477), False, 'from pixel2w... |
from __future__ import absolute_import
from ggb.utils.image import GGBImage
from ggb.utils import ColorSpace, CVLib
from ggb.utils import ColorSpaceError, ComputerVisionLibraryError
import ggb.backend as B
import numpy as np
class GGB(GGBImage):
"""GGB color space converter.
:param image: image source eith... | [
"ggb.utils.ComputerVisionLibraryError",
"ggb.utils.ColorSpaceError"
] | [((708, 736), 'ggb.utils.ColorSpaceError', 'ColorSpaceError', (['input_color'], {}), '(input_color)\n', (723, 736), False, 'from ggb.utils import ColorSpaceError, ComputerVisionLibraryError\n'), ((885, 920), 'ggb.utils.ComputerVisionLibraryError', 'ComputerVisionLibraryError', (['backend'], {}), '(backend)\n', (911, 92... |
from __future__ import print_function
#import matplotlib
#matplotlib.use('agg')
import unittest
import sys
#from tempdir.tempfile_ import TemporaryDirectory
class Test_README_File(unittest.TestCase):
def test_first_line(self):
with open('README', 'r') as f:
first_line = f.readline()
... | [
"unittest.main",
"sys.exit"
] | [((655, 670), 'unittest.main', 'unittest.main', ([], {}), '()\n', (668, 670), False, 'import unittest\n'), ((506, 517), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (514, 517), False, 'import sys\n')] |
# Copyright 2018 The TensorFlow Probability Authors.
#
# 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 o... | [
"hypothesis.strategies.data",
"tensorflow_probability.python.internal.test_util.main",
"absl.testing.parameterized.parameters",
"time.sleep",
"tensorflow_probability.python.internal.hypothesis_testlib.tensors_in_support",
"numpy.isfinite",
"tensorflow_probability.python.internal.hypothesis_testlib.tfp_h... | [((1260, 1332), 'absl.testing.parameterized.parameters', 'parameterized.parameters', (['((support,) for support in tfp_hps.ALL_SUPPORTS)'], {}), '((support,) for support in tfp_hps.ALL_SUPPORTS)\n', (1284, 1332), False, 'from absl.testing import parameterized\n'), ((1360, 1385), 'tensorflow_probability.python.internal.... |
from collections import Counter
import itertools
def checksum(ids):
twos = 0
threes = 0
for box in ids:
counts = Counter(box)
if 2 in counts.values():
twos += 1
if 3 in counts.values():
threes += 1
return twos * threes
def find_boxes(ids):
for box1... | [
"itertools.combinations",
"collections.Counter",
"aocd.models.Puzzle"
] | [((330, 360), 'itertools.combinations', 'itertools.combinations', (['ids', '(2)'], {}), '(ids, 2)\n', (352, 360), False, 'import itertools\n'), ((803, 818), 'aocd.models.Puzzle', 'Puzzle', (['(2018)', '(2)'], {}), '(2018, 2)\n', (809, 818), False, 'from aocd.models import Puzzle\n'), ((135, 147), 'collections.Counter',... |
from odoo import models, fields
class AccountTaxWithholdingRule(models.Model):
_name = "account.tax.withholding.rule"
_description = "account.tax.withholding.rule"
_order = "sequence"
sequence = fields.Integer(
default=10,
)
# name = fields.Char(
# required=True,
# )
... | [
"odoo.fields.Integer",
"odoo.fields.Many2one",
"odoo.fields.Float",
"odoo.fields.Char"
] | [((214, 240), 'odoo.fields.Integer', 'fields.Integer', ([], {'default': '(10)'}), '(default=10)\n', (228, 240), False, 'from odoo import models, fields\n'), ((332, 428), 'odoo.fields.Char', 'fields.Char', ([], {'required': '(True)', 'default': '"""[]"""', 'help': '"""Write a domain over account voucher module"""'}), "(... |
import pandas as pd
import numpy as np
def append(target_df, df):
"""Append df to the end of target_df.
Intended to be used in a loop where you are appending multiple dataframes
together.
Parameters
----------
target_df : GeoDataFrame or DataFrame
May be none for the first append ope... | [
"numpy.concatenate"
] | [((1103, 1132), 'numpy.concatenate', 'np.concatenate', (['series.values'], {}), '(series.values)\n', (1117, 1132), True, 'import numpy as np\n')] |
from pathlib import Path
from datetime import datetime, timedelta
from user_sync.cache.base import CacheBase
from user_sync.cache.sign import SignCache
from sign_client.model import DetailedUserInfo, GroupInfo, UserGroupInfo, SettingsInfo
def test_init_no_store(tmp_path):
"""test CacheBase.init with non-existent ... | [
"sign_client.model.GroupInfo",
"sign_client.model.DetailedUserInfo",
"user_sync.cache.base.CacheBase",
"datetime.timedelta",
"user_sync.cache.sign.SignCache",
"datetime.datetime.now",
"sign_client.model.SettingsInfo"
] | [((389, 400), 'user_sync.cache.base.CacheBase', 'CacheBase', ([], {}), '()\n', (398, 400), False, 'from user_sync.cache.base import CacheBase\n'), ((903, 914), 'user_sync.cache.base.CacheBase', 'CacheBase', ([], {}), '()\n', (912, 914), False, 'from user_sync.cache.base import CacheBase\n'), ((1248, 1259), 'user_sync.c... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from setuptools import setup
from setuptools.command.test import test as TestCommand
readme = open('README.md').read()
history = open('HISTORY.md').read()
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
... | [
"setuptools.command.test.test.finalize_options",
"setuptools.setup",
"sys.exit",
"pytest.main"
] | [((591, 1674), 'setuptools.setup', 'setup', ([], {'name': '"""python-scrapyd-api"""', 'version': '"""2.1.2"""', 'description': '"""A Python wrapper for working with the Scrapyd API"""', 'keywords': '"""python-scrapyd-api scrapyd scrapy api wrapper"""', 'long_description': "(readme + '\\n\\n' + history)", 'long_descript... |
import numpy as np
import tensorflow as tf
from collections import deque
import random
from . import env
np.random.seed(1)
tf.set_random_seed(1)
def weight_variable(shape, name):
initial = tf.truncated_normal(shape, stddev=0.01)
return tf.Variable(initial, name=name)
def bias_variable(shape, name):
ini... | [
"numpy.random.seed",
"numpy.argmax",
"random.sample",
"tensorflow.reshape",
"tensorflow.train.AdamOptimizer",
"tensorflow.matmul",
"tensorflow.multiply",
"tensorflow.Variable",
"numpy.random.randint",
"tensorflow.nn.conv2d",
"tensorflow.truncated_normal",
"collections.deque",
"tensorflow.var... | [((106, 123), 'numpy.random.seed', 'np.random.seed', (['(1)'], {}), '(1)\n', (120, 123), True, 'import numpy as np\n'), ((124, 145), 'tensorflow.set_random_seed', 'tf.set_random_seed', (['(1)'], {}), '(1)\n', (142, 145), True, 'import tensorflow as tf\n'), ((196, 235), 'tensorflow.truncated_normal', 'tf.truncated_norma... |
import pandas as pd
import numpy as np
import glob
import os
import warnings
from joblib import wrap_non_picklable_objects
from ..util import get_unique_str_markers
def proc_fop(fop):
# If provided as just % number, divide by 100
if not isinstance(fop, tuple):
fop /= 100
return (fop, 1-fop)
... | [
"numpy.stack",
"numpy.save",
"numpy.argmax",
"joblib.wrap_non_picklable_objects",
"pandas.unique",
"pandas.Series",
"glob.glob",
"warnings.warn",
"numpy.unique"
] | [((6788, 6816), 'numpy.stack', 'np.stack', (['subj_data'], {'axis': '(-1)'}), '(subj_data, axis=-1)\n', (6796, 6816), True, 'import numpy as np\n'), ((7024, 7052), 'numpy.save', 'np.save', (['save_loc', 'subj_data'], {}), '(save_loc, subj_data)\n', (7031, 7052), True, 'import numpy as np\n'), ((1555, 1595), 'numpy.uniq... |
"""ProtoTorch components modules."""
import warnings
import torch
from prototorch.components.initializers import (ClassAwareInitializer,
ComponentsInitializer,
CustomLabelsInitializer,
... | [
"prototorch.components.initializers.UnequalLabelsInitializer",
"prototorch.components.initializers.EqualLabelsInitializer",
"prototorch.components.initializers.CustomLabelsInitializer",
"warnings.warn",
"prototorch.components.initializers.ZeroReasoningsInitializer",
"torch.nn.parameter.Parameter"
] | [((1900, 1922), 'torch.nn.parameter.Parameter', 'Parameter', (['_components'], {}), '(_components)\n', (1909, 1922), False, 'from torch.nn.parameter import Parameter\n'), ((5744, 5798), 'prototorch.components.initializers.ZeroReasoningsInitializer', 'ZeroReasoningsInitializer', (['num_classes', 'num_components'], {}), ... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import pandas as pd
import numpy as np
import ray
class DataFrame(object):
def __init__(self, df, columns):
"""Distributed DataFrame object backed by Pandas dataframes.
Args:
... | [
"ray.get",
"ray.put",
"pandas.concat"
] | [((52089, 52118), 'pandas.concat', 'pd.concat', (['df_rows'], {'axis': 'axis'}), '(df_rows, axis=axis)\n', (52098, 52118), True, 'import pandas as pd\n'), ((6174, 6193), 'ray.get', 'ray.get', (['partitions'], {}), '(partitions)\n', (6181, 6193), False, 'import ray\n'), ((53486, 53509), 'ray.put', 'ray.put', (['df[:chun... |
""" Advent of code 2021 day 21 / 1 """
import math
from os import path
import re
roll_cnt = 0
def det_dice():
val = -1
global roll_cnt
while True:
val += 1
roll_cnt += 1
val %= 100
yield val+1
class Player(object):
def __init__(self, pos, score):
self.pos = ... | [
"os.path.dirname",
"re.match",
"re.compile"
] | [((1194, 1247), 're.compile', 're.compile', (['"""Player (\\\\d+) starting position: (\\\\d+)"""'], {}), "('Player (\\\\d+) starting position: (\\\\d+)')\n", (1204, 1247), False, 'import re\n'), ((1325, 1348), 're.match', 're.match', (['pattern', 'line'], {}), '(pattern, line)\n', (1333, 1348), False, 'import re\n'), (... |
import innvestigate
import innvestigate.utils
import numpy as np
from sklearn.preprocessing import minmax_scale
def run_interpretation_methods(model, methods, data, X_train_blob=None, normalize=False, **kwargs):
"""This function applies all interpretation methods given in methods (as implemented in innvestigate) ... | [
"innvestigate.create_analyzer",
"innvestigate.utils.model_wo_softmax"
] | [((890, 932), 'innvestigate.utils.model_wo_softmax', 'innvestigate.utils.model_wo_softmax', (['model'], {}), '(model)\n', (925, 932), False, 'import innvestigate\n'), ((1042, 1101), 'innvestigate.create_analyzer', 'innvestigate.create_analyzer', (['method[0]', 'model'], {}), '(method[0], model, **method[1])\n', (1070, ... |
from db_connect import mongo_connect
from nltk.metrics import *
import queue
import threading
import random
import time
import json
import itertools
import pprint
debugging = False
dry_run = False
read_table = 'people_debug'
write_table = 'people_debug'
maxAllowedDistanceLevenshtein = 2
locked_documen... | [
"threading.Thread.__init__",
"json.load",
"db_connect.mongo_connect",
"random.shuffle",
"time.sleep",
"threading.Lock",
"pprint.PrettyPrinter",
"itertools.product",
"queue.Queue"
] | [((334, 364), 'pprint.PrettyPrinter', 'pprint.PrettyPrinter', ([], {'indent': '(2)'}), '(indent=2)\n', (354, 364), False, 'import pprint\n'), ((396, 411), 'db_connect.mongo_connect', 'mongo_connect', ([], {}), '()\n', (409, 411), False, 'from db_connect import mongo_connect\n'), ((2101, 2140), 'itertools.product', 'ite... |
import ast
import logging
import requests
import typing as tp
# set up logging
logging.basicConfig(
level=logging.INFO,
filename="agent.log",
format="%(asctime)s %(levelname)s: %(message)s"
)
def generate_short_url(config: tp.Dict[str, tp.Dict[str, tp.Any]]) -> tp.Tuple[tp.Any, tp.Any]:
"""
:para... | [
"logging.error",
"logging.debug",
"logging.basicConfig",
"logging.warning",
"requests.request"
] | [((80, 195), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO', 'filename': '"""agent.log"""', 'format': '"""%(asctime)s %(levelname)s: %(message)s"""'}), "(level=logging.INFO, filename='agent.log', format=\n '%(asctime)s %(levelname)s: %(message)s')\n", (99, 195), False, 'import logging\n'... |
import argparse
import os
from punctatools.lib.quantify import quantify_batch
from punctatools.lib.segment import segment_puncta_batch
from punctatools.lib.utils import load_parameters, save_parameters
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('-p', '--parameter-file', ... | [
"os.makedirs",
"os.path.join",
"argparse.ArgumentParser",
"punctatools.lib.segment.segment_puncta_batch"
] | [((244, 269), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (267, 269), False, 'import argparse\n'), ((1370, 1418), 'os.makedirs', 'os.makedirs', (["kwargs['output_dir']"], {'exist_ok': '(True)'}), "(kwargs['output_dir'], exist_ok=True)\n", (1381, 1418), False, 'import os\n'), ((1922, 1978), '... |
'''
AUTHOR : <NAME>.
CAPSTONE 2: BUILDING A SMART QUEUE SYSTEM.
INTEL(R) EDGE AI FOR IOT DEVELOPERS NANODEGREE.
QUEUE SYSTEM AND INFERENCE MODULE.
'''
import numpy as np
import time
from openvino.inference_engine import IECore
import os
import cv2
import argparse
import sys, traceback
class Queue:
'''
Class f... | [
"numpy.load",
"cv2.putText",
"argparse.ArgumentParser",
"numpy.copy",
"openvino.inference_engine.IECore",
"cv2.VideoWriter_fourcc",
"traceback.print_tb",
"time.time",
"cv2.VideoCapture",
"cv2.rectangle",
"sys.exc_info",
"traceback.print_exception",
"cv2.destroyAllWindows",
"os.path.join",
... | [((3695, 3706), 'time.time', 'time.time', ([], {}), '()\n', (3704, 3706), False, 'import time\n'), ((4673, 4684), 'time.time', 'time.time', ([], {}), '()\n', (4682, 4684), False, 'import time\n'), ((6406, 6431), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (6429, 6431), False, 'import argpars... |
# -*- encoding: utf-8 -*-
from django.db import models
from django.contrib.gis.db import models as gismodels
from .Meet import Meet
class MeetExternalLinks(models.Model):
name = models.CharField(
blank=False,
null=False,
max_length=75,
primary_key=False
)
url = models.URL... | [
"django.db.models.CharField",
"django.db.models.URLField",
"django.db.models.ForeignKey"
] | [((185, 260), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(False)', 'null': '(False)', 'max_length': '(75)', 'primary_key': '(False)'}), '(blank=False, null=False, max_length=75, primary_key=False)\n', (201, 260), False, 'from django.db import models\n'), ((310, 369), 'django.db.models.URLField', ... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2013 The Plaso Project Authors.
# Please see the AUTHORS file for details on individual authors.
#
# 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 L... | [
"unittest.main",
"plaso.lib.timelib_test.CopyStringToTimestamp",
"plaso.parsers.mactime.MactimeParser"
] | [((3692, 3707), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3705, 3707), False, 'import unittest\n'), ((1168, 1191), 'plaso.parsers.mactime.MactimeParser', 'mactime.MactimeParser', ([], {}), '()\n', (1189, 1191), False, 'from plaso.parsers import mactime\n'), ((2109, 2173), 'plaso.lib.timelib_test.CopyStringTo... |
#!/usr/bin/env python
from .debug import Debug
from .utility import HtmlUtils
from .exception import LogicError
"""
"""
class Variable(object):
private = '_private_attrs_'
public = '_public_attrs_'
private_esc = '_private_attrs_esc_'
public_esc = '_public_attrs_esc_'
public_keys = '_public_keys_... | [
"io.StringIO",
"re.sub"
] | [((32717, 32727), 'io.StringIO', 'StringIO', ([], {}), '()\n', (32725, 32727), False, 'from io import StringIO\n'), ((9462, 9492), 're.sub', 'sub', (['"""@"""', '"""@"""', 'help_str'], {}), "('@', '@', help_str)\n", (9465, 9492), False, 'from re import sub\n')] |
import unittest
from leetcode.common import TreeNode
class Solution:
"""
This solution recursively traverses the tree and returns
False when it encounters a node with a value which differs
from the root value. If the node does not differ in value then
the algorithm returns the validity of both it... | [
"leetcode.common.TreeNode"
] | [((963, 974), 'leetcode.common.TreeNode', 'TreeNode', (['(1)'], {}), '(1)\n', (971, 974), False, 'from leetcode.common import TreeNode\n'), ((995, 1006), 'leetcode.common.TreeNode', 'TreeNode', (['(1)'], {}), '(1)\n', (1003, 1006), False, 'from leetcode.common import TreeNode\n'), ((1028, 1039), 'leetcode.common.TreeNo... |
from typing import List
from functools import lru_cache
import numpy as np
import matplotlib.pyplot as plt
from metaflow import Flow, Run
def _tokenize_full_text(texts, tokenizer):
"""Tokenize texts without truncation."""
return tokenizer(texts, padding=True, truncation=False, return_tensors="np")
def token... | [
"metaflow.Flow",
"numpy.random.RandomState",
"numpy.max",
"numpy.array",
"matplotlib.pyplot.subplots"
] | [((1044, 1059), 'numpy.max', 'np.max', (['lengths'], {}), '(lengths)\n', (1050, 1059), True, 'import numpy as np\n'), ((1125, 1139), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (1137, 1139), True, 'import matplotlib.pyplot as plt\n'), ((1629, 1656), 'numpy.random.RandomState', 'np.random.RandomState... |
import numpy as np
import pylab as pl
import matplotlib as mpl
mpl.rcParams['text.usetex'] = True
# Optionally, you can import packages
mpl.rcParams['text.latex.preamble'] = r'\usepackage{{amsmath}}\usepackage{{amsfonts}}'
mainpath = '/data/pt_02015/human_test_data_deconvolution_08088.b3/tp0/mrtrix/'
prob_int... | [
"pylab.close",
"numpy.load",
"pylab.title",
"pylab.imshow",
"pylab.xticks",
"pylab.savefig",
"pylab.yticks",
"pylab.colorbar",
"pylab.figure",
"numpy.eye",
"numpy.log10"
] | [((326, 396), 'numpy.load', 'np.load', (["(mainpath + 'tc_step_0p5_theta_90_th_0p20_npv_50_seed_int.npy')"], {}), "(mainpath + 'tc_step_0p5_theta_90_th_0p20_npv_50_seed_int.npy')\n", (333, 396), True, 'import numpy as np\n'), ((409, 464), 'numpy.load', 'np.load', (["(mainpath + 'graph_mat_cone60_com2com_prob.npy')"], {... |
import core
def core_test():
print(core.add(101, 210))
def test():
print("test called")
def test1():
print("test called") | [
"core.add"
] | [((38, 56), 'core.add', 'core.add', (['(101)', '(210)'], {}), '(101, 210)\n', (46, 56), False, 'import core\n')] |
# [main]
import os
import re
import gc
import joblib
import time
from glob import glob
from tqdm.auto import tqdm
import pandas as pd
# [snorkel]
from snorkel.labeling.model import LabelModel
from snorkel.labeling import PandasLFApplier, LFAnalysis, filter_unlabeled_dataframe
from snorkel.utils import probs_to_preds
... | [
"sklearn.feature_extraction.text.CountVectorizer",
"os.makedirs",
"snorkel.labeling.filter_unlabeled_dataframe",
"os.path.join",
"snorkel.labeling.LFAnalysis",
"sklearn.metrics.classification_report",
"time.time",
"snorkel.labeling.model.LabelModel",
"sklearn.linear_model.LogisticRegression",
"sno... | [((535, 546), 'time.time', 'time.time', ([], {}), '()\n', (544, 546), False, 'import time\n'), ((1077, 1115), 'os.makedirs', 'os.makedirs', (['output_dir'], {'exist_ok': '(True)'}), '(output_dir, exist_ok=True)\n', (1088, 1115), False, 'import os\n'), ((1127, 1140), 'src.labeling_functions.get_all_lfs', 'get_all_lfs', ... |
# -*- coding: utf-8 -*-
__author__ = "Yuchen"
__aim__ = 'rank top sentences in one topic'
__testCase__ = "../test/test_sentenceRanking.py"
import argparse
import numpy as np
# from Processing import process,synonyms
import Processing
from sentSimilarity import Rouge
import operator
from tfidf_contentWords import loadD... | [
"Processing.synonyms",
"argparse.ArgumentParser",
"numpy.array",
"Processing.process",
"numpy.row_stack",
"numpy.column_stack",
"operator.itemgetter",
"numpy.delete"
] | [((1526, 1551), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1549, 1551), False, 'import argparse\n'), ((1893, 1907), 'numpy.array', 'np.array', (['list'], {}), '(list)\n', (1901, 1907), True, 'import numpy as np\n'), ((1919, 1950), 'numpy.column_stack', 'np.column_stack', (['(data, column)'... |
import os
def update_directory(dir):
"""
Updates the particular directory from github. Assumes that the directory is under git version control.
"""
print('Updating {dir}...'.format(dir=dir))
os.chdir(dir)
status = 1
tries = 0
# Keep trying to git pull until success, or until tries = 30
... | [
"os.system",
"os.chdir"
] | [((997, 1039), 'os.chdir', 'os.chdir', (['"""/home/pi/github/tikicam-config"""'], {}), "('/home/pi/github/tikicam-config')\n", (1005, 1039), False, 'import os\n'), ((1040, 1125), 'os.system', 'os.system', (['"""sudo cp wpa_supplicant.conf /etc/wpa_supplicant/wpa_supplicant.conf"""'], {}), "('sudo cp wpa_supplicant.conf... |
"""
This module provides automata that model certain aspects of the Collatz problem.
"""
# Imports
from abc import ABC, abstractmethod
import random
class AbstractStateMachine(ABC):
"""
This abstract base class represents a finite state machine that models Collatz numbers.
Every state machine derived fro... | [
"random.sample"
] | [((2239, 2267), 'random.sample', 'random.sample', (['sequence'], {'k': '(1)'}), '(sequence, k=1)\n', (2252, 2267), False, 'import random\n')] |
"""Climate platform that offers a climate device for the TFIAC protocol."""
from concurrent import futures
from datetime import timedelta
import logging
import voluptuous as vol
from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateDevice
from homeassistant.components.climate.const import (
STATE_A... | [
"pytfiac.Tfiac",
"voluptuous.Required",
"datetime.timedelta",
"logging.getLogger"
] | [((637, 658), 'datetime.timedelta', 'timedelta', ([], {'seconds': '(60)'}), '(seconds=60)\n', (646, 658), False, 'from datetime import timedelta\n'), ((757, 784), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (774, 784), False, 'import logging\n'), ((1510, 1534), 'pytfiac.Tfiac', 'Tfiac'... |
"""
The MIT License (MIT)
Copyright (c) 2020 James
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publis... | [
"typing.TypeVar",
"datetime.datetime.strptime",
"datetime.datetime.utcfromtimestamp",
"re.search"
] | [((1566, 1578), 'typing.TypeVar', 'TypeVar', (['"""T"""'], {}), "('T')\n", (1573, 1578), False, 'from typing import TYPE_CHECKING, Any, Optional, TypeVar, overload\n'), ((10496, 10536), 'datetime.datetime.utcfromtimestamp', 'datetime.utcfromtimestamp', (["data['added']"], {}), "(data['added'])\n", (10521, 10536), False... |
#!/usr/bin/env python
# coding=utf-8
# aeneas is a Python/C library and a set of tools
# to automagically synchronize audio and text (aka forced alignment)
#
# Copyright (C) 2012-2013, <NAME> (www.albertopettarin.it)
# Copyright (C) 2013-2015, ReadBeyond Srl (www.readbeyond.it)
# Copyright (C) 2015-2017, <NAME> (www... | [
"aeneas.globalfunctions.file_name_without_extension",
"aeneas.plotter.PlotTimeScale",
"aeneas.audiofile.AudioFile",
"aeneas.plotter.Plotter",
"aeneas.globalfunctions.file_extension",
"aeneas.plotter.PlotWaveform",
"aeneas.syncmap.SyncMap",
"aeneas.plotter.PlotLabelset",
"aeneas.globalfunctions.relat... | [((1467, 1510), 'aeneas.globalfunctions.relative_path', 'gf.relative_path', (['"""res/audio.mp3"""', '__file__'], {}), "('res/audio.mp3', __file__)\n", (1483, 1510), True, 'import aeneas.globalfunctions as gf\n'), ((1526, 1570), 'aeneas.globalfunctions.relative_path', 'gf.relative_path', (['"""res/sonnet.vad"""', '__fi... |
from setuptools import setup, find_packages
setup(
name='muto',
version=__import__('muto').__version__,
description='Server and corresponding client library for ImageMagick-based image manipulation and conversion',
author='<NAME>',
author_email='<EMAIL>',
url='http://github.com/philippbosch/mut... | [
"setuptools.find_packages"
] | [((337, 352), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (350, 352), False, 'from setuptools import setup, find_packages\n')] |
import os
import shutil
import pickle
from torch import nn
import torch
import pandas as pd
import random
import numpy as np
from torch.utils.data import Dataset
from torch.utils.data import DataLoader
from torch.cuda.amp import autocast,GradScaler
from sklearn.model_selection import KFold
from sklearn.preprocessing i... | [
"torch.nn.Dropout",
"sklearn.preprocessing.StandardScaler",
"numpy.random.random_sample",
"numpy.argmax",
"pandas.read_csv",
"torch.argmax",
"random.sample",
"numpy.mean",
"pickle.load",
"shutil.rmtree",
"torch.no_grad",
"os.path.join",
"pandas.DataFrame",
"torch.cuda.amp.autocast",
"tor... | [((580, 601), 'torch.nn.ReLU', 'nn.ReLU', ([], {'inplace': '(True)'}), '(inplace=True)\n', (587, 601), False, 'from torch import nn\n'), ((613, 633), 'torch.nn.ELU', 'nn.ELU', ([], {'inplace': '(True)'}), '(inplace=True)\n', (619, 633), False, 'from torch import nn\n'), ((651, 677), 'torch.nn.LeakyReLU', 'nn.LeakyReLU'... |
##################################################
## Set relative file paths ##
import csv
import sys
import os
import numpy as np
import json
absFilePath = os.path.abspath(__file__)
fileDir = os.path.dirname(os.path.abspath(__file__))
parentDir = os.path.dirname(fileDir)
newPath = os.path.join(parentDir, 'core')
s... | [
"sys.path.append",
"os.path.abspath",
"csv.writer",
"sco2_cycle_ssc.C_sco2_sim",
"os.path.dirname",
"sco2_plots.plot_udpc_results",
"os.path.join"
] | [((160, 185), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (175, 185), False, 'import os\n'), ((251, 275), 'os.path.dirname', 'os.path.dirname', (['fileDir'], {}), '(fileDir)\n', (266, 275), False, 'import os\n'), ((286, 317), 'os.path.join', 'os.path.join', (['parentDir', '"""core"""'], {}... |
import tkinter as tk
from tkinter import ttk
from tksupport import LabelInput as LI
class loginwindow(tk.Tk):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.title("Login")
# self.geometry("300x200")
self.resizable(width=False, height=False)
logi... | [
"tkinter.StringVar",
"tkinter.ttk.Checkbutton",
"tkinter.LabelFrame",
"tkinter.ttk.Button"
] | [((589, 636), 'tkinter.LabelFrame', 'tk.LabelFrame', (['self'], {'text': '"""Account Information"""'}), "(self, text='Account Information')\n", (602, 636), True, 'import tkinter as tk\n'), ((1090, 1129), 'tkinter.ttk.Checkbutton', 'ttk.Checkbutton', (['self'], {'text': '"""Save Info"""'}), "(self, text='Save Info')\n",... |
import os
import random
if __name__ == "__main__":
cwd = os.getcwd()
## create train id.txt
trainimgfolder = os.path.join(cwd, 'myLIP/train/train_img')
trainimglist = os.listdir(trainimgfolder)
trainimglistfilter = [item for item in trainimglist if item.endswith('.jpg')]
trainid = os.path.joi... | [
"os.getcwd",
"random.random",
"os.path.join",
"os.listdir"
] | [((63, 74), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (72, 74), False, 'import os\n'), ((123, 165), 'os.path.join', 'os.path.join', (['cwd', '"""myLIP/train/train_img"""'], {}), "(cwd, 'myLIP/train/train_img')\n", (135, 165), False, 'import os\n'), ((185, 211), 'os.listdir', 'os.listdir', (['trainimgfolder'], {}), '(... |
import re
import shutil
import sys
import subprocess
from pathlib import Path
from typing import Optional
from loguru import logger
from pydantic import BaseModel, BaseSettings, DirectoryPath
from fastapi import FastAPI
class Settings(BaseSettings):
base_dir: Optional[DirectoryPath]
class Command(BaseModel):
... | [
"subprocess.run",
"loguru.logger.error",
"shutil.which",
"loguru.logger.info",
"loguru.logger.debug",
"re.search",
"sys.exit",
"fastapi.FastAPI"
] | [((567, 576), 'fastapi.FastAPI', 'FastAPI', ([], {}), '()\n', (574, 576), False, 'from fastapi import FastAPI\n'), ((842, 886), 'loguru.logger.info', 'logger.info', (['f"""Received command={command!r}"""'], {}), "(f'Received command={command!r}')\n", (853, 886), False, 'from loguru import logger\n'), ((933, 984), 're.s... |
from typing import List, Dict
from packaging import version
from cloudrail.knowledge.context.aws.aws_environment_context import AwsEnvironmentContext
from cloudrail.knowledge.rules.aws.aws_base_rule import AwsBaseRule
from cloudrail.knowledge.rules.base_rule import Issue
from cloudrail.knowledge.rules.rule_parameters... | [
"packaging.version.parse"
] | [((1595, 1621), 'packaging.version.parse', 'version.parse', (['version_num'], {}), '(version_num)\n', (1608, 1621), False, 'from packaging import version\n'), ((1624, 1649), 'packaging.version.parse', 'version.parse', (['"""1.2.2019"""'], {}), "('1.2.2019')\n", (1637, 1649), False, 'from packaging import version\n')] |
import numpy as np
import capytaine as cpt
vert = np.array([0.0, 0.0, -1.0,
1.0, 0.0, -1.0,
1.0, 1.0, -1.0,
0.0, 1.0, -1.0,
1.0, 0.0, -1.0,
2.0, 0.0, -1.0,
2.0, 1.0, -1.0,
1.0, 1.0, -1.0]).reshape((8,... | [
"capytaine.Mesh",
"capytaine.Delhommeau",
"numpy.array",
"numpy.arange"
] | [((370, 391), 'capytaine.Mesh', 'cpt.Mesh', (['vert', 'faces'], {}), '(vert, faces)\n', (378, 391), True, 'import capytaine as cpt\n'), ((51, 194), 'numpy.array', 'np.array', (['[0.0, 0.0, -1.0, 1.0, 0.0, -1.0, 1.0, 1.0, -1.0, 0.0, 1.0, -1.0, 1.0, 0.0, \n -1.0, 2.0, 0.0, -1.0, 2.0, 1.0, -1.0, 1.0, 1.0, -1.0]'], {}),... |
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2022 Scipp contributors (https://github.com/scipp)
# @author <NAME>
import numpy as np
import scipp as sc
def make_variables():
data = np.arange(1, 4, dtype=float)
a = sc.Variable(dims=['x'], values=data)
b = sc.Variable(dims=['x'], values=data)
... | [
"scipp.Dataset",
"scipp.ones_like",
"scipp.scalar",
"scipp.Variable",
"scipp.identical",
"scipp.zeros_like",
"numpy.arange",
"numpy.array_equal",
"scipp.arange"
] | [((198, 226), 'numpy.arange', 'np.arange', (['(1)', '(4)'], {'dtype': 'float'}), '(1, 4, dtype=float)\n', (207, 226), True, 'import numpy as np\n'), ((235, 271), 'scipp.Variable', 'sc.Variable', ([], {'dims': "['x']", 'values': 'data'}), "(dims=['x'], values=data)\n", (246, 271), True, 'import scipp as sc\n'), ((280, 3... |
#!/usr/bin/env python3
import json
import sys
import yaml
sys.stdout.write( json.dumps( yaml.safe_load( sys.stdin ), indent=4, sort_keys=True ) )
| [
"yaml.safe_load"
] | [((89, 114), 'yaml.safe_load', 'yaml.safe_load', (['sys.stdin'], {}), '(sys.stdin)\n', (103, 114), False, 'import yaml\n')] |
import json
from ees.model import CheckpointCalc, Response
class FetchGlobalChangesetsHandler:
def __init__(self, db):
self.db = db
self.checkpoint_calc = CheckpointCalc()
self.default_limit=10
def execute(self, cmd):
limit = cmd.limit or self.default_limit
cha... | [
"ees.model.Response",
"ees.model.CheckpointCalc"
] | [((176, 192), 'ees.model.CheckpointCalc', 'CheckpointCalc', ([], {}), '()\n', (190, 192), False, 'from ees.model import CheckpointCalc, Response\n'), ((882, 1026), 'ees.model.Response', 'Response', ([], {'http_status': '(200)', 'body': "{'checkpoint': cmd.checkpoint, 'limit': limit, 'changesets': changesets,\n 'next... |
#!/usr/bin/python3
import iutils
def main():
iutils.init()
ip = input('[ ip / host ] : ')
port = input('[ port ] : ')
print('[*] Generating pdf ...')
iutils.generate_pdf(ip, port)
print('[+] success : readme.pdf')
print('[+] starting listener ...')
iutils.start_listener(ip, port)
main()
| [
"iutils.generate_pdf",
"iutils.start_listener",
"iutils.init"
] | [((48, 61), 'iutils.init', 'iutils.init', ([], {}), '()\n', (59, 61), False, 'import iutils\n'), ((157, 186), 'iutils.generate_pdf', 'iutils.generate_pdf', (['ip', 'port'], {}), '(ip, port)\n', (176, 186), False, 'import iutils\n'), ((259, 290), 'iutils.start_listener', 'iutils.start_listener', (['ip', 'port'], {}), '(... |
import socket
class Communication:
ip = "" #"192.168.178.55"
#ip = "10.0.0.5"
udpBuffer = 2048
def __init__(self, name):
print("Init Communication %s" % name)
def getPortForDrive(self):
return 5001
def getPortForSteer(self):
return 5002
d... | [
"socket.socket"
] | [((649, 697), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_DGRAM'], {}), '(socket.AF_INET, socket.SOCK_DGRAM)\n', (662, 697), False, 'import socket\n')] |
import fileinput
import re
lists = [['fileListGetter.py', 'fileListGetter', ['directory', '_nsns'], [], 'def fileListGetter(directory, _nsns): """ Function to get list of files and language types Inputs: directory: Stirng containing path to search for files in. Outputs: List of Lists. Lists are of form... | [
"re.escape"
] | [((1399, 1418), 're.escape', 're.escape', (['function'], {}), '(function)\n', (1408, 1418), False, 'import re\n'), ((1499, 1518), 're.escape', 're.escape', (['function'], {}), '(function)\n', (1508, 1518), False, 'import re\n'), ((1665, 1684), 're.escape', 're.escape', (['function'], {}), '(function)\n', (1674, 1684), ... |
from numpy import zeros, swapaxes, sign
from ....Methods.Machine.Winding import WindingError
from swat_em import datamodel
def comp_connection_mat(self, Zs=None, p=None):
"""Compute the Winding Matrix for
Parameters
----------
self : Winding
A: Winding object
Zs : int
Number of ... | [
"numpy.zeros",
"numpy.swapaxes",
"swat_em.datamodel",
"numpy.sign"
] | [((1676, 1687), 'swat_em.datamodel', 'datamodel', ([], {}), '()\n', (1685, 1687), False, 'from swat_em import datamodel\n'), ((1852, 1878), 'numpy.zeros', 'zeros', (['(Nlayer, 1, Zs, qs)'], {}), '((Nlayer, 1, Zs, qs))\n', (1857, 1878), False, 'from numpy import zeros, swapaxes, sign\n'), ((2855, 2879), 'numpy.swapaxes'... |
"""
Kernel orthogonal matching pursuit for changepoint detection.
Fast but approximate.
"""
from itertools import product
import numpy as np
from ruptures.utils import pairwise
class OmpK:
"""Contient l'algorithme de parcours des partitions."""
def __init__(self, min_size=2, jump=5):
"""One lin... | [
"numpy.zeros",
"numpy.diag",
"numpy.arange",
"numpy.argmax"
] | [((1204, 1236), 'numpy.arange', 'np.arange', (['(1)', '(self.n_samples + 1)'], {}), '(1, self.n_samples + 1)\n', (1213, 1236), True, 'import numpy as np\n'), ((2255, 2280), 'numpy.zeros', 'np.zeros', (['self.gram.shape'], {}), '(self.gram.shape)\n', (2263, 2280), True, 'import numpy as np\n'), ((1630, 1652), 'numpy.arg... |
import numpy as np
# --------------------------- line-search ---------------------------
def wolfe(func, grad, xk, alpha, pk):
c1 = 1e-4
return func(xk + alpha * pk) <= func(xk) + c1 * alpha * np.dot(grad(xk), pk)
def strong_wolfe(func, grad, xk, alpha, pk, c2):
return wolfe(func, grad, xk, alpha, pk) ... | [
"numpy.outer",
"numpy.zeros_like",
"numpy.zeros",
"numpy.identity",
"numpy.ones",
"numpy.mean",
"numpy.array",
"numpy.linalg.norm",
"numpy.inner",
"numpy.random.rand",
"numpy.eye",
"numpy.linalg.solve"
] | [((4042, 4055), 'numpy.zeros', 'np.zeros', (['m_t'], {}), '(m_t)\n', (4050, 4055), True, 'import numpy as np\n'), ((4064, 4077), 'numpy.zeros', 'np.zeros', (['m_t'], {}), '(m_t)\n', (4072, 4077), True, 'import numpy as np\n'), ((4591, 4611), 'numpy.identity', 'np.identity', (['xk.size'], {}), '(xk.size)\n', (4602, 4611... |
# Copyright 2016 Brocade Communications Systems, Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or ... | [
"sys.exit"
] | [((1084, 1096), 'sys.exit', 'sys.exit', (['(-1)'], {}), '(-1)\n', (1092, 1096), False, 'import sys\n')] |
import os
import pickle
import matplotlib.pyplot as plt
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from scipy.io import loadmat
from torch import optim
from torch.autograd import Variable
from torch.optim.lr_scheduler import StepLR
from torchvision import models
from dataset... | [
"pickle.dump",
"torch.optim.lr_scheduler.StepLR",
"numpy.random.seed",
"torch.sqrt",
"torch.cat",
"torch.nn.init.constant_",
"torch.device",
"torch.no_grad",
"torch.nn.MSELoss",
"torchvision.models.vgg16",
"torch.manual_seed",
"torch.nn.Conv2d",
"torch.cuda.manual_seed",
"torch.nn.function... | [((694, 719), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (717, 719), False, 'import torch\n'), ((729, 772), 'torch.device', 'torch.device', (["('cuda' if use_cuda else 'cpu')"], {}), "('cuda' if use_cuda else 'cpu')\n", (741, 772), False, 'import torch\n'), ((833, 848), 'datasets.load_datas... |
from app import create_app
application = create_app('production')
# To Be used by a WSGI Server like Gunicorn
| [
"app.create_app"
] | [((42, 66), 'app.create_app', 'create_app', (['"""production"""'], {}), "('production')\n", (52, 66), False, 'from app import create_app\n')] |
from flask import request, jsonify, abort
import json
import sqlite3
from . import sqlite as db
from . import utilities as ut
from . import auth
@auth.request_is_authenticated
def tables(context):
conn = db.get_db(context['sqlitepath'])
if request.method == 'GET':
tables = db.get_tables(conn)
... | [
"flask.jsonify",
"flask.abort",
"json.loads"
] | [((335, 350), 'flask.jsonify', 'jsonify', (['tables'], {}), '(tables)\n', (342, 350), False, 'from flask import request, jsonify, abort\n'), ((400, 424), 'json.loads', 'json.loads', (['request.data'], {}), '(request.data)\n', (410, 424), False, 'import json\n'), ((2130, 2140), 'flask.abort', 'abort', (['(404)'], {}), '... |
import sys
import pygame as pg
from module.setting import *
from module.Actor import *
from pygame.locals import *
import random
import math
def main():
clock = pg.time.Clock()
pg.init()
screen = pg.display.set_mode(data["size"])
pg.display.set_caption("game window")
screen.fill((20, 0, 40))
act = []
... | [
"pygame.quit",
"pygame.event.get",
"pygame.display.set_mode",
"pygame.init",
"pygame.display.update",
"pygame.display.set_caption",
"pygame.time.Clock"
] | [((164, 179), 'pygame.time.Clock', 'pg.time.Clock', ([], {}), '()\n', (177, 179), True, 'import pygame as pg\n'), ((185, 194), 'pygame.init', 'pg.init', ([], {}), '()\n', (192, 194), True, 'import pygame as pg\n'), ((206, 239), 'pygame.display.set_mode', 'pg.display.set_mode', (["data['size']"], {}), "(data['size'])\n"... |
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 22 18:28:46 2021
@author: katie
"""
# import library
import random
import operator
import matplotlib.pyplot
num_of_agents = 10
num_of_iterations = 100
# create empty list called agents
agents = []
# Set up Variables(y,x) on random 100x100 grid. as many as num of agent... | [
"random.random",
"operator.itemgetter",
"random.randint"
] | [((1478, 1500), 'operator.itemgetter', 'operator.itemgetter', (['(1)'], {}), '(1)\n', (1497, 1500), False, 'import operator\n'), ((372, 393), 'random.randint', 'random.randint', (['(0)', '(99)'], {}), '(0, 99)\n', (386, 393), False, 'import random\n'), ((394, 415), 'random.randint', 'random.randint', (['(0)', '(99)'], ... |
from pyxb.exceptions_ import *
import unittest
import pyxb.binding.datatypes as xsd
class Test_IDREFS (unittest.TestCase):
def testBasicLists (self):
v = xsd.IDREFS([ "one", "two", "three" ])
self.assertEqual(3, len(v))
self.assertTrue(isinstance(v[0], xsd.IDREF))
self.assertEqual("... | [
"unittest.main",
"pyxb.binding.datatypes.IDREFS"
] | [((643, 658), 'unittest.main', 'unittest.main', ([], {}), '()\n', (656, 658), False, 'import unittest\n'), ((167, 202), 'pyxb.binding.datatypes.IDREFS', 'xsd.IDREFS', (["['one', 'two', 'three']"], {}), "(['one', 'two', 'three'])\n", (177, 202), True, 'import pyxb.binding.datatypes as xsd\n'), ((377, 404), 'pyxb.binding... |
# -*- coding: utf-8 -*-
from unordered_pair import upair
class Transition:
def __init__(self, pre, post):
self._pre = upair(pre)
self._post = upair(post)
self._preset = frozenset(self._pre)
self._postset = frozenset(self._post)
@property
def pre(self):
retur... | [
"unordered_pair.upair"
] | [((135, 145), 'unordered_pair.upair', 'upair', (['pre'], {}), '(pre)\n', (140, 145), False, 'from unordered_pair import upair\n'), ((170, 181), 'unordered_pair.upair', 'upair', (['post'], {}), '(post)\n', (175, 181), False, 'from unordered_pair import upair\n')] |
"""
The :mod:`usbinfo` module provides methods for gathering information from the
USB subsystem. The :func:`usbinfo` function, for example, returns a list
of all USB endpoints in the system and information pertaining to each device.
For example::
import usbinfo
usbinfo.usbinfo()
might return something like t... | [
"platform.system"
] | [((3678, 3695), 'platform.system', 'platform.system', ([], {}), '()\n', (3693, 3695), False, 'import platform\n')] |
#!/usr/bin/env python3
'''
WatchdogAction.py
--------------
Copyright 2016 <NAME>
'''
from watchdog.events import PatternMatchingEventHandler
from watchdog.observers import Observer
from flows.Actions.Action import Action
from flows.Actions.Action import ActionInput
import flows.Global
class DannyFileSystemEventHa... | [
"flows.Actions.Action.ActionInput",
"watchdog.observers.Observer"
] | [((3159, 3181), 'watchdog.observers.Observer', 'Observer', (['self.timeout'], {}), '(self.timeout)\n', (3167, 3181), False, 'from watchdog.observers import Observer\n'), ((3606, 3639), 'flows.Actions.Action.ActionInput', 'ActionInput', (['event', '""""""', 'self.name'], {}), "(event, '', self.name)\n", (3617, 3639), Fa... |
# _*_ coding: utf-8 _*_
__author__ = '<NAME>'
__date__ = '1/1/2018 2:05 PM'
from sklearn.datasets import load_iris
from sklearn.cross_validation import cross_val_score
from sklearn.neighbors import KNeighborsClassifier
from sklearn.cross_validation import train_test_split
import matplotlib.pyplot as plt
iris = load_... | [
"sklearn.datasets.load_iris",
"sklearn.cross_validation.train_test_split",
"sklearn.cross_validation.cross_val_score",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"sklearn.neighbors.KNeighborsClassifier",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel"
] | [((315, 326), 'sklearn.datasets.load_iris', 'load_iris', ([], {}), '()\n', (324, 326), False, 'from sklearn.datasets import load_iris\n'), ((389, 427), 'sklearn.cross_validation.train_test_split', 'train_test_split', (['x', 'y'], {'random_state': '(4)'}), '(x, y, random_state=4)\n', (405, 427), False, 'from sklearn.cro... |
# fieldz/tfbuffer.py
import ctypes
import sys
import wireops.chan
from wireops.enum import FieldTypes, PrimTypes
from wireops.raw import(
read_field_hdr,
# read_raw_varint, write_raw_varint,
read_raw_b32, # write_b32_field,
read_raw_b64, # write_b64_field,
read_raw_len_plus, ... | [
"wireops.raw.read_raw_b64",
"ctypes.c_int32",
"wireops.raw.read_raw_b256",
"wireops.raw.read_raw_b160",
"wireops.raw.read_raw_b128",
"ctypes.c_int64",
"wireops.raw.read_raw_b32",
"sys.stdout.flush",
"wireops.raw.read_raw_len_plus",
"fieldz.FieldzError",
"ctypes.c_uint64",
"ctypes.c_uint32",
... | [((2252, 2272), 'wireops.raw.read_field_hdr', 'read_field_hdr', (['self'], {}), '(self)\n', (2266, 2272), False, 'from wireops.raw import read_field_hdr, read_raw_b32, read_raw_b64, read_raw_len_plus, read_raw_b128, read_raw_b160, read_raw_b256\n'), ((7783, 7801), 'sys.stdout.flush', 'sys.stdout.flush', ([], {}), '()\n... |
from braintree.attribute_getter import AttributeGetter
class FundingDetails(AttributeGetter):
detail_list = [
"account_holder_name",
"bic",
"currency_iso_code",
"descriptor",
"iban",
]
def __init__(self, attributes):
AttributeGetter.__init__(self, attributes... | [
"braintree.attribute_getter.AttributeGetter.__init__"
] | [((279, 321), 'braintree.attribute_getter.AttributeGetter.__init__', 'AttributeGetter.__init__', (['self', 'attributes'], {}), '(self, attributes)\n', (303, 321), False, 'from braintree.attribute_getter import AttributeGetter\n')] |
import gym
import universe
env = gym.make('flashgames.CoasterRacer-v0')
observation_n = env.reset()
while True:
action_n = [[('KeyEvent', 'ArrowUp', True)] for o in observation_n]
observation_n, reward_n, done_n, info = env.step(action_n)
env.render()
| [
"gym.make"
] | [((34, 72), 'gym.make', 'gym.make', (['"""flashgames.CoasterRacer-v0"""'], {}), "('flashgames.CoasterRacer-v0')\n", (42, 72), False, 'import gym\n')] |
"""UNet architecture."""
import math
import tensorflow as tf
from ._networks import OPTIONS_CONV
from ._networks import conv_block
from ._networks import inception_block
from ._networks import residual_block
from ._networks import squeeze_block
from ._networks import upconv_block
def __block(inputs, filters, block... | [
"tensorflow.keras.layers.SpatialDropout2D",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.layers.Concatenate",
"tensorflow.keras.Model",
"tensorflow.keras.layers.Activation",
"tensorflow.keras.layers.MaxPool2D",
"tensorflow.keras.layers.Input",
"math.log",
"tensorflow.keras.regularizers.l2"
] | [((2176, 2220), 'tensorflow.keras.layers.Input', 'tf.keras.layers.Input', ([], {'shape': '(None, None, 1)'}), '(shape=(None, None, 1))\n', (2197, 2220), True, 'import tensorflow as tf\n'), ((3031, 3071), 'tensorflow.keras.Model', 'tf.keras.Model', ([], {'inputs': 'inputs', 'outputs': 'x'}), '(inputs=inputs, outputs=x)\... |
from pathlib import Path
import pandas as pd
from fuzzywuzzy import fuzz
import time
import numpy as np
pd.set_option('display.max_columns', None)
pd.set_option('display.max_rows', None)
def main():
# start time of function
start_time = time.time()
# project directory
project_dir = str(Path(__file__)... | [
"fuzzywuzzy.fuzz.partial_ratio",
"pandas.read_csv",
"time.time",
"pathlib.Path",
"pandas.isna",
"pandas.set_option"
] | [((105, 147), 'pandas.set_option', 'pd.set_option', (['"""display.max_columns"""', 'None'], {}), "('display.max_columns', None)\n", (118, 147), True, 'import pandas as pd\n'), ((148, 187), 'pandas.set_option', 'pd.set_option', (['"""display.max_rows"""', 'None'], {}), "('display.max_rows', None)\n", (161, 187), True, '... |
# Generated by Django 2.1.5 on 2019-01-28 00:50
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('configurations', '0014_merge_20190126_1723'),
]
operations = [
migrations.AddField(
model_name='d3mconfiguration',
n... | [
"django.db.models.TextField"
] | [((359, 454), 'django.db.models.TextField', 'models.TextField', ([], {'blank': '(True)', 'help_text': '"""Added in 2019 config."""', 'verbose_name': '"""D3MINPUTDIR"""'}), "(blank=True, help_text='Added in 2019 config.',\n verbose_name='D3MINPUTDIR')\n", (375, 454), False, 'from django.db import migrations, models\n... |
#!/usr/bin/env python
import wx
from wx.lib.splitter import MultiSplitterWindow
#----------------------------------------------------------------------
class SamplePane(wx.Panel):
"""
Just a simple test window to put into the splitter.
"""
def __init__(self, parent, colour, label):
wx.Panel._... | [
"wx.Panel.__init__",
"wx.BoxSizer",
"os.path.basename",
"wx.CheckBox",
"wx.lib.splitter.MultiSplitterWindow",
"wx.StaticText",
"wx.Button",
"wx.RadioBox"
] | [((310, 365), 'wx.Panel.__init__', 'wx.Panel.__init__', (['self', 'parent'], {'style': 'wx.BORDER_SUNKEN'}), '(self, parent, style=wx.BORDER_SUNKEN)\n', (327, 365), False, 'import wx\n'), ((415, 453), 'wx.StaticText', 'wx.StaticText', (['self', '(-1)', 'label', '(5, 5)'], {}), '(self, -1, label, (5, 5))\n', (428, 453),... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# signals.py - <NAME> (<EMAIL>) - Jan 2017
'''
Contains functions to deal with masking and removing periodic signals in light
curves.
'''
#############
## LOGGING ##
#############
import logging
from astrobase import log_sub, log_fmt, log_date_fmt
DEBUG = False
if DEB... | [
"matplotlib.pyplot.title",
"numpy.abs",
"numpy.floor",
"logging.getLogger",
"numpy.argsort",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.tight_layout",
"os.path.abspath",
"matplotlib.pyplot.close",
"numpy.median",
"numpy.min",
"matplotlib.use",
"matplotlib.pyplo... | [((390, 417), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (407, 417), False, 'import logging\n'), ((418, 508), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'level', 'style': 'log_sub', 'format': 'log_fmt', 'datefmt': 'log_date_fmt'}), '(level=level, style=log_sub, forma... |
import numpy as np
import signal_processing as sp
import numpy.ma as ma
import datetime as dt
"""
mel 2018-04-20
Translates RMS results for all files to minimum / mean / maximum and filters out zeros in the minimum.
Filters out only weekday results between 6:00 and 18:00 hours.
"""
# dir_path = "C:\\Users\... | [
"numpy.savetxt",
"datetime.date",
"datetime.datetime",
"numpy.ma.array",
"signal_processing.OneThird_octave",
"datetime.timedelta",
"numpy.loadtxt",
"datetime.time",
"numpy.ma.masked_less",
"signal_processing.obtain_files"
] | [((513, 538), 'signal_processing.obtain_files', 'sp.obtain_files', (['dir_path'], {}), '(dir_path)\n', (528, 538), True, 'import signal_processing as sp\n'), ((2149, 2208), 'signal_processing.OneThird_octave', 'sp.OneThird_octave', (['(0.625 / 2 ** (1 / 3))', '(80 * 2 ** (1 / 3))'], {}), '(0.625 / 2 ** (1 / 3), 80 * 2 ... |
import unittest
from dojo import criar_fita, main, pinta_fita
class DojoTest(unittest.TestCase):
def test_main(self):
self.assertEqual(main(4, [1]), 3)
def test_main_outro(self):
self.assertEqual(main(13, [2, 3, 6]), 3)
def test_main_outro(self):
self.assertEqual(main(10, [9, 10]... | [
"unittest.main",
"dojo.main",
"dojo.criar_fita",
"dojo.pinta_fita"
] | [((1288, 1303), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1301, 1303), False, 'import unittest\n'), ((149, 161), 'dojo.main', 'main', (['(4)', '[1]'], {}), '(4, [1])\n', (153, 161), False, 'from dojo import criar_fita, main, pinta_fita\n'), ((223, 242), 'dojo.main', 'main', (['(13)', '[2, 3, 6]'], {}), '(13,... |
import torch
import numpy as np
from torch.autograd import Variable
import halp.utils.utils
from halp.utils.utils import single_to_half_det, single_to_half_stoc
from halp.models.logistic_regression import LogisticRegression
from unittest import TestCase
class LeNetTest(TestCase):
def test_logistic_regression_gra... | [
"halp.models.logistic_regression.LogisticRegression",
"torch.sum",
"numpy.array",
"numpy.random.normal"
] | [((560, 646), 'halp.models.logistic_regression.LogisticRegression', 'LogisticRegression', ([], {'input_dim': 'n_dim', 'n_class': 'n_class', 'reg_lambda': '(100.0)', 'dtype': '"""fp"""'}), "(input_dim=n_dim, n_class=n_class, reg_lambda=100.0,\n dtype='fp')\n", (578, 646), False, 'from halp.models.logistic_regression ... |
import setuptools
with open("README.rst", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="yamlreader",
version="3.0.5",
author="<NAME>, <NAME>",
author_email="<EMAIL>",
description="Merge YAML data from given files, dir or file glob",
long_description=long_description,
... | [
"setuptools.find_packages"
] | [((463, 489), 'setuptools.find_packages', 'setuptools.find_packages', ([], {}), '()\n', (487, 489), False, 'import setuptools\n')] |