code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
from code.AmazonScraper import AmazonScraper
import re
# Unit tests for AmazonScraper.py
# Tests cost funcitonality
# @author rhnprabhune
InStock_URL = "https://www.amazon.com/adidas-Santiago-Lunch-Black-White/dp/B07KDSWWXK/ref=sr_1_3?crid=10JP8TVHSQW3E&dchild=1&keywords=limited+time+deal&qid=1631860841&s=apparel&spr... | [
"code.AmazonScraper.AmazonScraper",
"re.search"
] | [((1269, 1295), 'code.AmazonScraper.AmazonScraper', 'AmazonScraper', (['InStock_URL'], {}), '(InStock_URL)\n', (1282, 1295), False, 'from code.AmazonScraper import AmazonScraper\n'), ((1618, 1644), 'code.AmazonScraper.AmazonScraper', 'AmazonScraper', (['InStock_URL'], {}), '(InStock_URL)\n', (1631, 1644), False, 'from ... |
import bpy
from . import settings, utils
from bpy.props import (StringProperty,
BoolProperty,
IntProperty,
FloatProperty,
EnumProperty,
PointerProperty,
)
from bpy.types import (Pan... | [
"bpy.props.StringProperty",
"mathutils.Vector",
"bpy.ops.object.mode_set",
"os.access",
"struct.pack",
"bpy.context.scene.frame_set",
"os.path.split"
] | [((8434, 8464), 'bpy.context.scene.frame_set', 'bpy.context.scene.frame_set', (['(0)'], {}), '(0)\n', (8461, 8464), False, 'import bpy\n'), ((9235, 9268), 'struct.pack', 'struct.pack', (['"""<I"""', '(animLength + 1)'], {}), "('<I', animLength + 1)\n", (9246, 9268), False, 'import struct\n'), ((9359, 9406), 'struct.pac... |
import random
print('------------------login--------------------------------------------')
name = input("enter ur name: ")
age = input('enter age: ')
webpass = input('password: ')
command = f'''
welcome ({name},{age}) to world of game!
Even me(sidhant) developer doesnot know the
correct guess ,its generated ... | [
"random.randint"
] | [((481, 503), 'random.randint', 'random.randint', (['(40)', '(50)'], {}), '(40, 50)\n', (495, 503), False, 'import random\n')] |
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
from RK_Driver import dcm_from_q
# Make a 2D plot of the results for the angular velocity
# Inputs:
# - Time array (time[ N ]) [sec]
# - Angular rate array (om_arr[ N ][ 3 ]) [rad/s... | [
"matplotlib.pyplot.grid",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"RK_Driver.dcm_from_q",
"numpy.array",
"numpy.zeros",
"matplotlib.pyplot.figure",
"numpy.matmul",
"matplotlib.pyplot.pause",
"matplotlib.pyplot.title",
"numpy.transpose",
"matplotlib.pyplot.cla",
"matplotlib.py... | [((496, 510), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (508, 510), True, 'import matplotlib.pyplot as plt\n'), ((799, 821), 'matplotlib.pyplot.xlabel', 'plt.xlabel', (['"""Time (s)"""'], {}), "('Time (s)')\n", (809, 821), True, 'import matplotlib.pyplot as plt\n'), ((828, 862), 'matplotlib.pyplot... |
import os
import glob
import subprocess
import yaml
subfolder = os.listdir("models")[0]
folder = os.path.join("models", subfolder)
files = glob.glob("%s/[0-9]*.ckpt" % folder)
ids = sorted([int(f[len(folder)+1:-5]) for f in files])
config_path = glob.glob("*.yaml")[0]
config = yaml.safe_load(open(config_path, "r", en... | [
"os.listdir",
"os.path.join",
"subprocess.call",
"glob.glob"
] | [((98, 131), 'os.path.join', 'os.path.join', (['"""models"""', 'subfolder'], {}), "('models', subfolder)\n", (110, 131), False, 'import os\n'), ((140, 176), 'glob.glob', 'glob.glob', (["('%s/[0-9]*.ckpt' % folder)"], {}), "('%s/[0-9]*.ckpt' % folder)\n", (149, 176), False, 'import glob\n'), ((542, 672), 'subprocess.cal... |
from gurobipy import Model, GRB, quicksum
from itertools import product
from networkx import non_edges
def create_model(G, clique_size):
r""" Create an ILP for the clique packing problem
:param G: an :py:class:`~graphilp.imports.ilpgraph.ILPGraph`
:param clique_size: size of the clique to be packed
... | [
"gurobipy.quicksum",
"networkx.non_edges",
"gurobipy.Model"
] | [((2227, 2259), 'gurobipy.Model', 'Model', (['"""graphilp_clique_packing"""'], {}), "('graphilp_clique_packing')\n", (2232, 2259), False, 'from gurobipy import Model, GRB, quicksum\n'), ((2947, 2961), 'networkx.non_edges', 'non_edges', (['G.G'], {}), '(G.G)\n', (2956, 2961), False, 'from networkx import non_edges\n'), ... |
import pytest
from pvtool.db import PvModule, Measurement, MeasurementValues, FlasherData, ManufacturerData, db
@pytest.mark.incremental
class TestDBModels(object):
def test_pv_module_insert(client, init_db):
"""
GIVEN a database
WHEN database is initialized
THEN check ... | [
"pvtool.db.Measurement",
"pvtool.db.MeasurementValues",
"pvtool.db.db.session.query",
"pvtool.db.PvModule",
"pvtool.db.db.session.commit",
"pvtool.db.db.session.add"
] | [((398, 571), 'pvtool.db.PvModule', 'PvModule', ([], {'model': '"""TEST"""', 'manufacturer': '"""TEST"""', 'cell_type': '"""TEST"""', 'additional_information': '"""TEST"""', 'price_CHF': '"""-999"""', 'length': '"""-999"""', 'width': '"""-999"""', 'shunt_resistance': '"""-999"""'}), "(model='TEST', manufacturer='TEST',... |
import collections
import hashlib
import inspect
import os
import pathlib
import click
import django
from django.conf import settings
from django.db import connections
from django.db.migrations import executor as django_migration_executor
from django.db.migrations import loader as django_migration_loader
from django.u... | [
"migration_docs.utils.shell",
"formaldict.Schema",
"yaml.dump",
"click.secho",
"pathlib.Path",
"inspect.getmodule",
"django.db.migrations.loader.MigrationLoader",
"os.getcwd",
"jinja2.Template",
"yaml.safe_load",
"django.db.migrations.executor.MigrationExecutor"
] | [((1166, 1189), 'click.secho', 'click.secho', (['msg'], {'fg': 'fg'}), '(msg, fg=fg)\n', (1177, 1189), False, 'import click\n'), ((797, 808), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (806, 808), False, 'import os\n'), ((5473, 5528), 'django.db.migrations.executor.MigrationExecutor', 'django_migration_executor.Migrat... |
import io
import os
import time
import subprocess
import sdi_utils.gensolution as gs
import sdi_utils.set_logging as slog
import sdi_utils.textfield_parser as tfp
import sdi_utils.tprogress as tp
try:
api
except NameError:
class api:
queue = list()
class Message:
def __init__(s... | [
"os.path.realpath",
"subprocess.run",
"os.path.join",
"sdi_utils.set_logging.set_logging"
] | [((1826, 1891), 'sdi_utils.set_logging.set_logging', 'slog.set_logging', (["att['operator']"], {'loglevel': 'api.config.debug_mode'}), "(att['operator'], loglevel=api.config.debug_mode)\n", (1842, 1891), True, 'import sdi_utils.set_logging as slog\n'), ((2368, 2443), 'os.path.join', 'os.path.join', (["msg.attributes['c... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# C++ version Copyright (c) 2006-2007 <NAME> http://www.box2d.org
# Python version by <NAME> / sirkne at gmail dot com
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liable for any damages
# arising ... | [
"Box2D.examples.framework.main",
"Box2D.examples.framework.Framework.PreSolve",
"Box2D.b2PolygonShape",
"Box2D.examples.framework.Framework.__init__",
"Box2D.b2EdgeShape"
] | [((2391, 2409), 'Box2D.examples.framework.main', 'main', (['ConveyorBelt'], {}), '(ConveyorBelt)\n', (2395, 2409), False, 'from Box2D.examples.framework import Framework, main\n'), ((1211, 1235), 'Box2D.examples.framework.Framework.__init__', 'Framework.__init__', (['self'], {}), '(self)\n', (1229, 1235), False, 'from ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Apr 8 20:58:20 2021
@author: <NAME>
@email: <EMAIL>
Conjunto básico de testes de unidade para avaliar as instâncias utilizadas.
"""
from unittest import TestCase, main
import os
import numpy as np
import pandas as pd
class BasicTests(TestCase):
... | [
"unittest.main",
"numpy.array",
"os.path.join",
"pandas.read_csv"
] | [((3205, 3211), 'unittest.main', 'main', ([], {}), '()\n', (3209, 3211), False, 'from unittest import TestCase, main\n'), ((410, 461), 'os.path.join', 'os.path.join', (['"""data"""', '"""instances"""', '"""instance-1.csv"""'], {}), "('data', 'instances', 'instance-1.csv')\n", (422, 461), False, 'import os\n'), ((475, 5... |
"""
Use graph theory packages to identify disconnected subgraphs of the inferred relationship.
Each disconnected subgraph is called a "family." Each family is assigned a single identifer.
@author <NAME> and <NAME>
USAGE:
-----
python all_relationships.csv all_family_IDS.csv
"""
import networkx as nx
import matplo... | [
"networkx.connected_component_subgraphs",
"csv.writer",
"networkx.Graph"
] | [((750, 760), 'networkx.Graph', 'nx.Graph', ([], {}), '()\n', (758, 760), True, 'import networkx as nx\n'), ((1054, 1071), 'csv.writer', 'csv.writer', (['outfh'], {}), '(outfh)\n', (1064, 1071), False, 'import csv\n'), ((958, 993), 'networkx.connected_component_subgraphs', 'nx.connected_component_subgraphs', (['u'], {}... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 12 14:21:40 2019
"""
import math
def hoeffding_bounded_score(max_rew, score_bound, disc, horizon, dim,
estimator='gpomdp'):
if estimator=='reinforce':
time_factor = horizon * (1 - disc**horizon) / (1 - disc)... | [
"math.log"
] | [((622, 645), 'math.log', 'math.log', (['(6 / fail_prob)'], {}), '(6 / fail_prob)\n', (630, 645), False, 'import math\n'), ((1182, 1205), 'math.log', 'math.log', (['(6 / fail_prob)'], {}), '(6 / fail_prob)\n', (1190, 1205), False, 'import math\n'), ((2307, 2332), 'math.log', 'math.log', (['(6.0 / fail_prob)'], {}), '(6... |
import unittest
from mock import Mock
from mock import patch
import subprocess
import logging
from twilio.rest import TwilioRestClient
from twilio.exceptions import TwilioException
from .context import configure
class ConfigureTest(unittest.TestCase):
def setUp(self):
self.configure = configure.Configur... | [
"mock.patch",
"mock.Mock",
"mock.patch.object",
"twilio.exceptions.TwilioException",
"twilio.rest.TwilioRestClient"
] | [((750, 793), 'mock.patch', 'patch', (['"""twilio.rest.resources.Applications"""'], {}), "('twilio.rest.resources.Applications')\n", (755, 793), False, 'from mock import patch\n'), ((799, 841), 'mock.patch', 'patch', (['"""twilio.rest.resources.Application"""'], {}), "('twilio.rest.resources.Application')\n", (804, 841... |
# -*- coding: utf-8 -*-
# Copyright 2015, 2016 OpenMarket Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | [
"synapse.util.logcontext.LoggingContext.current_context",
"synapse.util.logcontext.PreserveLoggingContext",
"functools.wraps"
] | [((2650, 2668), 'functools.wraps', 'wraps', (['old__init__'], {}), '(old__init__)\n', (2655, 2668), False, 'from functools import wraps\n'), ((1219, 1251), 'synapse.util.logcontext.LoggingContext.current_context', 'LoggingContext.current_context', ([], {}), '()\n', (1249, 1251), False, 'from synapse.util.logcontext imp... |
from pardal import templates
from pardal.keyboard import KeyboardConfiguration
from pardal.speaking import say
from pynput import keyboard
class HomeTimeline:
def __init__(self, api):
super().__init__()
self.api = api
self.data = api.get_home_timeline()
self.cursor = 0
self... | [
"pardal.speaking.say",
"pynput.keyboard.Listener",
"pardal.templates.tweet",
"pardal.keyboard.KeyboardConfiguration"
] | [((503, 525), 'pardal.templates.tweet', 'templates.tweet', (['tweet'], {}), '(tweet)\n', (518, 525), False, 'from pardal import templates\n'), ((578, 598), 'pardal.speaking.say', 'say', (['formatted_tweet'], {}), '(formatted_tweet)\n', (581, 598), False, 'from pardal.speaking import say\n'), ((658, 700), 'pardal.speaki... |
# -*- coding: utf-8 -*-
"""Evaluators.
========= =============================================
Name Reference
========= =============================================
rankbased :class:`pykeen.evaluation.RankBasedEvaluator`
sklearn :class:`pykeen.evaluation.SklearnEvaluator`
========= =====================... | [
"dataclasses.fields",
"class_resolver.Resolver"
] | [((1731, 1827), 'class_resolver.Resolver', 'Resolver', (['_EVALUATORS'], {'base': 'Evaluator', 'suffix': '_EVALUATOR_SUFFIX', 'default': 'RankBasedEvaluator'}), '(_EVALUATORS, base=Evaluator, suffix=_EVALUATOR_SUFFIX, default=\n RankBasedEvaluator)\n', (1739, 1827), False, 'from class_resolver import Resolver\n'), (... |
import numpy as np
import matplotlib.pyplot as plt
import math
from pynverse import inversefunc
from IPython import get_ipython
get_ipython().magic('reset -sf')
import pandas as pd
from scipy.optimize import leastsq, least_squares, curve_fit
import os
from scipy import interpolate
import scipy.integrate as ... | [
"IPython.get_ipython",
"numpy.abs",
"scipy.integrate.quad",
"numpy.arcsin",
"numpy.asarray",
"scipy.interpolate.interp1d",
"numpy.exp",
"pynverse.inversefunc",
"numpy.sin"
] | [((3502, 3528), 'scipy.interpolate.interp1d', 'interpolate.interp1d', (['x', 'y'], {}), '(x, y)\n', (3522, 3528), False, 'from scipy import interpolate\n'), ((3587, 3613), 'scipy.interpolate.interp1d', 'interpolate.interp1d', (['x', 'y'], {}), '(x, y)\n', (3607, 3613), False, 'from scipy import interpolate\n'), ((3623,... |
import json
import os.path
import time
import numpy as np
import matplotlib.pyplot as plt
from collections import OrderedDict
import torch
from torch import nn, optim
import torch.nn.functional as F
from torchvision import datasets, transforms, models
from PIL import Image
# TODO: Fix bug with the epoch print in the ... | [
"numpy.clip",
"torch.nn.ReLU",
"torch.nn.Dropout",
"torch.nn.CrossEntropyLoss",
"torch.nn.Sequential",
"torch.max",
"torch.from_numpy",
"numpy.array",
"torch.cuda.is_available",
"numpy.arange",
"matplotlib.pyplot.plot",
"numpy.max",
"torchvision.datasets.ImageFolder",
"torchvision.models.v... | [((646, 665), 'torch.device', 'torch.device', (['"""cpu"""'], {}), "('cpu')\n", (658, 665), False, 'import torch\n'), ((1694, 1715), 'torch.nn.CrossEntropyLoss', 'nn.CrossEntropyLoss', ([], {}), '()\n', (1713, 1715), False, 'from torch import nn, optim\n'), ((1742, 1759), 'torch.nn.Softmax', 'nn.Softmax', ([], {'dim': ... |
from collections import OrderedDict
from django.db.models import Count, Case, When, IntegerField, Sum
from onadata.apps.fieldsight.models import Site
from onadata.apps.fsforms.models import FInstance, FieldSightXF
class BarGenerator(object):
def __init__(self, sites):
self.data = OrderedDict()
sel... | [
"django.db.models.When",
"collections.OrderedDict",
"django.db.models.IntegerField",
"onadata.apps.fieldsight.models.Site.objects.filter"
] | [((295, 308), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (306, 308), False, 'from collections import OrderedDict\n'), ((1224, 1237), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (1235, 1237), False, 'from collections import OrderedDict\n'), ((1271, 1313), 'onadata.apps.fieldsight.models.... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
from sumy._compat import to_unicode
from sumy.nlp.tokenizers import Tokenizer
from sumy.parsers.html import HtmlParser
from .utils import expand_resource_path
def test_annotated_text():
path = expand_resou... | [
"sumy._compat.to_unicode",
"sumy.nlp.tokenizers.Tokenizer"
] | [((453, 471), 'sumy.nlp.tokenizers.Tokenizer', 'Tokenizer', (['"""czech"""'], {}), "('czech')\n", (462, 471), False, 'from sumy.nlp.tokenizers import Tokenizer\n'), ((667, 713), 'sumy._compat.to_unicode', 'to_unicode', (['document.paragraphs[0].headings[0]'], {}), '(document.paragraphs[0].headings[0])\n', (677, 713), F... |
"""Background subtractor motion detection config."""
from voluptuous import All, Any, Coerce, Optional, Range
from viseron.motion import AbstractMotionDetectionConfig
from .const import ALPHA, AREA, THRESHOLD
SCHEMA = AbstractMotionDetectionConfig.SCHEMA.extend(
{
Optional("area", default=AREA): All(
... | [
"voluptuous.Optional",
"voluptuous.Range",
"voluptuous.Coerce"
] | [((280, 310), 'voluptuous.Optional', 'Optional', (['"""area"""'], {'default': 'AREA'}), "('area', default=AREA)\n", (288, 310), False, 'from voluptuous import All, Any, Coerce, Optional, Range\n'), ((423, 463), 'voluptuous.Optional', 'Optional', (['"""threshold"""'], {'default': 'THRESHOLD'}), "('threshold', default=TH... |
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.page import shared_page_state
from page_sets.login_helpers import google_login
from page_sets.rendering import rendering_story
from page_sets.... | [
"page_sets.login_helpers.google_login.NewLoginGoogleAccount"
] | [((1855, 1918), 'page_sets.login_helpers.google_login.NewLoginGoogleAccount', 'google_login.NewLoginGoogleAccount', (['action_runner', '"""googletest"""'], {}), "(action_runner, 'googletest')\n", (1889, 1918), False, 'from page_sets.login_helpers import google_login\n')] |
from napalm import get_network_driver
from ping3 import ping
from ipaddress import ip_network, ip_address
driver = get_network_driver('huawei_vrp')
device = driver(hostname='IP', username='usernama', password='password')
device.open()
# Return general device information
get_interfaces_ip = device.get_interfaces_ip(... | [
"napalm.get_network_driver"
] | [((116, 148), 'napalm.get_network_driver', 'get_network_driver', (['"""huawei_vrp"""'], {}), "('huawei_vrp')\n", (134, 148), False, 'from napalm import get_network_driver\n')] |
"""create settingsui table
Revision ID: 9cae4aa05dd7
Revises: <PASSWORD>
Create Date: 2021-03-11 23:55:12.428608
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '9cae4aa05dd7'
down_revision = '<PASSWORD>'
branch_labels = None
depends_on = None
def upgrade():
... | [
"alembic.op.drop_table",
"sqlalchemy.PrimaryKeyConstraint",
"alembic.op.batch_alter_table",
"sqlalchemy.Integer",
"alembic.op.bulk_insert",
"sqlalchemy.String"
] | [((1232, 1415), 'alembic.op.bulk_insert', 'op.bulk_insert', (['setting_table', "[{'id': 1, 'use_icons': 1, 'save_remote_images': 1, 'bootstrap_skin':\n 'spacelab', 'language': 'en', 'index_refresh': 10, 'database_limit': 200}]"], {}), "(setting_table, [{'id': 1, 'use_icons': 1,\n 'save_remote_images': 1, 'bootstr... |
# Copyright 2016 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 in wri... | [
"gossip.node.RoundTripEstimator"
] | [((885, 905), 'gossip.node.RoundTripEstimator', 'RoundTripEstimator', ([], {}), '()\n', (903, 905), False, 'from gossip.node import RoundTripEstimator\n'), ((1169, 1189), 'gossip.node.RoundTripEstimator', 'RoundTripEstimator', ([], {}), '()\n', (1187, 1189), False, 'from gossip.node import RoundTripEstimator\n'), ((170... |
import io
from typing import Any, Dict, List, Optional, Tuple
import pandas as pd
import time
def clean_csv_value(value: Optional[Any]) -> str:
if value is None:
return r'\N'
return str(value).replace('\n', '\\n')
def make_contract_csv(path: str) -> Tuple[io.StringIO, io.StringIO, io.StringIO, io.St... | [
"io.StringIO",
"time.time",
"pandas.read_csv"
] | [((442, 453), 'time.time', 'time.time', ([], {}), '()\n', (451, 453), False, 'import time\n'), ((465, 491), 'pandas.read_csv', 'pd.read_csv', (['path'], {'sep': '""","""'}), "(path, sep=',')\n", (476, 491), True, 'import pandas as pd\n'), ((706, 719), 'io.StringIO', 'io.StringIO', ([], {}), '()\n', (717, 719), False, '... |
from math import sqrt
from time import time
def main():
upperbound = 10000
result = 0
for n in range(2, upperbound + 1):
limit = int(sqrt(n))
if limit * limit == n:
continue
period = 0
d = 1
m = 0
a = limit
while a != 2 * limit:
... | [
"math.sqrt",
"time.time"
] | [((556, 562), 'time.time', 'time', ([], {}), '()\n', (560, 562), False, 'from time import time\n'), ((648, 654), 'time.time', 'time', ([], {}), '()\n', (652, 654), False, 'from time import time\n'), ((155, 162), 'math.sqrt', 'sqrt', (['n'], {}), '(n)\n', (159, 162), False, 'from math import sqrt\n')] |
import argparse
import base64
import json
import os
import pickle
import sys
from datetime import datetime, timedelta, timezone
from functools import wraps
import boto3
import botocore
import keyring
__version__ = "0.4.0"
ACCOUNT_MAPPING_FILENAME = os.path.expanduser("~/.aws/accounts")
KEYRING_SERVICE_NAME = "aws_lo... | [
"os.execlp",
"boto3.session.Session",
"argparse.ArgumentParser",
"keyring.set_password",
"pickle.dumps",
"subprocess.run",
"os.environ.get",
"base64.b64decode",
"functools.wraps",
"argparse.ArgumentTypeError",
"sys.stderr.write",
"datetime.datetime.now",
"keyring.get_password",
"sys.exit",... | [((252, 289), 'os.path.expanduser', 'os.path.expanduser', (['"""~/.aws/accounts"""'], {}), "('~/.aws/accounts')\n", (270, 289), False, 'import os\n'), ((721, 736), 'functools.wraps', 'wraps', (['function'], {}), '(function)\n', (726, 736), False, 'from functools import wraps\n'), ((1937, 1971), 'os.environ.get', 'os.en... |
#!/usr/bin/env python3
import feedparser
from urllib.parse import quote
from html import unescape
rssurl = 'https://chat.stackexchange.com/feeds/search/'
def search(phrase):
rss = feedparser.parse('{0}{1}'.format(rssurl, quote(phrase, safe='')))
for entry in rss.entries:
yield entry
def search_summ... | [
"urllib.parse.quote",
"html.unescape"
] | [((383, 419), 'html.unescape', 'unescape', (['entry.summary_detail.value'], {}), '(entry.summary_detail.value)\n', (391, 419), False, 'from html import unescape\n'), ((229, 251), 'urllib.parse.quote', 'quote', (['phrase'], {'safe': '""""""'}), "(phrase, safe='')\n", (234, 251), False, 'from urllib.parse import quote\n'... |
#!/usr/bin/env python
import setuptools
from distutils.core import setup
from distutils.extension import Extension
setup(name='streamp3',
version='0.1.5',
description="streaming mp3 decoder",
long_description=open('README.md', 'r').read(),
long_description_content_type='text/markdown',
u... | [
"setuptools.find_packages",
"distutils.extension.Extension"
] | [((429, 455), 'setuptools.find_packages', 'setuptools.find_packages', ([], {}), '()\n', (453, 455), False, 'import setuptools\n'), ((517, 579), 'distutils.extension.Extension', 'Extension', (['"""lame.hip"""', "['lame/hip.pyx']"], {'libraries': "['mp3lame']"}), "('lame.hip', ['lame/hip.pyx'], libraries=['mp3lame'])\n",... |
import math
import random
from pandemic.simulation.model.actions import (
OneQuietNight,
ResilientPopulation,
Airlift,
Forecast,
GovernmentGrant,
ChooseCard,
)
from pandemic.simulation.model.city_id import EventCard, City
from pandemic.simulation.model.enums import Character
from pandemic.simul... | [
"random.shuffle",
"pandemic.simulation.model.actions.Forecast",
"pandemic.simulation.model.actions.GovernmentGrant",
"pandemic.simulation.model.actions.ChooseCard",
"pandemic.simulation.model.actions.OneQuietNight",
"pandemic.simulation.simulation.Simulation",
"pandemic.test.utils.create_less_random_sim... | [((560, 572), 'pandemic.simulation.simulation.Simulation', 'Simulation', ([], {}), '()\n', (570, 572), False, 'from pandemic.simulation.simulation import Simulation\n'), ((730, 765), 'pandemic.simulation.model.actions.OneQuietNight', 'OneQuietNight', ([], {'player': 'active_player'}), '(player=active_player)\n', (743, ... |
from flask import Blueprint, make_response, render_template, request, session, abort, send_from_directory
from jinja2.exceptions import TemplateNotFound
from .service_page import render_template_wo_statistics
# Инициализируем модуль Game
game_bp = Blueprint('Game', __name__, template_folder='../games', static_fol... | [
"flask.render_template",
"flask.request.args.get",
"flask.send_from_directory",
"flask.abort",
"flask.make_response",
"flask.Blueprint"
] | [((254, 361), 'flask.Blueprint', 'Blueprint', (['"""Game"""', '__name__'], {'template_folder': '"""../games"""', 'static_folder': '"""../games"""', 'url_prefix': '"""/games"""'}), "('Game', __name__, template_folder='../games', static_folder=\n '../games', url_prefix='/games')\n", (263, 361), False, 'from flask impo... |
import torch, pytz
import torch.nn as nn
from torch.utils.data import Dataset, DataLoader
import numpy as np
import pandas as pd
import os, csv
# For plotting
import matplotlib.pyplot as plt
from matplotlib.pyplot import figure
import streamlit as st
from PIL import Image
import Reconstruction_DNN, Recon... | [
"streamlit.image",
"PIL.Image.open",
"streamlit.stop",
"pandas.read_csv",
"Reconstruction_DNN.Reconstruct",
"streamlit.video",
"streamlit.selectbox",
"streamlit.file_uploader",
"streamlit.write",
"streamlit.sidebar.expander",
"Reconstruct_DNN_2.Reconstruct",
"streamlit.download_button",
"str... | [((353, 505), 'streamlit.set_page_config', 'st.set_page_config', ([], {'page_title': '"""ARMOR Lab Human Digital Twin Demo"""', 'layout': '"""wide"""', 'page_icon': '"""/app/human_digital_twin/Deployment/EmbeddedImage.png"""'}), "(page_title='ARMOR Lab Human Digital Twin Demo', layout=\n 'wide', page_icon='/app/huma... |
import numpy as np
import tensorflow as tf
from tqdm import tqdm
from debias.squad_eval.squad_v1_official_evaluation import normalize_answer, f1_score
from debias.utils.ops import get_best_span
def eval_squad(predicted_ans, actual_answers, use_tqdm=False):
"""
:param predicted_ans: List of strings,
:param actu... | [
"debias.utils.ops.get_best_span",
"tensorflow.py_func",
"debias.squad_eval.squad_v1_official_evaluation.f1_score",
"debias.squad_eval.squad_v1_official_evaluation.normalize_answer"
] | [((1764, 1801), 'debias.utils.ops.get_best_span', 'get_best_span', (['span_logits', 'max_bound'], {}), '(span_logits, max_bound)\n', (1777, 1801), False, 'from debias.utils.ops import get_best_span\n'), ((1813, 1923), 'tensorflow.py_func', 'tf.py_func', (['_eval_squad_from_spans', '[predicted_span, inv, passage_text, a... |
import albumentations as A
from albumentations.pytorch.transforms import ToTensorV2
from .petrel import PetrelDataset
from .train_data import TrainDataset
from .val_data import ValDataset
BBOX = A.BboxParams(
format='pascal_voc',
min_area=0,
min_visibility=0,
label_fields=['labels'])
def get_default... | [
"albumentations.BboxParams",
"albumentations.Resize",
"albumentations.pytorch.transforms.ToTensorV2"
] | [((197, 289), 'albumentations.BboxParams', 'A.BboxParams', ([], {'format': '"""pascal_voc"""', 'min_area': '(0)', 'min_visibility': '(0)', 'label_fields': "['labels']"}), "(format='pascal_voc', min_area=0, min_visibility=0,\n label_fields=['labels'])\n", (209, 289), True, 'import albumentations as A\n'), ((471, 525)... |
#!/usr/bin/env python
#-*- coding: utf-8 -*-
""" Madxxx processing system
Package for system runtime and production loggers
Copyright EOSS GmbH 2016
"""
import logging
from logging.config import fileConfig
import os
import yaml
from utilities import read_OS_var
__author__ = "<NAME>, <NAME>"
__copyright__ = "Copyr... | [
"logging.getLogger",
"os.path.exists",
"logging.NullHandler",
"logging.config.dictConfig",
"os.path.join",
"os.path.dirname",
"utilities.read_OS_var"
] | [((888, 919), 'os.path.exists', 'os.path.exists', (['log_config_file'], {}), '(log_config_file)\n', (902, 919), False, 'import os\n'), ((1131, 1164), 'logging.getLogger', 'logging.getLogger', (['"""eoss:catalog"""'], {}), "('eoss:catalog')\n", (1148, 1164), False, 'import logging\n'), ((1300, 1338), 'logging.getLogger'... |
#!/usr/bin/env python3
# Forwards messages received from the serial port to MQTT.
#
# Serial messages are expected to be formatted as follows:
# * <topic> <payload>\n
# * any line starting with a '#' is ignored
#
# This program has the following dependencies, which can installed as follows
# * serial: 'apt... | [
"logging.basicConfig",
"argparse.ArgumentParser",
"serial.Serial",
"paho.mqtt.publish.single",
"logging.info"
] | [((1386, 1488), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO', 'format': '"""%(relativeCreated)6d %(threadName)s %(message)s"""'}), "(level=logging.INFO, format=\n '%(relativeCreated)6d %(threadName)s %(message)s')\n", (1405, 1488), False, 'import logging\n'), ((1498, 1523), 'argparse.A... |
#!/usr/bin/env python2
from pwn import *
from struct import pack,unpack
FREE_GOT_PLT = 0x601EF0
STRLEN_GOT_PLT = 0x601F00
FREE_OFFSET = 0x7c600
SYSTEM_OFFSET = 0x41490
r = remote("shell2017.picoctf.com", 8708)
r.send("09-24-2018 0\n")
r.send("~09-24-2018\n")
payload = pack("<Q",FREE_GOT_PLT)+pack("<Q",24)+pack("<Q",2)+... | [
"struct.pack"
] | [((333, 346), 'struct.pack', 'pack', (['"""<Q"""', '(0)'], {}), "('<Q', 0)\n", (337, 346), False, 'from struct import pack, unpack\n'), ((639, 652), 'struct.pack', 'pack', (['"""<Q"""', '(0)'], {}), "('<Q', 0)\n", (643, 652), False, 'from struct import pack, unpack\n'), ((320, 333), 'struct.pack', 'pack', (['"""<Q"""',... |
import abc
from timeit import default_timer as timer
from .solution import Solution
class Algorithm:
def __init__(self, inst, solution_class):
self.inst = inst
self.sol = solution_class(inst.size)
def solve(self):
conf = self.sol.conf
start = timer()
self._solve(conf, ... | [
"timeit.default_timer"
] | [((286, 293), 'timeit.default_timer', 'timer', ([], {}), '()\n', (291, 293), True, 'from timeit import default_timer as timer\n'), ((343, 350), 'timeit.default_timer', 'timer', ([], {}), '()\n', (348, 350), True, 'from timeit import default_timer as timer\n')] |
import numpy.testing as npt
from handyspark import *
# boolean returns
def test_between(sdf, pdf):
hdf = sdf.toHandy()
hdf = hdf.assign(newcol=hdf.pandas['Age'].between(left=20, right=40))
hres = hdf.cols['newcol'][:20]
res = pdf['Age'].between(left=20, right=40)[:20]
npt.assert_array_equal(hres, r... | [
"numpy.testing.assert_array_equal"
] | [((290, 323), 'numpy.testing.assert_array_equal', 'npt.assert_array_equal', (['hres', 'res'], {}), '(hres, res)\n', (312, 323), True, 'import numpy.testing as npt\n'), ((530, 563), 'numpy.testing.assert_array_equal', 'npt.assert_array_equal', (['hres', 'res'], {}), '(hres, res)\n', (552, 563), True, 'import numpy.testi... |
#################################################################################################################
#### GUI Interface for users
#################################################################################################################
from tkinter import *
import tkinter as tk
import tkinter.messa... | [
"sklearn.preprocessing.StandardScaler",
"numpy.array",
"tkinter.messagebox.showinfo",
"keras.models.load_model"
] | [((11493, 11615), 'numpy.array', 'np.array', (['[[i2, i1, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16,\n i17, i18, i19, i20, i21, i22, i23]]'], {}), '([[i2, i1, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15,\n i16, i17, i18, i19, i20, i21, i22, i23]])\n', (11501, 11615), True, 'import... |
from pymongo import MongoClient
from pymongo.database import Database
import requests
import json
import schedule
import datetime
import os
from tweet import Tweet
from threading import Thread
now = datetime.datetime.now()
CUR_TIMESTAMP = int(datetime.datetime(year=now.year, month=now.month, day=now.day, hour=now.ho... | [
"datetime.datetime",
"json.loads",
"schedule.run_pending",
"requests.request",
"datetime.datetime.now",
"schedule.every",
"pymongo.MongoClient",
"threading.Thread"
] | [((202, 225), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (223, 225), False, 'import datetime\n'), ((886, 944), 'requests.request', 'requests.request', (['"""GET"""', 'url'], {'headers': 'headers', 'stream': '(True)'}), "('GET', url, headers=headers, stream=True)\n", (902, 944), False, 'import r... |
import re
#from random import randrange
from model.contact import Contact
def test_contact_all(app, db):
ui_list = app.contact.get_contact_list()
def clean(contact):
return Contact(id=contact.id, name=contact.name.strip(), surname=contact.surname.strip(), address=contact.address,
... | [
"re.sub"
] | [((1401, 1424), 're.sub', 're.sub', (['"""[() -]"""', '""""""', 's'], {}), "('[() -]', '', s)\n", (1407, 1424), False, 'import re\n'), ((1459, 1479), 're.sub', 're.sub', (['"""[ ]"""', '""""""', 's'], {}), "('[ ]', '', s)\n", (1465, 1479), False, 'import re\n')] |
'''
BSD 3-Clause License
Copyright (c) 2020, <NAME>, <NAME>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of con... | [
"PIL.Image.open",
"numpy.sqrt",
"numpy.power",
"os.path.join",
"cv2.filter2D",
"numpy.squeeze",
"numpy.array",
"numpy.linspace",
"numpy.outer",
"numpy.zeros",
"numpy.dot",
"numpy.rot90",
"numpy.zeros_like"
] | [((4385, 4427), 'numpy.linspace', 'np.linspace', (['(-(size // 2))', '(size // 2)', 'size'], {}), '(-(size // 2), size // 2, size)\n', (4396, 4427), True, 'import numpy as np\n'), ((4669, 4711), 'numpy.outer', 'np.outer', (['self.kernel_1d.T', 'self.kernel_1d'], {}), '(self.kernel_1d.T, self.kernel_1d)\n', (4677, 4711)... |
#!/usr/bin/python
import unittest
import extractor.tumblr_post as extractor
class TumblrPostTestCase(unittest.TestCase):
# noinspection SpellCheckingInspection
def test_extract_tumblr_image_links(self):
# test single image
self.assertEqual(extractor.extract_tumblr_images("kiminukii", '65601520... | [
"extractor.tumblr_post.extract_tumblr_images"
] | [((266, 332), 'extractor.tumblr_post.extract_tumblr_images', 'extractor.extract_tumblr_images', (['"""kiminukii"""', '"""656015203710976000"""'], {}), "('kiminukii', '656015203710976000')\n", (297, 332), True, 'import extractor.tumblr_post as extractor\n'), ((601, 667), 'extractor.tumblr_post.extract_tumblr_images', 'e... |
"""
SQLAlchemy models and utility functions for Twitoff Application
"""
from flask_sqlalchemy import SQLAlchemy
DB = SQLAlchemy()
class User(DB.Model):
"""
Twitter User Table that will correspond to tweets - SQLAlchemy syntax
"""
id= DB.Column(DB.BigInteger, primary_key = True) # id column (primary k... | [
"flask_sqlalchemy.SQLAlchemy"
] | [((119, 131), 'flask_sqlalchemy.SQLAlchemy', 'SQLAlchemy', ([], {}), '()\n', (129, 131), False, 'from flask_sqlalchemy import SQLAlchemy\n')] |
import pandas as pd
from sklearn.model_selection import train_test_split
from dimensionality_reduction.LDA import *
from dimensionality_reduction.PCA import *
import matplotlib.pyplot as plt
print("DIABETES")
data = pd.read_csv('datasets/4-diabetes/pima-indians-diabetes.data', header=None)
labels = data[8].values ... | [
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.subplots",
"pandas.read_csv",
"matplotlib.pyplot.show"
] | [((218, 292), 'pandas.read_csv', 'pd.read_csv', (['"""datasets/4-diabetes/pima-indians-diabetes.data"""'], {'header': 'None'}), "('datasets/4-diabetes/pima-indians-diabetes.data', header=None)\n", (229, 292), True, 'import pandas as pd\n'), ((499, 535), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(1)', '(2)'], {'f... |
from rest_framework import serializers
from account.models import Account
class RegistrationSerializer(serializers.ModelSerializer):
password2 = serializers.CharField(style={'input_type': 'password'}, write_only=True)
class Meta:
model = Account
fields = ['email', 'username', 'password', '<PA... | [
"rest_framework.serializers.ValidationError",
"rest_framework.serializers.CharField",
"account.models.Account"
] | [((151, 223), 'rest_framework.serializers.CharField', 'serializers.CharField', ([], {'style': "{'input_type': 'password'}", 'write_only': '(True)'}), "(style={'input_type': 'password'}, write_only=True)\n", (172, 223), False, 'from rest_framework import serializers\n'), ((1298, 1334), 'rest_framework.serializers.CharFi... |
import unittest
from tests.availability import curio_available
if curio_available:
import curio
from garage.threads import actors
from garage.asyncs.actors import StubAdapter
from garage.asyncs.utils import synchronous
else:
def synchronous(func):
return func
@unittest.skipUnless(curio_a... | [
"unittest.main",
"curio.timeout_after",
"garage.threads.actors.build",
"unittest.skipUnless"
] | [((293, 350), 'unittest.skipUnless', 'unittest.skipUnless', (['curio_available', '"""curio unavailable"""'], {}), "(curio_available, 'curio unavailable')\n", (312, 350), False, 'import unittest\n'), ((1048, 1063), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1061, 1063), False, 'import unittest\n'), ((643, 681)... |
"""
Binning a particles STAR file
Input: - The particles STAR file
- Binning parameters
Output: - A new STAR file with binned particle subvolumes
"""
__author__ = '<NAME>'
###### Global variables
################# Package import
import os
import sys
import time
import pyseg as ps
from ... | [
"time.strftime",
"pyseg.sub.Star",
"sys.exit"
] | [((2266, 2279), 'pyseg.sub.Star', 'ps.sub.Star', ([], {}), '()\n', (2277, 2279), True, 'import pyseg as ps\n'), ((2513, 2525), 'sys.exit', 'sys.exit', (['(-1)'], {}), '(-1)\n', (2521, 2525), False, 'import sys\n'), ((2862, 2874), 'sys.exit', 'sys.exit', (['(-1)'], {}), '(-1)\n', (2870, 2874), False, 'import sys\n'), ((... |
import os
def data_info(type='train'):
dataset_directory = '../../../EgoGesture Dataset/'
folder_names = ['SingleOne', 'SingleTwo', 'SingleThree', 'SingleFour', 'SingleFive', 'SingleSix', 'SingleSeven',
'SingleEight']
if type is 'train':
nTrain = 0
for folder in folder... | [
"os.listdir"
] | [((362, 406), 'os.listdir', 'os.listdir', (["(dataset_directory + folder + '/')"], {}), "(dataset_directory + folder + '/')\n", (372, 406), False, 'import os\n'), ((546, 590), 'os.listdir', 'os.listdir', (["(dataset_directory + folder + '/')"], {}), "(dataset_directory + folder + '/')\n", (556, 590), False, 'import os\... |
from django.shortcuts import render, redirect
from .models import Song, Album, Artist, Profile
from django.contrib.auth.models import User
from django.contrib import auth
from django.contrib.auth import authenticate
from django.contrib.auth.decorators import login_required
from django.core.files.storage import FileSyst... | [
"django.shortcuts.render",
"django.contrib.auth.authenticate",
"django.contrib.messages.error",
"django.contrib.auth.login",
"django.shortcuts.redirect",
"django.contrib.auth.models.User.objects.get",
"django.contrib.auth.models.User.objects.create_user",
"django.contrib.auth.logout"
] | [((1166, 1205), 'django.shortcuts.render', 'render', (['request', '"""create.html"""', 'context'], {}), "(request, 'create.html', context)\n", (1172, 1205), False, 'from django.shortcuts import render, redirect\n'), ((2986, 3015), 'django.shortcuts.render', 'render', (['request', '"""Login.html"""'], {}), "(request, 'L... |
# 어휘 사전과 워드 임베딩을 만들고, 학습을 위해 대화 데이터를 읽어들이는 유틸리티들의 모음
import tensorflow as tf
import numpy as np
import re
import codecs
from config import FLAGS
class Dialog():
_PAD_ = "_PAD_" # 빈칸 채우는 심볼
_STA_ = "_STA_" # 디코드 입력 시퀀스의 시작 심볼
_EOS_ = "_EOS_" # 디코드 입출력 시퀀스의 종료 심볼
_UNK_ = "_UNK_" # 사전에 없는 단어를 나타내는 ... | [
"numpy.eye",
"re.compile",
"tensorflow.app.run"
] | [((6255, 6267), 'tensorflow.app.run', 'tf.app.run', ([], {}), '()\n', (6265, 6267), True, 'import tensorflow as tf\n'), ((4594, 4623), 're.compile', 're.compile', (['"""([.,!?"\':;)(])"""'], {}), '(\'([.,!?"\\\':;)(])\')\n', (4604, 4623), False, 'import re\n'), ((2543, 2566), 'numpy.eye', 'np.eye', (['self.vocab_size']... |
import pytest
from six.moves import range as _range
from flytekit.common.exceptions import user as _user_exceptions
from flytekit.common.types import containers, primitives
from flytekit.models import literals
from flytekit.models import types as literal_types
def test_list():
list_type = containers.List(primiti... | [
"flytekit.common.types.primitives.Integer",
"flytekit.common.types.containers.List",
"six.moves.range",
"pytest.raises",
"flytekit.models.literals.Primitive"
] | [((297, 332), 'flytekit.common.types.containers.List', 'containers.List', (['primitives.Integer'], {}), '(primitives.Integer)\n', (312, 332), False, 'from flytekit.common.types import containers, primitives\n'), ((2114, 2148), 'flytekit.common.types.containers.List', 'containers.List', (['primitives.String'], {}), '(pr... |
"""Module that inserts to database the values collected from the other files"""
from mysql.connector import connect, Error
def connections():
"""
Opens two files and drops their content
into a database.
Args:
f: file, file with post text, open for reading
f_tags: file, file with the t... | [
"mysql.connector.connect"
] | [((807, 896), 'mysql.connector.connect', 'connect', ([], {'host': '"""localhost"""', 'user': '"""mic"""', 'password': '"""<PASSWORD>"""', 'database': '"""micro_diary"""'}), "(host='localhost', user='mic', password='<PASSWORD>', database=\n 'micro_diary')\n", (814, 896), False, 'from mysql.connector import connect, E... |
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under ... | [
"models.encode_inputs",
"os.path.exists",
"nnabla.functions.randn",
"models.SpadeGenerator",
"nnabla.functions.one_hot",
"nnabla.functions.transpose",
"argparse.ArgumentParser",
"os.makedirs",
"nnabla.utils.image_utils.imsave",
"os.path.join",
"nnabla.load_parameters",
"nnabla.functions.concat... | [((846, 871), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (869, 871), False, 'import argparse\n'), ((1407, 1440), 'os.path.dirname', 'os.path.dirname', (['args.load_params'], {}), '(args.load_params)\n', (1422, 1440), False, 'import os\n'), ((3193, 3219), 'numpy.random.RandomState', 'np.rand... |
# this project is licensed under the WTFPLv2, see COPYING.txt for details
"""Path manipulation utilities
"""
import glob
import os
import re
__all__ = ('parseFilename', 'findAncestorContaining', 'findInAncestors',
'getCommonPrefix', 'getRelativePathIn', 'isIn',
'getConfigPath', 'getConfigFileP... | [
"os.path.exists",
"os.path.join",
"os.path.normpath",
"os.path.dirname",
"os.path.sep.join",
"os.path.isdir",
"os.path.basename",
"os.path.abspath",
"os.path.expanduser",
"re.search"
] | [((773, 813), 're.search', 're.search', (['"""(:\\\\d+)?(:\\\\d+)?$"""', 'filepath'], {}), "('(:\\\\d+)?(:\\\\d+)?$', filepath)\n", (782, 813), False, 'import re\n'), ((1617, 1638), 'os.path.abspath', 'os.path.abspath', (['path'], {}), '(path)\n', (1632, 1638), False, 'import os\n'), ((3472, 3491), 'os.path.join', 'os.... |
"""This file should probably be split into basic & per protocol accounting test files if too big"""
import pytest
from rotkehlchen.accounting.ledger_actions import LedgerAction, LedgerActionType
from rotkehlchen.accounting.mixins.event import AccountingEventType
from rotkehlchen.accounting.pnl import PNL, PnlTotals
f... | [
"rotkehlchen.tests.utils.accounting.check_pnls_and_csv",
"rotkehlchen.tests.utils.accounting.accounting_history_process",
"rotkehlchen.tests.utils.messages.no_message_errors",
"rotkehlchen.types.Timestamp",
"rotkehlchen.fval.FVal",
"pytest.mark.parametrize",
"rotkehlchen.tests.utils.factories.make_ether... | [((1020, 1077), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""mocked_price_queries"""', '[prices]'], {}), "('mocked_price_queries', [prices])\n", (1043, 1077), False, 'import pytest\n'), ((2235, 2292), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""mocked_price_queries"""', '[prices]'], {}), ... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2019 <NAME> <<EMAIL>>
# All rights reserved.
#
# This code is licensed under the MIT License.
#
# 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 withou... | [
"requests.post",
"json.dumps"
] | [((4191, 4205), 'json.dumps', 'dumps', (['payload'], {}), '(payload)\n', (4196, 4205), False, 'from json import dumps\n'), ((4890, 4904), 'json.dumps', 'dumps', (['payload'], {}), '(payload)\n', (4895, 4904), False, 'from json import dumps\n'), ((5912, 6009), 'requests.post', 'requests.post', (['url'], {'data': 'payloa... |
from .animal import AnimalSerializer
from crowdbotics_test.animal.models import Dog
class DogSerializer(AnimalSerializer):
def create(self, validated_data):
return Dog.objects.create(**validated_data)
def update(self, instance, validated_data):
instance.name = validated_data.get('name', inst... | [
"crowdbotics_test.animal.models.Dog.objects.create"
] | [((179, 215), 'crowdbotics_test.animal.models.Dog.objects.create', 'Dog.objects.create', ([], {}), '(**validated_data)\n', (197, 215), False, 'from crowdbotics_test.animal.models import Dog\n')] |
from guizero import App, Text
a = App()
a.font = "courier new"
t1 = Text(a)
t1.value = "{}, {}, {}".format(t1.font, t1.text_size, t1.text_color)
t2 = Text(a, font="arial")
t2.value = "{}, {}, {}".format(t2.font, t2.text_size, t2.text_color)
t3 = Text(a, color="red", size=8, font="verdana")
t3.value = "{}, {}, {}".f... | [
"guizero.Text",
"guizero.App"
] | [((35, 40), 'guizero.App', 'App', ([], {}), '()\n', (38, 40), False, 'from guizero import App, Text\n'), ((70, 77), 'guizero.Text', 'Text', (['a'], {}), '(a)\n', (74, 77), False, 'from guizero import App, Text\n'), ((153, 174), 'guizero.Text', 'Text', (['a'], {'font': '"""arial"""'}), "(a, font='arial')\n", (157, 174),... |
laptops = {
"HP" : "4 ram",
"Apple" : 5,
"Dell" : 3,
"Samsung" : 7,
'cats' : ['56', 56],
"dictionary" : {
'cats':56,
'Pull': 'Request'
}
}
from json import dumps
print(dumps(laptops, indent = 4))
for key, value in laptops.items() :
print(key, value)
for value in lapt... | [
"json.dumps"
] | [((215, 239), 'json.dumps', 'dumps', (['laptops'], {'indent': '(4)'}), '(laptops, indent=4)\n', (220, 239), False, 'from json import dumps\n'), ((378, 400), 'json.dumps', 'dumps', (['value'], {'indent': '(4)'}), '(value, indent=4)\n', (383, 400), False, 'from json import dumps\n')] |
import json
import os
from commons.aws.dynamodb_helper import get_element_from_table
from commons.logger import logged, logger
from commons.decimal_encoder import DecimalEncoder
from dynamodb_json import json_util as json_d
DYNAMO_TABLE = os.environ['DYNAMODB_INFORMATION']
@logged(truncate_long_messages=False)
def r... | [
"commons.logger.logged",
"json.dumps",
"commons.aws.dynamodb_helper.get_element_from_table",
"dynamodb_json.json_util.loads"
] | [((278, 314), 'commons.logger.logged', 'logged', ([], {'truncate_long_messages': '(False)'}), '(truncate_long_messages=False)\n', (284, 314), False, 'from commons.logger import logged, logger\n'), ((723, 775), 'commons.aws.dynamodb_helper.get_element_from_table', 'get_element_from_table', (['DYNAMO_TABLE', 'information... |
from abc import ABC, abstractmethod
from argparse import ArgumentParser
from pathlib import Path
from typing import List, Dict
import numpy as np
class DataSource(ABC):
def __init__(self, input_file: Path, args: ArgumentParser):
self.input = Path(input_file)
self.args = args
if not self.i... | [
"pathlib.Path"
] | [((257, 273), 'pathlib.Path', 'Path', (['input_file'], {}), '(input_file)\n', (261, 273), False, 'from pathlib import Path\n')] |
from collections import defaultdict
def solve(v):
chop_l = defaultdict(int)
chop_r = defaultdict(int)
for i in sorted(v, reverse=True):
L = i[0]
R = i[1]
side = i[2]
if side == 0:
chop_l[L] = max(chop_l[L], chop_l[R] + (R - L))
for i in sorted(v):
... | [
"collections.defaultdict"
] | [((65, 81), 'collections.defaultdict', 'defaultdict', (['int'], {}), '(int)\n', (76, 81), False, 'from collections import defaultdict\n'), ((95, 111), 'collections.defaultdict', 'defaultdict', (['int'], {}), '(int)\n', (106, 111), False, 'from collections import defaultdict\n')] |
"""Return text streams to EDAM data.
Keep parsing and such to minimum to maintain maximum backward compatibility.
"""
from importlib.resources import open_text
from typing import TextIO
def tabular_stream() -> TextIO:
"""Yield EDAM data in TSV format as a Python UTF-8 encoded text stream."""
return open_text... | [
"importlib.resources.open_text"
] | [((311, 345), 'importlib.resources.open_text', 'open_text', (['"""edam_data"""', '"""EDAM.tsv"""'], {}), "('edam_data', 'EDAM.tsv')\n", (320, 345), False, 'from importlib.resources import open_text\n')] |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('desafio', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Teleconsultor',
fields=[
... | [
"django.db.models.DateField",
"django.db.models.AutoField",
"django.db.models.CharField",
"django.db.models.IntegerField"
] | [((342, 435), 'django.db.models.AutoField', 'models.AutoField', ([], {'serialize': '(False)', 'verbose_name': '"""ID"""', 'primary_key': '(True)', 'auto_created': '(True)'}), "(serialize=False, verbose_name='ID', primary_key=True,\n auto_created=True)\n", (358, 435), False, 'from django.db import models, migrations\... |
from setuptools import setup, find_packages
import Spreadsheet.HTML
setup(
name='Spreadsheet-HTML',
version=Spreadsheet.HTML.__version__,
description='Just another HTML table generator (for Python)',
author='<NAME>',
author_email='<EMAIL>',
url='https://github.com/jeffa/Spreadsheet-HTML-python'... | [
"setuptools.find_packages"
] | [((359, 410), 'setuptools.find_packages', 'find_packages', ([], {'exclude': "['contrib', 'docs', 'tests']"}), "(exclude=['contrib', 'docs', 'tests'])\n", (372, 410), False, 'from setuptools import setup, find_packages\n')] |
import logging
import sys
from enum import Enum
class LogLevel(Enum):
CONSOLE = 0
LOGGING = 1
def __str__(self):
return self.name.lower()
@staticmethod
def from_string(s: str):
s = s.upper()
if s in LogLevel._member_map_:
return LogLevel[s]
raise Value... | [
"logging.getLogger",
"logging.Formatter",
"logging.StreamHandler",
"logging.FileHandler"
] | [((717, 740), 'logging.getLogger', 'logging.getLogger', (['name'], {}), '(name)\n', (734, 740), False, 'import logging\n'), ((904, 944), 'logging.FileHandler', 'logging.FileHandler', (['log_file'], {'mode': '"""w+"""'}), "(log_file, mode='w+')\n", (923, 944), False, 'import logging\n'), ((972, 1015), 'logging.Formatter... |
'''Setup: loss functions used for training and evaluation.'''
## Internal modules.
from mml.losses.classification import Zero_One
from mml.losses.logistic import Logistic
from mml.losses.quadratic import Quadratic
###############################################################################
## A dictionary of in... | [
"mml.losses.classification.Zero_One",
"mml.losses.logistic.Logistic",
"mml.losses.quadratic.Quadratic"
] | [((372, 382), 'mml.losses.logistic.Logistic', 'Logistic', ([], {}), '()\n', (380, 382), False, 'from mml.losses.logistic import Logistic\n'), ((401, 412), 'mml.losses.quadratic.Quadratic', 'Quadratic', ([], {}), '()\n', (410, 412), False, 'from mml.losses.quadratic import Quadratic\n'), ((430, 440), 'mml.losses.classif... |
# coding:utf-8
# description ...
# <EMAIL> | 2019.08.01
import os
import sys
import lib
reload(lib)
from Qt import QtGui, QtWidgets, QtCore
# in maya2016 PySide, Chinese characters display in garbage characters
try:
QtCore.QTextCodec.setCodecForTr(QtCore.QTextCodec.codecForName("UTF-8"))
except:
pass
import ... | [
"lib.getMayaMainWindow",
"Qt.QtCore.QTextCodec.codecForName"
] | [((254, 293), 'Qt.QtCore.QTextCodec.codecForName', 'QtCore.QTextCodec.codecForName', (['"""UTF-8"""'], {}), "('UTF-8')\n", (284, 293), False, 'from Qt import QtGui, QtWidgets, QtCore\n'), ((1422, 1445), 'lib.getMayaMainWindow', 'lib.getMayaMainWindow', ([], {}), '()\n', (1443, 1445), False, 'import lib\n')] |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
def execute(filters=None):
columns = [
_("Item") + ":Link/Item:100",
_("Item Name") + "::130",
... | [
"frappe._"
] | [((255, 264), 'frappe._', '_', (['"""Item"""'], {}), "('Item')\n", (256, 264), False, 'from frappe import _\n'), ((293, 307), 'frappe._', '_', (['"""Item Name"""'], {}), "('Item Name')\n", (294, 307), False, 'from frappe import _\n'), ((327, 342), 'frappe._', '_', (['"""Item Group"""'], {}), "('Item Group')\n", (328, 3... |
#!/usr/bin/python3
from fastapi import FastAPI, Request
from starlette.responses import HTMLResponse
from fastapi.staticfiles import StaticFiles
from fastapi.templating import Jinja2Templates
# import locale files
from models import models
from data.database import engine
# import router files
from core.cart import ... | [
"fastapi.staticfiles.StaticFiles",
"fastapi.FastAPI",
"models.models.Base.metadata.create_all",
"fastapi.templating.Jinja2Templates"
] | [((493, 537), 'models.models.Base.metadata.create_all', 'models.Base.metadata.create_all', ([], {'bind': 'engine'}), '(bind=engine)\n', (524, 537), False, 'from models import models\n'), ((567, 682), 'fastapi.FastAPI', 'FastAPI', ([], {'title': '"""Apollo - Auth"""', 'description': '"""A basic Application with multiple... |
#!/usr/bin/env python3
#
# Copyright 2019 <NAME> <<EMAIL>>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This p... | [
"os.makedirs",
"os.path.exists",
"csv.DictReader",
"argparse.ArgumentParser"
] | [((4853, 4964), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Send an email to people who stopped by the Outreachy booth at Tapia"""'}), "(description=\n 'Send an email to people who stopped by the Outreachy booth at Tapia')\n", (4876, 4964), False, 'import argparse\n'), ((5163, 5190... |
import random
import copy
class PuzzleNode:
def __init__(self, node_state, parent=None, depth=0):
self.node_state = node_state
self.parent = parent
self.depth = depth
self.dimension = int((len(node_state) - 1)**0.5)
self.value = 0
if self.dimension ** 2 + 1 != len(no... | [
"copy.deepcopy"
] | [((12347, 12379), 'copy.deepcopy', 'copy.deepcopy', (['self.row_adjacent'], {}), '(self.row_adjacent)\n', (12360, 12379), False, 'import copy\n'), ((12456, 12488), 'copy.deepcopy', 'copy.deepcopy', (['self.col_adjacent'], {}), '(self.col_adjacent)\n', (12469, 12488), False, 'import copy\n')] |
from __future__ import print_function
import os
import cv2
import argparse
parser = argparse.ArgumentParser(description='Process video with ANN')
parser.add_argument('filepath', action='store', help='Path to video file to process')
args = parser.parse_args()
def parse_file():
img_ref = cv2.imread(args.filepath)
... | [
"argparse.ArgumentParser",
"os.path.splitext",
"cv2.imshow",
"cv2.waitKey",
"cv2.imread"
] | [((86, 147), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Process video with ANN"""'}), "(description='Process video with ANN')\n", (109, 147), False, 'import argparse\n'), ((294, 319), 'cv2.imread', 'cv2.imread', (['args.filepath'], {}), '(args.filepath)\n', (304, 319), False, 'import... |
# Generated by Django 2.1.3 on 2019-01-29 22:19
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('brumadinho', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='FoundPeople',
... | [
"django.db.migrations.AlterUniqueTogether",
"django.db.models.ForeignKey",
"django.db.models.IntegerField",
"django.db.models.AutoField",
"django.db.models.DateTimeField",
"django.db.models.CharField"
] | [((1957, 2057), 'django.db.migrations.AlterUniqueTogether', 'migrations.AlterUniqueTogether', ([], {'name': '"""geolocation"""', 'unique_together': "{('latitude', 'longitude')}"}), "(name='geolocation', unique_together={(\n 'latitude', 'longitude')})\n", (1987, 2057), False, 'from django.db import migrations, models... |
#!/usr/bin/env python
import ipdb
import sys
import rospy
import moveit_commander as mc
from birl_ur5_assembly_experiment.moveit_vars_getter import get_moveit_vars
from birl_ur5_assembly_experiment import hardcoded_data as hd
if __name__ == '__main__':
mc.roscpp_initialize(sys.argv)
rospy.init_node("ur_go_hom... | [
"moveit_commander.roscpp_shutdown",
"rospy.init_node",
"birl_ur5_assembly_experiment.moveit_vars_getter.get_moveit_vars",
"moveit_commander.roscpp_initialize",
"rospy.sleep"
] | [((258, 288), 'moveit_commander.roscpp_initialize', 'mc.roscpp_initialize', (['sys.argv'], {}), '(sys.argv)\n', (278, 288), True, 'import moveit_commander as mc\n'), ((294, 339), 'rospy.init_node', 'rospy.init_node', (['"""ur_go_home"""'], {'anonymous': '(True)'}), "('ur_go_home', anonymous=True)\n", (309, 339), False,... |
#!/usr/bin/env python3
import re
if __name__ == "__main__":
string = input()
match = re.search(r'([a-zA-Z0-9])\1+', string)
print(match.group(1) if match else -1)
| [
"re.search"
] | [((100, 138), 're.search', 're.search', (['"""([a-zA-Z0-9])\\\\1+"""', 'string'], {}), "('([a-zA-Z0-9])\\\\1+', string)\n", (109, 138), False, 'import re\n')] |
# -*- coding:utf-8 -*-
"""
:author: <NAME>
:copyright: © 2019 <NAME>
:time: 2019/12/15 14:27
"""
from app import create_app
app = create_app()
if __name__ == "__main__":
app.run(host="127.0.0.1", port="5000")
| [
"app.create_app"
] | [((144, 156), 'app.create_app', 'create_app', ([], {}), '()\n', (154, 156), False, 'from app import create_app\n')] |
"""
Pytorch dataset for use on dataloaders
"""
import os
import cv2
import torch
import copy
import numpy as np
import pandas as pd
from torch.utils.data import Dataset
from preprocess.preprocess import propose_regions, calculate_iou
from pdb import set_trace as bp
class ImageDataset(Dataset):
"""
Custom Datas... | [
"preprocess.preprocess.propose_regions",
"pandas.read_csv",
"os.path.join",
"torch.from_numpy",
"pdb.set_trace",
"copy.deepcopy",
"preprocess.preprocess.calculate_iou",
"cv2.imread"
] | [((3785, 3789), 'pdb.set_trace', 'bp', ([], {}), '()\n', (3787, 3789), True, 'from pdb import set_trace as bp\n'), ((818, 846), 'pandas.read_csv', 'pd.read_csv', (['annotation_file'], {}), '(annotation_file)\n', (829, 846), True, 'import pandas as pd\n'), ((1221, 1273), 'os.path.join', 'os.path.join', (['self.data_dir'... |
import logging
from abc import ABCMeta, abstractmethod
from collections import defaultdict
from typing import List, Set, Union, Tuple, Any
from ontobio import Ontology
from ontobio.assocmodel import AssociationSet
from genedescriptions.commons import CommonAncestor, TrimmingResult
from genedescriptions.ontology_tools... | [
"logging.getLogger",
"genedescriptions.ontology_tools.get_all_common_ancestors",
"genedescriptions.optimization.find_set_covering",
"collections.defaultdict"
] | [((466, 493), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (483, 493), False, 'import logging\n'), ((4853, 4966), 'genedescriptions.ontology_tools.get_all_common_ancestors', 'get_all_common_ancestors', ([], {'node_ids': 'node_ids', 'ontology': 'self.ontology', 'nodeids_blacklist': 'self... |
"""
Goal - Calculate distance travelled by each fish
Date - Mar 11 2021
"""
import os
import pathlib
from pprint import pprint
import numpy as np
from scipy import stats
from scipy.spatial import distance
import matplotlib.pyplot as plt
from matplotlib.pyplot import figure
import trajectorytools as tt
import trajec... | [
"pandas.read_csv",
"csv.writer",
"numpy.nanmean",
"numpy.linalg.norm",
"trajectorytools.Trajectories.from_idtrackerai"
] | [((2854, 2919), 'pandas.read_csv', 'pd.read_csv', (['"""../../data/temp_collective/roi/metadata_w_loom.csv"""'], {}), "('../../data/temp_collective/roi/metadata_w_loom.csv')\n", (2865, 2919), True, 'import pandas as pd\n'), ((687, 713), 'numpy.linalg.norm', 'np.linalg.norm', (['v'], {'axis': '(-1)'}), '(v, axis=-1)\n',... |
#!/usr/bin/env python
import os
import random
# download dataset
print('downloading graph dataset...')
os.system('wget https://snap.stanford.edu/data/soc-pokec-relationships.txt.gz')
os.system('gunzip soc-pokec-relationships.txt.gz')
# reformat and shuffle
print('re-formating and shuffling graph dataset...')
node_siz... | [
"os.system",
"random.shuffle"
] | [((104, 183), 'os.system', 'os.system', (['"""wget https://snap.stanford.edu/data/soc-pokec-relationships.txt.gz"""'], {}), "('wget https://snap.stanford.edu/data/soc-pokec-relationships.txt.gz')\n", (113, 183), False, 'import os\n'), ((184, 234), 'os.system', 'os.system', (['"""gunzip soc-pokec-relationships.txt.gz"""... |
__author__ = "<NAME>"
import json, os
from stdnet import odm
from aristotle.settings import PROJECT_HOME
from aristotle.settings import ANNOTATION_REDIS, AUTHORITY_REDIS, CREATIVE_WORK_REDIS, INSTANCE_REDIS
SCHEMA_RDFS = json.load(open(os.path.join(PROJECT_HOME,
'schema_org',... | [
"stdnet.odm.FloatField",
"stdnet.odm.SymbolField",
"stdnet.odm.SetField",
"stdnet.odm.DateField",
"stdnet.odm.ListField",
"stdnet.odm.ForeignField",
"os.path.join",
"stdnet.odm.CharField",
"stdnet.odm.ManyToManyField",
"stdnet.odm.BooleanField"
] | [((599, 617), 'stdnet.odm.ForeignField', 'odm.ForeignField', ([], {}), '()\n', (615, 617), False, 'from stdnet import odm\n'), ((636, 651), 'stdnet.odm.CharField', 'odm.CharField', ([], {}), '()\n', (649, 651), False, 'from stdnet import odm\n'), ((664, 679), 'stdnet.odm.CharField', 'odm.CharField', ([], {}), '()\n', (... |
# _*_ coding: utf-8 _*_
"""
-------------------------------------------------
File Name: skip_gram.py
Description :
Author : ericdoug
date:2021/1/27
-------------------------------------------------
Change Activity:
2021/1/27: created
-------------------------------------------------
"""
from... | [
"tensorflow.train.AdamOptimizer",
"tensorflow.nn.embedding_lookup",
"tensorflow.glorot_uniform_initializer",
"tensorflow.summary.merge_all",
"tensorflow.variable_scope",
"tensorflow.Variable",
"tensorflow.nn.nce_loss",
"tensorflow.train.AdagradOptimizer",
"tensorflow.summary.histogram",
"tensorflo... | [((1071, 1138), 'tensorflow.Variable', 'tf.Variable', (['(0)'], {'dtype': 'tf.int32', 'trainable': '(False)', 'name': '"""global_step"""'}), "(0, dtype=tf.int32, trainable=False, name='global_step')\n", (1082, 1138), True, 'import tensorflow as tf\n'), ((1439, 1466), 'tensorflow.name_scope', 'tf.name_scope', (['"""inpu... |
import discord
import os
from discord.ext import commands
class RaavaApp(commands.Bot):
def __init__(self):
# Command Prefix for Raava is '+';
# Ex: "+help" -- Runs the "help" command from Raava
super().__init__(command_prefix='+', help_command=None)
# Load Cogs
for fileN... | [
"discord.Streaming",
"os.listdir"
] | [((327, 349), 'os.listdir', 'os.listdir', (['"""src/cogs"""'], {}), "('src/cogs')\n", (337, 349), False, 'import os\n'), ((864, 933), 'discord.Streaming', 'discord.Streaming', ([], {'name': '"""+help"""', 'url': '"""https://www.twitch.tv/RaavaApp"""'}), "(name='+help', url='https://www.twitch.tv/RaavaApp')\n", (881, 93... |
# in this tutorial, you will learn how to use for loop statement in python
import numpy as np
# Aim: We want to print "Hello" 10 times:
# np.arange creates a sequence from 0-9.
# in each loop i is given a number in the sequence (in order)
# the ":" is the beginning of the loop"
# The moment you press enter after t... | [
"numpy.arange"
] | [((774, 790), 'numpy.arange', 'np.arange', (['(0)', '(10)'], {}), '(0, 10)\n', (783, 790), True, 'import numpy as np\n')] |
from graph_db.access.cursor import Cursor
from graph_db.engine.api import EngineAPI
from graph_db.engine.graph_engine import GraphEngine
class GraphDB:
def __init__(self, config_path: str):
self.config_path = config_path
self.graph_engine: EngineAPI = GraphEngine(config_path)
def cursor(self)... | [
"graph_db.access.cursor.Cursor",
"graph_db.engine.graph_engine.GraphEngine"
] | [((274, 298), 'graph_db.engine.graph_engine.GraphEngine', 'GraphEngine', (['config_path'], {}), '(config_path)\n', (285, 298), False, 'from graph_db.engine.graph_engine import GraphEngine\n'), ((337, 362), 'graph_db.access.cursor.Cursor', 'Cursor', (['self.graph_engine'], {}), '(self.graph_engine)\n', (343, 362), False... |
#!/usr/bin/env python3.6
# -*- coding: utf-8 -*-
"""
IO stuff.
"""
import copy
import inspect
import os
__all__ = ('in_here',)
def in_here(first_path_bit: str, *path_bits: str, stack_depth: int=0) -> str:
"""
A somewhat voodooish and weird piece of code. This enables us to
directly refer to a file in th... | [
"inspect.stack",
"inspect.getmodule",
"os.path.join",
"os.path.dirname",
"copy.deepcopy",
"os.path.abspath"
] | [((1641, 1668), 'inspect.getmodule', 'inspect.getmodule', (['frame[0]'], {}), '(frame[0])\n', (1658, 1668), False, 'import inspect\n'), ((2288, 2307), 'copy.deepcopy', 'copy.deepcopy', (['file'], {}), '(file)\n', (2301, 2307), False, 'import copy\n'), ((2353, 2374), 'os.path.dirname', 'os.path.dirname', (['file'], {}),... |
import logging
import configparser
import os
from .mpdscrobble import MPDScrobbleLastFMNetwork, MPDScrobbleNetwork
logger = logging.getLogger(__name__)
def read_config(config_file):
config = configparser.ConfigParser()
config.read(os.path.expanduser(config_file))
return config
def create_network(confi... | [
"logging.getLogger",
"configparser.ConfigParser",
"os.path.expanduser"
] | [((126, 153), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (143, 153), False, 'import logging\n'), ((199, 226), 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {}), '()\n', (224, 226), False, 'import configparser\n'), ((243, 274), 'os.path.expanduser', 'os.path.expanduser... |
#################################################################################
# The Institute for the Design of Advanced Energy Systems Integrated Platform
# Framework (IDAES IP) was produced under the DOE Institute for the
# Design of Advanced Energy Systems (IDAES), and is copyright (c) 2018-2021
# by the softwar... | [
"logging.getLogger",
"pandas.DataFrame",
"numpy.array",
"json.load",
"csv.reader"
] | [((1314, 1341), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1331, 1341), False, 'import logging\n'), ((3757, 3770), 'json.load', 'json.load', (['fp'], {}), '(fp)\n', (3766, 3770), False, 'import json\n'), ((9668, 9699), 'pandas.DataFrame', 'pd.DataFrame', (['a2'], {'columns': 'names'}... |
"""A program that can be run with command line arguments
(a short keyphrase like: agree or busy)
This way the user can have long related text in clipboard,
without having to retype all text.
Usage: python multiclipboard.py [keyphrase]
"""
import sys, pyperclip
TEXT = {
'agree': """I agree, that sounds fine to me."... | [
"pyperclip.copy",
"sys.exit"
] | [((630, 655), 'pyperclip.copy', 'pyperclip.copy', (['TEXT[key]'], {}), '(TEXT[key])\n', (644, 655), False, 'import sys, pyperclip\n'), ((520, 530), 'sys.exit', 'sys.exit', ([], {}), '()\n', (528, 530), False, 'import sys, pyperclip\n'), ((618, 628), 'sys.exit', 'sys.exit', ([], {}), '()\n', (626, 628), False, 'import s... |
"""This is the main file called to run the flask application"""
from dotenv import load_dotenv
from root.factory import create_app
if __name__ == "__main__":
load_dotenv()
app = create_app()
app.run()
| [
"root.factory.create_app",
"dotenv.load_dotenv"
] | [((164, 177), 'dotenv.load_dotenv', 'load_dotenv', ([], {}), '()\n', (175, 177), False, 'from dotenv import load_dotenv\n'), ((188, 200), 'root.factory.create_app', 'create_app', ([], {}), '()\n', (198, 200), False, 'from root.factory import create_app\n')] |
import pytest
from api.base.settings.defaults import API_BASE
from osf_tests.factories import (
AuthUserFactory,
RegionFactory,
InstitutionFactory
)
@pytest.mark.django_db
class TestRegionList:
@pytest.fixture()
def region(self):
return RegionFactory(name='Frankfort', _id='eu-central-1')
... | [
"pytest.fixture",
"osf_tests.factories.InstitutionFactory",
"osf_tests.factories.AuthUserFactory",
"osf_tests.factories.RegionFactory"
] | [((214, 230), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (228, 230), False, 'import pytest\n'), ((326, 342), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (340, 342), False, 'import pytest\n'), ((435, 451), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (449, 451), False, 'import pytest\n'), (... |
import stringExercicio
#questão 6: programa
frase = input("Digite uma frase:") .lower()
resultado = stringExercicio.quantPontuacao(frase)
print(resultado)
| [
"stringExercicio.quantPontuacao"
] | [((102, 139), 'stringExercicio.quantPontuacao', 'stringExercicio.quantPontuacao', (['frase'], {}), '(frase)\n', (132, 139), False, 'import stringExercicio\n')] |
#!/usr/bin/env python3
from gi.repository import Gtk
def color_set(colorbutton):
color = colorbutton.get_rgba()
red = (color.red * 255)
green = (color.green * 255)
blue = (color.blue * 255)
print("Hex: #%02x%02x%02x" % (red, green, blue))
window = Gtk.Window()
window.connect("destroy", Gtk.main... | [
"gi.repository.Gtk.Window",
"gi.repository.Gtk.main",
"gi.repository.Gtk.ColorButton"
] | [((273, 285), 'gi.repository.Gtk.Window', 'Gtk.Window', ([], {}), '()\n', (283, 285), False, 'from gi.repository import Gtk\n'), ((342, 359), 'gi.repository.Gtk.ColorButton', 'Gtk.ColorButton', ([], {}), '()\n', (357, 359), False, 'from gi.repository import Gtk\n'), ((448, 458), 'gi.repository.Gtk.main', 'Gtk.main', ([... |
import typing_extensions, typing
from dispike.creating.models import permissions
class PermissionGenerator(object):
"""A helper that helps you create proper permissions for a slash command."""
def __init__(
self,
restrict_to_role: bool = False,
restrict_to_user: bool = False,
... | [
"dispike.creating.models.permissions.NewApplicationPermission",
"dispike.creating.models.permissions.ApplicationCommandPermissions"
] | [((7998, 8070), 'dispike.creating.models.permissions.NewApplicationPermission', 'permissions.NewApplicationPermission', ([], {'permissions': '_permissions_generated'}), '(permissions=_permissions_generated)\n', (8034, 8070), False, 'from dispike.creating.models import permissions\n'), ((7105, 7288), 'dispike.creating.m... |
from server.models import PluginScriptRow
import sal.plugin
class ARDInfo(sal.plugin.DetailPlugin):
description = "Apple Remote Desktop's Computer Information Fields"
supported_os_families = [sal.plugin.OSFamilies.darwin]
def get_context(self, machine, **kwargs):
context = self.super_get_conte... | [
"server.models.PluginScriptRow.objects.filter"
] | [((455, 572), 'server.models.PluginScriptRow.objects.filter', 'PluginScriptRow.objects.filter', ([], {'submission__machine': 'machine', 'submission__plugin': '"""ARD_Info"""', 'pluginscript_name': 'key'}), "(submission__machine=machine,\n submission__plugin='ARD_Info', pluginscript_name=key)\n", (485, 572), False, '... |