code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
# -*- coding: utf-8 -*-
"""Public forms."""
from flask_wtf import FlaskForm
from wtforms import (DateTimeField, IntegerField, SelectField, StringField,
ValidationError)
from wtforms.validators import DataRequired, NumberRange
from league.models import Color, Game, Player
class PlayerCreateForm(F... | [
"wtforms.validators.NumberRange",
"league.models.Color.__members__.items",
"wtforms.ValidationError",
"league.models.Player.get_by_id",
"league.models.Game.get_by_id",
"wtforms.DateTimeField",
"wtforms.SelectField",
"wtforms.validators.DataRequired"
] | [((1785, 1891), 'wtforms.SelectField', 'SelectField', (['"""handicap"""'], {'coerce': 'int', 'choices': '[(handi, handi) for handi in [0, 2, 3, 4, 5, 6, 7, 8, 9]]'}), "('handicap', coerce=int, choices=[(handi, handi) for handi in [0,\n 2, 3, 4, 5, 6, 7, 8, 9]])\n", (1796, 1891), False, 'from wtforms import DateTimeF... |
from heapq import heappush ,heappop, heapify ,_heapify_max
from typing import Union
# Running scalar median
# Ack: https://medium.com/mind-boggling-algorithms/streaming-algorithms-running-median-of-an-array-using-two-heaps-cd1b61b3c034
def med(s,x:Union[float,int]=None)->dict:
""" Running median
:param x... | [
"numpy.median",
"random.choice",
"heapq._heapify_max",
"heapq.heappop",
"heapq.heappush"
] | [((516, 542), 'heapq.heappush', 'heappush', (["s['low_heap']", 'x'], {}), "(s['low_heap'], x)\n", (524, 542), False, 'from heapq import heappush, heappop, heapify, _heapify_max\n'), ((551, 578), 'heapq._heapify_max', '_heapify_max', (["s['low_heap']"], {}), "(s['low_heap'])\n", (563, 578), False, 'from heapq import hea... |
# coding: utf-8
"""
Paasta API
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from... | [
"six.iteritems",
"paasta_tools.paastaapi.configuration.Configuration"
] | [((3694, 3727), 'six.iteritems', 'six.iteritems', (['self.openapi_types'], {}), '(self.openapi_types)\n', (3707, 3727), False, 'import six\n'), ((1348, 1363), 'paasta_tools.paastaapi.configuration.Configuration', 'Configuration', ([], {}), '()\n', (1361, 1363), False, 'from paasta_tools.paastaapi.configuration import C... |
import importlib.resources as pkg_resources
import json
# TODO remove 'experimental' before going live
bigquery = {
"datasets": {
"pages": "httparchive:experimental_summary_pages",
"requests": "httparchive:experimental_summary_requests",
},
"schemas": {
"pages": {
"field... | [
"importlib.resources.read_text"
] | [((352, 407), 'importlib.resources.read_text', 'pkg_resources.read_text', (['"""schema"""', '"""summary_pages.json"""'], {}), "('schema', 'summary_pages.json')\n", (375, 407), True, 'import importlib.resources as pkg_resources\n'), ((505, 563), 'importlib.resources.read_text', 'pkg_resources.read_text', (['"""schema"""... |
# !/usr/bin/env python3
# -*- coding: utf-8 -*-
from subprocess import run
if __name__ == '__main__':
run('pyside6-uic res/MainWindow.ui -o res/Ui_MainWindow.py')
| [
"subprocess.run"
] | [((107, 167), 'subprocess.run', 'run', (['"""pyside6-uic res/MainWindow.ui -o res/Ui_MainWindow.py"""'], {}), "('pyside6-uic res/MainWindow.ui -o res/Ui_MainWindow.py')\n", (110, 167), False, 'from subprocess import run\n')] |
import torch.nn
from gatelfpytorchjson import CustomModule
from gatelfpytorchjson import EmbeddingsModule
from gatelfpytorchjson import NgramModule
import sys
import logging
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
streamhandler = logging.StreamHandler(stream=sys.stderr)
formatter = logging.... | [
"logging.getLogger",
"logging.StreamHandler",
"logging.Formatter",
"gatelfpytorchjson.NgramModule",
"gatelfpytorchjson.EmbeddingsModule"
] | [((184, 211), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (201, 211), False, 'import logging\n'), ((259, 299), 'logging.StreamHandler', 'logging.StreamHandler', ([], {'stream': 'sys.stderr'}), '(stream=sys.stderr)\n', (280, 299), False, 'import logging\n'), ((312, 384), 'logging.Format... |
# Generated by Django 3.1.12 on 2021-06-25 12:30
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('oppositions', '0004_auto_20210625_1223'),
]
operations = [
migrations.AddField(
model_name='appeal',
name='create_d... | [
"django.db.models.DateTimeField"
] | [((344, 432), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'auto_now_add': '(True)', 'null': '(True)', 'verbose_name': '"""date de creation"""'}), "(auto_now_add=True, null=True, verbose_name=\n 'date de creation')\n", (364, 432), False, 'from django.db import migrations, models\n')] |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云(BlueKing) available.
Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
You may obt... | [
"home_application.models.AccountBkuser.objects.filter",
"json.loads",
"home_application.models.TInspectPlan.objects.get",
"json.JSONEncoder.default",
"common.mymako.render_json",
"django.http.HttpResponse",
"django.db.models.Count",
"json.dumps",
"home_application.models.AccountBkuser.objects.all",
... | [((1238, 1297), 'common.mymako.render_mako_context', 'render_mako_context', (['request', '"""/home_application/home.html"""'], {}), "(request, '/home_application/home.html')\n", (1257, 1297), False, 'from common.mymako import render_mako_context, render_json\n'), ((1360, 1424), 'common.mymako.render_mako_context', 'ren... |
import json
class Serializer(object):
def __init__(self, path):
self.path = path
def init(self, schema):
self.dump(schema)
def dump(self, dump):
with open(self.path, 'w') as f:
json.dump(dump, f)
f.closed
def load(self):
with open(self.path, 'r') as f:
return json.load(f)
| [
"json.load",
"json.dump"
] | [((192, 210), 'json.dump', 'json.dump', (['dump', 'f'], {}), '(dump, f)\n', (201, 210), False, 'import json\n'), ((284, 296), 'json.load', 'json.load', (['f'], {}), '(f)\n', (293, 296), False, 'import json\n')] |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import datetime, timedelta
from odoo.fields import Datetime as Dt
from odoo.addons.mrp.tests.common import TestMrpCommon
class TestMrpOrder(TestMrpCommon):
def test_access_rights_manager(self):
... | [
"datetime.datetime.now",
"datetime.timedelta",
"odoo.fields.Datetime.to_string"
] | [((2316, 2330), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (2328, 2330), False, 'from datetime import datetime, timedelta\n'), ((2333, 2350), 'datetime.timedelta', 'timedelta', ([], {'days': '(1)'}), '(days=1)\n', (2342, 2350), False, 'from datetime import datetime, timedelta\n'), ((3139, 3170), 'odoo.f... |
"""
mMOSS moderately Multiplayer Online Side Scroller
Classes defined:
1. ServerProtocol
Copyright (c) 2011 by <NAME>. All rights reserved.
"""
from __future__ import division
import time
import logging
from twisted.protocols import amp
from twisted.internet import protocol
from mmoss.network import *
from mmoss.ut... | [
"logging.info",
"time.time"
] | [((4360, 4412), 'logging.info', 'logging.info', (["('sendServerObjectStateEvent: %s' % obj)"], {}), "('sendServerObjectStateEvent: %s' % obj)\n", (4372, 4412), False, 'import logging\n'), ((4969, 5020), 'logging.info', 'logging.info', (["('sendServerObjectJoinEvent: %s' % obj)"], {}), "('sendServerObjectJoinEvent: %s' ... |
"""Unit tests for satellite_utils.py."""
import unittest
import numpy
from ml4tc.utils import satellite_utils
TOLERANCE = 1e-6
# The following constants are used to test _find_storm_center_px_space.
GRID_LATITUDES_DEG_N = numpy.array(
[-10, -8, -6, -4, -2, 0, 3, 6, 9, 12, 20], dtype=float
)
GRID_LONGITUDES_DEG_E... | [
"numpy.allclose",
"ml4tc.utils.satellite_utils.get_cyclone_id",
"ml4tc.utils.satellite_utils._crop_image_around_storm_center",
"ml4tc.utils.satellite_utils._find_storm_center_px_space",
"numpy.array",
"ml4tc.utils.satellite_utils.parse_cyclone_id",
"unittest.main"
] | [((225, 292), 'numpy.array', 'numpy.array', (['[-10, -8, -6, -4, -2, 0, 3, 6, 9, 12, 20]'], {'dtype': 'float'}), '([-10, -8, -6, -4, -2, 0, 3, 6, 9, 12, 20], dtype=float)\n', (236, 292), False, 'import numpy\n'), ((323, 397), 'numpy.array', 'numpy.array', (['[350, 355, 0, 5, 10, 15, 25, 35, 45, 55, 65, 75]'], {'dtype':... |
from .models import Article
from django.forms import ModelForm, TextInput, DateTimeInput, Textarea
class ArticleForm(ModelForm):
class Meta:
model = Article
fields = ['title', 'anons', 'text', 'pub_date']
widgets = {
'title': TextInput(attrs={
'class': 'form-co... | [
"django.forms.Textarea",
"django.forms.DateTimeInput",
"django.forms.TextInput"
] | [((269, 345), 'django.forms.TextInput', 'TextInput', ([], {'attrs': "{'class': 'form-control', 'placeholder': 'Название статьи'}"}), "(attrs={'class': 'form-control', 'placeholder': 'Название статьи'})\n", (278, 345), False, 'from django.forms import ModelForm, TextInput, DateTimeInput, Textarea\n'), ((415, 488), 'djan... |
"""Test file for float subgraph fusing"""
import random
from inspect import signature
import numpy
import pytest
from concrete.common.data_types.integers import Integer
from concrete.common.debugging.custom_assert import assert_not_reached
from concrete.common.optimization.topological import fuse_float_operations
fr... | [
"numpy.product",
"numpy.int64",
"numpy.reshape",
"numpy.ones",
"concrete.common.data_types.integers.Integer",
"numpy.int32",
"inspect.signature",
"concrete.common.optimization.topological.fuse_float_operations",
"pytest.param",
"pytest.mark.parametrize",
"pytest.raises",
"numpy.cos",
"concre... | [((24956, 25028), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""fun"""', 'tracing.NPTracer.LIST_OF_SUPPORTED_UFUNC'], {}), "('fun', tracing.NPTracer.LIST_OF_SUPPORTED_UFUNC)\n", (24979, 25028), False, 'import pytest\n'), ((1158, 1170), 'numpy.cos', 'numpy.cos', (['x'], {}), '(x)\n', (1167, 1170), False, '... |
"""
Functions for visualizing EE layers
"""
import folium
from branca.element import Template, MacroElement
def create_folium_map(images=None, name=None, coords=[20, 0], zoom=6, height='100%'):
"""
Creates a html file containing a folium map visualizing EE image
:param images: dict. w/ name as key and E... | [
"folium.TileLayer",
"branca.element.MacroElement",
"folium.LayerControl",
"branca.element.Template",
"folium.Map",
"folium.map.CustomPane"
] | [((648, 727), 'folium.Map', 'folium.Map', ([], {'location': 'coords', 'zoom_start': 'zoom', 'height': 'height', 'control_scale': '(True)'}), '(location=coords, zoom_start=zoom, height=height, control_scale=True)\n', (658, 727), False, 'import folium\n'), ((8354, 8368), 'branca.element.MacroElement', 'MacroElement', ([]... |
#!/usr/bin/python3
import json
import requests
response = requests.get("https://api.coinmarketcap.com/v2/ticker/")
data = json.loads(response.text)
finallist = []
def keep(data):
for i in data['data'].values():
if i['rank'] <= 10 and 1 <= i["quotes"]["USD"]["price"] <= 500:
finallist.append(... | [
"json.loads",
"json.dump",
"requests.get"
] | [((59, 115), 'requests.get', 'requests.get', (['"""https://api.coinmarketcap.com/v2/ticker/"""'], {}), "('https://api.coinmarketcap.com/v2/ticker/')\n", (71, 115), False, 'import requests\n'), ((123, 148), 'json.loads', 'json.loads', (['response.text'], {}), '(response.text)\n', (133, 148), False, 'import json\n'), ((4... |
# -*- coding: utf-8 -*-
"""
This module is used to manage optional dependencies.
Example usage::
from birdy.dependencies import ipywidgets as widgets
"""
import warnings
from .exceptions import SnappyWarning
warnings.filterwarnings('default', category=SnappyWarning)
try:
from snappy import ProductIO
f... | [
"warnings.warn",
"warnings.filterwarnings"
] | [((217, 275), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""default"""'], {'category': 'SnappyWarning'}), "('default', category=SnappyWarning)\n", (240, 275), False, 'import warnings\n'), ((402, 489), 'warnings.warn', 'warnings.warn', (['"""ESA snap is not supported. Please install *snappy*."""', 'SnappyW... |
import torch
from IPython.core.display import display
from torch import Tensor
from torch.nn import DataParallel
# noinspection PyProtectedMember
from torch.utils.data import DataLoader
from datasets.deep_fashion import ICRBDataset, ICRBCrossPoseDataloader
from modules.pgpg import PGPG
from train_setup import args, ru... | [
"datasets.deep_fashion.ICRBDataset.get_image_transforms",
"IPython.core.display.display",
"utils.dep_free.get_tqdm",
"torch.cuda.device_count",
"torch.nn.DataParallel",
"datasets.deep_fashion.ICRBCrossPoseDataloader",
"utils.metrics.GanEvaluator",
"train_setup.in_notebook"
] | [((1685, 1782), 'datasets.deep_fashion.ICRBDataset.get_image_transforms', 'ICRBDataset.get_image_transforms', ([], {'target_shape': 'target_shape', 'target_channels': 'target_channels'}), '(target_shape=target_shape, target_channels\n =target_channels)\n', (1717, 1782), False, 'from datasets.deep_fashion import ICRB... |
"""
Integration Tests for vmc_nat_rules state module
"""
import json
import pytest
import requests
from saltext.vmware.utils import vmc_request
@pytest.fixture()
def nat_rule_test_data():
tier1 = "cgw"
nat = "USER"
nat_rule = "NAT_RULE2"
translated_network = "192.168.1.1"
source_network = "10... | [
"pytest.fixture",
"requests.Session",
"saltext.vmware.utils.vmc_request.get_headers"
] | [((152, 168), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (166, 168), False, 'import pytest\n'), ((655, 746), 'saltext.vmware.utils.vmc_request.get_headers', 'vmc_request.get_headers', (["common_data['refresh_key']", "common_data['authorization_host']"], {}), "(common_data['refresh_key'], common_data[\n 'a... |
from math import log
def pattern(n):
string="".join([str(i) for i in range(1,n+1)])
res=""
index=0
for i in range(n):
if i: index+=int(log(i,10))
res+=string[i+index:]+string[:i+index]+"\n"
return res[:-1] | [
"math.log"
] | [((159, 169), 'math.log', 'log', (['i', '(10)'], {}), '(i, 10)\n', (162, 169), False, 'from math import log\n')] |
"""twitterclone URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-... | [
"django.urls.path"
] | [((1099, 1139), 'django.urls.path', 'path', (['"""notification/"""', 'notification_view'], {}), "('notification/', notification_view)\n", (1103, 1139), False, 'from django.urls import path\n'), ((1145, 1183), 'django.urls.path', 'path', (['"""detail/<int:id>/"""', 'detail_tweet'], {}), "('detail/<int:id>/', detail_twee... |
import scipy.optimize
from src.plot import *
import math
import sympy as sp
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
'''This script calculates the inverse kinematics in 6dofs for a Fanuc CR-7iA robot'''
def forward_kinematics(q):
T01 = sp.Matrix([[-sp.cos(q[0]), 0, -sp.sin(q[0]),... | [
"sympy.sin",
"sympy.Symbol",
"sympy.cos",
"math.sqrt",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show"
] | [((3566, 3578), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (3576, 3578), True, 'import matplotlib.pyplot as plt\n'), ((3932, 3944), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (3942, 3944), True, 'import matplotlib.pyplot as plt\n'), ((4140, 4150), 'matplotlib.pyplot.show', 'plt.show', ... |
# Generated by Django 2.2 on 2019-04-27 12:49
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('broker', '0007_auto_20190427_1224'),
migrations.swappable_depende... | [
"django.db.models.FloatField",
"django.db.models.IntegerField",
"django.db.models.ForeignKey",
"django.db.models.AutoField",
"django.db.models.DateTimeField",
"django.db.migrations.swappable_dependency"
] | [((292, 349), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (323, 349), False, 'from django.db import migrations, models\n'), ((484, 577), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)... |
import torch
from torch import nn
import numpy as np
from collections import OrderedDict
from torch.utils.data import DataLoader
from torch.utils.data import Sampler
from contextlib import nullcontext
import yaml
from yaml import SafeLoader as yaml_Loader, SafeDumper as yaml_Dumper
import os,sys
from tqdm import tqdm... | [
"torch.utils.data.DistributedSampler",
"yaml.load",
"lib.utils.dotdict.HDict.L",
"numpy.array_split",
"numpy.arange",
"lib.utils.dotdict.HDict",
"torch.nn.parallel.DistributedDataParallel",
"collections.OrderedDict",
"yaml.dump",
"torch.distributed.all_reduce",
"os.path.dirname",
"yaml.represe... | [((358, 399), 'lib.utils.dotdict.HDict.L.update_globals', 'HDict.L.update_globals', (["{'path': os.path}"], {}), "({'path': os.path})\n", (380, 399), False, 'from lib.utils.dotdict import HDict\n'), ((637, 705), 'yaml.representer.SafeRepresenter.add_representer', 'yaml.representer.SafeRepresenter.add_representer', (['s... |
import re
import time
import gobject
import terminatorlib.plugin as plugin
from terminatorlib.terminator import Terminator
from terminatorlib.terminal import Terminal
AVAILABLE = ['TitlebarClock']
def get_window_title_with_time(self):
title = self.vte.get_window_title() or str(self.command)
return TitlebarCl... | [
"re.compile",
"time.strftime",
"re.match",
"terminatorlib.plugin.Plugin.__init__",
"gobject.timeout_add_seconds",
"terminatorlib.terminator.Terminator"
] | [((500, 529), 're.compile', 're.compile', (['"""^\\\\d{2}:\\\\d{2} """'], {}), "('^\\\\d{2}:\\\\d{2} ')\n", (510, 529), False, 'import re\n'), ((561, 589), 'terminatorlib.plugin.Plugin.__init__', 'plugin.Plugin.__init__', (['self'], {}), '(self)\n', (583, 589), True, 'import terminatorlib.plugin as plugin\n'), ((616, 6... |
import networkx as nx
import numpy as np
def project3d(points, direction):
"""
投影函数,将三维点集投影到二维
投影平面内的y方向为z轴投影(如果投影的法向量为z轴,则y方向为x轴投影)
:param points: 三维点集
:param direction: 投影平面的法向量(u,v,w),投影平面通过原点(0,0,0)
"""
d = direction / np.linalg.norm(direction)
y0 = np.array([1, 0, 0]) if np.array(... | [
"numpy.cross",
"networkx.draw_networkx_edge_labels",
"networkx.is_connected",
"networkx.get_edge_attributes",
"networkx.Graph",
"networkx.connected_components",
"networkx.draw_networkx",
"networkx.draw_networkx_nodes",
"numpy.array",
"numpy.dot",
"networkx.draw_networkx_labels",
"networkx.get_... | [((446, 465), 'numpy.cross', 'np.cross', (['norm_y', 'd'], {}), '(norm_y, d)\n', (454, 465), True, 'import numpy as np\n'), ((253, 278), 'numpy.linalg.norm', 'np.linalg.norm', (['direction'], {}), '(direction)\n', (267, 278), True, 'import numpy as np\n'), ((288, 307), 'numpy.array', 'np.array', (['[1, 0, 0]'], {}), '(... |
import numpy as np
from scipy import ndimage
'''
See paper: Sensors 2018, 18(4), 1055; https://doi.org/10.3390/s18041055
"Divide and Conquer-Based 1D CNN Human Activity Recognition Using Test Data Sharpening"
by <NAME> & <NAME>
This code loads and sharpens UCI HAR Dataset data.
UCI HAR Dataset data can be download... | [
"numpy.array",
"numpy.empty",
"scipy.ndimage.gaussian_filter"
] | [((1051, 1067), 'numpy.array', 'np.array', (['result'], {}), '(result)\n', (1059, 1067), True, 'import numpy as np\n'), ((1463, 1479), 'numpy.array', 'np.array', (['result'], {}), '(result)\n', (1471, 1479), True, 'import numpy as np\n'), ((1581, 1597), 'numpy.empty', 'np.empty', (['(r, c)'], {}), '((r, c))\n', (1589, ... |
import pytest
from collect_social.twitter import search_tweets
# Mock tweepy Status Object
class Status:
def __init__(self,**entries):
self.__dict__.update(entries)
class User:
def __init__(self,**entries):
self.__dict__.update(entries)
@pytest.fixture
def tmp_db_str(tmpdir):
''' Creates... | [
"collect_social.twitter.search_tweets.upsert_tweets",
"collect_social.twitter.search_tweets.setup_db"
] | [((522, 556), 'collect_social.twitter.search_tweets.setup_db', 'search_tweets.setup_db', (['tmp_db_str'], {}), '(tmp_db_str)\n', (544, 556), False, 'from collect_social.twitter import search_tweets\n'), ((1488, 1562), 'collect_social.twitter.search_tweets.upsert_tweets', 'search_tweets.upsert_tweets', (['[tweet_status]... |
"""
File Backends
------------------
Provides backends that deal with local filesystem access.
"""
import collections
import hashlib
import io
import os
import pickle
import tempfile
import time
from shutil import copyfileobj
from dogpile.cache.api import CacheBackend, NO_VALUE, CachedValue
from . import registry
... | [
"dogpile.cache.api.CachedValue",
"os.path.exists",
"collections.namedtuple",
"pickle.dump",
"os.listdir",
"shutil.copyfileobj",
"os.path.join",
"pickle.load",
"io.open",
"os.path.normpath",
"tempfile.NamedTemporaryFile",
"time.time"
] | [((400, 485), 'collections.namedtuple', 'collections.namedtuple', (['"""Metadata"""', "['original_file_offset', 'dogpile_metadata']"], {}), "('Metadata', ['original_file_offset', 'dogpile_metadata']\n )\n", (422, 485), False, 'import collections\n'), ((2494, 2531), 'os.path.join', 'os.path.join', (['self.base_dir', ... |
from subdaap.models import Server
from daapserver.utils import generate_persistent_id
from daapserver import provider
import logging
# Logger instance
logger = logging.getLogger(__name__)
class Provider(provider.Provider):
# SubSonic has support for artwork.
supports_artwork = True
# Persistent IDs a... | [
"logging.getLogger",
"daapserver.utils.generate_persistent_id",
"subdaap.models.Server"
] | [((163, 190), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (180, 190), False, 'import logging\n'), ((979, 997), 'subdaap.models.Server', 'Server', ([], {'db': 'self.db'}), '(db=self.db)\n', (985, 997), False, 'from subdaap.models import Server\n'), ((878, 902), 'daapserver.utils.generat... |
from w_i_stage import IStage
class RPGField(IStage):
def __init__(self):
IStage.__init__(self)
self.setup()
self.setHeroCollision()
self.stop()
self.enemyIndexToBeDeleted = -1
self.previousIntoEvent = ''
def intoEvent(self, entry):
if not entry.hasInto(... | [
"w_i_stage.IStage.__init__"
] | [((87, 108), 'w_i_stage.IStage.__init__', 'IStage.__init__', (['self'], {}), '(self)\n', (102, 108), False, 'from w_i_stage import IStage\n')] |
import copy
import math
from connectfour.agents.computer_player import RandomAgent
def close_to_win(board, id):
score = 0
board_cp = copy.deepcopy(board)
for i in range(board_cp.width):
if board_cp.try_move(i) == -1:
continue
sub_board = board_cp.next_state(id, i)
if s... | [
"copy.deepcopy"
] | [((144, 164), 'copy.deepcopy', 'copy.deepcopy', (['board'], {}), '(board)\n', (157, 164), False, 'import copy\n'), ((3811, 3831), 'copy.deepcopy', 'copy.deepcopy', (['board'], {}), '(board)\n', (3824, 3831), False, 'import copy\n')] |
from __future__ import unicode_literals
import os
from collections import namedtuple
import keras
from keras.layers import Lambda
from keras_bert.layers import Extract, MaskedGlobalMaxPool1D
from keras_bert.loader import load_trained_model_from_checkpoint
__all__ = [
'POOL_NSP',
'POOL_MAX',
... | [
"collections.namedtuple",
"keras_bert.loader.load_trained_model_from_checkpoint",
"keras.layers.Lambda",
"keras.layers.Concatenate",
"os.path.join",
"keras.layers.GlobalAvgPool1D",
"keras_bert.layers.Extract",
"keras_bert.layers.MaskedGlobalMaxPool1D"
] | [((520, 584), 'collections.namedtuple', 'namedtuple', (['"""CheckpointPaths"""', "['config', 'checkpoint', 'vocab']"], {}), "('CheckpointPaths', ['config', 'checkpoint', 'vocab'])\n", (530, 584), False, 'from collections import namedtuple\n'), ((604, 648), 'os.path.join', 'os.path.join', (['model_path', '"""bert_config... |
import requests
url = "https://stroccoli-futbol-science-v1.p.rapidapi.com/s1/results/2017-01-01/2017-01-05"
querystring = {"tournament_name":"English Premier League"}
headers = {
'x-rapidapi-host': "stroccoli-futbol-science-v1.p.rapidapi.com",
'x-rapidapi-key': "472e13f6d7msh84492a2444096d4p1edbffjsn3ff4c107... | [
"requests.request"
] | [((344, 409), 'requests.request', 'requests.request', (['"""GET"""', 'url'], {'headers': 'headers', 'params': 'querystring'}), "('GET', url, headers=headers, params=querystring)\n", (360, 409), False, 'import requests\n')] |
from cdeid.display.html_generator import add_html_tags_of_entities, generate_html
import logging
from cdeid.utils.resources import PACKAGE_NAME
logger = logging.getLogger(PACKAGE_NAME)
class Token:
def __init__(self, text, ner_tag):
self.text = text
self.ner_tag = ner_tag
class Sentence:
d... | [
"logging.getLogger"
] | [((155, 186), 'logging.getLogger', 'logging.getLogger', (['PACKAGE_NAME'], {}), '(PACKAGE_NAME)\n', (172, 186), False, 'import logging\n')] |
"""Tests for the MJPEG IP Camera config flow."""
from unittest.mock import AsyncMock
import requests
from requests_mock import Mocker
from homeassistant.components.mjpeg.const import (
CONF_MJPEG_URL,
CONF_STILL_IMAGE_URL,
DOMAIN,
)
from homeassistant.config_entries import SOURCE_IMPORT, SOURCE_USER
from... | [
"tests.common.MockConfigEntry"
] | [((10616, 10894), 'tests.common.MockConfigEntry', 'MockConfigEntry', ([], {'title': '"""Another Camera"""', 'domain': 'DOMAIN', 'data': '{}', 'options': "{CONF_AUTHENTICATION: HTTP_BASIC_AUTHENTICATION, CONF_MJPEG_URL:\n 'https://example.com/second_camera', CONF_PASSWORD: '',\n CONF_STILL_IMAGE_URL: None, CONF_US... |
from PIL import Image, ImageDraw, ImageFont
import json
import base64
import math
from io import BytesIO
import sys
tile_images = Image.open('./mahjong_tiles/tiles.png')
xsize, ysize = tile_images.size
tile_width = xsize // 10
tile_height = ysize // 4
tile_names = ['1m','2m','3m','4m','5m','6m','7m','8m','9m','0m',
... | [
"PIL.Image.open",
"math.floor",
"PIL.Image.new",
"base64.b64encode",
"io.BytesIO",
"json.load",
"sys.stdout.flush"
] | [((131, 170), 'PIL.Image.open', 'Image.open', (['"""./mahjong_tiles/tiles.png"""'], {}), "('./mahjong_tiles/tiles.png')\n", (141, 170), False, 'from PIL import Image, ImageDraw, ImageFont\n'), ((996, 1005), 'io.BytesIO', 'BytesIO', ([], {}), '()\n', (1003, 1005), False, 'from io import BytesIO\n'), ((5555, 5669), 'PIL.... |
#-*- coding:utf-8 -*-
import torch
import torch.nn as nn
from torchvision import models
from utils.mask_utils import sample_masks
import torch.nn.functional as F
from model.models import MLP,Masknet,FPN
class EncoderwithProjection(nn.Module):
def __init__(self, config):
super().__init__()
self.mask... | [
"torch.ones_like",
"model.models.MLP",
"model.models.FPN",
"utils.mask_utils.sample_masks",
"utils.visualize_masks.wandb_sample",
"torch.reshape"
] | [((1595, 1694), 'model.models.MLP', 'MLP', ([], {'input_dim': 'input_dim', 'hidden_dim': 'hidden_dim', 'output_dim': 'output_dim', 'mask_roi': 'self.mask_rois'}), '(input_dim=input_dim, hidden_dim=hidden_dim, output_dim=output_dim,\n mask_roi=self.mask_rois)\n', (1598, 1694), False, 'from model.models import MLP, Ma... |
#!/usr/bin/env python3
#
# Copyright (c) 2019-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
... | [
"collections.namedtuple",
"unittest.mock.patch",
"typing.cast"
] | [((871, 906), 'unittest.mock.patch', 'patch', (['"""eden.cli.doctor.os.statvfs"""'], {}), "('eden.cli.doctor.os.statvfs')\n", (876, 906), False, 'from unittest.mock import patch\n'), ((1036, 1099), 'collections.namedtuple', 'collections.namedtuple', (['"""statvfs"""', '"""f_blocks f_bavail f_frsize"""'], {}), "('statvf... |
"""
Command-line interface implementing various MDS Provider data analytics, including:
- calculate average availability over a period of time
"""
import argparse
from datetime import datetime, timedelta
import dateutil
from measure import DeviceCounter
import pandas
import query
import time
def setup_cli():
... | [
"dateutil.parser.parse",
"argparse.ArgumentParser",
"datetime.datetime.utcnow",
"query.Availability",
"datetime.timedelta",
"measure.DeviceCounter"
] | [((488, 513), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (511, 513), False, 'import argparse\n'), ((3581, 3598), 'datetime.timedelta', 'timedelta', ([], {'days': '(1)'}), '(days=1)\n', (3590, 3598), False, 'from datetime import datetime, timedelta\n'), ((3817, 3924), 'query.Availability', '... |
import os
import sqlite3
import asyncio
import discord
import dropbox
from discord.ext import commands
print(f"{os.path.basename(__file__)}の読み込み完了")
cn = sqlite3.connect("Main_Data.db")
cu = cn.cursor()
dbxtoken = os.environ.get("dbxtoken")
dbx = dropbox.Dropbox(dbxtoken)
dbx.users_get_current_accoun... | [
"discord.ext.commands.Cog.listener",
"discord.ext.commands.has_permissions",
"dropbox.Dropbox",
"sqlite3.connect",
"discord.utils.get",
"os.environ.get",
"discord.Permissions",
"discord.Colour.green",
"discord.Colour.purple",
"os.path.basename",
"asyncio.sleep",
"discord.ext.commands.command"
... | [((167, 198), 'sqlite3.connect', 'sqlite3.connect', (['"""Main_Data.db"""'], {}), "('Main_Data.db')\n", (182, 198), False, 'import sqlite3\n'), ((231, 257), 'os.environ.get', 'os.environ.get', (['"""dbxtoken"""'], {}), "('dbxtoken')\n", (245, 257), False, 'import os\n'), ((265, 290), 'dropbox.Dropbox', 'dropbox.Dropbox... |
import matplotlib.pyplot as plt
import numpy as np
import numpy.random as rng
import scipy.special as scp
import os
import writer
import main
#Same as above, but random
def random_airfoil_eval(n,param,boundary,control,forces_control):
#Random stuff
par={'n':n, 'deg':int(rng.rand(1)*10), 'N1':rng.rand(1), 'N2':rng.r... | [
"writer.write_blockMeshDict",
"numpy.flip",
"numpy.multiply",
"numpy.sqrt",
"numpy.random.rand",
"main.airfoil_data",
"writer.write_controlDict",
"writer.write_forceCoeffs",
"os.scandir",
"writer.write_boundaryCond",
"numpy.linspace",
"numpy.zeros",
"numpy.linalg.norm",
"os.system",
"mai... | [((432, 443), 'numpy.random.rand', 'rng.rand', (['(1)'], {}), '(1)\n', (440, 443), True, 'import numpy.random as rng\n'), ((872, 944), 'main.airfoil_data', 'main.airfoil_data', (['Au', 'Al', 'par', 'param', 'boundary', 'control', 'forces_control'], {}), '(Au, Al, par, param, boundary, control, forces_control)\n', (889,... |
import unittest
import unittest.mock as mock
import re
from node.ping import Ping
PING_OK_EXAMPLE = 'PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.\n64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.037 ms\n64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.020 ms\n64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.0... | [
"node.ping.Ping",
"unittest.mock.Mock"
] | [((732, 738), 'node.ping.Ping', 'Ping', ([], {}), '()\n', (736, 738), False, 'from node.ping import Ping\n'), ((1517, 1556), 'unittest.mock.Mock', 'mock.Mock', ([], {'return_value': 'PING_OK_EXAMPLE'}), '(return_value=PING_OK_EXAMPLE)\n', (1526, 1556), True, 'import unittest.mock as mock\n')] |
import psycopg2 as pg
conn = pg.connect("dbname=example user=postgres password=<PASSWORD>")
cur = conn.cursor()
SQL_ = """
CREATE TABLE table2 (
id INTEGER PRIMARY KEY,
describe VARCHAR,
isboy BOOLEAN DEFAULT False
);
"""
cur.execute(SQL_)
conn.commit()
cur.close()
conn.close()
| [
"psycopg2.connect"
] | [((32, 94), 'psycopg2.connect', 'pg.connect', (['"""dbname=example user=postgres password=<PASSWORD>"""'], {}), "('dbname=example user=postgres password=<PASSWORD>')\n", (42, 94), True, 'import psycopg2 as pg\n')] |
# -*- coding: utf-8 -*-
# Author: XuMing <<EMAIL>>
# Brief:
import jieba
import jieba.posseg
import jieba.analyse
import os
__all__ = ["Lexer"]
class Lexer(object):
lexer_model = None
def __init__(self, custom_dict_path=None):
self.lexer_model = jieba
if custom_dict_path:
try:
... | [
"os.path.dirname",
"os.path.join"
] | [((517, 566), 'os.path.join', 'os.path.join', (['pwd_path', '"""../.."""', 'custom_dict_path'], {}), "(pwd_path, '../..', custom_dict_path)\n", (529, 566), False, 'import os\n'), ((455, 480), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (470, 480), False, 'import os\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
import config
locals().update(config.__dict__)
this_dir = os.path.dirname(os.path.realpath(config.__file__))
for k in paths:
# if not abspath
if not paths[k].startswith('/'):
... | [
"os.path.realpath",
"os.path.dirname",
"os.path.join"
] | [((207, 240), 'os.path.realpath', 'os.path.realpath', (['config.__file__'], {}), '(config.__file__)\n', (223, 240), False, 'import os\n'), ((97, 122), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (112, 122), False, 'import os\n'), ((335, 367), 'os.path.join', 'os.path.join', (['this_dir', '... |
#!/usr/bin/env python3
import os
import sys
import time
import atexit
import shutil
import asyncio
import socket
import argparse
import asyncssh
import ipaddress
import subprocess
from operator import itemgetter
#import logging
#
#logging.basicConfig(
# level=logging.DEBUG,
# format='%(levelname)7s: %(message)... | [
"asyncssh.connect",
"time.sleep",
"operator.itemgetter",
"os.path.islink",
"ipaddress.ip_network",
"os.remove",
"os.path.exists",
"argparse.ArgumentParser",
"subprocess.run",
"os.mkdir",
"asyncio.sleep",
"asyncio.get_event_loop",
"atexit.register",
"os.write",
"os.openpty",
"shutil.whi... | [((20779, 20790), 'time.time', 'time.time', ([], {}), '()\n', (20788, 20790), False, 'import time\n'), ((7417, 7448), 'subprocess.run', 'subprocess.run', (['cmd'], {'shell': '(True)'}), '(cmd, shell=True)\n', (7431, 7448), False, 'import subprocess\n'), ((7484, 7548), 'subprocess.run', 'subprocess.run', (["('ip netns e... |
from math import sin, cos, tan
def angulos(an):
seno = sin(an)
coss = cos(an)
tang = tan(an)
print(f'O valor do seno é [{seno:.3f}] do cosseno é [{coss:.3f}] e da tangente é [{tang:.3f}]')
angulo = int(input('Digite o valor do angulo: '))
angulos(angulo)
| [
"math.cos",
"math.sin",
"math.tan"
] | [((60, 67), 'math.sin', 'sin', (['an'], {}), '(an)\n', (63, 67), False, 'from math import sin, cos, tan\n'), ((79, 86), 'math.cos', 'cos', (['an'], {}), '(an)\n', (82, 86), False, 'from math import sin, cos, tan\n'), ((98, 105), 'math.tan', 'tan', (['an'], {}), '(an)\n', (101, 105), False, 'from math import sin, cos, t... |
"""
Created on August 06 15:20, 2020
@author: fassial
"""
import os
import timeit
import pyflann
import numpy as np
# local dep
import utils
# file loc params
PREFIX = ".."
# dataset & testdataset
DATASET = os.path.join(PREFIX, "dataset")
PREDATASET = os.path.join(PREFIX, "predataset")
# eval dir
EVAL_DIR = os.path.j... | [
"os.path.exists",
"timeit.default_timer",
"utils.store_data",
"os.path.join",
"numpy.max",
"pyflann.FLANN",
"numpy.zeros",
"numpy.sum",
"os.mkdir",
"utils.remap",
"utils.load_dataset",
"os.remove"
] | [((209, 240), 'os.path.join', 'os.path.join', (['PREFIX', '"""dataset"""'], {}), "(PREFIX, 'dataset')\n", (221, 240), False, 'import os\n'), ((254, 288), 'os.path.join', 'os.path.join', (['PREFIX', '"""predataset"""'], {}), "(PREFIX, 'predataset')\n", (266, 288), False, 'import os\n'), ((311, 336), 'os.path.join', 'os.... |
"""
Cuneiform Recogniser
"""
from __future__ import absolute_import
import os
import shutil
import tempfile
import subprocess as sp
from nodetree import node
import numpy
from . import base
from .. import utils, stages, types
class AbbyyRecognizer(base.CommandLineRecognizerNode):
"""Recognize an image using A... | [
"subprocess.Popen",
"os.path.basename",
"os.unlink",
"tempfile.NamedTemporaryFile"
] | [((1375, 1460), 'subprocess.Popen', 'sp.Popen', (["['convert', '-units', 'PixelsPerInch', '-density', '300', image, image]"], {}), "(['convert', '-units', 'PixelsPerInch', '-density', '300', image,\n image])\n", (1383, 1460), True, 'import subprocess as sp\n'), ((1595, 1636), 'tempfile.NamedTemporaryFile', 'tempfile... |
from aiofiles.os import remove
async def delete_temp_file(file_path):
await remove(file_path)
| [
"aiofiles.os.remove"
] | [((82, 99), 'aiofiles.os.remove', 'remove', (['file_path'], {}), '(file_path)\n', (88, 99), False, 'from aiofiles.os import remove\n')] |
import pytest
import pathlib
import align.pnr.main
import logging
import os
logger = logging.getLogger(__name__)
def results_directory_missing(design):
'''
This function will return true
if dependency is not satisfied
'''
if 'ALIGN_WORK_DIR' not in os.environ: return True
assert design, 'Funct... | [
"logging.getLogger",
"pathlib.Path"
] | [((86, 113), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (103, 113), False, 'import logging\n'), ((948, 972), 'pathlib.Path', 'pathlib.Path', (['ALIGN_HOME'], {}), '(ALIGN_HOME)\n', (960, 972), False, 'import pathlib\n'), ((1019, 1047), 'pathlib.Path', 'pathlib.Path', (['ALIGN_WORK_DIR... |
"""
Copyright (2010-2014) INCUBAID BVBA
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, so... | [
"ArakoonManagement.which_arakoon",
"pylabs.q.config.getConfig",
"pylabs.q.system.process.run"
] | [((1084, 1121), 'pylabs.q.config.getConfig', 'q.config.getConfig', (['"""arakoonclusters"""'], {}), "('arakoonclusters')\n", (1102, 1121), False, 'from pylabs import q\n'), ((3829, 3885), 'pylabs.q.system.process.run', 'q.system.process.run', ([], {'commandline': 'cmd', 'stopOnError': '(False)'}), '(commandline=cmd, st... |
# Problem Set 4C
# Name: <NAME>
# Collaborators:
# Start: 27.12.2020 14:50
# End: 29.12.2020 18:15
# EncryptedSubMessage decrypt_message() returns words that are not necessarily the original, though they are valid
# To run unit tests, type pytest in the terminal
import string
from ps4a import get_permutations
### HEL... | [
"ps4a.get_permutations"
] | [((6643, 6673), 'ps4a.get_permutations', 'get_permutations', (['VOWELS_LOWER'], {}), '(VOWELS_LOWER)\n', (6659, 6673), False, 'from ps4a import get_permutations\n')] |
from typing import Any, Dict
from mockserver_client._timing import _Timing
from mockserver_client.mock_request import MockRequest
class MockExpectation:
def __init__(
self, request: Dict[str, Any], response: Dict[str, Any], timing: _Timing
) -> None:
"""
Class for Expectation
... | [
"mockserver_client.mock_request.MockRequest"
] | [((457, 477), 'mockserver_client.mock_request.MockRequest', 'MockRequest', (['request'], {}), '(request)\n', (468, 477), False, 'from mockserver_client.mock_request import MockRequest\n')] |
from subprocess import *
import subprocess
import os
import sys
def get_git_root(p):
"""Return None if p is not in a git repo, or the root of the repo if it is"""
if call(["git", "branch"], stderr=STDOUT, stdout=open(os.devnull, 'w'), cwd=p) != 0:
return None
else:
root = check_output(["g... | [
"subprocess.check_output",
"os.path.dirname"
] | [((584, 612), 'os.path.dirname', 'os.path.dirname', (['target_file'], {}), '(target_file)\n', (599, 612), False, 'import os\n'), ((913, 970), 'subprocess.check_output', 'subprocess.check_output', (['add_to_gitignore_cmd'], {'shell': '(True)'}), '(add_to_gitignore_cmd, shell=True)\n', (936, 970), False, 'import subproce... |
from p3ui import Layout, ComboBox, Direction, Justification, Alignment, px, Button, Style, ScrollArea
class TabLayout(Layout):
def __init__(self):
super().__init__(
direction=Direction.Vertical,
justify_content=Justification.Center,
align_items=Alignment.Stretch)
... | [
"p3ui.Button",
"p3ui.Justification.__members__.items",
"p3ui.Layout",
"p3ui.Alignment.__members__.items"
] | [((3267, 3421), 'p3ui.Layout', 'Layout', ([], {'direction': 'Direction.Horizontal', 'justify_content': 'Justification.Center', 'align_items': 'Alignment.Stretch', 'children': '[self.vertical, self.horizontal]'}), '(direction=Direction.Horizontal, justify_content=Justification.Center,\n align_items=Alignment.Stretch,... |
from paver.easy import sh
import time
import yaml
from tests.util import clean, invoke_drkns
def test_check():
clean()
output = invoke_drkns('nominalcase', 'check')
assert (len(output) == 0)
def test_list():
clean()
output = invoke_drkns('nominalcase', 'list')
assert(len(output) > 6)
a... | [
"tests.util.clean",
"tests.util.invoke_drkns",
"yaml.safe_load",
"paver.easy.sh",
"time.time"
] | [((119, 126), 'tests.util.clean', 'clean', ([], {}), '()\n', (124, 126), False, 'from tests.util import clean, invoke_drkns\n'), ((140, 176), 'tests.util.invoke_drkns', 'invoke_drkns', (['"""nominalcase"""', '"""check"""'], {}), "('nominalcase', 'check')\n", (152, 176), False, 'from tests.util import clean, invoke_drkn... |
"""
The *devicestorage* package provides the API for working with a devices (sdcard) storage
"""
import logging
import os
import subprocess
from typing import Optional, List, AsyncIterable
from .device import (
Device,
RemoteDeviceBased,
)
__all__ = ["DeviceStorage", "AsyncDeviceStorage"]
log = logging.getL... | [
"logging.getLogger",
"os.path.exists",
"os.path.isfile"
] | [((308, 335), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (325, 335), False, 'import logging\n'), ((3057, 3083), 'os.path.exists', 'os.path.exists', (['local_path'], {}), '(local_path)\n', (3071, 3083), False, 'import os\n'), ((7771, 7797), 'os.path.exists', 'os.path.exists', (['local_... |
from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from zillow_mine.spiders.bs4_json import bsj
... | [
"selenium.webdriver.support.ui.WebDriverWait",
"selenium.webdriver.Chrome",
"zillow_mine.spiders.bs4_json.bsj",
"zillow_mine.spiders.to_db.db_parse",
"selenium.webdriver.support.expected_conditions.visibility_of_element_located",
"selenium.webdriver.support.expected_conditions.presence_of_element_located"... | [((651, 681), 'selenium.webdriver.support.ui.WebDriverWait', 'WebDriverWait', (['self.driver', '(10)'], {}), '(self.driver, 10)\n', (664, 681), False, 'from selenium.webdriver.support.ui import WebDriverWait\n'), ((1278, 1308), 'selenium.webdriver.support.ui.WebDriverWait', 'WebDriverWait', (['self.driver', '(10)'], {}... |
import os
import glob
import json
import argparse
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
parser = argparse.ArgumentParser()
parser.add_argument('--env', type=str, required=True)
parser.add_argument('--hash-bc', type=str, required=True)
parser.add_argument('--hash-dagger', type=str, re... | [
"argparse.ArgumentParser",
"matplotlib.pyplot.plot",
"os.path.join",
"matplotlib.pyplot.close",
"numpy.array",
"matplotlib.pyplot.rcParams.update",
"matplotlib.pyplot.style.context",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.autoscale",
"matplotlib.pyplot.tight_layout",
"json.load",
"matp... | [((133, 158), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (156, 158), False, 'import argparse\n'), ((1714, 1728), 'numpy.array', 'np.array', (['y_bc'], {}), '(y_bc)\n', (1722, 1728), True, 'import numpy as np\n'), ((1740, 1758), 'numpy.array', 'np.array', (['y_dagger'], {}), '(y_dagger)\n', ... |
#!/usr/bin/env python3.3
# coding: utf-8
# Very basic SPDY Client using OpenSSL-NPN support (Python 3.3+)
import sys
import socket
import ssl
from io import BytesIO
import gzip
from spdy.context import Context, CLIENT, SpdyProtocolError
from spdy.frames import SynStream, Ping, Goaway, FLAG_FIN
DEFAULT_HOST = 'www.goo... | [
"spdy.context.Context",
"socket.socket",
"ssl.SSLContext",
"spdy.frames.Ping",
"gzip.GzipFile"
] | [((1443, 1492), 'spdy.frames.Ping', 'Ping', (['spdy_ctx.next_ping_id'], {'version': 'SPDY_VERSION'}), '(spdy_ctx.next_ping_id, version=SPDY_VERSION)\n', (1447, 1492), False, 'from spdy.frames import SynStream, Ping, Goaway, FLAG_FIN\n'), ((2683, 2718), 'ssl.SSLContext', 'ssl.SSLContext', (['ssl.PROTOCOL_SSLv23'], {}), ... |
# (c) 2012-2014, <NAME> <<EMAIL>>
#
# This file is part of Ansible
#
# Ansible 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.
#
# Ansi... | [
"ansible.vars.manager.strip_internal_keys",
"ansible.parsing.dataloader.DataLoader",
"copy.deepcopy"
] | [((3889, 3911), 'copy.deepcopy', 'deepcopy', (['self._result'], {}), '(self._result)\n', (3897, 3911), False, 'from copy import deepcopy\n'), ((4171, 4292), 'ansible.vars.manager.strip_internal_keys', 'strip_internal_keys', (['result._result'], {'exceptions': "('_ansible_verbose_always', '_ansible_item_label', '_ansibl... |
"""
Example on how to use the 'calc_cops' function to get the
COPs of a compression chiller using pd.Time-Series as input.
We use the ambient air as heat sink (high temperature reservoir). The input is
a list to show how the function can be applied on several time steps. The
output is a list as well and may serve as i... | [
"pandas.DataFrame",
"pandas.Series",
"oemof.thermal.compression_heatpumps_and_chillers.calc_cops",
"pandas.date_range"
] | [((705, 752), 'pandas.date_range', 'pd.date_range', (['"""20200101"""'], {'periods': '(24)', 'freq': '"""H"""'}), "('20200101', periods=24, freq='H')\n", (718, 752), True, 'import pandas as pd\n'), ((815, 853), 'pandas.DataFrame', 'pd.DataFrame', (['temp_ambient', 'timestamps'], {}), '(temp_ambient, timestamps)\n', (82... |
import tensorflow as tf
from keras.models import Sequential,load_model,model_from_json
from keras.layers import Dense, Dropout,Activation,MaxPooling2D,Conv2D,Flatten
from keras.applications.imagenet_utils import preprocess_input, decode_predictions
from keras.preprocessing.image import load_img
from keras.preprocessing... | [
"flask.render_template",
"numpy.array",
"flask.request.form.get",
"flask.Flask"
] | [((628, 643), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (633, 643), False, 'from flask import Flask, redirect, url_for, request, render_template\n'), ((958, 992), 'flask.render_template', 'render_template', (['"""prediction.html"""'], {}), "('prediction.html')\n", (973, 992), False, 'from flask import... |
# Copyright Amazon Web Services and its Affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | [
"tensorflow.random.uniform",
"tensorflow.neuron.trace",
"tensorflow.transpose",
"inspect.signature",
"tensorflow.neuron.python.unittest_base.RemoveTestSession.__new__",
"distutils.version.LooseVersion",
"unittest.skip"
] | [((8207, 8255), 'tensorflow.neuron.python.unittest_base.RemoveTestSession.__new__', 'RemoveTestSession.__new__', (['mcs', 'name', 'bases', 'dct'], {}), '(mcs, name, bases, dct)\n', (8232, 8255), False, 'from tensorflow.neuron.python.unittest_base import TestV2Only, RemoveTestSession\n'), ((20507, 20535), 'distutils.ver... |
# -*- coding: utf-8 -*-
"""
Created on Wed Aug 14 20:43:59 2019
@author: mwhitten
"""
from setuptools import setup, find_packages
setup(name='myproject', version='1.0', packages=find_packages()) | [
"setuptools.find_packages"
] | [((181, 196), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (194, 196), False, 'from setuptools import setup, find_packages\n')] |
from ..annealer import Annealer
from dwave.system import DWaveSampler
import minorminer
class DWaveBaseAnnealer(Annealer):
def __init__(self, topology, solver_parameters={}):
super().__init__(solver_parameters)
# Check if the topology is valid
if topology not in ["chimera", "pegasus"]:
... | [
"dwave.system.DWaveSampler",
"minorminer.find_embedding"
] | [((541, 595), 'dwave.system.DWaveSampler', 'DWaveSampler', ([], {'solver': "{'topology__type': self.topology}"}), "(solver={'topology__type': self.topology})\n", (553, 595), False, 'from dwave.system import DWaveSampler\n'), ((660, 731), 'minorminer.find_embedding', 'minorminer.find_embedding', (['source_edges', 'self.... |
#!/usr/bin/env python3
import pytest
import subprocess as sub
from bin import get_dust
def test_main():
sub.call(get_dust.__file__, shell=True)
if __name__ == '__main__':
pytest.main()
| [
"subprocess.call",
"pytest.main"
] | [((110, 149), 'subprocess.call', 'sub.call', (['get_dust.__file__'], {'shell': '(True)'}), '(get_dust.__file__, shell=True)\n', (118, 149), True, 'import subprocess as sub\n'), ((183, 196), 'pytest.main', 'pytest.main', ([], {}), '()\n', (194, 196), False, 'import pytest\n')] |
import numpy as np
from flask import Flask, request, jsonify, render_template
import pickle
import pandas as pd
app = Flask(__name__)
model1 = pickle.load(open('model1.pkl', 'rb'))
model2 = pickle.load(open('model2.pkl', 'rb'))
model3 = pickle.load(open('model3.pkl', 'rb'))
model4 = pic... | [
"flask.render_template",
"pandas.DataFrame",
"flask.Flask",
"flask.request.form.get",
"pandas.get_dummies"
] | [((119, 134), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (124, 134), False, 'from flask import Flask, request, jsonify, render_template\n'), ((428, 457), 'flask.render_template', 'render_template', (['"""index.html"""'], {}), "('index.html')\n", (443, 457), False, 'from flask import Flask, request, jso... |
# -*- coding: utf-8 -*-
"""
# @file name : compute_flops.py
# @author : TingsongYu https://github.com/TingsongYu
# @date : 2020-02-29
# @brief : 观察resnet56 及 ghost-resnet-56
"""
import os
import sys
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.path.join(BASE_DIR, '..'))
from ... | [
"os.path.abspath",
"Ghost_ResNet.resnet56",
"os.path.join",
"torchstat.stat"
] | [((242, 267), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (257, 267), False, 'import os\n'), ((285, 313), 'os.path.join', 'os.path.join', (['BASE_DIR', '""".."""'], {}), "(BASE_DIR, '..')\n", (297, 313), False, 'import os\n'), ((435, 458), 'Ghost_ResNet.resnet56', 'Ghost_ResNet.resnet56', ... |
#Copyright 2019 Adobe. All rights reserved.
#This file is licensed to you 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 ag... | [
"ops.inventory.ec2inventory.Ec2Inventory"
] | [((1037, 1162), 'ops.inventory.ec2inventory.Ec2Inventory', 'Ec2Inventory', ([], {'boto_profile': "args['boto_profile']", 'regions': "args['region']", 'filters': 'filters', 'bastion_filters': 'bastion_filters'}), "(boto_profile=args['boto_profile'], regions=args['region'],\n filters=filters, bastion_filters=bastion_f... |
from unittest import TestCase
from openchain.models.block import Block
from openchain.models.factory import BlockchainFactory
from openchain.models.transaction import Transaction
from openchain.tests import TEST_PRIVATE_KEY
class WorkflowTestCase(TestCase):
def setUp(self):
Block.objects.delete_all()
... | [
"openchain.models.block.Block.objects.delete_all",
"openchain.models.transaction.Transaction.objects.delete_all",
"openchain.tests.TEST_PRIVATE_KEY.to_string",
"openchain.models.block.Block",
"openchain.models.transaction.Transaction",
"openchain.models.block.Block.objects.get"
] | [((291, 317), 'openchain.models.block.Block.objects.delete_all', 'Block.objects.delete_all', ([], {}), '()\n', (315, 317), False, 'from openchain.models.block import Block\n'), ((326, 358), 'openchain.models.transaction.Transaction.objects.delete_all', 'Transaction.objects.delete_all', ([], {}), '()\n', (356, 358), Fal... |
import os
import json
import requests
from common.doConfig import GetInfo
class DoLoginOut:
def getUrl(self):
"""
从配置文件中接口url
:return: 接口url
"""
cf = GetInfo(os.path.abspath(os.path.dirname(os.path.dirname(__file__))) + "/config/user_info.cfg")
base_interface = cf.... | [
"os.path.dirname",
"json.dumps"
] | [((2338, 2359), 'json.dumps', 'json.dumps', (['data_code'], {}), '(data_code)\n', (2348, 2359), False, 'import json\n'), ((2483, 2505), 'json.dumps', 'json.dumps', (['data_login'], {}), '(data_login)\n', (2493, 2505), False, 'import json\n'), ((237, 262), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__fi... |
# Copyright 2018, National Technology & Engineering Solutions of Sandia, LLC
# (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S.
# Government retains certain rights in this software.
import queue
import flask
from samlab.dashboard.server import application, socketio, require_auth, require_permi... | [
"samlab.dashboard.server.socketio.emit",
"flask.request.json.pop",
"samlab.dashboard.server.socketio.start_background_task",
"samlab.dashboard.server.socketio.sleep",
"samlab.dashboard.server.require_permissions",
"samlab.dashboard.server.application.route",
"queue.Queue",
"flask.jsonify"
] | [((330, 376), 'samlab.dashboard.server.application.route', 'application.route', (['"""/notify"""'], {'methods': "['POST']"}), "('/notify', methods=['POST'])\n", (347, 376), False, 'from samlab.dashboard.server import application, socketio, require_auth, require_permissions\n'), ((885, 898), 'queue.Queue', 'queue.Queue'... |
''' 配置pymysql '''
import pymysql
# 解决mysql版本问题报错而添加的代码
pymysql.version_info = (1, 3, 13, "final", 0)
pymysql.install_as_MySQLdb() | [
"pymysql.install_as_MySQLdb"
] | [((105, 133), 'pymysql.install_as_MySQLdb', 'pymysql.install_as_MySQLdb', ([], {}), '()\n', (131, 133), False, 'import pymysql\n')] |
from fixture.contact import Contact
from fixture.group import Group
from fixture.orm import ORMFixture
import random
db = ORMFixture(host="127.0.0.1", name="addressbook", user="root", password="")
def test_add_contact_in_group(app):
if len(db.get_group_list()) == 0:
app.group.create(Group(name="test"))
... | [
"fixture.contact.Contact",
"fixture.group.Group",
"fixture.orm.ORMFixture"
] | [((123, 197), 'fixture.orm.ORMFixture', 'ORMFixture', ([], {'host': '"""127.0.0.1"""', 'name': '"""addressbook"""', 'user': '"""root"""', 'password': '""""""'}), "(host='127.0.0.1', name='addressbook', user='root', password='')\n", (133, 197), False, 'from fixture.orm import ORMFixture\n'), ((299, 317), 'fixture.group.... |
"""
ASV benchmarks for location.py
"""
import pandas as pd
import pvlib
from pkg_resources import parse_version
def set_solar_position(obj):
obj.location = pvlib.location.Location(32, -110, altitude=700,
tz='Etc/GMT+7')
obj.times = pd.date_range(start='20180601', fr... | [
"pvlib.location.Location",
"pkg_resources.parse_version",
"pandas.date_range"
] | [((163, 226), 'pvlib.location.Location', 'pvlib.location.Location', (['(32)', '(-110)'], {'altitude': '(700)', 'tz': '"""Etc/GMT+7"""'}), "(32, -110, altitude=700, tz='Etc/GMT+7')\n", (186, 226), False, 'import pvlib\n'), ((286, 344), 'pandas.date_range', 'pd.date_range', ([], {'start': '"""20180601"""', 'freq': '"""3m... |
# -*- coding: utf-8 -*-
__title__ = 'Update Floor\nRebar Tag'
__author__ = 'htl'
import rpw
from rpw import doc
rebar_details = rpw.db.Collector(of_class='FamilyInstance',
where=lambda x: x.Symbol.FamilyName.lower()=='udic - floor rebar symbol',
view = doc.ActiveView)
wi... | [
"rpw.db.Element.from_int",
"rpw.db.Element",
"rpw.db.Transaction"
] | [((323, 370), 'rpw.db.Transaction', 'rpw.db.Transaction', (['"""Update Floor Rebar Detail"""'], {}), "('Update Floor Rebar Detail')\n", (341, 370), False, 'import rpw\n'), ((422, 444), 'rpw.db.Element', 'rpw.db.Element', (['detail'], {}), '(detail)\n', (436, 444), False, 'import rpw\n'), ((526, 559), 'rpw.db.Element.fr... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# /**********************************************************************************
# * _author : <NAME>
# * _mail : <EMAIL>
# * _repo : https://git.tuxstash.de/gothseidank/labertasche
# * _license : This project is under MIT License
# ***********************... | [
"platform.system",
"os.access",
"labertasche.settings.LegacySettings",
"sys.exit"
] | [((985, 1008), 'os.access', 'access', (['base_path', 'W_OK'], {}), '(base_path, W_OK)\n', (991, 1008), False, 'from os import access, W_OK\n'), ((1128, 1135), 'sys.exit', 'exit', (['(1)'], {}), '(1)\n', (1132, 1135), False, 'from sys import exit\n'), ((1187, 1203), 'labertasche.settings.LegacySettings', 'LegacySettings... |
#!/usr/bin/python3
import serial, string, datetime, time, Adafruit_ADS1x15
import RPi.GPIO as GPIO
#Set up signal to NI DAQ
GPIO.setmode(GPIO.BCM)
GPIO.setup(24, GPIO.OUT)
while True:
trigger = int(input('0 for trigger off, 1 for trigger on:'))
if trigger == 0:
GPIO.output(24,0)
print("trigger is off...")
if ... | [
"RPi.GPIO.setup",
"RPi.GPIO.output",
"RPi.GPIO.setmode"
] | [((126, 148), 'RPi.GPIO.setmode', 'GPIO.setmode', (['GPIO.BCM'], {}), '(GPIO.BCM)\n', (138, 148), True, 'import RPi.GPIO as GPIO\n'), ((149, 173), 'RPi.GPIO.setup', 'GPIO.setup', (['(24)', 'GPIO.OUT'], {}), '(24, GPIO.OUT)\n', (159, 173), True, 'import RPi.GPIO as GPIO\n'), ((269, 287), 'RPi.GPIO.output', 'GPIO.output'... |
from interface import common_inter, student_inter
from lib.common import login_auth
import time
user_data = {'name': None}
def register():
print('注册')
if user_data['name']:
print('您已登录,无需注册')
return
while True:
name = input('请输入用户名或按(q/Q)退出>>:').strip()
if na... | [
"lib.common.login_auth",
"interface.student_inter.check_score_interface",
"interface.common_inter.login_interface",
"interface.student_inter.register_interface",
"interface.student_inter.choose_course_interface",
"time.sleep",
"interface.student_inter.choose_school_interface",
"interface.student_inter... | [((1359, 1390), 'lib.common.login_auth', 'login_auth', ([], {'user_type': '"""student"""'}), "(user_type='student')\n", (1369, 1390), False, 'from lib.common import login_auth\n'), ((2131, 2162), 'lib.common.login_auth', 'login_auth', ([], {'user_type': '"""student"""'}), "(user_type='student')\n", (2141, 2162), False,... |
import unittest
import colour
from ay.utils import Colors
class ColorsTests (unittest.TestCase):
def test_range_colors (self):
color_range = Colors.color("#000000", "#00aabb", 10)
self.assertEqual(10, len(color_range))
self.assertEqual(colour.Color("black").hex, color_range[0])
... | [
"colour.Color",
"ay.utils.Colors.color"
] | [((159, 197), 'ay.utils.Colors.color', 'Colors.color', (['"""#000000"""', '"""#00aabb"""', '(10)'], {}), "('#000000', '#00aabb', 10)\n", (171, 197), False, 'from ay.utils import Colors\n'), ((270, 291), 'colour.Color', 'colour.Color', (['"""black"""'], {}), "('black')\n", (282, 291), False, 'import colour\n'), ((338, 3... |
import asyncio
import websockets
import DisplayActions
import ctypes
import os
authenticated = True
dActions = DisplayActions.Actions()
reserved = ["load","fun"]
global websocket_pointer
async def commu(websocket, path):
async for message in websocket:
dActions.websocket_pointer = id(websocket)
tr... | [
"websockets.serve",
"DisplayActions.Actions",
"asyncio.get_event_loop",
"os.getpid"
] | [((113, 137), 'DisplayActions.Actions', 'DisplayActions.Actions', ([], {}), '()\n', (135, 137), False, 'import DisplayActions\n'), ((1484, 1526), 'websockets.serve', 'websockets.serve', (['commu', '"""localhost"""', 'port'], {}), "(commu, 'localhost', port)\n", (1500, 1526), False, 'import websockets\n'), ((1538, 1562)... |
import numpy as np
import warnings
warnings.filterwarnings("ignore")
def knee_pt(y, x=None):
x_was_none = False
use_absolute_dev_p = True
res_x = np.nan
idx_of_result = np.nan
if type(y) is not np.ndarray:
print('knee_pt: y must be a numpy 1D vector')
return res_x, idx_of_result
... | [
"numpy.abs",
"numpy.multiply",
"numpy.nanargmin",
"numpy.full",
"numpy.size",
"numpy.sort",
"numpy.diff",
"numpy.argsort",
"numpy.min",
"numpy.argmin",
"numpy.cumsum",
"numpy.amax",
"warnings.filterwarnings"
] | [((36, 69), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (59, 69), False, 'import warnings\n'), ((458, 468), 'numpy.size', 'np.size', (['y'], {}), '(y)\n', (465, 468), True, 'import numpy as np\n'), ((1314, 1334), 'numpy.cumsum', 'np.cumsum', (['x'], {'axis': '(0)'}), '(... |
#########################################################################
# Dicomifier - Copyright (C) Universite de Strasbourg
# Distributed under the terms of the CeCILL-B license, as published by
# the CEA-CNRS-INRIA. Refer to the LICENSE file or to
# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
# for... | [
"numpy.isclose",
"numpy.cross",
"odil.Tag",
"pickle.dumps",
"re.match",
"numpy.subtract",
"numpy.argsort",
"numpy.linalg.norm",
"numpy.shape"
] | [((21251, 21269), 'odil.Tag', 'odil.Tag', (['group', '(0)'], {}), '(group, 0)\n', (21259, 21269), False, 'import odil\n'), ((8609, 8634), 'numpy.cross', 'numpy.cross', (['*orientation'], {}), '(*orientation)\n', (8620, 8634), False, 'import numpy\n'), ((15293, 15380), 're.match', 're.match', (["b'^b=([\\\\d.]+)\\\\((-?... |
import numpy as np
from math import factorial
def main():
x = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
y = np.array([1, 2, 3, 4])
z = np.convolve(x, y, mode="valid")
print(z)
z = np.convolve(x, y, mode="full")
print(z)
x = np.arange(0, 20, 1) ** 2
smoothed = savitzky_golay(x, 4, 3... | [
"numpy.abs",
"numpy.convolve",
"numpy.linalg.pinv",
"math.factorial",
"numpy.array",
"numpy.concatenate",
"numpy.arange"
] | [((68, 109), 'numpy.array', 'np.array', (['[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]'], {}), '([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])\n', (76, 109), True, 'import numpy as np\n'), ((118, 140), 'numpy.array', 'np.array', (['[1, 2, 3, 4]'], {}), '([1, 2, 3, 4])\n', (126, 140), True, 'import numpy as np\n'), ((150, 181), 'numpy.convolve'... |
#!/usr/bin/env python3
from math import ceil, log10
from itertools import count
def fib_number_of_digits(n):
'''
http://www.geeksforgeeks.org/finding-number-of-digits-in-nth-fibonacci-number/
'''
PHI = 1.6180339887498948
if n == 1:
return 1
d = (n * log10(PHI)) - (log10(5) / 2)
ret... | [
"math.log10",
"itertools.count",
"math.ceil"
] | [((324, 331), 'math.ceil', 'ceil', (['d'], {}), '(d)\n', (328, 331), False, 'from math import ceil, log10\n'), ((394, 408), 'itertools.count', 'count', (['temp', '(1)'], {}), '(temp, 1)\n', (399, 408), False, 'from itertools import count\n'), ((284, 294), 'math.log10', 'log10', (['PHI'], {}), '(PHI)\n', (289, 294), Fal... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 10 11:15:49 2018
# Congo basin tree fraction using 2018 dataset with gain
@author: earjba
"""
import numpy as np
import importlib
import iris
import iris.quickplot as qplt
import matplotlib.pyplot as plt
from datetime import datetime, timedelta
fro... | [
"matplotlib.pyplot.imshow",
"gdal.Open",
"numpy.hstack",
"mpl_toolkits.basemap.interp",
"iris.save",
"numpy.where",
"matplotlib.pyplot.colorbar",
"numpy.nanmean",
"numpy.zeros",
"jpros.harmonised.write_netcdf",
"numpy.empty",
"iris.load_cube",
"importlib.reload",
"numpy.concatenate",
"nu... | [((445, 472), 'importlib.reload', 'importlib.reload', (['readfiles'], {}), '(readfiles)\n', (461, 472), False, 'import importlib\n'), ((473, 501), 'importlib.reload', 'importlib.reload', (['harmonised'], {}), '(harmonised)\n', (489, 501), False, 'import importlib\n'), ((7309, 7325), 'matplotlib.pyplot.imshow', 'plt.ims... |
import json
import logging
import re
from typing import Dict
from bs4 import BeautifulSoup
LOG = logging.getLogger('scrapper.macrotrends.Parser')
class ParserError(Exception):
def __init__(self, error, parsing_content):
self.message = f'failed to parse: {error}'
LOG.exception(self.message)
... | [
"logging.getLogger",
"json.loads",
"re.compile",
"bs4.BeautifulSoup",
"re.search"
] | [((99, 147), 'logging.getLogger', 'logging.getLogger', (['"""scrapper.macrotrends.Parser"""'], {}), "('scrapper.macrotrends.Parser')\n", (116, 147), False, 'import logging\n'), ((999, 1025), 're.search', 're.search', (['pattern', 'string'], {}), '(pattern, string)\n', (1008, 1025), False, 'import re\n'), ((725, 755), '... |
# Generated by Django 3.1.2 on 2021-04-08 17:47
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('GnC', '0009_auto_20210407_1742'),
]
operations = [
migrations.AddField(
model_name='goals',
... | [
"django.db.models.ForeignKey"
] | [((369, 483), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'blank': '(True)', 'null': '(True)', 'on_delete': 'django.db.models.deletion.CASCADE', 'to': '"""GnC.cascadedgoals"""'}), "(blank=True, null=True, on_delete=django.db.models.\n deletion.CASCADE, to='GnC.cascadedgoals')\n", (386, 483), False, 'fr... |
import flask
import subprocess
import re
app = flask.Flask(__name__)
stored_volume = None
@app.route('/say', methods=['GET', 'POST'])
def say():
text = flask.request.values.get('text')
gain = flask.request.values.get('gain', "1.0")
# TODO: Make language configurable
# TODO: Then this replace should only happen ... | [
"subprocess.check_output",
"flask.request.args.get",
"re.search",
"flask.Flask",
"flask.request.values.get",
"subprocess.call",
"re.sub",
"flask.jsonify"
] | [((48, 69), 'flask.Flask', 'flask.Flask', (['__name__'], {}), '(__name__)\n', (59, 69), False, 'import flask\n'), ((156, 188), 'flask.request.values.get', 'flask.request.values.get', (['"""text"""'], {}), "('text')\n", (180, 188), False, 'import flask\n'), ((197, 236), 'flask.request.values.get', 'flask.request.values.... |
# -*- coding: utf-8 -*-
from tableau_tools import *
import time
server = 'http://127.0.0.1'
username = ''
password = ''
new_site_content_url = 'test_site'
new_site_name = 'Sample Test Site'
# Choose the API version for your server. 2019.3 = TableauRestApiConnection35
default = TableauServerRest(server=server, usern... | [
"time.sleep"
] | [((624, 637), 'time.sleep', 'time.sleep', (['(4)'], {}), '(4)\n', (634, 637), False, 'import time\n'), ((1142, 1155), 'time.sleep', 'time.sleep', (['(4)'], {}), '(4)\n', (1152, 1155), False, 'import time\n'), ((2988, 3001), 'time.sleep', 'time.sleep', (['(3)'], {}), '(3)\n', (2998, 3001), False, 'import time\n')] |
import matplotlib.pyplot as plt
x_values = [1, 2, 3, 4, 5]
y_values = [1, 4, 9, 16, 25]
plt.scatter(x_values, y_values, s=100)
# Set chart title and label size.
plt.title('Square Numbers', fontsize=24)
plt.xlabel('Value', fontsize=14)
plt.ylabel('Square of Value', fontsize=14)
# Set size of tick labels.
plt.tick_p... | [
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.tick_params",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.title",
"matplotlib.pyplot.show"
] | [((91, 129), 'matplotlib.pyplot.scatter', 'plt.scatter', (['x_values', 'y_values'], {'s': '(100)'}), '(x_values, y_values, s=100)\n', (102, 129), True, 'import matplotlib.pyplot as plt\n'), ((165, 205), 'matplotlib.pyplot.title', 'plt.title', (['"""Square Numbers"""'], {'fontsize': '(24)'}), "('Square Numbers', fontsiz... |
# flake8: noqa
# TODO(amog): Add this to CI once Trainer has been implemented.
# TODO(rliaw): Include this in the docs.
# fmt: off
# __custom_trainer_begin__
import torch
from ray.ml.trainer import Trainer
from ray import tune
class MyPytorchTrainer(Trainer):
def setup(self):
self.model = torch.nn.Linea... | [
"torch.nn.MSELoss",
"torch.nn.Linear",
"ray.data.from_items",
"ray.tune.report"
] | [((1427, 1457), 'ray.data.from_items', 'ray.data.from_items', (['[1, 2, 3]'], {}), '([1, 2, 3])\n', (1446, 1457), False, 'import ray\n'), ((306, 327), 'torch.nn.Linear', 'torch.nn.Linear', (['(1)', '(1)'], {}), '(1, 1)\n', (321, 327), False, 'import torch\n'), ((1276, 1315), 'ray.tune.report', 'tune.report', ([], {'los... |
# Generated by Django 3.1 on 2021-02-26 03:20
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('habits', '0002_auto_20210224_2212'),
]
operations = [
migrations.AlterField(
model_name='dailyhabit',
name='started_on... | [
"django.db.models.DateField"
] | [((341, 447), 'django.db.models.DateField', 'models.DateField', ([], {'auto_now_add': '(True)', 'help_text': '"""The date and time this particular habit was started."""'}), "(auto_now_add=True, help_text=\n 'The date and time this particular habit was started.')\n", (357, 447), False, 'from django.db import migratio... |
#!bin/evn python
# encoding:utf-8
from PIL import Image
import pytesseract
import re
import sys
import cv2
import os
from bin.python.utils.string_utils import StringUtils
#print(pytesseract.image_to_string(Image.open('src/test-european.jpg'), lang='fra'))
#str = pytesseract.image_to_string(Image.open('public/uploads/... | [
"bin.python.utils.string_utils.StringUtils",
"PIL.Image.open",
"os.path.isfile",
"cv2.cvtColor",
"cv2.imread",
"os.remove"
] | [((947, 967), 'cv2.imread', 'cv2.imread', (['ori_file'], {}), '(ori_file)\n', (957, 967), False, 'import cv2\n'), ((1116, 1155), 'cv2.cvtColor', 'cv2.cvtColor', (['image', 'cv2.COLOR_BGR2GRAY'], {}), '(image, cv2.COLOR_BGR2GRAY)\n', (1128, 1155), False, 'import cv2\n'), ((533, 553), 'os.path.isfile', 'os.path.isfile', ... |
from datetime import datetime
from db_manager import DBManager
from url_scanner import UrlScanner
from utils import get_same_domain_urls, get_external_urls, get_domain
class Crawler(object):
""" Crawler - a simple web-crawler that follows internal
and external links.
It will save all its results i... | [
"utils.get_same_domain_urls",
"db_manager.DBManager",
"datetime.datetime.now",
"utils.get_domain",
"url_scanner.UrlScanner",
"utils.get_external_urls"
] | [((545, 557), 'url_scanner.UrlScanner', 'UrlScanner', ([], {}), '()\n', (555, 557), False, 'from url_scanner import UrlScanner\n'), ((585, 603), 'db_manager.DBManager', 'DBManager', (['db_file'], {}), '(db_file)\n', (594, 603), False, 'from db_manager import DBManager\n'), ((1573, 1588), 'utils.get_domain', 'get_domain... |
import datetime
from os import makedirs, environ
import os.path
import unittest
from shutil import copy, rmtree
# It must be set before import "utils"
environ["SATNOGS_GUT_CONFIG_DIR"] = "tests/config"
from utils import CONFIG_DIRECTORY
from orbitdb import OrbitDatabase
tle_filename = "https___celestrak.com_NORAD_e... | [
"os.makedirs",
"datetime.datetime.utcnow",
"orbitdb.OrbitDatabase",
"shutil.copy",
"shutil.rmtree"
] | [((406, 447), 'os.makedirs', 'makedirs', (['CONFIG_DIRECTORY'], {'exist_ok': '(True)'}), '(CONFIG_DIRECTORY, exist_ok=True)\n', (414, 447), False, 'from os import makedirs, environ\n'), ((456, 498), 'shutil.copy', 'copy', (['"""tests/config.yml"""', 'CONFIG_DIRECTORY'], {}), "('tests/config.yml', CONFIG_DIRECTORY)\n", ... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
import json
import platform
import aiohttp
import tinify
from .errors import ConnectionError, Error
class Client(object):
API_ENDPOINT = 'https://api.tinify.com'
USER_AGENT = 'Tinify/{0} Python/{1} ({... | [
"platform.python_implementation",
"json.loads",
"json.dumps",
"aiohttp.BasicAuth",
"platform.python_version"
] | [((352, 377), 'platform.python_version', 'platform.python_version', ([], {}), '()\n', (375, 377), False, 'import platform\n'), ((433, 465), 'platform.python_implementation', 'platform.python_implementation', ([], {}), '()\n', (463, 465), False, 'import platform\n'), ((1013, 1047), 'aiohttp.BasicAuth', 'aiohttp.BasicAut... |