code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
from django.shortcuts import render,redirect,get_object_or_404
from .forms import *
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from .models import *
from django.views.generic import DetailView,DeleteView
from django.urls import reverse_lazy
from test2.notification impo... | [
"django.shortcuts.render",
"django.core.mail.send_mail",
"django.contrib.messages.error",
"django.shortcuts.redirect",
"django.contrib.messages.success",
"django.core.paginator.Paginator"
] | [((1667, 1735), 'django.contrib.messages.success', 'messages.success', (['request', '"""You Have Sucessfully Deleted A Product """'], {}), "(request, 'You Have Sucessfully Deleted A Product ')\n", (1683, 1735), False, 'from django.contrib import messages\n'), ((1747, 1772), 'django.shortcuts.redirect', 'redirect', (['"... |
from pyssian.chemistryutils import is_basis,is_method
import unittest
class ChemistryUtilsTest(unittest.TestCase):
def setUp(self):
self.Valid_Basis = '6-311+g(d,p) 6-31g* cc-pVTZ D95V* LanL2DZ SDD28 Def2SVP UGBS2P2++'.split()
self.Fake_Basis = '6-311g+(d,p) 6-31*g ccpVTZ D96V* LanL2TZ SDD Def2SP U... | [
"pyssian.chemistryutils.is_method",
"pyssian.chemistryutils.is_basis"
] | [((736, 751), 'pyssian.chemistryutils.is_basis', 'is_basis', (['valid'], {}), '(valid)\n', (744, 751), False, 'from pyssian.chemistryutils import is_basis, is_method\n'), ((903, 917), 'pyssian.chemistryutils.is_basis', 'is_basis', (['fake'], {}), '(fake)\n', (911, 917), False, 'from pyssian.chemistryutils import is_bas... |
"""
Objectives:
- Which players pass together the most?
- What types of position combintations are most frequent in pass-sequences?
"""
"""
Sample Run Script: python manage.py analysis3 --team_uuid="t1326"
--print_to_csv
python manage.py analysis4 --team_uuid="t1326" --start_date="2016-07-01"
python ... | [
"utils.f24_analysis.backtrack",
"utils.analysis.team_list_games",
"datetime.datetime.strptime",
"teams.models.Team.objects.get",
"utils.f24_analysis.parse_backtrack",
"utils.f24_analysis.identify_shots"
] | [((2198, 2252), 'datetime.datetime.strptime', 'datetime.datetime.strptime', (['arg_start_date', '"""%Y-%m-%d"""'], {}), "(arg_start_date, '%Y-%m-%d')\n", (2224, 2252), False, 'import datetime\n'), ((2270, 2322), 'datetime.datetime.strptime', 'datetime.datetime.strptime', (['arg_end_date', '"""%Y-%m-%d"""'], {}), "(arg_... |
#!/usr/bin/env ipython
import numpy as np
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
class gral():
def __init__(self):
self.name = ''
sh, mc = gral(), gral()
cr = gral()
cr.sh, cr.mc = gral(), gral()
vlo, vhi = 550.0, 3000.0 #550., 3000. #100.0, 450.0 #... | [
"numpy.loadtxt"
] | [((687, 707), 'numpy.loadtxt', 'np.loadtxt', (['fname_sh'], {}), '(fname_sh)\n', (697, 707), True, 'import numpy as np\n'), ((720, 740), 'numpy.loadtxt', 'np.loadtxt', (['fname_mc'], {}), '(fname_mc)\n', (730, 740), True, 'import numpy as np\n'), ((1005, 1025), 'numpy.loadtxt', 'np.loadtxt', (['fname_sh'], {}), '(fname... |
# Copyright 2018-2019 CRS4
#
# 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, softwa... | [
"os.listdir",
"cdo.Cdo",
"argparse.ArgumentParser",
"os.makedirs",
"os.path.splitext",
"os.getcwd",
"tdm.radar.utils.get_images",
"sys.stdout.flush",
"datetime.date.strftime"
] | [((1097, 1115), 'os.listdir', 'os.listdir', (['nc_dir'], {}), '(nc_dir)\n', (1107, 1115), False, 'import os\n'), ((1775, 1784), 'cdo.Cdo', 'cdo.Cdo', ([], {}), '()\n', (1782, 1784), False, 'import cdo\n'), ((2801, 2845), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '__doc__'}), '(descripti... |
import logging
from django.apps import apps
from django.contrib.auth.mixins import LoginRequiredMixin
from django.http import Http404, HttpResponse, JsonResponse
from django.views.generic import TemplateView, View
from zentral.core.stores import frontend_store
logger = logging.getLogger("server.base.views")
class H... | [
"logging.getLogger",
"django.http.HttpResponse",
"django.apps.apps.app_configs.items",
"django.http.JsonResponse"
] | [((272, 310), 'logging.getLogger', 'logging.getLogger', (['"""server.base.views"""'], {}), "('server.base.views')\n", (289, 310), False, 'import logging\n'), ((402, 420), 'django.http.HttpResponse', 'HttpResponse', (['"""OK"""'], {}), "('OK')\n", (414, 420), False, 'from django.http import Http404, HttpResponse, JsonRe... |
from libqtile.widget import base
from libqtile import bar, hook
__all__ = ['She']
class She(base._TextBox):
''' Widget to display the Super Hybrid Engine status.
can display either the mode or CPU speed on eeepc computers.'''
defaults = [
('device', '/sys/devices/platform/eeepc/cpufv', 'sys path... | [
"libqtile.widget.base._TextBox.draw",
"libqtile.widget.base._TextBox.__init__"
] | [((536, 581), 'libqtile.widget.base._TextBox.__init__', 'base._TextBox.__init__', (['self', '"""CPU"""'], {}), "(self, 'CPU', **config)\n", (558, 581), False, 'from libqtile.widget import base\n'), ((1477, 1501), 'libqtile.widget.base._TextBox.draw', 'base._TextBox.draw', (['self'], {}), '(self)\n', (1495, 1501), False... |
import sys
import requests
from statistics import mean, stdev
from bs4 import BeautifulSoup
import matplotlib.pyplot as plt
class Disco():
def __init__(self, artist):
self.website_url = "https://en.wikipedia.org"
disco_soup = self.get_disco_soup(artist)
album_urls = self.get_album_urls(dis... | [
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"requests.get",
"bs4.BeautifulSoup",
"matplotlib.pyplot.show"
] | [((427, 444), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (439, 444), False, 'import requests\n'), ((460, 502), 'bs4.BeautifulSoup', 'BeautifulSoup', (['html.content', '"""html.parser"""'], {}), "(html.content, 'html.parser')\n", (473, 502), False, 'from bs4 import BeautifulSoup\n'), ((2668, 2704), 'matpl... |
from django.conf.urls import url
from .views import (
add,
clear,
remove,
remove_single,
set_quantity,
show
)
urlpatterns = [
url(r'^show/$', show, name='carton-tests-show'),
url(r'^add/$', add, name='carton-tests-add'),
url(r'^remove/$', remove, name='carton-tests-remove'),
u... | [
"django.conf.urls.url"
] | [((157, 203), 'django.conf.urls.url', 'url', (['"""^show/$"""', 'show'], {'name': '"""carton-tests-show"""'}), "('^show/$', show, name='carton-tests-show')\n", (160, 203), False, 'from django.conf.urls import url\n'), ((210, 253), 'django.conf.urls.url', 'url', (['"""^add/$"""', 'add'], {'name': '"""carton-tests-add"""... |
from haystack.forms import FacetedSearchForm
from haystack.query import SQ
from django import forms
from hs_core.discovery_parser import ParseSQ, MatchingBracketsNotFoundError, \
FieldNotRecognizedError, InequalityNotAllowedError, MalformedDateError
FACETS_TO_SHOW = ['creator', 'contributor', 'owner', 'content_typ... | [
"django.forms.HiddenInput",
"haystack.query.SQ",
"django.forms.DateField",
"django.forms.Select",
"hs_core.discovery_parser.ParseSQ"
] | [((1117, 1167), 'django.forms.DateField', 'forms.DateField', ([], {'label': '"""From Date"""', 'required': '(False)'}), "(label='From Date', required=False)\n", (1132, 1167), False, 'from django import forms\n'), ((1183, 1231), 'django.forms.DateField', 'forms.DateField', ([], {'label': '"""To Date"""', 'required': '(F... |
from typing import Any, Dict, List
import datetime
import pandas as pd
import plotly.express as px
import plotly.figure_factory as ff
import plotly.graph_objects as go
import streamlit as st
from fbprophet import Prophet
from fbprophet.plot import plot_plotly
from plotly.subplots import make_subplots
from streamlit_p... | [
"streamlit_prophet.lib.exposition.expanders.display_expanders_performance",
"pandas.date_range",
"pandas.to_datetime",
"plotly.graph_objects.Bar",
"plotly.express.scatter",
"fbprophet.plot.plot_plotly",
"plotly.express.line",
"plotly.graph_objects.Scatter",
"streamlit.columns",
"plotly.figure_fact... | [((1846, 1908), 'streamlit_prophet.lib.exposition.expanders.display_expander', 'display_expander', (['readme', '"""overview"""', '"""More info on this plot"""'], {}), "(readme, 'overview', 'More info on this plot')\n", (1862, 1908), False, 'from streamlit_prophet.lib.exposition.expanders import display_expander, displa... |
from django.test import Client
from django.test import TestCase
from django.urls import reverse
from django.contrib.auth import get_user_model
from model_mommy import mommy
from django.conf import settings
User = get_user_model()
class RegisterViewTestCase(TestCase):
def setUp(self):
self.client = Client(... | [
"django.urls.reverse",
"django.contrib.auth.get_user_model",
"model_mommy.mommy.prepare",
"django.test.Client"
] | [((214, 230), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (228, 230), False, 'from django.contrib.auth import get_user_model\n'), ((313, 321), 'django.test.Client', 'Client', ([], {}), '()\n', (319, 321), False, 'from django.test import Client\n'), ((350, 378), 'django.urls.reverse', 'reve... |
"""
DUNE CVN generator module.
"""
__version__ = '1.0'
__author__ = '<NAME>, <NAME>'
__email__ = "<EMAIL>, <EMAIL>"
import numpy as np
import zlib
class DataGenerator(object):
''' Generate data for tf.keras.
'''
def __init__(self, cells=500, planes=500, views=3, batch_size=32,
images_pat... | [
"numpy.empty",
"numpy.random.shuffle"
] | [((2123, 2149), 'numpy.random.shuffle', 'np.random.shuffle', (['indexes'], {}), '(indexes)\n', (2140, 2149), True, 'import numpy as np\n'), ((2517, 2589), 'numpy.empty', 'np.empty', (['(self.batch_size, self.planes, self.cells, 1)'], {'dtype': '"""float32"""'}), "((self.batch_size, self.planes, self.cells, 1), dtype='f... |
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
def show_batch(ds: tf.data.Dataset,
classes: list,
rescale: bool = False,
size: tuple = (10, 10),
title: str = None):
"""
Function to show a batch of images including labels f... | [
"matplotlib.pyplot.imshow",
"numpy.ceil",
"numpy.argmax",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.suptitle",
"matplotlib.pyplot.show"
] | [((640, 664), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': 'size'}), '(figsize=size)\n', (650, 664), True, 'import matplotlib.pyplot as plt\n'), ((1464, 1505), 'matplotlib.pyplot.tight_layout', 'plt.tight_layout', ([], {'rect': '[0, 0.03, 1, 0.95]'}), '(rect=[0, 0.03, 1, 0.95])\n', (1480, 1505), True, 'im... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Makina custom grains
=====================
makina.upstart
true if using upstart
makina.lxc
true if inside an lxc container
makina.docker
true if inside a docker container
makina.devhost_num
devhost num if any
'''
import os
import copy
import subprocess... | [
"os.path.exists",
"os.listdir",
"os.readlink",
"subprocess.Popen",
"os.path.join",
"os.environ.get",
"os.path.dirname",
"copy.deepcopy"
] | [((5692, 5726), 'os.path.exists', 'os.path.exists', (['"""/var/log/upstart"""'], {}), "('/var/log/upstart')\n", (5706, 5726), False, 'import os\n'), ((4942, 4979), 'os.path.join', 'os.path.join', (['cfgdir', '"""makina-states"""'], {}), "(cfgdir, 'makina-states')\n", (4954, 4979), False, 'import os\n'), ((6633, 6652), ... |
from cgi import FieldStorage
from datetime import date
from io import BytesIO
from onegov.core.utils import Bunch
from onegov.form import Form
from onegov.wtfs.fields import HintField
from onegov.wtfs.fields import MunicipalityDataUploadField
class PostData(dict):
def getlist(self, key):
v = self[key]
... | [
"cgi.FieldStorage",
"onegov.form.Form",
"onegov.wtfs.fields.MunicipalityDataUploadField",
"io.BytesIO",
"onegov.core.utils.Bunch",
"datetime.date",
"onegov.wtfs.fields.HintField"
] | [((455, 461), 'onegov.form.Form', 'Form', ([], {}), '()\n', (459, 461), False, 'from onegov.form import Form\n'), ((1610, 1616), 'onegov.form.Form', 'Form', ([], {}), '()\n', (1614, 1616), False, 'from onegov.form import Form\n'), ((1629, 1669), 'onegov.wtfs.fields.HintField', 'HintField', ([], {'macro': '"""express_sh... |
from airflow import DAG
from airflow.utils.dates import days_ago
from anyway_etl_airflow.operators.cli_bash_operator import CliBashOperator
dag_kwargs = dict(
default_args={
'owner': 'airflow',
},
schedule_interval='@weekly',
catchup=False,
start_date=days_ago(2),
)
with DAG('cbs', **da... | [
"airflow.utils.dates.days_ago",
"anyway_etl_airflow.operators.cli_bash_operator.CliBashOperator",
"airflow.DAG"
] | [((305, 508), 'airflow.DAG', 'DAG', (['"""cbs"""'], {'description': '"""by default imports emails and processes data for (current year - 1). For back-fill do a manual run with following example json: {"load_start_year": 2019}"""'}), '(\'cbs\', **dag_kwargs, description=\n \'by default imports emails and processes da... |
import cc_dat_utils
#Part 1
input_dat_file = "data/pfgd_test.dat"
#Use cc_dat_utils.make_cc_level_pack_from_dat() to load the file specified by input_dat_file
#print the resulting data
data = cc_dat_utils.make_cc_level_pack_from_dat(input_dat_file)
print(data) | [
"cc_dat_utils.make_cc_level_pack_from_dat"
] | [((195, 251), 'cc_dat_utils.make_cc_level_pack_from_dat', 'cc_dat_utils.make_cc_level_pack_from_dat', (['input_dat_file'], {}), '(input_dat_file)\n', (235, 251), False, 'import cc_dat_utils\n')] |
'''
Created on Jun 14, 2020
@author: peter
'''
import sys
import re
import tarfile
from os import path
import xml.etree.ElementTree as ET
import logging
from gen_drum_kit.importer.importer_base import ImporterBase
from gen_drum_kit.builder.builder_hydrogen import Builder_Hydrogen
from gen_drum_kit.util ... | [
"logging.getLogger",
"os.path.exists",
"tarfile.open",
"xml.etree.ElementTree.parse",
"gen_drum_kit.builder.builder_hydrogen.Builder_Hydrogen",
"gen_drum_kit.util.dir_exists",
"os.path.basename",
"sys.exit",
"re.findall"
] | [((359, 386), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (376, 386), False, 'import logging\n'), ((1233, 1310), 'gen_drum_kit.builder.builder_hydrogen.Builder_Hydrogen', 'Builder_Hydrogen', ([], {'params': 'self._params', 'xml': 'self._xml', 'mapDB': 'self._channel_map'}), '(params=se... |
import matlab.engine
import matlab
import numpy as np
import PIL
import matplotlib.pyplot as plt
import sys
print(sys.version_info[0:2])
if sys.version_info[0:2] != (3, 8) and sys.version_info[0:2] != (3, 7) and sys.version_info[0:2] != (3, 6):
raise Exception('Requires python 3.6, 3.7, or 3.8')
eng = matlab.eng... | [
"PIL.Image.fromarray",
"PIL.Image.open",
"matlab.engine.start_matlab",
"numpy.ones",
"numpy.asarray",
"PIL.ImageOps.grayscale",
"matlab.double"
] | [((310, 338), 'matlab.engine.start_matlab', 'matlab.engine.start_matlab', ([], {}), '()\n', (336, 338), False, 'import matlab\n'), ((1282, 1317), 'numpy.ones', 'np.ones', (['(kernel_size, kernel_size)'], {}), '((kernel_size, kernel_size))\n', (1289, 1317), True, 'import numpy as np\n'), ((1354, 1371), 'numpy.asarray', ... |
from collections import defaultdict
import pieces
class RulesEnforcer(object):
"""
Enforces the rules of the game
Examines the move, and determines whether its a valid move or not.
"""
letter_dict = {'a':0,'b':1,'c':2,'d':3,'e':4,'f':5,'g':6,'h':7}
pos_letters = letter_dict.keys()
pos_nums... | [
"pieces.Bishop.moves",
"pieces.Knight.moves",
"pieces.Pawn.moves",
"pieces.King.moves",
"collections.defaultdict",
"pieces.Queen.moves",
"pieces.Rook.moves"
] | [((2898, 2911), 'collections.defaultdict', 'defaultdict', ([], {}), '()\n', (2909, 2911), False, 'from collections import defaultdict\n'), ((1670, 1713), 'pieces.Pawn.moves', 'pieces.Pawn.moves', (['cords', 'color', 'chessboard'], {}), '(cords, color, chessboard)\n', (1687, 1713), False, 'import pieces\n'), ((1782, 182... |
from skimage.util import img_as_float
from skimage import io, filters
# from skimage.viewer import ImageViewer
import numpy as np
def split_image_into_channels(image):
"""Look at each image separately"""
red_channel = image[:, :, 0]
green_channel = image[:, :, 1]
blue_channel = image[:, :, 2]
ret... | [
"numpy.clip",
"skimage.util.img_as_float",
"numpy.stack",
"skimage.io.imread",
"numpy.linspace",
"skimage.io.imsave",
"skimage.filters.gaussian"
] | [((460, 496), 'numpy.stack', 'np.stack', (['[red, green, blue]'], {'axis': '(2)'}), '([red, green, blue], axis=2)\n', (468, 496), True, 'import numpy as np\n'), ((607, 659), 'skimage.filters.gaussian', 'filters.gaussian', (['image'], {'sigma': '(10)', 'multichannel': '(True)'}), '(image, sigma=10, multichannel=True)\n'... |
from datetime import datetime
from backend.backend.classes_main import Order, OrderItemStateUpdate, OrderUpdate, StatusHistory
from backend.backend.exceptions import NoOrderFoundException
from backend.backend.repository import get_order_by_id, update_items, update_order_status, get_orders, create_order
from backend.ba... | [
"backend.backend.repository.update_order_status",
"backend.backend.repository.get_orders",
"backend.backend.delivery_integration.update_delivery_provider",
"backend.backend.repository.get_order_by_id",
"backend.backend.repository.update_items",
"backend.backend.exceptions.NoOrderFoundException",
"dateti... | [((1540, 1566), 'backend.backend.delivery_integration.update_delivery_provider', 'update_delivery_provider', ([], {}), '()\n', (1564, 1566), False, 'from backend.backend.delivery_integration import update_delivery_provider\n'), ((473, 485), 'backend.backend.repository.get_orders', 'get_orders', ([], {}), '()\n', (483, ... |
from botocore.configprovider import os, SmartDefaultsConfigStoreFactory
class AioSmartDefaultsConfigStoreFactory(SmartDefaultsConfigStoreFactory):
async def merge_smart_defaults(self, config_store, mode, region_name):
if mode == 'auto':
mode = await self.resolve_auto_mode(region_name)
... | [
"botocore.configprovider.os.environ.get"
] | [((742, 777), 'botocore.configprovider.os.environ.get', 'os.environ.get', (['"""AWS_EXECUTION_ENV"""'], {}), "('AWS_EXECUTION_ENV')\n", (756, 777), False, 'from botocore.configprovider import os, SmartDefaultsConfigStoreFactory\n'), ((808, 844), 'botocore.configprovider.os.environ.get', 'os.environ.get', (['"""AWS_DEFA... |
#!/usr/bin/python3
# This file is part of libmodulemd
# Copyright (C) 2017-2018 <NAME>
#
# Fedora-License-Identifier: MIT
# SPDX-2.0-License-Identifier: MIT
# SPDX-3.0-License-Identifier: MIT
#
# This program is free software.
# For more information on the license, see COPYING.
# For more information on free software,... | [
"gi.repository.Modulemd.Obsoletes.new",
"os.path.join",
"gi.require_version",
"gi.repository.Modulemd.ModuleIndex.new",
"gi.repository.Modulemd.ModuleStream.new",
"sys.exit",
"unittest.main"
] | [((454, 491), 'gi.require_version', 'gi.require_version', (['"""Modulemd"""', '"""2.0"""'], {}), "('Modulemd', '2.0')\n", (472, 491), False, 'import gi\n'), ((3275, 3290), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3288, 3290), False, 'import unittest\n'), ((737, 749), 'sys.exit', 'sys.exit', (['(77)'], {}), ... |
import logging
import pytest
from tests.common.utilities import wait_until
from utils import get_crm_resources, check_queue_status, sleep_to_wait
CRM_POLLING_INTERVAL = 1
CRM_DEFAULT_POLL_INTERVAL = 300
MAX_WAIT_TIME = 120
logger = logging.getLogger(__name__)
@pytest.fixture(scope='module')
def get_function_conple... | [
"logging.getLogger",
"utils.check_queue_status",
"utils.get_crm_resources",
"utils.sleep_to_wait",
"pytest.fixture"
] | [((235, 262), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (252, 262), False, 'import logging\n'), ((266, 296), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (280, 296), False, 'import pytest\n'), ((409, 453), 'pytest.fixture', 'pytest.fixtur... |
# ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# ---------------------------------------------------------
# Tests for classical explainer
from interpret_text.experimental.classical import ClassicalTextExplainer
from sklearn.model_selection impor... | [
"sklearn.model_selection.train_test_split",
"utils_test.get_mnli_test_dataset",
"sklearn.preprocessing.LabelEncoder",
"interpret_text.experimental.classical.ClassicalTextExplainer"
] | [((747, 777), 'utils_test.get_mnli_test_dataset', 'get_mnli_test_dataset', (['"""train"""'], {}), "('train')\n", (768, 777), False, 'from utils_test import get_mnli_test_dataset\n'), ((895, 958), 'sklearn.model_selection.train_test_split', 'train_test_split', (['X_str', 'ylabels'], {'train_size': '(0.8)', 'test_size': ... |
import argparse
from create_python_app.path_utils import *
from create_python_app.create_gitignore_file import create_gitignore_file
from create_python_app.create_license_file import create_license_file
from create_python_app.create_makefile_file import create_makefile_file
from create_python_app.create_readme_file imp... | [
"create_python_app.create_readme_file.create_readme_file",
"argparse.ArgumentParser",
"create_python_app.create_config_module.create_config_module",
"create_python_app.create_root_package.create_root_package",
"create_python_app.create_setup_file.create_setup_file",
"create_python_app.create_gitignore_fil... | [((729, 754), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (752, 754), False, 'import argparse\n'), ((956, 987), 'create_python_app.create_gitignore_file.create_gitignore_file', 'create_gitignore_file', (['base_dir'], {}), '(base_dir)\n', (977, 987), False, 'from create_python_app.create_giti... |
import time
class User:
"""
A class representing a users information.
NOTE: Defaults are attributes that pinylib expects
"""
def __init__(self, **kwargs):
# Default's.
self.lf = kwargs.get('lf')
self.account = kwargs.get('account', '')
self.is_owner = kwargs.get('ow... | [
"time.time"
] | [((697, 708), 'time.time', 'time.time', ([], {}), '()\n', (706, 708), False, 'import time\n')] |
# Copyright 2010 New Relic, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | [
"newrelic.common.object_wrapper.transient_function_wrapper",
"newrelic.common.encoding_utils.json_decode",
"newrelic.common.encoding_utils.serverless_payload_decode"
] | [((939, 1035), 'newrelic.common.object_wrapper.transient_function_wrapper', 'transient_function_wrapper', (['"""newrelic.core.data_collector"""', '"""ServerlessModeSession.finalize"""'], {}), "('newrelic.core.data_collector',\n 'ServerlessModeSession.finalize')\n", (965, 1035), False, 'from newrelic.common.object_wr... |
import argparse
import logging
from pathlib import Path
import dask
import h5py
import joblib
import numpy as np
import pandas as pd
from dask.diagnostics import ProgressBar
from tqdm import tqdm
from dsconcept.get_metrics import (
get_cat_inds,
get_synth_preds,
load_category_models,
load_concept_mode... | [
"logging.basicConfig",
"logging.getLogger",
"dsconcept.get_metrics.get_synth_preds",
"dask.delayed",
"dask.compute",
"pathlib.Path",
"argparse.ArgumentParser",
"dsconcept.get_metrics.get_cat_inds",
"dsconcept.get_metrics.load_concept_models",
"tqdm.tqdm",
"h5py.File",
"dsconcept.get_metrics.lo... | [((369, 408), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (388, 408), False, 'import logging\n'), ((415, 442), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (432, 442), False, 'import logging\n'), ((659, 715), 'numpy.load', 'np... |
"""Email module"""
#pylint: disable=too-few-public-methods
import json
import os
import falcon
import requests
from mako.template import Template
import sendgrid
from sendgrid.helpers.mail import Email, To, Content, Mail
from .hooks import validate_access
FROM_EMAIL = "<EMAIL>"
SUBJECT = "Appointment Offering"
SPREADS... | [
"json.loads",
"sendgrid.helpers.mail.Email",
"mako.template.Template",
"sendgrid.helpers.mail.Mail",
"falcon.get_http_status",
"sendgrid.SendGridAPIClient",
"os.environ.get",
"falcon.before"
] | [((345, 392), 'os.environ.get', 'os.environ.get', (['"""SPREADSHEETS_MICROSERVICE_URL"""'], {}), "('SPREADSHEETS_MICROSERVICE_URL')\n", (359, 392), False, 'import os\n'), ((429, 480), 'os.environ.get', 'os.environ.get', (['"""SPREADSHEETS_MICROSERVICE_API_KEY"""'], {}), "('SPREADSHEETS_MICROSERVICE_API_KEY')\n", (443, ... |
from flask import Flask, request
from flask import render_template
from flask_mysqldb import MySQL
import TimeCalc
from datetime import datetime, timedelta
app = Flask(__name__)
app.config['MYSQL_USER'] = 'root'
app.config['MYSQL_PASSWORD'] = 'password'
app.config['MYSQL_HOST'] = 'localhost'
app.config['MYSQL_DB'] = '... | [
"flask.render_template",
"TimeCalc.CalculateWaitTime",
"flask_mysqldb.MySQL",
"flask.Flask",
"datetime.datetime.now"
] | [((163, 178), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (168, 178), False, 'from flask import Flask, request\n'), ((384, 394), 'flask_mysqldb.MySQL', 'MySQL', (['app'], {}), '(app)\n', (389, 394), False, 'from flask_mysqldb import MySQL\n'), ((723, 768), 'TimeCalc.CalculateWaitTime', 'TimeCalc.Calcula... |
from conans import ConanFile, Meson, tools
from conans.errors import ConanInvalidConfiguration
import os
class LibnameConan(ConanFile):
name = "gtk"
description = "libraries used for creating graphical user interfaces for applications."
topics = ("conan", "gtk", "widgets")
url = "https://github.com/bi... | [
"conans.tools.SystemPackageTool",
"os.rename",
"conans.errors.ConanInvalidConfiguration",
"os.path.join",
"conans.tools.get",
"conans.tools.which",
"conans.tools.RunEnvironment",
"conans.tools.collect_libs",
"conans.Meson"
] | [((2848, 2901), 'conans.tools.get', 'tools.get', ([], {}), "(**self.conan_data['sources'][self.version])\n", (2857, 2901), False, 'from conans import ConanFile, Meson, tools\n'), ((2965, 3013), 'os.rename', 'os.rename', (['extracted_dir', 'self._source_subfolder'], {}), '(extracted_dir, self._source_subfolder)\n', (297... |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making BK-LOG 蓝鲸日志平台 available.
Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
BK-LOG 蓝鲸日志平台 is licensed under the MIT License.
License for BK-LOG 蓝鲸日志平台:
------------------------------------------------... | [
"celery.task.task",
"concurrent.futures.ThreadPoolExecutor",
"apps.log_search.models.LogIndexSet.objects.filter",
"apps.log_search.models.LogIndexSet.objects.get",
"apps.utils.log.logger.exception",
"apps.utils.log.logger.info",
"celery.schedules.crontab",
"apps.log_search.handlers.search.search_handl... | [((1998, 2010), 'apps.utils.lock.share_lock', 'share_lock', ([], {}), '()\n', (2008, 2010), False, 'from apps.utils.lock import share_lock\n'), ((4090, 4114), 'celery.task.task', 'task', ([], {'ignore_result': '(True)'}), '(ignore_result=True)\n', (4094, 4114), False, 'from celery.task import periodic_task, task\n'), (... |
import phonenumbers
from phonenumbers import geocoder
phone = input('type phone number format(+551100000000): ')
phone_number = phonenumbers.parse(phone)
print(geocoder.description_for_number(phone_number, 'pt'))
| [
"phonenumbers.parse",
"phonenumbers.geocoder.description_for_number"
] | [((130, 155), 'phonenumbers.parse', 'phonenumbers.parse', (['phone'], {}), '(phone)\n', (148, 155), False, 'import phonenumbers\n'), ((163, 214), 'phonenumbers.geocoder.description_for_number', 'geocoder.description_for_number', (['phone_number', '"""pt"""'], {}), "(phone_number, 'pt')\n", (194, 214), False, 'from phon... |
# Copyright (c) 2020, <NAME>, Honda Research Institute Europe GmbH, and
# Technical University of Darmstadt.
# 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 mus... | [
"numpy.array",
"pyrado.spaces.box.BoxSpace",
"pyrado.environment_wrappers.action_delay.ActDelayWrapper"
] | [((2046, 2079), 'pyrado.environment_wrappers.action_delay.ActDelayWrapper', 'ActDelayWrapper', (['mockenv'], {'delay': '(0)'}), '(mockenv, delay=0)\n', (2061, 2079), False, 'from pyrado.environment_wrappers.action_delay import ActDelayWrapper\n'), ((2416, 2449), 'pyrado.environment_wrappers.action_delay.ActDelayWrapper... |
import csv
import datetime
import io
import logging
import os
import tempfile
from typing import Any, Callable, List, Mapping, Optional, Set
import pandas as pd # type: ignore
from doltpy.cli import Dolt
from doltpy.shared.helpers import columns_to_rows
logger = logging.getLogger(__name__)
CREATE, FORCE_CREATE, RE... | [
"logging.getLogger",
"os.path.exists",
"csv.DictWriter",
"doltpy.shared.helpers.columns_to_rows",
"tempfile.mktemp",
"os.remove"
] | [((267, 294), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (284, 294), False, 'import logging\n'), ((4902, 4932), 'tempfile.mktemp', 'tempfile.mktemp', ([], {'suffix': '""".csv"""'}), "(suffix='.csv')\n", (4917, 4932), False, 'import tempfile\n'), ((5424, 5445), 'os.path.exists', 'os.pa... |
# @author <NAME>
# @copyright Copyright (c) 2008-2015, <NAME> aka LONGMAN (<EMAIL>)
# @link http://longman.me
# @license The MIT License (MIT)
import os
import sys
import re
import sublime
directory = os.path.dirname(os.path.realpath(__file__))
libs_path = os.path.join(director... | [
"sublime.version",
"re.compile",
"os.path.join",
"sublime.packages_path",
"os.path.realpath",
"sublime.platform",
"re.sub",
"sys.path.append",
"sublime.load_settings"
] | [((299, 329), 'os.path.join', 'os.path.join', (['directory', '"""lib"""'], {}), "(directory, 'lib')\n", (311, 329), False, 'import os\n'), ((259, 285), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (275, 285), False, 'import os\n'), ((365, 391), 'sys.path.append', 'sys.path.append', (['lib... |
from typing import List, Optional
from attr import dataclass
from fastapi import APIRouter, Security
from fastapi.exceptions import HTTPException
from fastapi import Header
from pydantic import BaseModel
from pydantic.tools import parse_obj_as
from splash.api.auth import get_current_user
from splash.service import Spl... | [
"fastapi.Security",
"fastapi.exceptions.HTTPException",
"fastapi.APIRouter",
"fastapi.Header"
] | [((494, 505), 'fastapi.APIRouter', 'APIRouter', ([], {}), '()\n', (503, 505), False, 'from fastapi import APIRouter, Security\n'), ((917, 943), 'fastapi.Security', 'Security', (['get_current_user'], {}), '(get_current_user)\n', (925, 943), False, 'from fastapi import APIRouter, Security\n'), ((1227, 1253), 'fastapi.Sec... |
#!/usr/bin/env libtbx.python
#
# iotbx.xds.xds_cbf.py
#
# <NAME>, Diamond Light Source, 2012/OCT/16
#
# Class to read the CBF files used in XDS
#
from __future__ import absolute_import, division, print_function
class reader:
"""A class to read the CBF files used in XDS"""
def __init__(self):
pass
def re... | [
"pycbf.cbf_handle_struct",
"numpy.fromstring"
] | [((412, 437), 'pycbf.cbf_handle_struct', 'pycbf.cbf_handle_struct', ([], {}), '()\n', (435, 437), False, 'import pycbf\n'), ((1127, 1170), 'numpy.fromstring', 'numpy.fromstring', (['image_string', 'numpy.int32'], {}), '(image_string, numpy.int32)\n', (1143, 1170), False, 'import numpy\n')] |
# utils for graphs of the networkx library
import copy
import networkx as nx
from networkx.algorithms.shortest_paths import shortest_path
from typing import Any, Union, Optional, Iterator, Iterable, Tuple, Dict, List, cast
LEFT = 0
RIGHT = 1
def top_nodes(graph: nx.Graph,
data: bool = False) -> Union[I... | [
"networkx.algorithms.shortest_paths.shortest_path",
"networkx.strongly_connected_components",
"networkx.Graph",
"networkx.draw_networkx_nodes",
"networkx.draw_networkx_labels",
"copy.deepcopy",
"networkx.draw_networkx_edges",
"typing.cast",
"networkx.draw"
] | [((1342, 1403), 'networkx.draw', 'nx.draw', (['graph'], {'pos': 'pos', 'with_labels': '(True)', 'font_weight': '"""bold"""'}), "(graph, pos=pos, with_labels=True, font_weight='bold')\n", (1349, 1403), True, 'import networkx as nx\n'), ((1515, 1568), 'networkx.draw_networkx_nodes', 'nx.draw_networkx_nodes', (['graph'], ... |
#-------------------------------------------------------------------------------------------------------
# Copyright (C) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
#-------------------------------------------------------------... | [
"os.path.exists",
"xml.dom.minidom.parse",
"os.makedirs",
"argparse.ArgumentParser",
"sys.exit"
] | [((26281, 26300), 'xml.dom.minidom.parse', 'DOM.parse', (['manifest'], {}), '(manifest)\n', (26290, 26300), True, 'import xml.dom.minidom as DOM\n'), ((28758, 28868), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Generates the Code required to instrument LTTtng logging mechanism"""'}), ... |
"""
Handles all requests that coming from phone
"""
import socketserver
import bot
from bot import TVBot
class TCPSocketHandler(socketserver.StreamRequestHandler):
"""
Handles the tcp socket connection
"""
def handle(self):
self.bot = TVBot()
while True:
self.data = ... | [
"bot.TVBot"
] | [((268, 275), 'bot.TVBot', 'TVBot', ([], {}), '()\n', (273, 275), False, 'from bot import TVBot\n')] |
import yaml
from javaSerializationTools import JavaString, JavaField, JavaObject, JavaEndBlock
from javaSerializationTools import ObjectRead
from javaSerializationTools import ObjectWrite
if __name__ == '__main__':
with open("../files/7u21.ser", "rb") as f:
a = ObjectRead(f)
obj = a.readContent()... | [
"javaSerializationTools.JavaEndBlock",
"javaSerializationTools.JavaString",
"javaSerializationTools.ObjectRead",
"javaSerializationTools.JavaObject",
"javaSerializationTools.JavaField",
"javaSerializationTools.ObjectWrite"
] | [((277, 290), 'javaSerializationTools.ObjectRead', 'ObjectRead', (['f'], {}), '(f)\n', (287, 290), False, 'from javaSerializationTools import ObjectRead\n'), ((379, 436), 'javaSerializationTools.JavaString', 'JavaString', (['"""Ljava/beans/beancontext/BeanContextSupport;"""'], {}), "('Ljava/beans/beancontext/BeanContex... |
import asyncio
import uuid
class MockChannel:
def __init__(self):
self.published = []
self.acked = []
self.nacked = []
async def publish(self, *args, **kwargs):
self.published.append({"args": args, "kwargs": kwargs})
async def basic_client_ack(self, *args, **kwargs):
... | [
"uuid.uuid4",
"asyncio.sleep"
] | [((3441, 3460), 'asyncio.sleep', 'asyncio.sleep', (['(0.06)'], {}), '(0.06)\n', (3454, 3460), False, 'import asyncio\n'), ((1496, 1515), 'asyncio.sleep', 'asyncio.sleep', (['(0.02)'], {}), '(0.02)\n', (1509, 1515), False, 'import asyncio\n'), ((3935, 3954), 'asyncio.sleep', 'asyncio.sleep', (['(0.05)'], {}), '(0.05)\n'... |
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^bot/', views.webhook, name='bot'),
url(r'^foodcenter/', views.food_center_webhook, name= 'food'),
# url(r'^relay/', vi)
] | [
"django.conf.urls.url"
] | [((74, 113), 'django.conf.urls.url', 'url', (['"""^bot/"""', 'views.webhook'], {'name': '"""bot"""'}), "('^bot/', views.webhook, name='bot')\n", (77, 113), False, 'from django.conf.urls import url\n'), ((120, 179), 'django.conf.urls.url', 'url', (['"""^foodcenter/"""', 'views.food_center_webhook'], {'name': '"""food"""... |
"""Common configure functions for bgp"""
# Python
import logging
import re
# Unicon
from unicon.core.errors import SubCommandFailure
log = logging.getLogger(__name__)
def configure_l2vpn_storm_control(
device, interface, service_instance_id, storm_control
):
""" Configures storm control under service insta... | [
"logging.getLogger"
] | [((142, 169), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (159, 169), False, 'import logging\n')] |
from os import environ
from MagiSlack.io import MagiIO
from MagiSlack.module import MagiModule
def hello_world(*args, **kwargs):
return f"HELLO WORLD! user {kwargs['name']}, {kwargs['display_name']}"
if __name__ == '__main__':
print('Magi Start!')
print('='*30)
print('MagiModule Initializing.')
... | [
"MagiSlack.module.MagiModule.MagiModule",
"MagiSlack.io.MagiIO.MagiIO"
] | [((330, 379), 'MagiSlack.module.MagiModule.MagiModule', 'MagiModule.MagiModule', (["environ['SLACK_API_TOKEN']"], {}), "(environ['SLACK_API_TOKEN'])\n", (351, 379), False, 'from MagiSlack.module import MagiModule\n'), ((464, 485), 'MagiSlack.io.MagiIO.MagiIO', 'MagiIO.MagiIO', (['module'], {}), '(module)\n', (477, 485)... |
def get_dosages(connection):
cursor = connection.cursor()
query = ("SELECT * from dosage")
cursor.execute(query)
response = []
for (dosage_id, dosage_name) in cursor:
response.append({
'dosage_id': dosage_id,
'dosage_name': dosage_name
})
retur... | [
"sql_connection.get_sql_connection"
] | [((434, 454), 'sql_connection.get_sql_connection', 'get_sql_connection', ([], {}), '()\n', (452, 454), False, 'from sql_connection import get_sql_connection\n')] |
import jtweeter
access_token = "TWITTER_APP_ACCESS_TOKEN"
access_token_secret = "TWITTER_APP_ACCESS_TOKEN_SECRET"
consumer_key = "TWITTER_APP_CONSUMER_KEY"
consumer_secret = "TWITTER_APP_CONSUMER_SECRET"
user_id = 000000000 #user id of twitter user to simulate.
def main():
jtweeter.tweet(access_token, ac... | [
"jtweeter.tweet"
] | [((289, 382), 'jtweeter.tweet', 'jtweeter.tweet', (['access_token', 'access_token_secret', 'consumer_key', 'consumer_secret', 'user_id'], {}), '(access_token, access_token_secret, consumer_key,\n consumer_secret, user_id)\n', (303, 382), False, 'import jtweeter\n')] |
import pickle
import numpy as np
def fetch_file(path):
with open(path, 'rb') as fp:
return pickle.load(fp)
def fetch_adj_mat(column):
if column == 0:
return A1
elif column == 1:
return A2
elif column == 2:
return A3
# elif column == 3:
# return A4
print(... | [
"pickle.dump",
"numpy.linalg.eig",
"pickle.load",
"numpy.array",
"numpy.linalg.norm"
] | [((1745, 1774), 'numpy.array', 'np.array', (['krp'], {'dtype': 'np.float'}), '(krp, dtype=np.float)\n', (1753, 1774), True, 'import numpy as np\n'), ((1871, 1896), 'numpy.linalg.eig', 'np.linalg.eig', (['kr_product'], {}), '(kr_product)\n', (1884, 1896), True, 'import numpy as np\n'), ((1992, 2018), 'numpy.linalg.norm'... |
"""
Module comparison superimposes most probable local density, maximum
cooperativity, time of maximum cooperativity and ratio of transversal and
longitudinal correlations at time of maximum cooperativity, as functions of
the Péclet number, for different trajectories in the phase diagram (either
varying persistence tim... | [
"active_particles.naming.AHB2D",
"active_particles.naming.Cee",
"matplotlib.rcParams.update",
"matplotlib.pyplot.show",
"active_particles.naming.Cww",
"active_particles.plot.pphiloc.Philoc",
"active_particles.plot.chi_msd.ChiMsd",
"matplotlib.lines.Line2D",
"active_particles.init.get_env",
"active... | [((8387, 8402), 'active_particles.init.get_env', 'get_env', (['"""HOME"""'], {}), "('HOME')\n", (8394, 8402), False, 'from active_particles.init import get_env, get_env_list\n'), ((8551, 8576), 'active_particles.init.get_env_list', 'get_env_list', (['"""VARIABLES"""'], {}), "('VARIABLES')\n", (8563, 8576), False, 'from... |
# Generated by Django 2.2.15 on 2021-01-29 22:55
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('sitewebapp', '0013_auto_20210130_0409'),
]
operations = [
migrations.RemoveField(
model_name='... | [
"django.db.migrations.RemoveField",
"django.db.models.ForeignKey"
] | [((272, 341), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""auditionrounds"""', 'name': '"""candidate"""'}), "(model_name='auditionrounds', name='candidate')\n", (294, 341), False, 'from django.db import migrations, models\n'), ((496, 641), 'django.db.models.ForeignKey', 'models.... |
import urllib.request
from urllib.parse import urlencode
from json import loads
from socket import timeout
from ssl import _create_unverified_context
from corsair import *
class Api(object):
def __init__(self, base_url, auth, tls_verify=True):
self.base_url = base_url if base_url[-1] != '/' else base_ur... | [
"urllib.parse.urlencode",
"ssl._create_unverified_context"
] | [((2902, 2930), 'ssl._create_unverified_context', '_create_unverified_context', ([], {}), '()\n', (2928, 2930), False, 'from ssl import _create_unverified_context\n'), ((3298, 3316), 'urllib.parse.urlencode', 'urlencode', (['filters'], {}), '(filters)\n', (3307, 3316), False, 'from urllib.parse import urlencode\n'), ((... |
from queue import Queue
def convert_arr_to_binary_tree(arr):
"""
Takes arr representing level-order traversal of Binary Tree
"""
index = 0
length = len(arr)
if length <= 0 or arr[0] == -1:
return None
root = BinaryTreeNode(arr[index])
index += 1
queue = Queue()
qu... | [
"queue.Queue"
] | [((306, 313), 'queue.Queue', 'Queue', ([], {}), '()\n', (311, 313), False, 'from queue import Queue\n')] |
import os
PROJECT_DIR = os.path.dirname(os.path.abspath(__file__))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
('<NAME>', '<EMAIL>'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'data.sqlite'
}
}
ALLOWED_HOSTS = ['*']
TIME_ZONE = '... | [
"os.path.abspath",
"os.path.join"
] | [((1455, 1493), 'os.path.join', 'os.path.join', (['PROJECT_DIR', '"""templates"""'], {}), "(PROJECT_DIR, 'templates')\n", (1467, 1493), False, 'import os\n'), ((41, 66), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (56, 66), False, 'import os\n')] |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#
import json
from pathlib import Path
import pytest
import cc_net
import cc_net.minify as minify
from cc_net import jsonql, process_wet_fil... | [
"cc_net.process_wet_file.CCSegmentsReader",
"cc_net.minify._b2i",
"pathlib.Path",
"cc_net.minify.encode_hashes",
"cc_net.minify.get_hashes",
"cc_net.jsonql.open_write",
"json.dumps",
"cc_net.minify.decode_hashes",
"cc_net.minify.Minifier",
"cc_net.minify.encode_line_ids",
"cc_net.minify.Metadata... | [((548, 569), 'cc_net.minify.get_hashes', 'get_hashes', (['sentences'], {}), '(sentences)\n', (558, 569), False, 'from cc_net.minify import HASH_SIZE, decode_hashes, encode_hashes, encode_line_ids, get_hashes\n'), ((688, 709), 'cc_net.minify.encode_hashes', 'encode_hashes', (['hashes'], {}), '(hashes)\n', (701, 709), F... |
##bu python kodu, selenium ve chromedriver ile çalışmakta, siteyi normal kullanıcı gibi ziyaret edip, gerekli verileri parse ediyor
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
import os
from bs4 import BeautifulSoup
import time, datetime
import json
import requests
import sys
... | [
"selenium.webdriver.chrome.options.Options",
"ftplib.FTP",
"selenium.webdriver.Chrome",
"json.dumps",
"requests.get",
"time.sleep",
"os.getcwd",
"sys.exc_info",
"json.dump"
] | [((351, 360), 'selenium.webdriver.chrome.options.Options', 'Options', ([], {}), '()\n', (358, 360), False, 'from selenium.webdriver.chrome.options import Options\n'), ((521, 599), 'selenium.webdriver.Chrome', 'webdriver.Chrome', ([], {'chrome_options': 'chrome_options', 'executable_path': 'chrome_driver'}), '(chrome_op... |
from typing import List, overload
from flow.envs.multiagent.traffic_light_grid import MultiTrafficLightGridPOEnv
from flow.envs.traffic_light_grid import TrafficLightGridPOEnv
from gym.spaces import Box, Discrete
import numpy as np
ID_IDX = 1
class SeqTraffiLightEnv(TrafficLightGridPOEnv):
def __init__(self, en... | [
"numpy.append",
"numpy.array",
"numpy.concatenate",
"gym.spaces.Box"
] | [((1060, 1229), 'gym.spaces.Box', 'Box', ([], {'low': '(0.0)', 'high': '(1)', 'shape': '(self.num_traffic_lights, 3 * 4 * self.num_observed + 2 * self.\n num_local_edges + 2 * (1 + self.num_local_lights))', 'dtype': 'np.float32'}), '(low=0.0, high=1, shape=(self.num_traffic_lights, 3 * 4 * self.\n num_observed + ... |
import gin
import torch
import logging
from sparse_causal_model_learner_rl.metrics import find_value, find_key
@gin.configurable
def AnnealerThresholdSelector(config, config_object, epoch_info, temp,
adjust_every=100,
multiplier=10, # allow the lo... | [
"sparse_causal_model_learner_rl.metrics.find_value",
"torch.nn.init.xavier_uniform_",
"gin.bind_parameter",
"gin.query_parameter",
"logging.warning",
"torch.nn.init.zeros_",
"gin.unlock_config",
"torch.no_grad",
"logging.info"
] | [((3912, 3972), 'gin.query_parameter', 'gin.query_parameter', (['f"""{gin_annealer_cls}.source_metric_key"""'], {}), "(f'{gin_annealer_cls}.source_metric_key')\n", (3931, 3972), False, 'import gin\n'), ((4290, 4346), 'gin.query_parameter', 'gin.query_parameter', (['f"""{gin_annealer_cls}.fit_threshold"""'], {}), "(f'{g... |
import os
# filters
FILTERS = {
'min_bathrooms': 1,
'min_bedrooms': 3
}
## Location preferences
# The Craigslist site you want to search on.
# For instance, https://sfbay.craigslist.org is SF and the Bay Area.
# You only need the beginning of the URL.
CRAIGSLIST_SITE = 'sfbay'
# What Craigslist subdirectorie... | [
"os.getenv"
] | [((5037, 5065), 'os.getenv', 'os.getenv', (['"""SLACK_TOKEN"""', '""""""'], {}), "('SLACK_TOKEN', '')\n", (5046, 5065), False, 'import os\n')] |
import os
import scipy.io.wavfile
import matplotlib.pyplot as plt
import numpy as np
import os
import random
'''
Create a random dataset with three different frequencies that are always in fase.
Frequencies will be octave [440, 880, 1320].
'''
fs = 16000
x1 = scipy.io.wavfile.read('corpus/Analysis/a440.wav')[1]
x2 ... | [
"numpy.argmax",
"numpy.asarray",
"os.path.join",
"random.randint"
] | [((773, 794), 'random.randint', 'random.randint', (['(5)', '(10)'], {}), '(5, 10)\n', (787, 794), False, 'import random\n'), ((926, 946), 'random.randint', 'random.randint', (['(0)', '(6)'], {}), '(0, 6)\n', (940, 946), False, 'import random\n'), ((1389, 1455), 'os.path.join', 'os.path.join', (['"""corpus"""', '"""panF... |
import unittest
import game.engine.dice as dice
class DiceRollTest(unittest.TestCase):
def test_dice_roll(self):
roll = dice.roll()
self.assertGreaterEqual(roll, 1)
self.assertLessEqual(roll, 6)
| [
"game.engine.dice.roll"
] | [((134, 145), 'game.engine.dice.roll', 'dice.roll', ([], {}), '()\n', (143, 145), True, 'import game.engine.dice as dice\n')] |
""" This module contains a pytorch dataset for learning peptide embeddings.
In particular, each "instance" of the dataset comprises two peptide sequences,
as well as the sNebula similarity between them. The sNebula distance reflects
the BLOSSUM similarity transformed from 0 to 1.
"""
import logging
logger = logging.ge... | [
"logging.getLogger",
"numpy.clip",
"pyllars.string_utils.encode_all_sequences",
"torch.as_tensor",
"numpy.random.default_rng",
"lifesci.sequence_similarity_utils.get_snebula_score",
"lifesci.peptide_dataset.PeptideDataset.load"
] | [((310, 337), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (327, 337), False, 'import logging\n'), ((3411, 3443), 'numpy.random.default_rng', 'np.random.default_rng', (['self.seed'], {}), '(self.seed)\n', (3432, 3443), True, 'import numpy as np\n'), ((3467, 3552), 'lifesci.peptide_datas... |
"""Combines all components
The `sidebar` component combines all the inputs while other components potentially
have callbacks.
To add or remove components, adjust the `setup`.
If callbacks are present, also adjust `CALLBACK_INPUTS`, `CALLBACK_OUTPUTS` and
`callback_body`.
"""
from collections import OrderedDict
from ... | [
"collections.OrderedDict",
"chime_dash.app.components.sidebar.Sidebar",
"chime_dash.app.components.intro.Intro",
"chime_dash.app.components.additions.Additions",
"chime_dash.app.components.visualizations.Visualizations",
"chime_dash.app.components.definitions.Definitions",
"chime_dash.app.components.int... | [((1954, 1967), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (1965, 1967), False, 'from collections import OrderedDict\n'), ((3618, 3635), 'penn_chime.models.SimSirModel', 'SimSirModel', (['pars'], {}), '(pars)\n', (3629, 3635), False, 'from penn_chime.models import SimSirModel\n'), ((1432, 1459), 'chime... |
"""crwal_and_scrap trying to gathering news with web scrawl"""
from crwal_and_scrap.main import main
main()
| [
"crwal_and_scrap.main.main"
] | [((103, 109), 'crwal_and_scrap.main.main', 'main', ([], {}), '()\n', (107, 109), False, 'from crwal_and_scrap.main import main\n')] |
from dataclasses import dataclass, field
from typing import List
__NAMESPACE__ = "a"
@dataclass
class Nametest:
choice: List[object] = field(
default_factory=list,
metadata={
"type": "Elements",
"choices": (
{
"name": "_ele",
... | [
"dataclasses.field"
] | [((142, 620), 'dataclasses.field', 'field', ([], {'default_factory': 'list', 'metadata': "{'type': 'Elements', 'choices': ({'name': '_ele', 'type': str, 'namespace':\n 'a'}, {'name': '_-', 'type': str, 'namespace': 'a'}, {'name': '_.',\n 'type': str, 'namespace': 'a'}, {'name': '_9', 'type': str, 'namespace':\n ... |
import pprint
from app.models import Cepage
data = []
counter = 0
with open('static_data.tsv', 'r') as file:
for line in file:
if counter == 0:
headers = line.split('\t')
print(len(headers))
else:
print(len(line.split('\t')))
data.append(dict(zip(head... | [
"app.models.Cepage",
"pprint.pprint"
] | [((389, 408), 'pprint.pprint', 'pprint.pprint', (['data'], {}), '(data)\n', (402, 408), False, 'import pprint\n'), ((1090, 1269), 'app.models.Cepage', 'Cepage', ([], {'id': 'id_', 'name': 'name', 'regions': 'regions', 'vignobles': 'vignobles', 'sous_regions': 'sous_regions', 'superficie_france': 'superficie_france', 's... |
from tastypie.api import Api
from encuestas.api.user import UserResource
from encuestas.api.encuesta import EncuestaResource
from encuestas.api.grupo import GrupoResource
from encuestas.api.pregunta import PreguntaResource
from encuestas.api.opcion import OpcionResource
from encuestas.api.link import LinkResource
from ... | [
"encuestas.api.encuesta.EncuestaResource",
"encuestas.api.link.LinkResource",
"encuestas.api.user.UserResource",
"tastypie.api.Api",
"encuestas.api.grupo.GrupoResource",
"encuestas.api.pregunta.PreguntaResource",
"encuestas.api.opcion.OpcionResource",
"encuestas.api.respuesta.RespuestaResource"
] | [((380, 398), 'tastypie.api.Api', 'Api', ([], {'api_name': '"""v1"""'}), "(api_name='v1')\n", (383, 398), False, 'from tastypie.api import Api\n'), ((415, 429), 'encuestas.api.user.UserResource', 'UserResource', ([], {}), '()\n', (427, 429), False, 'from encuestas.api.user import UserResource\n'), ((447, 465), 'encuest... |
"""
An interface for handling sets of ReadsAlignments.
"""
from pprint import pprint
from SetAPI.generic.SetInterfaceV1 import SetInterfaceV1
from SetAPI import util
class ReadsAlignmentSetInterfaceV1:
def __init__(self, workspace_client):
self.workspace_client = workspace_client
self.set_interfa... | [
"SetAPI.util.populate_item_object_ref_paths",
"SetAPI.util.check_reference",
"SetAPI.generic.SetInterfaceV1.SetInterfaceV1"
] | [((325, 357), 'SetAPI.generic.SetInterfaceV1.SetInterfaceV1', 'SetInterfaceV1', (['workspace_client'], {}), '(workspace_client)\n', (339, 357), False, 'from SetAPI.generic.SetInterfaceV1 import SetInterfaceV1\n'), ((5211, 5273), 'SetAPI.util.populate_item_object_ref_paths', 'util.populate_item_object_ref_paths', (['ali... |
import collections
import inspect
import json
import jsonschema
import os
import sys
from pprint import pprint
from slugify import slugify
from ...dicthelpers import data_merge
from ..basestore import LinkedStore, linkages
from ..basestore import HeritableDocumentSchema, JSONSchemaCollection, formatChecker
from ..base... | [
"slugify.slugify"
] | [((3095, 3163), 'slugify.slugify', 'slugify', (['textstring'], {'stopwords': 'stopwords', 'lowercase': 'case_insensitive'}), '(textstring, stopwords=stopwords, lowercase=case_insensitive)\n', (3102, 3163), False, 'from slugify import slugify\n')] |
from copy import deepcopy
import pytest
from snuba.clickhouse.columns import (
UUID,
AggregateFunction,
Array,
ColumnType,
Date,
DateTime,
Enum,
FixedString,
Float,
IPv4,
IPv6,
Nested,
ReadOnly,
)
from snuba.clickhouse.columns import SchemaModifiers as Modifier
from ... | [
"snuba.clickhouse.columns.IPv6",
"snuba.clickhouse.columns.Date",
"snuba.clickhouse.columns.UUID",
"snuba.clickhouse.columns.DateTime",
"snuba.clickhouse.columns.Float",
"pytest.mark.parametrize",
"snuba.clickhouse.columns.SchemaModifiers",
"snuba.clickhouse.columns.UInt",
"snuba.clickhouse.columns.... | [((2792, 2881), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""col_type, raw_type, different_type, for_schema"""', 'TEST_CASES'], {}), "('col_type, raw_type, different_type, for_schema',\n TEST_CASES)\n", (2815, 2881), False, 'import pytest\n'), ((448, 456), 'snuba.clickhouse.columns.String', 'String', ... |
from collections import defaultdict
import itertools
import numpy as np
import pickle
import time
import warnings
from Analysis import binomial_pgf, BranchModel, StaticModel
from simulators.fires.UrbanForest import UrbanForest
from Policies import NCTfires, UBTfires, DWTfires, RHTfires, USTfires
from Utilities import ... | [
"Utilities.equivalent_percolation_control",
"time.clock",
"Utilities.urban_boundary",
"simulators.fires.UrbanForest.UrbanForest",
"Utilities.percolation_parameter",
"itertools.product",
"numpy.exp",
"numpy.random.seed",
"Utilities.fire_boundary",
"numpy.amin",
"Policies.NCTfires",
"numpy.floor... | [((423, 445), 'numpy.seterr', 'np.seterr', ([], {'all': '"""raise"""'}), "(all='raise')\n", (432, 445), True, 'import numpy as np\n'), ((575, 590), 'numpy.exp', 'np.exp', (['(-1 / 10)'], {}), '(-1 / 10)\n', (581, 590), True, 'import numpy as np\n'), ((597, 624), 'Utilities.percolation_parameter', 'percolation_parameter... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Functional tests for `ugetcli` package - `create` command.
Tests functionality of the cli create command with various options.
"""
import os
import unittest
import json
from click.testing import CliRunner
from mock import MagicMock, patch
from ugetcli import cli
from... | [
"mock.patch",
"os.makedirs",
"json.dumps",
"click.testing.CliRunner",
"os.path.isfile",
"os.path.normpath",
"ugetcli.utils.create_empty_file",
"mock.MagicMock"
] | [((481, 509), 'mock.patch', 'patch', (['"""ugetcli.uget.CsProj"""'], {}), "('ugetcli.uget.CsProj')\n", (486, 509), False, 'from mock import MagicMock, patch\n'), ((515, 555), 'mock.patch', 'patch', (['"""ugetcli.uget.UnityPackageRunner"""'], {}), "('ugetcli.uget.UnityPackageRunner')\n", (520, 555), False, 'from mock im... |
#! /usr/bin/env python
import re
import pandas as pd
from numpy import interp
import os
from pathlib import Path
home = os.environ['HOME']
home_dir = Path(home)
work_dir = home_dir / 'Programming/Python/python-exercises/hackerrank'
# 12/14/2012 16:00:00 Missing_19
pattern = re.compile(r'(\d{1,2}/\d{1,2}/2012)\s+(16:... | [
"pandas.to_datetime",
"re.compile",
"pandas.read_csv",
"pathlib.Path"
] | [((152, 162), 'pathlib.Path', 'Path', (['home'], {}), '(home)\n', (156, 162), False, 'from pathlib import Path\n'), ((278, 352), 're.compile', 're.compile', (['"""(\\\\d{1,2}/\\\\d{1,2}/2012)\\\\s+(16:00:00)\\\\s+(Missing_\\\\d{1,2})"""'], {}), "('(\\\\d{1,2}/\\\\d{1,2}/2012)\\\\s+(16:00:00)\\\\s+(Missing_\\\\d{1,2})')... |
from __future__ import print_function
import os
import itertools, pkg_resources, sys
from distutils.version import LooseVersion
if LooseVersion(pkg_resources.get_distribution("chainer").version) >= LooseVersion('7.0.0') and \
sys.version_info.major == 2:
print('''Please install chainer <= 7.0.0:
sudo pip in... | [
"chainer.links.Convolution2D",
"os.path.exists",
"chainer.dataset.cached_download",
"chainer.dataset.get_dataset_directory",
"chainer.functions.concat",
"chainer.serializers.save_npz",
"os.path.splitext",
"os.path.join",
"chainer.links.caffe.CaffeFunction",
"chainer.functions.max_pooling_2d",
"o... | [((428, 439), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (436, 439), False, 'import itertools, pkg_resources, sys\n'), ((720, 731), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (728, 731), False, 'import itertools, pkg_resources, sys\n'), ((19383, 19408), 'os.path.exists', 'os.path.exists', (['dest_path'], {}),... |
from __future__ import absolute_import, division, print_function
from wxtbx import phil_controls
import wxtbx
from libtbx.utils import Abort, to_unicode, to_str
from libtbx import Auto
import wx
import sys
class ValidatedTextCtrl(wx.TextCtrl, phil_controls.PhilCtrl):
def __init__(self, *args, **kwds):
saved_val... | [
"libtbx.utils.to_unicode",
"libtbx.utils.Abort",
"wx.TextCtrl.Enable",
"wx.TextCtrl.GetValue",
"wx.SystemSettings_GetColour",
"libtbx.utils.to_str",
"wx.MessageBox",
"wxtbx.is_unicode_build",
"wx.Font",
"wx.PyValidator.__init__"
] | [((497, 562), 'wx.Font', 'wx.Font', (['wxtbx.default_font_size', 'wx.MODERN', 'wx.NORMAL', 'wx.NORMAL'], {}), '(wxtbx.default_font_size, wx.MODERN, wx.NORMAL, wx.NORMAL)\n', (504, 562), False, 'import wx\n'), ((1066, 1092), 'wx.TextCtrl.GetValue', 'wx.TextCtrl.GetValue', (['self'], {}), '(self)\n', (1086, 1092), False,... |
import base64
import datetime
import io
import json
import traceback
import aiohttp
import discord
import pytimeparse
from data.services.guild_service import guild_service
from discord.commands import Option, slash_command, message_command, user_command
from discord.ext import commands
from discord.utils import forma... | [
"discord.Color.blurple",
"discord.commands.user_command",
"discord.ext.commands.CooldownMapping.from_cooldown",
"utils.permissions.checks.whisper_in_general",
"io.BytesIO",
"utils.permissions.slash_perms.slash_perms.mod_and_up",
"data.services.guild_service.guild_service.get_guild",
"discord.utils.for... | [((4882, 4891), 'utils.permissions.checks.whisper', 'whisper', ([], {}), '()\n', (4889, 4891), False, 'from utils.permissions.checks import PermissionsFailure, mod_and_up, whisper, whisper_in_general\n'), ((4897, 5004), 'discord.commands.slash_command', 'slash_command', ([], {'guild_ids': '[cfg.guild_id]', 'description... |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: crud/Paging.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.pro... | [
"google.protobuf.reflection.GeneratedProtocolMessageType",
"google.protobuf.symbol_database.Default",
"google.protobuf.descriptor.FieldDescriptor",
"google.protobuf.descriptor.FileDescriptor"
] | [((417, 443), 'google.protobuf.symbol_database.Default', '_symbol_database.Default', ([], {}), '()\n', (441, 443), True, 'from google.protobuf import symbol_database as _symbol_database\n'), ((459, 1006), 'google.protobuf.descriptor.FileDescriptor', '_descriptor.FileDescriptor', ([], {'name': '"""crud/Paging.proto"""',... |
# -*- coding: utf-8 -*-
""" BLEND
This module defines classes and methods for blending images.
:Author: <NAME> <<EMAIL>>
"""
import numpy as np
from lmfit import Model
from lmfit.models import GaussianModel, ConstantModel
from modopt.base.np_adjust import pad2d
from sf_tools.image.stamp import postage_stamp
from s... | [
"numpy.prod",
"numpy.copy",
"numpy.arange",
"modopt.base.np_adjust.pad2d",
"sf_tools.image.distort.recentre",
"numpy.sin",
"numpy.max",
"numpy.array",
"numpy.random.randint",
"lmfit.models.GaussianModel",
"numpy.random.seed",
"numpy.around",
"numpy.cos",
"numpy.random.ranf",
"numpy.pad",... | [((610, 631), 'numpy.array', 'np.array', (['stamp_shape'], {}), '(stamp_shape)\n', (618, 631), True, 'import numpy as np\n'), ((1178, 1193), 'lmfit.models.GaussianModel', 'GaussianModel', ([], {}), '()\n', (1191, 1193), False, 'from lmfit.models import GaussianModel, ConstantModel\n'), ((1472, 1493), 'numpy.arange', 'n... |
__copyright__ = "Copyright 2013-2016, http://radical.rutgers.edu"
__license__ = "MIT"
import os
import time
import threading as mt
import radical.utils as ru
from . import utils as rpu
from . import states as rps
from . import constants as rpc
from . import compute_unit_description as rpcud
# bulk call... | [
"radical.utils.RLock",
"os.environ.get",
"radical.utils.as_list",
"time.sleep",
"threading.Event",
"radical.utils.atfork",
"radical.utils.Config",
"time.time",
"radical.utils.generate_id"
] | [((2898, 2926), 'radical.utils.RLock', 'ru.RLock', (['"""umgr.pilots_lock"""'], {}), "('umgr.pilots_lock')\n", (2906, 2926), True, 'import radical.utils as ru\n'), ((2990, 3017), 'radical.utils.RLock', 'ru.RLock', (['"""umgr.units_lock"""'], {}), "('umgr.units_lock')\n", (2998, 3017), True, 'import radical.utils as ru\... |
'''Escreva um programa que solicite ao usuário dois números e apresente na tela os resultados das
operações aritméticas (soma, subtração, multiplicação, divisão, resto da divisão, exponenciação, radiciação)'''
import math
num1 = float(input('Informe um numero: '))
num2 = float(input('Informe outro numero: '))
print(f... | [
"math.exp",
"math.sqrt"
] | [((614, 628), 'math.exp', 'math.exp', (['num1'], {}), '(num1)\n', (622, 628), False, 'import math\n'), ((630, 644), 'math.exp', 'math.exp', (['num2'], {}), '(num2)\n', (638, 644), False, 'import math\n'), ((687, 702), 'math.sqrt', 'math.sqrt', (['num1'], {}), '(num1)\n', (696, 702), False, 'import math\n'), ((704, 719)... |
import os
import shutil
import subprocess
from possum.exc import PipenvPathNotFound
class PipenvWrapper:
def __init__(self):
self.pipenv_path = shutil.which('pipenv')
if not self.pipenv_path:
raise PipenvPathNotFound
# Force pipenv to ignore any currently active pipenv envir... | [
"subprocess.check_output",
"subprocess.Popen",
"shutil.which"
] | [((159, 181), 'shutil.which', 'shutil.which', (['"""pipenv"""'], {}), "('pipenv')\n", (171, 181), False, 'import shutil\n'), ((527, 626), 'subprocess.Popen', 'subprocess.Popen', (["[self.pipenv_path, '--three']"], {'stdout': 'subprocess.PIPE', 'stderr': 'subprocess.PIPE'}), "([self.pipenv_path, '--three'], stdout=subpr... |
import pytest
import envpy
import os
folder = os.path.dirname(__file__)
folder_env_file = f'{folder}/resources'
file_dot_env = 'test.env'
def test__init__():
karg = {'filepath':folder_env_file, 'filename':file_dot_env}
envpy.get_variables(**karg)
envpy.printenv(envpy.get_variables(**karg))
if __name_... | [
"os.path.dirname",
"envpy.get_variables"
] | [((47, 72), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (62, 72), False, 'import os\n'), ((230, 257), 'envpy.get_variables', 'envpy.get_variables', ([], {}), '(**karg)\n', (249, 257), False, 'import envpy\n'), ((277, 304), 'envpy.get_variables', 'envpy.get_variables', ([], {}), '(**karg)\n... |
import os
import sys
import argparse
import onnx
import time
import subprocess
import numpy as np
import tempfile
from onnx import numpy_helper
from collections import OrderedDict
# Command arguments.
parser = argparse.ArgumentParser()
parser.add_argument('model_path', type=str, help="Path to the ONNX model.")
parser... | [
"PyRuntime.ExecutionSession",
"tempfile.TemporaryDirectory",
"onnx.save",
"collections.OrderedDict.fromkeys",
"argparse.ArgumentParser",
"onnx.helper.make_tensor_value_info",
"os.path.join",
"os.environ.get",
"time.perf_counter",
"onnxruntime.InferenceSession",
"onnx.TensorProto",
"numpy.ndenu... | [((212, 237), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (235, 237), False, 'import argparse\n'), ((2061, 2093), 'os.environ.get', 'os.environ.get', (['"""VERBOSE"""', '(False)'], {}), "('VERBOSE', False)\n", (2075, 2093), False, 'import os\n'), ((2208, 2276), 'os.path.join', 'os.path.join'... |
import requests
from json import loads
from bs4 import BeautifulSoup
from os import environ
l = ['atom','moon','star','space','astro','cluster','galaxy','sky','planet','solar','science','physic','scientist','cosmos']
def clean(text):
while '[' in text:
text = text.replace(text[text.find('['):text.find(']',... | [
"bs4.BeautifulSoup",
"requests.get"
] | [((775, 801), 'bs4.BeautifulSoup', 'BeautifulSoup', (['req', '"""lxml"""'], {}), "(req, 'lxml')\n", (788, 801), False, 'from bs4 import BeautifulSoup\n'), ((736, 754), 'requests.get', 'requests.get', (['page'], {}), '(page)\n', (748, 754), False, 'import requests\n'), ((2338, 2391), 'requests.get', 'requests.get', (['u... |
from django.shortcuts import render
from django.http import JsonResponse
from django.views import View
from core.handlers.dispatcher import process_telegram_event
from app_my_places.settings import TELEGRAM_TOKEN
import json
# Create your views here.
def index(request):
return JsonResponse({"error": "forbidden"})... | [
"json.loads",
"django.http.JsonResponse"
] | [((284, 320), 'django.http.JsonResponse', 'JsonResponse', (["{'error': 'forbidden'}"], {}), "({'error': 'forbidden'})\n", (296, 320), False, 'from django.http import JsonResponse\n'), ((477, 508), 'django.http.JsonResponse', 'JsonResponse', (["{'post': 'work!'}"], {}), "({'post': 'work!'})\n", (489, 508), False, 'from ... |
# Copyright (c) 2020, TU Wien, Department of Geodesy and Geoinformation
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice,... | [
"numpy.log10",
"numpy.arccos",
"numpy.sum",
"numpy.zeros",
"numpy.cos"
] | [((3934, 3957), 'numpy.zeros', 'np.zeros', (['distance.size'], {}), '(distance.size)\n', (3942, 3957), True, 'import numpy as np\n'), ((2192, 2205), 'numpy.log10', 'np.log10', (['val'], {}), '(val)\n', (2200, 2205), True, 'import numpy as np\n'), ((3659, 3674), 'numpy.sum', 'np.sum', (['weights'], {}), '(weights)\n', (... |
import pytest
import tempfile
@pytest.fixture
def post(user):
from posts.models import Post
image = tempfile.NamedTemporaryFile(suffix=".jpg").name
return Post.objects.create(text='Тестовый пост 1', author=user, image=image)
@pytest.fixture
def group():
from posts.models import Group
return Grou... | [
"warehouse.models.Storage.objects.create",
"posts.models.Post.objects.create",
"warehouse.models.MaterialStorage.objects.create",
"warehouse.models.Material.objects.create",
"posts.models.Group.objects.create",
"warehouse.models.Instrument.objects.create",
"tempfile.NamedTemporaryFile"
] | [((169, 238), 'posts.models.Post.objects.create', 'Post.objects.create', ([], {'text': '"""Тестовый пост 1"""', 'author': 'user', 'image': 'image'}), "(text='Тестовый пост 1', author=user, image=image)\n", (188, 238), False, 'from posts.models import Post\n'), ((316, 425), 'posts.models.Group.objects.create', 'Group.ob... |
from django.conf import settings
from django.contrib.postgres.fields import JSONField
from django.db import models
from django.db.models import Q
from django.template.loader import render_to_string
from django.utils.translation import ugettext_lazy as _
TARGET_FKEY_ATTRS = dict(
null=True,
blank=True,
on_... | [
"django.utils.translation.ugettext_lazy",
"django.contrib.postgres.fields.JSONField",
"django.db.models.ForeignKey",
"django.db.models.DateTimeField",
"django.db.models.Q",
"labour.models.Signup.objects.get",
"django.db.models.CharField"
] | [((392, 446), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'auto_now_add': '(True)', 'db_index': '(True)'}), '(auto_now_add=True, db_index=True)\n', (412, 446), False, 'from django.db import models\n'), ((464, 562), 'django.db.models.ForeignKey', 'models.ForeignKey', (['settings.AUTH_USER_MODEL'], {'... |
import aiohttp_jinja2
import jinja2
import secrets
import random
from aiohttp import web
from aiohttp.client import MultiDict
from source import fit_model, vectorize, model_predict
routes = web.RouteTableDef()
PORT = 8080
base_url = f"http://localhost:{PORT}"
IMGS, X, Y = 3, 5, 7
THRESH = 0.1
networks = {}
@rout... | [
"aiohttp.web.run_app",
"aiohttp.client.MultiDict",
"secrets.token_hex",
"random.randrange",
"aiohttp.web.HTTPFound",
"aiohttp.web.Application",
"source.vectorize",
"random.random",
"aiohttp.web.HTTPBadRequest",
"source.fit_model",
"aiohttp.web.RouteTableDef",
"aiohttp_jinja2.template",
"jinj... | [((194, 213), 'aiohttp.web.RouteTableDef', 'web.RouteTableDef', ([], {}), '()\n', (211, 213), False, 'from aiohttp import web\n'), ((476, 511), 'aiohttp_jinja2.template', 'aiohttp_jinja2.template', (['"""fit.html"""'], {}), "('fit.html')\n", (499, 511), False, 'import aiohttp_jinja2\n'), ((2556, 2595), 'aiohttp_jinja2.... |
from flask import Blueprint, render_template, url_for, session, flash, redirect, request
from edu_visitor import db
from edu_visitor.visitor_logs.forms import StudentSignInForm, StudentSignOutForm, VisitorSignInForm, VisitorSignOutForm, StudentUpdateForm, VisitorUpdateForm
from edu_visitor.models import StudentLog, Vi... | [
"flask.render_template",
"flask.request.args.get",
"edu_visitor.db.session.delete",
"edu_visitor.models.VisitorLog",
"edu_visitor.db.session.commit",
"edu_visitor.models.StudentLog.query.get_or_404",
"edu_visitor.visitor_logs.forms.StudentSignInForm",
"flask.flash",
"edu_visitor.visitor_logs.forms.V... | [((384, 419), 'flask.Blueprint', 'Blueprint', (['"""visitor_logs"""', '__name__'], {}), "('visitor_logs', __name__)\n", (393, 419), False, 'from flask import Blueprint, render_template, url_for, session, flash, redirect, request\n'), ((560, 579), 'edu_visitor.visitor_logs.forms.StudentSignInForm', 'StudentSignInForm', ... |
import os
import sys
from argparse import ArgumentParser
from sphinxviewer.sphinx import build_html
from sphinxviewer.server import serve_server
def main():
parser = ArgumentParser(description="Live editing sphinx doc server")
# parser.add_argument("-p", "--port", default=8888, help="Port to run server on")... | [
"sphinxviewer.server.serve_server",
"sys.exit",
"argparse.ArgumentParser",
"os.getcwd"
] | [((174, 234), 'argparse.ArgumentParser', 'ArgumentParser', ([], {'description': '"""Live editing sphinx doc server"""'}), "(description='Live editing sphinx doc server')\n", (188, 234), False, 'from argparse import ArgumentParser\n'), ((668, 686), 'sphinxviewer.server.serve_server', 'serve_server', (['(8888)'], {}), '(... |
import mimetypes
from django.contrib.staticfiles.storage import staticfiles_storage
from django.core import signing
from django.forms import widgets
from django.forms.utils import flatatt
from django.utils.safestring import mark_safe
from django.utils.html import format_html
from django.utils.translation import ugette... | [
"django.utils.translation.ugettext_lazy",
"easy_thumbnails.files.get_thumbnailer",
"mimetypes.guess_type",
"django.forms.utils.flatatt",
"mimetypes.guess_extension",
"django.core.signing.Signer"
] | [((417, 433), 'django.core.signing.Signer', 'signing.Signer', ([], {}), '()\n', (431, 433), False, 'from django.core import signing\n'), ((1915, 1931), 'django.utils.translation.ugettext_lazy', '_', (['"""Delete File"""'], {}), "('Delete File')\n", (1916, 1931), True, 'from django.utils.translation import ugettext_lazy... |
from flask import jsonify, render_template
import sqlalchemy
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import Session
from sqlalchemy import create_engine, func
import datetime as dt
from climateapp import app
engine = create_engine('sqlite:///../Resources/hawaii.sqlite')
Base = automap_base... | [
"flask.render_template",
"climateapp.app.route",
"sqlalchemy.func.count",
"sqlalchemy.func.sum",
"sqlalchemy.func.min",
"datetime.datetime.strptime",
"sqlalchemy.ext.automap.automap_base",
"sqlalchemy.create_engine",
"sqlalchemy.orm.Session",
"sqlalchemy.func.max",
"sqlalchemy.func.strftime",
... | [((246, 299), 'sqlalchemy.create_engine', 'create_engine', (['"""sqlite:///../Resources/hawaii.sqlite"""'], {}), "('sqlite:///../Resources/hawaii.sqlite')\n", (259, 299), False, 'from sqlalchemy import create_engine, func\n'), ((308, 322), 'sqlalchemy.ext.automap.automap_base', 'automap_base', ([], {}), '()\n', (320, 3... |
"""fasterRCNN对象创建"""
import numpy as np
import colorsys
import os
from keras import backend as K
from keras.applications.imagenet_utils import preprocess_input
from PIL import Image, ImageFont, ImageDraw
import copy
import math
from net import fasterrcnn as frcnn
from net import netconfig as netconfig
from net import ... | [
"net.tools.get_new_img_size",
"colorsys.hsv_to_rgb",
"numpy.array",
"PIL.ImageDraw.Draw",
"copy.deepcopy",
"math.exp",
"numpy.delete",
"numpy.max",
"numpy.round",
"os.path.expanduser",
"net.tools.BBoxUtility",
"net.fasterrcnn.get_predict_model",
"numpy.floor",
"numpy.argmax",
"numpy.shap... | [((938, 953), 'keras.backend.get_session', 'K.get_session', ([], {}), '()\n', (951, 953), True, 'from keras import backend as K\n'), ((976, 994), 'net.netconfig.Config', 'netconfig.Config', ([], {}), '()\n', (992, 994), True, 'from net import netconfig as netconfig\n'), ((1044, 1063), 'net.tools.BBoxUtility', 'tools.BB... |
# coding: utf-8
import os
import shutil
import sys
import unittest
from os import path as op
from tempfile import gettempdir
from send2trash import send2trash as s2t
# import the two versions as well as the "automatic" version
from send2trash.plat_win_modern import send2trash as s2t_modern
from send2trash.plat_win_le... | [
"os.path.exists",
"os.makedirs",
"unittest.skipIf",
"os.path.join",
"os.getcwd",
"os.path.dirname",
"os.path.isdir",
"tempfile.gettempdir",
"shutil.rmtree"
] | [((360, 416), 'unittest.skipIf', 'unittest.skipIf', (["(sys.platform != 'win32')", '"""Windows only"""'], {}), "(sys.platform != 'win32', 'Windows only')\n", (375, 416), False, 'import unittest\n'), ((2207, 2263), 'unittest.skipIf', 'unittest.skipIf', (["(sys.platform != 'win32')", '"""Windows only"""'], {}), "(sys.pla... |
from setuptools import find_packages, setup
setup(
name='src',
packages=find_packages(),
version='0.1.0',
description='POC model for publication',
author='<NAME>',
license='MIT',
)
| [
"setuptools.find_packages"
] | [((81, 96), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (94, 96), False, 'from setuptools import find_packages, setup\n')] |
from cms.app_base import CMSApp
from cms.apphook_pool import apphook_pool
from django.utils.translation import ugettext_lazy as _
class StatsApphook(CMSApp):
name = _("Stats Apphook")
def get_urls(self, page=None, language=None, **kwargs):
return ["danceschool.stats.urls"] # replace th... | [
"cms.apphook_pool.apphook_pool.register",
"django.utils.translation.ugettext_lazy"
] | [((376, 411), 'cms.apphook_pool.apphook_pool.register', 'apphook_pool.register', (['StatsApphook'], {}), '(StatsApphook)\n', (397, 411), False, 'from cms.apphook_pool import apphook_pool\n'), ((177, 195), 'django.utils.translation.ugettext_lazy', '_', (['"""Stats Apphook"""'], {}), "('Stats Apphook')\n", (178, 195), Tr... |