code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import os
import runpy
import subprocess
from setuptools import setup, find_packages
def get_version_from_pyfile(version_file="gitlab_registry_cleanup/_version.py"):
file_globals = runpy.run_path(version_file)
return file_globals["__version__"]
def get_install_requires_from_requirements(requirements_filenam... | [
"os.remove",
"subprocess.check_call",
"os.path.basename",
"logging.warning",
"os.path.isfile",
"runpy.run_path",
"setuptools.find_packages"
] | [((187, 215), 'runpy.run_path', 'runpy.run_path', (['version_file'], {}), '(version_file)\n', (201, 215), False, 'import runpy\n'), ((1194, 1222), 'os.path.isfile', 'os.path.isfile', (['rst_filename'], {}), '(rst_filename)\n', (1208, 1222), False, 'import os\n'), ((827, 855), 'os.path.isfile', 'os.path.isfile', (['rst_... |
import pandas as pd
from datetime import datetime as dt
def validade(df):
result = []
hoje = dt.now()
list_of_etapas_access = ['ANÁLISE TÉCNICA',
'ANÁLISE TECNICA - CGCEB',
'ANÁLISE TECNICA - CCEB',
'EM DILIGÊNCIA',
... | [
"pandas.read_excel",
"datetime.datetime.now",
"pandas.DataFrame"
] | [((3218, 3261), 'pandas.read_excel', 'pd.read_excel', (['"""input/processos_cebas.xlsx"""'], {}), "('input/processos_cebas.xlsx')\n", (3231, 3261), True, 'import pandas as pd\n'), ((104, 112), 'datetime.datetime.now', 'dt.now', ([], {}), '()\n', (110, 112), True, 'from datetime import datetime as dt\n'), ((3171, 3189),... |
#!/usr/bin/python
# -*- encoding: utf-8 -*-
import os
import psutil
import pyexcel as pe
from pyexcel_io.exceptions import IntegerAccuracyLossError
from nose import SkipTest
from nose.tools import eq_, raises
IN_TRAVIS = "TRAVIS" in os.environ
def test_issue_10():
test_file_name = "test_issue_10.ods"
from ... | [
"psutil.Process",
"pyexcel.get_book",
"pyexcel.get_sheet",
"os.unlink",
"os.path.join",
"nose.SkipTest",
"pyexcel_ods3.save_data",
"os.path.exists",
"nose.tools.eq_",
"pyexcel.iget_array",
"nose.tools.raises",
"pyexcel.Sheet",
"pyexcel.free_resources"
] | [((2606, 2638), 'nose.tools.raises', 'raises', (['IntegerAccuracyLossError'], {}), '(IntegerAccuracyLossError)\n', (2612, 2638), False, 'from nose.tools import eq_, raises\n'), ((388, 422), 'pyexcel_ods3.save_data', 'save_data', (['test_file_name', 'content'], {}), '(test_file_name, content)\n', (397, 422), False, 'fro... |
# -*- coding: utf-8 -*-
import os
from simmate.conftest import copy_test_files
from simmate.calculators.vasp.inputs import Incar
from simmate.calculators.vasp.error_handlers import Unconverged
def test_unconverged_electronic(tmpdir):
copy_test_files(
tmpdir,
test_directory=__file__,
test... | [
"os.remove",
"simmate.conftest.copy_test_files",
"simmate.calculators.vasp.inputs.Incar.from_file",
"simmate.calculators.vasp.error_handlers.Unconverged",
"os.path.join"
] | [((242, 333), 'simmate.conftest.copy_test_files', 'copy_test_files', (['tmpdir'], {'test_directory': '__file__', 'test_folder': '"""unconverged_electronic"""'}), "(tmpdir, test_directory=__file__, test_folder=\n 'unconverged_electronic')\n", (257, 333), False, 'from simmate.conftest import copy_test_files\n'), ((460... |
from tests.unit.dataactcore.factories.staging import DetachedAwardFinancialAssistanceFactory
from tests.unit.dataactvalidator.utils import number_of_errors, query_columns
from dataactcore.models.domainModels import Zips
_FILE = 'fabs41_detached_award_financial_assistance_3'
def test_column_headers(database):
exp... | [
"tests.unit.dataactvalidator.utils.number_of_errors",
"tests.unit.dataactcore.factories.staging.DetachedAwardFinancialAssistanceFactory",
"dataactcore.models.domainModels.Zips",
"tests.unit.dataactvalidator.utils.query_columns"
] | [((801, 862), 'dataactcore.models.domainModels.Zips', 'Zips', ([], {'zip5': '"""12345"""', 'zip_last4': '"""6789"""', 'state_abbreviation': '"""NY"""'}), "(zip5='12345', zip_last4='6789', state_abbreviation='NY')\n", (805, 862), False, 'from dataactcore.models.domainModels import Zips\n'), ((911, 1022), 'tests.unit.dat... |
# processing the SA2 and road shapefiles
# inputs: raw SA2 and road shapefiles
# Outputs: Adelaide SA2 nodal and link dataframes with transport information
# Outputs are pickles:
# sa2_node_with_only_transport_attributes.pickle
# sa2_edge_with_only_transport_attributes.pickle
# Processin... | [
"sys.path.append",
"pysal.lib.weights.distance.Kernel.from_dataframe",
"pickle.dump",
"pandas.DataFrame",
"numpy.sum",
"utilities.compute_intersection_attributes",
"os.getcwd",
"utilities.compute_road_attributes",
"pandas.MultiIndex.from_product",
"shapely.geometry.LineString",
"geopandas.GeoDat... | [((841, 870), 'sys.path.append', 'sys.path.append', (['utility_path'], {}), '(utility_path)\n', (856, 870), False, 'import sys\n'), ((1279, 1333), 'geopandas.read_file', 'gpd.read_file', (["(raw_data_path + 'sa2/SA2_2016_AUST.shp')"], {}), "(raw_data_path + 'sa2/SA2_2016_AUST.shp')\n", (1292, 1333), True, 'import geopa... |
from unittest import mock, TestCase
from typing import List, Dict
import numpy as np
from runeq import Config, stream, errors
def mock_get_json_response(
bodies: List[dict],
calls: List,
status_code=200,
headers: List[Dict[str, str]] = None
):
"""Return a function that can be use... | [
"unittest.mock.MagicMock",
"runeq.Config",
"unittest.mock.patch",
"runeq.stream.V1Client",
"unittest.mock.call"
] | [((2690, 2728), 'unittest.mock.patch', 'mock.patch', (['"""runeq.stream.v1.requests"""'], {}), "('runeq.stream.v1.requests')\n", (2700, 2728), False, 'from unittest import mock, TestCase\n'), ((4077, 4115), 'unittest.mock.patch', 'mock.patch', (['"""runeq.stream.v1.requests"""'], {}), "('runeq.stream.v1.requests')\n", ... |
import unittest
from project.service.dockerfile_service import DockerfileParser, DockerfileService
class Dockerfile_Service_Test(unittest.TestCase):
def test_given_a_dockerfile_when_parse_then_instructions_are_parsed(self):
parser = DockerfileParser('test/resources/Dockerfile_basic')
instruction... | [
"unittest.main",
"project.service.dockerfile_service.DockerfileService.check_and_fix_dockerfile",
"project.service.dockerfile_service.DockerfileService.check_dockerfile",
"project.service.dockerfile_service.DockerfileService.evaluate_dockerfile",
"project.service.dockerfile_service.DockerfileService.get_doc... | [((5737, 5752), 'unittest.main', 'unittest.main', ([], {}), '()\n', (5750, 5752), False, 'import unittest\n'), ((249, 300), 'project.service.dockerfile_service.DockerfileParser', 'DockerfileParser', (['"""test/resources/Dockerfile_basic"""'], {}), "('test/resources/Dockerfile_basic')\n", (265, 300), False, 'from projec... |
import pytest
from cuml.dask.datasets.blobs import make_blobs
from cuml.dask.common.part_utils import _extract_partitions
from dask.distributed import Client
import dask.array as da
import cupy as cp
@pytest.mark.mg
@pytest.mark.parametrize("nrows", [1e4])
@pytest.mark.parametrize("ncols", [10])
@pytest.mark.parametr... | [
"dask.distributed.Client",
"cuml.dask.datasets.blobs.make_blobs",
"cupy.random.standard_normal",
"dask.array.from_array",
"pytest.mark.parametrize"
] | [((219, 262), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""nrows"""', '[10000.0]'], {}), "('nrows', [10000.0])\n", (242, 262), False, 'import pytest\n'), ((260, 298), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""ncols"""', '[10]'], {}), "('ncols', [10])\n", (283, 298), False, 'import pytes... |
import config_with_yaml as config
class Config:
""" Base class for reading configuration parameters from config file. """
def __init__(self, filename='modules/config.yaml'):
""" Instance constructor
:param filename: configuration file (string)
"""
# Read config par... | [
"config_with_yaml.load"
] | [((368, 389), 'config_with_yaml.load', 'config.load', (['filename'], {}), '(filename)\n', (379, 389), True, 'import config_with_yaml as config\n')] |
from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class AddressConfig(AppConfig):
label = 'address'
name = 'oscar.apps.address'
verbose_name = _('Address')
| [
"django.utils.translation.gettext_lazy"
] | [((196, 208), 'django.utils.translation.gettext_lazy', '_', (['"""Address"""'], {}), "('Address')\n", (197, 208), True, 'from django.utils.translation import gettext_lazy as _\n')] |
#
import pytest
from aspect.core.engines.Engine import Engine
@pytest.fixture
def engine():
return Engine()
def test_engine_instantiation(engine):
assert engine.target == "PythonMemoryModel"
def test_engine_get_operation(engine):
with pytest.raises(NotImplementedError):
engine.get_operation("com... | [
"pytest.raises",
"aspect.core.engines.Engine.Engine"
] | [((105, 113), 'aspect.core.engines.Engine.Engine', 'Engine', ([], {}), '()\n', (111, 113), False, 'from aspect.core.engines.Engine import Engine\n'), ((251, 285), 'pytest.raises', 'pytest.raises', (['NotImplementedError'], {}), '(NotImplementedError)\n', (264, 285), False, 'import pytest\n')] |
import scrapy
import json
import urllib.parse
import re
from scrapy import http
from scrapy_splash import SplashRequest
paper_without_doi = 0
total_paper_count = 0
class IeeeSpider(scrapy.Spider):
name = "ieee"
custom_settings = {'ROBOTSTXT_OBEY': True}
def start_requests(self):
url = 'http://ie... | [
"scrapy_splash.SplashRequest",
"re.search",
"json.dumps"
] | [((3188, 3254), 'scrapy_splash.SplashRequest', 'SplashRequest', (['link', 'self.parse_each_paper'], {'endpoint': '"""render.html"""'}), "(link, self.parse_each_paper, endpoint='render.html')\n", (3201, 3254), False, 'from scrapy_splash import SplashRequest\n'), ((3556, 3589), 're.search', 're.search', (['"""[0-9]+"""',... |
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | [
"upvote.gae.lib.exemption.monitoring.expired_exemptions.Set",
"upvote.gae.lib.exemption.monitoring.requested_exemptions.Set",
"upvote.gae.lib.exemption.notify.SendExpirationEmail",
"logging.info",
"datetime.datetime.utcnow",
"upvote.gae.datastore.models.exemption.Exemption.query",
"google.appengine.ext.... | [((2290, 2501), 'upvote.gae.datastore.models.exemption.Exemption.query', 'exemption_models.Exemption.query', (['(exemption_models.Exemption.state == EXEMPTION_STATE.APPROVED)', '(exemption_models.Exemption.deactivation_dt >= start_dt)', '(exemption_models.Exemption.deactivation_dt < end_dt)'], {}), '(exemption_models.E... |
from ledgerblue.comm import getDongle
import struct
import algosdk
from algosdk.future import transaction
import base64
import os
import sys
import inspect
import nacl.signing
from Cryptodome.Hash import SHA256
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.pat... | [
"Cryptodome.Hash.SHA256.new",
"algosdk.future.transaction.ApplicationCreateTxn",
"test.txn_utils.sign_algo_txn",
"os.path.dirname",
"sys.path.insert",
"algosdk.future.transaction.StateSchema",
"struct.pack",
"algosdk.encoding.msgpack_encode",
"algosdk.future.transaction.SuggestedParams",
"inspect.... | [((314, 341), 'os.path.dirname', 'os.path.dirname', (['currentdir'], {}), '(currentdir)\n', (329, 341), False, 'import os\n'), ((342, 371), 'sys.path.insert', 'sys.path.insert', (['(0)', 'parentdir'], {}), '(0, parentdir)\n', (357, 371), False, 'import sys\n'), ((1889, 1939), 'algosdk.future.transaction.StateSchema', '... |
#!/usr/bin/env python3
import sys
import os
import shutil
sys.path.append('_setup/model')
from model import *
import korali
# Creating Experiment List
eList = []
for i in range(5):
e = korali.Experiment()
data = getReferenceData("_setup/data/", i)
N = len(data)
e["Problem"]["Type"] = "Bayesian/Reference"
e... | [
"sys.path.append",
"korali.Engine",
"korali.Experiment"
] | [((58, 89), 'sys.path.append', 'sys.path.append', (['"""_setup/model"""'], {}), "('_setup/model')\n", (73, 89), False, 'import sys\n'), ((1484, 1499), 'korali.Engine', 'korali.Engine', ([], {}), '()\n', (1497, 1499), False, 'import korali\n'), ((188, 207), 'korali.Experiment', 'korali.Experiment', ([], {}), '()\n', (20... |
import os
import pathlib
import time
import logging
import datetime
from dotenv import load_dotenv
import pandas as pd
import requests
load_dotenv()
TOKEN = os.getenv("TELEGRAM_TOKEN")
IVANSKA_ID = os.getenv("IVANSKA_ID")
NARA_ID = os.getenv("NARA_ID")
LOC1 = os.getenv("LOC1")
LOC2 = os.getenv("LOC2")
LOCC = os.geten... | [
"datetime.datetime.today",
"logging.basicConfig",
"pandas.read_xml",
"datetime.datetime",
"dotenv.load_dotenv",
"pathlib.Path",
"datetime.timedelta",
"requests.get",
"pandas.concat",
"os.getenv",
"logging.getLogger"
] | [((137, 150), 'dotenv.load_dotenv', 'load_dotenv', ([], {}), '()\n', (148, 150), False, 'from dotenv import load_dotenv\n'), ((159, 186), 'os.getenv', 'os.getenv', (['"""TELEGRAM_TOKEN"""'], {}), "('TELEGRAM_TOKEN')\n", (168, 186), False, 'import os\n'), ((200, 223), 'os.getenv', 'os.getenv', (['"""IVANSKA_ID"""'], {})... |
from unittest import TestCase, main
from unittest.mock import patch
from pyrarcrack import generate_combinations
class TestCombination(TestCase):
def test_should_generate_minimal_combination(self):
self.assertEqual(
list(generate_combinations('a', 1)),
['a']
)
... | [
"unittest.main",
"pyrarcrack.generate_combinations"
] | [((356, 362), 'unittest.main', 'main', ([], {}), '()\n', (360, 362), False, 'from unittest import TestCase, main\n'), ((257, 286), 'pyrarcrack.generate_combinations', 'generate_combinations', (['"""a"""', '(1)'], {}), "('a', 1)\n", (278, 286), False, 'from pyrarcrack import generate_combinations\n')] |
"""GOEA and report generation w/bonferroni multiple test corrections from statsmodels.
python test_goea_rpt_bonferroni.py
python test_goea_rpt_bonferroni.py [LOG FILENAME]
"""
__copyright__ = "Copyright (C) 2016-2017, <NAME>, <NAME>. All rights reserved."
__author__ = "<NAME>"
import os
import sys
f... | [
"os.getcwd",
"goatools.go_enrichment.GOEnrichmentStudy",
"os.path.abspath",
"os.path.join"
] | [((3768, 3846), 'goatools.go_enrichment.GOEnrichmentStudy', 'GOEnrichmentStudy', (['popul_ids', 'assoc', 'godag'], {'alpha': '(0.05)', 'methods': "['bonferroni']"}), "(popul_ids, assoc, godag, alpha=0.05, methods=['bonferroni'])\n", (3785, 3846), False, 'from goatools.go_enrichment import GOEnrichmentStudy\n'), ((497, ... |
# -*- coding: UTF-8 -*-
################################################################################
#
# Copyright (c) 2018 Baidu.com, Inc. All Rights Reserved
#
################################################################################
"""
**client** 模块提供对第三方组件操作的统一抽象,规范化智能运维机器人与外部系统交互的方式
* ``BaseClient`` 提... | [
"json.loads",
"ark.are.log.d",
"httplib.HTTPConnection",
"ark.are.config.GuardianConfig.get",
"json.dumps",
"time.sleep"
] | [((4552, 4595), 'ark.are.config.GuardianConfig.get', 'config.GuardianConfig.get', (['self.ARK_ES_HOST'], {}), '(self.ARK_ES_HOST)\n', (4577, 4595), False, 'from ark.are import config\n'), ((4122, 4142), 'json.loads', 'json.loads', (['res_data'], {}), '(res_data)\n', (4132, 4142), False, 'import json\n'), ((4622, 4665),... |
"""
Django middleware for generating request flame graphs.
Requires the flamegraph.pl perl script:
https://github.com/brendangregg/FlameGraph/blob/master/flamegraph.pl
Installation:
1. Create a directory for flame graphs
2. Copy the flamegraph.pl script to it
3. Add the FLAMES_DIR django setting
4. Add the flames.Flam... | [
"threading.Thread",
"os.path.abspath",
"os.getcwd",
"time.clock",
"traceback.extract_stack",
"time.time",
"datetime.datetime.now",
"subprocess.call",
"threading.Event",
"xml.dom.minidom.Text",
"sys._current_frames",
"threading.current_thread",
"os.path.join"
] | [((785, 821), 'os.path.abspath', 'os.path.abspath', (['settings.FLAMES_DIR'], {}), '(settings.FLAMES_DIR)\n', (800, 821), False, 'import os\n'), ((847, 888), 'os.path.join', 'os.path.join', (['FLAMES_DIR', '"""flamegraph.pl"""'], {}), "(FLAMES_DIR, 'flamegraph.pl')\n", (859, 888), False, 'import os\n'), ((1927, 1933), ... |
"""
This module contains test cases for API endpoints.
"""
import unittest
from pay_ir.api.client import PayIrClient
class PayIrAPITestCase(unittest.TestCase):
def __init__(self, *args, **kwargs):
unittest.TestCase.__init__(self, *args, **kwargs)
def setUp(self):
self.client = PayIrCli... | [
"unittest.TestCase.__init__",
"pay_ir.api.client.PayIrClient"
] | [((217, 266), 'unittest.TestCase.__init__', 'unittest.TestCase.__init__', (['self', '*args'], {}), '(self, *args, **kwargs)\n', (243, 266), False, 'import unittest\n'), ((312, 331), 'pay_ir.api.client.PayIrClient', 'PayIrClient', (['"""test"""'], {}), "('test')\n", (323, 331), False, 'from pay_ir.api.client import PayI... |
from __future__ import unicode_literals, absolute_import, print_function
import calendar
from decimal import Decimal
import random
import datetime
import uuid
import mock
from django.conf import settings
from django.core.management import call_command
from dimagi.utils.dates import add_months
from dimagi.utils.data i... | [
"corehq.apps.accounting.models.BillingContactInfo.objects.all",
"dimagi.utils.data.generator.arbitrary_firstname",
"corehq.apps.accounting.models.Currency.objects.all",
"corehq.apps.accounting.models.SubscriptionAdjustment.objects.all",
"dimagi.utils.data.generator.random_phonenumber",
"random.randint",
... | [((993, 1043), 'django.core.management.call_command', 'call_command', (['"""cchq_prbac_bootstrap"""'], {'testing': '(True)'}), "('cchq_prbac_bootstrap', testing=True)\n", (1005, 1043), False, 'from django.core.management import call_command\n'), ((1048, 1106), 'django.core.management.call_command', 'call_command', (['"... |
from kivy.lang.builder import Builder
Builder.unload_file('modules/friday/login.kv')
Builder.unload_file('modules/twitter_interface/permission.kv')
Builder.unload_file('modules/twitter_interface/login.kv')
from kivy.app import App
from kivy.uix.screenmanager import ScreenManager, Screen
from kivy.properties import Stri... | [
"kivy.config.Config.set",
"kivy.uix.screenmanager.FadeTransition",
"kivy.properties.StringProperty",
"kivy.core.window.Window.__init__",
"kivy.clock.Clock.schedule_once",
"kivy.clock.Clock.__init__",
"kivy.app.App.get_running_app",
"kivy.properties.ObjectProperty",
"kivy.lang.builder.Builder.unload_... | [((38, 84), 'kivy.lang.builder.Builder.unload_file', 'Builder.unload_file', (['"""modules/friday/login.kv"""'], {}), "('modules/friday/login.kv')\n", (57, 84), False, 'from kivy.lang.builder import Builder\n'), ((85, 147), 'kivy.lang.builder.Builder.unload_file', 'Builder.unload_file', (['"""modules/twitter_interface/p... |
import pygame
import sprites
import projectiles
import chest
import pygame
import enemy
import portal
class level():
def __init__(self, design, enemies,chest1,chest2,chest3,portal,screen): #design is a 2d list
self.boxGroup = pygame.sprite.Group()
self.boxes = []
self.enemies = enemies
self.chest1 = chest1
... | [
"portal.portal",
"pygame.sprite.Group",
"chest.chest",
"sprites.sprites",
"enemy.enemy"
] | [((232, 253), 'pygame.sprite.Group', 'pygame.sprite.Group', ([], {}), '()\n', (251, 253), False, 'import pygame\n'), ((618, 670), 'sprites.sprites', 'sprites.sprites', (['"""Obstacles/box.png"""', '(xSpot, ySpot)'], {}), "('Obstacles/box.png', (xSpot, ySpot))\n", (633, 670), False, 'import sprites\n'), ((888, 942), 'sp... |
from tempfile import NamedTemporaryFile
from os import remove
from mhctools.mixmhcpred import parse_mixmhcpred_results
from nose.tools import eq_
example_output = """Peptide\tScore_bestAllele\tBestAllele\t%Rank_bestAllele\tScore_A0201\t%Rank_A0201
MLDDFSAGA\t0.182093\tA0201\t0.3\t0.182093\t0.3
SPEGEETII\t-0.655341\tA... | [
"tempfile.NamedTemporaryFile",
"mhctools.mixmhcpred.parse_mixmhcpred_results",
"nose.tools.eq_"
] | [((445, 474), 'tempfile.NamedTemporaryFile', 'NamedTemporaryFile', ([], {'mode': '"""r+"""'}), "(mode='r+')\n", (463, 474), False, 'from tempfile import NamedTemporaryFile\n'), ((557, 589), 'mhctools.mixmhcpred.parse_mixmhcpred_results', 'parse_mixmhcpred_results', (['f.name'], {}), '(f.name)\n', (581, 589), False, 'fr... |
# ******************************************************************************
# Copyright 2017-2018 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apa... | [
"examples.word_language_model_with_tcn.adding_problem.adding_model.TCNForAdding",
"examples.word_language_model_with_tcn.toy_data.adding.Adding"
] | [((1383, 1437), 'examples.word_language_model_with_tcn.toy_data.adding.Adding', 'Adding', ([], {'seq_len': 'seq_len', 'n_train': 'n_train', 'n_test': 'n_val'}), '(seq_len=seq_len, n_train=n_train, n_test=n_val)\n', (1389, 1437), False, 'from examples.word_language_model_with_tcn.toy_data.adding import Adding\n'), ((145... |
'''Example streaming ffmpeg numpy processing.
Based on examples from https://github.com/kkroening/ffmpeg-python/tree/master/examples
Usage instructions:
1. Install opencv, ffmpeg-python and numpy
2. Run python ffmpeg_stream.py input_file
3. In separate terminal run ffplay -f avi http://localhost:8080 (after enabling ... | [
"threading.Thread",
"subprocess.Popen",
"os.remove",
"argparse.ArgumentParser",
"logging.basicConfig",
"numpy.frombuffer",
"os.path.exists",
"ffmpeg.output",
"ffmpeg.probe",
"os.mkfifo",
"ffmpeg.input",
"logging.getLogger"
] | [((1704, 1789), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Example streaming ffmpeg numpy processing"""'}), "(description='Example streaming ffmpeg numpy processing'\n )\n", (1727, 1789), False, 'import argparse\n'), ((1908, 1935), 'logging.getLogger', 'logging.getLogger', (['__na... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# || ____ _ __
# +------+ / __ )(_) /_______________ _____ ___
# | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \
# +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
# || || /_____/_/\__/\___/_/ \__,_/ /___/\___/
#
# Copyright (C) 20... | [
"PyQt5.QtCore.pyqtSignal",
"PyQt5.uic.loadUiType",
"PyQt5.QtWidgets.QTreeWidgetItem",
"PyQt5.QtCore.pyqtSlot"
] | [((1431, 1490), 'PyQt5.uic.loadUiType', 'uic.loadUiType', (["(cfclient.module_path + '/ui/tabs/logTab.ui')"], {}), "(cfclient.module_path + '/ui/tabs/logTab.ui')\n", (1445, 1490), False, 'from PyQt5 import uic\n'), ((1587, 1602), 'PyQt5.QtCore.pyqtSignal', 'pyqtSignal', (['str'], {}), '(str)\n', (1597, 1602), False, 'f... |
# Copyright 2020 TestProject (https://testproject.io)
#
# 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 ... | [
"src.testproject.classes.ProxyDescriptor"
] | [((870, 992), 'src.testproject.classes.ProxyDescriptor', 'ProxyDescriptor', ([], {'guid': '"""GrQN1LQqTEmuYTnIujiEwA"""', 'classname': '"""io.testproject.examples.sdk.actions.TypeRandomPhoneAction"""'}), "(guid='GrQN1LQqTEmuYTnIujiEwA', classname=\n 'io.testproject.examples.sdk.actions.TypeRandomPhoneAction')\n", (8... |
#!/usr/bin/env python
import rospy
# import sys
from std_msgs.msg import ColorRGBA
from geometry_msgs.msg import PoseStamped, Twist, Vector3, Point
from ford_msgs.msg import Clusters
from visualization_msgs.msg import Marker, MarkerArray
import numpy as np
import math
from nav_msgs.msg import Odometry
import configpa... | [
"geometry_msgs.msg.Vector3",
"crowd_nav.policy.sarl.SARL",
"rospy.Subscriber",
"numpy.arctan2",
"numpy.linalg.norm",
"std_msgs.msg.ColorRGBA",
"rospy.Duration",
"geometry_msgs.msg.PoseStamped",
"crowd_sim.envs.utils.robot.Robot",
"rospy.Time.now",
"configparser.RawConfigParser",
"torch.load",
... | [((10476, 10506), 'configparser.RawConfigParser', 'configparser.RawConfigParser', ([], {}), '()\n', (10504, 10506), False, 'import configparser\n'), ((10768, 10798), 'configparser.RawConfigParser', 'configparser.RawConfigParser', ([], {}), '()\n', (10796, 10798), False, 'import configparser\n'), ((10846, 10869), 'gym.m... |
# standard imports
import logging
from sklearn.metrics.cluster import homogeneity_score, completeness_score
import numpy
import matplotlib.pyplot as plt
# our imports
import emission.analysis.modelling.tour_model.cluster_pipeline as cp
import emission.analysis.modelling.tour_model.similarity as similarity
"""
Functi... | [
"sklearn.metrics.cluster.completeness_score",
"emission.analysis.modelling.tour_model.similarity.similarity",
"logging.debug",
"emission.analysis.modelling.tour_model.cluster_pipeline.remove_noise",
"pygmaps.maps",
"emission.analysis.modelling.tour_model.cluster_pipeline.read_data",
"numpy.array",
"sk... | [((1778, 1811), 'sklearn.metrics.cluster.homogeneity_score', 'homogeneity_score', (['colors', 'labels'], {}), '(colors, labels)\n', (1795, 1811), False, 'from sklearn.metrics.cluster import homogeneity_score, completeness_score\n'), ((1820, 1854), 'sklearn.metrics.cluster.completeness_score', 'completeness_score', (['c... |
from datetime import timedelta
from django.test import TestCase
from django.contrib.auth import get_user_model
from bestflightApp.tests.factories import (
AirlineFactory,
AirplaneFactory,
FlightClassFactory,
ReservationFactory,
AvailableFlightFactory,
AirlineFlightPathFactory,
)
from bestfligh... | [
"bestflightApp.tests.factories.AirplaneFactory",
"django.contrib.auth.get_user_model",
"bestflightUser.tests.factories.UserFactory",
"bestflightApp.tests.factories.ReservationFactory",
"datetime.timedelta",
"bestflightApp.tests.factories.AvailableFlightFactory",
"bestflightApp.tests.factories.AirlineFac... | [((368, 384), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (382, 384), False, 'from django.contrib.auth import get_user_model\n'), ((469, 485), 'bestflightApp.tests.factories.AirlineFactory', 'AirlineFactory', ([], {}), '()\n', (483, 485), False, 'from bestflightApp.tests.factories import A... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from ax.core.metric import Metric
from ax.core.objective import Objective, ScalarizedObjective
from ax.core.optimizatio... | [
"ax.core.outcome_constraint.OutcomeConstraint",
"ax.core.objective.Objective",
"ax.core.metric.Metric",
"ax.core.optimization_config.OptimizationConfig",
"ax.core.objective.ScalarizedObjective"
] | [((860, 912), 'ax.core.objective.Objective', 'Objective', ([], {'metric': "self.metrics['m1']", 'minimize': '(False)'}), "(metric=self.metrics['m1'], minimize=False)\n", (869, 912), False, 'from ax.core.objective import Objective, ScalarizedObjective\n'), ((941, 1010), 'ax.core.objective.ScalarizedObjective', 'Scalariz... |
import numpy as np
from pandas import DataFrame
import matplotlib.pyplot as py
class ca(object):
'''
Docstring for function ecopy.ca
====================
Conducts correspondance analysis (CA). User supplies
an observation x descriptor matrix.
Use
----
ca(x, siteNames=None, spNames... | [
"pandas.DataFrame",
"matplotlib.pyplot.show",
"numpy.sum",
"numpy.amin",
"numpy.isnan",
"numpy.amax",
"numpy.cumsum",
"numpy.min",
"numpy.array",
"numpy.diag",
"matplotlib.pyplot.subplots",
"numpy.vstack",
"numpy.sqrt"
] | [((6821, 6840), 'numpy.sqrt', 'np.sqrt', (['self.evals'], {}), '(self.evals)\n', (6828, 6840), True, 'import numpy as np\n'), ((7352, 7365), 'matplotlib.pyplot.subplots', 'py.subplots', ([], {}), '()\n', (7363, 7365), True, 'import matplotlib.pyplot as py\n'), ((8922, 8931), 'matplotlib.pyplot.show', 'py.show', ([], {}... |
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
# pylint:... | [
"azure.cli.core.util.sdk_no_wait"
] | [((2695, 2861), 'azure.cli.core.util.sdk_no_wait', 'sdk_no_wait', (['no_wait', 'client.create_or_update'], {'resource_group_name': 'resource_group_name', 'resource_name': 'resource_name', 'service_description': 'service_description'}), '(no_wait, client.create_or_update, resource_group_name=\n resource_group_name, r... |
from mqtt_kube.mqtt import TopicMatcher
class TestTopicMatcher:
def test_basic(self):
assert TopicMatcher('topic/one').match('topic/one') == True
assert TopicMatcher('topic/two').match('topic/one') == False
def test_plus(self):
assert TopicMatcher('topic/+/plus').match('topic/one/plus... | [
"mqtt_kube.mqtt.TopicMatcher"
] | [((107, 132), 'mqtt_kube.mqtt.TopicMatcher', 'TopicMatcher', (['"""topic/one"""'], {}), "('topic/one')\n", (119, 132), False, 'from mqtt_kube.mqtt import TopicMatcher\n'), ((175, 200), 'mqtt_kube.mqtt.TopicMatcher', 'TopicMatcher', (['"""topic/two"""'], {}), "('topic/two')\n", (187, 200), False, 'from mqtt_kube.mqtt im... |
# 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, software
# distrib... | [
"osc_lib.i18n._",
"osc_lib.exceptions.NotFound"
] | [((4588, 4612), 'osc_lib.exceptions.NotFound', 'exceptions.NotFound', (['msg'], {}), '(msg)\n', (4607, 4612), False, 'from osc_lib import exceptions\n'), ((4545, 4562), 'osc_lib.i18n._', '_', (['"""%s not found"""'], {}), "('%s not found')\n", (4546, 4562), False, 'from osc_lib.i18n import _\n'), ((1657, 1682), 'osc_li... |
import socket
class ClientSocket:
"""
simple client socket for omnomnom game
"""
def __init__(self):
"""
creates a socket and starts a connection
"""
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.PORT = 2222
# connect on construc... | [
"socket.socket"
] | [((216, 265), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_STREAM'], {}), '(socket.AF_INET, socket.SOCK_STREAM)\n', (229, 265), False, 'import socket\n')] |
# -*- coding: utf-8 -*-
__author__ = 'alex'
from PyQt4 import QtCore, QtGui
import MyWindow
class MyDialog(QtGui.QDialog):
def __init__(self, parent=None):
QtGui.QDialog.__init__(self, parent)
self.MyWidget = MyWindow.MyWindow()
self.MyWidget.vbox.setMargin(0)
self.button = QtGui.Q... | [
"PyQt4.QtGui.QDialog.__init__",
"PyQt4.QtGui.QVBoxLayout",
"PyQt4.QtGui.QApplication",
"PyQt4.QtGui.QPushButton",
"MyWindow.MyWindow",
"PyQt4.QtCore.SIGNAL"
] | [((778, 806), 'PyQt4.QtGui.QApplication', 'QtGui.QApplication', (['sys.argv'], {}), '(sys.argv)\n', (796, 806), False, 'from PyQt4 import QtCore, QtGui\n'), ((170, 206), 'PyQt4.QtGui.QDialog.__init__', 'QtGui.QDialog.__init__', (['self', 'parent'], {}), '(self, parent)\n', (192, 206), False, 'from PyQt4 import QtCore, ... |
'''Class to find shapes in gray image with cv2'''
# import the necessary packages
import argparse
import cv2 as cv2
import os
import numpy as np
from PIL import Image
result = [0] *256
image_path = '../resources/'+os.getenv('IMAGE', 'sample.bin')
xbash = np.fromfile(image_path, dtype='uint8')
#print(xbash.shape)
ima... | [
"cv2.GaussianBlur",
"cv2.approxPolyDP",
"cv2.erode",
"cv2.imshow",
"cv2.cvtColor",
"cv2.copyMakeBorder",
"cv2.drawContours",
"cv2.mean",
"cv2.resize",
"cv2.circle",
"cv2.waitKey",
"os.getenv",
"cv2.putText",
"numpy.fromfile",
"cv2.threshold",
"cv2.moments",
"numpy.zeros",
"PIL.Imag... | [((258, 296), 'numpy.fromfile', 'np.fromfile', (['image_path'], {'dtype': '"""uint8"""'}), "(image_path, dtype='uint8')\n", (269, 296), True, 'import numpy as np\n'), ((827, 849), 'PIL.Image.fromarray', 'Image.fromarray', (['array'], {}), '(array)\n', (842, 849), False, 'from PIL import Image\n'), ((883, 905), 'cv2.imr... |
"""A kernel manager for multiple kernels"""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import asyncio
import os
import socket
import typing as t
import uuid
import zmq
from traitlets import Any
from traitlets import Bool
from traitlets import default
from trait... | [
"traitlets.default",
"asyncio.gather",
"traitlets.Bool",
"uuid.uuid4",
"typing.cast",
"traitlets.DottedObjectName",
"traitlets.Unicode",
"traitlets.Dict",
"traitlets.observe",
"traitlets.Any",
"os.path.join",
"traitlets.Instance",
"zmq.Context",
"traitlets.utils.importstring.import_item"
] | [((1728, 1772), 'traitlets.Instance', 'Instance', (['KernelSpecManager'], {'allow_none': '(True)'}), '(KernelSpecManager, allow_none=True)\n', (1736, 1772), False, 'from traitlets import Instance\n'), ((2053, 2084), 'traitlets.observe', 'observe', (['"""kernel_manager_class"""'], {}), "('kernel_manager_class')\n", (206... |
import pyglet
from pyglet.gl import *
# pyglet.options['debug_gl_shaders'] = True
window = pyglet.window.Window(width=540, height=540, resizable=True)
batch = pyglet.graphics.Batch()
print("OpenGL Context: {}".format(window.context.get_info().version))
##########################################################
# ... | [
"pyglet.app.run",
"pyglet.text.Label",
"pyglet.gl.glClearColor",
"pyglet.graphics.Batch",
"pyglet.image.SolidColorImagePattern",
"pyglet.sprite.Sprite",
"pyglet.image.load",
"pyglet.window.Window",
"pyglet.graphics.vertex_list",
"pyglet.clock.schedule_interval"
] | [((94, 153), 'pyglet.window.Window', 'pyglet.window.Window', ([], {'width': '(540)', 'height': '(540)', 'resizable': '(True)'}), '(width=540, height=540, resizable=True)\n', (114, 153), False, 'import pyglet\n'), ((162, 185), 'pyglet.graphics.Batch', 'pyglet.graphics.Batch', ([], {}), '()\n', (183, 185), False, 'import... |
from PIL import Image
import PIL.ImageOps
import numpy as np
import tensorflow as tf
import time
## 시간측정 시작
stime = time.time()
### 학습모델 불러오기
model = tf.keras.models.load_model('my_model.h5')
# model.summary()
### 유효영역 자르기
img = PIL.ImageOps.invert(Image.open('sample.bmp')).convert("1")
Newimg = np.asarray(img.crop(... | [
"tensorflow.keras.models.load_model",
"numpy.amin",
"numpy.argmax",
"numpy.asarray",
"numpy.zeros",
"time.time",
"numpy.amax",
"numpy.argwhere",
"PIL.Image.open",
"numpy.mean",
"numpy.array",
"PIL.Image.fromarray"
] | [((117, 128), 'time.time', 'time.time', ([], {}), '()\n', (126, 128), False, 'import time\n'), ((152, 193), 'tensorflow.keras.models.load_model', 'tf.keras.models.load_model', (['"""my_model.h5"""'], {}), "('my_model.h5')\n", (178, 193), True, 'import tensorflow as tf\n'), ((1977, 2023), 'numpy.array', 'np.array', (['[... |
from setuptools import setup, find_packages
setup(
name="pymaster",
packages=find_packages(exclude=["tests", "docs"]),
version="1.0.0",
description="Quick Recipes for interview problems",
author="<NAME>",
classifiers=[
"Topic:: Utilities",
"Operating System :: POSIX",
"P... | [
"setuptools.find_packages"
] | [((86, 126), 'setuptools.find_packages', 'find_packages', ([], {'exclude': "['tests', 'docs']"}), "(exclude=['tests', 'docs'])\n", (99, 126), False, 'from setuptools import setup, find_packages\n')] |
# Copyright (C) 2019 by eHealth Africa : http://www.eHealthAfrica.org
#
# See the NOTICE file distributed with this work for additional information
# regarding copyright ownership.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with
# the License. Y... | [
"django.db.models.Index",
"django_prometheus.models.ExportModelOperationsMixin",
"aether.sdk.utils.json_prettified",
"django.utils.translation.gettext"
] | [((2547, 2587), 'django_prometheus.models.ExportModelOperationsMixin', 'ExportModelOperationsMixin', (['"""ui_project"""'], {}), "('ui_project')\n", (2573, 2587), False, 'from django_prometheus.models import ExportModelOperationsMixin\n'), ((3760, 3801), 'django_prometheus.models.ExportModelOperationsMixin', 'ExportMod... |
'''
Useful functions for combined signal strategy
'''
import numpy as np
def get_split_w_threshold(alpha, normalization='exponential'):
"""
Get normalize weights and thresholds from alpha vector
:param alpha: optimize Vectorize
:return: weights and thresholds
"""
w = []
if normalization ... | [
"numpy.array"
] | [((1541, 1552), 'numpy.array', 'np.array', (['w'], {}), '(w)\n', (1549, 1552), True, 'import numpy as np\n'), ((1553, 1574), 'numpy.array', 'np.array', (['signal_list'], {}), '(signal_list)\n', (1561, 1574), True, 'import numpy as np\n')] |
#!/usr/bin/env python2.7
from __future__ import print_function, division
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
import matplotlib.colors as clr
import dtk
import h5py
import time
import sys
def plot_mag_dust(mag_delta, mag, name,obs= False,ybins=None):
plt.figure()
if obs:
... | [
"h5py.File",
"matplotlib.pyplot.show",
"numpy.histogram2d",
"time.time",
"matplotlib.pyplot.figure",
"dtk.Param",
"matplotlib.colors.LogNorm",
"numpy.linspace",
"matplotlib.pyplot.ylabel",
"numpy.log10",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.grid"
] | [((290, 302), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (300, 302), True, 'import matplotlib.pyplot as plt\n'), ((485, 536), 'numpy.histogram2d', 'np.histogram2d', (['mag', 'mag_delta'], {'bins': '(xbins, ybins)'}), '(mag, mag_delta, bins=(xbins, ybins))\n', (499, 536), True, 'import numpy as np\n'), ... |
import pathlib
import pygraphviz
def task_imports():
"""find imports from a python module"""
return {
'file_dep': ['projects/requests/requests/models.py'],
'targets': ['requests.models.deps'],
'actions': ['python -m import_deps %(dependencies)s > %(targets)s'],
'clean': True,
... | [
"pygraphviz.AGraph",
"pathlib.Path"
] | [((380, 426), 'pygraphviz.AGraph', 'pygraphviz.AGraph', ([], {'strict': '(False)', 'directed': '(True)'}), '(strict=False, directed=True)\n', (397, 426), False, 'import pygraphviz\n'), ((559, 576), 'pathlib.Path', 'pathlib.Path', (['dep'], {}), '(dep)\n', (571, 576), False, 'import pathlib\n')] |
import torch
import torch.nn as nn
from model_util import conv_block_3d_feature_leaner
class featureLearner(nn.Module):
def __init__(self,channels):
super(featureLearner, self).__init__()
self.in_dim = 1
self.mid1_dim = channels[0]
self.mid2_dim = channels[1]
self.mid3_dim... | [
"torch.nn.init.constant",
"model_util.conv_block_3d_feature_leaner",
"torch.nn.ReLU",
"torch.nn.init.kaiming_normal"
] | [((492, 501), 'torch.nn.ReLU', 'nn.ReLU', ([], {}), '()\n', (499, 501), True, 'import torch.nn as nn\n'), ((576, 643), 'model_util.conv_block_3d_feature_leaner', 'conv_block_3d_feature_leaner', (['self.in_dim', 'self.mid1_dim', 'act_fn', '(1)'], {}), '(self.in_dim, self.mid1_dim, act_fn, 1)\n', (604, 643), False, 'from... |
# Copyright 2018 The TensorFlow Constrained Optimization Authors. All Rights
# Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... | [
"tensorflow.control_dependencies",
"tensorflow_constrained_optimization.python.train.lagrangian_optimizer.LagrangianOptimizerV1",
"tensorflow.compat.v1.train.get_global_step",
"tensorflow.constant",
"tensorflow.compat.v1.get_collection",
"tensorflow_constrained_optimization.python.train.lagrangian_optimiz... | [((15093, 15155), 'tensorflow.compat.v1.get_collection', 'tf.compat.v1.get_collection', (['tf.compat.v1.GraphKeys.UPDATE_OPS'], {}), '(tf.compat.v1.GraphKeys.UPDATE_OPS)\n', (15120, 15155), True, 'import tensorflow as tf\n'), ((15187, 15223), 'tensorflow.compat.v1.train.get_global_step', 'tf.compat.v1.train.get_global_... |
import torch
import argparse
from sdf.utils import *
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('path', type=str)
parser.add_argument('--test', action='store_true', help="test mode")
parser.add_argument('--workspace', type=str, default='workspace')
parser.ad... | [
"sdf.provider.SDFDataset",
"sdf.netowrk.SDFNetwork",
"argparse.ArgumentParser",
"torch.utils.data.DataLoader"
] | [((96, 121), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (119, 121), False, 'import argparse\n'), ((1124, 1155), 'sdf.netowrk.SDFNetwork', 'SDFNetwork', ([], {'encoding': '"""hashgrid"""'}), "(encoding='hashgrid')\n", (1134, 1155), False, 'from sdf.netowrk import SDFNetwork\n'), ((1512, 1563... |
"""
Scatter Plot with Minimap
-------------------------
This example shows how to create a miniature version of a plot
such that creating a selection in the miniature version
adjusts the axis limits in another, more detailed view.
"""
# category: scatter plots
import altair as alt
from vega_datasets import data
sourc... | [
"altair.selection_interval",
"vega_datasets.data.seattle_weather",
"altair.Chart",
"altair.value",
"altair.Scale"
] | [((324, 346), 'vega_datasets.data.seattle_weather', 'data.seattle_weather', ([], {}), '()\n', (344, 346), False, 'from vega_datasets import data\n'), ((355, 399), 'altair.selection_interval', 'alt.selection_interval', ([], {'encodings': "['x', 'y']"}), "(encodings=['x', 'y'])\n", (377, 399), True, 'import altair as alt... |
import re
import sys
if ".draft" not in sys.argv[1]:
sys.exit(1)
t = open(sys.argv[1], "rb").read().decode()
t = re.sub(r"(\n|\r)", "", t)
t = re.sub(r" +", " ", t)
open(sys.argv[1].replace(".draft", ""), "wb").write(t.encode())
| [
"re.sub",
"sys.exit"
] | [((120, 146), 're.sub', 're.sub', (['"""(\\\\n|\\\\r)"""', '""""""', 't'], {}), "('(\\\\n|\\\\r)', '', t)\n", (126, 146), False, 'import re\n'), ((151, 172), 're.sub', 're.sub', (['""" +"""', '""" """', 't'], {}), "(' +', ' ', t)\n", (157, 172), False, 'import re\n'), ((58, 69), 'sys.exit', 'sys.exit', (['(1)'], {}),... |
from distutils.core import setup
from setuptools import find_packages
with open('README.md') as f:
long_description = f.read()
setup(
name='gdaxcli',
packages=find_packages('gdaxcli', exclude=['tests']),
version='0.1.1',
description='Commandline client for trading on GDAX',
long_description=lon... | [
"setuptools.find_packages"
] | [((172, 215), 'setuptools.find_packages', 'find_packages', (['"""gdaxcli"""'], {'exclude': "['tests']"}), "('gdaxcli', exclude=['tests'])\n", (185, 215), False, 'from setuptools import find_packages\n')] |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import torch
import torch.nn.functional as F
from torch import nn
class PostProcessor(nn.Module):
def __init__(
self,
score_thresh=0.05,
nms=0.5,
detections_per_img=100,
num_class=2
):
super(... | [
"torch.cat"
] | [((771, 815), 'torch.cat', 'torch.cat', (['(depth_per_img, disp_per_img)', '(-1)'], {}), '((depth_per_img, disp_per_img), -1)\n', (780, 815), False, 'import torch\n')] |
from copy import deepcopy
import pytest
@pytest.fixture
def real_oldcase_database(real_panel_database, parsed_case):
# add case with old case id construct
config_data = deepcopy(parsed_case)
config_data["case_id"] = "-".join([config_data["owner"], config_data["display_name"]])
case_obj = real_panel_d... | [
"copy.deepcopy"
] | [((180, 201), 'copy.deepcopy', 'deepcopy', (['parsed_case'], {}), '(parsed_case)\n', (188, 201), False, 'from copy import deepcopy\n')] |
import hashlib
import logging
import os
import dj_database_url
from django.contrib.messages import constants as messages
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
APP_DIRNAME = "apps"
SETTINGS_DIR = os.path.dirname(os.path.abspath(__file__))
BASE_DIR = os.path.dirname(SETTINGS_DIR)
DOCK... | [
"os.path.abspath",
"os.path.dirname",
"os.path.join",
"dj_database_url.config",
"logging.getLogger"
] | [((286, 315), 'os.path.dirname', 'os.path.dirname', (['SETTINGS_DIR'], {}), '(SETTINGS_DIR)\n', (301, 315), False, 'import os\n'), ((339, 377), 'os.path.join', 'os.path.join', (['BASE_DIR', '"""default_file"""'], {}), "(BASE_DIR, 'default_file')\n", (351, 377), False, 'import os\n'), ((5284, 5324), 'dj_database_url.con... |
# This source code is part of the Biotite package and is distributed
# under the 3-Clause BSD License. Please see 'LICENSE.rst' for further
# information.
__name__ = "biotite.structure.io.mol"
__author__ = "<NAME>"
__all__ = ["MOLFile"]
import datetime
from warnings import warn
import numpy as np
from ...atoms import... | [
"datetime.datetime.strptime",
"datetime.datetime.now"
] | [((3942, 4003), 'datetime.datetime.strptime', 'datetime.datetime.strptime', (['self.lines[1][10:20]', 'DATE_FORMAT'], {}), '(self.lines[1][10:20], DATE_FORMAT)\n', (3968, 4003), False, 'import datetime\n'), ((5549, 5572), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (5570, 5572), False, 'import d... |
# coding: utf-8
# DO NOT EDIT
# Autogenerated from the notebook glm.ipynb.
# Edit the notebook and then sync the output with this file.
#
# flake8: noqa
# DO NOT EDIT
# # 广义线性模型
import numpy as np
import statsmodels.api as sm
from scipy import stats
from matplotlib import pyplot as plt
# ## GLM: 二项式响应数据
#
# ### 加载数... | [
"numpy.random.seed",
"scipy.stats.zscore",
"statsmodels.api.families.Binomial",
"scipy.stats.scoreatpercentile",
"statsmodels.api.families.Gamma",
"numpy.column_stack",
"statsmodels.graphics.gofplots.qqplot",
"numpy.arange",
"numpy.exp",
"statsmodels.graphics.api.abline_plot",
"statsmodels.api.d... | [((474, 499), 'statsmodels.api.datasets.star98.load', 'sm.datasets.star98.load', ([], {}), '()\n', (497, 499), True, 'import statsmodels.api as sm\n'), ((512, 553), 'statsmodels.api.add_constant', 'sm.add_constant', (['data.exog'], {'prepend': '(False)'}), '(data.exog, prepend=False)\n', (527, 553), True, 'import stats... |
import logging
import os
log = logging.getLogger(__name__)
class JobListService(object):
PESTO_WORKSPACE = '/tmp/.pesto/jobs'
def __init__(self) -> None:
self.PESTO_WORKSPACE = JobListService.PESTO_WORKSPACE
def job_list(self, url_root: str) -> dict:
log.info('job_list : url_root = {}'.... | [
"os.path.exists",
"os.listdir",
"logging.getLogger"
] | [((32, 59), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (49, 59), False, 'import logging\n'), ((371, 407), 'os.path.exists', 'os.path.exists', (['self.PESTO_WORKSPACE'], {}), '(self.PESTO_WORKSPACE)\n', (385, 407), False, 'import os\n'), ((509, 541), 'os.listdir', 'os.listdir', (['self... |
from __future__ import absolute_import, division, print_function
import os
from qtpy import QtWidgets
from glue.utils.qt import load_ui
from glue.external.echo.qt import autoconnect_callbacks_to_qt
from glue_vispy_viewers.utils import fix_tab_widget_fontsize
class ScatterLayerStyleWidget(QtWidgets.QWidget):
... | [
"glue_vispy_viewers.utils.fix_tab_widget_fontsize",
"os.path.dirname",
"glue.external.echo.qt.autoconnect_callbacks_to_qt"
] | [((541, 584), 'glue_vispy_viewers.utils.fix_tab_widget_fontsize', 'fix_tab_widget_fontsize', (['self.ui.tab_widget'], {}), '(self.ui.tab_widget)\n', (564, 584), False, 'from glue_vispy_viewers.utils import fix_tab_widget_fontsize\n'), ((893, 957), 'glue.external.echo.qt.autoconnect_callbacks_to_qt', 'autoconnect_callba... |
"""
Implementation of the XDG Menu Specification Version 1.0.draft-1
http://standards.freedesktop.org/menu-spec/
"""
from __future__ import generators
import locale, os, xml.dom.minidom
from xdg.BaseDirectory import *
from xdg.DesktopEntry import *
from xdg.Exceptions import *
import xdg.Xocale
import xdg.Config
EL... | [
"os.path.abspath",
"os.path.isabs",
"os.path.basename",
"os.path.isdir",
"os.popen3",
"os.path.dirname",
"os.path.exists",
"os.environ.get",
"os.path.isfile",
"os.path.splitext",
"os.access",
"os.path.join",
"os.listdir"
] | [((22946, 22971), 'os.path.dirname', 'os.path.dirname', (['filename'], {}), '(filename)\n', (22961, 22971), False, 'import locale, os, xml.dom.minidom\n'), ((23061, 23083), 'os.path.abspath', 'os.path.abspath', (['value'], {}), '(value)\n', (23076, 23083), False, 'import locale, os, xml.dom.minidom\n'), ((27493, 27528)... |
import sapien.core as sapien
import mplib
import numpy as np
from sapien.utils.viewer import Viewer
class PlanningDemo():
def __init__(self):
self.engine = sapien.Engine()
self.renderer = sapien.VulkanRenderer()
self.engine.set_renderer(self.renderer)
scene_config = sapien.SceneCon... | [
"sapien.core.SceneConfig",
"trimesh.sample.sample_surface",
"numpy.ones",
"sapien.core.Pose",
"trimesh.creation.box",
"sapien.utils.viewer.Viewer",
"sapien.core.Engine",
"sapien.core.VulkanRenderer"
] | [((169, 184), 'sapien.core.Engine', 'sapien.Engine', ([], {}), '()\n', (182, 184), True, 'import sapien.core as sapien\n'), ((209, 232), 'sapien.core.VulkanRenderer', 'sapien.VulkanRenderer', ([], {}), '()\n', (230, 232), True, 'import sapien.core as sapien\n'), ((305, 325), 'sapien.core.SceneConfig', 'sapien.SceneConf... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
""" Generating random graphs"""
from cyberbattle.simulation.model import Identifiers, NodeID, CredentialID, PortName, FirewallConfiguration, FirewallRule, RulePermission
import numpy as np
import networkx as nx
from cyberbattle.simulation import ... | [
"cyberbattle.simulation.model.ListeningService",
"numpy.random.seed",
"random.randint",
"numpy.random.beta",
"numpy.float32",
"random.choice",
"cyberbattle.simulation.model.Identifiers",
"cyberbattle.simulation.model.FirewallRule",
"collections.defaultdict",
"networkx.stochastic_block_model",
"r... | [((455, 709), 'cyberbattle.simulation.model.Identifiers', 'Identifiers', ([], {'properties': "['breach_node']", 'ports': "['SMB', 'HTTP', 'RDP']", 'local_vulnerabilities': "['ScanWindowsCredentialManagerForRDP', 'ScanWindowsExplorerRecentFiles',\n 'ScanWindowsCredentialManagerForSMB']", 'remote_vulnerabilities': "['... |
import asyncio
import datetime, time
import os, sys
from AWSIoTPythonSDK.MQTTLib import AWSIoTMQTTClient
from uuid import uuid4
from aiocoap import *
class Times:
def timeNow(self):
return datetime.datetime.now()
def __init__(self):
self.sendMQTTTime = None
self.sendCoAPTime = Non... | [
"AWSIoTPythonSDK.MQTTLib.AWSIoTMQTTClient",
"os.path.abspath",
"uuid.uuid4",
"asyncio.get_event_loop",
"datetime.datetime.now",
"time.sleep",
"os.path.join"
] | [((976, 1026), 'os.path.join', 'os.path.join', (['cwd', '"""certs"""', '"""Amazon-root-CA-1.pem"""'], {}), "(cwd, 'certs', 'Amazon-root-CA-1.pem')\n", (988, 1026), False, 'import os, sys\n'), ((1042, 1087), 'os.path.join', 'os.path.join', (['cwd', '"""certs"""', '"""private.pem.key"""'], {}), "(cwd, 'certs', 'private.p... |
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainApp(object):
def setupUi(self, MainApp):
MainApp.setObjectName("MainApp")
MainApp.resize(1017, 805)
self.centralwidget = QtWidgets.QWidget(MainApp)
self.centralwidget.setObjectName("centralwidget")
self.pushButt... | [
"PyQt5.QtWidgets.QComboBox",
"PyQt5.QtWidgets.QLabel",
"PyQt5.QtWidgets.QFrame",
"PyQt5.QtWidgets.QWidget",
"PyQt5.QtWidgets.QTableWidget",
"PyQt5.QtCore.QRect",
"PyQt5.QtWidgets.QStatusBar",
"PyQt5.QtWidgets.QPushButton",
"PyQt5.QtWidgets.QLineEdit",
"PyQt5.QtGui.QFont",
"PyQt5.QtCore.QMetaObje... | [((212, 238), 'PyQt5.QtWidgets.QWidget', 'QtWidgets.QWidget', (['MainApp'], {}), '(MainApp)\n', (229, 238), False, 'from PyQt5 import QtCore, QtGui, QtWidgets\n'), ((334, 375), 'PyQt5.QtWidgets.QPushButton', 'QtWidgets.QPushButton', (['self.centralwidget'], {}), '(self.centralwidget)\n', (355, 375), False, 'from PyQt5 ... |
from tkinter import *
from tkinter.scrolledtext import ScrolledText
from rl_2048.gui.root import WIDTH
from rl_2048.gui.config import Config
from tkinter.constants import END
import threading
TITLE_FONT = ("Helvetica", 32)
DEFAULT_FONT = ("Helvetica", 14)
TRAIN_DIR_POS = (WIDTH / 2, 60)
DELAY_MS_POS = (WIDTH / 2, 100... | [
"threading.Thread",
"rl_2048.gui.config.Config",
"tkinter.scrolledtext.ScrolledText"
] | [((768, 782), 'rl_2048.gui.config.Config', 'Config', (['master'], {}), '(master)\n', (774, 782), False, 'from rl_2048.gui.config import Config\n'), ((1689, 1736), 'tkinter.scrolledtext.ScrolledText', 'ScrolledText', (['self.master'], {'width': '(111)', 'height': '(12)'}), '(self.master, width=111, height=12)\n', (1701,... |
"""Configuration Object."""
import logging
import yaml
import voluptuous as vol
from watchdog.events import FileSystemEventHandler
from watchdog.observers.polling import PollingObserver as Observer
from consts import (
DEFAULT_CONFIG_FILE,
DEFAULT_MQTT_PORT,
DEFAULT_MQTT_SERVER,
DEFAULT_HA_DISCOVERY_PR... | [
"voluptuous.Range",
"watchdog.observers.polling.PollingObserver",
"voluptuous.Optional",
"logging.basicConfig",
"voluptuous.Required",
"yaml.dump",
"yaml.safe_load",
"watchdog.events.FileSystemEventHandler",
"voluptuous.In",
"logging.getLogger",
"voluptuous.Coerce"
] | [((1614, 1652), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': 'LOG_FORMAT'}), '(format=LOG_FORMAT)\n', (1633, 1652), False, 'import logging\n'), ((1662, 1689), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1679, 1689), False, 'import logging\n'), ((793, 852), 'voluptuous... |
# -*- coding: utf-8 -*-
from setuptools import setup
setup(
name='pitman',
version='0.0.1',
packages=['pitman'],
author='<NAME>',
author_email='<EMAIL>',
url='https://github.com/tschaefer/pitman',
description='Dig for your favored Podcast.',
license='BSD',
install_requires=['feedpa... | [
"setuptools.setup"
] | [((55, 418), 'setuptools.setup', 'setup', ([], {'name': '"""pitman"""', 'version': '"""0.0.1"""', 'packages': "['pitman']", 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'url': '"""https://github.com/tschaefer/pitman"""', 'description': '"""Dig for your favored Podcast."""', 'license': '"""BSD"""', 'instal... |
"""Polynomials over arbitrary terms."""
from fractions import Fraction
from collections.abc import Iterable
from functools import cmp_to_key
from kernel.term import Term
from kernel import term_ord
def compare_fst(p1, p2):
if isinstance(p1[0], Term):
return term_ord.fast_compare(p1[0], p2[0])
else:
... | [
"kernel.term_ord.compare_atom",
"kernel.term_ord.fast_compare_list",
"functools.cmp_to_key",
"kernel.term_ord.fast_compare"
] | [((274, 309), 'kernel.term_ord.fast_compare', 'term_ord.fast_compare', (['p1[0]', 'p2[0]'], {}), '(p1[0], p2[0])\n', (295, 309), False, 'from kernel import term_ord\n'), ((2377, 2432), 'kernel.term_ord.fast_compare_list', 'term_ord.fast_compare_list', (['self.factors', 'other.factors'], {}), '(self.factors, other.facto... |
import os
import pandas as pd
CURRENT_DIR = os.path.dirname(__file__)
INPUT_DIR = os.path.join(CURRENT_DIR, "input")
TMP_DIR = os.path.join(CURRENT_DIR, "tmp")
GRAPHER_DIR = os.path.join(CURRENT_DIR, "grapher")
def main():
# GCP data
gas_gcp = pd.read_excel(
os.path.join(INPUT_DIR, "country_fuel/gas... | [
"pandas.melt",
"os.path.dirname",
"os.path.join",
"pandas.concat"
] | [((46, 71), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (61, 71), False, 'import os\n'), ((84, 118), 'os.path.join', 'os.path.join', (['CURRENT_DIR', '"""input"""'], {}), "(CURRENT_DIR, 'input')\n", (96, 118), False, 'import os\n'), ((129, 161), 'os.path.join', 'os.path.join', (['CURRENT_D... |
from contextlib import suppress
from steem.blockchain import Blockchain
from steem.post import Post
from steembase.exceptions import PostDoesNotExist
from steembase.exceptions import RPCError
from datetime import timedelta
def gen(stream):
while True:
try:
for post in stream:
... | [
"datetime.timedelta",
"steem.blockchain.Blockchain"
] | [((767, 779), 'steem.blockchain.Blockchain', 'Blockchain', ([], {}), '()\n', (777, 779), False, 'from steem.blockchain import Blockchain\n'), ((1004, 1022), 'datetime.timedelta', 'timedelta', ([], {'hours': '(9)'}), '(hours=9)\n', (1013, 1022), False, 'from datetime import timedelta\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Copyright (C) 2018 <NAME>
Parameter Parser
"""
import sys
_VALID_TRUE_VALUES = set(['true', '1', 1])
_VALID_FALSE_VALUES = set(['false', '0', 0])
_VALID_BOOLEAN_VALUES = _VALID_TRUE_VALUES | _VALID_FALSE_VALUES
_VALID_TYPES = set(['int', 'float', 'bool', 'str'])
class... | [
"sys.exit"
] | [((2815, 2854), 'sys.exit', 'sys.exit', (['"""Must provide a params_file."""'], {}), "('Must provide a params_file.')\n", (2823, 2854), False, 'import sys\n'), ((4309, 4337), 'sys.exit', 'sys.exit', (['"""outfile required"""'], {}), "('outfile required')\n", (4317, 4337), False, 'import sys\n')] |
""" Network architectures.
"""
# pylint: disable=W0221,W0622,C0103,R0913
##
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.nn.functional as F
from .unet_parts import *
import functools
##
def get_norm_layer(norm_type='instance'):
"""Return a normalization layer
Parameters:
... | [
"torch.nn.Dropout",
"functools.partial",
"torch.nn.ReLU",
"torch.nn.ConvTranspose2d",
"torch.nn.Sequential",
"torch.nn.Tanh",
"torch.nn.Conv2d",
"torch.nn.BatchNorm2d",
"torch.nn.Linear",
"torch.nn.MaxPool2d",
"torch.nn.LeakyReLU",
"torch.nn.Sigmoid"
] | [((659, 731), 'functools.partial', 'functools.partial', (['nn.BatchNorm2d'], {'affine': '(True)', 'track_running_stats': '(True)'}), '(nn.BatchNorm2d, affine=True, track_running_stats=True)\n', (676, 731), False, 'import functools\n'), ((5162, 5247), 'torch.nn.Conv2d', 'nn.Conv2d', (['input_nc', 'inner_nc'], {'kernel_s... |
from casexml.apps.case.xform import extract_case_blocks
from corehq.apps.case_importer.tracking.models import CaseUploadRecord
from corehq.form_processor.interfaces.dbaccessors import FormAccessors
MAX_RECENT_UPLOADS = 100
def get_case_upload_records(domain, user, limit, skip=0):
query_set = CaseUploadRecord.ob... | [
"casexml.apps.case.xform.extract_case_blocks",
"corehq.form_processor.interfaces.dbaccessors.FormAccessors",
"corehq.apps.case_importer.tracking.models.CaseUploadRecord.objects.filter"
] | [((301, 347), 'corehq.apps.case_importer.tracking.models.CaseUploadRecord.objects.filter', 'CaseUploadRecord.objects.filter', ([], {'domain': 'domain'}), '(domain=domain)\n', (332, 347), False, 'from corehq.apps.case_importer.tracking.models import CaseUploadRecord\n'), ((600, 646), 'corehq.apps.case_importer.tracking.... |
import zmq
import logging as log
import multiprocessing as prc
import time
class DBNode:
def __init__(self, netconf, name="Database"):
self.name=name
self.listen_addr = netconf.get_address('database')
def _init_sockets(self):
ctx = zmq.Context()
listen_addr = self.listen_addr
... | [
"multiprocessing.Process",
"logging.debug",
"zmq.Context",
"time.sleep"
] | [((266, 279), 'zmq.Context', 'zmq.Context', ([], {}), '()\n', (277, 279), False, 'import zmq\n'), ((369, 423), 'logging.debug', 'log.debug', (["('Binding database to addr %s' % listen_addr)"], {}), "('Binding database to addr %s' % listen_addr)\n", (378, 423), True, 'import logging as log\n'), ((997, 1048), 'multiproce... |
#!/usr/bin/env python
import sys
import sqlite3
import Bio
from Bio import SeqIO
import pickle
recs = SeqIO.parse(sys.argv[1],'fasta')
source = sys.argv[3]
load = []
for rec in recs:
scanid = rec.id
seq = str(rec.seq)
load.append((scanid, seq, sqlite3.Binary(pickle.dumps(rec,pickle.HIGHEST_PROTOCOL)), so... | [
"sqlite3.connect",
"Bio.SeqIO.parse",
"pickle.dumps"
] | [((104, 137), 'Bio.SeqIO.parse', 'SeqIO.parse', (['sys.argv[1]', '"""fasta"""'], {}), "(sys.argv[1], 'fasta')\n", (115, 137), False, 'from Bio import SeqIO\n'), ((333, 361), 'sqlite3.connect', 'sqlite3.connect', (['sys.argv[2]'], {}), '(sys.argv[2])\n', (348, 361), False, 'import sqlite3\n'), ((274, 316), 'pickle.dumps... |
#!/usr/bin/python3
"""
Tool for listing and extracting data from an UBI (Unsorted Block Image) image.
(C) 2017 by <NAME> <<EMAIL>>
"""
from __future__ import division, print_function
import crcmod.predefined
import argparse
import struct
from binascii import b2a_hex
import lzo
import zlib
import os
import errno
import... | [
"argparse.ArgumentParser",
"pkg_resources.require",
"socket.socket",
"collections.defaultdict",
"sys.stdout.flush",
"lzo.decompress",
"lzo.compress",
"os.path.join",
"struct.unpack_from",
"traceback.print_exc",
"struct.pack",
"datetime.datetime.utcfromtimestamp",
"zlib.decompress",
"sys.se... | [((686, 721), 'pkg_resources.require', 'pkg_resources.require', (['dependencies'], {}), '(dependencies)\n', (707, 721), False, 'import pkg_resources\n'), ((591, 622), 'sys.setdefaultencoding', 'sys.setdefaultencoding', (['"""utf-8"""'], {}), "('utf-8')\n", (613, 622), False, 'import sys\n'), ((12070, 12099), 'struct.un... |
# Copyright 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | [
"tempest.lib.common.rest_client.ResponseBody",
"oslo_serialization.jsonutils.loads"
] | [((1007, 1023), 'oslo_serialization.jsonutils.loads', 'json.loads', (['body'], {}), '(body)\n', (1017, 1023), True, 'from oslo_serialization import jsonutils as json\n'), ((1039, 1075), 'tempest.lib.common.rest_client.ResponseBody', 'rest_client.ResponseBody', (['resp', 'body'], {}), '(resp, body)\n', (1063, 1075), Fal... |
"""The :func:`deephyper.nas.run.horovod.run` function is used to evaluate a deep neural network by enabling data-parallelism with Horovod to the :func:`deephyper.nas.run.alpha.run` function. This function will automatically apply the linear scaling rule to the learning rate and batch size given the current number of ra... | [
"tensorflow.random.set_seed",
"numpy.random.seed",
"tensorflow.config.threading.set_intra_op_parallelism_threads",
"horovod.tensorflow.keras.callbacks.MetricAverageCallback",
"deephyper.nas.run._util.get_search_space",
"horovod.tensorflow.keras.callbacks.LearningRateWarmupCallback",
"deephyper.nas.run._... | [((851, 878), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (868, 878), False, 'import logging\n'), ((1841, 1851), 'horovod.tensorflow.keras.init', 'hvd.init', ([], {}), '()\n', (1849, 1851), True, 'import horovod.tensorflow.keras as hvd\n'), ((2549, 2568), 'deephyper.nas.run._util.load_... |
import pytest
from unittest.mock import Mock
from app.meals.exceptions import MealNotFound, ActionNotAllowed
from app.meals.services import UpdateMealService, DeleteMealService
@pytest.mark.unit
class TestUpdateMealService:
def test_meal_not_found_raises_exception(self):
meal_repository = Mock()
... | [
"app.meals.services.UpdateMealService",
"pytest.raises",
"unittest.mock.Mock",
"app.meals.services.DeleteMealService"
] | [((305, 311), 'unittest.mock.Mock', 'Mock', ([], {}), '()\n', (309, 311), False, 'from unittest.mock import Mock\n'), ((385, 419), 'app.meals.services.UpdateMealService', 'UpdateMealService', (['meal_repository'], {}), '(meal_repository)\n', (402, 419), False, 'from app.meals.services import UpdateMealService, DeleteMe... |
import pymysql
db = pymysql.connect(host="localhost",user="root",passwd="<PASSWORD>", db="sidekem")
cur = db.cursor()
cur.execute("SELECT id FROM `villages` WHERE id LIKE '%3327%' ")
desa=cur.fetchall()
for a in desa:
"""Counting Bahan Bakar Masak"""
"""bahan_bakar_masak_listrik"""
cur.execute("SELECT COUNT... | [
"pymysql.connect"
] | [((20, 106), 'pymysql.connect', 'pymysql.connect', ([], {'host': '"""localhost"""', 'user': '"""root"""', 'passwd': '"""<PASSWORD>"""', 'db': '"""sidekem"""'}), "(host='localhost', user='root', passwd='<PASSWORD>', db=\n 'sidekem')\n", (35, 106), False, 'import pymysql\n')] |
import unittest
from nose.tools import *
from website.addons.citations.utils import serialize_account
class TestSerializeAccount(unittest.TestCase):
# TODO: Move to website/addons/citations/tests
def test_serialize_account_none(self):
assert_is_none(serialize_account(None)) | [
"website.addons.citations.utils.serialize_account"
] | [((270, 293), 'website.addons.citations.utils.serialize_account', 'serialize_account', (['None'], {}), '(None)\n', (287, 293), False, 'from website.addons.citations.utils import serialize_account\n')] |
#
# Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending
#
""" This module implements the AxisFormat class that can be applied to format axis tick labels on a plot. """
import jpy
from deephaven.time import TimeZone
from deephaven._wrapper import JObjectWrapper
_JAxisFormat = jpy.get_type("io.deephaven.p... | [
"jpy.get_type"
] | [((292, 351), 'jpy.get_type', 'jpy.get_type', (['"""io.deephaven.plot.axisformatters.AxisFormat"""'], {}), "('io.deephaven.plot.axisformatters.AxisFormat')\n", (304, 351), False, 'import jpy\n'), ((374, 440), 'jpy.get_type', 'jpy.get_type', (['"""io.deephaven.plot.axisformatters.DecimalAxisFormat"""'], {}), "('io.deeph... |
from typing import Optional, List
import torch
import torch.nn as nn
from pbrl.policy.base import Mlp, Cnn, Rnn, Discrete, Continuous, Deterministic, init_weights
class Actor(nn.Module):
def __init__(
self,
obs_dim: tuple,
action_dim: int,
hidden_sizes: List[int],
... | [
"pbrl.policy.base.init_weights",
"pbrl.policy.base.Rnn",
"pbrl.policy.base.Continuous",
"pbrl.policy.base.Deterministic",
"pbrl.policy.base.Mlp",
"torch.nn.init.constant_",
"pbrl.policy.base.Discrete",
"pbrl.policy.base.Cnn"
] | [((726, 746), 'pbrl.policy.base.init_weights', 'init_weights', (['self.f'], {}), '(self.f)\n', (738, 746), False, 'from pbrl.policy.base import Mlp, Cnn, Rnn, Discrete, Continuous, Deterministic, init_weights\n'), ((1106, 1135), 'pbrl.policy.base.init_weights', 'init_weights', (['self.dist', '(0.01)'], {}), '(self.dist... |
import numpy as np
def distances_to_point(lat_point, lon_point, lats, lons):
"""Method to calculate distances between a project and an array of lats and lons
:Parameters:
lat_project: float
Project latitude
lon_project: float
Project longitude
lats: np.array
... | [
"numpy.sin",
"numpy.sqrt",
"numpy.cos",
"numpy.deg2rad"
] | [((523, 544), 'numpy.deg2rad', 'np.deg2rad', (['lat_point'], {}), '(lat_point)\n', (533, 544), True, 'import numpy as np\n'), ((562, 583), 'numpy.deg2rad', 'np.deg2rad', (['lon_point'], {}), '(lon_point)\n', (572, 583), True, 'import numpy as np\n'), ((634, 650), 'numpy.deg2rad', 'np.deg2rad', (['lats'], {}), '(lats)\n... |
# -*- coding: utf-8 -*-
"""force sync_translation after migrate for unit tests"""
import sys
from django.conf import settings
from django.core.management import call_command
from django.core.management.commands import migrate
from django.utils.six import StringIO
class Command(migrate.Command):
"""migrate"""
... | [
"django.utils.six.StringIO",
"django.core.management.call_command"
] | [((802, 812), 'django.utils.six.StringIO', 'StringIO', ([], {}), '()\n', (810, 812), False, 'from django.utils.six import StringIO\n'), ((891, 976), 'django.core.management.call_command', 'call_command', (['"""sync_translation_fields"""'], {'interactive': '(False)', 'stdout': 'silent_stdout'}), "('sync_translation_fiel... |
import contextlib
from datetime import timedelta
from Engine import GGame
def spawn(delay, activity):
GGame.AddDelayedActivity(delay, activity)
| [
"Engine.GGame.AddDelayedActivity"
] | [((105, 146), 'Engine.GGame.AddDelayedActivity', 'GGame.AddDelayedActivity', (['delay', 'activity'], {}), '(delay, activity)\n', (129, 146), False, 'from Engine import GGame\n')] |
# -*- coding: utf-8 -*-
#
# ***********************************************************************************
# MIT License
#
# Copyright (c) 2020 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# i... | [
"ctypes.byref",
"collections.namedtuple",
"six.add_metaclass"
] | [((3596, 3661), 'collections.namedtuple', 'namedtuple', (['"""ColorCoordinates"""', "['red', 'green', 'blue', 'white']"], {}), "('ColorCoordinates', ['red', 'green', 'blue', 'white'])\n", (3606, 3661), False, 'from collections import namedtuple\n'), ((3678, 3717), 'collections.namedtuple', 'namedtuple', (['"""RedCoordi... |
# Generated by Django 3.0.11 on 2021-03-22 22:07
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("users", "0008_remove_old_fields"),
]
operations = [
migrations.AlterField(
model_name="institu... | [
"django.db.models.OneToOneField",
"django.db.migrations.AlterModelOptions"
] | [((485, 638), 'django.db.migrations.AlterModelOptions', 'migrations.AlterModelOptions', ([], {'name': '"""institutionfontys"""', 'options': "{'verbose_name': 'Member of Fontys', 'verbose_name_plural': 'Members of Fontys'\n }"}), "(name='institutionfontys', options={\n 'verbose_name': 'Member of Fontys', 'verbose_... |
# Copyright 2021 DeepMind Technologies Limited.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | [
"tensorflow.compat.v2.pad",
"tensorflow.compat.v2.reshape",
"tensorflow.compat.v2.constant",
"neural_lns.preprocessor.Preprocessor",
"tensorflow.compat.v2.round",
"tensorflow.compat.v2.data.TFRecordDataset",
"tensorflow.compat.v2.expand_dims",
"tensorflow.compat.v2.shape",
"tensorflow.compat.v2.conc... | [((1538, 1703), 'ml_collections.ConfigDict', 'ml_collections.ConfigDict', (["{'seed': 42, 'time_limit_seconds': 60 * 10, 'separating_maxroundsroot': 0,\n 'conflict_enable': False, 'heuristics_emphasis': 'off'}"], {}), "({'seed': 42, 'time_limit_seconds': 60 * 10,\n 'separating_maxroundsroot': 0, 'conflict_enable'... |
#!/usr/bin/env python3
import sys
import os
import json
import networkx as nx
import math
from networkx.algorithms import approximation as approx
import time
from itertools import groupby as g
from operator import itemgetter
from graphFunctions import *
import csv
import configparser
import logging
#from networkx.read... | [
"json.dump",
"os.path.isabs",
"logging.error",
"logging.debug",
"networkx.write_gml",
"networkx.complement",
"networkx.readwrite.json_graph.node_link_data",
"time.time",
"logging.info",
"networkx.Graph",
"networkx.get_node_attributes",
"networkx.read_gml",
"configparser.ConfigParser",
"ope... | [((491, 518), 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {}), '()\n', (516, 518), False, 'import configparser\n'), ((1669, 1695), 'logging.debug', 'logging.debug', (['""" ========"""'], {}), "(' ========')\n", (1682, 1695), False, 'import logging\n'), ((1697, 1782), 'logging.info', 'logging.info', (... |
# -*- coding: utf-8 -*-
from fabric.api import env, local, puts
import fabric.contrib.project as project
import os
import sys
PY3 = sys.version_info > (3,)
# Local path configuration (can be absolute or relative to fabfile)
env.deploy_path = 'output'
DEPLOY_PATH = env.deploy_path
# Remote server configuration
env.u... | [
"jinja2.Template",
"os.path.isdir",
"os.path.dirname",
"os.path.exists",
"bs4.BeautifulSoup",
"datetime.datetime.now",
"re.sub"
] | [((1373, 1396), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (1394, 1396), False, 'import datetime\n'), ((2103, 2133), 're.sub', 're.sub', (['"""--+"""', '"""-"""', 'normalized'], {}), "('--+', '-', normalized)\n", (2109, 2133), False, 'import re\n'), ((2153, 2186), 're.sub', 're.sub', (['"""^-+"... |
# array module example
import sample
import array
a = array.array('d', [1, -3, 4, 7, 2, 0])
PETSc.Sys.Print(a)
sample.clip(a, 1, 4, a)
PETSc.Sys.Print(a)
# numpy example
import numpy
b = numpy.random.uniform(-10, 10, size=1000000)
PETSc.Sys.Print(b)
c = numpy.zeros_like(b)
PETSc.Sys.Print(c)
sample.c... | [
"numpy.random.uniform",
"numpy.zeros_like",
"sample.clip2d",
"array.array",
"timeit.timeit",
"sample.clip"
] | [((59, 96), 'array.array', 'array.array', (['"""d"""', '[1, -3, 4, 7, 2, 0]'], {}), "('d', [1, -3, 4, 7, 2, 0])\n", (70, 96), False, 'import array\n'), ((118, 141), 'sample.clip', 'sample.clip', (['a', '(1)', '(4)', 'a'], {}), '(a, 1, 4, a)\n', (129, 141), False, 'import sample\n'), ((202, 245), 'numpy.random.uniform',... |
import os
import random
import tweepy
import redis
CONSUMER_KEY = os.environ.get('TWITTER_CONSUMER_KEY')
CONSUMER_SECRET = os.environ.get('TWITTER_CONSUMER_SECRET')
ACCESS_TOKEN = os.environ.get('TWITTER_ACCESS_TOKEN')
ACCESS_TOKEN_SECRET = os.environ.get('TWITTER_ACCESS_TOKEN_SECRET')
r = redis.from_url(os.environ.g... | [
"os.environ.get",
"tweepy.OAuthHandler",
"random.choice",
"tweepy.API"
] | [((67, 105), 'os.environ.get', 'os.environ.get', (['"""TWITTER_CONSUMER_KEY"""'], {}), "('TWITTER_CONSUMER_KEY')\n", (81, 105), False, 'import os\n'), ((124, 165), 'os.environ.get', 'os.environ.get', (['"""TWITTER_CONSUMER_SECRET"""'], {}), "('TWITTER_CONSUMER_SECRET')\n", (138, 165), False, 'import os\n'), ((181, 219)... |
# -*- coding: utf-8 -*-
# *****************************************************************************
# NICOS, the Networked Instrument Control System of the MLZ
# Copyright (c) 2009-2021 by the NICOS contributors (see AUTHORS)
#
# This program is free software; you can redistribute it and/or modify it under
# the t... | [
"nicos.core.sessions.simple.NoninteractiveSession._notify_systemd",
"nicos.protocols.cache.cache_load",
"nicos.core.sessions.simple.NoninteractiveSession._deviceNotFound",
"nicos.core.Override",
"nicos.core.sessions.simple.NoninteractiveSession.getDevice"
] | [((2206, 2231), 'nicos.core.Override', 'Override', ([], {'mandatory': '(False)'}), '(mandatory=False)\n', (2214, 2231), False, 'from nicos.core import POLLER, Device, DeviceAlias, Override\n'), ((4047, 4143), 'nicos.core.sessions.simple.NoninteractiveSession.getDevice', 'NoninteractiveSession.getDevice', (['self', 'dev... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-06-17 15:31
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('wagtailcore', '0023_alter_page_revision_on_delete_behaviour'... | [
"django.db.models.CharField",
"django.db.models.URLField",
"django.db.models.OneToOneField",
"django.db.models.AutoField"
] | [((1324, 1456), 'django.db.models.CharField', 'models.CharField', ([], {'help_text': '"""Hex ref colour of link and background gradient, use #23b0b0 for default blue"""', 'max_length': '(255)'}), "(help_text=\n 'Hex ref colour of link and background gradient, use #23b0b0 for default blue'\n , max_length=255)\n", ... |
import os
from pathlib import *
p = PurePath('/etc')
print(os.fspath(p))
| [
"os.fspath"
] | [((59, 71), 'os.fspath', 'os.fspath', (['p'], {}), '(p)\n', (68, 71), False, 'import os\n')] |
# Generated by Django 3.2.7 on 2021-12-13 17:40
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('awardsapp', '0003_auto_2... | [
"django.db.models.BigAutoField",
"django.db.models.IntegerField",
"django.db.migrations.swappable_dependency",
"django.db.models.ForeignKey"
] | [((227, 284), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (258, 284), False, 'from django.db import migrations, models\n'), ((465, 561), 'django.db.models.BigAutoField', 'models.BigAutoField', ([], {'auto_created': '... |