code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
r"""Implementation of games in extensive form.
The most important class of the module is ``ExtensiveFormGame'', which
provides support for n-player extensive form games, including chance moves.
It also provides support for a graphical representation of the game tree and
implementation for the backward induction algori... | [
"matplotlib.pyplot.text",
"networkx.topological_sort",
"networkx.draw_networkx_edge_labels",
"matplotlib.patches.Arc",
"networkx.is_tree",
"networkx.DiGraph",
"networkx.draw_networkx",
"matplotlib.pyplot.close",
"itertools.combinations",
"networkx.algorithms.simple_paths.all_simple_edge_paths",
... | [((28008, 28034), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '(**fig_kwargs)\n', (28020, 28034), True, 'import matplotlib.pyplot as plt\n'), ((28609, 28730), 'networkx.draw_networkx', 'nx.draw_networkx', (['game.game_tree'], {'pos': 'pos', 'ax': 'ax', 'with_labels': '(True)', 'node_color': 'node_col'}), '(... |
from requests import get
from selectorlib import Extractor
def _adidas(adidas_url):
extractor = Extractor.from_yaml_string("""
name:
css: 'div.sidebar___2C-EP h1.gl-heading span'
xpath: null
type: Text
price:
css: 'div.sidebar___2C-EP div.gl-price-item'
xpath: null
... | [
"selectorlib.Extractor.from_yaml_string",
"requests.get"
] | [((102, 357), 'selectorlib.Extractor.from_yaml_string', 'Extractor.from_yaml_string', (['"""\n name:\n css: \'div.sidebar___2C-EP h1.gl-heading span\'\n xpath: null\n type: Text\n price:\n css: \'div.sidebar___2C-EP div.gl-price-item\'\n xpath: null\n type: Text\n """'... |
#
# This source file is part of the EdgeDB open source project.
#
# Copyright 2016-present MagicStack Inc. and the EdgeDB authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http... | [
"asyncio.BoundedSemaphore",
"edb.testbase.serutils.serialize",
"edb.server.cluster.Cluster",
"edb.server.cluster.RunningCluster",
"edgedb.async_connect",
"os.path.exists",
"asyncio.new_event_loop",
"functools.wraps",
"os.getpid",
"asyncio.sleep",
"atexit.register",
"collections.OrderedDict",
... | [((1214, 1239), 'collections.OrderedDict', 'collections.OrderedDict', ([], {}), '()\n', (1237, 1239), False, 'import collections\n'), ((2324, 2345), 'functools.wraps', 'functools.wraps', (['meth'], {}), '(meth)\n', (2339, 2345), False, 'import functools\n'), ((4046, 4070), 'asyncio.new_event_loop', 'asyncio.new_event_l... |
import logging
from helium.common.managers.basemanager import BaseManager, BaseQuerySet
__author__ = "<NAME>"
__copyright__ = "Copyright 2019, Helium Edu"
__version__ = "1.4.38"
logger = logging.getLogger(__name__)
class EventQuerySet(BaseQuerySet):
def exists_for_user(self, id, user_id):
return self.f... | [
"logging.getLogger"
] | [((190, 217), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (207, 217), False, 'import logging\n')] |
'''
Utilities for blockchain backup.
Copyright 2018-2020 DeNova
Last modified: 2020-12-08
'''
import json
import os
from datetime import timedelta
from traceback import format_exc
from django.utils.timezone import now
from blockchain_backup import __file__ as blockchain_backup_file
from blockchain_backu... | [
"denova.python.times.seconds_human_readable",
"denova.os.command.run",
"blockchain_backup.bitcoin.state.get_last_access_time",
"denova.os.command.background",
"blockchain_backup.bitcoin.state.set_last_block_updated",
"os.get_exec_path",
"datetime.timedelta",
"denova.os.osid.is_windows",
"os.remove",... | [((761, 770), 'denova.python.log.get_log', 'get_log', ([], {}), '()\n', (768, 770), False, 'from denova.python.log import get_log\n'), ((926, 938), 'denova.os.osid.is_windows', 'is_windows', ([], {}), '()\n', (936, 938), False, 'from denova.os.osid import is_windows\n'), ((1145, 1157), 'denova.os.osid.is_windows', 'is_... |
import argparse
from pathlib import Path
from securify.analyses.analysis import discover_patterns, AnalysisContext, AnalysisConfiguration, print_pattern_matches, print_pattern_matches_json
from securify.solidity import solidity_ast_compiler, solidity_cfg_compiler
from securify.staticanalysis import static_analysis
from... | [
"sys.setrecursionlimit",
"securify.analyses.analysis.AnalysisContext",
"securify.solidity.solidity_cfg_compiler.compile_cfg",
"importlib.import_module",
"argparse.ArgumentParser",
"re.compile",
"pathlib.Path",
"securify.solidity.solidity_ast_compiler.compile_ast",
"securify.staticanalysis.visualizat... | [((673, 690), 'securify.analyses.analysis.AnalysisContext', 'AnalysisContext', ([], {}), '()\n', (688, 690), False, 'from securify.analyses.analysis import discover_patterns, AnalysisContext, AnalysisConfiguration, print_pattern_matches, print_pattern_matches_json\n'), ((786, 805), 'securify.analyses.analysis.discover_... |
# 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
# distributed u... | [
"logging.getLogger"
] | [((619, 646), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (636, 646), False, 'import logging\n')] |
# -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2020-12-03 14:35
import logging
from typing import Union, List, Dict, Any, Iterable, Callable, Set
import torch
from hanlp_trie import DictInterface
from torch.utils.data import DataLoader
from elit.common.dataset import SamplerBuilder, PadSequenceDataLoader
from elit.c... | [
"elit.components.ner.transformer_ner.TransformerNamedEntityRecognizer.update_metrics",
"elit.components.ner.transformer_ner.TransformerNamedEntityRecognizer.prediction_to_human",
"elit.layers.crf.crf.CRF",
"elit.components.ner.transformer_ner.TransformerNamedEntityRecognizer.compute_loss",
"elit.components.... | [((1012, 1052), 'torch.nn.Linear', 'torch.nn.Linear', (['hidden_size', 'num_labels'], {}), '(hidden_size, num_labels)\n', (1027, 1052), False, 'import torch\n'), ((5437, 5448), 'elit.common.transform.VocabDict', 'VocabDict', ([], {}), '()\n', (5446, 5448), False, 'from elit.common.transform import VocabDict\n'), ((6947... |
import logging
import math
from datetime import datetime
from pathlib import Path
from typing import Set
from pandas import DataFrame
from shapely.geometry import Point
from shapely.strtree import STRtree
import utility
from model import Position
DEFAULT_CLASSES = {
'b11', 'c61', 'c51', 'c... | [
"pathlib.Path",
"datetime.datetime.strptime",
"shapely.strtree.STRtree",
"shapely.geometry.Point",
"utility.load_geoJson",
"math.radians"
] | [((1720, 1776), 'utility.load_geoJson', 'utility.load_geoJson', (['filepath', '"""epsg:4326"""', '"""epsg:3044"""'], {}), "(filepath, 'epsg:4326', 'epsg:3044')\n", (1740, 1776), False, 'import utility\n'), ((3527, 3575), 'math.radians', 'math.radians', (["position.properties['map_heading']"], {}), "(position.properties... |
# Generated by Django 3.0.2 on 2020-01-24 02:16
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('restaurantes', '0009_auto_20200123_2310'),
]
operations = [
migrations.RemoveField(
model_name=... | [
"django.db.migrations.RemoveField",
"django.db.models.ForeignKey"
] | [((273, 339), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""enderecos"""', 'name': '"""restaurante"""'}), "(model_name='enderecos', name='restaurante')\n", (295, 339), False, 'from django.db import migrations, models\n'), ((492, 614), 'django.db.models.ForeignKey', 'models.Foreig... |
import collections
import os
import os.path
import re
import subprocess
import sys
from urllib.parse import urlparse
from typing import List, Optional, Dict, Tuple
from pygments import highlight
from pygments.formatters.html import HtmlFormatter
from pygments.lexers import get_lexer_by_name
from h2o_wave import main,... | [
"collections.OrderedDict",
"re.compile",
"pygments.highlight",
"h2o_wave.ui.meta_card",
"os.environ.get",
"h2o_wave.ui.section_card",
"os.path.join",
"h2o_wave.ui.frame_card",
"os.path.realpath",
"os.path.splitext",
"h2o_wave.ui.button",
"h2o_wave.app",
"h2o_wave.ui.choice",
"pygments.lexe... | [((344, 371), 'pygments.lexers.get_lexer_by_name', 'get_lexer_by_name', (['"""python"""'], {}), "('python')\n", (361, 371), False, 'from pygments.lexers import get_lexer_by_name\n'), ((389, 428), 'pygments.formatters.html.HtmlFormatter', 'HtmlFormatter', ([], {'full': '(True)', 'style': '"""xcode"""'}), "(full=True, st... |
from flask import request, jsonify, abort
from flask.ext.login import login_required, current_user
import bots
from matchmaker import app, db
import matches
import match_logs
import util
import profile
#
# Public API
#
@app.route('/api/matches')
@login_required
def open_matches():
open = matches.OpenMatches(db... | [
"flask.request.args.get",
"bots.BotInfo",
"matches.OpenMatches",
"profile.BotMaker",
"matches.MatchJoiner",
"flask.jsonify",
"matches.NewMatch",
"matches.MatchCreatorJob",
"match_logs.MatchLogBuilder",
"matches.MatchResultsWriter",
"flask.request.get_json",
"matchmaker.app.route",
"util.page... | [((225, 250), 'matchmaker.app.route', 'app.route', (['"""/api/matches"""'], {}), "('/api/matches')\n", (234, 250), False, 'from matchmaker import app, db\n'), ((377, 411), 'matchmaker.app.route', 'app.route', (['"""/api/matches/finished"""'], {}), "('/api/matches/finished')\n", (386, 411), False, 'from matchmaker impor... |
from dataapi import TrackerFeeder
from sqlalchemy import create_engine
import matplotlib.pyplot as plt
connect_dict = {'flavor': 'postgres+psycopg2',
'database': '[DATABASE NAME]',
'schema': '[DATABASE SCHEMA]',
'user': '[USERNAME]',
'password': '[PASSWOR... | [
"dataapi.TrackerFeeder"
] | [((922, 947), 'dataapi.TrackerFeeder', 'TrackerFeeder', (['db_connect'], {}), '(db_connect)\n', (935, 947), False, 'from dataapi import TrackerFeeder\n')] |
import sys
import os
import pytest
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
@pytest.fixture
def mock_coroutine(mocker, monkeypatch):
def _create_coro_patch(*args):
"""Fixture to mock a corotine. If an object path is given, monkeypatch
the coroutine with th... | [
"os.path.dirname"
] | [((84, 109), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (99, 109), False, 'import os\n')] |
import torch
import torch.nn.functional as F
import torch.nn as nn
class multi_head_attention_2d(torch.nn.Module):
def __init__(self, in_channel, key_filters, value_filters,
output_filters, num_heads, dropout_prob=0.5, layer_type='SAME'):
super().__init__()
"""Multihead scaled-dot-product at... | [
"torch.nn.Dropout",
"torch.rand",
"torch.nn.Conv2d",
"torch.softmax",
"torch.matmul",
"torch.nn.ConvTranspose2d",
"torch.flatten",
"torch.device"
] | [((4702, 4721), 'torch.device', 'torch.device', (['"""cpu"""'], {}), "('cpu')\n", (4714, 4721), False, 'import torch\n'), ((2330, 2416), 'torch.nn.Conv2d', 'nn.Conv2d', (['in_channel', 'key_filters'], {'kernel_size': '(1)', 'stride': '(1)', 'padding': '(0)', 'bias': '(True)'}), '(in_channel, key_filters, kernel_size=1,... |
# -*- coding: utf-8 -*-
## LOPF then non-linear power flow with SciGRID
#
# This Jupyter Notebook is also available to download at: <https://pypsa.readthedocs.io/en/latest/examples/scigrid-lopf-then-pf.ipynb> and can be viewed as an HTML page at: <https://pypsa.readthedocs.io/en/latest/examples/scigrid-lopf-then-pf.htm... | [
"pandas.Series",
"matplotlib.pyplot.hexbin",
"pandas.merge",
"matplotlib.pyplot.colorbar",
"pypsa.Network",
"cartopy.crs.PlateCarree",
"os.path.dirname",
"pandas.DataFrame",
"matplotlib.pyplot.subplots"
] | [((3922, 3968), 'pypsa.Network', 'pypsa.Network', ([], {'csv_folder_name': 'csv_folder_name'}), '(csv_folder_name=csv_folder_name)\n', (3935, 3968), False, 'import pypsa\n'), ((7529, 7547), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(1)', '(1)'], {}), '(1, 1)\n', (7541, 7547), True, 'import matplotlib.pyplot as p... |
import os
import glob
import numpy as np
import cv2
from PIL import Image, ImageFile
import torch
from torch.utils.data import Dataset
import torchvision.transforms as transforms
class BatchManagerTinyImageNet(Dataset):
def __init__(self, split='train',transform=None):
assert split in ['train', 'val']
... | [
"PIL.Image.open",
"os.path.join",
"os.path.basename",
"glob.glob"
] | [((424, 459), 'os.path.join', 'os.path.join', (['self._base_dir', 'split'], {}), '(self._base_dir, split)\n', (436, 459), False, 'import os\n'), ((901, 948), 'os.path.join', 'os.path.join', (['self._data_dir', "(class_code + '/*')"], {}), "(self._data_dir, class_code + '/*')\n", (913, 948), False, 'import os\n'), ((983... |
"""Implements COVID Img Slic sDataset"""
import os
import pandas as pd
import torch
from PIL import Image
from torch.utils.data import Dataset
from torchvision import transforms
from src.modules.transforms import *
from src.utils.mapper import configmapper
@configmapper.map("datasets", "covid_img_slic")
class Covi... | [
"PIL.Image.open",
"pandas.read_csv",
"src.utils.mapper.configmapper.map",
"torch.tensor",
"torchvision.transforms.Compose",
"src.utils.mapper.configmapper.get_object"
] | [((263, 309), 'src.utils.mapper.configmapper.map', 'configmapper.map', (['"""datasets"""', '"""covid_img_slic"""'], {}), "('datasets', 'covid_img_slic')\n", (279, 309), False, 'from src.utils.mapper import configmapper\n'), ((1499, 1533), 'pandas.read_csv', 'pd.read_csv', (['config.data_paths_csv'], {}), '(config.data_... |
import logging
from core_tools.data.ds.data_set_core import data_set
from core_tools.data.ds.data_set_raw import data_set_raw
from core_tools.data.SQL.SQL_dataset_creator import SQL_dataset_creator
import json
import qcodes as qc
def load_by_id(exp_id):
'''
load a dataset by specifying its id (search in local... | [
"core_tools.data.SQL.SQL_dataset_creator.SQL_dataset_creator",
"json.loads",
"core_tools.data.SQL.connect.set_up_remote_storage",
"json.dumps",
"core_tools.data.ds.data_set_core.data_set",
"qcodes.Station.default.snapshot",
"logging.error",
"core_tools.data.ds.data_set_raw.data_set_raw"
] | [((419, 440), 'core_tools.data.SQL.SQL_dataset_creator.SQL_dataset_creator', 'SQL_dataset_creator', ([], {}), '()\n', (438, 440), False, 'from core_tools.data.SQL.SQL_dataset_creator import SQL_dataset_creator\n'), ((815, 836), 'core_tools.data.SQL.SQL_dataset_creator.SQL_dataset_creator', 'SQL_dataset_creator', ([], {... |
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Ericsson AB
#
# 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 ... | [
"calvin.actor.actor.condition",
"calvin.actor.actor.guard",
"calvin.actor.actor.manage",
"calvin.actor.actor.ActionResult",
"calvin.utilities.calvinlogger.get_logger",
"calvin.runtime.north.calvin_token.ExceptionToken"
] | [((860, 880), 'calvin.utilities.calvinlogger.get_logger', 'get_logger', (['__name__'], {}), '(__name__)\n', (870, 880), False, 'from calvin.utilities.calvinlogger import get_logger\n'), ((1049, 1153), 'calvin.actor.actor.manage', 'manage', (["['devicename', 'baudrate', 'bytesize', 'parity', 'stopbits', 'timeout',\n ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from setuptools import setup, find_packages
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='asciitree',
version='0.3.4.dev1',
description='Draws ASCII trees.',
long_description=read('README... | [
"os.path.dirname",
"setuptools.find_packages"
] | [((452, 484), 'setuptools.find_packages', 'find_packages', ([], {'exclude': "['tests']"}), "(exclude=['tests'])\n", (465, 484), False, 'from setuptools import setup, find_packages\n'), ((150, 175), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (165, 175), False, 'import os\n')] |
# Copyright 2017 D-Wave Systems Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | [
"logging.getLogger",
"dwave.cloud.coders.decode_qp_numpy",
"dwave.cloud.coders.decode_bq",
"dwave.cloud.coders.encode_problem_as_bq",
"dwave.cloud.utils.reformat_qubo_as_ising",
"dwave.cloud.utils.uniform_iterator",
"dwave.cloud.coders.decode_qp",
"dwave.cloud.coders.encode_problem_as_qp",
"dimod.Bi... | [((1678, 1705), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1695, 1705), False, 'import logging\n'), ((5113, 5150), 'dwave.cloud.computation.Future', 'Future', (['self', 'id_', 'self.return_matrix'], {}), '(self, id_, self.return_matrix)\n', (5119, 5150), False, 'from dwave.cloud.comp... |
import pytest
from unittest.mock import patch
import tests.fixtures.journal as FakeJournalExporter
from systemdlogger.elasticsearch import ElasticsearchLogger
@pytest.mark.parametrize(('config_path'), [
'tests/fixtures/config_es.json'
])
class TestRunner:
def setup_method(self, method):
""" setup any... | [
"pytest.mark.parametrize",
"unittest.mock.patch.dict"
] | [((162, 235), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""config_path"""', "['tests/fixtures/config_es.json']"], {}), "('config_path', ['tests/fixtures/config_es.json'])\n", (185, 235), False, 'import pytest\n'), ((578, 612), 'unittest.mock.patch.dict', 'patch.dict', (['"""sys.modules"""', 'modules'], {... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2019 CERN.
#
# invenio-app-ils is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Loan indexer APIs."""
from datetime import datetime
from celery import shared_task
from flask import current_... | [
"invenio_app_ils.indexer.ReferencedRecordsIndexer",
"celery.shared_task",
"invenio_app_ils.circulation.utils.resolve_item_from_loan",
"datetime.datetime.utcnow"
] | [((800, 831), 'celery.shared_task', 'shared_task', ([], {'ignore_result': '(True)'}), '(ignore_result=True)\n', (811, 831), False, 'from celery import shared_task\n'), ((918, 944), 'invenio_app_ils.indexer.ReferencedRecordsIndexer', 'ReferencedRecordsIndexer', ([], {}), '()\n', (942, 944), False, 'from invenio_app_ils.... |
""" bot example
Minimal bot implementation to serve as an example.
Not really a part of the Canvas Indexer code base.
"""
import json
import random
import requests
import time
from celery import Celery
from flask import (abort, Flask, request, Response)
from flask_cors import CORS
def get_tags(img_url):
... | [
"json.loads",
"flask_cors.CORS",
"flask.Flask",
"celery.Celery",
"json.dumps",
"random.seed",
"time.sleep",
"flask.abort",
"random.randint"
] | [((776, 791), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (781, 791), False, 'from flask import abort, Flask, request, Response\n'), ((938, 947), 'flask_cors.CORS', 'CORS', (['app'], {}), '(app)\n', (942, 947), False, 'from flask_cors import CORS\n'), ((948, 961), 'random.seed', 'random.seed', ([], {}),... |
# -*- coding:utf-8 -*-
import hashlib
import hmac
import time
def create_auth_headers(url, access_key, secret, body=None):
"""
get HTTP headers for API authentication
:param url: API url. (e.g. https://coincheck.com/api/accounts/balance )
:param access_key: Access Key string for API authentication
... | [
"time.time"
] | [((463, 474), 'time.time', 'time.time', ([], {}), '()\n', (472, 474), False, 'import time\n')] |
from datetime import datetime
from django.utils.timesince import timesince
from rest_framework import serializers
from news.models import Journalist, Article
class ArticleSerializer(serializers.ModelSerializer):
time_since_publication = serializers.SerializerMethodField()
# author = JournalistSerializer(read... | [
"rest_framework.serializers.SerializerMethodField",
"rest_framework.serializers.ValidationError",
"datetime.datetime.now",
"rest_framework.serializers.HyperlinkedRelatedField",
"django.utils.timesince.timesince"
] | [((244, 279), 'rest_framework.serializers.SerializerMethodField', 'serializers.SerializerMethodField', ([], {}), '()\n', (277, 279), False, 'from rest_framework import serializers\n'), ((1116, 1211), 'rest_framework.serializers.HyperlinkedRelatedField', 'serializers.HyperlinkedRelatedField', ([], {'many': '(True)', 're... |
from math import hypot
class Vector():
def __init__(self, x=0, y=0):
self.x = x
self.y = y
def __repr__(self):
return 'Vector(%r, %r)' % (self.x, self.y)
def __abs__(self):
return hypot(self.x, self.y)
def __bool__(self):
return bool(abs(self))
def __add... | [
"math.hypot"
] | [((228, 249), 'math.hypot', 'hypot', (['self.x', 'self.y'], {}), '(self.x, self.y)\n', (233, 249), False, 'from math import hypot\n')] |
import itertools
from task_selector.task import Task
class TaskSelector:
"""Selector for finding best Task combination """
def __init__(self, tasks: list[Task] = None):
if tasks is None:
tasks = []
self.tasks = tasks
self.selected = []
self.selected_profit = 0.0
... | [
"itertools.combinations"
] | [((931, 968), 'itertools.combinations', 'itertools.combinations', (['self.tasks', 'i'], {}), '(self.tasks, i)\n', (953, 968), False, 'import itertools\n')] |
# -*- coding: utf-8 -*-
import pandas as pd
import numpy as np
def rescale(data, to=[0, 1]):
"""Rescale data.
Rescale a numeric variable to a new range.
Parameters
----------
data : list, array or Series
Raw data.
to : list
New range of values of the data after rescaling.
... | [
"numpy.nanmin",
"numpy.array",
"numpy.nanmax"
] | [((623, 637), 'numpy.array', 'np.array', (['data'], {}), '(data)\n', (631, 637), True, 'import numpy as np\n'), ((821, 836), 'numpy.nanmin', 'np.nanmin', (['data'], {}), '(data)\n', (830, 836), True, 'import numpy as np\n'), ((776, 791), 'numpy.nanmax', 'np.nanmax', (['data'], {}), '(data)\n', (785, 791), True, 'import... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | [
"uuid.uuid1",
"msrest.pipeline.ClientRawResponse",
"msrestazure.azure_exceptions.CloudError",
"msrestazure.azure_operation.AzureOperationPoller"
] | [((8938, 9063), 'msrestazure.azure_operation.AzureOperationPoller', 'AzureOperationPoller', (['long_running_send', 'get_long_running_output', 'get_long_running_status', 'long_running_operation_timeout'], {}), '(long_running_send, get_long_running_output,\n get_long_running_status, long_running_operation_timeout)\n',... |
from parsuite.core.argument import Argument
from parsuite import helpers
from parsuite.core.suffix_printer import *
from pathlib import Path
import xml.etree.ElementTree as ET
import argparse
import os
import re
help = 'Convert URLCrazy output to CSV'
args = [
Argument('--output-file', '-of', required=True,
... | [
"re.search",
"parsuite.core.argument.Argument",
"re.compile"
] | [((371, 580), 're.compile', 're.compile', (['"""^(Bit Flipping|Character Insertion|Character Omission|Character Repeat|Character Replacement|Character Swap|Homoglyphs|Homophones|Missing Dot|Singular or Pluralise|Vowel Swap|Wrong TLD)"""'], {}), "(\n '^(Bit Flipping|Character Insertion|Character Omission|Character Re... |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
#Libraries
import cv2
import numpy as np
import pyautogui
import keyboard
# In[2]:
#Color to detect BGR
l = [17, 15, 100] #lower
u = [80, 76, 220] #upper
# In[3]:
#region coordinates
k_left, k_top, k_right, k_bottom = 640, 30, 440, 130
h_left, h_top, h_right, h... | [
"cv2.rectangle",
"cv2.imshow",
"numpy.array",
"cv2.destroyAllWindows",
"cv2.threshold",
"cv2.erode",
"cv2.waitKey",
"pyautogui.keyDown",
"cv2.putText",
"cv2.cvtColor",
"cv2.resize",
"cv2.GaussianBlur",
"cv2.namedWindow",
"cv2.flip",
"cv2.inRange",
"cv2.bitwise_and",
"cv2.VideoCapture... | [((566, 589), 'pyautogui.keyDown', 'pyautogui.keyDown', (['"""up"""'], {}), "('up')\n", (583, 589), False, 'import pyautogui\n'), ((685, 711), 'pyautogui.keyDown', 'pyautogui.keyDown', (['"""right"""'], {}), "('right')\n", (702, 711), False, 'import pyautogui\n'), ((805, 830), 'pyautogui.keyDown', 'pyautogui.keyDown', ... |
# pylint: disable=function-redefined
from discord import File
from multipledispatch import dispatch
from fate_of_dice.common import DiceException
from fate_of_dice.resources.resource_handler import ResourceImageHandler
from .dice_embed import DiceEmbed
@dispatch(DiceException)
def from_exception(error: DiceException... | [
"multipledispatch.dispatch"
] | [((257, 280), 'multipledispatch.dispatch', 'dispatch', (['DiceException'], {}), '(DiceException)\n', (265, 280), False, 'from multipledispatch import dispatch\n'), ((533, 556), 'multipledispatch.dispatch', 'dispatch', (['BaseException'], {}), '(BaseException)\n', (541, 556), False, 'from multipledispatch import dispatc... |
import os
from dotenv import load_dotenv
load_dotenv()
AWS_ACCESS_KEY_ID = os.getenv('AWS_ACCESS_KEY_ID')
AWS_SECRET_KEY = os.getenv('AWS_SECRET_KEY')
AWS_DEFAULT_REGION = os.getenv('AWS_DEFAULT_REGION')
| [
"os.getenv",
"dotenv.load_dotenv"
] | [((42, 55), 'dotenv.load_dotenv', 'load_dotenv', ([], {}), '()\n', (53, 55), False, 'from dotenv import load_dotenv\n'), ((77, 107), 'os.getenv', 'os.getenv', (['"""AWS_ACCESS_KEY_ID"""'], {}), "('AWS_ACCESS_KEY_ID')\n", (86, 107), False, 'import os\n'), ((125, 152), 'os.getenv', 'os.getenv', (['"""AWS_SECRET_KEY"""'],... |
from copy import deepcopy
import six
from lxml import etree
from regparser import plugins
from regparser.tree.xml_parser.preprocessors import replace_html_entities
class XMLWrapper(object):
"""Wrapper around XML which provides a consistent interface shared by both
Notices and Annual editions of XML"""
d... | [
"copy.deepcopy",
"lxml.etree.SubElement",
"regparser.plugins.instantiate_if_possible",
"regparser.tree.xml_parser.preprocessors.replace_html_entities",
"lxml.etree.fromstring",
"lxml.etree.tounicode"
] | [((1191, 1284), 'regparser.plugins.instantiate_if_possible', 'plugins.instantiate_if_possible', (['"""eregs_ns.parser.preprocessors"""'], {'method_name': '"""transform"""'}), "('eregs_ns.parser.preprocessors',\n method_name='transform')\n", (1222, 1284), False, 'from regparser import plugins\n'), ((1474, 1518), 'lxm... |
# Copyright 2018 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | [
"tensorflow.compat.v2.nest.map_structure",
"numpy.log",
"tensorflow.compat.v2.einsum",
"tensorflow_probability.python.internal.test_util.jax_disable_test_missing_functionality",
"tensorflow.compat.v2.cast",
"tensorflow.compat.v2.nest.pack_sequence_as",
"tensorflow.compat.v2.nest.assert_same_structure",
... | [((1233, 1535), 'absl.testing.parameterized.named_parameters', 'parameterized.named_parameters', (["{'testcase_name': 'coroutine', 'jd_class': tfd.\n JointDistributionCoroutineAutoBatched}", "{'testcase_name': 'sequential', 'jd_class': tfd.\n JointDistributionSequentialAutoBatched}", "{'testcase_name': 'named', '... |
import socket
from typing import Callable, List
import pytest
from pytest_mock import MockerFixture
from meta_memcache.base.memcache_socket import MemcacheSocket
from meta_memcache.errors import MemcacheError
from meta_memcache.protocol import (
Conflict,
Flag,
IntFlag,
Miss,
NotStored,
Server... | [
"meta_memcache.base.memcache_socket.MemcacheSocket"
] | [((1351, 1378), 'meta_memcache.base.memcache_socket.MemcacheSocket', 'MemcacheSocket', (['fake_socket'], {}), '(fake_socket)\n', (1365, 1378), False, 'from meta_memcache.base.memcache_socket import MemcacheSocket\n'), ((1870, 1897), 'meta_memcache.base.memcache_socket.MemcacheSocket', 'MemcacheSocket', (['fake_socket']... |
# encoding=utf-8
import sys
import string
import getopt
import pubproxy
import filter
def main(argv):
deploy_channel = None
docker_envs = []
node = None
container_name = None
docker_image = None
volumes = []
net = 'bridge' # 默认网络模式
ports = []
mode = 'default' # default or swarm
... | [
"getopt.getopt",
"filter.filter",
"sys.exit",
"pubproxy.PubProxy"
] | [((2207, 2346), 'pubproxy.PubProxy', 'pubproxy.PubProxy', (['deploy_channel', 'node', 'container_name', 'docker_image', 'net', 'ports', 'volumes', 'docker_envs', 'mode', 'compose_file', 'stack_name'], {}), '(deploy_channel, node, container_name, docker_image, net,\n ports, volumes, docker_envs, mode, compose_file, s... |
from __future__ import annotations
from custom_components.magic_lights.const import DOMAIN
from custom_components.magic_lights.magicbase.share import get_magic
import logging
from typing import TYPE_CHECKING
from homeassistant.core import Context
_LOGGER = logging.getLogger(__name__)
if TYPE_CHECKING:
from custo... | [
"logging.getLogger",
"custom_components.magic_lights.magicbase.share.get_magic",
"homeassistant.core.Context"
] | [((259, 286), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (276, 286), False, 'import logging\n'), ((1327, 1348), 'homeassistant.core.Context', 'Context', (['None', 'DOMAIN'], {}), '(None, DOMAIN)\n', (1334, 1348), False, 'from homeassistant.core import Context\n'), ((1362, 1373), 'cust... |
# coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... | [
"core.domain.user_jobs_one_off.UserContributionsOneOffJob.enqueue",
"core.domain.collection_services.delete_collection",
"core.domain.event_services.StartExplorationEventHandler.record",
"core.domain.user_jobs_one_off.CleanUpUserSubscribersModelOneOffJob.create_new",
"core.domain.user_jobs_one_off.UsernameL... | [((1712, 1835), 'core.platform.models.Registry.import_models', 'models.Registry.import_models', (['[models.NAMES.auth, models.NAMES.user, models.NAMES.feedback, models.NAMES.\n exploration]'], {}), '([models.NAMES.auth, models.NAMES.user, models\n .NAMES.feedback, models.NAMES.exploration])\n', (1741, 1835), Fals... |
import sys,platform
import telebot
import requests
from getmac import get_mac_address as gma
from RAT import *
from Core.Settings.Organization import *
from Core.Settings.Antivirus import *
from Core.Settings.Admin import *
from Core.Settings.CriticalProcess import *
from Core.Settings.MessageBox ... | [
"telebot.types.KeyboardButton",
"requests.get",
"telebot.types.InlineKeyboardButton",
"telebot.types.ReplyKeyboardMarkup",
"telebot.types.InlineKeyboardMarkup",
"sys.exit",
"telebot.util.split_string",
"telebot.util.ThreadPool",
"getmac.get_mac_address",
"telebot.TeleBot"
] | [((1321, 1366), 'telebot.TeleBot', 'telebot.TeleBot', (['TelegramToken'], {'threaded': '(True)'}), '(TelegramToken, threaded=True)\n', (1336, 1366), False, 'import telebot\n'), ((1385, 1416), 'telebot.util.ThreadPool', 'util.ThreadPool', ([], {'num_threads': '(50)'}), '(num_threads=50)\n', (1400, 1416), False, 'from te... |
'''
Repositories.py
From VSTS get the list of code repositories so we can
later crawl and link up pull request info and comments.
'''
# import logging
import configparser
from multiprocessing import Pool
from VSTSInfo import VstsInfo
from models import GraphBuilder, Repository, Project
class RepositoriesWorker(object... | [
"models.Project.select",
"models.Repository",
"models.GraphBuilder",
"VSTSInfo.VstsInfo",
"multiprocessing.Pool",
"models.Project"
] | [((1989, 2003), 'models.GraphBuilder', 'GraphBuilder', ([], {}), '()\n', (2001, 2003), False, 'from models import GraphBuilder, Repository, Project\n'), ((2129, 2168), 'VSTSInfo.VstsInfo', 'VstsInfo', (['None', 'None'], {'ignore_cache': '(True)'}), '(None, None, ignore_cache=True)\n', (2137, 2168), False, 'from VSTSInf... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django import forms
from django.contrib.auth import get_user_model
from ..models import UserProfile
User = get_user_model()
class UserForm(forms.ModelForm):
class Meta:
model = User
fields = ("username", "email", "is_active"... | [
"django.contrib.auth.get_user_model"
] | [((180, 196), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (194, 196), False, 'from django.contrib.auth import get_user_model\n')] |
from abc import ABCMeta, abstractmethod
import six
from dagster import check
class TypeStoragePlugin(six.with_metaclass(ABCMeta)): # pylint: disable=no-init
'''Base class for storage plugins.
Extend this class for (system_storage_name, dagster_type) pairs that need special handling.
'''
@classmet... | [
"dagster.check.inst_param",
"dagster.check.opt_list_param",
"dagster.check.invariant",
"dagster.check.inst",
"dagster.check.subclass",
"six.with_metaclass",
"dagster.check.subclass_param"
] | [((105, 132), 'six.with_metaclass', 'six.with_metaclass', (['ABCMeta'], {}), '(ABCMeta)\n', (123, 132), False, 'import six\n'), ((3998, 4064), 'dagster.check.inst_param', 'check.inst_param', (['pipeline_def', '"""pipeline_def"""', 'PipelineDefinition'], {}), "(pipeline_def, 'pipeline_def', PipelineDefinition)\n", (4014... |
import sys
import base_func as base
import twint
from similar_hashtags import similar_hashtags
from top_mentions_hashtags import top_mentions_hashtags as mentions
def basic(username,search):
base.get_user_bio(username,search)
base.get_user_tweets(username,search,True)
def get_keyword(key,limit=100):
base... | [
"base_func.get_user_bio",
"base_func.get_user_tweets",
"similar_hashtags.similar_hashtags.get_similar_hashtags",
"base_func.get_tweets",
"top_mentions_hashtags.top_mentions_hashtags.get_top_mentions_hashtags"
] | [((197, 232), 'base_func.get_user_bio', 'base.get_user_bio', (['username', 'search'], {}), '(username, search)\n', (214, 232), True, 'import base_func as base\n'), ((236, 280), 'base_func.get_user_tweets', 'base.get_user_tweets', (['username', 'search', '(True)'], {}), '(username, search, True)\n', (256, 280), True, 'i... |
# Copyright 2019 StreamSets 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 writi... | [
"logging.getLogger",
"base64.b64encode",
"streamsets.testframework.markers.sdc_min_version",
"streamsets.testframework.utils.get_random_string",
"pytest.fixture",
"streamsets.testframework.markers.aws",
"streamsets.testframework.markers.aws.encrypt",
"streamsets.testframework.markers.aws.decrypt",
"... | [((824, 851), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (841, 851), False, 'import logging\n'), ((880, 910), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (894, 910), False, 'import pytest\n'), ((1059, 1069), 'streamsets.testframework.mark... |
# Generated by Django 2.2.5 on 2019-10-08 21:43
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('starboardscanner_app', '0002_auto_20191008_2338'),
]
operations = [
migrations.AlterField(
model_name='record',
name... | [
"django.db.models.CharField"
] | [((353, 384), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(50)'}), '(max_length=50)\n', (369, 384), False, 'from django.db import migrations, models\n')] |
# Copyright 2021 The TensorFlow Recommenders Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | [
"setuptools.find_packages",
"pathlib.Path"
] | [((1236, 1262), 'setuptools.find_packages', 'setuptools.find_packages', ([], {}), '()\n', (1260, 1262), False, 'import setuptools\n'), ((752, 774), 'pathlib.Path', 'pathlib.Path', (['__file__'], {}), '(__file__)\n', (764, 774), False, 'import pathlib\n'), ((1285, 1317), 'pathlib.Path', 'pathlib.Path', (['"""requirement... |
# 3/28/2020 Convert Nested JSON to Pandas DataFrame and Flatten List in a Column
# https://gist.github.com/rafaan/4ddc91ae47ea46a46c0b
# 6/25/2020 Initial
# 7/7/2020 Merge test_stort3Qdb.py and test_query3Qtable.py
########################################################
import json
from pandas.io.json import json_n... | [
"db_sqlite.DB_sqlite",
"csvdataAnalysis.CSVDataAnalysis",
"os.path.join",
"csvdataAnalysis.PandasDataAnalysis",
"os.path.split",
"os.path.isfile",
"os.path.dirname",
"platform.system",
"os.path.abspath",
"sys.path.append"
] | [((390, 415), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (405, 415), False, 'import os, sys, time, platform\n'), ((427, 454), 'os.path.dirname', 'os.path.dirname', (['strabspath'], {}), '(strabspath)\n', (442, 454), False, 'import os, sys, time, platform\n'), ((465, 490), 'os.path.split',... |
from __future__ import unicode_literals
import logging
from django.core.management.base import BaseCommand
from django.db.models import F
from scripts import utils as script_utils
from osf.models import PreprintService
from website.preprints.tasks import on_preprint_updated
logger = logging.getLogger(__name__)
def ... | [
"logging.getLogger",
"website.preprints.tasks.on_preprint_updated",
"django.db.models.F",
"scripts.utils.add_file_logger"
] | [((287, 314), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (304, 314), False, 'import logging\n'), ((442, 461), 'django.db.models.F', 'F', (['"""node__modified"""'], {}), "('node__modified')\n", (443, 461), False, 'from django.db.models import F\n'), ((588, 621), 'website.preprints.task... |
import numpy as np
from sklearn.decomposition import PCA
import pandas as pd
import matplotlib.pyplot as plt
import random
import seaborn as sns
from sklearn.cluster import KMeans
from sklearn.metrics import confusion_matrix
from sklearn.metrics.cluster import adjusted_rand_score
from sklearn.datasets import fetch_open... | [
"numpy.trace",
"pandas.read_csv",
"matplotlib.pyplot.ylabel",
"sklearn.neighbors.kneighbors_graph",
"random.choices",
"numpy.linalg.norm",
"sklearn.decomposition.sparse_encode",
"numpy.arange",
"sklearn.cluster.k_means",
"seaborn.distplot",
"sklearn.decomposition.PCA",
"matplotlib.pyplot.xlabe... | [((15196, 15201), 'sklearn.decomposition.PCA', 'PCA', ([], {}), '()\n', (15199, 15201), False, 'from sklearn.decomposition import PCA\n'), ((16649, 16657), 'sklearn.decomposition.PCA', 'PCA', (['(0.9)'], {}), '(0.9)\n', (16652, 16657), False, 'from sklearn.decomposition import PCA\n'), ((17838, 17857), 'sklearn.decompo... |
from tkinter import Tk, IntVar, Checkbutton, Button, Label, StringVar
from evaluator import Evaluator
class Win(Tk):
def __init__(self):
Tk.__init__(self, None, None)
self.wm_title('My first window')
self.evaluator = Evaluator()
self.label_var = StringVar()
Label(self, tex... | [
"tkinter.IntVar",
"tkinter.Checkbutton",
"evaluator.Evaluator",
"tkinter.Button",
"tkinter.StringVar",
"tkinter.Tk.__init__",
"tkinter.Label"
] | [((152, 181), 'tkinter.Tk.__init__', 'Tk.__init__', (['self', 'None', 'None'], {}), '(self, None, None)\n', (163, 181), False, 'from tkinter import Tk, IntVar, Checkbutton, Button, Label, StringVar\n'), ((248, 259), 'evaluator.Evaluator', 'Evaluator', ([], {}), '()\n', (257, 259), False, 'from evaluator import Evaluato... |
from unittest import TestCase
from mock_adapter import MockAdapter
from mock import Mock
from aweber_api import (AWeberAPI, AWeberUser, ACCESS_TOKEN_URL, AUTHORIZE_URL,
REQUEST_TOKEN_URL, AWeberEntry)
key = 'XXXXX'
secret = '3434534534534'
class AWeberAPITest(TestCase):
def setUp(self):
... | [
"mock.Mock",
"aweber_api.AWeberUser",
"aweber_api.AWeberAPI",
"mock_adapter.MockAdapter"
] | [((340, 362), 'aweber_api.AWeberAPI', 'AWeberAPI', (['key', 'secret'], {}), '(key, secret)\n', (349, 362), False, 'from aweber_api import AWeberAPI, AWeberUser, ACCESS_TOKEN_URL, AUTHORIZE_URL, REQUEST_TOKEN_URL, AWeberEntry\n'), ((641, 647), 'mock.Mock', 'Mock', ([], {}), '()\n', (645, 647), False, 'from mock import M... |
from amuse.community import *
from amuse.community.interface.gd import GravitationalDynamicsInterface
from amuse.community.interface.gd import GravitationalDynamics
from amuse.community.interface.gd import SinglePointGravityFieldInterface
from amuse.community.interface.gd import GravityFieldCode
class ReboundInterface... | [
"amuse.community.interface.gd.GravitationalDynamics.define_particle_sets",
"amuse.community.interface.gd.GravitationalDynamics.define_parameters",
"amuse.community.interface.gd.GravitationalDynamics.__init__",
"amuse.community.interface.gd.GravitationalDynamics.define_state",
"amuse.community.interface.gd.G... | [((22422, 22507), 'amuse.community.interface.gd.GravitationalDynamics.__init__', 'GravitationalDynamics.__init__', (['self', 'legacy_interface', 'convert_nbody'], {}), '(self, legacy_interface, convert_nbody, **options\n )\n', (22452, 22507), False, 'from amuse.community.interface.gd import GravitationalDynamics\n')... |
"""Conversion of parse tree nodes to strings."""
import re
import os
import typing
from mypy.util import dump_tagged, short_type
import mypy.nodes
from mypy.visitor import NodeVisitor
class StrConv(NodeVisitor[str]):
"""Visitor for converting a Node to a human-readable string.
For example, an MypyFile... | [
"mypy.util.short_type"
] | [((789, 804), 'mypy.util.short_type', 'short_type', (['obj'], {}), '(obj)\n', (799, 804), False, 'from mypy.util import dump_tagged, short_type\n'), ((8895, 8908), 'mypy.util.short_type', 'short_type', (['o'], {}), '(o)\n', (8905, 8908), False, 'from mypy.util import dump_tagged, short_type\n')] |
#
# General-purpose Photovoltaic Device Model - a drift diffusion base/Shockley-Read-Hall
# model for 1st, 2nd and 3rd generation solar cells.
# Copyright (C) 2008-2022 <NAME> r.<EMAIL>.<EMAIL> at googlemail.com
#
# https://www.gpvdm.com
#
# This program is free software; you can redistribute it and/or ... | [
"PyQt5.QtWidgets.QWidget",
"PyQt5.QtCore.pyqtSignal",
"PyQt5.QtWidgets.QToolBar",
"global_objects.global_object_run",
"webbrowser.open",
"tab.tab_class",
"icon_lib.icon_get",
"QWidgetSavePos.QWidgetSavePos.__init__",
"css.css_apply",
"gpvdm_json.gpvdm_data",
"PyQt5.QtWidgets.QTabWidget",
"PyQt... | [((1551, 1563), 'PyQt5.QtCore.pyqtSignal', 'pyqtSignal', ([], {}), '()\n', (1561, 1563), False, 'from PyQt5.QtCore import pyqtSignal\n'), ((1622, 1672), 'global_objects.global_object_run', 'global_object_run', (['"""ribbon_configure_dump_refresh"""'], {}), "('ribbon_configure_dump_refresh')\n", (1639, 1672), False, 'fr... |
"""
bakes houdini chanel expression into
keys on each frame in the timeline
Houdini 15.0
todo:
- automatical parm selection
"""
__version__ = 'v0.3'
__author__ = 'github/danielforgacs'
import hou
def bake_parm(parm):
values = []
start, end = get_frame_range()
end ... | [
"hou.parm",
"hou.Keyframe"
] | [((1073, 1097), 'hou.parm', 'hou.parm', (['"""/obj/geo1/rx"""'], {}), "('/obj/geo1/rx')\n", (1081, 1097), False, 'import hou\n'), ((712, 726), 'hou.Keyframe', 'hou.Keyframe', ([], {}), '()\n', (724, 726), False, 'import hou\n')] |
"""
Runs the coco-supplied cocoeval script to evaluate detections
outputted by using the output_coco_json flag in eval.py.
"""
import argparse
from pycocotools.coco import COCO
from pycocotools.cocoeval import COCOeval
parser = argparse.ArgumentParser(description='COCO Detections Evaluator')
parser.add_argument('-... | [
"pycocotools.coco.COCO",
"pycocotools.cocoeval.COCOeval",
"argparse.ArgumentParser"
] | [((233, 297), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""COCO Detections Evaluator"""'}), "(description='COCO Detections Evaluator')\n", (256, 297), False, 'import argparse\n'), ((898, 920), 'pycocotools.coco.COCO', 'COCO', (['args.gt_ann_file'], {}), '(args.gt_ann_file)\n', (902, 92... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from rest_framework.viewsets import GenericViewSet
from rest_framework import mixins
from irekua_database import models
from irekua_rest_api import serializers
from irekua_rest_api import utils
from irekua_rest_api.permissions import IsAdmin
from irekua... | [
"irekua_database.models.Term.objects.all",
"irekua_rest_api.utils.SerializerMapping.from_module",
"irekua_rest_api.utils.PermissionMapping"
] | [((638, 663), 'irekua_database.models.Term.objects.all', 'models.Term.objects.all', ([], {}), '()\n', (661, 663), False, 'from irekua_database import models\n'), ((715, 775), 'irekua_rest_api.utils.SerializerMapping.from_module', 'utils.SerializerMapping.from_module', (['serializers.terms.terms'], {}), '(serializers.te... |
from typing import Dict
from jina import Document, DocumentArray, Flow
from docarray.document.generators import from_csv
from random import randint
with open("Data.csv") as file:
movies = DocumentArray(
from_csv(file, field_resolver={'Summary': 'text'})
)
movies=movies.shuffle(seed=randint)
for i in ra... | [
"docarray.document.generators.from_csv"
] | [((216, 266), 'docarray.document.generators.from_csv', 'from_csv', (['file'], {'field_resolver': "{'Summary': 'text'}"}), "(file, field_resolver={'Summary': 'text'})\n", (224, 266), False, 'from docarray.document.generators import from_csv\n')] |
#
# Copyright (C) 2020 IBM. All Rights Reserved.
#
# See LICENSE.txt file in the root directory
# of this source tree for licensing information.
#
import json
from typing import List, Dict
from clai.server.searchlib.providers import Provider
class StackExchange(Provider):
def __init__(self, name: str, descripti... | [
"json.dumps"
] | [((762, 781), 'json.dumps', 'json.dumps', (['payload'], {}), '(payload)\n', (772, 781), False, 'import json\n')] |
#!/usr/bin/env python3
# class file uppergeodesic.py
# started as a script to visualize what happens to hyperbolic plane
# if different isometries act on it
import geodesic as gd
import numpy as np
import numpy.linalg as lina
import matplotlib.pyplot as plt
# upper half space as the basic model
class UpperGeodesic... | [
"numpy.sin",
"numpy.matrix",
"numpy.linspace",
"numpy.cos"
] | [((4613, 4650), 'numpy.matrix', 'np.matrix', (['[[diag, off], [off, diag]]'], {}), '([[diag, off], [off, diag]])\n', (4622, 4650), True, 'import numpy as np\n'), ((2161, 2192), 'numpy.linspace', 'np.linspace', (['(0)', 'np.pi', 'self.res'], {}), '(0, np.pi, self.res)\n', (2172, 2192), True, 'import numpy as np\n'), ((2... |
import os
import json
def evaluation(results, all_res, bug_data, storage_path):
map_value = 0
map_value_all = 0
ap_value = {}
count = 0
for bug_id, bug_cont in bug_data.items():
temp1 = 0
temp2 = 0
ap_tmp = 0
all_ap_tmp = 0
truth_num = 0
file_pa... | [
"json.load",
"os.path.join",
"json.dump"
] | [((1708, 1753), 'os.path.join', 'os.path.join', (['storage_path', '"""evaluation.json"""'], {}), "(storage_path, 'evaluation.json')\n", (1720, 1753), False, 'import os\n'), ((1993, 2020), 'json.dump', 'json.dump', (['past_ap_value', 'f'], {}), '(past_ap_value, f)\n', (2002, 2020), False, 'import json\n'), ((1860, 1872)... |
"""
Created on Thu Sept 24 2020-
@author: <NAME>
GitHub username: esgomezm
"""
import tensorflow as tf
from tensorflow.keras import backend as K
from tensorflow.keras.losses import binary_crossentropy
import numpy as np
from tensorflow.keras import losses
# --------------------------------
# ## Unet with tf 2.0.0
# h... | [
"tensorflow.keras.backend.log",
"tensorflow.shape",
"tensorflow.keras.backend.floatx",
"tensorflow.keras.backend.greater",
"tensorflow.keras.backend.ones_like",
"tensorflow.keras.losses.binary_crossentropy",
"tensorflow.cast",
"tensorflow.keras.backend.conv2d",
"tensorflow.keras.backend.conv3d",
"... | [((1129, 1167), 'tensorflow.keras.backend.clip', 'K.clip', (['y_pred', 'epsilon', '(1.0 - epsilon)'], {}), '(y_pred, epsilon, 1.0 - epsilon)\n', (1135, 1167), True, 'from tensorflow.keras import backend as K\n'), ((1186, 1216), 'tensorflow.keras.backend.log', 'K.log', (['(y_pred / (1.0 - y_pred))'], {}), '(y_pred / (1.... |
# Copyright 2017 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... | [
"tensorflow.python.saved_model.signature_def_utils.regression_signature_def",
"tensorflow.python.framework.dtypes.as_dtype",
"tensorflow.python.saved_model.signature_def_utils.classification_signature_def",
"tensorflow.python.saved_model.signature_def_utils.predict_signature_def"
] | [((4153, 4242), 'tensorflow.python.saved_model.signature_def_utils.classification_signature_def', 'signature_def_utils.classification_signature_def', (['examples', 'self.classes', 'self.scores'], {}), '(examples, self.classes,\n self.scores)\n', (4201, 4242), False, 'from tensorflow.python.saved_model import signatu... |
import xlsxwriter
# Create a workbook and add a worksheet.
workbook = xlsxwriter.Workbook('Expenses01.xlsx')
worksheet = workbook.add_worksheet()
# Some data we want to write to the worksheet.
expenses = (
['Rent', 1000],
['Gas', 100],
['Food', 300],
['Gym', 50],
)
# Start from the first cell. ... | [
"xlsxwriter.Workbook"
] | [((71, 109), 'xlsxwriter.Workbook', 'xlsxwriter.Workbook', (['"""Expenses01.xlsx"""'], {}), "('Expenses01.xlsx')\n", (90, 109), False, 'import xlsxwriter\n')] |
"""Generic socket server classes.
This module tries to capture the various aspects of defining a server:
For socket-based servers:
- address family:
- AF_INET{,6}: IP (Internet Protocol) sockets (default)
- AF_UNIX: Unix domain sockets
- others, e.g. AF_DECNET are conceivable (see <socket.h>
... | [
"dummy_threading.Thread",
"socket.socket",
"os.waitpid",
"io.BytesIO",
"os._exit",
"dummy_threading.Event",
"os.fork",
"traceback.print_exc",
"time.time"
] | [((7416, 7433), 'dummy_threading.Event', 'threading.Event', ([], {}), '()\n', (7431, 7433), True, 'import dummy_threading as threading\n'), ((13072, 13093), 'traceback.print_exc', 'traceback.print_exc', ([], {}), '()\n', (13091, 13093), False, 'import traceback\n'), ((14642, 14694), 'socket.socket', 'socket.socket', ([... |
#!/usr/bin/env python
# coding=utf-8
from django.conf.urls import patterns, url
from ma import views
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'cat.views.home', name='home'),
# url(r'^... | [
"django.conf.urls.url"
] | [((600, 626), 'django.conf.urls.url', 'url', (['"""^home/$"""', 'views.home'], {}), "('^home/$', views.home)\n", (603, 626), False, 'from django.conf.urls import patterns, url\n'), ((633, 657), 'django.conf.urls.url', 'url', (['"""^pwd/$"""', 'views.pwd'], {}), "('^pwd/$', views.pwd)\n", (636, 657), False, 'from django... |
from typing import Optional
import torch
import torch.nn as nn
from torch.nn.parameter import Parameter
class ShardedGradient:
def __init__(self,
param: Parameter,
sharded_module: nn.Module,
offload_config: Optional[dict] = None
) -> None:
... | [
"torch.is_floating_point",
"torch.no_grad",
"torch.cuda.current_stream",
"torch.device"
] | [((1079, 1094), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (1092, 1094), False, 'import torch\n'), ((2944, 2959), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (2957, 2959), False, 'import torch\n'), ((2208, 2245), 'torch.is_floating_point', 'torch.is_floating_point', (['reduced_grad'], {}), '(reduced_gr... |
#!/usr/bin/env python3
import argparse
import csv
from typing import List
from cyvcf2 import VCF
def main():
args = parse_arguments()
# load all variants
variants = []
with open(args.inputs) as f:
reader = csv.DictReader(f)
for row in reader:
variants += get_records(
... | [
"csv.DictWriter",
"cyvcf2.VCF",
"csv.DictReader",
"argparse.ArgumentParser"
] | [((1155, 1168), 'cyvcf2.VCF', 'VCF', (['vcf_path'], {}), '(vcf_path)\n', (1158, 1168), False, 'from cyvcf2 import VCF\n'), ((1695, 1798), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Reads a set of VCF files and creates list with the variants"""'}), "(description=\n 'Reads a set of ... |
import json
import bz2
import gzip
import _pickle as cPickle
import gym
import numpy as np
import quaternion
import skimage.morphology
import habitat
from envs.utils.fmm_planner import FMMPlanner
from constants import coco_categories
import envs.utils.pose as pu
class ObjectGoal_Env(habitat.RLEnv):
"""The Object... | [
"quaternion.as_rotation_vector",
"quaternion.as_float_array",
"envs.utils.fmm_planner.FMMPlanner",
"numpy.random.rand",
"gzip.open",
"envs.utils.pose.get_l2_distance",
"numpy.arange",
"_pickle.load",
"bz2.BZ2File",
"numpy.concatenate",
"constants.coco_categories.items",
"numpy.rad2deg",
"qua... | [((1554, 1576), 'gym.spaces.Discrete', 'gym.spaces.Discrete', (['(3)'], {}), '(3)\n', (1573, 1576), False, 'import gym\n'), ((1611, 1690), 'gym.spaces.Box', 'gym.spaces.Box', (['(0)', '(255)', '(3, args.frame_height, args.frame_width)'], {'dtype': '"""uint8"""'}), "(0, 255, (3, args.frame_height, args.frame_width), dty... |
import math
import re
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from go_utils.cleanup import ( # isort: skip
rename_latlon_cols,
replace_column_prefix,
round_cols,
standardize_null_vals,
)
from go_utils.plot import ( # isort: skip
completeness_histogram,
plot_fr... | [
"go_utils.plot.completeness_histogram",
"go_utils.plot.plot_int_distribution",
"matplotlib.pyplot.ylabel",
"go_utils.cleanup.round_cols",
"matplotlib.pyplot.xlabel",
"go_utils.cleanup.rename_latlon_cols",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.bar",
"re.sub",
"go_utils.cleanup.standardize_... | [((2550, 2624), 'go_utils.cleanup.replace_column_prefix', 'replace_column_prefix', (['df', '"""mosquitohabitatmapper"""', '"""mhm"""'], {'inplace': 'inplace'}), "(df, 'mosquitohabitatmapper', 'mhm', inplace=inplace)\n", (2571, 2624), False, 'from go_utils.cleanup import rename_latlon_cols, replace_column_prefix, round_... |
"""
mbed SDK
Copyright (c) 2011-2015 ARM 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 agreed to in wr... | [
"logging.getLogger",
"logging.NullHandler",
"prettytable.PrettyTable",
"os.listdir",
"os.path.exists",
"subprocess.Popen",
"os.path.join",
"functools.wraps",
"io.open",
"os.path.isfile",
"os.path.isdir",
"json.load",
"os.path.expanduser",
"re.search"
] | [((939, 966), 'logging.getLogger', 'logging.getLogger', (['"""mbedls"""'], {}), "('mbedls')\n", (956, 966), False, 'import logging\n'), ((1022, 1062), 'logging.getLogger', 'logging.getLogger', (['"""mbedls.lstools_base"""'], {}), "('mbedls.lstools_base')\n", (1039, 1062), False, 'import logging\n'), ((1081, 1102), 'log... |
# Copyright (c) 2013 <NAME> <<EMAIL>>
# Copyright (c) 2013, 2014 <NAME> <<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 rig... | [
"os.path.exists",
"sys.path.insert",
"ast.walk",
"hy._compat.wr_long",
"hy.errors.HyIOError",
"marshal.dump",
"os.path.splitext",
"io.open",
"hy.lex.tokenize",
"hy.compiler.hy_compile",
"hy.models.HyObject",
"hy.models.replace_hy_obj",
"os.path.abspath",
"os.stat",
"hy._compat.long_type"... | [((6603, 6625), 'sys.path.insert', 'sys.path.insert', (['(0)', '""""""'], {}), "(0, '')\n", (6618, 6625), False, 'import sys\n'), ((1839, 1859), 'hy.lex.tokenize', 'tokenize', (["(buf + '\\n')"], {}), "(buf + '\\n')\n", (1847, 1859), False, 'from hy.lex import tokenize, LexException\n'), ((3548, 3558), 'hy.models.HyObj... |
import pygame as pg
class State(pg.sprite.Sprite):
def __init__(self,col,row):
super().__init__()
self.image=pg.Surface((50,50))
self.rect=self.image.get_rect()
self.pos=pg.Vector2(col,row)
self.set_pixcel_position()
def set_pixcel_position(self):
self.r... | [
"pygame.image.load",
"pygame.Vector2",
"pygame.Surface"
] | [((130, 150), 'pygame.Surface', 'pg.Surface', (['(50, 50)'], {}), '((50, 50))\n', (140, 150), True, 'import pygame as pg\n'), ((207, 227), 'pygame.Vector2', 'pg.Vector2', (['col', 'row'], {}), '(col, row)\n', (217, 227), True, 'import pygame as pg\n'), ((599, 651), 'pygame.image.load', 'pg.image.load', (["('./images/' ... |
# -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2020.
#
# 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 modif... | [
"itertools.permutations",
"itertools.product",
"numpy.isclose"
] | [((3021, 3053), 'itertools.product', 'itertools.product', (['mos'], {'repeat': '(2)'}), '(mos, repeat=2)\n', (3038, 3053), False, 'import itertools\n'), ((3677, 3709), 'itertools.product', 'itertools.product', (['mos'], {'repeat': '(4)'}), '(mos, repeat=4)\n', (3694, 3709), False, 'import itertools\n'), ((3722, 3762), ... |
import os
import time
from parsons.etl.table import Table
from parsons.utilities.check_env import check
from slackclient import SlackClient
from slackclient.exceptions import SlackClientError
import requests
class Slack(object):
def __init__(self, api_key=None):
if api_key is None:
try:
... | [
"requests.post",
"slackclient.exceptions.SlackClientError",
"slackclient.SlackClient",
"parsons.etl.table.Table",
"parsons.utilities.check_env.check"
] | [((639, 664), 'slackclient.SlackClient', 'SlackClient', (['self.api_key'], {}), '(self.api_key)\n', (650, 664), False, 'from slackclient import SlackClient\n'), ((3936, 3986), 'parsons.utilities.check_env.check', 'check', (['"""SLACK_API_WEBHOOK"""', 'webhook'], {'optional': '(True)'}), "('SLACK_API_WEBHOOK', webhook, ... |
from flask import Flask, flash, request, redirect, url_for, render_template
from werkzeug.utils import secure_filename
import os
from keras.models import load_model
from keras.applications.inception_resnet_v2 import InceptionResNetV2
import tensorflow as tf
from skimage.io import imsave
from skimage.transform import re... | [
"flask.render_template",
"flask.Flask",
"PIL.Image.new",
"logging.exception",
"numpy.array",
"werkzeug.utils.secure_filename",
"os.listdir",
"skimage.color.rgb2lab",
"flask.flash",
"keras.applications.inception_resnet_v2.preprocess_input",
"skimage.color.lab2rgb",
"keras.applications.inception... | [((642, 664), 'tensorflow.get_default_graph', 'tf.get_default_graph', ([], {}), '()\n', (662, 664), True, 'import tensorflow as tf\n'), ((671, 686), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (676, 686), False, 'from flask import Flask, flash, request, redirect, url_for, render_template\n'), ((769, 799... |
import utils
import mysql.connector
def migration_name():
return "Spell blobs to spell table"
def check_preconditions(cur):
cur.execute("SHOW TABLES LIKE 'char_spells';")
if not cur.fetchone():
raise Exception("char_spells table does not exist. Please run sql/char_spells.sql")
def needs_to_run(c... | [
"utils.blob_to_binary"
] | [((1051, 1079), 'utils.blob_to_binary', 'utils.blob_to_binary', (['spells'], {}), '(spells)\n', (1071, 1079), False, 'import utils\n')] |
from collections import ChainMap
from collections.abc import Mapping, Iterable
from itertools import groupby
from operator import itemgetter
import numpy as np
from probability import RowKey
from probability import TableColumns
# from probability.core_1 import RowKey
# from probability.core_1 import TableColumns
def... | [
"probability.RowKey",
"numpy.max",
"operator.itemgetter",
"numpy.all",
"probability.TableColumns"
] | [((14467, 14529), 'numpy.all', 'np.all', (['(arr_counter[:, columns_info.indices] == values)'], {'axis': '(1)'}), '(arr_counter[:, columns_info.indices] == values, axis=1)\n', (14473, 14529), True, 'import numpy as np\n'), ((16044, 16075), 'numpy.max', 'np.max', (['arr_len[:, :-1]'], {'axis': '(0)'}), '(arr_len[:, :-1]... |
#!/usr/bin/env python
import argparse
from autoscaler.client.sender import send_request_data
def main():
parser = argparse.ArgumentParser(
description='Send a timestamp to the autoscaler listener'
)
parser.add_argument(
'--host',
type=str,
default='127.0.0.1',
help... | [
"autoscaler.client.sender.send_request_data",
"argparse.ArgumentParser"
] | [((121, 208), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Send a timestamp to the autoscaler listener"""'}), "(description=\n 'Send a timestamp to the autoscaler listener')\n", (144, 208), False, 'import argparse\n'), ((501, 540), 'autoscaler.client.sender.send_request_data', 'send... |
import math
from ffmpeg import probe
def get_bitrate(video_path):
bitrate = probe(video_path)['format']['bit_rate']
return f'{math.trunc(int(bitrate) / 1000)} kbit/s'
def get_framerate_fraction(video_path):
r_frame_rate = [stream for stream in probe(video_path)['streams']
if stream['... | [
"ffmpeg.probe"
] | [((82, 99), 'ffmpeg.probe', 'probe', (['video_path'], {}), '(video_path)\n', (87, 99), False, 'from ffmpeg import probe\n'), ((611, 628), 'ffmpeg.probe', 'probe', (['video_path'], {}), '(video_path)\n', (616, 628), False, 'from ffmpeg import probe\n'), ((260, 277), 'ffmpeg.probe', 'probe', (['video_path'], {}), '(video... |
import time;
try: # mDebugOutput use is Optional
from mDebugOutput import ShowDebugOutput, fShowDebugOutput;
except ModuleNotFoundError as oException:
if oException.args[0] != "No module named 'mDebugOutput'":
raise;
ShowDebugOutput = fShowDebugOutput = lambda x: x; # NOP
from mMultiThreading import cLock, ... | [
"mMultiThreading.cLock",
"mDebugOutput.fShowDebugOutput"
] | [((1342, 1466), 'mMultiThreading.cLock', 'cLock', (["('%s.__oConnectionsPropertyLock' % oSelf.__class__.__name__)"], {'n0DeadlockTimeoutInSeconds': 'gnDeadlockTimeoutInSeconds'}), "('%s.__oConnectionsPropertyLock' % oSelf.__class__.__name__,\n n0DeadlockTimeoutInSeconds=gnDeadlockTimeoutInSeconds)\n", (1347, 1466), ... |
# Copyright (C) 2020-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
from copy import deepcopy
from functools import partial
import numpy as np
import scipy
from addict import Dict
from ....algorithms.quantization import utils as eu
from ....engines.ac_engine import ACEngine
from ....graph.model_utils i... | [
"addict.Dict",
"numpy.mean",
"numpy.flip",
"numpy.asarray",
"numpy.argsort",
"numpy.nanmean",
"functools.partial",
"copy.deepcopy",
"scipy.special.softmax"
] | [((5558, 5564), 'addict.Dict', 'Dict', ([], {}), '()\n', (5562, 5564), False, 'from addict import Dict\n'), ((7929, 7965), 'numpy.argsort', 'np.argsort', (['distance_between_samples'], {}), '(distance_between_samples)\n', (7939, 7965), True, 'import numpy as np\n'), ((8299, 8312), 'numpy.asarray', 'np.asarray', (['u'],... |
from django.urls import path, include
from rest_framework.authtoken import views
from .views import home
urlpatterns = [
path('', home, name='api.home'),
path('category/', include('api.category.urls')),
path('product/', include('api.product.urls')),
path('order/', include('api.order.urls')),
path('... | [
"django.urls.path",
"django.urls.include"
] | [((126, 157), 'django.urls.path', 'path', (['""""""', 'home'], {'name': '"""api.home"""'}), "('', home, name='api.home')\n", (130, 157), False, 'from django.urls import path, include\n'), ((181, 209), 'django.urls.include', 'include', (['"""api.category.urls"""'], {}), "('api.category.urls')\n", (188, 209), False, 'fro... |
from django.urls import path
from notes_app import views
urlpatterns = [
path('',views.home,name='home'),
path('home/',views.home,name='home'),
path('add/',views.add,name='add'),
path('edit/<int:id>',views.edit,name='edit'),
path('delete/<int:id>',views.delete, name='delete')
]
| [
"django.urls.path"
] | [((77, 110), 'django.urls.path', 'path', (['""""""', 'views.home'], {'name': '"""home"""'}), "('', views.home, name='home')\n", (81, 110), False, 'from django.urls import path\n'), ((114, 152), 'django.urls.path', 'path', (['"""home/"""', 'views.home'], {'name': '"""home"""'}), "('home/', views.home, name='home')\n", (... |
import requests
from bs4 import BeautifulSoup
from .sections import *
SITE_PELANDO_COMPUTADORES = "https://www.pelando.com.br/grupo/computadores-e-informatica"
SITE_PELANDO_TECEESCRITORIO = "https://www.pelando.com.br/grupo/tecnologia-e-escritorio"
SITE_PELANDO_SMARTPHONES = "https://www.pelando.com.br/grupo/celulare... | [
"bs4.BeautifulSoup",
"requests.get"
] | [((1034, 1063), 'bs4.BeautifulSoup', 'BeautifulSoup', (['source', '"""lxml"""'], {}), "(source, 'lxml')\n", (1047, 1063), False, 'from bs4 import BeautifulSoup\n'), ((992, 1013), 'requests.get', 'requests.get', (['section'], {}), '(section)\n', (1004, 1013), False, 'import requests\n')] |
from collections import defaultdict
import time
from joblib import Parallel, delayed
from multiprocessing import cpu_count
from math import ceil
import torch
from torch import nn
import torch.multiprocessing as mp
import torch.distributed as dist
from torch.nn.parallel import DistributedDataParallel as DDP
from torch.u... | [
"torch.nn.CrossEntropyLoss",
"multiprocessing.cpu_count",
"numpy.array",
"torch.utils.data.distributed.DistributedSampler",
"torch.sum",
"sys.exit",
"joblib.delayed",
"torch.arange",
"os.path.exists",
"numpy.mean",
"os.listdir",
"nltk.corpus.stopwords.words",
"numpy.delete",
"numpy.max",
... | [((970, 1003), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (993, 1003), False, 'import warnings\n'), ((1868, 1937), 'transformers.BertTokenizer.from_pretrained', 'BertTokenizer.from_pretrained', (['self.pretrained_lm'], {'do_lower_case': '(True)'}), '(self.pretrained_lm... |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright (c) 2010 Citrix Systems, Inc.
# Copyright (c) 2011 Piston Cloud Computing, Inc
# Copyright (c) 2012 University Of Minho
# (c) Copyright 2013 Hewlett-Pa... | [
"libvirt.virEventRegisterDefaultImpl",
"nova.virt.libvirt.config.LibvirtConfigCaps",
"nova.virt.libvirt.utils.get_default_machine_type",
"oslo_utils.importutils.import_module",
"nova.utils.spawn",
"nova.compute.utils.notify_about_libvirt_connect_error",
"nova.i18n._",
"nova.virt.libvirt.config.Libvirt... | [((2186, 2213), 'oslo_log.log.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (2203, 2213), True, 'from oslo_log import log as logging\n'), ((2231, 2257), 'eventlet.patcher.original', 'patcher.original', (['"""socket"""'], {}), "('socket')\n", (2247, 2257), False, 'from eventlet import patcher\n'),... |
# -*- coding: utf-8 -*-
# Copyright 2015 www.suishouguan.com
#
# Licensed under the Private License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://github.com/samuelbaizg/ssguan/blob/master/LICENSE
#
# Unless ... | [
"ssguan.ignitor.base.struct.ThreadedDict",
"re.compile",
"ssguan.ignitor.base.struct.Storage",
"DBUtils.PooledDB.PooledDB",
"doctest.testmod",
"time.time",
"DBUtils.PooledDB.__version__.split"
] | [((1113, 1122), 'ssguan.ignitor.base.struct.Storage', 'Storage', ([], {}), '()\n', (1120, 1122), False, 'from ssguan.ignitor.base.struct import ThreadedDict, Storage\n'), ((41310, 41327), 'doctest.testmod', 'doctest.testmod', ([], {}), '()\n', (41325, 41327), False, 'import doctest\n'), ((14751, 14765), 'ssguan.ignitor... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Copyright (c) 2019, Linear Labs Technologies
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
Unles... | [
"ignite.engine.create_supervised_evaluator",
"collections.namedtuple",
"tensorboardX.SummaryWriter",
"torch.cuda.is_available",
"torch.cuda.empty_cache"
] | [((1420, 1489), 'collections.namedtuple', 'namedtuple', (['"""Transition"""', "('state', 'action', 'next_state', 'reward')"], {}), "('Transition', ('state', 'action', 'next_state', 'reward'))\n", (1430, 1489), False, 'from collections import namedtuple\n'), ((1534, 1559), 'torch.cuda.is_available', 'torch.cuda.is_avail... |
#! python
from commonthread import *
import time
lg = ThreadLogger()
lg.debug('hello!')
def worker1(th, x, y, **kwargs):
lg.debug('start')
lg.debug('th.name={}'.format(th.name))
lg.debug('x={}'.format(x))
lg.debug('y={}'.format(y))
lg.debug('kwargs={}'.format(kwargs))
time.sleep(5... | [
"time.sleep"
] | [((308, 321), 'time.sleep', 'time.sleep', (['(5)'], {}), '(5)\n', (318, 321), False, 'import time\n')] |
from uuid import uuid4
from datetime import datetime, timedelta
from flask import request, make_response, jsonify, Blueprint
from flask_restful import Resource, Api
from marshmallow.exceptions import ValidationError as DataError
from flask_jwt_extended import create_access_token, get_jwt_identity, jwt_required, current... | [
"flask_restful.Api",
"pluggy.HookimplMarker",
"flask_jwt_extended.create_access_token",
"uuid.uuid4",
"app.core.helpers.handleInternalError",
"datetime.datetime.now",
"flask.request.get_json",
"datetime.timedelta",
"flask.Blueprint",
"sqlalchemy.func.lower"
] | [((698, 719), 'pluggy.HookimplMarker', 'HookimplMarker', (['"""app"""'], {}), "('app')\n", (712, 719), False, 'from pluggy import HookimplMarker\n'), ((4822, 4869), 'flask.Blueprint', 'Blueprint', (['"""user"""', '__name__'], {'url_prefix': '"""/user"""'}), "('user', __name__, url_prefix='/user')\n", (4831, 4869), Fals... |
# -*- coding: utf-8 -*-
r"""
DataModule
==========
The DataModule encapsulates all the steps needed to process data:
- Download / tokenize
- Save to disk.
- Apply transforms (tokenize, pad, batch creation, etc…).
- Load inside Dataset.
- Wrap inside a DataLoader.
The most important function to... | [
"itertools.chain",
"click.secho",
"torch.load",
"torch.utils.data.TensorDataset",
"multiprocessing.cpu_count",
"os.path.isfile",
"torch.tensor",
"torchnlp.download.download_file_maybe_extract",
"collections.defaultdict",
"torch.save"
] | [((6207, 6236), 'os.path.isfile', 'os.path.isfile', (['dataset_cache'], {}), '(dataset_cache)\n', (6221, 6236), False, 'import os\n'), ((6534, 6610), 'click.secho', 'click.secho', (['"""Running tokenization: This might take some time!"""'], {'fg': '"""yellow"""'}), "('Running tokenization: This might take some time!', ... |
#!/usr/bin/env python
import os
os.environ["TF_CPP_MIN_LOG_LEVEL"] = '2'
import sys
import csv
import numpy as np
import pandas as pd
import random
from time import time, strftime, gmtime, sleep
from optparse import OptionParser
from pylsl import StreamInlet, resolve_byprop
from sklearn.linear_model import LinearRegre... | [
"subprocess.check_output",
"numpy.abs",
"os.listdir",
"random.choice",
"pylsl.StreamInlet",
"subprocess.Popen",
"os.path.join",
"optparse.OptionParser",
"pylsl.resolve_byprop",
"time.sleep",
"os.path.realpath",
"numpy.array",
"time.gmtime",
"numpy.concatenate",
"sys.exit",
"pandas.Data... | [((531, 545), 'optparse.OptionParser', 'OptionParser', ([], {}), '()\n', (543, 545), False, 'from optparse import OptionParser\n'), ((2457, 2497), 'pylsl.resolve_byprop', 'resolve_byprop', (['"""type"""', '"""EEG"""'], {'timeout': '(2)'}), "('type', 'EEG', timeout=2)\n", (2471, 2497), False, 'from pylsl import StreamIn... |
# Hungarian algorithm (Kuhn-Munkres) for solving the linear sum assignment
# problem. Taken from scikit-learn. Based on original code by <NAME>,
# adapted to NumPy by <NAME>.
# Further improvements by <NAME>, <NAME> and <NAME>.
#
# Copyright (c) 2008 <NAME> <<EMAIL>>, <NAME>
# Author: <NAME>, <NAME>
# License: 3... | [
"numpy.ones",
"numpy.where",
"numpy.asarray",
"numpy.argmax",
"numpy.any",
"numpy.zeros",
"numpy.min"
] | [((2927, 2950), 'numpy.asarray', 'np.asarray', (['cost_matrix'], {}), '(cost_matrix)\n', (2937, 2950), True, 'import numpy as np\n'), ((3713, 3734), 'numpy.where', 'np.where', (['(marked == 1)'], {}), '(marked == 1)\n', (3721, 3734), True, 'import numpy as np\n'), ((6247, 6289), 'numpy.asarray', 'np.asarray', (['state.... |
from abc import ABC, abstractmethod
import numpy as np
import pandas as pd
from pvrpm.core.enums import ConfigKeys as ck
from pvrpm.core.case import SamCase
from pvrpm.core.utils import sample, get_higher_components
from pvrpm.core.modules.monitor import IndepMonitor
class Failure(ABC):
"""
This abstract cl... | [
"numpy.random.random_sample",
"numpy.amin",
"pvrpm.core.utils.sample",
"numpy.array",
"numpy.zeros",
"numpy.finfo",
"numpy.argmin"
] | [((4175, 4216), 'numpy.argmin', 'np.argmin', (['possible_failure_times'], {'axis': '(1)'}), '(possible_failure_times, axis=1)\n', (4184, 4216), True, 'import numpy as np\n'), ((4249, 4288), 'numpy.amin', 'np.amin', (['possible_failure_times'], {'axis': '(1)'}), '(possible_failure_times, axis=1)\n', (4256, 4288), True, ... |
# uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Server\postures\posture_state_spec.py
# Compiled at: 2020-04-15 01:17:36
# Size of source mod 2**32: 27750 ... | [
"postures.posture_specs.variables_match",
"postures.posture_specs.PostureSpec",
"collections.namedtuple",
"postures.posture_specs.PostureAspectBody",
"animation.posture_manifest.logger.error",
"sims4.collections.frozendict",
"postures.posture_specs.PostureOperation.TargetAlreadyInSlot",
"postures.post... | [((1193, 1282), 'collections.namedtuple', 'namedtuple', (['"""_PostureStateSpec"""', "('posture_manifest', 'slot_manifest', 'body_target')"], {}), "('_PostureStateSpec', ('posture_manifest', 'slot_manifest',\n 'body_target'))\n", (1203, 1282), False, 'from collections import namedtuple\n'), ((15391, 15424), 'sims4.c... |
from aiohttp import web
import json
from weather_connector import WeatherConnector
from essentialdb import EssentialDB
import random
import jinja2
import aiohttp_jinja2
import os
import datetime
class MMRequestHandler:
def __init__(self, db_path):
self.db_path = db_path
self._init_db()
def _i... | [
"aiohttp.web.run_app",
"weather_connector.WeatherConnector",
"aiohttp.web.Application",
"json.load",
"os.path.isfile",
"datetime.datetime.now",
"essentialdb.EssentialDB",
"aiohttp_jinja2.template",
"jinja2.FileSystemLoader",
"datetime.timedelta"
] | [((616, 655), 'aiohttp_jinja2.template', 'aiohttp_jinja2.template', (['"""weather.html"""'], {}), "('weather.html')\n", (639, 655), False, 'import aiohttp_jinja2\n'), ((1399, 1436), 'aiohttp_jinja2.template', 'aiohttp_jinja2.template', (['"""quote.html"""'], {}), "('quote.html')\n", (1422, 1436), False, 'import aiohttp... |