code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import unittest
import json
from kit_test_helper import TestHelper
from bit_extension import BitExtension
# selenium stuff
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as ... | [
"selenium.webdriver.support.expected_conditions.presence_of_element_located",
"json.load",
"selenium.webdriver.support.expected_conditions.element_to_be_clickable",
"bit_extension.BitExtension",
"selenium.webdriver.Firefox",
"selenium.webdriver.support.expected_conditions.invisibility_of_element_located",... | [((652, 671), 'selenium.webdriver.Firefox', 'webdriver.Firefox', ([], {}), '()\n', (669, 671), False, 'from selenium import webdriver\n'), ((822, 834), 'kit_test_helper.TestHelper', 'TestHelper', ([], {}), '()\n', (832, 834), False, 'from kit_test_helper import TestHelper\n'), ((2865, 2896), 'selenium.webdriver.support... |
# Roll 'n' Jump
# Written in 2020, 2021 by <NAME>, <NAME>,
# <NAME>, <NAME>
# To the extent possible under law, the author(s) have dedicated all
# copyright and related and neighboring rights to this software to the
# public domain worldwide. This software is distributed without any warranty.
# You should have received... | [
"rollnjump.score.winner_endgame",
"hypothesis.strategies.lists",
"rollnjump.main.initialization",
"rollnjump.score.get_scores",
"hypothesis.strategies.characters",
"os.path.dirname",
"rollnjump.score.init_best_score",
"rollnjump.score.set_best_score",
"hypothesis.strategies.text",
"rollnjump.score... | [((1090, 1230), 'hypothesis.strategies.characters', 'characters', ([], {'min_codepoint': '(48)', 'max_codepoint': '(122)', 'blacklist_characters': "[':', ';', '<', '=', '>', '?', '@', '[', '\\\\', ']', '^', '_', '`']"}), "(min_codepoint=48, max_codepoint=122, blacklist_characters=[':',\n ';', '<', '=', '>', '?', '@'... |
# pyenchant
#
# Copyright (C) 2004-2011, <NAME>
#
# 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 libr... | [
"enchant._enchant.dict_describe",
"enchant.utils.get_default_language",
"enchant._enchant.get_version",
"enchant._enchant.broker_free_dict",
"enchant._enchant.broker_list_dicts",
"enchant._enchant.dict_get_error",
"enchant._enchant.broker_get_error",
"enchant._enchant.get_user_config_dir",
"os.path.... | [((33475, 33498), 'enchant._enchant.set_prefix_dir', '_e.set_prefix_dir', (['path'], {}), '(path)\n', (33492, 33498), True, 'from enchant import _enchant as _e\n'), ((7430, 7446), 'enchant._enchant.broker_init', '_e.broker_init', ([], {}), '()\n', (7444, 7446), True, 'from enchant import _enchant as _e\n'), ((8081, 811... |
# AUTOGENERATED! DO NOT EDIT! File to edit: 01_utils.ipynb (unless otherwise specified).
__all__ = ['to_hhmmss', 'to_secs', 'display_video', 'check_resolution', 'check_fps', 'play_audio',
'change_audio_format', 'trim_audio', 'change_volume', 'loop_audio', 'concat_audios']
# Internal Cell
from collections i... | [
"os.remove",
"IPython.core.display.Video",
"time.gmtime",
"IPython.display.Audio",
"collections.defaultdict",
"cv2.VideoCapture",
"pathlib.Path",
"imageio.get_reader",
"pydub.AudioSegment.from_file"
] | [((8700, 8717), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (8711, 8717), False, 'from collections import defaultdict\n'), ((17886, 17921), 'IPython.core.display.Video', 'Video', (['video'], {'height': '(400)', 'width': '(400)'}), '(video, height=400, width=400)\n', (17891, 17921), False, 'fro... |
# Copyright (c) 2018 <NAME>, <NAME>
# All rights reserved.
#
# Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
import mSCM
import sys
import numpy as np
from numpy.random import choice
from numpy.random import seed
import random
nbr = int(sys.argv[1])
random.seed(nbr... | [
"numpy.random.seed",
"random.seed"
] | [((305, 321), 'random.seed', 'random.seed', (['nbr'], {}), '(nbr)\n', (316, 321), False, 'import random\n'), ((322, 341), 'numpy.random.seed', 'np.random.seed', (['nbr'], {}), '(nbr)\n', (336, 341), True, 'import numpy as np\n')] |
import torch
import torch.nn as nn
class Swish(nn.Module):
def __init__(self):
super().__init__()
def forward(self, x):
return x * torch.sigmoid(x)
"""
class Swish(nn.Module):
def forward(self, input):
return (input * torch.sigmoid(input))
def __repr__(self):
return self._... | [
"torch.sigmoid"
] | [((161, 177), 'torch.sigmoid', 'torch.sigmoid', (['x'], {}), '(x)\n', (174, 177), False, 'import torch\n')] |
import os
import json
import socket
import logging
import asyncio
from typing import List
from discord import Forbidden
from discord.ext import commands
from bot import constants
from bot.utils.embed_handler import info, thumbnail, success
from bot.utils.members import get_member_activity, get_member_status
from bot.... | [
"bot.utils.embed_handler.info",
"bot.utils.exceptions.EndpointSuccess",
"discord.ext.commands.check",
"socket.socket",
"bot.utils.exceptions.EndpointError",
"json.dumps",
"bot.utils.embed_handler.success",
"bot.utils.embed_handler.thumbnail",
"discord.ext.commands.command",
"asyncio.coroutine",
... | [((562, 589), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (579, 589), False, 'import logging\n'), ((3921, 3939), 'discord.ext.commands.command', 'commands.command', ([], {}), '()\n', (3937, 3939), False, 'from discord.ext import commands\n'), ((3945, 3990), 'discord.ext.commands.check'... |
# 引入 sqlite 套件
import sqlite3
import numpy as np
import matplotlib.pyplot as plt
# %matplotlib inline
#定義資料庫位置
conn = sqlite3.connect('database.db')
db_connection = conn.cursor()
List_Ecg_Signal = [] ## 空列表
#t查詢數據
rows = db_connection.execute("SELECT serialno,time,length,date,ecg,qrs,beat,feature,measuremen... | [
"numpy.frombuffer",
"sqlite3.connect"
] | [((119, 149), 'sqlite3.connect', 'sqlite3.connect', (['"""database.db"""'], {}), "('database.db')\n", (134, 149), False, 'import sqlite3\n'), ((1028, 1062), 'numpy.frombuffer', 'np.frombuffer', (['row[4]'], {'dtype': '"""<f4"""'}), "(row[4], dtype='<f4')\n", (1041, 1062), True, 'import numpy as np\n')] |
import copy
import cv2
import glob
import json
import numpy as np
import os
from .box_utils import compute_box_3d, boxes_to_corners_3d, get_size
from .rotation import convert_angle_axis_to_matrix3
from .taxonomy import class_names, ARKitDatasetConfig
def TrajStringToMatrix(traj_str):
""" convert traj_str into tr... | [
"copy.deepcopy",
"numpy.ones_like",
"os.path.basename",
"numpy.asarray",
"numpy.zeros",
"numpy.identity",
"os.path.exists",
"numpy.float",
"numpy.ones",
"cv2.imread",
"numpy.mean",
"numpy.linalg.inv",
"numpy.loadtxt",
"numpy.array",
"numpy.dot",
"numpy.eye",
"os.path.join",
"numpy.... | [((1363, 1375), 'numpy.eye', 'np.eye', (['(4)', '(4)'], {}), '(4, 4)\n', (1369, 1375), True, 'import numpy as np\n'), ((1453, 1478), 'numpy.linalg.inv', 'np.linalg.inv', (['extrinsics'], {}), '(extrinsics)\n', (1466, 1478), True, 'import numpy as np\n'), ((1565, 1585), 'numpy.loadtxt', 'np.loadtxt', (['filename'], {}),... |
# Basic imports for Ryu
from ryu.base import app_manager
from ryu.controller import ofp_event
from ryu.controller.handler import CONFIG_DISPATCHER, MAIN_DISPATCHER
from ryu.controller.handler import set_ev_cls
import ryu.ofproto.ofproto_v1_3_parser as parser
import ryu.ofproto.ofproto_v1_3 as ofproto
from ryu.lib.packe... | [
"ryu.ofproto.ofproto_v1_3_parser.OFPMatch",
"ryu.controller.handler.set_ev_cls",
"ryu.ofproto.ofproto_v1_3_parser.OFPActionOutput",
"ryu.ofproto.ofproto_v1_3_parser.OFPInstructionActions"
] | [((1886, 1949), 'ryu.controller.handler.set_ev_cls', 'set_ev_cls', (['ofp_event.EventOFPSwitchFeatures', 'CONFIG_DISPATCHER'], {}), '(ofp_event.EventOFPSwitchFeatures, CONFIG_DISPATCHER)\n', (1896, 1949), False, 'from ryu.controller.handler import set_ev_cls\n'), ((2413, 2430), 'ryu.ofproto.ofproto_v1_3_parser.OFPMatch... |
#!/usr/bin/env python
# coding:utf-8
"""
@Time : 2021/10/15 17:29
@Author : harvey
@File : filters.py
@Software: PyCharm
@Desc:
@Module
"""
import uuid
import datetime
from django.contrib.auth.models import AbstractUser
from django.conf import settings
from django.db import models
from django.utils import timezone... | [
"django.utils.timezone.get_current_timezone",
"django.db.models.CharField",
"django.db.models.DateTimeField",
"django.db.models.ForeignKey",
"django.utils.timezone.now",
"django.db.models.EmailField",
"django.db.models.ImageField",
"django.utils.timezone.timedelta",
"django.db.models.UUIDField"
] | [((650, 723), 'django.db.models.UUIDField', 'models.UUIDField', ([], {'default': 'uuid.uuid4', 'primary_key': '(True)', 'verbose_name': '"""主键"""'}), "(default=uuid.uuid4, primary_key=True, verbose_name='主键')\n", (666, 723), False, 'from django.db import models\n'), ((739, 804), 'django.db.models.CharField', 'models.Ch... |
# coding: utf-8
from __future__ import absolute_import
import datetime
import re
import importlib
import six
from huaweicloudsdkcore.client import Client, ClientBuilder
from huaweicloudsdkcore.exceptions import exceptions
from huaweicloudsdkcore.utils import http_utils
from huaweicloudsdkcore.sdk_stream_request imp... | [
"huaweicloudsdkcore.client.ClientBuilder",
"huaweicloudsdkcore.utils.http_utils.select_header_content_type",
"importlib.import_module"
] | [((1024, 1077), 'importlib.import_module', 'importlib.import_module', (['"""huaweicloudsdkkms.v1.model"""'], {}), "('huaweicloudsdkkms.v1.model')\n", (1047, 1077), False, 'import importlib\n'), ((1211, 1231), 'huaweicloudsdkcore.client.ClientBuilder', 'ClientBuilder', (['clazz'], {}), '(clazz)\n', (1224, 1231), False, ... |
'''
Parse the MC_object database from the Habitat Stratus backup.
There are still lots of unknowns:
* Many objects have container 0x20202020. They appear to be unused, but it's
unclear why.
* Some address strings have unprintable characters. It's unclear if this
was intentional or garbage data.
* Matchbook (class... | [
"collections.OrderedDict",
"json.dump",
"struct.unpack",
"struct.calcsize"
] | [((897, 920), 'struct.calcsize', 'struct.calcsize', (['FORMAT'], {}), '(FORMAT)\n', (912, 920), False, 'import json, struct, sys\n'), ((5375, 5395), 'struct.calcsize', 'struct.calcsize', (['fmt'], {}), '(fmt)\n', (5390, 5395), False, 'import json, struct, sys\n'), ((5850, 5863), 'collections.OrderedDict', 'OrderedDict'... |
#
# Copyright (c) 2021 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | [
"tensorflow_serving.apis.get_model_metadata_pb2.GetModelMetadataRequest",
"tensorflow_serving.apis.predict_pb2.PredictRequest",
"tensorflow.core.framework.tensor_shape_pb2.TensorShapeProto.Dim",
"tensorflow.core.framework.tensor_pb2.TensorProto",
"ovmsclient.tfs_compat.grpc.requests.GrpcModelStatusRequest",... | [((8055, 8083), 'numpy.array', 'array', (['[1, 2, 3]'], {'dtype': 'int8'}), '([1, 2, 3], dtype=int8)\n', (8060, 8083), False, 'from numpy import array, float64, int32, int8, float128, float32\n'), ((11394, 11417), 'tensorflow_serving.apis.get_model_status_pb2.GetModelStatusRequest', 'GetModelStatusRequest', ([], {}), '... |
from uber_rides.session import Session
from uber_rides.client import UberRidesClient
#Add the token
session = Session(server_token='')
def getPriceEstimate(start_lat,start_long,end_lat,end_long):
client = UberRidesClient(session)
p=client.get_price_estimates(start_lat,start_long,end_lat,end_long)
key=str(start_l... | [
"uber_rides.client.UberRidesClient",
"uber_rides.session.Session"
] | [((112, 136), 'uber_rides.session.Session', 'Session', ([], {'server_token': '""""""'}), "(server_token='')\n", (119, 136), False, 'from uber_rides.session import Session\n'), ((210, 234), 'uber_rides.client.UberRidesClient', 'UberRidesClient', (['session'], {}), '(session)\n', (225, 234), False, 'from uber_rides.clien... |
import json
import logging
import random
import time
import configparser
import logging.handlers
from datetime import datetime, timezone
sample_data = {
"timestamp": "", # ISO Zulu date format
"equip_name": "X-Machine",
"feed_rate": 0.0,
"shaft_speed": 0,
"oil_temperature": 0.0,
"voltage": 0
}
... | [
"random.randint",
"json.dumps",
"time.sleep",
"logging.Formatter",
"logging.handlers.TimedRotatingFileHandler",
"configparser.ConfigParser",
"datetime.datetime.now",
"logging.getLogger"
] | [((396, 423), 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {}), '()\n', (421, 423), False, 'import configparser\n'), ((850, 882), 'logging.Formatter', 'logging.Formatter', (['"""%(message)s"""'], {}), "('%(message)s')\n", (867, 882), False, 'import logging\n'), ((897, 1018), 'logging.handlers.TimedRot... |
"""
Module containing all general purpose functions shared by other modules.
This module is not intended for the direct use by a User. Therefore, I will
only docstring functions if I see fit to do so.
LOG
---
11/07/18
Changed the way vector path is analysed. Now, the initial analysis is
done with the geometri... | [
"numpy.linalg.eigvals",
"numpy.triu",
"numpy.sum",
"numpy.arctan2",
"numpy.allclose",
"numpy.einsum",
"numpy.argmin",
"numpy.around",
"numpy.mean",
"numpy.linalg.norm",
"numpy.sin",
"numpy.arange",
"numpy.round",
"sklearn.cluster.DBSCAN",
"scipy.optimize.minimize",
"numpy.zeros_like",
... | [((11504, 11515), 'numpy.zeros', 'np.zeros', (['(3)'], {}), '(3)\n', (11512, 11515), True, 'import numpy as np\n'), ((11997, 12048), 'numpy.array', 'np.array', (['([com - com_adjust] * coordinates.shape[0])'], {}), '([com - com_adjust] * coordinates.shape[0])\n', (12005, 12048), True, 'import numpy as np\n'), ((12618, ... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2019-03-05 15:45
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('catalog', '0003_merge_20190305_1545'),
]
operations = [
migrations.AlterFie... | [
"django.db.models.CharField",
"django.db.models.URLField"
] | [((403, 453), 'django.db.models.URLField', 'models.URLField', ([], {'primary_key': '(True)', 'serialize': '(False)'}), '(primary_key=True, serialize=False)\n', (418, 453), False, 'from django.db import migrations, models\n'), ((577, 644), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)', 'p... |
import grpc
from six import iteritems
from . import hetr_pb2
from . import hetr_pb2_grpc
from ngraph.op_graph.serde.serde import op_to_protobuf, tensor_to_protobuf,\
pb_to_tensor, is_scalar_type, assign_scalar, protobuf_scalar_to_python
import logging
_TIMEOUT_SECONDS = 600
logger = logging.getLogger(__name__)
... | [
"ngraph.op_graph.serde.serde.pb_to_tensor",
"ngraph.op_graph.serde.serde.tensor_to_protobuf",
"ngraph.op_graph.serde.serde.assign_scalar",
"grpc.insecure_channel",
"ngraph.op_graph.serde.serde.protobuf_scalar_to_python",
"ngraph.op_graph.serde.serde.op_to_protobuf",
"ngraph.op_graph.serde.serde.is_scala... | [((291, 318), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (308, 318), False, 'import logging\n'), ((3516, 3575), 'grpc.insecure_channel', 'grpc.insecure_channel', (['self.server_address'], {'options': 'options'}), '(self.server_address, options=options)\n', (3537, 3575), False, 'import... |
import sys
import ast
import io
class Visitor(ast.NodeVisitor):
def __init__(self, f):
self.f = f
def generic_visit(self, node):
self.f.write(ast.dump(node))
self.f.write("\n")
super().generic_visit(node)
def visit_Assign(self, node):
for n in node.targets:
... | [
"ast.dump",
"ast.parse",
"io.StringIO"
] | [((793, 807), 'ast.parse', 'ast.parse', (['SRC'], {}), '(SRC)\n', (802, 807), False, 'import ast\n'), ((815, 828), 'io.StringIO', 'io.StringIO', ([], {}), '()\n', (826, 828), False, 'import io\n'), ((170, 184), 'ast.dump', 'ast.dump', (['node'], {}), '(node)\n', (178, 184), False, 'import ast\n')] |
import _sk_fail; _sk_fail._("SocketServer")
| [
"_sk_fail._"
] | [((17, 43), '_sk_fail._', '_sk_fail._', (['"""SocketServer"""'], {}), "('SocketServer')\n", (27, 43), False, 'import _sk_fail\n')] |
#!/usr/bin/env python3
from typing import List
import numpy as np
import copy
import pprint as pp
from scipy.misc import logsumexp
from scipy.stats import beta
from neuralmonkey.vocabulary import Vocabulary
from n_gram_model import NGramModel
from hypothesis import Hypothesis, ExpandFunction
from beam_search import... | [
"beam_search.empty_hypothesis",
"numpy.empty",
"beam_search.compute_feature",
"beam_search.score_hypothesis",
"numpy.argsort",
"numpy.argpartition",
"beam_search.expand_null",
"beam_search.log_softmax",
"numpy.in1d"
] | [((1875, 1922), 'numpy.empty', 'np.empty', ([], {'shape': '(rows, time_steps)', 'dtype': 'tuple'}), '(shape=(rows, time_steps), dtype=tuple)\n', (1883, 1922), True, 'import numpy as np\n'), ((3544, 3569), 'beam_search.log_softmax', 'log_softmax', (['logits_table'], {}), '(logits_table)\n', (3555, 3569), False, 'from be... |
from __future__ import print_function
from six.moves import xrange
from ortools.constraint_solver import pywrapcp
from ortools.constraint_solver import routing_enums_pb2
import googlemaps
gmaps = googlemaps.Client(key='******API_Key******') # Replace with the Google Distance Matrix API Key...
class DataProbl... | [
"googlemaps.Client",
"ortools.constraint_solver.pywrapcp.RoutingModel",
"six.moves.xrange",
"ortools.constraint_solver.pywrapcp.RoutingModel.DefaultSearchParameters"
] | [((203, 247), 'googlemaps.Client', 'googlemaps.Client', ([], {'key': '"""******API_Key******"""'}), "(key='******API_Key******')\n", (220, 247), False, 'import googlemaps\n'), ((5109, 5181), 'ortools.constraint_solver.pywrapcp.RoutingModel', 'pywrapcp.RoutingModel', (['data.num_locations', 'data.num_vehicles', 'data.de... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2018/10/18 1:13 PM
# @Author : <NAME>
# @File : urls.py
# @Software: Pycharm professional
from django.conf.urls import include, url
from data import views
urlpatterns = [
url(r'^large$', views.large_data),
url(r'^mini$', views.mini_data),
url(... | [
"django.conf.urls.url"
] | [((240, 272), 'django.conf.urls.url', 'url', (['"""^large$"""', 'views.large_data'], {}), "('^large$', views.large_data)\n", (243, 272), False, 'from django.conf.urls import include, url\n'), ((279, 309), 'django.conf.urls.url', 'url', (['"""^mini$"""', 'views.mini_data'], {}), "('^mini$', views.mini_data)\n", (282, 30... |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import os
dir = 'plots'
if not os.path.exists(dir):
os.mkdir(dir)
df = pd.read_csv('final_data/final-data.csv', index_col='player-name')
df =df.replace(-1,np.nan)
# describe
print('--- Description ---')
print(df.describe... | [
"os.mkdir",
"seaborn.displot",
"matplotlib.pyplot.clf",
"pandas.read_csv",
"os.path.exists",
"os.path.join"
] | [((170, 235), 'pandas.read_csv', 'pd.read_csv', (['"""final_data/final-data.csv"""'], {'index_col': '"""player-name"""'}), "('final_data/final-data.csv', index_col='player-name')\n", (181, 235), True, 'import pandas as pd\n'), ((340, 349), 'matplotlib.pyplot.clf', 'plt.clf', ([], {}), '()\n', (347, 349), True, 'import ... |
import json
from google.appengine.ext import ndb
from controllers.apiv3.api_base_controller import ApiBaseController
from controllers.apiv3.model_properties import filter_event_properties, filter_team_properties
from database.district_query import DistrictListQuery
from database.event_query import DistrictEventsQuery... | [
"controllers.apiv3.model_properties.filter_event_properties",
"controllers.apiv3.model_properties.filter_team_properties",
"json.dumps"
] | [((737, 810), 'json.dumps', 'json.dumps', (['district_list'], {'ensure_ascii': '(True)', 'indent': '(True)', 'sort_keys': '(True)'}), '(district_list, ensure_ascii=True, indent=True, sort_keys=True)\n', (747, 810), False, 'import json\n'), ((1485, 1551), 'json.dumps', 'json.dumps', (['events'], {'ensure_ascii': '(True)... |
#!/usr/bin/env python3
"""
Created on 24 Mar 2021
@author: <NAME> (<EMAIL>)
"""
from scs_host.sys.host import Host
# --------------------------------------------------------------------------------------------------------------------
sim = Host.sim()
print(sim)
| [
"scs_host.sys.host.Host.sim"
] | [((246, 256), 'scs_host.sys.host.Host.sim', 'Host.sim', ([], {}), '()\n', (254, 256), False, 'from scs_host.sys.host import Host\n')] |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 16 13:18:29 2021
@author: dpetrovykh
"""
from PyQt5 import QtCore, QtWidgets, QtWidgets
class MainWindow(QtWidgets.QMainWindow):
def __init__(self, parent=None):
# Run Initialization of parent class
super(MainWindow, self).__in... | [
"PyQt5.QtWidgets.QLabel",
"PyQt5.QtWidgets.QHBoxLayout",
"PyQt5.QtWidgets.QPushButton",
"PyQt5.QtWidgets.QApplication",
"PyQt5.QtWidgets.QStackedWidget"
] | [((2228, 2254), 'PyQt5.QtWidgets.QApplication', 'QtWidgets.QApplication', (['[]'], {}), '([])\n', (2250, 2254), False, 'from PyQt5 import QtCore, QtWidgets, QtWidgets\n'), ((446, 472), 'PyQt5.QtWidgets.QStackedWidget', 'QtWidgets.QStackedWidget', ([], {}), '()\n', (470, 472), False, 'from PyQt5 import QtCore, QtWidgets... |
import re
def normalize_text(text):
result = text.lower() #lower the text even unicode given
result = re.sub(r'[^a-z0-9 -]', ' ', result, flags = re.IGNORECASE|re.MULTILINE)
result = re.sub(r'( +)', ' ', result, flags = re.IGNORECASE|re.MULTILINE)
return result.strip()
| [
"re.sub"
] | [((111, 181), 're.sub', 're.sub', (['"""[^a-z0-9 -]"""', '""" """', 'result'], {'flags': '(re.IGNORECASE | re.MULTILINE)'}), "('[^a-z0-9 -]', ' ', result, flags=re.IGNORECASE | re.MULTILINE)\n", (117, 181), False, 'import re\n'), ((196, 259), 're.sub', 're.sub', (['"""( +)"""', '""" """', 'result'], {'flags': '(re.IGNO... |
from __future__ import nested_scopes, generators, division, absolute_import, with_statement, \
print_function, unicode_literals
from . import compatibility
compatibility.backport() # noqa
import builtins
import os # noqa
import sys # noqa
from io import UnsupportedOperation # noqa
from collections import O... | [
"unicodedata.normalize",
"inspect.getargvalues",
"inspect.getargspec",
"inspect.getmodulename",
"inspect.signature",
"collections.OrderedDict",
"inspect.getsource",
"os.path.split",
"inspect.stack",
"keyword.iskeyword",
"doctest.testmod"
] | [((2961, 2976), 'inspect.stack', 'inspect.stack', ([], {}), '()\n', (2974, 2976), False, 'import inspect\n'), ((7729, 7754), 'unicodedata.normalize', 'normalize', (['"""NFKD"""', 'string'], {}), "('NFKD', string)\n", (7738, 7754), False, 'from unicodedata import normalize\n'), ((11900, 11913), 'collections.OrderedDict'... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'cnheider'
from pynput import keyboard
# import keyboard
import utilities as U
COMBINATIONS = [
{keyboard.Key.shift, keyboard.Key.alt, keyboard.KeyCode(char='s')},
{keyboard.Key.shift, keyboard.Key.alt, keyboard.KeyCode(char='S')},
]
CALLBACKS = []
#... | [
"utilities.sprint",
"pynput.keyboard.KeyCode",
"pynput.keyboard.Listener"
] | [((510, 623), 'utilities.sprint', 'U.sprint', (['f"""\n\nPress any of:\n{COMBINATIONS}\n for early stopping\n"""'], {'color': '"""red"""', 'bold': '(True)', 'highlight': '(True)'}), '(f"""\n\nPress any of:\n{COMBINATIONS}\n for early stopping\n""", color=\n \'red\', bold=True, highlight=True)\n', (518, 623), True, '... |
#!/usr/bin/env python3
import sys
import json
CHUNK_SIZE = 4*32*1024
def wrong_written_size(x):
out = 0
while x >= 0:
out += x
x -= CHUNK_SIZE
return out
if __name__ == '__main__':
with open(sys.argv[1], 'rb') as f:
data = f.read()
print(sys.argv[1])
try:
j... | [
"json.loads",
"sys.exit"
] | [((603, 614), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (611, 614), False, 'import sys\n'), ((319, 335), 'json.loads', 'json.loads', (['data'], {}), '(data)\n', (329, 335), False, 'import json\n'), ((586, 597), 'sys.exit', 'sys.exit', (['(0)'], {}), '(0)\n', (594, 597), False, 'import sys\n')] |
from malcolm.yamlutil import check_yaml_names, make_block_creator
aravisGigE_driver_block = make_block_creator(__file__, "aravisGigE_driver_block.yaml")
aravisGigE_runnable_block = make_block_creator(
__file__, "aravisGigE_runnable_block.yaml"
)
aravisGigE_manager_block = make_block_creator(__file__, "aravisGigE_m... | [
"malcolm.yamlutil.make_block_creator"
] | [((93, 153), 'malcolm.yamlutil.make_block_creator', 'make_block_creator', (['__file__', '"""aravisGigE_driver_block.yaml"""'], {}), "(__file__, 'aravisGigE_driver_block.yaml')\n", (111, 153), False, 'from malcolm.yamlutil import check_yaml_names, make_block_creator\n'), ((182, 244), 'malcolm.yamlutil.make_block_creator... |
from werkzeug.exceptions import NotFound
from . import bp_obj, views
from project.core.models import User
@bp_obj.route('/')
def index():
return 'Welcome home.'
@bp_obj.route('/users/<username>')
def get_profile_info(username):
user = User.query.filter(User.username == username).first()
if user is N... | [
"project.core.models.User.query.filter",
"werkzeug.exceptions.NotFound"
] | [((339, 366), 'werkzeug.exceptions.NotFound', 'NotFound', (['"""User not found."""'], {}), "('User not found.')\n", (347, 366), False, 'from werkzeug.exceptions import NotFound\n'), ((250, 294), 'project.core.models.User.query.filter', 'User.query.filter', (['(User.username == username)'], {}), '(User.username == usern... |
import time
from animation import *
from asteroidField import *
from background import *
from loader import *
from physics import *
from player import *
from powerup import *
import pygame
from pygame.locals import *
from rotatingMenu_img import *
from spacemenu import *
from starField import *
# teclas dos jogadore... | [
"pygame.font.SysFont",
"pygame.mouse.set_visible",
"pygame.display.set_mode",
"pygame.event.get",
"pygame.init",
"pygame.display.flip",
"time.clock",
"pygame.sprite.RenderPlain",
"pygame.display.set_caption",
"pygame.time.Clock"
] | [((432, 445), 'pygame.init', 'pygame.init', ([], {}), '()\n', (443, 445), False, 'import pygame\n'), ((532, 586), 'pygame.display.set_mode', 'pygame.display.set_mode', (['SCREENSIZE', 'pygame.FULLSCREEN'], {}), '(SCREENSIZE, pygame.FULLSCREEN)\n', (555, 586), False, 'import pygame\n'), ((667, 694), 'pygame.mouse.set_vi... |
# -*- coding: utf-8 -*-
import ctypes
import os
from collections import namedtuple
from ctypes import POINTER
from six.moves import range
from .xdo import libX11 as _libX11
from .xdo import libxdo as _libxdo
from .xdo import ( # noqa
CURRENTWINDOW, SEARCH_CLASS, SEARCH_CLASSNAME, SEARCH_DESKTOP, SEARCH_NAME,
... | [
"ctypes.c_char_p",
"ctypes.c_int",
"six.moves.range",
"ctypes.byref",
"ctypes.c_ulong",
"os.environ.get",
"collections.namedtuple",
"ctypes.c_long",
"ctypes.c_uint",
"ctypes.POINTER"
] | [((488, 534), 'collections.namedtuple', 'namedtuple', (['"""mouse_location"""', '"""x,y,screen_num"""'], {}), "('mouse_location', 'x,y,screen_num')\n", (498, 534), False, 'from collections import namedtuple\n'), ((553, 607), 'collections.namedtuple', 'namedtuple', (['"""mouse_location2"""', '"""x,y,screen_num,window"""... |
import django_filters
from django import forms
from django.conf import settings
from django.db import models
from extras.models import Tag
def multivalue_field_factory(field_class):
"""
Given a form field class, return a subclass capable of accepting multiple values. This allows us to OR on multiple
filt... | [
"django.db.models.Q",
"django_filters.CharFilter",
"extras.models.Tag.objects.all"
] | [((3257, 3315), 'django_filters.CharFilter', 'django_filters.CharFilter', ([], {'method': '"""search"""', 'label': '"""Search"""'}), "(method='search', label='Search')\n", (3282, 3315), False, 'import django_filters\n'), ((2991, 3008), 'extras.models.Tag.objects.all', 'Tag.objects.all', ([], {}), '()\n', (3006, 3008), ... |
# -*- coding: utf-8 -*-
"""
Created on Sun May 23 16:38:11 2021
@author: Jaroslav
"""
# -*- coding: utf-8 -*-
def f1(x):
return x+1
x2=f1(1)
print("vvedite vo skolko uvelichet functziy:")
n=int(input())
def doublern (f):
def g(n):
return n*f
return g
#print(x2)
g=double... | [
"os.getcwd",
"os.listdir",
"shutil.copy"
] | [((818, 877), 'shutil.copy', 'shutil.copy', (['"""C:/F#/exp2/file1.txt"""', '"""C:/F#/exp2/file3.txt"""'], {}), "('C:/F#/exp2/file1.txt', 'C:/F#/exp2/file3.txt')\n", (829, 877), False, 'import shutil\n'), ((892, 903), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (901, 903), False, 'import os\n'), ((913, 938), 'os.listdi... |
#@@---------------------------@@
# Author: <NAME>
# Date: 5/18/17
# Description:
#@@---------------------------@@
from mininet.log import setLogLevel, info, lg
import sys
import logging
import subprocess
class Logger(object):
def __init__(self, terminal, filename):
self.terminal = terminal
self... | [
"subprocess.call",
"mininet.log.lg.addHandler",
"logging.FileHandler",
"mininet.log.setLogLevel"
] | [((919, 949), 'logging.FileHandler', 'logging.FileHandler', (['file_name'], {}), '(file_name)\n', (938, 949), False, 'import logging\n'), ((954, 973), 'mininet.log.setLogLevel', 'setLogLevel', (['"""info"""'], {}), "('info')\n", (965, 973), False, 'from mininet.log import setLogLevel, info, lg\n'), ((978, 995), 'minine... |
from ipykernel.kernelbase import Kernel
from MDSplus import Data
class MdstclKernel(Kernel):
implementation = 'Mdstcl'
implementation_version = '1.0'
language = 'no-op'
language_version = '0.1'
language_info = {
'name': 'mdstcl commands',
'mimetype': 'text/plain',
'file_exte... | [
"MDSplus.Data.execute"
] | [((675, 722), 'MDSplus.Data.execute', 'Data.execute', (['"""_status=tcl($1,_out),_out"""', 'line'], {}), "('_status=tcl($1,_out),_out', line)\n", (687, 722), False, 'from MDSplus import Data\n'), ((753, 776), 'MDSplus.Data.execute', 'Data.execute', (['"""_status"""'], {}), "('_status')\n", (765, 776), False, 'from MDSp... |
# ---
# jupyter:
# jupytext:
# formats: ipynb,py
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.9.1+dev
# kernelspec:
# display_name: Python [conda env:generic_expression] *
# language: python
# name: conda-env-g... | [
"pandas.read_csv",
"os.getcwd",
"sklearn.preprocessing.MinMaxScaler",
"scipy.stats.spearmanr",
"ponyo.utils.read_config",
"pandas.isnull",
"matplotlib.pyplot.colorbar",
"numpy.array",
"seaborn.jointplot",
"os.path.join",
"pandas.concat"
] | [((987, 1021), 'ponyo.utils.read_config', 'utils.read_config', (['config_filename'], {}), '(config_filename)\n', (1004, 1021), False, 'from ponyo import utils\n'), ((1174, 1222), 'os.path.join', 'os.path.join', (['base_dir', '"""human_general_analysis"""'], {}), "(base_dir, 'human_general_analysis')\n", (1186, 1222), F... |
from fastapi import FastAPI
from sqlalchemy import Column, Float, Integer, String
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
from sqlalchemy_utils import create_database, database_exists, drop_database
from fastapi_crudrouter imp... | [
"sqlalchemy_utils.create_database",
"sqlalchemy_utils.drop_database",
"sqlalchemy_utils.database_exists",
"fastapi_crudrouter.SQLAlchemyCRUDRouter",
"sqlalchemy.ext.declarative.declarative_base",
"sqlalchemy.Column",
"sqlalchemy.create_engine",
"sqlalchemy.orm.sessionmaker",
"fastapi.FastAPI"
] | [((580, 620), 'sqlalchemy_utils.database_exists', 'database_exists', (['SQLALCHEMY_DATABASE_URL'], {}), '(SQLALCHEMY_DATABASE_URL)\n', (595, 620), False, 'from sqlalchemy_utils import create_database, database_exists, drop_database\n'), ((674, 714), 'sqlalchemy_utils.create_database', 'create_database', (['SQLALCHEMY_D... |
"""
Steps:
-get the summer.ai.pem key
-login to the env.host machine and add your public key to the machine's authorized keys
http://www.perrygeo.com/running-python-with-compiled-code-on-aws-lambda.html
"""
from fabric.api import local, sudo, run, warn_only, env, lcd, cd
import yaml
with open("serapis/config/default... | [
"yaml.load",
"fabric.api.sudo",
"fabric.api.local",
"fabric.api.lcd",
"fabric.api.run",
"fabric.api.warn_only"
] | [((347, 359), 'yaml.load', 'yaml.load', (['f'], {}), '(f)\n', (356, 359), False, 'import yaml\n'), ((873, 899), 'fabric.api.sudo', 'sudo', (['"""sudo yum -y update"""'], {}), "('sudo yum -y update')\n", (877, 899), False, 'from fabric.api import local, sudo, run, warn_only, env, lcd, cd\n'), ((904, 931), 'fabric.api.su... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-11-07 08:01
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('project', '0037_auto_20171031_0715'),
]
operations = [
migrations.RenameField(
... | [
"django.db.migrations.RenameField"
] | [((292, 398), 'django.db.migrations.RenameField', 'migrations.RenameField', ([], {'model_name': '"""application"""', 'old_name': '"""did_accept_date"""', 'new_name': '"""decision_date"""'}), "(model_name='application', old_name='did_accept_date',\n new_name='decision_date')\n", (314, 398), False, 'from django.db imp... |
import tensorflow as tf
from layers.utils import CustomLayer
class SELayer(CustomLayer):
def __init__(self):
super().__init__()
def build(self, input_shape):
B, H, W, C = input_shape
self.squeeze = tf.keras.layers.GlobalAveragePooling2D()
self.excitation = tf.keras.Sequential... | [
"tensorflow.keras.layers.GlobalAveragePooling2D",
"tensorflow.keras.layers.Multiply",
"tensorflow.keras.layers.Dense"
] | [((234, 274), 'tensorflow.keras.layers.GlobalAveragePooling2D', 'tf.keras.layers.GlobalAveragePooling2D', ([], {}), '()\n', (272, 274), True, 'import tensorflow as tf\n'), ((456, 482), 'tensorflow.keras.layers.Multiply', 'tf.keras.layers.Multiply', ([], {}), '()\n', (480, 482), True, 'import tensorflow as tf\n'), ((335... |
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import os
import warnings
from matplotlib import colors
matplotlib.rc("font",family='AR PL SungtiL GB')
warnings.filterwarnings('ignore')
def vis_national(national, native, null, x):
fig = plt.figure()
ax = fig.add_subplot(111)
plt.gri... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.axhline",
"matplotlib.rc",
"matplotlib.pyplot.plot",
"warnings.filterwarnings",
"matplotlib.pyplot.bar",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"numpy.array",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pypl... | [((126, 174), 'matplotlib.rc', 'matplotlib.rc', (['"""font"""'], {'family': '"""AR PL SungtiL GB"""'}), "('font', family='AR PL SungtiL GB')\n", (139, 174), False, 'import matplotlib\n'), ((175, 208), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (198, 208), False, 'impor... |
#!/usr/bin/env bash
#!/bin/bash
#!/bin/sh
#!/bin/sh -
from vk_api.utils import get_random_id
from vk_api.bot_longpoll import VkBotLongPoll
from vk_api import VkUpload
import requests
import vk_api
import time
import bot_functions
import bot_variable
if bot_variable.flag_repository:
start_path = ""
else:
start... | [
"vk_api.utils.get_random_id",
"requests.Session",
"vk_api.VkUpload",
"time.sleep",
"vk_api.VkApi",
"vk_api.bot_longpoll.VkBotLongPoll"
] | [((542, 560), 'requests.Session', 'requests.Session', ([], {}), '()\n', (558, 560), False, 'import requests\n'), ((574, 599), 'vk_api.VkApi', 'vk_api.VkApi', ([], {'token': 'token'}), '(token=token)\n', (586, 599), False, 'import vk_api\n'), ((611, 649), 'vk_api.bot_longpoll.VkBotLongPoll', 'VkBotLongPoll', (['vk_sessi... |
from sympy import (symbols, FunctionMatrix, MatrixExpr, Lambda, Matrix)
def test_funcmatrix():
i, j = symbols('i,j')
X = FunctionMatrix(3, 3, Lambda((i, j), i - j))
assert X[1, 1] == 0
assert X[1, 2] == -1
assert X.shape == (3, 3)
assert X.rows == X.cols == 3
assert Matrix(X) == Matrix(3, ... | [
"sympy.symbols",
"sympy.Lambda",
"sympy.Matrix"
] | [((108, 122), 'sympy.symbols', 'symbols', (['"""i,j"""'], {}), "('i,j')\n", (115, 122), False, 'from sympy import symbols, FunctionMatrix, MatrixExpr, Lambda, Matrix\n'), ((152, 173), 'sympy.Lambda', 'Lambda', (['(i, j)', '(i - j)'], {}), '((i, j), i - j)\n', (158, 173), False, 'from sympy import symbols, FunctionMatri... |
from webdriver_manager.chrome import ChromeDriverManager
from bs4 import BeautifulSoup as bs
from selenium import webdriver
import json
browser = webdriver.Chrome(ChromeDriverManager().install())
browser.get("https://www.asdc.asi.it/bzcat/")
page = browser.execute_script("setPageSizeValue(0); setHead(Head, 1,... | [
"bs4.BeautifulSoup",
"webdriver_manager.chrome.ChromeDriverManager",
"json.dumps"
] | [((527, 550), 'bs4.BeautifulSoup', 'bs', (['page', '"""html.parser"""'], {}), "(page, 'html.parser')\n", (529, 550), True, 'from bs4 import BeautifulSoup as bs\n'), ((985, 1052), 'json.dumps', 'json.dumps', (['final'], {'sort_keys': '(True)', 'indent': '(4)', 'separators': "(',', ': ')"}), "(final, sort_keys=True, inde... |
# Copyright 2019 Graphcore Ltd.
import tensorflow as tf
import os
import time
import argparse
import numpy as np
import random
from tensorflow.python.ipu.scopes import ipu_scope
from tensorflow.python.ipu import ipu_compiler
from seq2seq_edits import AttentionWrapperNoAssert, dynamic_decode, TrainingHelperNoCond, Gre... | [
"tensorflow.contrib.seq2seq.BahdanauAttention",
"util.get_config",
"tensorflow.reduce_sum",
"tensorflow.contrib.seq2seq.LuongAttention",
"argparse.ArgumentParser",
"tensorflow.trainable_variables",
"seq2seq_edits.GreedyEmbeddingHelperNoCond",
"random.sample",
"time.strftime",
"tensorflow.logging.s... | [((566, 608), 'tensorflow.logging.set_verbosity', 'tf.logging.set_verbosity', (['tf.logging.ERROR'], {}), '(tf.logging.ERROR)\n', (590, 608), True, 'import tensorflow as tf\n'), ((14999, 15084), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""NMT model in TensorFlow to run on the IPU"""'}... |
"""
Generates an executable with pytest runner embedded using PyInstaller.
"""
if __name__ == '__main__':
import pytest
import subprocess
hidden = []
for x in pytest.freeze_includes():
hidden.extend(['--hidden-import', x])
args = ['pyinstaller', '--noconfirm'] + hidden + ['runtests_script.p... | [
"pytest.freeze_includes"
] | [((176, 200), 'pytest.freeze_includes', 'pytest.freeze_includes', ([], {}), '()\n', (198, 200), False, 'import pytest\n')] |
#!/usr/bin/python
# Copyright (c) 2020, 2022 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for d... | [
"ansible_collections.oracle.oci.plugins.module_utils.oci_common_utils.get_common_arg_spec",
"ansible.module_utils.basic.AnsibleModule",
"ansible_collections.oracle.oci.plugins.module_utils.oci_resource_utils.get_custom_class",
"ansible_collections.oracle.oci.plugins.module_utils.oci_common_utils.get_work_requ... | [((8365, 8421), 'ansible_collections.oracle.oci.plugins.module_utils.oci_resource_utils.get_custom_class', 'get_custom_class', (['"""MonitoredInstanceActionsHelperCustom"""'], {}), "('MonitoredInstanceActionsHelperCustom')\n", (8381, 8421), False, 'from ansible_collections.oracle.oci.plugins.module_utils.oci_resource_u... |
from django.conf import settings
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ImproperlyConfigured
from django.db import models
from django.utils.translation import gettext_lazy as _
from simpleseo.utils im... | [
"django.core.exceptions.ImproperlyConfigured",
"django.contrib.contenttypes.fields.GenericForeignKey",
"django.contrib.contenttypes.models.ContentType.objects.get",
"django.db.models.ForeignKey",
"django.utils.translation.gettext_lazy",
"django.db.models.PositiveIntegerField",
"simpleseo.utils.get_gener... | [((401, 480), 'django.db.models.ForeignKey', 'models.ForeignKey', (['ContentType'], {'on_delete': 'models.CASCADE', 'null': '(True)', 'blank': '(True)'}), '(ContentType, on_delete=models.CASCADE, null=True, blank=True)\n', (418, 480), False, 'from django.db import models\n'), ((506, 556), 'django.db.models.PositiveInte... |
import cv2
import numpy as np
from random import randint
from functools import reduce
from os import walk
from scipy.spatial import ConvexHull
DIMENSIONS = (512, 512)
def fragment_overlay(background_img, masked_fragment):
mask = masked_fragment.astype(int).sum(-1) == np.zeros(DIMENSIONS)
backgrou... | [
"cv2.GaussianBlur",
"numpy.abs",
"os.walk",
"cv2.warpAffine",
"numpy.random.randint",
"cv2.getRotationMatrix2D",
"random.randint",
"cv2.cvtColor",
"cv2.split",
"numpy.random.choice",
"cv2.addWeighted",
"cv2.createCLAHE",
"numpy.dot",
"cv2.merge",
"scipy.spatial.ConvexHull",
"cv2.add",
... | [((329, 387), 'numpy.where', 'np.where', (['mask[..., None]', 'background_img', 'masked_fragment'], {}), '(mask[..., None], background_img, masked_fragment)\n', (337, 387), True, 'import numpy as np\n'), ((1016, 1054), 'cv2.cvtColor', 'cv2.cvtColor', (['image', 'cv2.COLOR_BGR2LAB'], {}), '(image, cv2.COLOR_BGR2LAB)\n',... |
# -*- coding: utf-8 -*-
"""Console script for ptrello."""
import sys
import click
import logging
from ptrello import api
from ptrello.core.config import logger
# from ptrello.core.config import settings
# import inspect
logger = logging.getLogger("ptrello."+__name__)
default_note = "quicknote.txt"
class Config(obje... | [
"ptrello.api.print_trello_object",
"ptrello.api.guess_card_list_board",
"click.argument",
"click.option",
"ptrello.api.move_card",
"ptrello.api.add_card",
"sys._getframe",
"ptrello.api.add_comment",
"click.group",
"click.secho",
"logging.getLogger",
"click.prompt"
] | [((232, 272), 'logging.getLogger', 'logging.getLogger', (["('ptrello.' + __name__)"], {}), "('ptrello.' + __name__)\n", (249, 272), False, 'import logging\n'), ((414, 437), 'click.group', 'click.group', ([], {'chain': '(True)'}), '(chain=True)\n', (425, 437), False, 'import click\n'), ((1598, 1645), 'click.argument', '... |
import gzip
import io
import json
import os
import random
import time
import requests
import requests_cache
requests_cache.install_cache()
request = requests.get('https://rpg.rigden.us/seeds_of_infinity/resources/json/names.json')
NAMES = request.json()['data']
HOME_PATH = os.path.dirname(os.path.realpath(__file__... | [
"gzip.open",
"os.path.realpath",
"requests_cache.install_cache",
"json.dumps",
"random.choice",
"requests.get",
"io.open",
"os.path.join"
] | [((111, 141), 'requests_cache.install_cache', 'requests_cache.install_cache', ([], {}), '()\n', (139, 141), False, 'import requests_cache\n'), ((153, 239), 'requests.get', 'requests.get', (['"""https://rpg.rigden.us/seeds_of_infinity/resources/json/names.json"""'], {}), "(\n 'https://rpg.rigden.us/seeds_of_infinity/... |
import argparse
import os
import pathlib
import typing
import pycspr
from pycspr import NodeClient
from pycspr import NodeConnection
from pycspr.crypto import KeyAlgorithm
from pycspr.types import CL_ByteArray
from pycspr.types import CL_U256
from pycspr.types import Deploy
from pycspr.types import DeployParameters
fr... | [
"pycspr.create_deploy_parameters",
"pycspr.parse_public_key",
"pycspr.parse_private_key",
"argparse.ArgumentParser",
"pycspr.types.CL_ByteArray",
"pycspr.NodeConnection",
"pycspr.types.CL_U256",
"pycspr.create_standard_payment",
"pycspr.create_deploy",
"os.getenv"
] | [((613, 703), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (['"""Demo illustrating how to install an ERC-20 smart contract."""'], {}), "(\n 'Demo illustrating how to install an ERC-20 smart contract.')\n", (636, 703), False, 'import argparse\n'), ((3829, 3926), 'pycspr.parse_private_key', 'pycspr.parse_priv... |
# View more python tutorials on my Youtube and Youku channel!!!
# Youtube video tutorial: https://www.youtube.com/channel/UCdyjiB5H8Pu7aDTNVXTTpcg
# Youku video tutorial: http://i.youku.com/pythontutorial
# 12 - contours
"""
Please note, this script is for python3+.
If you are using python2+, please modify it accordi... | [
"matplotlib.pyplot.clabel",
"numpy.meshgrid",
"matplotlib.pyplot.show",
"matplotlib.pyplot.yticks",
"numpy.exp",
"numpy.linspace",
"matplotlib.pyplot.xticks"
] | [((576, 597), 'numpy.linspace', 'np.linspace', (['(-3)', '(3)', 'n'], {}), '(-3, 3, n)\n', (587, 597), True, 'import numpy as np\n'), ((602, 623), 'numpy.linspace', 'np.linspace', (['(-3)', '(3)', 'n'], {}), '(-3, 3, n)\n', (613, 623), True, 'import numpy as np\n'), ((630, 647), 'numpy.meshgrid', 'np.meshgrid', (['x', ... |
import kfp
import kfp.dsl as dsl
from kfp.components import create_component_from_func
import kfp.components as comp
IMAGE = 'salazar99/python-kubeflow:latest'
DATA_URL = 'https://gs-kubeflow-pipelines.nyc3.digitaloceanspaces.com/clean-spam-data.csv'
# Download data
# def download_data(source_path: str, output_csv: c... | [
"numpy.save",
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"sklearn.feature_extraction.text.TfidfVectorizer",
"kfp.components.create_component_from_func",
"kfp.compiler.Compiler",
"kfp.components.InputPath",
"kfp.components.load_component_from_url",
"sklearn.feature_selection.Selec... | [((621, 771), 'kfp.components.load_component_from_url', 'kfp.components.load_component_from_url', (['"""https://raw.githubusercontent.com/kubeflow/pipelines/master/components/web/Download/component.yaml"""'], {}), "(\n 'https://raw.githubusercontent.com/kubeflow/pipelines/master/components/web/Download/component.yam... |
import sys
import os
import platform
import threading
import socket
import pytest
from Pyro5 import config, socketutil
# determine ipv6 capability
has_ipv6 = socket.has_ipv6
if has_ipv6:
s = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM)
try:
s.connect(("::1", 53))
s.close()
socket.... | [
"Pyro5.socketutil.send_data",
"Pyro5.socketutil.create_bc_socket",
"os.remove",
"sys.platform.startswith",
"socket.socket",
"Pyro5.socketutil.create_socket",
"os.path.exists",
"pytest.skip",
"platform.system",
"Pyro5.socketutil.receive_data",
"socket.getaddrinfo",
"Pyro5.socketutil.find_probab... | [((197, 246), 'socket.socket', 'socket.socket', (['socket.AF_INET6', 'socket.SOCK_DGRAM'], {}), '(socket.AF_INET6, socket.SOCK_DGRAM)\n', (210, 246), False, 'import socket\n'), ((313, 365), 'socket.getaddrinfo', 'socket.getaddrinfo', (['"""localhost"""', '(53)', 'socket.AF_INET6'], {}), "('localhost', 53, socket.AF_INE... |
# coding=utf-8
"""
Attempt to creat an RNG that picks numbers like humans
# favors date parts (1-31, 1-12, 19/20, 50-99/00-18)
# seeks/avoids patterns (i.e. 1,2,3,4,5 or 2,22,32,42)
# favors past winning numbers
# favors culturally meaningful numbers, 777, 888, etc.
# http://ww2.amstat.org/publications/jse/v13n2/meck... | [
"datetime.date.today",
"random.randint",
"datetime.timedelta"
] | [((2279, 2302), 'random.randint', 'random.randint', (['(0)', 'days'], {}), '(0, days)\n', (2293, 2302), False, 'import random\n'), ((2206, 2218), 'datetime.date.today', 'date.today', ([], {}), '()\n', (2216, 2218), False, 'from datetime import date, timedelta\n'), ((2221, 2241), 'datetime.timedelta', 'timedelta', ([], ... |
# coding=utf-8
# Copyright 2020 The TensorFlow Datasets 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 appl... | [
"tensorflow_datasets.testing.test_main",
"tensorflow_datasets.core._sharded_files.get_read_instructions"
] | [((2399, 2418), 'tensorflow_datasets.testing.test_main', 'testing.test_main', ([], {}), '()\n', (2416, 2418), False, 'from tensorflow_datasets import testing\n'), ((1014, 1088), 'tensorflow_datasets.core._sharded_files.get_read_instructions', '_sharded_files.get_read_instructions', (['(0)', '(12)', "['f1', 'f2', 'f3']"... |
#!/usr/bin/env python3
# coding=utf-8
import glob
import sys
import os.path
import subprocess
from utils import Fore, parse_image_arg, probe_wsl, get_label, path_trans, handle_sigint
# handle arguments
handle_sigint()
if len(sys.argv) < 2:
# print usage information
print('usage: ./switch.py image[:tag]')
# che... | [
"utils.handle_sigint",
"utils.get_label",
"utils.parse_image_arg",
"utils.probe_wsl",
"sys.exit"
] | [((204, 219), 'utils.handle_sigint', 'handle_sigint', ([], {}), '()\n', (217, 219), False, 'from utils import Fore, parse_image_arg, probe_wsl, get_label, path_trans, handle_sigint\n'), ((1590, 1625), 'utils.parse_image_arg', 'parse_image_arg', (['sys.argv[1]', '(False)'], {}), '(sys.argv[1], False)\n', (1605, 1625), F... |
# Generated by Django 3.0.7 on 2020-06-07 13:45
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('Torrents', '0004_auto_20200607_1344'),
]
operations = [
migrations.AlterField(
model_name='uploadtorrents',
name='up... | [
"django.db.models.CharField"
] | [((352, 413), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'default': '"""tabish"""', 'max_length': '(50)'}), "(blank=True, default='tabish', max_length=50)\n", (368, 413), False, 'from django.db import migrations, models\n')] |
import sys
from mitmproxy.platform import pf
from . import tutils
class TestLookup:
def test_simple(self):
if sys.platform == "freebsd10":
p = tutils.test_data.path("data/pf02")
d = open(p, "rb").read()
else:
p = tutils.test_data.path("data/pf01")
d... | [
"mitmproxy.platform.pf.lookup"
] | [((359, 395), 'mitmproxy.platform.pf.lookup', 'pf.lookup', (['"""192.168.1.111"""', '(40000)', 'd'], {}), "('192.168.1.111', 40000, d)\n", (368, 395), False, 'from mitmproxy.platform import pf\n')] |
#!/usr/bin/python
#
# Copyright 2002-2021 Barcelona Supercomputing Center (www.bsc.es)
#
# 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
... | [
"os.remove",
"pycompss.util.warnings.modules.show_optional_module_warnings",
"os.path.getsize",
"os.path.exists",
"pycompss.util.exceptions.PyCOMPSsException",
"pycompss.util.warnings.modules.get_optional_module_warning"
] | [((880, 948), 'pycompss.util.warnings.modules.get_optional_module_warning', 'get_optional_module_warning', (['"""UNITTEST_NAME"""', '"""UNITTEST_DESCRIPTION"""'], {}), "('UNITTEST_NAME', 'UNITTEST_DESCRIPTION')\n", (907, 948), False, 'from pycompss.util.warnings.modules import get_optional_module_warning\n'), ((1627, 1... |
# ==============================================================================
# Copyright 2019 - <NAME>
#
# NOTICE: 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, ... | [
"diplomacy_research.models.state_space.get_current_season",
"diplomacy_research.models.datasets.base_builder.VarProtoField",
"diplomacy_research.models.state_space.get_orderable_locs_for_powers",
"diplomacy_research.models.state_space.get_order_based_mask",
"numpy.zeros",
"diplomacy_research.models.state_... | [((1513, 1540), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1530, 1540), False, 'import logging\n'), ((4610, 4630), 'diplomacy.Map', 'Map', (['state_proto.map'], {}), '(state_proto.map)\n', (4613, 4630), False, 'from diplomacy import Map\n'), ((4653, 4698), 'diplomacy_research.models.... |
# Generated by Django 3.0.2 on 2020-01-13 14:16
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('server_app', '0009_auto_20200113_1606'),
]
operations = [
migrations.AlterField(
model_name='film',
name='pic_url',
... | [
"django.db.models.FileField"
] | [((338, 377), 'django.db.models.FileField', 'models.FileField', ([], {'upload_to': '"""film_pic/"""'}), "(upload_to='film_pic/')\n", (354, 377), False, 'from django.db import migrations, models\n')] |
"""A setuptools based setup module.
See:
https://packaging.python.org/guides/distributing-packages-using-setuptools/
https://github.com/pypa/sampleproject
"""
from os import path
from setuptools import setup, find_packages
with open(path.join(path.abspath(path.dirname(__file__)), 'README.md'), encoding='utf-8') as f... | [
"os.path.dirname",
"setuptools.find_packages"
] | [((1177, 1236), 'setuptools.find_packages', 'find_packages', ([], {'exclude': "['contrib', 'docs', 'tests', 'test']"}), "(exclude=['contrib', 'docs', 'tests', 'test'])\n", (1190, 1236), False, 'from setuptools import setup, find_packages\n'), ((259, 281), 'os.path.dirname', 'path.dirname', (['__file__'], {}), '(__file_... |
from django.urls import path
from form_workshop.create_form.views import show_form_data
urlpatterns = [
path('', show_form_data, name='show form')
] | [
"django.urls.path"
] | [((113, 155), 'django.urls.path', 'path', (['""""""', 'show_form_data'], {'name': '"""show form"""'}), "('', show_form_data, name='show form')\n", (117, 155), False, 'from django.urls import path\n')] |
################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this... | [
"sys.path.append",
"serve.functions.bind",
"serve.run",
"os.path.dirname",
"os.path.realpath"
] | [((1067, 1091), 'os.path.dirname', 'os.path.dirname', (['current'], {}), '(current)\n', (1082, 1091), False, 'import os\n'), ((1092, 1115), 'sys.path.append', 'sys.path.append', (['parent'], {}), '(parent)\n', (1107, 1115), False, 'import sys\n'), ((1179, 1230), 'serve.functions.bind', 'serve.functions.bind', ([], {'ty... |
import py
from rpython.rtyper.lltypesystem import lltype, llmemory
from rpython.memory.gc.incminimark import IncrementalMiniMarkGC
from rpython.memory.gc.test.test_direct import BaseDirectGCTest
from rpython.rlib.rawrefcount import REFCNT_FROM_PYPY
from rpython.rlib.rawrefcount import REFCNT_FROM_PYPY_LIGHT
PYOBJ_HDR ... | [
"py.test.mark.parametrize",
"rpython.rtyper.lltypesystem.lltype.nullptr",
"rpython.rtyper.lltypesystem.lltype.free",
"py.test.raises",
"rpython.rtyper.lltypesystem.lltype.GcForwardReference",
"rpython.rtyper.lltypesystem.lltype.cast_opaque_ptr",
"rpython.rtyper.lltypesystem.lltype.Ptr",
"rpython.rtype... | [((411, 438), 'rpython.rtyper.lltypesystem.lltype.GcForwardReference', 'lltype.GcForwardReference', ([], {}), '()\n', (436, 438), False, 'from rpython.rtyper.lltypesystem import lltype, llmemory\n'), ((9154, 9205), 'py.test.mark.parametrize', 'py.test.mark.parametrize', (['"""external"""', '[False, True]'], {}), "('ext... |
from matplotlib import pyplot as plt
from PIL import Image
import pandas as pd
import matplotlib
import numpy as np
from typing import Optional, Union, Mapping # Special
from typing import Sequence, Iterable # ABCs
from typing import Tuple # Classes
from anndata import AnnData
import warnings
from stlearn.plottin... | [
"bokeh.io.output_notebook",
"stlearn.utils._docs_params",
"stlearn.plotting.classes.GenePlot",
"stlearn.plotting.classes_bokeh.BokehGenePlot",
"bokeh.plotting.show"
] | [((631, 709), 'stlearn.utils._docs_params', '_docs_params', ([], {'spatial_base_plot': 'doc_spatial_base_plot', 'gene_plot': 'doc_gene_plot'}), '(spatial_base_plot=doc_spatial_base_plot, gene_plot=doc_gene_plot)\n', (643, 709), False, 'from stlearn.utils import Empty, _empty, _AxesSubplot, _docs_params\n'), ((2215, 272... |
import csv
import numpy as np
import torch
import time
class Timer(object):
"""
docstring for Timer
"""
def __init__(self):
super(Timer, self).__init__()
self.total_time = 0.0
self.calls = 0
self.start_time = 0.0
self.diff = 0.0
self.average_time = 0.0
def tic(self):
self.start_time = time.time()
... | [
"numpy.random.beta",
"torch.randperm",
"csv.writer",
"time.time"
] | [((307, 318), 'time.time', 'time.time', ([], {}), '()\n', (316, 318), False, 'import time\n'), ((1435, 1476), 'csv.writer', 'csv.writer', (['self.log_file'], {'delimiter': '"""\t"""'}), "(self.log_file, delimiter='\\t')\n", (1445, 1476), False, 'import csv\n'), ((367, 378), 'time.time', 'time.time', ([], {}), '()\n', (... |
import pygame
pygame.mixer.init()
pygame.mixer.music.load("myFile.wav")
pygame.mixer.music.play()
while pygame.mixer.music.get_busy() == True:
continue
| [
"pygame.mixer.init",
"pygame.mixer.music.get_busy",
"pygame.mixer.music.play",
"pygame.mixer.music.load"
] | [((14, 33), 'pygame.mixer.init', 'pygame.mixer.init', ([], {}), '()\n', (31, 33), False, 'import pygame\n'), ((34, 71), 'pygame.mixer.music.load', 'pygame.mixer.music.load', (['"""myFile.wav"""'], {}), "('myFile.wav')\n", (57, 71), False, 'import pygame\n'), ((72, 97), 'pygame.mixer.music.play', 'pygame.mixer.music.pla... |
from flask import render_template
from . import main
from ..requests import get_sources, get_articles
#Views
@main.route('/')
def index():
'''
View root page function that returns the index page and its data
'''
#Getting news sources
sources = get_sources()
title = 'News OTG'
return rende... | [
"flask.render_template"
] | [((315, 374), 'flask.render_template', 'render_template', (['"""index.html"""'], {'title': 'title', 'sources': 'sources'}), "('index.html', title=title, sources=sources)\n", (330, 374), False, 'from flask import render_template\n'), ((599, 650), 'flask.render_template', 'render_template', (['"""articles.html"""'], {'ar... |
# check utils zdecomp
def izmat_zdecomp():
import numpy as np
from limetr.special_mat import izmat
ok = True
tol = 1e-10
# setup problem
# -------------------------------------------------------------------------
k = 3
n = [5, 2, 4]
z_list = []
tr_u_list = []
tr_s_list = ... | [
"numpy.random.randn",
"limetr.special_mat.izmat.zdecomp",
"numpy.zeros",
"numpy.hstack",
"numpy.linalg.svd",
"numpy.vstack"
] | [((530, 547), 'numpy.vstack', 'np.vstack', (['z_list'], {}), '(z_list)\n', (539, 547), True, 'import numpy as np\n'), ((631, 651), 'numpy.hstack', 'np.hstack', (['tr_s_list'], {}), '(tr_s_list)\n', (640, 651), True, 'import numpy as np\n'), ((664, 683), 'numpy.zeros', 'np.zeros', (['tr_u.size'], {}), '(tr_u.size)\n', (... |
"""OpenAQ Air Quality Dashboard with Flask."""
from datetime import datetime
from flask import Flask, render_template
from flask_sqlalchemy import SQLAlchemy
import openaq
APP = Flask(__name__)
APP.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///db.sqlite3'
DB = SQLAlchemy(APP)
class Record(DB.Model):
id = DB.Col... | [
"flask.Flask",
"openaq.OpenAQ",
"datetime.datetime.strptime",
"flask_sqlalchemy.SQLAlchemy",
"flask.render_template"
] | [((179, 194), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (184, 194), False, 'from flask import Flask, render_template\n'), ((263, 278), 'flask_sqlalchemy.SQLAlchemy', 'SQLAlchemy', (['APP'], {}), '(APP)\n', (273, 278), False, 'from flask_sqlalchemy import SQLAlchemy\n'), ((651, 666), 'openaq.OpenAQ', '... |
'''
Created on 13 Aug 2020
@author: <NAME>
'''
from .ts_util import *
import numpy as np
from typing import List, Tuple
class ts_data(object):
def __init__(self, ts: np.array, prop_train: float =0.75, has_time:bool = True, delta_t:float = 1.0):
'''
Utility object for time series data.
... | [
"numpy.linalg.inv"
] | [((2492, 2521), 'numpy.linalg.inv', 'np.linalg.inv', (['self.train_std'], {}), '(self.train_std)\n', (2505, 2521), True, 'import numpy as np\n')] |
# %% [markdown]
"""
# Target Tracking
This example demonstrates the kernel-based stochastic optimal control algorithm and the
dynamic programming algorithm. By default, it uses a nonholonomic vehicle system
(unicycle dynamics), and seeks to track a v-shaped trajectory.
To run the example, use the following command:
... | [
"functools.partial",
"gym_socks.sampling.random_sampler",
"matplotlib.pyplot.show",
"numpy.abs",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.axes",
"numpy.power",
"matplotlib.pyplot.legend",
"numpy.rad2deg",
"matplotlib.pyplot.figure",
"numpy.array",
"gym.envs.registration.make",
"numpy.lin... | [((1343, 1358), 'gym.envs.registration.make', 'make', (['system_id'], {}), '(system_id)\n', (1347, 1358), False, 'from gym.envs.registration import make\n'), ((1833, 1874), 'gym_socks.sampling.random_sampler', 'random_sampler', ([], {'sample_space': 'sample_space'}), '(sample_space=sample_space)\n', (1847, 1874), False... |
"""
ckwg +31
Copyright 2016-2020 by Kitware, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and... | [
"kwiver.vital.types.rotation.interpolate_rotation",
"numpy.asarray",
"numpy.array",
"kwiver.vital.types.RotationD",
"kwiver.vital.types.RotationF",
"numpy.testing.assert_equal",
"numpy.linalg.norm",
"numpy.eye",
"numpy.testing.assert_array_almost_equal",
"kwiver.vital.types.rotation.interpolated_r... | [((1827, 1850), 'numpy.asarray', 'numpy.asarray', (['a', 'dtype'], {}), '(a, dtype)\n', (1840, 1850), False, 'import numpy\n'), ((2028, 2039), 'kwiver.vital.types.RotationD', 'RotationD', ([], {}), '()\n', (2037, 2039), False, 'from kwiver.vital.types import rotation, RotationD, RotationF\n'), ((2111, 2122), 'kwiver.vi... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import print_function
__author__ = 'bibow'
import json, uuid, os
from datetime import datetime, date
from decimal import Decimal
import logging
logger = logging.getLogger()
logger.setLevel(eval(os.environ["LOGGINGLEVEL"]))
import boto3
from boto3.dynamodb.con... | [
"boto3.dynamodb.conditions.Key",
"json.dumps",
"datetime.datetime.utcnow",
"uuid.uuid1",
"boto3.resource",
"logging.getLogger"
] | [((213, 232), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (230, 232), False, 'import logging\n'), ((356, 382), 'boto3.resource', 'boto3.resource', (['"""dynamodb"""'], {}), "('dynamodb')\n", (370, 382), False, 'import boto3\n'), ((1823, 1867), 'json.dumps', 'json.dumps', (['order'], {'indent': '(4)', 'c... |
from flask_script import Manager
from schedule import frontend, api
from werkzeug.wsgi import DispatcherMiddleware
from werkzeug.serving import run_simple
from schedule.core import db
manager = Manager(frontend.create_app())
@manager.command
def runserver():
app = DispatcherMiddleware(frontend.create_app(), {'/a... | [
"schedule.core.db.drop_all",
"schedule.api.create_app",
"schedule.frontend.create_app",
"werkzeug.serving.run_simple",
"schedule.core.db.create_all"
] | [((203, 224), 'schedule.frontend.create_app', 'frontend.create_app', ([], {}), '()\n', (222, 224), False, 'from schedule import frontend, api\n'), ((348, 418), 'werkzeug.serving.run_simple', 'run_simple', (['"""0.0.0.0"""', '(5000)', 'app'], {'use_reloader': '(True)', 'use_debugger': '(True)'}), "('0.0.0.0', 5000, app,... |
'''
Created on 28.12.2016
@author: sapejura
'''
import threading
import socket
import select
import queue
from xcamserver.framebuffer import FrameQueue
# from xcamserver import worker_ctx, dummy_worker
class SocketServer():
def __init__(self):
self.stop_event = threading.Event()
self.thread = th... | [
"threading.Thread",
"xcamserver.framebuffer.FrameQueue",
"socket.socket",
"select.select",
"threading.Event"
] | [((278, 295), 'threading.Event', 'threading.Event', ([], {}), '()\n', (293, 295), False, 'import threading\n'), ((318, 407), 'threading.Thread', 'threading.Thread', ([], {'name': '"""socket thread"""', 'target': 'self._thread', 'args': '(self.stop_event,)'}), "(name='socket thread', target=self._thread, args=(self.\n ... |
#!/usr/bin/env python3
# imports go here
from xmlrpc.server import SimpleXMLRPCServer
import xmlrpc.client
from threading import Thread
#
# Free Coding session for 2015-02-07
# Written by <NAME>
#
def run_server():
server = SimpleXMLRPCServer(('localhost', 9000))
server.register_function(pow)
server.regi... | [
"threading.Thread",
"xmlrpc.server.SimpleXMLRPCServer"
] | [((584, 609), 'threading.Thread', 'Thread', ([], {'target': 'run_server'}), '(target=run_server)\n', (590, 609), False, 'from threading import Thread\n'), ((625, 651), 'threading.Thread', 'Thread', ([], {'target': 'call_server'}), '(target=call_server)\n', (631, 651), False, 'from threading import Thread\n'), ((231, 27... |
# This file is part of the Astrometry.net suite.
# Licensed under a 3-clause BSD style license - see LICENSE
from __future__ import print_function
from __future__ import absolute_import
import os
from astrometry.util.fits import fits_table
import numpy as np
import logging
import tempfile
import sys
py3 = (sys.version... | [
"os.remove",
"os.close",
"os.path.join",
"numpy.round",
"numpy.unique",
"numpy.meshgrid",
"numpy.zeros_like",
"os.path.dirname",
"os.path.exists",
"numpy.log10",
"numpy.minimum",
"os.path.basename",
"os.rename",
"astropy.io.fits.open",
"astrometry.util.fits.fits_table",
"astrometry.uti... | [((4601, 4654), 'numpy.array', 'np.array', (['[1.4e-10, 9e-11, 1.2e-10, 1.8e-10, 7.4e-10]'], {}), '([1.4e-10, 9e-11, 1.2e-10, 1.8e-10, 7.4e-10])\n', (4609, 4654), True, 'import numpy as np\n'), ((4721, 4742), 'numpy.log', 'np.log', (['_lup_to_mag_b'], {}), '(_lup_to_mag_b)\n', (4727, 4742), True, 'import numpy as np\n'... |
import base64
import json
import sys
import wave
from flask import Flask, jsonify, request
from flask_cors import CORS
import parselmouth
import pandas as pd
from scipy.signal import find_peaks
import numpy as np
import matplotlib.pyplot as plt
app = Flask(__name__)
app_config = {"host": "0.0.0.0", "port": sys.argv[1... | [
"matplotlib.pyplot.xlim",
"wave.open",
"parselmouth.Sound",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylim",
"flask_cors.CORS",
"matplotlib.pyplot.twinx",
"numpy.frombuffer",
"flask.Flask",
"numpy.empty",
"flask.request.environ.get",
"matplotlib.pyplot.figure",
"flask.jsonify",
"matplot... | [((253, 268), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (258, 268), False, 'from flask import Flask, jsonify, request\n'), ((537, 581), 'flask_cors.CORS', 'CORS', (['app'], {'resource': "{'/*': {'origins': '*'}}"}), "(app, resource={'/*': {'origins': '*'}})\n", (541, 581), False, 'from flask_cors impo... |
from overrides import overrides
from claf.config.registry import Registry
from claf.config.utils import convert_config2dict
from claf.tokens import tokenizer
from .base import Factory
def make_tokenizer(tokenizer_cls, tokenizer_config, parent_tokenizers={}):
if tokenizer_config is None or "name" not in tokeniz... | [
"claf.config.registry.Registry",
"claf.config.utils.convert_config2dict"
] | [((1907, 1917), 'claf.config.registry.Registry', 'Registry', ([], {}), '()\n', (1915, 1917), False, 'from claf.config.registry import Registry\n'), ((1997, 2039), 'claf.config.utils.convert_config2dict', 'convert_config2dict', (['self.config.tokenizer'], {}), '(self.config.tokenizer)\n', (2016, 2039), False, 'from claf... |
import argparse
from sensai_dataset.generator.commands import generate_dataset
from sensai_dataset.generator.constants import DATASET_DIR, DATASET_SOURCE_DIR
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='dataset generator')
parser.add_argument('-m', '--matcher', type=str, default='c... | [
"argparse.ArgumentParser",
"sensai_dataset.generator.commands.generate_dataset"
] | [((200, 256), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""dataset generator"""'}), "(description='dataset generator')\n", (223, 256), False, 'import argparse\n'), ((449, 546), 'sensai_dataset.generator.commands.generate_dataset', 'generate_dataset', ([], {'source_dir': 'DATASET_SOURCE... |
# Lint as: python2, python3
# Copyright 2019 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
#
... | [
"lingvo.tasks.car.kitti_metadata.KITTIMetadata",
"lingvo.compat.gfile.Open",
"numpy.load",
"lingvo.compat.gfile.MkDir",
"lingvo.tasks.car.tools.kitti_data.VeloToCameraTransformation",
"lingvo.compat.app.run",
"lingvo.compat.gfile.Exists",
"absl.flags.DEFINE_string",
"lingvo.compat.logging.info",
"... | [((1752, 1964), 'absl.flags.DEFINE_string', 'flags.DEFINE_string', (['"""decoder_path"""', 'None', '"""Paths to decoder file containing output of decoder for everything. Either supply this argument or individual decoder paths for cars, pedestrians and cyclists."""'], {}), "('decoder_path', None,\n 'Paths to decoder ... |
# !/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import argparse
import datetime
import json
import math
import os
import random
import time
import numpy as np
import torch
import torch.optim as optim
import torch.utils.data
import compression
from compression.utils import load_i... | [
"numpy.random.seed",
"argparse.ArgumentParser",
"torch.optim.lr_scheduler.StepLR",
"os.path.isfile",
"numpy.mean",
"optimization.training.train",
"os.path.join",
"optimization.training.evaluate",
"random.randint",
"torch.utils.data.DataLoader",
"numpy.std",
"torch.load",
"random.seed",
"co... | [((384, 401), 'random.seed', 'random.seed', (['(7610)'], {}), '(7610)\n', (395, 401), False, 'import random\n'), ((412, 485), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""PyTorch Discrete Normalizing flows"""'}), "(description='PyTorch Discrete Normalizing flows')\n", (435, 485), False... |
#!/usr/bin/env python3
"""tests for histy.py"""
import os
import random
import re
import string
from subprocess import getstatusoutput
prg = './histy.py'
# --------------------------------------------------
def test_usage():
"""usage"""
for flag in ['', '-h', '--help']:
rv, out = getstatusoutput('{... | [
"os.path.join",
"re.match"
] | [((413, 450), 're.match', 're.match', (['"""usage"""', 'out', 're.IGNORECASE'], {}), "('usage', out, re.IGNORECASE)\n", (421, 450), False, 'import re\n'), ((636, 675), 'os.path.join', 'os.path.join', (['"""test-outs"""', 'expected_out'], {}), "('test-outs', expected_out)\n", (648, 675), False, 'import os\n')] |
#!/usr/bin/env python3
from pymoos import pymoos
import time
import matplotlib.pyplot as plt
import numpy as np
import threading
fig, ax = plt.subplots(subplot_kw=dict(polar=True))
ax.set_theta_direction(-1)
ax.set_theta_zero_location('N')
nav_line, des_line, = ax.plot([], [], 'r', [], [], 'b')
nav_line.set_label('NAV... | [
"matplotlib.pyplot.show",
"numpy.deg2rad",
"threading.Lock",
"matplotlib.pyplot.draw",
"numpy.arange"
] | [((3430, 3440), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (3438, 3440), True, 'import matplotlib.pyplot as plt\n'), ((906, 922), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (920, 922), False, 'import threading\n'), ((2401, 2432), 'numpy.arange', 'np.arange', (['(0)', 'self.n_speed', '(0.1)'], {}... |
import os
import configparser
import logging
import cx_Oracle
import sqlparse
import sys
log = logging.getLogger()
log.setLevel(logging.INFO)
SCRIPTS_FOLDER_BASE = "../db/"
INIT_FOLDER_PATH = SCRIPTS_FOLDER_BASE + "init/"
ADDITIONS_FOLDER_PATH = SCRIPTS_FOLDER_BASE + "additions/"
CONFIG_FILE_PATH = "../connection.ini... | [
"sqlparse.split",
"logging.getLogger",
"cx_Oracle.connect",
"configparser.ConfigParser",
"os.listdir",
"sys.exit"
] | [((96, 115), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (113, 115), False, 'import logging\n'), ((1298, 1325), 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {}), '()\n', (1323, 1325), False, 'import configparser\n'), ((5228, 5251), 'os.listdir', 'os.listdir', (['folder_path'], {}), '(f... |
import numpy as np
from random import random
import math
class Path:
def __init__(self, r):
self.radius = r
self.path = []
def circleDiscretization(self, qtd_poits = 40):
self.path = []
angle_diff = 2 * math.pi / qtd_poits
for i in range(qtd_poits):
point... | [
"math.sin",
"numpy.array",
"math.cos",
"math.sqrt"
] | [((614, 656), 'math.sqrt', 'math.sqrt', (['((x1 - x2) ** 2 + (y1 - y2) ** 2)'], {}), '((x1 - x2) ** 2 + (y1 - y2) ** 2)\n', (623, 656), False, 'import math\n'), ((1655, 1669), 'numpy.array', 'np.array', (['path'], {}), '(path)\n', (1663, 1669), True, 'import numpy as np\n'), ((1132, 1152), 'numpy.array', 'np.array', ([... |
#! /usr/bin/env python
import random
import numpy as np
class Environment:
def __init__(self, size=[3,4], start=(0,0), end=(2,3), block=[(1,1)], false_end=(1,3)):
self.size = size
self.state = np.zeros(self.size)
self.action_space = self.generate_action_space()
self.state_space = s... | [
"numpy.zeros"
] | [((215, 234), 'numpy.zeros', 'np.zeros', (['self.size'], {}), '(self.size)\n', (223, 234), True, 'import numpy as np\n')] |
import torch
from torch.optim.optimizer import Optimizer, required
from torch import optim, nn
import torch.optim._functional as F
from agc_optims.utils import agc
class RMSprop_AGC(Optimizer):
r"""Implements RMSprop algorithm with adaptive gradient clipping (AGC).
.. math::
\begin{aligned}
... | [
"torch.zeros_like",
"torch.optim._functional.rmsprop",
"torch.enable_grad",
"torch.no_grad",
"agc_optims.utils.agc"
] | [((5926, 5941), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (5939, 5941), False, 'import torch\n'), ((7820, 8061), 'torch.optim._functional.rmsprop', 'F.rmsprop', (['params_with_grad', 'grads', 'square_avgs', 'grad_avgs', 'momentum_buffer_list'], {'lr': "group['lr']", 'alpha': "group['alpha']", 'eps': "group['e... |
import sys
sys.path.insert(0,'../input/shopee-competition-utils')
from config import CFG
from run_test import run_bert_test
# choose which cuda to load model on
CFG.DEVICE = 'cuda:0'
CFG.BATCH_SIZE = 16
# choose which model with what hyperparameters to use
CFG.BERT_MODEL_NAME = CFG.BERT_MODEL_NAMES[3]
CFG.MARGIN = C... | [
"sys.path.insert",
"config.CFG.BERT_MODEL_NAME.rsplit",
"run_test.run_bert_test"
] | [((11, 66), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""../input/shopee-competition-utils"""'], {}), "(0, '../input/shopee-competition-utils')\n", (26, 66), False, 'import sys\n'), ((461, 476), 'run_test.run_bert_test', 'run_bert_test', ([], {}), '()\n', (474, 476), False, 'from run_test import run_bert_test\n')... |
#!/usr/bin/env python3
from __future__ import print_function
from __future__ import absolute_import
import os, click
import subprocess
from taw.util import *
from taw.taw import *
# commands/subcommands
# ==============
# SSH COMMAND
# ==============
@taw.command("ssh")
@click.argument('hostname', metavar='<host n... | [
"click.argument",
"click.option",
"os.path.exists",
"os.path.expanduser",
"subprocess.check_call"
] | [((277, 326), 'click.argument', 'click.argument', (['"""hostname"""'], {'metavar': '"""<host name>"""'}), "('hostname', metavar='<host name>')\n", (291, 326), False, 'import os, click\n'), ((328, 363), 'click.argument', 'click.argument', (['"""sshargs"""'], {'nargs': '(-1)'}), "('sshargs', nargs=-1)\n", (342, 363), Fal... |
# -*- coding: utf-8 -*-
from model.group import Group
import random
import re
def test_delete_some_group(app, db, check_ui):
if len(db.get_group_list()) == 0:
app.group.create(Group(name = "test"))
old_groups = db.get_group_list()
group = random.choice(old_groups)
app.group.delete_group_by_id(g... | [
"random.choice",
"model.group.Group"
] | [((260, 285), 'random.choice', 'random.choice', (['old_groups'], {}), '(old_groups)\n', (273, 285), False, 'import random\n'), ((189, 207), 'model.group.Group', 'Group', ([], {'name': '"""test"""'}), "(name='test')\n", (194, 207), False, 'from model.group import Group\n')] |