code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
"""
Copyright 2016-2017 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at
http://aws.amazon.com/apache2.0/
or in the "license" file accompany... | [
"cfn_tools.odict.ODict",
"pickle.dumps",
"pytest.raises",
"copy.deepcopy",
"pickle.loads"
] | [((743, 750), 'cfn_tools.odict.ODict', 'ODict', ([], {}), '()\n', (748, 750), False, 'from cfn_tools.odict import ODict\n'), ((974, 1005), 'cfn_tools.odict.ODict', 'ODict', (["(('one', 1), ('two', 2))"], {}), "((('one', 1), ('two', 2)))\n", (979, 1005), False, 'from cfn_tools.odict import ODict\n'), ((1233, 1240), 'cfn... |
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from pex.crawler import Crawler
from pex.fetcher import PyPIFetcher
from pex.iterator import Iterator
from pex.package import SourcePackage
from pex.third_party.pkg_resources import Requir... | [
"pex.iterator.Iterator",
"mock.create_autospec",
"pex.third_party.pkg_resources.Requirement.parse",
"pex.fetcher.PyPIFetcher"
] | [((441, 485), 'mock.create_autospec', 'mock.create_autospec', (['Crawler'], {'spec_set': '(True)'}), '(Crawler, spec_set=True)\n', (461, 485), False, 'import mock\n'), ((538, 568), 'pex.iterator.Iterator', 'Iterator', ([], {'crawler': 'crawler_mock'}), '(crawler=crawler_mock)\n', (546, 568), False, 'from pex.iterator i... |
import setuptools
setuptools.setup(
name="neuroglia",
version="0.1.0",
url="https://github.com/AllenInstitute/neuroglia",
author="<NAME>",
author_email="<EMAIL>",
description="scikit-learn compatible transformers for neural data science",
packages=setuptools.find_packages(),
install... | [
"setuptools.find_packages"
] | [((280, 306), 'setuptools.find_packages', 'setuptools.find_packages', ([], {}), '()\n', (304, 306), False, 'import setuptools\n')] |
# 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.
import logging
import os
import signal
import threading
from torch import nn
logger = logging.getLogger(__name__)
class DistributedTimeou... | [
"logging.getLogger",
"threading.Event",
"os.kill",
"os.getpid"
] | [((267, 294), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (284, 294), False, 'import logging\n'), ((1227, 1244), 'threading.Event', 'threading.Event', ([], {}), '()\n', (1242, 1244), False, 'import threading\n'), ((2986, 3018), 'os.kill', 'os.kill', (['parent_pid', 'self.signal'], {}),... |
from django.contrib import admin
from django.urls import path, include
from mpulseapp.views import MemberView, MemberCreate, FileUploadView
urlpatterns = [
#Path for admin page, mainly to check on model instamces instead of using SQLite DB browser
path('admin/', admin.site.urls),
#Path for REST Framework aut... | [
"django.urls.include",
"mpulseapp.views.MemberCreate.as_view",
"mpulseapp.views.FileUploadView.as_view",
"django.urls.path",
"mpulseapp.views.MemberView.as_view"
] | [((255, 286), 'django.urls.path', 'path', (['"""admin/"""', 'admin.site.urls'], {}), "('admin/', admin.site.urls)\n", (259, 286), False, 'from django.urls import path, include\n'), ((364, 394), 'django.urls.include', 'include', (['"""rest_framework.urls"""'], {}), "('rest_framework.urls')\n", (371, 394), False, 'from d... |
from stacker.context import Context
from stacker.config import Config
from stacker.variables import Variable
from stacker_blueprints.network import Network
from stacker.blueprints.testutil import BlueprintTestCase
class TestNetwork(BlueprintTestCase):
def setUp(self):
self.ctx = Context(config=Config({'na... | [
"stacker_blueprints.network.Network",
"stacker.variables.Variable",
"stacker.config.Config"
] | [((614, 637), 'stacker_blueprints.network.Network', 'Network', (['name', 'self.ctx'], {}), '(name, self.ctx)\n', (621, 637), False, 'from stacker_blueprints.network import Network\n'), ((806, 820), 'stacker.variables.Variable', 'Variable', (['k', 'v'], {}), '(k, v)\n', (814, 820), False, 'from stacker.variables import ... |
# RS_SGS100A.py class, to perform the communication between the Wrapper and the device
# <NAME> <<EMAIL>>, 2015
#
# 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,... | [
"logging.debug",
"visa.ResourceManager",
"instrument.Instrument.__init__",
"numpy.finfo",
"logging.info",
"numpy.round"
] | [((1437, 1501), 'logging.info', 'logging.info', (["(__name__ + ' : Initializing instrument RS_SGS100A')"], {}), "(__name__ + ' : Initializing instrument RS_SGS100A')\n", (1449, 1501), False, 'import logging\n'), ((1510, 1560), 'instrument.Instrument.__init__', 'Instrument.__init__', (['self', 'name'], {'tags': "['physi... |
import sys
from monosi.cli import CliParser
def main():
parser = CliParser()
parser.parse(sys.argv)
if __name__ == "__main__":
main()
| [
"monosi.cli.CliParser"
] | [((67, 78), 'monosi.cli.CliParser', 'CliParser', ([], {}), '()\n', (76, 78), False, 'from monosi.cli import CliParser\n')] |
'''
<NAME>
<NAME>
01/05/2017 version 0.7
'''
from pyactor.context import sleep, interval
from pyactor.exceptions import TimeoutError
class Member(object):
_tell = ['multicast', 'receive', 'process_msg', 'process_queue',
'init_start', 'announce']
_ask = ['get_message', 'get_queue']
def __ini... | [
"pyactor.context.sleep",
"pyactor.context.interval"
] | [((619, 665), 'pyactor.context.interval', 'interval', (['self.host', '(6)', 'self.proxy', '"""announce"""'], {}), "(self.host, 6, self.proxy, 'announce')\n", (627, 665), False, 'from pyactor.context import sleep, interval\n'), ((916, 933), 'pyactor.context.sleep', 'sleep', (['self.delay'], {}), '(self.delay)\n', (921, ... |
from sympy import *
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import math
# DH parameters of UR5 Robots
# a = [0.00000, -0.42500, -0.39225, 0.00000, 0.00000, 0.0000]
# d = [0.089159, 0.00000, 0.00000, 0.10915, 0.09465, 0.0823]
# alpha = [ 1.570796327, 0, 0, 1.570796327, -1.5707963... | [
"matplotlib.pyplot.pause",
"matplotlib.pyplot.figure",
"mpl_toolkits.mplot3d.Axes3D",
"matplotlib.pyplot.show"
] | [((2711, 2723), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (2721, 2723), True, 'import matplotlib.pyplot as plt\n'), ((2729, 2740), 'mpl_toolkits.mplot3d.Axes3D', 'Axes3D', (['fig'], {}), '(fig)\n', (2735, 2740), False, 'from mpl_toolkits.mplot3d import Axes3D\n'), ((3737, 3747), 'matplotlib.pyplot.sho... |
# -*- coding:utf-8 -*-
"""
"""
import numpy as np
from hyperts.macro_estimators import ProphetForecastEstimator, \
VARForecastEstimator, TSFClassificationEstimator
from hyperts.transformers import TimeSeriesHyperTransformer
from hyperts.utils import consts
from hypernets.tabular import column_selector as tcs
fr... | [
"hypernets.searchers.random_searcher.RandomSearcher",
"hypernets.core.ops.Optional",
"hypernets.pipeline.transformers.StandardScaler",
"hypernets.core.search_space.HyperSpace",
"hypernets.pipeline.base.DataFrameMapper",
"hypernets.pipeline.transformers.MinMaxScaler",
"hypernets.core.ops.HyperInput",
"... | [((711, 739), 'hypernets.utils.logging.get_logger', 'logging.get_logger', (['__name__'], {}), '(__name__)\n', (729, 739), False, 'from hypernets.utils import logging, get_params\n'), ((2103, 2195), 'hypernets.pipeline.base.Pipeline', 'Pipeline', (['steps'], {'columns': 'cs', 'name': 'f"""categorical_covariable_transfor... |
# -*- coding: utf-8 -*-
# !/usr/bin/env python
"""
__version__ = "1.0"
__license__ = "Copyright (c) 2014-2010, levp-inc, All rights reserved."
__author__ = "madeling <<EMAIL>>"
"""
from django.conf.urls import patterns, url
from account.views import LoginView, LogOutView
urlpatterns = patterns('',
... | [
"account.views.LogOutView.as_view",
"account.views.LoginView.as_view"
] | [((343, 362), 'account.views.LoginView.as_view', 'LoginView.as_view', ([], {}), '()\n', (360, 362), False, 'from account.views import LoginView, LogOutView\n'), ((420, 440), 'account.views.LogOutView.as_view', 'LogOutView.as_view', ([], {}), '()\n', (438, 440), False, 'from account.views import LoginView, LogOutView\n'... |
__all__ = ['conf']
from paytm.settings import Configuration
conf = Configuration()
| [
"paytm.settings.Configuration"
] | [((68, 83), 'paytm.settings.Configuration', 'Configuration', ([], {}), '()\n', (81, 83), False, 'from paytm.settings import Configuration\n')] |
from sklearn.cluster import KMeans
import Data as dt
import ClientClass
class Cluster_Kmeans:
def __init__(self):
self.num_cluster=10
self.ccs=[]
self.kmeans=None
def fit(self,training_data,testing_data,num_cluster=10):
headers = training_data.headers
features_traini... | [
"sklearn.cluster.KMeans",
"ClientClass.ClientClass",
"Data.split_data_to_2",
"Data.load_csv",
"Data.DataSource"
] | [((3263, 3313), 'Data.load_csv', 'dt.load_csv', (['"""../data/2CASP.csv"""', 'fields', 'y_column'], {}), "('../data/2CASP.csv', fields, y_column)\n", (3274, 3313), True, 'import Data as dt\n'), ((7183, 7220), 'Data.split_data_to_2', 'dt.split_data_to_2', (['data'], {'percent': '(0.7)'}), '(data, percent=0.7)\n', (7201,... |
from setuptools import setup, find_packages
import torch
from torch.utils.cpp_extension import CppExtension, CUDAExtension, CUDA_HOME
ext_modules = [
CppExtension('sym3eig_cpu', ['cpu/sym3eig.cpp']),
]
cmdclass = {'build_ext': torch.utils.cpp_extension.BuildExtension}
if CUDA_HOME is not None:
ext_modules += ... | [
"torch.utils.cpp_extension.CppExtension",
"torch.utils.cpp_extension.CUDAExtension",
"setuptools.find_packages"
] | [((155, 203), 'torch.utils.cpp_extension.CppExtension', 'CppExtension', (['"""sym3eig_cpu"""', "['cpu/sym3eig.cpp']"], {}), "('sym3eig_cpu', ['cpu/sym3eig.cpp'])\n", (167, 203), False, 'from torch.utils.cpp_extension import CppExtension, CUDAExtension, CUDA_HOME\n'), ((330, 407), 'torch.utils.cpp_extension.CUDAExtensio... |
import asyncio
import time
import json
import socket
import sys
from datetime import datetime
from gmqtt import Client as MQTTClient
from cover import Cover
from alarm_control_panel import Alarm
# Globals
# MQTT
from light import Light
from boiler import Boiler
from switch import Switch
tydom_topic = "+/tydom/#"
ref... | [
"json.loads",
"sys.exit",
"gmqtt.Client",
"alarm_control_panel.Alarm.put_alarm_state",
"asyncio.sleep",
"socket.gethostname",
"time.time",
"switch.Switch.put_switch_state"
] | [((383, 403), 'socket.gethostname', 'socket.gethostname', ([], {}), '()\n', (401, 403), False, 'import socket\n'), ((1329, 1347), 'gmqtt.Client', 'MQTTClient', (['adress'], {}), '(adress)\n', (1339, 1347), True, 'from gmqtt import Client as MQTTClient\n'), ((2927, 2937), 'sys.exit', 'sys.exit', ([], {}), '()\n', (2935,... |
# QEMU library
#
# Copyright (C) 2015-2016 Red Hat Inc.
# Copyright (C) 2012 IBM Corp.
#
# Authors:
# <NAME> <<EMAIL>>
#
# This work is licensed under the terms of the GNU GPL, version 2. See
# the COPYING file in the top-level directory.
#
# Based on qmp.py.
#
import errno
import string
import os
import sys
import ... | [
"string.maketrans",
"os.path.exists",
"subprocess.Popen",
"os.path.join",
"os.getpid",
"os.remove"
] | [((5320, 5346), 'string.maketrans', 'string.maketrans', (['"""_"""', '"""-"""'], {}), "('_', '-')\n", (5336, 5346), False, 'import string\n'), ((816, 853), 'os.path.join', 'os.path.join', (['test_dir', "(name + '.log')"], {}), "(test_dir, name + '.log')\n", (828, 853), False, 'import os\n'), ((2387, 2466), 'subprocess.... |
import re
import datetime
from billy.scrape.events import Event, EventScraper
from openstates.utils import LXMLMixin
import pytz
class AKEventScraper(EventScraper, LXMLMixin):
jurisdiction = 'ak'
_TZ = pytz.timezone('US/Alaska')
_DATETIME_FORMAT = '%m/%d/%Y %I:%M %p'
def scrape(self, session, chamb... | [
"pytz.timezone"
] | [((214, 240), 'pytz.timezone', 'pytz.timezone', (['"""US/Alaska"""'], {}), "('US/Alaska')\n", (227, 240), False, 'import pytz\n')] |
from __future__ import absolute_import, division, print_function, unicode_literals
import os
import unittest
from mock import patch
from nose.tools import assert_equals, assert_raises
assert_equals.__self__.maxDiff = None
import pygenie
def mock_to_attachment(att):
if isinstance(att, dict):
return {... | [
"mock.patch",
"mock.patch.dict",
"pygenie.adapter.genie_2.get_payload",
"pygenie.jobs.HiveJob",
"os.path.join",
"os.path.realpath",
"pygenie.conf.GenieConf",
"os.path.basename",
"pygenie.adapter.genie_3.get_payload",
"nose.tools.assert_equals"
] | [((452, 511), 'mock.patch.dict', 'patch.dict', (['"""os.environ"""', "{'GENIE_BYPASS_HOME_CONFIG': '1'}"], {}), "('os.environ', {'GENIE_BYPASS_HOME_CONFIG': '1'})\n", (462, 511), False, 'from mock import patch\n'), ((3692, 3751), 'mock.patch.dict', 'patch.dict', (['"""os.environ"""', "{'GENIE_BYPASS_HOME_CONFIG': '1'}"... |
from django.forms import ModelForm, Form, ValidationError
from django.forms.fields import CharField
from django.core.validators import RegexValidator
from django.contrib.auth.models import User
from django.contrib.auth.forms import PasswordResetForm
from django.template import loader
from django.utils import timezone
f... | [
"django.forms.fields.CharField",
"django.utils.translation.gettext_lazy",
"django.forms.ValidationError",
"django.utils.timezone.now",
"django_countries.widgets.CountrySelectWidget",
"sorl.thumbnail.fields.ImageFormField",
"django.template.loader.render_to_string"
] | [((1476, 1492), 'sorl.thumbnail.fields.ImageFormField', 'ImageFormField', ([], {}), '()\n', (1490, 1492), False, 'from sorl.thumbnail.fields import ImageFormField\n'), ((2198, 2264), 'django.forms.fields.CharField', 'CharField', ([], {'max_length': '(150)', 'required': '(True)', 'label': '"""ะะผั ะฟะพะปัะทะพะฒะฐัะตะปั"""'}), "(m... |
# Copyright 2019-2020 The GPflow Contributors. 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 appli... | [
"os.getenv",
"dataclasses.dataclass",
"tensorflow.as_dtype",
"dataclasses.replace",
"dataclasses.field"
] | [((5348, 5370), 'dataclasses.dataclass', 'dataclass', ([], {'frozen': '(True)'}), '(frozen=True)\n', (5357, 5370), False, 'from dataclasses import dataclass, field, replace\n'), ((3280, 3322), 'os.getenv', 'os.getenv', (['value.name'], {'default': 'value.value'}), '(value.name, default=value.value)\n', (3289, 3322), Fa... |
from __future__ import annotations
from collections import defaultdict
from dataclasses import dataclass
from puzzle_input import puzzle_input
from typing import Any
@dataclass(frozen=True)
class Position:
x: int
y: int
def __add__(self, p: Position | Any) -> Position:
if isinstance(p, Position)... | [
"puzzle_input.puzzle_input",
"dataclasses.dataclass",
"collections.defaultdict"
] | [((170, 192), 'dataclasses.dataclass', 'dataclass', ([], {'frozen': '(True)'}), '(frozen=True)\n', (179, 192), False, 'from dataclasses import dataclass\n'), ((2936, 2959), 'collections.defaultdict', 'defaultdict', (['(lambda : 0)'], {}), '(lambda : 0)\n', (2947, 2959), False, 'from collections import defaultdict\n'), ... |
import threading
from tempus.edge.proto import TrackConfig_pb2 as TC
config_lock = threading.Lock()
CONFIG_PATH="/mnt/config/config.pb"
tc = TC.TrackConfig()
def updateTrackConfig():
try:
with config_lock:
tc.Clear()
tc.ParseFromString(open(CONFIG_PATH, "rb").read())
print("succesfully updated... | [
"threading.Lock",
"tempus.edge.proto.TrackConfig_pb2.TrackConfig"
] | [((84, 100), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (98, 100), False, 'import threading\n'), ((142, 158), 'tempus.edge.proto.TrackConfig_pb2.TrackConfig', 'TC.TrackConfig', ([], {}), '()\n', (156, 158), True, 'from tempus.edge.proto import TrackConfig_pb2 as TC\n')] |
# vim:foldmethod=marker:foldlevel=0
import asyncio
import ipaddress
import itertools
import logging
import os
import socket
import struct
import sys
import typing
import unittest
import unittest.mock
from dataclasses import replace
import someip.header as hdr
import someip.config as cfg
import someip.sd as sd
logging... | [
"logging.getLogger",
"someip.header.SOMEIPSDEntry",
"unittest.mock.call.reboot_detected",
"ipaddress.IPv4Address",
"unittest.mock.call.service_stopped",
"someip.sd.ServiceDiscover",
"sys.platform.startswith",
"someip.config.Service.from_offer_entry",
"unittest.mock.call.service_offered",
"someip.s... | [((313, 342), 'logging.captureWarnings', 'logging.captureWarnings', (['(True)'], {}), '(True)\n', (336, 342), False, 'import logging\n'), ((343, 383), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG'}), '(level=logging.DEBUG)\n', (362, 383), False, 'import logging\n'), ((638, 668), 'sys.plat... |
from joblib import Parallel, delayed
import queue
import os
import time
# Define number of GPUs available
GPU_available = [0, 1]
N_GPU = len(GPU_available)
models = ["EleutherAI/gpt-j-6B"] #"EleutherAI/gpt-neo-1.3B", "EleutherAI/gpt-neo-2.7B", ]
datasets = ["flowMWOZ", "top", "dialKG-parse"]
template = "python main_... | [
"joblib.Parallel",
"joblib.delayed",
"queue.Queue"
] | [((525, 551), 'queue.Queue', 'queue.Queue', ([], {'maxsize': 'N_GPU'}), '(maxsize=N_GPU)\n', (536, 551), False, 'import queue\n'), ((855, 898), 'joblib.Parallel', 'Parallel', ([], {'n_jobs': 'N_GPU', 'backend': '"""threading"""'}), "(n_jobs=N_GPU, backend='threading')\n", (863, 898), False, 'from joblib import Parallel... |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... | [
"qiskit_dynamics.type_utils.to_array",
"qiskit_dynamics.type_utils.to_numeric_matrix_type",
"scipy.sparse.issparse",
"numpy.diag",
"numpy.exp",
"qiskit.QiskitError",
"scipy.sparse.csr_matrix",
"qiskit_dynamics.type_utils.to_BCOO",
"numpy.linalg.eigh",
"jax.experimental.sparse.sparsify",
"qiskit.... | [((1052, 1080), 'jax.experimental.sparse.sparsify', 'jsparse.sparsify', (['jnp.matmul'], {}), '(jnp.matmul)\n', (1068, 1080), True, 'from jax.experimental import sparse as jsparse\n'), ((23189, 23202), 'qiskit_dynamics.type_utils.to_array', 'to_array', (['mat'], {}), '(mat)\n', (23197, 23202), False, 'from qiskit_dynam... |
import argparse
import json
import logging
import logging.config
import os
import sys
import migrations.migrate
from auth.authorization import create_group_provider, Authorizer
from communications.alerts_service import AlertsService
from config.config_service import ConfigService
from execution.execution_service impor... | [
"logging.getLogger",
"config.config_service.ConfigService",
"model.server_conf.from_json",
"execution.execution_service.ExecutionService",
"features.file_download_feature.FileDownloadFeature",
"utils.file_utils.read_file",
"sys.exit",
"web.server.init",
"logging.info",
"features.file_upload_featur... | [((1053, 1113), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Launch script-server."""'}), "(description='Launch script-server.')\n", (1076, 1113), False, 'import argparse\n'), ((1490, 1524), 'os.path.isabs', 'os.path.isabs', (["args['config_file']"], {}), "(args['config_file'])\n", (15... |
# Generated by Django 3.2.9 on 2021-12-19 19:34
import django.contrib.postgres.indexes
import django.contrib.postgres.search
from django.db import migrations, models
from machina_search import settings
class Migration(migrations.Migration):
initial = True
dependencies = [
]
if settings.SEARCH_ENGIN... | [
"django.db.models.IntegerField"
] | [((492, 542), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'unique': '(True)', 'primary_key': '(True)'}), '(unique=True, primary_key=True)\n', (511, 542), False, 'from django.db import migrations, models\n')] |
from datetime import datetime, timedelta
from backup.config import Config, Setting
from backup.time import Time
from backup.exceptions import GoogleCredGenerateError, KnownError, LogicError, ensureKey
from aiohttp import ClientSession
from injector import inject
from .driverequests import DriveRequester
from backup.lo... | [
"backup.exceptions.ensureKey",
"backup.creds.Creds.load",
"backup.exceptions.GoogleCredGenerateError",
"backup.exceptions.LogicError",
"backup.logger.getLogger",
"datetime.timedelta"
] | [((398, 417), 'backup.logger.getLogger', 'getLogger', (['__name__'], {}), '(__name__)\n', (407, 417), False, 'from backup.logger import getLogger\n'), ((946, 966), 'datetime.timedelta', 'timedelta', ([], {'seconds': '(5)'}), '(seconds=5)\n', (955, 966), False, 'from datetime import datetime, timedelta\n'), ((5362, 5460... |
import re
import feedparser
from django.conf import settings
def get_news_feeds():
img_re = re.compile(r'<img.*?src=["\']+(.*?)["\']+/>')
feed_result = feedparser.parse(settings.NEWS_FEED_URL)
for entity in feed_result.entries:
img_search = img_re.search(entity.description)
try:
... | [
"feedparser.parse",
"re.compile"
] | [((99, 147), 're.compile', 're.compile', (['"""<img.*?src=["\\\\\']+(.*?)["\\\\\']+/>"""'], {}), '(\'<img.*?src=["\\\\\\\']+(.*?)["\\\\\\\']+/>\')\n', (109, 147), False, 'import re\n'), ((163, 203), 'feedparser.parse', 'feedparser.parse', (['settings.NEWS_FEED_URL'], {}), '(settings.NEWS_FEED_URL)\n', (179, 203), False... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# License: Apache-2.0
import argparse
from android_backup import AndroidBackup
import sys
def _description():
plat = sys.platform
supported_platform = plat != 'Pocket PC' and (plat != 'win32' or
'ANSICON' in os.env... | [
"sys.stdout.isatty"
] | [((375, 394), 'sys.stdout.isatty', 'sys.stdout.isatty', ([], {}), '()\n', (392, 394), False, 'import sys\n')] |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2017 Nippon Telegraph and Telephone 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.apache.org/l... | [
"argparse.ArgumentParser",
"grpc.insecure_channel",
"nlaapi.nlaapi_pb2.GetNeighsRequest",
"nlaapi.nlaapi_pb2.GetLinksRequest",
"nlaapi.nlaapi_pb2.GetMplssRequest",
"nlaapi.nlaapi_pb2.MonNetlinkRequest",
"nlaapi.nlaapi_pb2.GetRoutesRequest",
"nlaapi.nlaapi_pb2.GetAddrsRequest",
"nlaapi.nlaapi_pb2.NLA... | [((2539, 2564), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (2562, 2564), False, 'import argparse\n'), ((2869, 2901), 'grpc.insecure_channel', 'grpc.insecure_channel', (['opts.addr'], {}), '(opts.addr)\n', (2890, 2901), False, 'import grpc\n'), ((2913, 2936), 'nlaapi.nlaapi_pb2.NLAApiStub', ... |
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
#############################################################################
# Copyright (c) 2020 Huawei Technologies Co.,Ltd.
#
# openGauss is licensed under Mulan PSL v2.
# You can use this software according to the terms
# and conditions of the Mulan PSL v2.
# You may o... | [
"gspylib.common.Common.DefaultValue.execCommandLocally",
"gspylib.os.gsfile.g_file.deleteLine",
"gspylib.common.Common.DefaultValue.getTmpDirFromEnv",
"re.compile",
"os.getuid",
"gspylib.common.ParameterParsecheck.Parameter.checkParaVaild",
"time.sleep",
"gspylib.common.Common.ClusterCommand.remoteSQL... | [((1087, 1124), 'sys.path.append', 'sys.path.append', (["(sys.path[0] + '/../')"], {}), "(sys.path[0] + '/../')\n", (1102, 1124), False, 'import sys\n'), ((3907, 3946), 'gspylib.common.Common.DefaultValue.getInstallDir', 'DefaultValue.getInstallDir', (['g_opts.user'], {}), '(g_opts.user)\n', (3933, 3946), False, 'from ... |
import base64
from _hashlib import HASH
from dataclasses import dataclass
from hashlib import md5
from io import DEFAULT_BUFFER_SIZE
from typing import IO, Callable
@dataclass()
class Hash(object):
_h: HASH
def digest(self) -> bytes:
return self._h.digest()
def hexdigest(self) -> str:
re... | [
"dataclasses.dataclass"
] | [((168, 179), 'dataclasses.dataclass', 'dataclass', ([], {}), '()\n', (177, 179), False, 'from dataclasses import dataclass\n')] |
#!/usr/bin/env python3
# -> Use this script to upload .wav files on your CUCM Cluster.
# -> MoH Files cannot contain spaces in the file names.
# -> Use the template YaML file to provide CUCM Cluster details.
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.u... | [
"ntpath.basename",
"selenium.webdriver.Chrome",
"time.sleep",
"yaml.safe_load",
"sys.exit",
"time.time",
"itertools.repeat"
] | [((762, 826), 'selenium.webdriver.Chrome', 'webdriver.Chrome', ([], {'executable_path': "settings['CHROME_DRIVER_PATH']"}), "(executable_path=settings['CHROME_DRIVER_PATH'])\n", (778, 826), False, 'from selenium import webdriver\n'), ((1189, 1202), 'time.sleep', 'time.sleep', (['(2)'], {}), '(2)\n', (1199, 1202), False... |
#!/usr/bin/env python3
# coding: utf-8
# Copyright 2016 <NAME>, https://github.com/tywtyw2002, and https://github.com/treedust
#
# 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:/... | [
"urllib.parse.urlparse",
"socket.socket",
"sys.exit"
] | [((1262, 1311), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_STREAM'], {}), '(socket.AF_INET, socket.SOCK_STREAM)\n', (1275, 1311), False, 'import socket\n'), ((2806, 2819), 'urllib.parse.urlparse', 'urlparse', (['url'], {}), '(url)\n', (2814, 2819), False, 'from urllib.parse import urlparse\n'), ... |
import gym
import numpy as np
from metaworlds.core import Serializable
from metaworlds.envs import Step
from metaworlds.misc.overrides import overrides
class SlidingMemEnv(gym.Wrapper, Serializable):
def __init__(
self,
env,
n_steps=4,
axis=0,
):
super(... | [
"numpy.zeros",
"numpy.repeat",
"metaworlds.envs.Step"
] | [((608, 664), 'numpy.zeros', 'np.zeros', (['self.observation_space.shape'], {'dtype': 'np.float32'}), '(self.observation_space.shape, dtype=np.float32)\n', (616, 664), True, 'import numpy as np\n'), ((1708, 1747), 'metaworlds.envs.Step', 'Step', (['self.buffer', 'reward', 'done'], {}), '(self.buffer, reward, done, **in... |
import requests
import os
os.environ.setdefault('PYWIKIBOT2_NO_USER_CONFIG', '1')
import pywikibot
#https://stackoverflow.com/questions/30556857/creating-a-static-class-with-no-instances
#pฤrbaudฤซt, vai ลกis normฤli strฤdฤ, ja izsauc vairฤkas reizes un daลพฤdas metodes
class WikipediaAPI(object):
@staticmethod
def get... | [
"os.environ.setdefault",
"pywikibot.Site",
"pywikibot.Page"
] | [((26, 81), 'os.environ.setdefault', 'os.environ.setdefault', (['"""PYWIKIBOT2_NO_USER_CONFIG"""', '"""1"""'], {}), "('PYWIKIBOT2_NO_USER_CONFIG', '1')\n", (47, 81), False, 'import os\n'), ((402, 435), 'pywikibot.Site', 'pywikibot.Site', (['wiki', '"""wikipedia"""'], {}), "(wiki, 'wikipedia')\n", (416, 435), False, 'im... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from time import sleep
from selenium.webdriver.common.by import By
from codelib.automation_testing.selenium_automation.selenium_automation.pages.base import \
BasePage
from codelib.automation_testing.selenium_automation.selenium_automation.timeunits import \
two, ... | [
"time.sleep"
] | [((2628, 2638), 'time.sleep', 'sleep', (['(200)'], {}), '(200)\n', (2633, 2638), False, 'from time import sleep\n')] |
import unittest
import HTMLTestRunnerNew
'''class Add():
def add(self,a,b):
print(a+b)
#่ฆๆฑไฝ ไปฌๅฏน่ฟไธชadd็ฑป้้ข็ๅฝๆฐ่ฟ่กๆต่ฏ
#1 2/-1 -2/0 0/-1 2/ไธ่พๅ
ฅๆฐๆฎa/ไธ่พๅ
ฅๆฐๆฎb/ไธคไธชๆฐๆฎ้ฝไธ่พๅ
ฅ
#ๅฐๆฐ
t=Add()
if t.add(1,2)==3:
print('็จไพ้่ฟ')
t.add(-1,-2)
t.add(0,0)
t.add(-1,2)
t.add(None,2)
t.add(1,None)
t.add(None,None)'''
#from class_0609 i... | [
"HTMLTestRunnerNew.HTMLTestRunner",
"unittest.TestSuite",
"unittest.TestLoader"
] | [((393, 413), 'unittest.TestSuite', 'unittest.TestSuite', ([], {}), '()\n', (411, 413), False, 'import unittest\n'), ((555, 576), 'unittest.TestLoader', 'unittest.TestLoader', ([], {}), '()\n', (574, 576), False, 'import unittest\n'), ((868, 992), 'HTMLTestRunnerNew.HTMLTestRunner', 'HTMLTestRunnerNew.HTMLTestRunner', ... |
from __future__ import annotations
import pyqtgraph as pg
from pyqtgraph import colormap as cmap
from typing import Generic, Iterator, Sequence, TypeVar, overload, MutableSequence
import numpy as np
from ._utils import convert_color_code, to_rgba
from .components import Legend, Region, ScaleBar, TextItem
from .graph_i... | [
"pyqtgraph.icons.getGraphPixmap",
"pyqtgraph.colormap.get",
"numpy.isscalar",
"pyqtgraph.PlotItem",
"pyqtgraph.ROI",
"pyqtgraph.ImageItem",
"numpy.asarray",
"pyqtgraph.HistogramLUTItem",
"pyqtgraph.mkBrush",
"numpy.array",
"numpy.arctan",
"pyqtgraph.GraphicsLayoutWidget",
"pyqtgraph.ViewBox"... | [((26167, 26198), 'typing.TypeVar', 'TypeVar', (['"""_C"""'], {'bound': 'HasViewBox'}), "('_C', bound=HasViewBox)\n", (26174, 26198), False, 'from typing import Generic, Iterator, Sequence, TypeVar, overload, MutableSequence\n'), ((13600, 13614), 'pyqtgraph.ROI', 'pg.ROI', (['(0, 0)'], {}), '((0, 0))\n', (13606, 13614)... |
###############################################################################
# Imports
import sys # Exit function
import os # OS functions
import argparse # Argument parser
import pprint # Pretty printing dicts
from datetime import datetime # Dates
# Shell commands
import subprocess
from subprocess import Popen,PI... | [
"json.loads",
"argparse.ArgumentParser",
"shlex.split",
"subprocess.Popen",
"datetime.datetime.strptime",
"sys.exit"
] | [((905, 927), 'shlex.split', 'shlex.split', (['"""kubectx"""'], {}), "('kubectx')\n", (916, 927), False, 'import shlex\n'), ((1040, 1104), 'subprocess.Popen', 'Popen', (['contexts'], {'stdout': 'subprocess.PIPE', 'universal_newlines': '(True)'}), '(contexts, stdout=subprocess.PIPE, universal_newlines=True)\n', (1045, 1... |
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
from telemetry.core.backends.chrome_inspector import tracing_backend
from telemetry.core.backends.chrome_inspector import websocket
from tel... | [
"mock.patch",
"telemetry.core.backends.chrome_inspector.tracing_backend.TracingBackend",
"telemetry.core.backends.chrome_inspector.websocket.WebSocketTimeoutException",
"telemetry.core.platform.tracing_options.TracingOptions",
"telemetry.core.platform.tracing_category_filter.TracingCategoryFilter",
"telem... | [((632, 654), 'telemetry.core.util.GetTelemetryDir', 'util.GetTelemetryDir', ([], {}), '()\n', (652, 654), False, 'from telemetry.core import util\n'), ((2593, 2625), 'telemetry.core.platform.tracing_options.TracingOptions', 'tracing_options.TracingOptions', ([], {}), '()\n', (2623, 2625), False, 'from telemetry.core.p... |
#coding:utf-8
# Author: mozman
# Purpose: svg path element
# Created: 08.09.2010
# License: MIT License
from svgwrite.base import BaseElement
from svgwrite.utils import strlist
from svgwrite.mixins import Presentation, Markers, Transform
class Path(BaseElement, Transform, Presentation, Markers):
""" The <path> ... | [
"svgwrite.utils.strlist"
] | [((2701, 2728), 'svgwrite.utils.strlist', 'strlist', (['self.commands', '""" """'], {}), "(self.commands, ' ')\n", (2708, 2728), False, 'from svgwrite.utils import strlist\n')] |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... | [
"logging.getLogger",
"openstack_dashboard.api.glance.image_create",
"django.utils.translation.ugettext_lazy",
"horizon.forms.Select"
] | [((1168, 1195), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1185, 1195), False, 'import logging\n'), ((1296, 1305), 'django.utils.translation.ugettext_lazy', '_', (['"""Name"""'], {}), "('Name')\n", (1297, 1305), True, 'from django.utils.translation import ugettext_lazy as _\n'), ((14... |
from pandac.PandaModules import *
from direct.distributed import ParentMgr
from direct.directnotify.DirectNotifyGlobal import directNotify
from direct.task import Task
from direct.showbase import LeakDetectors
from otp.otpbase import OTPGlobals
import random
class AIZoneData:
notify = directNotify.newCategory('AIZ... | [
"direct.directnotify.DirectNotifyGlobal.directNotify.newCategory",
"direct.distributed.ParentMgr.ParentMgr",
"direct.showbase.LeakDetectors.SceneGraphLeakDetector"
] | [((291, 329), 'direct.directnotify.DirectNotifyGlobal.directNotify.newCategory', 'directNotify.newCategory', (['"""AIZoneData"""'], {}), "('AIZoneData')\n", (315, 329), False, 'from direct.directnotify.DirectNotifyGlobal import directNotify\n'), ((879, 920), 'direct.directnotify.DirectNotifyGlobal.directNotify.newCateg... |
from typing import List, Dict
import logging
from gmail import GMail, Message
from .abstract_emailer import AbstractEmailer
from starter import ColorizedLogger
logger = ColorizedLogger('GmailEmailer')
class GmailEmailer(AbstractEmailer):
__slots__ = ('_handler', 'email_address', 'test_mode')
_handler: GMai... | [
"starter.ColorizedLogger",
"gmail.GMail"
] | [((171, 202), 'starter.ColorizedLogger', 'ColorizedLogger', (['"""GmailEmailer"""'], {}), "('GmailEmailer')\n", (186, 202), False, 'from starter import ColorizedLogger\n'), ((1086, 1133), 'gmail.GMail', 'GMail', ([], {'username': 'email_address', 'password': 'api_key'}), '(username=email_address, password=api_key)\n', ... |
# Copyright 2013 Cloudera 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 agreed to in writing... | [
"versioneer.get_cmdclass",
"setuptools.find_packages",
"ez_setup.use_setuptools",
"versioneer.get_version"
] | [((634, 659), 'ez_setup.use_setuptools', 'ez_setup.use_setuptools', ([], {}), '()\n', (657, 659), False, 'import ez_setup\n'), ((851, 875), 'versioneer.get_version', 'versioneer.get_version', ([], {}), '()\n', (873, 875), False, 'import versioneer\n'), ((890, 915), 'versioneer.get_cmdclass', 'versioneer.get_cmdclass', ... |
from flask import Blueprint
admin_bp : Blueprint = Blueprint("admin", __name__, template_folder='templates/admin')
from . import routes
| [
"flask.Blueprint"
] | [((52, 115), 'flask.Blueprint', 'Blueprint', (['"""admin"""', '__name__'], {'template_folder': '"""templates/admin"""'}), "('admin', __name__, template_folder='templates/admin')\n", (61, 115), False, 'from flask import Blueprint\n')] |
"""
Name: coloredComponents
Date: Jun 2019
Programmer: <NAME>, <NAME>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
If you use the 'NMF toolbox' please refer to:
[1] <NAME>, <NAME>, <NAME>, and <NAME>
NMF Toolbox: Music Processing Applications of Nonne... | [
"matplotlib.colors.rgb_to_hsv",
"matplotlib.cm.hsv",
"numpy.zeros",
"matplotlib.colors.hsv_to_rgb",
"numpy.mod"
] | [((2195, 2228), 'numpy.zeros', 'np.zeros', (['(numBins, numFrames, 3)'], {}), '((numBins, numFrames, 3))\n', (2203, 2228), True, 'import numpy as np\n'), ((2696, 2729), 'numpy.zeros', 'np.zeros', (['(numBins, numFrames, 3)'], {}), '((numBins, numFrames, 3))\n', (2704, 2729), True, 'import numpy as np\n'), ((3040, 3056)... |
"""Fixtures for testing parsers."""
import pytest
@pytest.fixture(scope="session")
def filepath_parsers_fixtures(filepath_tests):
"""Return the absolute filepath of the `tests/parsers/fixtures` folder.
.. warning:: if this file moves with respect to the `tests` folder, the implementation should change.
... | [
"pytest.fixture"
] | [((53, 84), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (67, 84), False, 'import pytest\n')] |
#This file is auto-generated. See modules.json and autogenerator.py for details
#!/usr/bin/python3
"""
get_allpages.py
MediaWiki API Demos
Demo of `Allpages` module: Get all pages whose title contains the text
"Jungle," in whole or part.
MIT License
"""
import requests
S = requests.Session()
... | [
"requests.Session"
] | [((300, 318), 'requests.Session', 'requests.Session', ([], {}), '()\n', (316, 318), False, 'import requests\n')] |
import gzip
import io
import os
import subprocess
from collections import Counter
def convert_and_filter_topk(output_dir, input_txt, top_k):
""" Convert to lowercase, count word occurrences and save top-k words to a file """
counter = Counter()
data_lower = output_dir + "." + "lower.txt.gz"
print("\n... | [
"gzip.open",
"subprocess.check_call",
"os.path.splitext",
"os.path.join",
"collections.Counter"
] | [((245, 254), 'collections.Counter', 'Counter', ([], {}), '()\n', (252, 254), False, 'from collections import Counter\n'), ((3208, 3238), 'subprocess.check_call', 'subprocess.check_call', (['subargs'], {}), '(subargs)\n', (3229, 3238), False, 'import subprocess\n'), ((596, 623), 'os.path.splitext', 'os.path.splitext', ... |
from nltk.corpus import twitter_samples
def getNegativeTweets():
return twitter_samples.strings('negative_tweets.json')
def getPositiveTweets():
return twitter_samples.strings('positive_tweets.json')
| [
"nltk.corpus.twitter_samples.strings"
] | [((78, 125), 'nltk.corpus.twitter_samples.strings', 'twitter_samples.strings', (['"""negative_tweets.json"""'], {}), "('negative_tweets.json')\n", (101, 125), False, 'from nltk.corpus import twitter_samples\n'), ((163, 210), 'nltk.corpus.twitter_samples.strings', 'twitter_samples.strings', (['"""positive_tweets.json"""... |
from django.urls import reverse
from rest_framework import serializers
from redirink.links.models import Link
class LinkSerializer(serializers.ModelSerializer):
"""
Serializer to dict for link.
"""
user = serializers.HiddenField(default=serializers.CurrentUserDefault())
from_url = serializers.Se... | [
"rest_framework.serializers.CurrentUserDefault",
"rest_framework.serializers.SerializerMethodField",
"django.urls.reverse"
] | [((306, 341), 'rest_framework.serializers.SerializerMethodField', 'serializers.SerializerMethodField', ([], {}), '()\n', (339, 341), False, 'from rest_framework import serializers\n'), ((736, 784), 'django.urls.reverse', 'reverse', (['"""links:redirect"""'], {'kwargs': "{'pk': obj.pk}"}), "('links:redirect', kwargs={'p... |
import argparse
import sys
def get_args():
parser = argparse.ArgumentParser('Interface for Inductive Dynamic Representation Learning for Link Prediction on Temporal Graphs')
# select dataset and training mode
parser.add_argument('-d', '--data', type=str, help='data sources to use, try wikipedia or reddit',
... | [
"argparse.ArgumentParser",
"sys.exit"
] | [((56, 187), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (['"""Interface for Inductive Dynamic Representation Learning for Link Prediction on Temporal Graphs"""'], {}), "(\n 'Interface for Inductive Dynamic Representation Learning for Link Prediction on Temporal Graphs'\n )\n", (79, 187), False, 'import... |
# DebFile: a Python representation of Debian .deb binary packages.
# Copyright (C) 2007-2008 <NAME> <<EMAIL>>
# 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 Softw... | [
"signal.signal",
"tarfile.open",
"debian.arfile.ArFile.__init__",
"debian.changelog.Changelog",
"io.BytesIO",
"codecs.EncodedFile",
"io.TextIOWrapper"
] | [((10232, 10278), 'debian.arfile.ArFile.__init__', 'ArFile.__init__', (['self', 'filename', 'mode', 'fileobj'], {}), '(self, filename, mode, fileobj)\n', (10247, 10278), False, 'from debian.arfile import ArFile, ArError\n'), ((6226, 6282), 'io.TextIOWrapper', 'io.TextIOWrapper', (['fobj'], {'encoding': 'encoding', 'err... |
"""
RenderPipeline
Copyright (c) 2014-2016 tobspr <<EMAIL>>
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, mo... | [
"rpcore.pynative.rp_light.RPLight.write_to_command",
"rplibs.six.moves.range",
"panda3d.core.Vec3",
"rpcore.pynative.rp_light.RPLight.__init__",
"rpcore.pynative.shadow_source.ShadowSource"
] | [((1531, 1577), 'rpcore.pynative.rp_light.RPLight.__init__', 'RPLight.__init__', (['self', 'RPLight.LT_point_light'], {}), '(self, RPLight.LT_point_light)\n', (1547, 1577), False, 'from rpcore.pynative.rp_light import RPLight\n'), ((1691, 1726), 'rpcore.pynative.rp_light.RPLight.write_to_command', 'RPLight.write_to_com... |
import ca3 as ca
g = 19
h = 24717
Fp = 48611
res = ca.pollard_rho(g, h, Fp)
assert(res == 37869)
| [
"ca3.pollard_rho"
] | [((54, 78), 'ca3.pollard_rho', 'ca.pollard_rho', (['g', 'h', 'Fp'], {}), '(g, h, Fp)\n', (68, 78), True, 'import ca3 as ca\n')] |
# Generated by Django 2.1 on 2018-08-20 08:48
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('items', '0004_auto_20180820_1202'),
]
operations = [
migrations.AlterField(
model_name='itemstatrange',
name='max',
... | [
"django.db.models.IntegerField"
] | [((336, 366), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'default': '(0)'}), '(default=0)\n', (355, 366), False, 'from django.db import migrations, models\n'), ((492, 522), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'default': '(0)'}), '(default=0)\n', (511, 522), False, 'from djan... |
# coding: utf-8
# # Mask R-CNN - Train on Shapes Dataset
#
#
# This notebook shows how to train Mask R-CNN on your own dataset. To keep things simple we use a synthetic dataset of shapes (squares, triangles, and circles) which enables fast training. You'd still need a GPU, though, because the network backbone is a ... | [
"mrcnn.model.MaskRCNN",
"numpy.random.choice",
"os.path.join",
"os.getcwd",
"mrcnn.shapes.ShapesDataset",
"mrcnn.shapes.ShapesConfig",
"matplotlib.pyplot.subplots"
] | [((1305, 1316), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (1314, 1316), False, 'import os\n'), ((1400, 1438), 'os.path.join', 'os.path.join', (['MODEL_PATH', '"""mrcnn_logs"""'], {}), "(MODEL_PATH, 'mrcnn_logs')\n", (1412, 1438), False, 'import os\n'), ((1489, 1534), 'os.path.join', 'os.path.join', (['MODEL_PATH', '"... |
from collections import Counter as cntr
import random
import subprocess
import sys
SIZE = 10
def calculateBasins(grid):
n, basins = len(grid), [u for u in range(len(grid)**2)]
def find(u): return u if basins[u] == u else find(basins[u])
def union(u, v): basins[find(u)] = find(v)
for i in range(n):
for ... | [
"subprocess.run",
"random.randint"
] | [((1090, 1112), 'random.randint', 'random.randint', (['(0)', '(100)'], {}), '(0, 100)\n', (1104, 1112), False, 'import random\n'), ((1473, 1562), 'subprocess.run', 'subprocess.run', (["['./a.out']"], {'shell': '(True)', 'stdin': 'fin', 'stdout': 'subprocess.PIPE', 'text': '(True)'}), "(['./a.out'], shell=True, stdin=fi... |
import logging
import xbmc
from . import youtube_api
from .player_listener import PlayerListener
from .sponsorblock import SponsorBlockAPI
from .sponsorblock.utils import new_user_id
from .utils import addon
from .utils.const import CONF_API_SERVER, CONF_CATEGORIES_MAP, CONF_CATEGORY_CUSTOM, CONF_IGNORE_UNLISTED, CON... | [
"logging.getLogger"
] | [((340, 367), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (357, 367), False, 'import logging\n')] |
# Generated by Django 2.2.24 on 2022-01-23 01:09
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("petition", "0041_merge_20211212_2109"),
]
operations = [
migrations.AddField(
model_name="generatedpetition",
name=... | [
"django.db.models.PositiveIntegerField",
"django.db.models.CharField"
] | [((345, 383), 'django.db.models.PositiveIntegerField', 'models.PositiveIntegerField', ([], {'null': '(True)'}), '(null=True)\n', (372, 383), False, 'from django.db import migrations, models\n'), ((514, 569), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'max_length': '(256)', 'null': '(True... |
import spirit.spiritlib as spiritlib
import ctypes
from spirit.scalar import scalar
# Load Library
_spirit = spiritlib.LoadSpiritLibrary()
# The Bohr Magneton [meV / T]
_mu_B = _spirit.Constants_mu_B
_mu_B.argtypes = None
_mu_B.restype = scalar
def mu_B():
return _mu_B()
# The vacuum permeability [... | [
"spirit.spiritlib.LoadSpiritLibrary"
] | [((111, 140), 'spirit.spiritlib.LoadSpiritLibrary', 'spiritlib.LoadSpiritLibrary', ([], {}), '()\n', (138, 140), True, 'import spirit.spiritlib as spiritlib\n')] |
#!/usr/bin/env python
""" Interact with Extreme Networks devices running EXOS """
from setuptools import setup, find_packages
with open("requirements.txt") as f:
reqs = f.read().strip().split('\n')
version = '0.2.2'
setup(
name='pyEXOS',
version=version,
py_modules=['pyEXOS'],
packages=find_pack... | [
"setuptools.find_packages"
] | [((311, 326), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (324, 326), False, 'from setuptools import setup, find_packages\n')] |
import datetime
from databaseUser.HandlerDatabase import HandlerDatabase
from databaseUser.ObjectUser import UserObj
from handler.HandlerErrors import HandlerErrors
from message.Response import Response
from message.StatusCode import StatusCode
import json
class POST:
@staticmethod
def response(request) -> st... | [
"json.loads",
"handler.HandlerErrors.HandlerErrors.sendErrorCode",
"databaseUser.HandlerDatabase.HandlerDatabase.insertPokemon",
"databaseUser.ObjectUser.UserObj.fromDict",
"message.Response.Response",
"datetime.datetime.now"
] | [((680, 704), 'json.loads', 'json.loads', (['request.body'], {}), '(request.body)\n', (690, 704), False, 'import json\n'), ((886, 908), 'databaseUser.ObjectUser.UserObj.fromDict', 'UserObj.fromDict', (['data'], {}), '(data)\n', (902, 908), False, 'from databaseUser.ObjectUser import UserObj\n'), ((1012, 1046), 'databas... |
import os
from rl.control.DQN import DQN
from rl.control.QLearning import QLearning
from rl.environment.mdp.MDPGrid import MDPGrid
alpha = 0.1
gamma = 0.9
learning_rate = 0.001
epsilon = 0.1
number_of_episode = 200
environment = MDPGrid(json_path=os.path.join(os.getcwd(), f'../env/env_10.json'))
#environment.render(... | [
"rl.control.DQN.DQN",
"os.getcwd"
] | [((332, 448), 'rl.control.DQN.DQN', 'DQN', (['environment'], {'discount_factor': 'gamma', 'exploration_rate': 'epsilon', 'step_size': 'alpha', 'learning_rate': 'learning_rate'}), '(environment, discount_factor=gamma, exploration_rate=epsilon, step_size\n =alpha, learning_rate=learning_rate)\n', (335, 448), False, 'f... |
import json
import os
import unittest
import warnings
from contextlib import redirect_stdout
from io import StringIO
import LnkParse3
TARGET_DIR = os.path.join(os.path.dirname(__file__), 'samples')
JSON_DIR = os.path.join(os.path.dirname(__file__), 'json')
class TestSamples(unittest.TestCase):
def setUp(self):
... | [
"contextlib.redirect_stdout",
"LnkParse3.lnk_file",
"os.scandir",
"os.path.join",
"json.load",
"os.path.dirname",
"warnings.simplefilter",
"unittest.main",
"io.StringIO"
] | [((162, 187), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (177, 187), False, 'import os\n'), ((224, 249), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (239, 249), False, 'import os\n'), ((1087, 1102), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1100, 1... |
# -*- coding: utf-8 -*-
import swarmmaster
from pymavlink.dialects.v20 import ardupilotmega as mavlink2
import time
import unittest
from nose.tools import *
# 'assert_almost_equal'
# 'assert_almost_equals'
# 'assert_count_equal'
# 'assert_dict_contains_subset'
# 'assert_dict_equal'
# 'assert_equal'
# 'assert_equals'... | [
"unittest.main",
"swarmmaster.UDPServer",
"swarmmaster.Mavpacker",
"swarmmaster.SwarmClient"
] | [((1210, 1235), 'swarmmaster.SwarmClient', 'swarmmaster.SwarmClient', ([], {}), '()\n', (1233, 1235), False, 'import swarmmaster\n'), ((2557, 2572), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2570, 2572), False, 'import unittest\n'), ((1425, 1448), 'swarmmaster.UDPServer', 'swarmmaster.UDPServer', ([], {}), '... |
"""
This module contains functions to scrape the Json Play by Play for any given game
"""
import pandas as pd
import json
from operator import itemgetter
import hockey_scraper.shared as shared
def get_pbp(game_id):
"""
Given a game_id it returns the raw json
Ex: http://statsapi.web.nhl.com/api/v1/game/20... | [
"json.loads",
"hockey_scraper.shared.convert_to_seconds",
"hockey_scraper.shared.get_file",
"hockey_scraper.shared.fix_name",
"pandas.DataFrame",
"operator.itemgetter"
] | [((664, 690), 'hockey_scraper.shared.get_file', 'shared.get_file', (['page_info'], {}), '(page_info)\n', (679, 690), True, 'import hockey_scraper.shared as shared\n'), ((2392, 2447), 'hockey_scraper.shared.convert_to_seconds', 'shared.convert_to_seconds', (["event['about']['periodTime']"], {}), "(event['about']['period... |
import typing
import pandas as pd
import copy
import os
import random
import collections
import typing
import logging
import json
import re
import io
import string
import time
import cgitb
import sys
from ast import literal_eval
from itertools import combinations
from d3m import container
from d3m import utils
from d3... | [
"logging.getLogger",
"datamart_isi.augment.Augment",
"datamart_isi.utilities.utils.Utils.time_granularity_value_to_stringfy_time_format",
"d3m.base.utils.get_tabular_resource",
"datamart_isi.utilities.utils.Utils.map_granularity_to_value",
"datamart_isi.utilities.d3m_wikifier.check_and_correct_q_nodes_sem... | [((2383, 2398), 'random.seed', 'random.seed', (['(42)'], {}), '(42)\n', (2394, 2398), False, 'import random\n'), ((3311, 3338), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (3328, 3338), False, 'import logging\n'), ((4226, 4238), 'datamart_isi.cache.wikidata_cache.QueryCache', 'QueryCac... |
DATASET = '../dataset/'
from quick_start import run_toolkit
from create_datasets import Create_Datasets
class MWP_Solver:
def __init__(self, task_type="single_equation"):
self.task_type = task_type
def train_solver(self, train_data, test_data, valid_data):
config_dict = {}
dataset_c... | [
"quick_start.run_toolkit",
"create_datasets.Create_Datasets"
] | [((329, 379), 'create_datasets.Create_Datasets', 'Create_Datasets', (['test_data', 'valid_data', 'train_data'], {}), '(test_data, valid_data, train_data)\n', (344, 379), False, 'from create_datasets import Create_Datasets\n'), ((580, 634), 'quick_start.run_toolkit', 'run_toolkit', (['"""Graph2Tree"""', 'self.task_type'... |
import secrets
from discord.ext import commands
from pypubg import core
class Stats:
def __init__(self, statbot):
self.statbot = statbot
self.api = core.PUBGAPI(secrets.PUBG_STATS_TOKEN)
@commands.command(pass_context=False, help="!pubstats <name> <mode> <region>\n\n"
... | [
"pypubg.core.PUBGAPI",
"discord.ext.commands.command"
] | [((215, 517), 'discord.ext.commands.command', 'commands.command', ([], {'pass_context': '(False)', 'help': '"""!pubstats <name> <mode> <region>\n\nDisplays a few stats from the chosen game mode on the chosen region\n\nEXAMPLE: !pubstats rauxz duo na\n\nna = North America\nas = Asia\neu = Europe\noc = Oceania\nsa = Sout... |
import pandas as pd
import numpy as np
from pandas.api.types import is_numeric_dtype
from datetime import date, datetime
import calendar
def add_datetime_features(df, datetime_columns: list, add_time_features=False, scale_0_to_1=True,
cos_sin_transform=True, return_new_cols=True) -> pd.DataFrame:
... | [
"numpy.sin",
"numpy.cos",
"pandas.to_datetime"
] | [((670, 693), 'pandas.to_datetime', 'pd.to_datetime', (['df[col]'], {}), '(df[col])\n', (684, 693), True, 'import pandas as pd\n'), ((2722, 2773), 'numpy.cos', 'np.cos', (["(df[f'ft_{col}_{seasonal_part}'] * 2 * np.pi)"], {}), "(df[f'ft_{col}_{seasonal_part}'] * 2 * np.pi)\n", (2728, 2773), True, 'import numpy as np\n'... |
"""tests the NastranIO class"""
import os
from copy import deepcopy
import unittest
import numpy as np
try:
import matplotlib
matplotlib.use('Agg')
IS_MATPLOTLIB = True
except ModuleNotFoundError: # pyparsing is missing
IS_MATPLOTLIB = False
#except ImportError:
#pass
import vtk
from cpylog impor... | [
"unittest.skipIf",
"numpy.array",
"copy.deepcopy",
"unittest.main",
"os.remove",
"os.path.exists",
"cpylog.SimpleLogger",
"vtk.vtkRenderLargeImage",
"pyNastran.gui.testing_methods.FakeGUIMethods.__init__",
"vtk.vtkAxesActor",
"pyNastran.converters.nastran.nastran_to_vtk.nastran_to_vtk",
"numpy... | [((987, 1030), 'os.path.join', 'os.path.join', (['PKG_PATH', '"""converters"""', '"""stl"""'], {}), "(PKG_PATH, 'converters', 'stl')\n", (999, 1030), False, 'import os\n'), ((1044, 1082), 'os.path.join', 'os.path.join', (['PKG_PATH', '""".."""', '"""models"""'], {}), "(PKG_PATH, '..', 'models')\n", (1056, 1082), False,... |
from bblfsh.aliases import ParseResponse
from bblfsh.node import Node
from bblfsh.node_iterator import NodeIterator
from bblfsh.pyuast import decode, iterator, uast
from bblfsh.tree_order import TreeOrder
class ResponseError(Exception):
pass
class NotNodeIterationException(Exception):
pass
class GetOnEmpt... | [
"bblfsh.pyuast.decode",
"bblfsh.tree_order.TreeOrder.check_order",
"bblfsh.pyuast.uast"
] | [((1061, 1089), 'bblfsh.tree_order.TreeOrder.check_order', 'TreeOrder.check_order', (['order'], {}), '(order)\n', (1082, 1089), False, 'from bblfsh.tree_order import TreeOrder\n'), ((710, 746), 'bblfsh.pyuast.decode', 'decode', (['grpc_response.uast'], {'format': '(0)'}), '(grpc_response.uast, format=0)\n', (716, 746),... |
# Copyright 2018 The TensorFlow 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
#
# Unless required by applica... | [
"utils.ops.pad_to_multiple",
"utils.shape_utils.check_min_image_dim",
"tensorflow.keras.Model",
"models.feature_map_generators.KerasMultiResolutionFeatureMaps",
"models.keras_applications.mobilenet_v2.mobilenet_v2"
] | [((4270, 4626), 'models.keras_applications.mobilenet_v2.mobilenet_v2', 'mobilenet_v2.mobilenet_v2', ([], {'batchnorm_training': '(self._is_training and not self._freeze_batchnorm)', 'conv_hyperparams': '(self._conv_hyperparams if self.\n _override_base_feature_extractor_hyperparams else None)', 'weights': 'None', 'u... |
import sys, re, os
from pathlib import Path
_, output_dir, *output_base_names = sys.argv
chrom_regex = re.compile(r'(chr[a-zA-Z0-9]+)')
chromosomes = [chrom_regex.search(x).group(1) for x in output_base_names]
output_dir = Path(output_dir)
if not output_dir.exists():
os.makedirs(str(output_dir))
output_files = di... | [
"pathlib.Path",
"re.compile"
] | [((105, 136), 're.compile', 're.compile', (['"""(chr[a-zA-Z0-9]+)"""'], {}), "('(chr[a-zA-Z0-9]+)')\n", (115, 136), False, 'import sys, re, os\n'), ((226, 242), 'pathlib.Path', 'Path', (['output_dir'], {}), '(output_dir)\n', (230, 242), False, 'from pathlib import Path\n')] |
from time import time
from random import randrange, seed
import numpy as np
#import pandas as pd
import cv2
#import sys
from sklearn.cluster import KMeans
from scipy.optimize import linear_sum_assignment
from scipy.spatial.distance import cdist
#from random import randrange, seed
class Tracktor():
def __init__(... | [
"numpy.sqrt",
"numpy.array",
"cv2.ocl.useOpenCL",
"cv2.ocl.setUseOpenCL",
"scipy.optimize.linear_sum_assignment",
"numpy.where",
"numpy.delete",
"cv2.contourArea",
"numpy.vstack",
"cv2.VideoWriter_fourcc",
"cv2.blur",
"cv2.drawContours",
"numpy.ones",
"random.randrange",
"cv2.cvtColor",
... | [((2861, 2886), 'numpy.ones', 'np.ones', (['(5, 5)', 'np.uint8'], {}), '((5, 5), np.uint8)\n', (2868, 2886), True, 'import numpy as np\n'), ((3489, 3519), 'cv2.VideoWriter_fourcc', 'cv2.VideoWriter_fourcc', (['*codec'], {}), '(*codec)\n', (3511, 3519), False, 'import cv2\n'), ((4933, 4956), 'cv2.blur', 'cv2.blur', (['f... |
from django.shortcuts import render
# Create your views here.
from django.http import HttpResponse
def index(request):
return HttpResponse("SUMAS")
def suma(request):
return HttpResponse("SUMA DE DIGITOS")
def num1(request, num1):
response = "Los numeros son %s"
return HttpResponse(response % num1)
d... | [
"django.http.HttpResponse"
] | [((132, 153), 'django.http.HttpResponse', 'HttpResponse', (['"""SUMAS"""'], {}), "('SUMAS')\n", (144, 153), False, 'from django.http import HttpResponse\n'), ((184, 215), 'django.http.HttpResponse', 'HttpResponse', (['"""SUMA DE DIGITOS"""'], {}), "('SUMA DE DIGITOS')\n", (196, 215), False, 'from django.http import Htt... |
from insights.parsers import SkipException
from insights.parsers import ip_netns_exec_namespace_lsof
from insights.parsers.ip_netns_exec_namespace_lsof import IpNetnsExecNamespaceLsofI
from insights.tests import context_wrap
import doctest
import pytest
IP_NETNS_EXEC_NAMESPACE_LSOF_I = """
COMMAND PID USER FD ... | [
"insights.tests.context_wrap",
"doctest.testmod",
"pytest.raises"
] | [((1169, 1225), 'doctest.testmod', 'doctest.testmod', (['ip_netns_exec_namespace_lsof'], {'globs': 'env'}), '(ip_netns_exec_namespace_lsof, globs=env)\n', (1184, 1225), False, 'import doctest\n'), ((648, 692), 'insights.tests.context_wrap', 'context_wrap', (['IP_NETNS_EXEC_NAMESPACE_LSOF_I'], {}), '(IP_NETNS_EXEC_NAMES... |
# Copyright (c) 2021 OpenCyphal
# This software is distributed under the terms of the MIT License.
# Author: <NAME> <<EMAIL>>
from __future__ import annotations
import asyncio
import sys
from typing import Optional, Dict, TypeVar, Generic, cast, Any, TYPE_CHECKING
import shutil
import click
import pycyphal
from pycyph... | [
"yakut.get_logger",
"pycyphal.application.plug_and_play.CentralizedAllocator",
"collections.deque",
"yakut.cmd.compile.make_usage_suggestion",
"yakut.subcommand",
"shutil.get_terminal_size",
"pycyphal.application.node_tracker.NodeTracker",
"yakut.asynchronous",
"click.Path",
"scipy.sparse.dok_matr... | [((666, 697), 'yakut.subcommand', 'yakut.subcommand', ([], {'aliases': '"""mon"""'}), "(aliases='mon')\n", (682, 697), False, 'import yakut\n'), ((1289, 1328), 'yakut.asynchronous', 'yakut.asynchronous', ([], {'interrupted_ok': '(True)'}), '(interrupted_ok=True)\n', (1307, 1328), False, 'import yakut\n'), ((10493, 1050... |
import torch.nn as nn
import torch
from torch.nn import init
from layer.normalize_layer import Normalization
from layer.audio_extract_layer import LSTM, GRU
from layer.video_extract_layer import BottomUpExtract
from layer.ave_coattn_layer import DCNLayer
from layer.predict_layer import PredictLayer
import torch.nn.func... | [
"layer.video_extract_layer.BottomUpExtract",
"torch.nn.init.constant_",
"layer.normalize_layer.Normalization",
"torch.nn.init.xavier_uniform_",
"layer.audio_extract_layer.LSTM",
"torch.nn.init.kaiming_uniform_",
"torch.nn.init.orthogonal_",
"layer.predict_layer.PredictLayer",
"torch.cuda.is_availabl... | [((1027, 1042), 'layer.normalize_layer.Normalization', 'Normalization', ([], {}), '()\n', (1040, 1042), False, 'from layer.normalize_layer import Normalization\n'), ((1069, 1116), 'layer.video_extract_layer.BottomUpExtract', 'BottomUpExtract', (['opt.audio_size', 'opt.video_size'], {}), '(opt.audio_size, opt.video_size... |
"""
Functions for running Monte Carlo simulation.
"""
import math
import random
import os
import matplotlib.pyplot as plt
def calculate_LJ(r_ij):
"""
The LJ interaction energy between two particles.
Computes the pairwise Lennard-Jones interaction energy based on the separation distance in reduced uni... | [
"random.uniform",
"random.randrange",
"math.pow",
"math.sqrt",
"random.random",
"math.exp"
] | [((753, 773), 'math.pow', 'math.pow', (['r6_term', '(2)'], {}), '(r6_term, 2)\n', (761, 773), False, 'import math\n'), ((1673, 1692), 'math.sqrt', 'math.sqrt', (['distance'], {}), '(distance)\n', (1682, 1692), False, 'import math\n'), ((599, 620), 'math.pow', 'math.pow', (['(1 / r_ij)', '(6)'], {}), '(1 / r_ij, 6)\n', ... |
#!/usr/bin/env python
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the ... | [
"ctypes.sizeof",
"fluidity.diagnostics.debug.dprint",
"psyco.full"
] | [((906, 939), 'fluidity.diagnostics.debug.dprint', 'debug.dprint', (['"""Enabled debugging"""'], {}), "('Enabled debugging')\n", (918, 939), True, 'import fluidity.diagnostics.debug as debug\n'), ((1028, 1062), 'fluidity.diagnostics.debug.dprint', 'debug.dprint', (['"""Disabled debugging"""'], {}), "('Disabled debuggin... |
# third-party imports
import pytest
# local imports
from shpkpr import template_filters
def test_filter_items():
values = template_filters.filter_items({"X": "a", "Y": "b", "Z": "c"})
assert ("X", "a") in values
assert ("Y", "b") in values
assert ("Z", "c") in values
def test_filter_items_with_star... | [
"shpkpr.template_filters.require_int",
"shpkpr.template_filters.filter_items",
"shpkpr.template_filters.require_float",
"pytest.raises"
] | [((129, 190), 'shpkpr.template_filters.filter_items', 'template_filters.filter_items', (["{'X': 'a', 'Y': 'b', 'Z': 'c'}"], {}), "({'X': 'a', 'Y': 'b', 'Z': 'c'})\n", (158, 190), False, 'from shpkpr import template_filters\n'), ((343, 422), 'shpkpr.template_filters.filter_items', 'template_filters.filter_items', (["{'_... |
from bs4 import BeautifulSoup
import time
import re
# global variables
comment_type_list = ['ๆ็ธ้็่จ', 'ๆๆฐ', 'ๆๆ็่จ']
def browse_post(driver, url):
if 'groups' not in url:
url = url.replace('www.', 'm.')
driver.get(url)
time.sleep(2) # ็ญๅพ
็ถฒ้ ่ทๅฎ
# ๆๆๆ็่จ้ปๆๅบไพ
all_comment_btn = driver.find_elem... | [
"bs4.BeautifulSoup",
"time.sleep",
"re.search"
] | [((241, 254), 'time.sleep', 'time.sleep', (['(2)'], {}), '(2)\n', (251, 254), False, 'import time\n'), ((3048, 3096), 'bs4.BeautifulSoup', 'BeautifulSoup', (['driver.page_source', '"""html.parser"""'], {}), "(driver.page_source, 'html.parser')\n", (3061, 3096), False, 'from bs4 import BeautifulSoup\n'), ((511, 524), 't... |
# functions that implement transformations using the sineModel
import numpy as np
from scipy.interpolate import interp1d
def sineTimeScaling(sfreq, smag, timeScaling):
"""
Time scaling of sinusoidal tracks
sfreq, smag: frequencies and magnitudes of input sinusoidal tracks
timeScaling: scaling factors, in time-val... | [
"numpy.where",
"numpy.zeros_like",
"numpy.arange",
"scipy.interpolate.interp1d"
] | [((1122, 1165), 'scipy.interpolate.interp1d', 'interp1d', (['outFrames', 'inFrames'], {'fill_value': '(0)'}), '(outFrames, inFrames, fill_value=0)\n', (1130, 1165), False, 'from scipy.interpolate import interp1d\n'), ((2456, 2476), 'numpy.zeros_like', 'np.zeros_like', (['sfreq'], {}), '(sfreq)\n', (2469, 2476), True, '... |
import sys
import random
import pygame
from CardGame import *
from Gui import *
class Player():
def __init__(self):
self.hand = []
self.pointsCards = []
self.permCards = []
self.jacks = {} # Dictionary with card keys that have list of jack cards attached to them
self.sc... | [
"pygame.init",
"pygame.time.get_ticks",
"pygame.event.get",
"pygame.display.flip",
"sys.exit",
"random.randint"
] | [((19867, 19880), 'pygame.init', 'pygame.init', ([], {}), '()\n', (19878, 19880), False, 'import pygame\n'), ((20192, 20210), 'pygame.event.get', 'pygame.event.get', ([], {}), '()\n', (20208, 20210), False, 'import pygame\n'), ((33095, 33116), 'pygame.display.flip', 'pygame.display.flip', ([], {}), '()\n', (33114, 3311... |
""" CLI tools for working with cedar configuration files
"""
import json
import logging
import os
from pathlib import Path
import shutil
import click
from . import options
@click.group('config', help='Create or check cedar configuration files')
@click.pass_context
def group_config(ctx):
pass
@group_config.com... | [
"pathlib.Path",
"click.group",
"click.option",
"cedar.config.Config.from_yaml",
"click.echo",
"click.Abort",
"click.Path",
"os.getpid"
] | [((177, 248), 'click.group', 'click.group', (['"""config"""'], {'help': '"""Create or check cedar configuration files"""'}), "('config', help='Create or check cedar configuration files')\n", (188, 248), False, 'import click\n'), ((457, 534), 'click.option', 'click.option', (['"""--comment"""'], {'is_flag': '(True)', 'h... |
# Generated by Django 3.2.6 on 2021-08-04 19:07
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('worlds', '0011_alter_job_status'),
]
operations = [
migrations.AddField(
model_name='job',
name='failed',
... | [
"django.db.models.PositiveSmallIntegerField"
] | [((328, 371), 'django.db.models.PositiveSmallIntegerField', 'models.PositiveSmallIntegerField', ([], {'default': '(0)'}), '(default=0)\n', (360, 371), False, 'from django.db import migrations, models\n'), ((491, 534), 'django.db.models.PositiveSmallIntegerField', 'models.PositiveSmallIntegerField', ([], {'default': '(0... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from fabric.api import env
from fabtest import fab
from fab_deploy.db import postgres
from ..utils import setup_sudo
from .base import FabDeployTest
def postgres_is_installed():
return fab(postgres.is_installed)
def database_exists(db_name):
user_... | [
"fabtest.fab"
] | [((253, 279), 'fabtest.fab', 'fab', (['postgres.is_installed'], {}), '(postgres.is_installed)\n', (256, 279), False, 'from fabtest import fab\n'), ((371, 443), 'fabtest.fab', 'fab', (['postgres.execute_sql', '"""select datname from pg_database;"""', 'user_name'], {}), "(postgres.execute_sql, 'select datname from pg_dat... |
import blazer
from blazer.hpc.mpi import scatter, size
def calc_some(value, *args):
"""Do some calculations"""
result = {"some": value}
return result
def calc_stuff(value, *args):
"""Do some calculations"""
result = {"this": value}
return result
def add_date(result):
from datetime impo... | [
"blazer.begin",
"datetime.datetime.now",
"blazer.print"
] | [((669, 683), 'blazer.begin', 'blazer.begin', ([], {}), '()\n', (681, 683), False, 'import blazer\n'), ((843, 875), 'blazer.print', 'blazer.print', (['"""SCATTER:"""', 'result'], {}), "('SCATTER:', result)\n", (855, 875), False, 'import blazer\n'), ((391, 405), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n',... |
import mysql.connector
import csv
lista = []
with open('escolas.csv', encoding='utf-8', newline='') as csvfile:
spamreader = csv.reader(csvfile, delimiter=';', quotechar='|')
for row in spamreader:
dicionario={}
dicionario["grupo"]="A1_GRPECON = '{}'".format(row[0].strip())
dicionario["e... | [
"csv.reader"
] | [((129, 178), 'csv.reader', 'csv.reader', (['csvfile'], {'delimiter': '""";"""', 'quotechar': '"""|"""'}), "(csvfile, delimiter=';', quotechar='|')\n", (139, 178), False, 'import csv\n')] |
import findspark
findspark.init()
from pyspark import SparkConf,SparkContext
from pyspark.streaming import StreamingContext
from pyspark.sql import Row,SQLContext
import sys
import time
def myprint(rdd,num):
taken = rdd.take(num)
for record in taken[0:1]:
if record[1] != 0:
print(record[0]... | [
"findspark.init",
"pyspark.SparkContext",
"pyspark.streaming.StreamingContext",
"pyspark.SparkConf"
] | [((17, 33), 'findspark.init', 'findspark.init', ([], {}), '()\n', (31, 33), False, 'import findspark\n'), ((837, 848), 'pyspark.SparkConf', 'SparkConf', ([], {}), '()\n', (846, 848), False, 'from pyspark import SparkConf, SparkContext\n'), ((900, 923), 'pyspark.SparkContext', 'SparkContext', ([], {'conf': 'conf'}), '(c... |
"""
MIT License
Copyright (c) 2021 UltronRoBo
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, publish, di... | [
"UltronRoBo.modules.helper_funcs.string_handling.button_markdown_parser"
] | [((6407, 6472), 'UltronRoBo.modules.helper_funcs.string_handling.button_markdown_parser', 'button_markdown_parser', (['argumen'], {'entities': 'entities', 'offset': 'offset'}), '(argumen, entities=entities, offset=offset)\n', (6429, 6472), False, 'from UltronRoBo.modules.helper_funcs.string_handling import button_markd... |
from django.core.management.base import BaseCommand, CommandError
from momentum.models import Goal, Entry
from django.contrib.auth.models import User
import sqlite3
import datetime
class Command(BaseCommand):
args = ''
help = 'Updates statuses to be just active/inactive'
def handle(self, *args, **option... | [
"momentum.models.Goal.objects.all"
] | [((357, 375), 'momentum.models.Goal.objects.all', 'Goal.objects.all', ([], {}), '()\n', (373, 375), False, 'from momentum.models import Goal, Entry\n')] |
from django.conf.urls import patterns, include, url
from django.contrib import admin
from church.utils import const
from church.views.common import IndexView, SigninView, SignoutView, DocFileView, HelpFileView
admin.autodiscover()
urlpatterns = patterns('',
url('^$', IndexView.as_view(), name=... | [
"church.views.common.SignoutView.as_view",
"church.views.common.IndexView.as_view",
"django.conf.urls.include",
"church.views.common.DocFileView.as_view",
"church.views.common.HelpFileView.as_view",
"church.views.common.SigninView.as_view",
"django.contrib.admin.autodiscover"
] | [((212, 232), 'django.contrib.admin.autodiscover', 'admin.autodiscover', ([], {}), '()\n', (230, 232), False, 'from django.contrib import admin\n'), ((294, 313), 'church.views.common.IndexView.as_view', 'IndexView.as_view', ([], {}), '()\n', (311, 313), False, 'from church.views.common import IndexView, SigninView, Sig... |
#!/usr/bin/env python
"""
#
# Description:
# originally based on copy_media.py
# updated to use JSON playlists pointing to Content objects...
# should use other scripts to help with that conversion as needed
#
# copy the refrenced files to a new directory
#
# By: <NAME> [code at charlesbrandt dot com]
# On: 2009.04.... | [
"os.path.exists",
"os.makedirs",
"subprocess.Popen",
"os.path.join",
"os.path.dirname",
"medley.playlist.Playlist",
"os.path.abspath",
"medley.formats.M3U",
"re.search"
] | [((827, 854), 'os.path.exists', 'os.path.exists', (['destination'], {}), '(destination)\n', (841, 854), False, 'import sys, os, re\n'), ((1660, 1682), 'os.path.exists', 'os.path.exists', (['source'], {}), '(source)\n', (1674, 1682), False, 'import sys, os, re\n'), ((943, 971), 'os.path.dirname', 'os.path.dirname', (['d... |