code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import requests
from lxml import html
class GithubRepo:
name = ''
author = ''
summary = ''
tag_list = []
license = ''
lastUpdateTime = ''
language = ''
star_num = 0
def tostring(self):
print(self.__dict__)
keyWorld = 'swift'
language = 'Swift'
URL = ('https://github.com... | [
"requests.session",
"lxml.html.fromstring"
] | [((411, 429), 'requests.session', 'requests.session', ([], {}), '()\n', (427, 429), False, 'import requests\n'), ((466, 496), 'lxml.html.fromstring', 'html.fromstring', (['response.text'], {}), '(response.text)\n', (481, 496), False, 'from lxml import html\n')] |
"""Test merge module"""
import copy
import json
import unittest
from unittest.mock import MagicMock, patch
from annotation import merge
from util.files import FileModel, MergeGroup
class MergeImagesTest(unittest.TestCase):
"""Merge frames test"""
TEST_SUFFIX = ".png"
TEST_KEYS = [
"front_left",... | [
"annotation.merge.create_layout_data",
"json.loads",
"annotation.merge.merge_json_data",
"util.files.FileModel",
"unittest.mock.MagicMock",
"copy.deepcopy",
"unittest.main"
] | [((451, 564), 'json.loads', 'json.loads', (['"""{"width": 10, "height": 5, "layout": [{"camera": "front", "location": {"y": 0, "x": 0}}]}"""'], {}), '(\n \'{"width": 10, "height": 5, "layout": [{"camera": "front", "location": {"y": 0, "x": 0}}]}\'\n )\n', (461, 564), False, 'import json\n'), ((591, 1022), 'json.l... |
#!/var/gopher/cgi-bin/venv/bin/python3.7
import os
from sys import stdin
from imdb import IMDb
from pyfiglet import Figlet
from gopher_server.menu import Menu, MenuItem, InfoMenuItem
# Configuration: Change this to your needs
host = "jan.bio"
selector = "/cgi-bin/gmdb.py"
port = 70
def p(str):
""" Renders a stri... | [
"gopher_server.menu.InfoMenuItem",
"pyfiglet.Figlet",
"imdb.IMDb",
"gopher_server.menu.MenuItem"
] | [((480, 486), 'imdb.IMDb', 'IMDb', ([], {}), '()\n', (484, 486), False, 'from imdb import IMDb\n'), ((515, 535), 'pyfiglet.Figlet', 'Figlet', ([], {'font': '"""slant"""'}), "(font='slant')\n", (521, 535), False, 'from pyfiglet import Figlet\n'), ((2004, 2054), 'gopher_server.menu.MenuItem', 'MenuItem', (['"""7"""', '""... |
import sys
import re
import subprocess
import json
import os
import argparse
sid_re = re.compile('exports ([0-9]+) as "([^"]+)"')
smap_re = re.compile('Push String:"(S[^"]+)".*String:"(A[^"]+)"')
actionstring_re = re.compile('Push String:"_(?P<key>.+)" String:"(?P<value>.+)"')
def extract_assets(dat_filename, outpath)... | [
"argparse.ArgumentParser",
"re.compile",
"os.makedirs",
"subprocess.run",
"json.dumps",
"sys.stderr.flush",
"os.path.isfile",
"sys.stderr.write",
"os.path.isdir"
] | [((87, 130), 're.compile', 're.compile', (['"""exports ([0-9]+) as "([^"]+)\\""""'], {}), '(\'exports ([0-9]+) as "([^"]+)"\')\n', (97, 130), False, 'import re\n'), ((141, 196), 're.compile', 're.compile', (['"""Push String:"(S[^"]+)".*String:"(A[^"]+)\\""""'], {}), '(\'Push String:"(S[^"]+)".*String:"(A[^"]+)"\')\n', ... |
from django.template import Template, Context
from django.template.loader import render_to_string
from django.conf import settings
def parse(kwargs, template_name="shortcodes/vimeo.html"):
video_id = kwargs.get('id')
if video_id:
width = int(kwargs.get(
'width',
getattr(setting... | [
"django.template.loader.render_to_string"
] | [((626, 662), 'django.template.loader.render_to_string', 'render_to_string', (['template_name', 'ctx'], {}), '(template_name, ctx)\n', (642, 662), False, 'from django.template.loader import render_to_string\n')] |
"""
Marshmallow fields to pyspark sql type converter
"""
from abc import ABCMeta, abstractmethod
from typing import Mapping, Type
from marshmallow import fields as ma_fields
from pyspark.sql.types import (DataType, StringType, BooleanType,
TimestampType, DateType, IntegerType,
... | [
"pyspark.sql.types.BooleanType",
"pyspark.sql.types.StructType",
"pyspark.sql.types.DoubleType",
"pyspark.sql.types.FloatType",
"pyspark.sql.types.IntegerType",
"pyspark.sql.types.TimestampType",
"pyspark.sql.types.DateType",
"pyspark.sql.types.StringType"
] | [((1754, 1766), 'pyspark.sql.types.StringType', 'StringType', ([], {}), '()\n', (1764, 1766), False, 'from pyspark.sql.types import DataType, StringType, BooleanType, TimestampType, DateType, IntegerType, FloatType, DoubleType, ArrayType, StructType, StructField, MapType\n'), ((1935, 1950), 'pyspark.sql.types.Timestamp... |
'''
do not directly run this script, you should execute the unit test
by launching the "run_test.sh"
'''
import libqpsolver
import os
import time
import progressbar
import numpy as np
from random import random
from cvxopt import matrix, solvers
#show detailed unit test message
verbose = False
#unit test run time and... | [
"numpy.identity",
"progressbar.Bar",
"numpy.multiply",
"numpy.ones",
"numpy.random.rand",
"numpy.nditer",
"numpy.array",
"numpy.zeros",
"numpy.matmul",
"progressbar.Percentage",
"cvxopt.matrix",
"libqpsolver.quadprog",
"cvxopt.solvers.qp",
"random.random",
"numpy.transpose",
"time.time... | [((1597, 1640), 'cvxopt.solvers.qp', 'solvers.qp', (['P', 'q', 'A', 'b', 'A_eq', 'b_eq', 'options'], {}), '(P, q, A, b, A_eq, b_eq, options)\n', (1607, 1640), False, 'from cvxopt import matrix, solvers\n'), ((1653, 1671), 'numpy.array', 'np.array', (["sol['x']"], {}), "(sol['x'])\n", (1661, 1671), True, 'import numpy a... |
import argparse
import os
from stepwise import Stepwise, StepwiseGauss
from entropy import EntropyGauss
from incremental import IncrementalGauss
import utils
from dataset import Dataset, get_dataset
from offline import BatchGauss, BatchEntropy
from config import *
from benchmark import *
algs= {
"stepwise": {
... | [
"dataset.get_dataset",
"utils.mkdirs",
"argparse.ArgumentParser"
] | [((610, 635), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (633, 635), False, 'import argparse\n'), ((809, 829), 'utils.mkdirs', 'utils.mkdirs', (['config'], {}), '(config)\n', (821, 829), False, 'import utils\n'), ((844, 863), 'dataset.get_dataset', 'get_dataset', (['config'], {}), '(config)... |
# -*- coding: utf-8 -*-
import tkinter as tk
import traceback
import sys
import math
####################################################################################################
###
### ToolTip
###
### This class allows to add a ToolTip to a Tkinter widget.
###
### Author: <NAME>
###
### V ... | [
"tkinter.Toplevel",
"tkinter.Button",
"tkinter.Canvas",
"tkinter.Tk",
"tkinter.Scrollbar",
"tkinter.Label",
"traceback.print_exc",
"tkinter.Frame"
] | [((28402, 28409), 'tkinter.Tk', 'tk.Tk', ([], {}), '()\n', (28407, 28409), True, 'import tkinter as tk\n'), ((28455, 28488), 'tkinter.Button', 'tk.Button', (['root'], {'text': '"""Example 1"""'}), "(root, text='Example 1')\n", (28464, 28488), True, 'import tkinter as tk\n'), ((28647, 28696), 'tkinter.Canvas', 'tk.Canva... |
import uuid
class Entity:
@property
def id(self):
"""
Read only property
:return: The id of the entity.
:rtype: string
"""
return self._id
def __init__(self, entity_id):
"""
Constructor
:param entity_id: The identif... | [
"uuid.uuid4"
] | [((2395, 2407), 'uuid.uuid4', 'uuid.uuid4', ([], {}), '()\n', (2405, 2407), False, 'import uuid\n')] |
"""
Bpyfrost
<NAME>
MIT License
2021-07-30
A flexible, lightweight Python HTTP request multiplexer that can be easily
integrated with other libraries, frameworks, or WSGI applications. It is
implemented using a prefix tree (trie). On successful match, a tuple of a
function (handler) and a dictionary (parameters) is re... | [
"utils._sanitize_path",
"tree._insert",
"tree._Node",
"tree._find"
] | [((496, 503), 'tree._Node', '_Node', ([], {}), '()\n', (501, 503), False, 'from tree import _Node, _insert, _find\n'), ((1046, 1072), 'utils._sanitize_path', '_sanitize_path', (['self', 'path'], {}), '(self, path)\n', (1060, 1072), False, 'from utils import _sanitize_path\n'), ((1082, 1112), 'tree._insert', '_insert', ... |
from smartsexplore.database import MoleculeSet
def test_session_is_unique_per_test_1(session):
"""
This, together with its two identical copies, tests the ``session`` fixture by indirectly
asserting that the session is unique per test function and indeed works on a newly created
database each time. If... | [
"smartsexplore.database.MoleculeSet"
] | [((698, 711), 'smartsexplore.database.MoleculeSet', 'MoleculeSet', ([], {}), '()\n', (709, 711), False, 'from smartsexplore.database import MoleculeSet\n')] |
import redis
import random
import logging
class RedisClientError(Exception): pass
class RedisClient(object):
client = None
@classmethod
def get_client(klass,params):
if klass.client is None:
klass.client = klass(params)
return klass.client
def __init__(self,connection_p... | [
"random.randint",
"redis.StrictRedis"
] | [((500, 549), 'redis.StrictRedis', 'redis.StrictRedis', ([], {'db': '(0)'}), '(db=0, **self.connection_params)\n', (517, 549), False, 'import redis\n'), ((1750, 1783), 'random.randint', 'random.randint', (['(1)', '(db_max_num - 1)'], {}), '(1, db_max_num - 1)\n', (1764, 1783), False, 'import random\n')] |
import re
import string
from spyd.permissions.group import Group
class GroupInheritanceCycle(Exception): pass
class MissingGroup(Exception): pass
class MissingInheritedGroup(Exception): pass
def create_simple_pattern(pattern_string):
"Takes a group or functionality pattern string and converts it into a RegexOb... | [
"spyd.permissions.group.Group",
"string.replace",
"re.compile"
] | [((348, 390), 'string.replace', 'string.replace', (['pattern_string', '"""."""', '"""\\\\."""'], {}), "(pattern_string, '.', '\\\\.')\n", (362, 390), False, 'import string\n'), ((411, 452), 'string.replace', 'string.replace', (['pattern_string', '"""*"""', '""".*"""'], {}), "(pattern_string, '*', '.*')\n", (425, 452), ... |
# Copyright 2016-present CERN – European Organization for Nuclear Research
#
# 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... | [
"qf_lib.containers.series.qf_series.QFSeries",
"qf_lib.plotting.charts.line_chart.LineChart",
"qf_lib.plotting.decorators.data_element_decorator.DataElementDecorator",
"pandas.concat",
"pandas.date_range",
"matplotlib.pyplot.show"
] | [((938, 987), 'pandas.date_range', 'pd.date_range', (['"""2015-01-01"""'], {'periods': '(10)', 'freq': '"""D"""'}), "('2015-01-01', periods=10, freq='D')\n", (951, 987), True, 'import pandas as pd\n'), ((996, 1073), 'qf_lib.containers.series.qf_series.QFSeries', 'QFSeries', ([], {'data': '[1, 2, 3, 4, 5, 4, 3, 2, 1, 4]... |
#! /usr/bin/env python
# Copyright 2021 <NAME>
#
# This file is part of WarpX.
#
# License: BSD-3-Clause-LBNL
import os
import sys
import yt
sys.path.insert(1, '../../../../warpx/Regression/Checksum/')
import checksumAPI
import numpy as np
import scipy.constants as scc
## This script performs various checks for the... | [
"numpy.clip",
"sys.path.insert",
"numpy.sqrt",
"numpy.arange",
"numpy.histogram",
"numpy.select",
"numpy.exp",
"numpy.empty",
"yt.load",
"numpy.amin",
"numpy.average",
"numpy.isclose",
"numpy.unique",
"os.getcwd",
"checksumAPI.evaluate_checksum",
"numpy.sum",
"numpy.array_equal",
"... | [((144, 204), 'sys.path.insert', 'sys.path.insert', (['(1)', '"""../../../../warpx/Regression/Checksum/"""'], {}), "(1, '../../../../warpx/Regression/Checksum/')\n", (159, 204), False, 'import sys\n'), ((4774, 4818), 'numpy.isclose', 'np.isclose', (['val1', 'val2'], {'rtol': 'rtol', 'atol': 'atol'}), '(val1, val2, rtol... |
from flask import current_app as app
class Review:
def __init__(self, buyer_id, product_id, rating, review, date):
self.buyer_id = buyer_id
self.product_id = product_id
self.rating = rating
self.review = review
self.date = date
@staticmethod
def list_ratings(bu... | [
"flask.current_app.db.execute"
] | [((344, 464), 'flask.current_app.db.execute', 'app.db.execute', (['"""\nSELECT *\nFROM Feedback\nWHERE buyer_id =:buyer_id\nORDER BY date DESC\n"""'], {'buyer_id': 'buyer_id'}), '(\n """\nSELECT *\nFROM Feedback\nWHERE buyer_id =:buyer_id\nORDER BY date DESC\n"""\n , buyer_id=buyer_id)\n', (358, 464), True, 'from... |
#%%
import matplotlib.pyplot as plt
import numpy as np
x = [1,2,3,4]
y = [4,8,1,2]
plt.plot(x,y,'b')
plt.title('Gráfico.')
plt.ylabel('Eixo Y')
plt.xlabel('Eixo X')
plt.yticks(y)
plt.xticks(x)
plt.grid(axis = 'y', linestyle = ':')
plt.show()
#%%
import matplotlib.pyplot as plt
import numpy as... | [
"matplotlib.pyplot.grid",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.suptitle",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.bar",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.sc... | [((92, 111), 'matplotlib.pyplot.plot', 'plt.plot', (['x', 'y', '"""b"""'], {}), "(x, y, 'b')\n", (100, 111), True, 'import matplotlib.pyplot as plt\n'), ((113, 134), 'matplotlib.pyplot.title', 'plt.title', (['"""Gráfico."""'], {}), "('Gráfico.')\n", (122, 134), True, 'import matplotlib.pyplot as plt\n'), ((136, 156), '... |
# Copyright 2016 Splunk, Inc.
#
# Licensed under the Apache License, Version 2.0 (the 'License'): you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | [
"traceback.format_exc",
"solnlib.utils.retry",
"solnlib.modular_input.event.HECEvent.format_events",
"solnlib.utils.extract_http_scheme_host_port",
"solnlib.splunk_rest_client.SplunkRestClient",
"threading.Lock",
"time.sleep",
"solnlib.hec_config.HECConfig",
"solnlib.modular_input.event.XMLEvent.for... | [((7462, 7499), 'solnlib.utils.retry', 'retry', ([], {'exceptions': '[binding.HTTPError]'}), '(exceptions=[binding.HTTPError])\n', (7467, 7499), False, 'from solnlib.utils import retry\n'), ((4592, 4729), 'solnlib.modular_input.event.XMLEvent', 'XMLEvent', (['data'], {'time': 'time', 'index': 'index', 'host': 'host', '... |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
#******************************************************************************
# Copyright (C) 2015-2016 <NAME>
# New BSD License.
#******************************************************************************
# \file
# \brief srt file to some format
#
# Examples:
#
# ... | [
"argparse.ArgumentParser",
"re.compile"
] | [((11772, 11797), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (11795, 11797), False, 'import argparse, sys, re, codecs\n'), ((1380, 1398), 're.compile', 're.compile', (['"""\\\\d+"""'], {}), "('\\\\d+')\n", (1390, 1398), False, 'import argparse, sys, re, codecs\n'), ((1462, 1478), 're.compil... |
import pygame
pygame.init()
Closed=True
onbutton=None
def preHandle():
pass
def eventHandler(event):
return False
def afterHandle():
pass
def init():
pass
def show():
pass
def remove():
pass
| [
"pygame.init"
] | [((14, 27), 'pygame.init', 'pygame.init', ([], {}), '()\n', (25, 27), False, 'import pygame\n')] |
# Copyright 2008 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | [
"unittest.main",
"os.path.dirname",
"mabot.model.io.IO",
"copy.deepcopy"
] | [((7578, 7593), 'unittest.main', 'unittest.main', ([], {}), '()\n', (7591, 7593), False, 'import unittest\n'), ((1013, 1037), 'copy.deepcopy', 'deepcopy', (['model.SETTINGS'], {}), '(model.SETTINGS)\n', (1021, 1037), False, 'from copy import deepcopy\n'), ((850, 867), 'os.path.dirname', 'dirname', (['__file__'], {}), '... |
# coding=utf-8
# Copyright (C) 2019 Alibaba Group Holding 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 app... | [
"tensorflow.variable_scope",
"src.utils.registry.register",
"math.sqrt",
"tensorflow.summary.histogram",
"functools.partial",
"tensorflow.matmul",
"tensorflow.nn.softmax",
"tensorflow.nn.dropout",
"tensorflow.identity",
"tensorflow.cast"
] | [((766, 802), 'functools.partial', 'partial', (['register'], {'registry': 'registry'}), '(register, registry=registry)\n', (773, 802), False, 'from functools import partial\n'), ((806, 826), 'src.utils.registry.register', 'register', (['"""identity"""'], {}), "('identity')\n", (814, 826), False, 'from src.utils.registr... |
#!/usr/bin/env python3
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import tensorflow as tf
from tensorflow.contrib import antares
import os
x = tf.random.uniform([1024, 512])
op = antares.make_op('reduce_sum_0[N] +=! data[N, M]', {'data': x}, server_addr=os.environ.get('ANTARES_ADDR', '... | [
"tensorflow.random.uniform",
"tensorflow.Session",
"os.environ.get"
] | [((176, 206), 'tensorflow.random.uniform', 'tf.random.uniform', (['[1024, 512]'], {}), '([1024, 512])\n', (193, 206), True, 'import tensorflow as tf\n'), ((344, 356), 'tensorflow.Session', 'tf.Session', ([], {}), '()\n', (354, 356), True, 'import tensorflow as tf\n'), ((288, 336), 'os.environ.get', 'os.environ.get', ([... |
from rajesh.element import Button, Div, Input
from rajesh import expr
from constants import CREDITS
class Screen(Div):
def __init__(self, app, **kwargs):
super(Screen, self).__init__(**kwargs)
self.app = app
self.app.js.info_box.innerHTML = ""
@property
def js(self):
retu... | [
"constants.CREDITS.replace",
"rajesh.element.Button",
"rajesh.element.Input",
"rajesh.expr",
"rajesh.element.Div"
] | [((2515, 2658), 'rajesh.element.Input', 'Input', ([], {'id': '"""name_input"""', 'type': '"""text"""', 'value': 'self.app.player.name', 'onkeydown': '"""sock.send(\'key_down \' + evt.keyCode + \' \' + name_input.value)"""'}), '(id=\'name_input\', type=\'text\', value=self.app.player.name, onkeydown=\n "sock.send(\'k... |
from __future__ import (absolute_import, division, print_function)
from collections import Iterable, OrderedDict
import wrapt
import numpy as np
import numpy.ma as ma
from .units import do_conversion, check_units, dealias_and_clean_unit
from .util import iter_left_indexes, from_args, to_np, combine_dims
from .py3co... | [
"numpy.empty"
] | [((6435, 6463), 'numpy.empty', 'np.empty', (['outdims', 'alg_dtype'], {}), '(outdims, alg_dtype)\n', (6443, 6463), True, 'import numpy as np\n')] |
import pcbnew
import re
__version__ = "0.0.1"
board = pcbnew.GetBoard()
def GetUnit(value, do_mm=True):
if do_mm:
return pcbnew.ToMM(value)
else:
return round(pcbnew.ToMils(value))
def FindAll(board=None, do_tracks=True, do_mm=True):
if board is None:
board = GetBoard()
... | [
"pcbnew.GetBoard",
"pcbnew.ToMM",
"pcbnew.ToMils"
] | [((56, 73), 'pcbnew.GetBoard', 'pcbnew.GetBoard', ([], {}), '()\n', (71, 73), False, 'import pcbnew\n'), ((136, 154), 'pcbnew.ToMM', 'pcbnew.ToMM', (['value'], {}), '(value)\n', (147, 154), False, 'import pcbnew\n'), ((186, 206), 'pcbnew.ToMils', 'pcbnew.ToMils', (['value'], {}), '(value)\n', (199, 206), False, 'import... |
import wx
app = wx.App()
win = wx.Frame(None)
btn = wx.Button(win)
win.Show()
app.MainLoop() | [
"wx.Button",
"wx.Frame",
"wx.App"
] | [((16, 24), 'wx.App', 'wx.App', ([], {}), '()\n', (22, 24), False, 'import wx\n'), ((31, 45), 'wx.Frame', 'wx.Frame', (['None'], {}), '(None)\n', (39, 45), False, 'import wx\n'), ((52, 66), 'wx.Button', 'wx.Button', (['win'], {}), '(win)\n', (61, 66), False, 'import wx\n')] |
from re import compile
from functools import reduce
rectRe = compile(r'(rect) (\d+)x(\d+)')
rotaRe = compile(r'(rotate [rc])\w* \w=(\d+) by (\d+)')
def makeScreen(x, y):
return [[' '] * x for _ in range(y)]
def transpose(l):
return list(map(list, zip(*l)))
def parseInstruction(inst):
rect = rectRe.searc... | [
"re.compile"
] | [((62, 93), 're.compile', 'compile', (['"""(rect) (\\\\d+)x(\\\\d+)"""'], {}), "('(rect) (\\\\d+)x(\\\\d+)')\n", (69, 93), False, 'from re import compile\n'), ((102, 151), 're.compile', 'compile', (['"""(rotate [rc])\\\\w* \\\\w=(\\\\d+) by (\\\\d+)"""'], {}), "('(rotate [rc])\\\\w* \\\\w=(\\\\d+) by (\\\\d+)')\n", (10... |
import unittest
import itemic
import copy
class MyTestCase(unittest.TestCase):
def test_jdict(self):
this_jdict = itemic.jdict({'a': 1, 'b': 2})
self.assertEqual(this_jdict['a'], this_jdict.a)
self.assertEqual(this_jdict['b'], this_jdict.b)
this_jdict_copy = copy.deepcopy(this_jdi... | [
"unittest.main",
"itemic.jdict",
"copy.deepcopy"
] | [((723, 738), 'unittest.main', 'unittest.main', ([], {}), '()\n', (736, 738), False, 'import unittest\n'), ((128, 158), 'itemic.jdict', 'itemic.jdict', (["{'a': 1, 'b': 2}"], {}), "({'a': 1, 'b': 2})\n", (140, 158), False, 'import itemic\n'), ((298, 323), 'copy.deepcopy', 'copy.deepcopy', (['this_jdict'], {}), '(this_j... |
# SPDX-License-Identifier: MIT
# Copyright (c) 2019 Intel Corporation
"""
Command line interface evaluates packages given their source URLs
"""
import pdb
import pkg_resources
from ..version import VERSION
from ..record import Record
from ..source.source import BaseSource
from ..util.packaging import is_develop
from .... | [
"pkg_resources.iter_entry_points",
"pdb.set_trace"
] | [((2876, 2928), 'pkg_resources.iter_entry_points', 'pkg_resources.iter_entry_points', (['"""dffml.service.cli"""'], {}), "('dffml.service.cli')\n", (2907, 2928), False, 'import pkg_resources\n'), ((1124, 1139), 'pdb.set_trace', 'pdb.set_trace', ([], {}), '()\n', (1137, 1139), False, 'import pdb\n')] |
from unittest.mock import AsyncMock
import pytest
from app.core import lista_de_comandos, usuarios_conectados
from app.core.comandos import _executar_comando, _separar_comando
@pytest.fixture
def setup():
lista_de_comandos['umcomando'] = AsyncMock()
usuarios_conectados['usuario-acucar'] = AsyncMock()
yi... | [
"pytest.mark.parametrize",
"app.core.comandos._executar_comando",
"unittest.mock.AsyncMock",
"app.core.comandos._separar_comando"
] | [((412, 618), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""entrada, saida"""', "[('/CoMaNdo Argumento', ('comando', 'Argumento')), ('/ÇôMãNdo Argumento', (\n 'comando', 'Argumento')), ('/Co-Man_do Argumento', ('co-man_do',\n 'Argumento'))]"], {}), "('entrada, saida', [('/CoMaNdo Argumento', (\n ... |
from caffe2.python import core
import caffe2.python.hypothesis_test_util as hu
import caffe2.python.serialized_test.serialized_test_util as serial
from hypothesis import given, settings
import hypothesis.strategies as st
import numpy as np
import unittest
class TestGroupNormOp(serial.SerializedTestCase):
de... | [
"numpy.mean",
"hypothesis.strategies.sampled_from",
"hypothesis.strategies.integers",
"numpy.arange",
"hypothesis.strategies.floats",
"hypothesis.settings",
"caffe2.python.core.CreateOperator",
"unittest.main",
"numpy.random.randn",
"numpy.var",
"numpy.random.shuffle"
] | [((4406, 4430), 'hypothesis.settings', 'settings', ([], {'deadline': '(10000)'}), '(deadline=10000)\n', (4414, 4430), False, 'from hypothesis import given, settings\n'), ((5236, 5251), 'unittest.main', 'unittest.main', ([], {}), '()\n', (5249, 5251), False, 'import unittest\n'), ((533, 571), 'numpy.mean', 'np.mean', ([... |
from linecook import patterns
def test_any_of():
assert patterns.any_of("a", "b", "c") == r"(a|b|c)"
def test_bounded_word():
assert patterns.bounded_word("hello") == r"\bhello\b"
def test_exact_match():
assert patterns.exact_match("hello") == r"^hello$"
| [
"linecook.patterns.any_of",
"linecook.patterns.exact_match",
"linecook.patterns.bounded_word"
] | [((62, 92), 'linecook.patterns.any_of', 'patterns.any_of', (['"""a"""', '"""b"""', '"""c"""'], {}), "('a', 'b', 'c')\n", (77, 92), False, 'from linecook import patterns\n'), ((145, 175), 'linecook.patterns.bounded_word', 'patterns.bounded_word', (['"""hello"""'], {}), "('hello')\n", (166, 175), False, 'from linecook im... |
# -*- coding:UTF-8 -*-
#! /usr/bin/python3
import random
list_a = [1,2,3,4,1,2,3,4,5,1,4,3,4,1,10]
print(range(10))
print('将range(10)转化成数组:',list(range(10)))
print(random.choice(list_a))
print(random.choice(range(10)))
# print(random.randrange(-10,10,1.5)) # randrange ([start,] stop [,step])
print(random.ran... | [
"random.uniform",
"random.random",
"random.choice",
"random.shuffle"
] | [((172, 193), 'random.choice', 'random.choice', (['list_a'], {}), '(list_a)\n', (185, 193), False, 'import random\n'), ((310, 325), 'random.random', 'random.random', ([], {}), '()\n', (323, 325), False, 'import random\n'), ((358, 380), 'random.shuffle', 'random.shuffle', (['list_a'], {}), '(list_a)\n', (372, 380), Fals... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
#
# written by <NAME>
# 2017-03-03
"""論文[1]に従い六角格子内の1点をその六角格子セルを代表する点とみなし,
隣接する6つのセルを代表する点を繋ぐことでランダムな三角格子を生成する
[1] https://www.jstage.jst.go.jp/article/journalcpij/44.3/0/44.3_799/_pdf
"""
import numpy as np
def pick_param():
"""Pick up random point from hex region"""... | [
"numpy.sqrt",
"numpy.random.rand",
"matplotlib.tri.Triangulation",
"numpy.zeros",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show"
] | [((1126, 1140), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (1138, 1140), True, 'import matplotlib.pyplot as plt\n'), ((1717, 1756), 'matplotlib.tri.Triangulation', 'tri.Triangulation', (['lattice_X', 'lattice_Y'], {}), '(lattice_X, lattice_Y)\n', (1734, 1756), True, 'import matplotlib.tri as tri\n'... |
from queue import PriorityQueue
def dfs(graph, start, goal):
visited = []
path = [start]
fringe = PriorityQueue()
fringe.put((0, start, path, visited))
while not fringe.empty():
_, current_node, path, visited = fringe.get()
if current_node == goal:
return path + [curre... | [
"queue.PriorityQueue"
] | [((111, 126), 'queue.PriorityQueue', 'PriorityQueue', ([], {}), '()\n', (124, 126), False, 'from queue import PriorityQueue\n')] |
"""Module for handling data throughout the procedure."""
import dataclasses
import torch
from arviz import InferenceData
from kulprit.data.structure import ModelStructure
@dataclasses.dataclass(order=True)
class ModelData:
"""Data class for handling model data.
This class serves as the primary data contai... | [
"dataclasses.dataclass",
"dataclasses.field"
] | [((177, 210), 'dataclasses.dataclass', 'dataclasses.dataclass', ([], {'order': '(True)'}), '(order=True)\n', (198, 210), False, 'import dataclasses\n'), ((1225, 1254), 'dataclasses.field', 'dataclasses.field', ([], {'init': '(False)'}), '(init=False)\n', (1242, 1254), False, 'import dataclasses\n')] |
import pymysql
myconn=pymysql.connect(host='localhost',user='root',password='<PASSWORD>', database="mydatabase")
cur=myconn.cursor()
cur.execute("delete from employee1 where empid=104")
print("success")
myconn.commit()
myconn.close() | [
"pymysql.connect"
] | [((22, 118), 'pymysql.connect', 'pymysql.connect', ([], {'host': '"""localhost"""', 'user': '"""root"""', 'password': '"""<PASSWORD>"""', 'database': '"""mydatabase"""'}), "(host='localhost', user='root', password='<PASSWORD>',\n database='mydatabase')\n", (37, 118), False, 'import pymysql\n')] |
import logging
import re
import socket
import subprocess
from typing import Optional
import psycopg2
import redis
from pydantic import BaseSettings, PostgresDsn
from pythonjsonlogger import jsonlogger
logger = logging.getLogger()
logHandler = logging.StreamHandler()
logFmt = jsonlogger.JsonFormatter(timestamp=True)
l... | [
"logging.getLogger",
"psycopg2.connect",
"redis.Redis.from_url",
"logging.StreamHandler",
"subprocess.run",
"logging.warning",
"socket.gethostname",
"pythonjsonlogger.jsonlogger.JsonFormatter",
"re.search"
] | [((212, 231), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (229, 231), False, 'import logging\n'), ((245, 268), 'logging.StreamHandler', 'logging.StreamHandler', ([], {}), '()\n', (266, 268), False, 'import logging\n'), ((278, 318), 'pythonjsonlogger.jsonlogger.JsonFormatter', 'jsonlogger.JsonFormatter',... |
from fast_youtube_search import search_youtube
print(search_youtube(['jorja', 'smith'])) | [
"fast_youtube_search.search_youtube"
] | [((54, 88), 'fast_youtube_search.search_youtube', 'search_youtube', (["['jorja', 'smith']"], {}), "(['jorja', 'smith'])\n", (68, 88), False, 'from fast_youtube_search import search_youtube\n')] |
from __future__ import annotations
from dataclasses import dataclass
from typing import Any, Callable, Dict, Optional, OrderedDict, Tuple
from pydantic.fields import FieldInfo
import sqlalchemy as sa
import uvicore
from uvicore.contracts import Field as FieldInterface
from uvicore.contracts import Relation as Relati... | [
"uvicore.support.module.load",
"uvicore.db.table",
"uvicore.service",
"uvicore.ioc.binding",
"uvicore.ioc.make"
] | [((600, 617), 'uvicore.service', 'uvicore.service', ([], {}), '()\n', (615, 617), False, 'import uvicore\n'), ((3537, 3554), 'uvicore.service', 'uvicore.service', ([], {}), '()\n', (3552, 3554), False, 'import uvicore\n'), ((4162, 4179), 'uvicore.service', 'uvicore.service', ([], {}), '()\n', (4177, 4179), False, 'impo... |
# -*- coding: utf-8 -*-
"""
Test Scrapbag strings file
"""
import unittest
import collections
from scrapbag.collections import format_dict
from scrapbag.strings import (
clean_text,
clean_markdown,
get_only_words,
select_regexp_char,
exclude_chars,
normalizer,
normalize_dict
)
class U... | [
"collections.OrderedDict",
"scrapbag.strings.clean_text",
"scrapbag.strings.normalizer",
"scrapbag.strings.get_only_words",
"scrapbag.strings.clean_markdown",
"scrapbag.strings.exclude_chars",
"scrapbag.strings.select_regexp_char",
"scrapbag.strings.normalize_dict",
"scrapbag.collections.format_dict... | [((1171, 1194), 'scrapbag.strings.select_regexp_char', 'select_regexp_char', (['"""*"""'], {}), "('*')\n", (1189, 1194), False, 'from scrapbag.strings import clean_text, clean_markdown, get_only_words, select_regexp_char, exclude_chars, normalizer, normalize_dict\n'), ((1213, 1236), 'scrapbag.strings.select_regexp_char... |
# coding: utf-8
# Copyright © 2014-2020 VMware, Inc. All Rights Reserved.
################################################################################
import unittest
from unittest import mock
from cbopensource.driver.taxii_server_config import ServerVersion, TaxiiServerConfiguration
from cbopensource.utilities.c... | [
"unittest.main",
"cbopensource.driver.taxii_server_config.TaxiiServerConfiguration.parse",
"unittest.mock.patch"
] | [((10221, 10289), 'unittest.mock.patch', 'mock.patch', (['"""cbopensource.driver.taxii_server_config.os.path.exists"""'], {}), "('cbopensource.driver.taxii_server_config.os.path.exists')\n", (10231, 10289), False, 'from unittest import mock\n'), ((10642, 10670), 'unittest.mock.patch', 'mock.patch', (['"""os.path.exists... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# main.py
#
# Copyright 2020 Alvarito050506 <<EMAIL>>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# ... | [
"struct.unpack",
"struct.pack",
"rak.RakNet"
] | [((1028, 1036), 'rak.RakNet', 'RakNet', ([], {}), '()\n', (1034, 1036), False, 'from rak import RakNet\n'), ((3168, 3199), 'struct.pack', 'struct.pack', (['"""!f"""', '(128 + pos[2])'], {}), "('!f', 128 + pos[2])\n", (3179, 3199), False, 'import struct\n'), ((3481, 3512), 'struct.pack', 'struct.pack', (['"""!H"""', 'pi... |
""" Tests dataset views methods """
from __future__ import unicode_literals
from __future__ import absolute_import
import copy
import datetime
import json
import django
from django.utils.timezone import now
from rest_framework import status
from rest_framework.test import APITestCase
from data.data.json.data_v6 impo... | [
"storage.test.utils.create_country",
"django.setup",
"storage.test.utils.create_workspace",
"data.test.utils.create_dataset",
"json.loads",
"util.rest.login_client",
"json.dumps",
"data.models.DataSet.objects.filter",
"django.utils.timezone.now",
"data.test.utils.create_dataset_members",
"data.d... | [((692, 706), 'django.setup', 'django.setup', ([], {}), '()\n', (704, 706), False, 'import django\n'), ((716, 761), 'util.rest.login_client', 'rest.login_client', (['self.client'], {'is_staff': '(True)'}), '(self.client, is_staff=True)\n', (733, 761), False, 'from util import rest\n'), ((835, 904), 'storage.test.utils.... |
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from builtins import range
from past.utils import old_div
from .tesisfunctions import Plotim,overlay,padVH
import cv2
import numpy as np
#from invariantMoments import centroid,invmoments,normalizedinvariantmome... | [
"cv2.convexityDefects",
"past.utils.old_div",
"numpy.array",
"builtins.range",
"cv2.ellipse",
"cv2.fitEllipse",
"cv2.threshold",
"cv2.line",
"cv2.contourArea",
"cv2.drawContours",
"numpy.ones",
"cv2.circle",
"cv2.moments",
"cv2.resize",
"cv2.imread",
"cv2.convexHull",
"cv2.imwrite",
... | [((781, 796), 'cv2.imread', 'cv2.imread', (['fn1'], {}), '(fn1)\n', (791, 796), False, 'import cv2\n'), ((804, 832), 'cv2.resize', 'cv2.resize', (['fore', '(300, 300)'], {}), '(fore, (300, 300))\n', (814, 832), False, 'import cv2\n'), ((1683, 1742), 'cv2.threshold', 'cv2.threshold', (['P', '(0)', '(1)', '(cv2.THRESH_BI... |
# Copyright (c) 2019 PaddlePaddle 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... | [
"re.sub",
"os.listdir"
] | [((1246, 1306), 're.sub', 're.sub', (['"""/\\\\*[^*]*\\\\*/"""', '""""""', 'common_content'], {'flags': 're.DOTALL'}), "('/\\\\*[^*]*\\\\*/', '', common_content, flags=re.DOTALL)\n", (1252, 1306), False, 'import re\n'), ((1669, 1692), 'os.listdir', 'os.listdir', (['"""cl_kernel"""'], {}), "('cl_kernel')\n", (1679, 1692... |
# -*- coding: utf-8 -*-
from senlerpy import Senler, methods
# Создаём объект с секретным ключом
api = Senler('SECRET')
# Выполняем запросы к апи используя встроенные схемы
data = api(
methods.Deliveries.stat,
date_from='2018-01-01 10:00:00',
date_to='2018-12-30 23:00:00',
vk_group_id=1,
)
print(data['items'])
#... | [
"senlerpy.Senler"
] | [((104, 120), 'senlerpy.Senler', 'Senler', (['"""SECRET"""'], {}), "('SECRET')\n", (110, 120), False, 'from senlerpy import Senler, methods\n'), ((532, 563), 'senlerpy.Senler', 'Senler', (['"""SECRET"""'], {'vk_group_id': '(1)'}), "('SECRET', vk_group_id=1)\n", (538, 563), False, 'from senlerpy import Senler, methods\n... |
import numpy as np
import os
import pandas as pd
import micro_dl.utils.tile_utils as tile_utils
import micro_dl.utils.aux_utils as aux_utils
import micro_dl.utils.image_utils as image_utils
import micro_dl.utils.mp_utils as mp_utils
class ImageTilerUniform:
"""Tiles all images in a dataset"""
def __init__(s... | [
"micro_dl.utils.mp_utils.mp_crop_save",
"micro_dl.utils.aux_utils.validate_metadata_indices",
"micro_dl.utils.aux_utils.read_meta",
"numpy.unique",
"os.makedirs",
"micro_dl.utils.aux_utils.get_meta_idx",
"micro_dl.utils.image_utils.preprocess_imstack",
"os.path.join",
"numpy.any",
"micro_dl.utils.... | [((3507, 3551), 'os.path.join', 'os.path.join', (['output_dir', 'self.str_tile_step'], {}), '(output_dir, self.str_tile_step)\n', (3519, 3551), False, 'import os\n'), ((4556, 4591), 'micro_dl.utils.aux_utils.read_meta', 'aux_utils.read_meta', (['self.input_dir'], {}), '(self.input_dir)\n', (4575, 4591), True, 'import m... |
from unittest import TestCase
from src.PairwiseVariationMPHF import PairwiseVariationMPHF
from src.PairwiseVariation import PairwiseVariation
class TestPairwiseVariationMPHF(TestCase):
def test___get_pairwise_variation_id_to_alleles_id(self):
mphf = PairwiseVariationMPHF()
pairwise_variation_1 = P... | [
"src.PairwiseVariationMPHF.PairwiseVariationMPHF",
"src.PairwiseVariation.PairwiseVariation"
] | [((264, 287), 'src.PairwiseVariationMPHF.PairwiseVariationMPHF', 'PairwiseVariationMPHF', ([], {}), '()\n', (285, 287), False, 'from src.PairwiseVariationMPHF import PairwiseVariationMPHF\n'), ((319, 342), 'src.PairwiseVariation.PairwiseVariation', 'PairwiseVariation', (['(0)', '(1)'], {}), '(0, 1)\n', (336, 342), Fals... |
import six
from sevenbridges.meta.resource import Resource
from sevenbridges.meta.fields import StringField
class JobDocker(Resource):
"""
JobDocker resource contains information for a docker image that was
used for execution of a single job.
"""
checksum = StringField(read_only=True)
def __... | [
"sevenbridges.meta.fields.StringField"
] | [((281, 308), 'sevenbridges.meta.fields.StringField', 'StringField', ([], {'read_only': '(True)'}), '(read_only=True)\n', (292, 308), False, 'from sevenbridges.meta.fields import StringField\n')] |
'''
Created on 07-Aug-2018
@author: <NAME>
'''
import pymysql
class database:
conn=None
curs=None
@staticmethod
def connection():
database.conn = pymysql.connect(user='root', password='<PASSWORD>', database='pharmacy')
return database.conn
@staticmethod
def cur... | [
"pymysql.connect"
] | [((186, 258), 'pymysql.connect', 'pymysql.connect', ([], {'user': '"""root"""', 'password': '"""<PASSWORD>"""', 'database': '"""pharmacy"""'}), "(user='root', password='<PASSWORD>', database='pharmacy')\n", (201, 258), False, 'import pymysql\n')] |
import matplotlib.pyplot as pyplot
from SQL import querys as sql
from Diagram import hex_converting
import seaborn as sb
import numpy as np
import pandas as ps
import sqlite3
import datetime
import config
save_plots = 'plots/'
__databaseFile = config.CONFIG['database_file_name']
sb.set(style="dark", color_codes=True)
... | [
"seaborn.set",
"datetime.datetime.fromtimestamp",
"sqlite3.connect",
"datetime.datetime.strptime",
"matplotlib.pyplot.gcf",
"datetime.timedelta",
"seaborn.lineplot",
"matplotlib.pyplot.close",
"seaborn.barplot",
"pandas.DataFrame",
"SQL.querys.get_count_daily_op_return",
"matplotlib.pyplot.dra... | [((281, 319), 'seaborn.set', 'sb.set', ([], {'style': '"""dark"""', 'color_codes': '(True)'}), "(style='dark', color_codes=True)\n", (287, 319), True, 'import seaborn as sb\n'), ((413, 444), 'sqlite3.connect', 'sqlite3.connect', (['__databaseFile'], {}), '(__databaseFile)\n', (428, 444), False, 'import sqlite3\n'), ((5... |
"""Send this code, run and watch the repl.
Then turn the wheel slowly to see the change"""
import board
import rp2pio
import adafruit_pioasm
pio_input = """
.program pio_input
in pins, 2 ; read in two pins (into ISR)
push noblock ; put ISR into input FIFO
"""
assembled = adafruit_pioasm.assemble(pio_i... | [
"adafruit_pioasm.assemble",
"rp2pio.StateMachine"
] | [((290, 325), 'adafruit_pioasm.assemble', 'adafruit_pioasm.assemble', (['pio_input'], {}), '(pio_input)\n', (314, 325), False, 'import adafruit_pioasm\n'), ((357, 448), 'rp2pio.StateMachine', 'rp2pio.StateMachine', (['assembled'], {'frequency': '(2000)', 'first_in_pin': 'board.GP20', 'in_pin_count': '(2)'}), '(assemble... |
import musket_core.generic_config as generic
import musket_core.datasets as datasets
import musket_core.configloader as configloader
import musket_core.utils as utils
import musket_core.context as context
import numpy as np
import keras
import musket_core.net_declaration as net
import musket_core.quasymodels as qm
impo... | [
"sys.path.insert",
"musket_core.datasets.BufferedWriteableDS",
"musket_core.utils.save",
"musket_core.datasets.generic_batch_generator",
"numpy.array",
"musket_core.context.isTrainMode",
"numpy.load",
"os.path.exists",
"os.listdir",
"musket_core.configloader.parse",
"os.path.isdir",
"musket_co... | [((9086, 9128), 'musket_core.configloader.parse', 'configloader.parse', (['"""generic"""', 'path', 'extra'], {}), "('generic', path, extra)\n", (9104, 9128), True, 'import musket_core.configloader as configloader\n'), ((841, 879), 'musket_core.utils.load_yaml', 'utils.load_yaml', (["(self.path + '.shapes')"], {}), "(se... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
http://www.pythondoc.com/flask/config.html#id6
"""
import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
SECRET_KEY = os.getenv('SECRET_KEY') or 'MPk2WlUArcLeeU_iohzT'
'''
# 旧版本
import random
import string
''.join(rando... | [
"os.path.abspath",
"os.path.dirname",
"os.getenv"
] | [((138, 163), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (153, 163), False, 'import os\n'), ((799, 823), 'os.getenv', 'os.getenv', (['"""MAIL_SERVER"""'], {}), "('MAIL_SERVER')\n", (808, 823), False, 'import os\n'), ((909, 935), 'os.getenv', 'os.getenv', (['"""MAIL_USERNAME"""'], {}), "('... |
# Copyright (c) 2019 PaddlePaddle 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 app... | [
"paddle.fluid.layers.less_than",
"paddle.fluid.default_startup_program",
"paddle.fluid.layers.mean",
"paddle.fluid.layers.cos_sim",
"paddle.fluid.layers.reduce_sum",
"paddle.fluid.default_main_program",
"paddle.fluid.layers.softsign",
"paddle.fluid.layers.elementwise_div",
"paddle.fluid.layers.eleme... | [((996, 1026), 'paddle.fluid.layers.reduce_sum', 'fluid.layers.reduce_sum', (['wrong'], {}), '(wrong)\n', (1019, 1026), True, 'import paddle.fluid as fluid\n'), ((1145, 1175), 'paddle.fluid.layers.reduce_sum', 'fluid.layers.reduce_sum', (['right'], {}), '(right)\n', (1168, 1175), True, 'import paddle.fluid as fluid\n')... |
import pandas as pd
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import pyplot as plt
import seaborn as sns
def plot_3d_with_hue(df, cols = ['x','y','z'], hue_col='hue', title='', \
xlabel='X', ylabel='Y', zlabel='Z', figsize=(8,8), hue_color_dict={},\
fig_filepath=None):
'''
... | [
"seaborn.set",
"matplotlib.pyplot.savefig",
"seaborn.diverging_palette",
"numpy.triu_indices_from",
"seaborn.heatmap",
"mpl_toolkits.mplot3d.Axes3D",
"matplotlib.pyplot.figure",
"numpy.zeros_like",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.show"
] | [((835, 862), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': 'figsize'}), '(figsize=figsize)\n', (845, 862), True, 'from matplotlib import pyplot as plt\n'), ((872, 883), 'mpl_toolkits.mplot3d.Axes3D', 'Axes3D', (['fig'], {}), '(fig)\n', (878, 883), False, 'from mpl_toolkits.mplot3d import Axes3D\n'), ((132... |
"""
Implements distance_calc using the Google Maps API.
For more information on the API specifications, see:
https://developers.google.com/maps/documentation/distancematrix/
"""
import requests
import json
from .distance_calc import DistanceCalculator, MappingException
class GoogleDistanceCalc(DistanceCalculator):
... | [
"requests.get"
] | [((894, 941), 'requests.get', 'requests.get', (['self.__geocode_url'], {'params': 'params'}), '(self.__geocode_url, params=params)\n', (906, 941), False, 'import requests\n'), ((1510, 1556), 'requests.get', 'requests.get', (['self.__matrix_url'], {'params': 'params'}), '(self.__matrix_url, params=params)\n', (1522, 155... |
import json
import csv
infile = "UTI GILT Fund.json"
outfile = "UTI GILT Fund.csv"
with open(infile) as inf, open(outfile, "w") as ouf:
data = json.load(inf)
writer = csv.DictWriter(ouf, fieldnames=["date", "nav"])
writer.writeheader()
for item in data:
writer.writerow(item)
| [
"json.load",
"csv.DictWriter"
] | [((149, 163), 'json.load', 'json.load', (['inf'], {}), '(inf)\n', (158, 163), False, 'import json\n'), ((177, 224), 'csv.DictWriter', 'csv.DictWriter', (['ouf'], {'fieldnames': "['date', 'nav']"}), "(ouf, fieldnames=['date', 'nav'])\n", (191, 224), False, 'import csv\n')] |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import random
import unittest
from collections import Counter
from weightedDict import WeightedDict
class TestWeightedDict(unittest.TestCase):
# Usage example
def test_main(self):
random.seed... | [
"weightedDict.WeightedDict",
"random.choice",
"random.shuffle",
"random.seed",
"collections.Counter",
"unittest.main"
] | [((3422, 3437), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3435, 3437), False, 'import unittest\n'), ((309, 324), 'random.seed', 'random.seed', (['(42)'], {}), '(42)\n', (320, 324), False, 'import random\n'), ((342, 356), 'weightedDict.WeightedDict', 'WeightedDict', ([], {}), '()\n', (354, 356), False, 'from ... |
# Generated by Django 3.0.4 on 2020-03-27 14:01
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0011... | [
"django.db.models.EmailField",
"django.db.models.DateField",
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.db.models.IntegerField",
"django.db.models.ManyToManyField",
"django.db.models.BooleanField",
"django.db.models.AutoField",
"django.db.models.DateTimeField",
"django.db... | [((4077, 4162), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'on_delete': 'django.db.models.deletion.CASCADE', 'to': '"""posts.Skill"""'}), "(on_delete=django.db.models.deletion.CASCADE, to='posts.Skill'\n )\n", (4094, 4162), False, 'from django.db import migrations, models\n'), ((4275, 4371), 'django.d... |
# FAÇA UM PROGRAMA QUE MOSTRE NA TELA UMA CONTAGEM
# REGRESSIVA PARA O ESTOURO DE FOGOS DE ARTIFÍCIO
# INDO DE 10 ATÉ 0, COM UMA PAUSA DE 1 SEGUNDO ENTRE ELES.
from time import sleep
print("Contagem regressiva FINAL DO ANOS:")
for c in range(10, -1, -1, ):
print(c)
sleep(1)
print("BOMM BOMM POWWN!")
| [
"time.sleep"
] | [((275, 283), 'time.sleep', 'sleep', (['(1)'], {}), '(1)\n', (280, 283), False, 'from time import sleep\n')] |
import numpy as np
import cv2
import matplotlib.pyplot as plt
# vids = np.load('data/mnist_training_fast_videos.npy')
# bbox = np.load('data/mnist_training_fast_trajectories.npy')
# bbox[:, :, :, 3] = vids.shape[2] - bbox[:, :, :, 3]
# bbox[:, :, :, 1] = vids.shape[2] - bbox[:, :, :, 1]
# bbox = bbox.swapaxes(1, 2)
... | [
"numpy.eye",
"numpy.ones",
"numpy.random.choice",
"numpy.where",
"numpy.zeros",
"cv2.resize",
"numpy.load",
"numpy.save",
"numpy.random.permutation"
] | [((2227, 2273), 'numpy.load', 'np.load', (['"""data/icons8_testing_fast_videos.npy"""'], {}), "('data/icons8_testing_fast_videos.npy')\n", (2234, 2273), True, 'import numpy as np\n'), ((2281, 2333), 'numpy.load', 'np.load', (['"""data/icons8_testing_fast_trajectories.npy"""'], {}), "('data/icons8_testing_fast_trajector... |
"""Base class for the tidal database models."""
# 1. Standard python modules
from abc import ABCMeta, abstractmethod
from datetime import datetime
import math
# 2. Third party modules
import numpy
import pandas as pd
from pytides.astro import astro
# 3. Aquaveo modules
# 4. Local modules
from .resource import Resour... | [
"datetime.datetime",
"math.tan",
"math.pow",
"math.radians",
"math.cos",
"pytides.astro.astro",
"math.atan2",
"pandas.DataFrame",
"math.sin",
"math.atan"
] | [((8895, 9027), 'pandas.DataFrame', 'pd.DataFrame', ([], {'columns': "['amplitude', 'frequency', 'speed', 'earth_tide_reduction_factor',\n 'equilibrium_argument', 'nodal_factor']"}), "(columns=['amplitude', 'frequency', 'speed',\n 'earth_tide_reduction_factor', 'equilibrium_argument', 'nodal_factor'])\n", (8907, ... |
# coding: utf-8
import os
import sys
import random
import datetime
from time import time
from time import sleep
import boto3
import argparse
from app import s3_client
from app import get_db_cursor
from app import db
import package
from package_input import PackageInput
from counter import CounterInput
from perpetual... | [
"perpetual_access.PerpetualAccessInput",
"app.s3_client.get_object",
"argparse.ArgumentParser",
"datetime.datetime.utcnow",
"counter.CounterInput",
"app.get_db_cursor",
"boto3.resource",
"journal_price.JournalPriceInput",
"random.random",
"app.db.session.rollback",
"app.s3_client.list_objects"
] | [((4410, 4461), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Run stuff :)"""'}), "(description='Run stuff :)')\n", (4433, 4461), False, 'import argparse\n'), ((1787, 1842), 'app.s3_client.list_objects', 's3_client.list_objects', ([], {'Bucket': 'upload_preprocess_bucket'}), '(Bucket=up... |
# Generated by Django 2.1 on 2019-06-23 12:37
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('users', '0008_auto_20190623_1105'),
]
operations = [
migrations.AlterModelOptions(
name='profile',
options={'permissions': (('... | [
"django.db.migrations.AlterModelOptions"
] | [((223, 382), 'django.db.migrations.AlterModelOptions', 'migrations.AlterModelOptions', ([], {'name': '"""profile"""', 'options': "{'permissions': (('can_generate_invoices', 'Can generate invocies'),),\n 'verbose_name': 'Profil'}"}), "(name='profile', options={'permissions': ((\n 'can_generate_invoices', 'Can gen... |
#!/usr/bin/env python3
import setuptools
from passchek.passchek import __version__
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="passchek",
version=__version__,
license="MIT",
author="<NAME>",
author_email="<EMAIL>",
description="Passchek is a sim... | [
"setuptools.find_packages"
] | [((531, 557), 'setuptools.find_packages', 'setuptools.find_packages', ([], {}), '()\n', (555, 557), False, 'import setuptools\n')] |
from types import GeneratorType
import pytest
from pathable.paths import SEPARATOR
from pathable.paths import BasePath
from pathable.paths import LookupPath
class TestBasePathInit:
def test_default(self):
p = BasePath()
assert p.parts == []
assert p.separator == SEPARATOR
def test_... | [
"pathable.paths.BasePath._from_parts",
"pathable.paths.SEPARATOR.join",
"pathable.paths.BasePath._from_parsed_parts",
"pathable.paths.BasePath",
"pytest.raises",
"pathable.paths.LookupPath"
] | [((225, 235), 'pathable.paths.BasePath', 'BasePath', ([], {}), '()\n', (233, 235), False, 'from pathable.paths import BasePath\n'), ((371, 385), 'pathable.paths.BasePath', 'BasePath', (['part'], {}), '(part)\n', (379, 385), False, 'from pathable.paths import BasePath\n'), ((551, 565), 'pathable.paths.BasePath', 'BasePa... |
#!/usr/bin/python3
#
# Python script that regenerates the README.md from the embedded template. Uses
# ./generate_table.awk to regenerate the ASCII tables from the various *.txt
# files.
from subprocess import check_output
attiny_results = check_output(
"./generate_table.awk < attiny.txt", shell=True, text=True)
... | [
"subprocess.check_output"
] | [((242, 314), 'subprocess.check_output', 'check_output', (['"""./generate_table.awk < attiny.txt"""'], {'shell': '(True)', 'text': '(True)'}), "('./generate_table.awk < attiny.txt', shell=True, text=True)\n", (254, 314), False, 'from subprocess import check_output\n'), ((335, 405), 'subprocess.check_output', 'check_out... |
# Generated by Django 3.0.5 on 2020-10-18 22:25
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('shelter', '0023_animal_adopted_by'),
]
operations = [
migrations.AlterField(
model_name='animal... | [
"django.db.models.ForeignKey"
] | [((372, 485), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'blank': '(True)', 'null': '(True)', 'on_delete': 'django.db.models.deletion.CASCADE', 'to': '"""shelter.PetOwner"""'}), "(blank=True, null=True, on_delete=django.db.models.\n deletion.CASCADE, to='shelter.PetOwner')\n", (389, 485), False, 'from... |
import tensorflow as tf
input_image_size = 28
output_image_size = 24
input_image_channels = 1
num_labels = 10
valid_records = 5000
test_records = 10000
train_records = 55000
batch_size = 100
def read_path_file(image_file):
f = open(image_file, 'r')
paths = []
labels = []
for line in f:
label,... | [
"tensorflow.image.decode_png",
"tensorflow.image.per_image_whitening",
"tensorflow.sparse_to_dense",
"tensorflow.image.resize_image_with_crop_or_pad",
"tensorflow.read_file",
"tensorflow.train.slice_input_producer",
"tensorflow.image.random_brightness",
"tensorflow.train.batch",
"tensorflow.reshape"... | [((554, 603), 'tensorflow.convert_to_tensor', 'tf.convert_to_tensor', (['image_list'], {'dtype': 'tf.string'}), '(image_list, dtype=tf.string)\n', (574, 603), True, 'import tensorflow as tf\n'), ((617, 665), 'tensorflow.convert_to_tensor', 'tf.convert_to_tensor', (['label_list'], {'dtype': 'tf.int32'}), '(label_list, d... |
from minisom import MiniSom
from numpy import genfromtxt,array,linalg,zeros,mean,std,apply_along_axis
"""
This script shows how to use MiniSom on the Iris dataset.
In partucular it shows how to train MiniSom and how to visualize the result.
ATTENTION: pylab is required for the visualization.
"""
#... | [
"pylab.axis",
"pylab.bone",
"pylab.plot",
"minisom.MiniSom",
"pylab.colorbar",
"numpy.linalg.norm",
"numpy.genfromtxt",
"pylab.show"
] | [((437, 496), 'numpy.genfromtxt', 'genfromtxt', (['"""iris.csv"""'], {'delimiter': '""","""', 'usecols': '(0, 1, 2, 3)'}), "('iris.csv', delimiter=',', usecols=(0, 1, 2, 3))\n", (447, 496), False, 'from numpy import genfromtxt, array, linalg, zeros, mean, std, apply_along_axis\n'), ((616, 662), 'minisom.MiniSom', 'Mini... |
import ast
import tokenize
from typing import List
import asttokens
import pytest
from flake8.defaults import MAX_LINE_LENGTH # type: ignore
from flake8.processor import FileProcessor # type: ignore
class FakeOptions:
hang_closing: bool
indent_size: int
max_line_length: int
max_doc_length: int
... | [
"ast.parse",
"asttokens.ASTTokens"
] | [((1431, 1450), 'ast.parse', 'ast.parse', (['code_str'], {}), '(code_str)\n', (1440, 1450), False, 'import ast\n'), ((1548, 1588), 'asttokens.ASTTokens', 'asttokens.ASTTokens', (['code_str'], {'tree': 'tree'}), '(code_str, tree=tree)\n', (1567, 1588), False, 'import asttokens\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from multiprocessing import cpu_count
from multiprocessing.dummy import Pool
try:
from .util.fingerprint import input_data_fingerprint
from .pkg.sfm import nameddict
from .pkg.sfm.exception_mate import get_last_exc_info
from .pkg.loggerFactory import Strea... | [
"dupefilter.pkg.loggerFactory.StreamOnlyLogger",
"dupefilter.pkg.sfm.exception_mate.get_last_exc_info",
"dupefilter.util.fingerprint.input_data_fingerprint",
"multiprocessing.cpu_count"
] | [((1993, 2027), 'dupefilter.util.fingerprint.input_data_fingerprint', 'input_data_fingerprint', (['input_data'], {}), '(input_data)\n', (2015, 2027), False, 'from dupefilter.util.fingerprint import input_data_fingerprint\n'), ((1261, 1292), 'dupefilter.pkg.loggerFactory.StreamOnlyLogger', 'StreamOnlyLogger', (['"""Dupe... |
from __future__ import annotations
import typing
import re
from functools import lru_cache
from pony.orm.core import Query, EntityMeta, EntityProxy, Entity
from .runtime import AttrInfo, dbinfo
if typing.TYPE_CHECKING:
from typing import *
from .types import AnyEntity
from .runtime import EntityInfo
__a... | [
"re.search",
"functools.lru_cache",
"re.compile"
] | [((1661, 1710), 're.compile', 're.compile', (['"""[\\\\\'"]([^\\\\\'"]*?)[\\\\\'"]\\\\s*\\\\)+$"""'], {}), '(\'[\\\\\\\'"]([^\\\\\\\'"]*?)[\\\\\\\'"]\\\\s*\\\\)+$\')\n', (1671, 1710), False, 'import re\n'), ((2198, 2221), 'functools.lru_cache', 'lru_cache', ([], {'maxsize': 'None'}), '(maxsize=None)\n', (2207, 2221), F... |
#!/usr/bin/env python
"""
[1] ----- [3] ----- [5]
| ____/ | \ |
| / | \____ |
| / | \ |
[2] ----- [4] ----- [6]
"""
from mininet.topo import Topo
class RegionABC( Topo ):
"""Simple 6 switch example"""
def __init__( self ):
"""Create a topol... | [
"mininet.topo.Topo.__init__"
] | [((367, 386), 'mininet.topo.Topo.__init__', 'Topo.__init__', (['self'], {}), '(self)\n', (380, 386), False, 'from mininet.topo import Topo\n')] |
"""
* Licensed to DSecure.me under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. DSecure.me licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file ex... | [
"vmc.assets.documents.AssetDocument",
"vmc.assets.documents.AssetDocument.get_or_create",
"vmc.common.utils.thread_pool_executor.wait_for_all",
"vmc.vulnerabilities.tests.create_vulnerability",
"vmc.vulnerabilities.tests.create_cve",
"vmc.vulnerabilities.documents.VulnerabilityDocument.search",
"elastic... | [((1653, 1682), 'vmc.ralph.models.Config.objects.get', 'RalphConfig.objects.get', ([], {'id': '(1)'}), '(id=1)\n', (1676, 1682), True, 'from vmc.ralph.models import Config as RalphConfig\n'), ((1714, 1743), 'vmc.ralph.models.Config.objects.get', 'RalphConfig.objects.get', ([], {'id': '(2)'}), '(id=2)\n', (1737, 1743), ... |
import click
import pytest
from pytest_mock import MockFixture
from opta.exceptions import UserErrors
from opta.utils import alternate_yaml_extension, check_opta_file_exists, exp_backoff
def test_exp_backoff(mocker: MockFixture) -> None:
# Sleep should be exponential for each iteration
mocked_sleep = mocker.... | [
"opta.utils.exp_backoff",
"opta.utils.check_opta_file_exists",
"opta.utils.alternate_yaml_extension",
"pytest.raises"
] | [((375, 405), 'opta.utils.exp_backoff', 'exp_backoff', ([], {'num_tries': 'retries'}), '(num_tries=retries)\n', (386, 405), False, 'from opta.utils import alternate_yaml_extension, check_opta_file_exists, exp_backoff\n'), ((705, 735), 'opta.utils.exp_backoff', 'exp_backoff', ([], {'num_tries': 'retries'}), '(num_tries=... |
# -*- coding: utf-8 -*-
"""Provides functions for handling images."""
import pygame
try:
import numpy
HAS_NUMPY = True
except ImportError:
HAS_NUMPY = False
from thorpy import miscgui
def detect_frame(surf, vacuum=(255, 255, 255)):
"""Returns a Rect of the minimum size to contain all that is not <v... | [
"PIL.Image.open",
"pygame.surfarray.array3d",
"pygame.Surface",
"numpy.array",
"pygame.PixelArray",
"thorpy.miscgui.application._loaded.get",
"thorpy.miscgui.functions.debug_msg",
"pygame.image.load",
"pygame.Rect",
"pygame.transform.scale"
] | [((575, 594), 'numpy.array', 'numpy.array', (['vacuum'], {}), '(vacuum)\n', (586, 594), False, 'import numpy\n'), ((607, 637), 'pygame.surfarray.array3d', 'pygame.surfarray.array3d', (['surf'], {}), '(surf)\n', (631, 637), False, 'import pygame\n'), ((1217, 1274), 'pygame.Rect', 'pygame.Rect', (['first_x', 'miny', '(la... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) IBM Corporation 2021
# Apache License, Version 2.0 (see https://opensource.org/licenses/Apache-2.0)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = r"""
---
module: zmf_authenticate
short_description: Au... | [
"ansible_collections.ibm.ibm_zosmf.plugins.module_utils.zmf_util.get_connect_session",
"ansible.module_utils.basic.AnsibleModule",
"ansible_collections.ibm.ibm_zosmf.plugins.module_utils.zmf_util.get_auth_argument_spec",
"ansible_collections.ibm.ibm_zosmf.plugins.module_utils.zmf_auth_api.call_auth_api",
"r... | [((4600, 4627), 'ansible_collections.ibm.ibm_zosmf.plugins.module_utils.zmf_util.get_connect_session', 'get_connect_session', (['module'], {}), '(module)\n', (4619, 4627), False, 'from ansible_collections.ibm.ibm_zosmf.plugins.module_utils.zmf_util import get_auth_argument_spec, get_connect_session\n'), ((4682, 4723), ... |
import pandas as pd
import numpy as np
from torch.utils.data import Dataset, DataLoader
from torch import nn
from torchvision import transforms
import matplotlib.pyplot as plt
import torch
import random
import torch.nn.functional as F
from torch.utils.data.sampler import SubsetRandomSampler
random_seed = 1234
torch.ma... | [
"torch.nn.ReLU",
"torch.nn.CrossEntropyLoss",
"pandas.read_csv",
"numpy.array",
"torch.cuda.is_available",
"torch.nn.BatchNorm2d",
"numpy.asarray",
"numpy.random.seed",
"torchvision.transforms.ToTensor",
"torch.argmax",
"torch.utils.data.sampler.SubsetRandomSampler",
"torch.save",
"torch.cud... | [((312, 342), 'torch.manual_seed', 'torch.manual_seed', (['random_seed'], {}), '(random_seed)\n', (329, 342), False, 'import torch\n'), ((343, 378), 'torch.cuda.manual_seed', 'torch.cuda.manual_seed', (['random_seed'], {}), '(random_seed)\n', (365, 378), False, 'import torch\n'), ((379, 418), 'torch.cuda.manual_seed_al... |
import logging
from enum import Enum
from typing import List, Dict, Any
from fidesops.service.pagination.pagination_strategy import PaginationStrategy
from fidesops.service.pagination.pagination_strategy_cursor import (
CursorPaginationStrategy,
)
from fidesops.service.pagination.pagination_strategy_link import Lin... | [
"logging.getLogger",
"fidesops.common_exceptions.NoSuchStrategyException"
] | [((689, 716), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (706, 716), False, 'import logging\n'), ((1387, 1509), 'fidesops.common_exceptions.NoSuchStrategyException', 'NoSuchStrategyException', (['f"""Strategy \'{strategy_name}\' does not exist. Valid strategies are [{valid_strategies}... |
from __future__ import annotations
import copy
import typing
class Activity:
def __init__(self, start_time: float, finish_time: float) -> None:
self.start_time = start_time
self.finish_time = finish_time
def __iter__(self) -> typing.Iterator[float]:
for item in (self.start_time, self... | [
"copy.deepcopy"
] | [((446, 471), 'copy.deepcopy', 'copy.deepcopy', (['activities'], {}), '(activities)\n', (459, 471), False, 'import copy\n')] |
#! /usr/bin/python
# Copyright (c) 2009 <NAME>.
# (c) 2010-2019 Griatch
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 or
# later, as published by the Free Software Foundation.
"""
Evennia codebot system and github web... | [
"traceback.format_exc",
"json.loads",
"twisted.internet.reactor.connectTCP",
"inspect.getmembers",
"twisted.words.protocols.irc.IRCClient.connectionMade",
"os.getenv",
"twisted.internet.reactor.addSystemEventTrigger",
"twisted.internet.task.LoopingCall",
"feedparser.parse",
"twisted.internet.threa... | [((33581, 33596), 'twisted.python.log.count', 'log.count', (['"""\n"""'], {}), "('\\n')\n", (33590, 33596), False, 'from twisted.python import log\n'), ((35269, 35309), 'os.getenv', 'os.getenv', (['"""GITHUB_WEBHOOK_SECRET"""', 'None'], {}), "('GITHUB_WEBHOOK_SECRET', None)\n", (35278, 35309), False, 'import os\n'), ((... |
#!/usr/bin/env python
"""
DNAplotlib
==========
This module is designed to allow for highly customisable visualisation of DNA
fragments. Diagrams can be in the form of conceptual SBOL compliant icons or
make use of icons whose width is scaled to allow for easier comparison of part
locations to trace in... | [
"matplotlib.path.Path",
"matplotlib.use",
"matplotlib.patches.Wedge",
"matplotlib.pyplot.gcf",
"math.sqrt",
"matplotlib.patheffects.Stroke",
"matplotlib.pyplot.close",
"math.cos",
"matplotlib.pyplot.figure",
"matplotlib.patches.PathPatch",
"math.fabs",
"matplotlib.pyplot.tight_layout",
"oper... | [((2237, 2258), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (2251, 2258), False, 'import matplotlib\n'), ((5830, 5939), 'matplotlib.lines.Line2D', 'Line2D', (['[start, start]', '[0, dir_fac * y_extent]'], {'linewidth': 'linewidth', 'color': 'color', 'zorder': '(9 + zorder_add)'}), '([start, st... |
from flask import Flask, jsonify
from flask_graphql import GraphQLView
from py2neo import Graph
from flask_restx import Api
from src.schemas import schema
app = Flask(__name__)
app.config.from_object("src.config.Config")
app.add_url_rule(
"/graphql", view_func=GraphQLView.as_view("graphql", schema=schema, grap... | [
"flask.jsonify",
"flask_graphql.GraphQLView.as_view",
"flask_restx.Api",
"flask.Flask"
] | [((164, 179), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (169, 179), False, 'from flask import Flask, jsonify\n'), ((340, 425), 'flask_restx.Api', 'Api', (['app'], {'version': '"""1.0"""', 'title': '"""TodoMVC API"""', 'description': '"""A simple TodoMVC API"""'}), "(app, version='1.0', title='TodoMVC ... |
# Copyright (c) 2022 <NAME>
# This software is published under MIT license. Full text of the license is available at https://opensource.org/licenses/MIT
from ___basal.___logging import Logging
from ___blocks.___block_types import BlockTypes
import machine
import time
from micropython import const
_power_save_comman... | [
"___basal.___logging.Logging",
"machine.Pin",
"time.sleep",
"micropython.const"
] | [((324, 334), 'micropython.const', 'const', (['(246)'], {}), '(246)\n', (329, 334), False, 'from micropython import const\n'), ((366, 376), 'micropython.const', 'const', (['(247)'], {}), '(247)\n', (371, 376), False, 'from micropython import const\n'), ((409, 419), 'micropython.const', 'const', (['(254)'], {}), '(254)\... |
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""Extended thread dispatching support.
For basic support see reactor threading API docs.
API Stability: stable
Maintainer: U{<NAME><mailto:<EMAIL>>}
"""
# twisted imports
from twisted.python import log, failure
# sibling imports
f... | [
"twisted.internet.reactor.callInThread",
"twisted.internet.reactor.callFromThread",
"twisted.python.failure.Failure",
"twisted.internet.defer.Deferred"
] | [((826, 842), 'twisted.internet.defer.Deferred', 'defer.Deferred', ([], {}), '()\n', (840, 842), False, 'from twisted.internet import defer\n'), ((888, 950), 'twisted.internet.reactor.callInThread', 'reactor.callInThread', (['_putResultInDeferred', 'd', 'f', 'args', 'kwargs'], {}), '(_putResultInDeferred, d, f, args, k... |
"""
.. codeauthor:: <NAME> <<EMAIL>>
"""
import re
from typing import List, Pattern
from ._base import VarNameSanitizer
class PythonVarNameSanitizer(VarNameSanitizer):
__PYTHON_RESERVED_KEYWORDS = [
"and",
"del",
"from",
"not",
"while",
"as",
"elif",
... | [
"re.compile"
] | [((904, 931), 're.compile', 're.compile', (['"""[^a-zA-Z0-9_]"""'], {}), "('[^a-zA-Z0-9_]')\n", (914, 931), False, 'import re\n'), ((965, 990), 're.compile', 're.compile', (['"""^[^a-zA-Z]+"""'], {}), "('^[^a-zA-Z]+')\n", (975, 990), False, 'import re\n')] |
import pandas as pd
# Load dataset https://storage.googleapis.com/dqlab-dataset/LO4/global_air_quality_4000rows.csv
gaq = pd.read_csv('https://storage.googleapis.com/dqlab-dataset/LO4/global_air_quality_4000rows.csv')
# Cetak 5 data teratas
print('Sebelum diubah dalam format datetime:\n', gaq.head())
# Ubah menjadi dat... | [
"pandas.to_datetime",
"pandas.read_csv"
] | [((122, 227), 'pandas.read_csv', 'pd.read_csv', (['"""https://storage.googleapis.com/dqlab-dataset/LO4/global_air_quality_4000rows.csv"""'], {}), "(\n 'https://storage.googleapis.com/dqlab-dataset/LO4/global_air_quality_4000rows.csv'\n )\n", (133, 227), True, 'import pandas as pd\n'), ((345, 377), 'pandas.to_date... |
from django.contrib.auth.models import Group as AbstractGroup
from django.core.validators import RegexValidator
from django.db import models
from openwisp_users.base.models import (
AbstractUser,
BaseGroup,
BaseOrganization,
BaseOrganizationOwner,
BaseOrganizationUser,
)
from organizations.abstract ... | [
"django.core.validators.RegexValidator"
] | [((575, 624), 'django.core.validators.RegexValidator', 'RegexValidator', (['"""^\\\\d\\\\d\\\\d-\\\\d\\\\d-\\\\d\\\\d\\\\d\\\\d$"""'], {}), "('^\\\\d\\\\d\\\\d-\\\\d\\\\d-\\\\d\\\\d\\\\d\\\\d$')\n", (589, 624), False, 'from django.core.validators import RegexValidator\n')] |
# Copyright (c) Scanlon Materials Theory Group
# Distributed under the terms of the MIT License.
"""
Plot high symmetry points on the Brillouin Zone from calculated band structure
TODO:
- Connect the high symmetry points to make a path as it appears on the band
structure
- Incorporate an option to open ... | [
"logging.basicConfig",
"os.path.exists",
"logging.getLogger",
"logging.StreamHandler",
"matplotlib.use",
"pymatgen.io.vasp.outputs.BSVasprun",
"os.path.join",
"sumo.plotting.styled_plot",
"sys.exit",
"pymatgen.electronic_structure.bandstructure.get_reconstructed_band_structure",
"sumo.plotting.p... | [((810, 824), 'matplotlib.use', 'mpl.use', (['"""Agg"""'], {}), "('Agg')\n", (817, 824), True, 'import matplotlib as mpl\n'), ((1087, 1115), 'sumo.plotting.styled_plot', 'styled_plot', (['sumo_base_style'], {}), '(sumo_base_style)\n', (1098, 1115), False, 'from sumo.plotting import colour_cache, styled_plot, sumo_base_... |
# -*- coding: utf-8 -*-
import scrapy
from bs4 import BeautifulSoup
from termcolor import colored
class GenericSpider(scrapy.Spider):
name = 'generic'
allowed_domains = ['yjc.ir','irna.ir','isna.ir','mehrnews.com','khabaronline.ir','mashreghnews.ir','irinn.ir']
start_urls = [
'https://www.yjc.ir/f... | [
"bs4.BeautifulSoup",
"termcolor.colored"
] | [((2194, 2228), 'bs4.BeautifulSoup', 'BeautifulSoup', (['text', '"""html.parser"""'], {}), "(text, 'html.parser')\n", (2207, 2228), False, 'from bs4 import BeautifulSoup\n'), ((2745, 2779), 'bs4.BeautifulSoup', 'BeautifulSoup', (['text', '"""html.parser"""'], {}), "(text, 'html.parser')\n", (2758, 2779), False, 'from b... |
from itertools import product
from jsonschema import ValidationError
import pytest
from math import ceil
from random import randint, shuffle
from typing import Dict, List, TypeVar, Type
from pyaestro.dataclasses import GraphEdge
from pyaestro.structures.abstracts import \
BidirectionalGraph, Graph
from pyaestro.st... | [
"random.shuffle",
"itertools.product",
"tests.helpers.utils.generate_unique_lower_names",
"pytest.fail",
"pytest.mark.parametrize",
"pytest.raises",
"pyaestro.dataclasses.GraphEdge",
"random.randint",
"typing.TypeVar"
] | [((606, 635), 'typing.TypeVar', 'TypeVar', (['"""Graph"""'], {'bound': 'Graph'}), "('Graph', bound=Graph)\n", (613, 635), False, 'from typing import Dict, List, TypeVar, Type\n'), ((2687, 2732), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""graph_type"""', 'GRAPHS'], {}), "('graph_type', GRAPHS)\n", (2710... |
# Generated by Django 3.1.1 on 2020-09-27 13:47
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('app_users', '0001_initial'),
('curriculum', '0005_auto_20200927_1914'),
]
operations = [
migrations.RenameModel(
old_name='Comme... | [
"django.db.migrations.RenameModel"
] | [((269, 332), 'django.db.migrations.RenameModel', 'migrations.RenameModel', ([], {'old_name': '"""Comments"""', 'new_name': '"""Comment"""'}), "(old_name='Comments', new_name='Comment')\n", (291, 332), False, 'from django.db import migrations\n')] |
#!/usr/bin/env python3
from unittest.mock import patch
from unittest import TestCase
from inputs import UserInputs
class TestInputJobs(TestCase):
def setUp(self):
self.inputs = UserInputs()
def tearDown(self):
del self.inputs
@patch("builtins.input", return_value="")
def test_n... | [
"inputs.UserInputs",
"unittest.mock.patch"
] | [((265, 305), 'unittest.mock.patch', 'patch', (['"""builtins.input"""'], {'return_value': '""""""'}), "('builtins.input', return_value='')\n", (270, 305), False, 'from unittest.mock import patch\n'), ((481, 530), 'unittest.mock.patch', 'patch', (['"""builtins.input"""'], {'return_value': '"""developer"""'}), "('builtin... |
import socket
import re
import winsound
import tkinter
import threading
import getpass
import os
import traceback
import io
from tkinter.simpledialog import askstring
from tkinter.messagebox import showerror
path = r"C:\Users\{}\AppData\Local\Temp\twitch_sound_chat.txt"
path = path.format(getpass.getuser())
root = t... | [
"tkinter.IntVar",
"os.path.exists",
"tkinter.Checkbutton",
"socket.socket",
"tkinter.simpledialog.askstring",
"tkinter.Button",
"tkinter.Tk",
"winsound.Beep",
"getpass.getuser",
"threading.Thread",
"io.StringIO",
"traceback.print_exc",
"re.search"
] | [((319, 331), 'tkinter.Tk', 'tkinter.Tk', ([], {}), '()\n', (329, 331), False, 'import tkinter\n'), ((859, 875), 'tkinter.IntVar', 'tkinter.IntVar', ([], {}), '()\n', (873, 875), False, 'import tkinter\n'), ((1910, 1952), 'threading.Thread', 'threading.Thread', ([], {'target': 'main', 'daemon': '(True)'}), '(target=mai... |
# /usr/bin/env python3
# -*- coding: utf-8 -*-
##############################################
############## Importing ###############
##############################################
import utility as _utility
import docstrings as _docstrings
import subprocess as _subprocess
#####################################... | [
"utility.check_path",
"utility.get_ticks",
"utility.hist_data",
"utility.get_matrix_data",
"utility.remove_color",
"plotext.test",
"utility.get_lim_data",
"utility.write",
"utility.bars",
"utility.frame_matrix",
"utility.background_color.keys",
"utility.shell",
"subprocess.call",
"utility.... | [((436, 455), 'utility.platform', '_utility.platform', ([], {}), '()\n', (453, 455), True, 'import utility as _utility\n'), ((634, 650), 'utility.shell', '_utility.shell', ([], {}), '()\n', (648, 650), True, 'import utility as _utility\n'), ((511, 543), 'subprocess.call', '_subprocess.call', (['""""""'], {'shell': '(Tr... |