code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import pandas as pd
import numpy as np
import datetime as dt
import math
#输入H 文件名
def cal_riskrt(H,source):
source=source.iloc[:,0:6]
source=source.drop(columns=["Unnamed: 0"])
source=source.set_index('date').dropna(subset=['long_rt','short_rt','long_short_rt'],how='all')
#新建一个数据框记录各种指标
df=pd.Dat... | [
"pandas.read_csv",
"pandas.to_datetime",
"math.sqrt",
"pandas.DataFrame",
"numpy.cumprod"
] | [((3751, 3791), 'pandas.read_csv', 'pd.read_csv', (['"""../draw/inv_level_H30.csv"""'], {}), "('../draw/inv_level_H30.csv')\n", (3762, 3791), True, 'import pandas as pd\n'), ((3860, 3901), 'pandas.read_csv', 'pd.read_csv', (['"""../draw/warehouseR90H5.csv"""'], {}), "('../draw/warehouseR90H5.csv')\n", (3871, 3901), Tru... |
import time
import uuid
import requests
# The source repo is here - https://github.com/DataGreed/amplitude-python
#
# Documentation of AmplitudeHTTP API:
# https://developers.amplitude.com/docs/http-api-v2
#
# Convert Curl queries - such as below to - python:
# https://curl.trillworks.com/
#
# TODO: Example HTTP... | [
"time.time",
"requests.Session",
"uuid.uuid4"
] | [((636, 654), 'requests.Session', 'requests.Session', ([], {}), '()\n', (652, 654), False, 'import requests\n'), ((4255, 4267), 'uuid.uuid4', 'uuid.uuid4', ([], {}), '()\n', (4265, 4267), False, 'import uuid\n'), ((3661, 3672), 'time.time', 'time.time', ([], {}), '()\n', (3670, 3672), False, 'import time\n')] |
from django.shortcuts import render, get_object_or_404
from rest_framework import generics, permissions, status
from rest_framework.response import Response
from rest_framework.views import APIView
from .serializers import RestaurantSerializer, RestaurantnamesSerializer, UserCollectionsSerializer, RestaurantCollections... | [
"datetime.datetime.strptime",
"rest_framework.response.Response",
"django.shortcuts.get_object_or_404",
"django.contrib.auth.models.User.objects.get"
] | [((8051, 8213), 'django.shortcuts.get_object_or_404', 'get_object_or_404', (['queryset'], {'restaurant_collection__collaborators__id': 'user_id', 'restaurant_collection__name': 'collection_name', 'restaurant__id': 'restaurant_id'}), '(queryset, restaurant_collection__collaborators__id=\n user_id, restaurant_collecti... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'UI/pesquisa_fornecedores.ui'
#
# Created by: PyQt5 UI code generator 5.15.4
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 im... | [
"PyQt5.QtWidgets.QTableWidget",
"PyQt5.QtWidgets.QLineEdit",
"PyQt5.QtGui.QIcon",
"PyQt5.QtGui.QFont",
"PyQt5.QtWidgets.QComboBox",
"PyQt5.QtCore.QMetaObject.connectSlotsByName",
"PyQt5.QtWidgets.QFrame",
"PyQt5.QtGui.QCursor",
"PyQt5.QtCore.QRect",
"PyQt5.QtGui.QPixmap",
"PyQt5.QtWidgets.QLabel... | [((557, 580), 'PyQt5.QtWidgets.QFrame', 'QtWidgets.QFrame', (['Frame'], {}), '(Frame)\n', (573, 580), False, 'from PyQt5 import QtCore, QtGui, QtWidgets\n'), ((807, 848), 'PyQt5.QtWidgets.QLabel', 'QtWidgets.QLabel', (['self.fr_titulo_servicos'], {}), '(self.fr_titulo_servicos)\n', (823, 848), False, 'from PyQt5 import... |
"""Initial Migration
Revision ID: f32cf801ec62
Revises: <PASSWORD>
Create Date: 2021-06-20 23:26:48.445342
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = 'c1180bb9d<PASSWORD>'
branch_labels = None
depends_on = None
def upgrade():
... | [
"alembic.op.drop_column",
"sqlalchemy.DateTime"
] | [((587, 623), 'alembic.op.drop_column', 'op.drop_column', (['"""comments"""', '"""posted"""'], {}), "('comments', 'posted')\n", (601, 623), False, 'from alembic import op\n'), ((432, 445), 'sqlalchemy.DateTime', 'sa.DateTime', ([], {}), '()\n', (443, 445), True, 'import sqlalchemy as sa\n')] |
import logging
from datawinners.main.couchdb.utils import all_db_names
from datawinners.main.database import get_db_manager
from migration.couch.utils import migrate, mark_as_completed
def advanced_questionnaire_usage(db_name):
dbm = get_db_manager(db_name)
logger = logging.getLogger(db_name)
try:
... | [
"logging.getLogger",
"migration.couch.utils.mark_as_completed",
"datawinners.main.database.get_db_manager",
"datawinners.main.couchdb.utils.all_db_names"
] | [((240, 263), 'datawinners.main.database.get_db_manager', 'get_db_manager', (['db_name'], {}), '(db_name)\n', (254, 263), False, 'from datawinners.main.database import get_db_manager\n'), ((277, 303), 'logging.getLogger', 'logging.getLogger', (['db_name'], {}), '(db_name)\n', (294, 303), False, 'import logging\n'), ((1... |
#!usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Model module.
"""
__author__ = '<NAME>'
import random
from abc import ABC
class PhoneExchange:
"""
PhoneExchange class that works as "Mediator".
A "Mediator" object acts as the communication center for "ConcreteColleague"
objects by encapsulating th... | [
"random.randint"
] | [((608, 632), 'random.randint', 'random.randint', (['(100)', '(999)'], {}), '(100, 999)\n', (622, 632), False, 'import random\n'), ((806, 832), 'random.randint', 'random.randint', (['(1000)', '(9999)'], {}), '(1000, 9999)\n', (820, 832), False, 'import random\n')] |
from django.http import HttpResponse
# function that are called via the chosen path in the app file
def index(request):
return HttpResponse("This is a bad request. Start with the music route.")
def music(request):
return HttpResponse("King Princess, Ariana, Christine and the Queens")
def ari(request):
... | [
"django.http.HttpResponse"
] | [((132, 198), 'django.http.HttpResponse', 'HttpResponse', (['"""This is a bad request. Start with the music route."""'], {}), "('This is a bad request. Start with the music route.')\n", (144, 198), False, 'from django.http import HttpResponse\n'), ((232, 295), 'django.http.HttpResponse', 'HttpResponse', (['"""King Prin... |
from gzip import GzipFile
from exporters.readers import FSReader
from exporters.exceptions import ConfigurationError
from .utils import meta
import pytest
class FSReaderTest(object):
@classmethod
def setup_class(cls):
cls.options = {
'input': {
'dir': './tests/data/fs_re... | [
"pytest.raises"
] | [((3322, 3355), 'pytest.raises', 'pytest.raises', (['ConfigurationError'], {}), '(ConfigurationError)\n', (3335, 3355), False, 'import pytest\n'), ((3643, 3676), 'pytest.raises', 'pytest.raises', (['ConfigurationError'], {}), '(ConfigurationError)\n', (3656, 3676), False, 'import pytest\n')] |
import wikiquotes
import os
from time import sleep
from sys import argv
from sys import exit
from getpass import getpass
from random import randint
from PIL import Image, ImageDraw, ImageFont, ImageStat
wd = os.getcwd() # Get the working directory
def getInstagramFile(username):
"""
This function hand... | [
"os.listdir",
"PIL.Image.open",
"os.path.join",
"PIL.ImageFont.truetype",
"os.getcwd",
"PIL.ImageDraw.Draw",
"PIL.ImageStat.Stat",
"wikiquotes.random_quote",
"sys.exit",
"os.system"
] | [((208, 219), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (217, 219), False, 'import os\n'), ((746, 760), 'os.listdir', 'os.listdir', (['wd'], {}), '(wd)\n', (756, 760), False, 'import os\n'), ((819, 930), 'os.system', 'os.system', (["('instagram-scraper ' + username + ' -u ' + usr + ' -p ' + pswd + ' -d ' +\n wd + ... |
import enum
from typing import Deque, Tuple, List, Union
from spacepackets.ecss.tm import PusTelemetry
from tmtccmd.tm.base import PusTmInfoInterface, PusTmInterface
TelemetryListT = List[bytearray]
TelemetryQueueT = Deque[bytearray]
PusTmQueue = Deque[PusTelemetry]
PusTmTupleT = Tuple[bytearray, PusTelemetry]
PusTm... | [
"enum.auto"
] | [((617, 628), 'enum.auto', 'enum.auto', ([], {}), '()\n', (626, 628), False, 'import enum\n'), ((655, 666), 'enum.auto', 'enum.auto', ([], {}), '()\n', (664, 666), False, 'import enum\n')] |
import numpy as np
from configparser import SafeConfigParser
from pyfisher.lensInterface import lensNoise
import orphics.theory.gaussianCov as gcov
from orphics.theory.cosmology import Cosmology
import orphics.tools.io as io
cc = Cosmology(lmax=6000,pickling=True)
theory = cc.theory
# Read config
iniFile = "../pyfi... | [
"orphics.theory.gaussianCov.LensForecast",
"orphics.theory.cosmology.Cosmology",
"pyfisher.lensInterface.lensNoise",
"orphics.tools.io.Plotter",
"numpy.arange",
"configparser.SafeConfigParser"
] | [((232, 267), 'orphics.theory.cosmology.Cosmology', 'Cosmology', ([], {'lmax': '(6000)', 'pickling': '(True)'}), '(lmax=6000, pickling=True)\n', (241, 267), False, 'from orphics.theory.cosmology import Cosmology\n'), ((352, 370), 'configparser.SafeConfigParser', 'SafeConfigParser', ([], {}), '()\n', (368, 370), False, ... |
"""Tests for peek helpers."""
import pytest
from open_alchemy import exceptions
from open_alchemy import helpers
@pytest.mark.parametrize(
"schema, schemas",
[({}, {}), ({"type": True}, {})],
ids=["plain", "not string value"],
)
@pytest.mark.helper
def test_type_no_type(schema, schemas):
"""
GIV... | [
"open_alchemy.helpers.peek.default",
"pytest.param",
"pytest.mark.parametrize",
"pytest.raises",
"open_alchemy.helpers.peek.type_"
] | [((118, 233), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""schema, schemas"""', "[({}, {}), ({'type': True}, {})]"], {'ids': "['plain', 'not string value']"}), "('schema, schemas', [({}, {}), ({'type': True}, {})],\n ids=['plain', 'not string value'])\n", (141, 233), False, 'import pytest\n'), ((3448,... |
from django.db import models
# Create your models here.
class QuesModel(models.Model):
question = models.CharField(max_length=200, null=True)
op1 = models.CharField(max_length=200, null=True)
op2 = models.CharField(max_length=200, null=True)
op3 = models.CharField(max_length=200, null=True)
op4 =... | [
"django.db.models.CharField"
] | [((105, 148), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(200)', 'null': '(True)'}), '(max_length=200, null=True)\n', (121, 148), False, 'from django.db import models\n'), ((159, 202), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(200)', 'null': '(True)'}), '(max_le... |
# BEGIN_COPYRIGHT
#
# Copyright 2009-2015 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 ... | [
"os.path.dirname"
] | [((10013, 10034), 'os.path.dirname', 'os.path.dirname', (['name'], {}), '(name)\n', (10028, 10034), False, 'import os\n')] |
# ----------------------------------------------------------------------
# HTTP Basic Auth Middleware
# ----------------------------------------------------------------------
# Copyright (C) 2007-2020 The NOC Project
# See LICENSE for details
# ----------------------------------------------------------------------
# P... | [
"noc.core.comp.smart_text"
] | [((956, 994), 'noc.core.comp.smart_text', 'smart_text', (["('%s:%s' % (user, password))"], {}), "('%s:%s' % (user, password))\n", (966, 994), False, 'from noc.core.comp import smart_text\n')] |
#<NAME>
#Jan 28 17
#Voyager Prgm
#Calculates the position of voyager and round trip time of radio comunication given a date after
#variables
# initiald, the initial distance at 9/25/2009
# mph, how fast the space craft is going in mph
# days, days after 9/25/09
# calcdm, calculated distance in miles
# calcdk, calculat... | [
"locale.setlocale"
] | [((555, 590), 'locale.setlocale', 'locale.setlocale', (['locale.LC_ALL', '""""""'], {}), "(locale.LC_ALL, '')\n", (571, 590), False, 'import locale\n')] |
#!/usr/bin/env python
""" Usage: python clean_data.py <path/to/file.csv>
This program cleans a .csv data set
Adapted from <NAME> for GWC 2017-2018
"""
import os
import sys
import numpy as np
print(sys.version)
def main(path_to_file):
""" This is the main driver function of the script.
Args:
path_... | [
"os.path.isfile"
] | [((513, 541), 'os.path.isfile', 'os.path.isfile', (['path_to_file'], {}), '(path_to_file)\n', (527, 541), False, 'import os\n')] |
#directory operations
import os
#current working directory
curDir = os.getcwd()
print(curDir)
#new folder
# os.mkdir('newDir')
# os.rename('newDir','newDir2')
os.rmdir('newDir2')
# os.rmdir('newDir')
# os.rmdir('path')
# os.rmdir('path1') | [
"os.rmdir",
"os.getcwd"
] | [((68, 79), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (77, 79), False, 'import os\n'), ((161, 180), 'os.rmdir', 'os.rmdir', (['"""newDir2"""'], {}), "('newDir2')\n", (169, 180), False, 'import os\n')] |
"""Submodule providing wrapper for PyKeen's TuckER model."""
from typing import Union, Type, Dict, Any, Optional
from pykeen.training import TrainingLoop
from pykeen.models import TuckER
from embiggen.embedders.pykeen_embedders.entity_relation_embedding_model_pykeen import EntityRelationEmbeddingModelPyKeen
from pykeen... | [
"pykeen.models.TuckER"
] | [((3896, 4158), 'pykeen.models.TuckER', 'TuckER', ([], {'triples_factory': 'triples_factory', 'embedding_dim': 'self._embedding_size', 'relation_dim': 'self._relation_dim', 'dropout_0': 'self._dropout_0', 'dropout_1': 'self._dropout_1', 'dropout_2': 'self._dropout_2', 'apply_batch_normalization': 'self._apply_batch_nor... |
import glob
import os
from os.path import join
import numpy as np
DIR_DATA = join(".", "datasets")
DIR_SAVE = os.path.join(os.environ["HOME"], "Soroosh/results_full")
DATASETS = glob.glob(DIR_DATA + "/*.txt")
DATASETS = [f_name for f_name in DATASETS if "_test.txt" not in f_name]
DATASETS.sort()
rho = np.hstack([np.r... | [
"os.path.exists",
"numpy.linspace",
"os.path.join",
"glob.glob"
] | [((78, 99), 'os.path.join', 'join', (['"""."""', '"""datasets"""'], {}), "('.', 'datasets')\n", (82, 99), False, 'from os.path import join\n'), ((111, 167), 'os.path.join', 'os.path.join', (["os.environ['HOME']", '"""Soroosh/results_full"""'], {}), "(os.environ['HOME'], 'Soroosh/results_full')\n", (123, 167), False, 'i... |
import datetime
import logging
import os
import pdb
import sys
import numpy as np
import torch
from transformers import BertTokenizer
from sklearn.metrics import classification_report, recall_score, f1_score, precision_score
from torch import nn
from torch.utils.data import DataLoader
from model import (KvretConfig... | [
"model.MTSIAdapterDataset",
"collections.OrderedDict",
"model.KvretDataset",
"sklearn.metrics.f1_score",
"model.TwoSepTensorBuilder",
"model.MTSIBert",
"torch.load",
"transformers.BertTokenizer.from_pretrained",
"torch.cuda.device_count",
"torch.nn.DataParallel",
"torch.argmax",
"sklearn.metri... | [((879, 911), 'torch.load', 'torch.load', (['load_checkpoint_path'], {}), '(load_checkpoint_path)\n', (889, 911), False, 'import torch\n'), ((1034, 1047), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (1045, 1047), False, 'from collections import OrderedDict\n'), ((1422, 1443), 'model.TwoSepTensorBuilder'... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import time
import logging
import random
import requests
logger = logging.getLogger()
logger.setLevel(logging.INFO)
SERVER = 'http://127.0.0.1:8000/api/v1/'
def main():
while True:
logging.info('Free driver')
requests.put(
... | [
"logging.getLogger",
"logging.info",
"random.randint"
] | [((134, 153), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (151, 153), False, 'import logging\n'), ((265, 292), 'logging.info', 'logging.info', (['"""Free driver"""'], {}), "('Free driver')\n", (277, 292), False, 'import logging\n'), ((537, 558), 'random.randint', 'random.randint', (['(1)', '(60)'], {}),... |
"""
* Licensed to DSecure.me under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. DSecure.me licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this f... | [
"rest_framework.test.APIClient",
"vmc.assets.documents.AssetDocument.search",
"django.core.cache.cache.keys.assert_called_once_with",
"django.urls.reverse",
"uuid.uuid3",
"django.contrib.auth.models.User.objects.get",
"unittest.mock.patch",
"parameterized.parameterized.expand",
"vmc.common.tasks.wor... | [((2598, 2683), 'parameterized.parameterized.expand', 'parameterized.expand', (["[('http', 'http://test:80'), ('https', 'https://test:80')]"], {}), "([('http', 'http://test:80'), ('https', 'https://test:80')]\n )\n", (2618, 2683), False, 'from parameterized import parameterized\n'), ((3601, 3631), 'unittest.mock.pat... |
"""saltshaker URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-... | [
"django.conf.urls.url"
] | [((702, 751), 'django.conf.urls.url', 'url', (['"""login"""', 'views.login_view'], {'name': '"""login_view"""'}), "('login', views.login_view, name='login_view')\n", (705, 751), False, 'from django.conf.urls import include, url\n'), ((758, 810), 'django.conf.urls.url', 'url', (['"""logout"""', 'views.logout_view'], {'n... |
from django.conf import settings
from django.db.models.loading import get_model
def get_profile_model():
"""
Returns configured user profile model or None if not found
"""
user_profile_module = getattr(settings, 'USER_PROFILE_MODULE', None)
if user_profile_module:
app_label, model_name = u... | [
"django.db.models.loading.get_model"
] | [((365, 397), 'django.db.models.loading.get_model', 'get_model', (['app_label', 'model_name'], {}), '(app_label, model_name)\n', (374, 397), False, 'from django.db.models.loading import get_model\n')] |
from typing import List
from pathlib import Path
from scrapy import Spider
from scrapy.selector.unified import Selector
from scrapy_splash import SplashResponse
from ..items import Quest
import scrapy_splash
from .. import PROJECT_ROOT
class ZoneSpider(Spider):
name = "wowhead"
base_url = "https://classic.wow... | [
"scrapy.selector.unified.Selector",
"scrapy_splash.SplashRequest",
"pathlib.Path"
] | [((3356, 3380), 'scrapy.selector.unified.Selector', 'Selector', ([], {'text': 'result[0]'}), '(text=result[0])\n', (3364, 3380), False, 'from scrapy.selector.unified import Selector\n'), ((514, 532), 'pathlib.Path', 'Path', (['PROJECT_ROOT'], {}), '(PROJECT_ROOT)\n', (518, 532), False, 'from pathlib import Path\n'), ((... |
from django.contrib import admin
from django.urls import path, include
from users.views import UserLogoutView, UserLoginView, UserRegisterView, ProfileView, EditProfileView, RequestView, FollowerListView, FollowingListView
from django.conf.urls.static import static
from . import settings
from posts.views import PostCre... | [
"django.urls.include",
"users.views.UserLogoutView.as_view",
"users.views.UserLoginView.as_view",
"posts.views.PostCreateView.as_view",
"users.views.PasswordResetDoneView.as_view",
"users.views.PasswordResetView.as_view",
"django.conf.urls.static.static",
"users.views.PasswordResetCompleteView.as_view... | [((467, 498), 'django.urls.path', 'path', (['"""admin/"""', 'admin.site.urls'], {}), "('admin/', admin.site.urls)\n", (471, 498), False, 'from django.urls import path, include\n'), ((629, 681), 'django.urls.path', 'path', (['"""register/"""', 'UserRegisterView'], {'name': '"""register"""'}), "('register/', UserRegister... |
import torch
import torch.nn as nn
from typing import List, Tuple
from transformers import Wav2Vec2Tokenizer
class Wav2Vec2Tok(Wav2Vec2Tokenizer):
"""
Extending the base tokenizer of Wav2Vec2 for the purpose of encoding
text sequences.
"""
def __init__(self, *args, **kwargs):
super().__ini... | [
"torch.tensor"
] | [((1457, 1501), 'torch.tensor', 'torch.tensor', (['sentences'], {'dtype': 'torch.float32'}), '(sentences, dtype=torch.float32)\n', (1469, 1501), False, 'import torch\n'), ((1503, 1524), 'torch.tensor', 'torch.tensor', (['lengths'], {}), '(lengths)\n', (1515, 1524), False, 'import torch\n')] |
"""Query the db
"""
import sqlite3 as sql
import pandas as pd
path_to_db = "monitor.db"
def load(query, *args, path=path_to_db) -> pd.DataFrame:
"""Converts sqlite3 db query to pandas df
@param[in] query - str with direct sql query (for more complex queries)
@param[in] args - query args (passed into q... | [
"pandas.read_sql_query",
"sqlite3.connect"
] | [((468, 485), 'sqlite3.connect', 'sql.connect', (['path'], {}), '(path)\n', (479, 485), True, 'import sqlite3 as sql\n'), ((567, 616), 'pandas.read_sql_query', 'pd.read_sql_query', (['query', 'connection'], {'params': 'args'}), '(query, connection, params=args)\n', (584, 616), True, 'import pandas as pd\n'), ((640, 676... |
from django.conf.urls import url
from schedule.timetable import views
urlpatterns = [
url(
regex=r'^$',
view=views.ConsultationListView.as_view(),
name='list'
),
url(
regex=r'^~redirect/$',
view=views.ConsultationRedirectView.as_view(),
name='redirect'
)... | [
"schedule.timetable.views.ConsultationListView.as_view",
"schedule.timetable.views.ConsultationDetailView.as_view",
"schedule.timetable.views.ConsultationRedirectView.as_view",
"schedule.timetable.views.ConsultationUpdateView.as_view"
] | [((131, 167), 'schedule.timetable.views.ConsultationListView.as_view', 'views.ConsultationListView.as_view', ([], {}), '()\n', (165, 167), False, 'from schedule.timetable import views\n'), ((249, 289), 'schedule.timetable.views.ConsultationRedirectView.as_view', 'views.ConsultationRedirectView.as_view', ([], {}), '()\n... |
import subprocess
from os.path import join
from app import create_app
from flask import current_app
from flask.ext.script import Shell, Manager, Server
manager = Manager(create_app)
def _make_shell_context():
"""
Shell context: import helper objects here.
"""
return dict(app=current_app)
manager.ad... | [
"app.assets.init",
"flask.ext.script.Server",
"flask.ext.script.Manager",
"flask.ext.script.Shell"
] | [((163, 182), 'flask.ext.script.Manager', 'Manager', (['create_app'], {}), '(create_app)\n', (170, 182), False, 'from flask.ext.script import Shell, Manager, Server\n'), ((441, 480), 'flask.ext.script.Shell', 'Shell', ([], {'make_context': '_make_shell_context'}), '(make_context=_make_shell_context)\n', (446, 480), Fal... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
# Created Date: 2020-04-16 15:45:59
# Author: <NAME>
# Contact: <EMAIL>
# -----
# MIT License
# Copyright (c) 2020 <NAME>
import types
import logging
class RpcFnCodeContatiner:
def __init__(self, fn):
self.code_descriptor = self.__from_code(fn)
@classmeth... | [
"types.FunctionType"
] | [((2878, 2922), 'types.FunctionType', 'types.FunctionType', (['code', 'namespace', 'co_name'], {}), '(code, namespace, co_name)\n', (2896, 2922), False, 'import types\n')] |
from .sqlite_server_lib_py3 import Construct_RPC_Library
from redis_support_py3.graph_query_support_py3 import Query_Support
from redis_support_py3.construct_data_handlers_py3 import Generate_Handlers
import datetime
import msgpack
class SQLITE_Client_Support(Construct_RPC_Library):
def __init__( self, qs... | [
"json.loads",
"redis_support_py3.graph_query_support_py3.Query_Support"
] | [((5360, 5376), 'json.loads', 'json.loads', (['data'], {}), '(data)\n', (5370, 5376), False, 'import json\n'), ((5457, 5482), 'redis_support_py3.graph_query_support_py3.Query_Support', 'Query_Support', (['redis_site'], {}), '(redis_site)\n', (5470, 5482), False, 'from redis_support_py3.graph_query_support_py3 import Qu... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Quick and dirty "unit" tests for API. Too complex but do the job."""
from multiprocessing import Process
import unittest
import time
import requests
from app import app
class CallLocalApiTestCase(unittest.TestCase):
@classmethod
def setUpClass(cls):
... | [
"unittest.main",
"multiprocessing.Process",
"requests.post",
"time.sleep"
] | [((5029, 5044), 'unittest.main', 'unittest.main', ([], {}), '()\n', (5042, 5044), False, 'import unittest\n'), ((340, 363), 'multiprocessing.Process', 'Process', ([], {'target': 'app.run'}), '(target=app.run)\n', (347, 363), False, 'from multiprocessing import Process\n'), ((448, 461), 'time.sleep', 'time.sleep', (['(1... |
from __future__ import absolute_import
from __future__ import division
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from core.minisim.util.normalization import apply_normalization, get_state_statistics
from core.model import Model
from utils.... | [
"torch.nn.ReLU",
"core.minisim.util.normalization.apply_normalization",
"torch.nn.Softmax",
"torch.nn.LSTMCell",
"core.minisim.util.normalization.get_state_statistics",
"torch.nn.Linear",
"torch.nn.init.calculate_gain",
"torch.cat"
] | [((769, 791), 'core.minisim.util.normalization.get_state_statistics', 'get_state_statistics', ([], {}), '()\n', (789, 791), False, 'from core.minisim.util.normalization import apply_normalization, get_state_statistics\n'), ((862, 929), 'torch.nn.Linear', 'nn.Linear', (['(self.input_dims[0] * self.input_dims[1])', 'self... |
__author__ = "<NAME>, University of Kansas"
__version__ = "1.3"
# Change these to your values, you will also likely have to edit the variable names (such as RH for humidity
# or AT for the Temperature) in the below code
CWOPid = "FW####"
DataFile = 'Mesonet.dat'
Lat = '####.##N'
Lon = '#####.##W'
StationHeight = 67 ... | [
"socket.socket",
"pandas.read_csv",
"schedule.run_pending",
"time.sleep",
"schedule.every",
"pandas.to_datetime"
] | [((3532, 3554), 'schedule.run_pending', 'schedule.run_pending', ([], {}), '()\n', (3552, 3554), False, 'import schedule\n'), ((3556, 3569), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (3566, 3569), False, 'import time\n'), ((1346, 1370), 'pandas.to_datetime', 'pd.to_datetime', (['timedata'], {}), '(timedata)\n'... |
from functions import *
import glob
import sys
import os
import numpy as np
from validation_ids import validation_ids
def save_data(file_name, data):
res_out = open(file_name, "w+", encoding='utf-8')
res_out.write("\n".join(data))
res_out.close()
if __name__ == "__main__":
num_validation = 10000
... | [
"os.path.exists",
"os.makedirs",
"os.path.join",
"numpy.random.seed",
"os.path.basename",
"glob.glob"
] | [((373, 393), 'numpy.random.seed', 'np.random.seed', (['(1234)'], {}), '(1234)\n', (387, 393), True, 'import numpy as np\n'), ((709, 750), 'os.path.join', 'os.path.join', (['target_dir', '"""train.src.txt"""'], {}), "(target_dir, 'train.src.txt')\n", (721, 750), False, 'import os\n'), ((772, 813), 'os.path.join', 'os.p... |
import argparse
from pathlib import Path
import tensorflow as tf
from keras import backend as K
from .network_definition import Colorization
from .training_utils import (
evaluation_pipeline,
checkpointing_system,
plot_evaluation,
metrics_system,
)
parser = argparse.ArgumentParser(description="Eval")... | [
"tensorflow.local_variables_initializer",
"argparse.ArgumentParser",
"tensorflow.train.Coordinator",
"pathlib.Path",
"tensorflow.Session",
"keras.backend.set_session",
"tensorflow.train.start_queue_runners",
"tensorflow.global_variables_initializer"
] | [((277, 320), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Eval"""'}), "(description='Eval')\n", (300, 320), False, 'import argparse\n'), ((1002, 1014), 'tensorflow.Session', 'tf.Session', ([], {}), '()\n', (1012, 1014), True, 'import tensorflow as tf\n'), ((1015, 1034), 'keras.backend... |
#!/usr/bin/env python
from pathlib import Path
import subprocess
import numpy as np
import pytest
R = Path(__file__).resolve().parents[1]
def test_bsr():
pytest.importorskip('oct2py')
subprocess.check_call(['octave-cli', '-q', 'Test.m'], cwd=R / 'tests')
def test_wideangle_scatter():
oct2py = pytest.im... | [
"pathlib.Path",
"subprocess.check_call",
"pytest.main",
"pytest.importorskip",
"numpy.arange"
] | [((161, 190), 'pytest.importorskip', 'pytest.importorskip', (['"""oct2py"""'], {}), "('oct2py')\n", (180, 190), False, 'import pytest\n'), ((195, 265), 'subprocess.check_call', 'subprocess.check_call', (["['octave-cli', '-q', 'Test.m']"], {'cwd': "(R / 'tests')"}), "(['octave-cli', '-q', 'Test.m'], cwd=R / 'tests')\n",... |
#!/usr/bin/env python3
"""
Purpose : Tests canopycover.py
Author : <NAME> <<EMAIL>>
<NAME> <<EMAIL>>
"""
import csv
import json
import os
import random
import re
import string
from shutil import rmtree
from subprocess import getstatusoutput
# The name of the source file to test and it's path
SOURCE_FILE = 'ca... | [
"re.search",
"os.path.exists",
"csv.DictReader",
"canopycover.get_default_trait",
"os.makedirs",
"canopycover.get_traits_table",
"os.path.join",
"re.match",
"canopycover.generate_traits_list",
"os.path.realpath",
"os.path.isfile",
"canopycover.get_fields",
"random.choices",
"os.path.isdir"... | [((492, 523), 'os.path.realpath', 'os.path.realpath', (['"""./test_data"""'], {}), "('./test_data')\n", (508, 523), False, 'import os\n'), ((364, 394), 'os.path.join', 'os.path.join', (['"""."""', 'SOURCE_FILE'], {}), "('.', SOURCE_FILE)\n", (376, 394), False, 'import os\n'), ((583, 632), 'os.path.join', 'os.path.join'... |
# (C) Copyright [2020] Hewlett Packard Enterprise Development LP
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy,... | [
"requests.structures.CaseInsensitiveDict",
"re.match"
] | [((3493, 3541), 're.match', 're.match', (['"""\\\\/api\\\\/v1\\\\/lock\\\\/[0-9]+"""', 'lock_id'], {}), "('\\\\/api\\\\/v1\\\\/lock\\\\/[0-9]+', lock_id)\n", (3501, 3541), False, 'import re\n'), ((2266, 2303), 'requests.structures.CaseInsensitiveDict', 'CaseInsensitiveDict', (['response.headers'], {}), '(response.heade... |
# Author: <NAME>
# Date: 5/21/2019
# Reference Formula: https://anomaly.io/understand-auto-cross-correlation-normalized-shift/
# Referrence Video: https://www.youtube.com/watch?v=ngEC3sXeUb4
import math
from scipy.signal import fftconvolve
import numpy as np
# It implements the normalized, and standard correlation a... | [
"numpy.array",
"scipy.signal.fftconvolve"
] | [((640, 652), 'numpy.array', 'np.array', (['x1'], {}), '(x1)\n', (648, 652), True, 'import numpy as np\n'), ((677, 689), 'numpy.array', 'np.array', (['x2'], {}), '(x2)\n', (685, 689), True, 'import numpy as np\n'), ((1367, 1397), 'scipy.signal.fftconvolve', 'fftconvolve', (['f', 'g'], {'mode': '"""same"""'}), "(f, g, m... |
# ------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
# -------------------------------------------------------------------... | [
"health_azure.submit_to_azure_if_needed",
"argparse.ArgumentParser"
] | [((1038, 1172), 'health_azure.submit_to_azure_if_needed', 'submit_to_azure_if_needed', ([], {'compute_cluster_name': '"""lite-testing-ds2"""', 'wait_for_completion': '(True)', 'wait_for_completion_show_output': '(True)'}), "(compute_cluster_name='lite-testing-ds2',\n wait_for_completion=True, wait_for_completion_sho... |
"""Custom integration for Chargers that support the Open Charge Point Protocol."""
import asyncio
import logging
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import Config, HomeAssistant
from homeassistant.helpers import device_registry
import homeassistant.helpers.config_validation as... | [
"logging.getLogger",
"voluptuous.Required",
"homeassistant.helpers.device_registry.async_get_registry",
"voluptuous.Schema",
"voluptuous.Optional"
] | [((688, 718), 'logging.getLogger', 'logging.getLogger', (['__package__'], {}), '(__package__)\n', (705, 718), False, 'import logging\n'), ((719, 744), 'logging.getLogger', 'logging.getLogger', (['DOMAIN'], {}), '(DOMAIN)\n', (736, 744), False, 'import logging\n'), ((815, 840), 'voluptuous.Required', 'vol.Required', (['... |
##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by <NAME>, <EMAIL>, All rights reserved.
# LLNL-CODE-647188
#
# For det... | [
"os.chdir"
] | [((2046, 2077), 'os.chdir', 'os.chdir', (['"""ptools_common_files"""'], {}), "('ptools_common_files')\n", (2054, 2077), False, 'import os\n'), ((2168, 2197), 'os.chdir', 'os.chdir', (['"""../paraver-kernel"""'], {}), "('../paraver-kernel')\n", (2176, 2197), False, 'import os\n'), ((2530, 2560), 'os.chdir', 'os.chdir', ... |
# Copyright 2017 SAP SE
#
# 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, softw... | [
"swift_health_statsd.collector.CollectorConfig",
"swift_health_statsd.recon.SwiftReconCollector",
"swift_health_statsd.dispersion.SwiftDispersionCollector",
"re.compile"
] | [((13663, 13807), 'swift_health_statsd.collector.CollectorConfig', 'CollectorConfig', ([], {'recon_path': '"""./test/fixtures/recon.sh"""', 'dispersion_report_path': '"""./test/fixtures/dispersion.sh"""', 'add_hostname_suffix': '(True)'}), "(recon_path='./test/fixtures/recon.sh',\n dispersion_report_path='./test/fix... |
from pyradioconfig.parts.ocelot.calculators.calc_freq_offset_comp import CALC_Freq_Offset_Comp_ocelot
from pyradioconfig.parts.sol.calculators.calc_utilities import Calc_Utilities_Sol
class Calc_Freq_Offset_Comp_Sol(CALC_Freq_Offset_Comp_ocelot):
def calc_afc_scale_value(self, model):
# Overriding this fun... | [
"pyradioconfig.parts.sol.calculators.calc_utilities.Calc_Utilities_Sol"
] | [((1042, 1062), 'pyradioconfig.parts.sol.calculators.calc_utilities.Calc_Utilities_Sol', 'Calc_Utilities_Sol', ([], {}), '()\n', (1060, 1062), False, 'from pyradioconfig.parts.sol.calculators.calc_utilities import Calc_Utilities_Sol\n'), ((12405, 12425), 'pyradioconfig.parts.sol.calculators.calc_utilities.Calc_Utilitie... |
import random
import hashlib
import math
class Neuron:
def __init__(self, net, index, activ_func, alfa=1, is_input=False):
self.net = net
self.is_input = is_input
self.n = net.mass
self.x = [1] + [0] * self.n
self.b = [0] * (self.n + 1)
self.b_step = [0] * (self.n... | [
"random.uniform",
"math.cosh",
"random.random",
"math.sinh",
"random.randint",
"math.tanh",
"math.exp"
] | [((1883, 1898), 'random.random', 'random.random', ([], {}), '()\n', (1896, 1898), False, 'import random\n'), ((3846, 3861), 'random.random', 'random.random', ([], {}), '()\n', (3859, 3861), False, 'import random\n'), ((4538, 4553), 'random.random', 'random.random', ([], {}), '()\n', (4551, 4553), False, 'import random\... |
from traceback_with_variables import print_cur_tb # , format_cur_tb, iter_cur_tb_lines
def f(n):
print_cur_tb()
# cur_tb_str = format_cur_tb()
# cur_tb_lines = list(iter_cur_tb_lines())
return n + 1
def main():
f(10)
main()
| [
"traceback_with_variables.print_cur_tb"
] | [((108, 122), 'traceback_with_variables.print_cur_tb', 'print_cur_tb', ([], {}), '()\n', (120, 122), False, 'from traceback_with_variables import print_cur_tb\n')] |
##
## Copyright (c) 2019
##
## @author: <NAME>
## @company: Technische Universität Berlin
##
## This file is part of the python package analyticcenter
## (see https://gitlab.tu-berlin.de/PassivityRadius/analyticcenter/)
##
## License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
##
import control
i... | [
"numpy.asmatrix",
"analyticcenter.WeightedSystem",
"control.tf2ss",
"numpy.array",
"numpy.zeros",
"control.tf",
"control.series"
] | [((574, 597), 'numpy.array', 'np.array', (['[1 / (L * C)]'], {}), '([1 / (L * C)])\n', (582, 597), True, 'import numpy as np\n'), ((604, 638), 'numpy.array', 'np.array', (['[1, RR / L, 1 / (L * C)]'], {}), '([1, RR / L, 1 / (L * C)])\n', (612, 638), True, 'import numpy as np\n'), ((733, 753), 'control.tf', 'control.tf'... |
from django.contrib import admin
from .models import Class, Studio
# Register your models here.
admin.site.register(Class)
admin.site.register(Studio)
| [
"django.contrib.admin.site.register"
] | [((98, 124), 'django.contrib.admin.site.register', 'admin.site.register', (['Class'], {}), '(Class)\n', (117, 124), False, 'from django.contrib import admin\n'), ((125, 152), 'django.contrib.admin.site.register', 'admin.site.register', (['Studio'], {}), '(Studio)\n', (144, 152), False, 'from django.contrib import admin... |
import math
from galpy.potential import MWPotential2014
from galpy.potential import PowerSphericalPotentialwCutoff
from galpy.potential import MiyamotoNagaiPotential
from galpy.potential import NFWPotential
from galpy.util import bovy_conversion
from astropy import units
from galpy.potential import KeplerPotential
from... | [
"galpy.util.bovy_conversion.mass_in_msol",
"galpy.potential.evaluateRforces",
"galpy.util.bovy_conversion.force_in_kmsMyr",
"GalDynPsr.read_parameters.Rpkpc",
"math.cos",
"math.sin"
] | [((606, 651), 'GalDynPsr.read_parameters.Rpkpc', 'par.Rpkpc', (['ldeg', 'sigl', 'bdeg', 'sigb', 'dkpc', 'sigd'], {}), '(ldeg, sigl, bdeg, sigb, dkpc, sigd)\n', (615, 651), True, 'from GalDynPsr import read_parameters as par\n'), ((668, 679), 'math.sin', 'math.sin', (['b'], {}), '(b)\n', (676, 679), False, 'import math\... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torchsummary import summary
class Net(nn.Module):
def __init__(self):
super(Net, self).__init__()
self.conv1 = nn.Conv2d(1, 10, kernel_size=5)
self.conv2 = nn.Conv2d(10, 20, kernel_size=5)
self.conv2_drop = nn.D... | [
"torch.nn.Dropout2d",
"torch.nn.functional.dropout",
"torch.nn.Conv2d",
"torch.zeros",
"torch.cuda.is_available",
"torch.nn.Linear",
"torch.nn.functional.log_softmax",
"torch.no_grad",
"torchsummary.summary",
"torch.randn",
"torch.onnx.export"
] | [((840, 867), 'torchsummary.summary', 'summary', (['model', '(1, 28, 28)'], {}), '(model, (1, 28, 28))\n', (847, 867), False, 'from torchsummary import summary\n'), ((1160, 1197), 'torch.randn', 'torch.randn', (['batch_size', '*input_shape'], {}), '(batch_size, *input_shape)\n', (1171, 1197), False, 'import torch\n'), ... |
from typing import Union, Tuple, List, Dict, Any
from easydict import EasyDict
import random
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from ding.utils import SequenceType, REWARD_MODEL_REGISTRY
from ding.model import FCEncoder, ConvEncoder
from .base_reward_model i... | [
"random.sample",
"torch.nn.functional.mse_loss",
"ding.torch_utils.data_helper.to_tensor",
"ding.utils.REWARD_MODEL_REGISTRY.register",
"ding.model.ConvEncoder",
"torch.stack",
"ding.model.FCEncoder",
"torch.chunk",
"torch.no_grad",
"torch.clamp",
"ding.utils.RunningMeanStd"
] | [((1660, 1697), 'ding.utils.REWARD_MODEL_REGISTRY.register', 'REWARD_MODEL_REGISTRY.register', (['"""rnd"""'], {}), "('rnd')\n", (1690, 1697), False, 'from ding.utils import SequenceType, REWARD_MODEL_REGISTRY\n'), ((3315, 3345), 'ding.utils.RunningMeanStd', 'RunningMeanStd', ([], {'epsilon': '(0.0001)'}), '(epsilon=0.... |
from warnings import warn
import os, json
import urllib.request
import _thread as thread
import logging
import traceback
# debugprint=lambda *x: None
debugprint = print
#### Crash if offline.
try:
urllib.request.urlopen('http://python.org/')
except OSError:
warn('The server is running in OFFLINE mode as it c... | [
"logging.getLogger",
"os.path.exists",
"traceback.format_exc",
"os.path.join",
"os.path.isfile",
"os.mkdir",
"warnings.warn",
"_thread.start_new_thread"
] | [((531, 565), 'os.path.join', 'os.path.join', (['Settings.path', '"""tmp"""'], {}), "(Settings.path, 'tmp')\n", (543, 565), False, 'import os, json\n'), ((930, 963), 'os.path.isfile', 'os.path.isfile', (['"""addressbook.csv"""'], {}), "('addressbook.csv')\n", (944, 963), False, 'import os, json\n'), ((573, 592), 'os.pa... |
"""
Import module example
"""
from C_my_module import my_sum, __version__, __sprint__, some_value
print(my_sum(1.25, 3.2))
print(__version__)
print(__sprint__)
print(some_value)
| [
"C_my_module.my_sum"
] | [((112, 129), 'C_my_module.my_sum', 'my_sum', (['(1.25)', '(3.2)'], {}), '(1.25, 3.2)\n', (118, 129), False, 'from C_my_module import my_sum, __version__, __sprint__, some_value\n')] |
from django.urls import path
from . import views
from django.views.generic import TemplateView
from redes.views import TwitterView, FacebookView
urlpatterns = [
path('twitter', TwitterView.as_view(), name="twitter"),
path('facebook', FacebookView.as_view(), name="facebook"),
] | [
"redes.views.TwitterView.as_view",
"redes.views.FacebookView.as_view"
] | [((183, 204), 'redes.views.TwitterView.as_view', 'TwitterView.as_view', ([], {}), '()\n', (202, 204), False, 'from redes.views import TwitterView, FacebookView\n'), ((244, 266), 'redes.views.FacebookView.as_view', 'FacebookView.as_view', ([], {}), '()\n', (264, 266), False, 'from redes.views import TwitterView, Faceboo... |
import numpy as np
import pandas as pd
import requests
from flashtext.keyword import KeywordProcessor
from nltk.corpus import stopwords
# let's read in a couple of forum posts
forum_posts = pd.read_csv("input/ForumMessages.csv")
# get a smaller sub-set for playing around with
sample_posts = forum_posts.Mess... | [
"flashtext.keyword.KeywordProcessor",
"requests.get",
"nltk.corpus.stopwords.words",
"pandas.read_csv"
] | [((198, 236), 'pandas.read_csv', 'pd.read_csv', (['"""input/ForumMessages.csv"""'], {}), "('input/ForumMessages.csv')\n", (209, 236), True, 'import pandas as pd\n'), ((986, 1004), 'flashtext.keyword.KeywordProcessor', 'KeywordProcessor', ([], {}), '()\n', (1002, 1004), False, 'from flashtext.keyword import KeywordProce... |
import numpy as np
import tensorflow as tf
import gzip
import cPickle
import sys
sys.path.extend(['alg/'])
import vcl
import coreset
import utils
class SplitMnistGenerator():
def __init__(self):
# Open data file
f = gzip.open('data/mnist.pkl.gz', 'rb')
train_set, valid_set, test_set = cPic... | [
"vcl.run_vcl_shared",
"numpy.savez",
"gzip.open",
"numpy.hstack",
"numpy.where",
"numpy.size",
"utils.plot",
"sys.path.extend",
"numpy.random.seed",
"tensorflow.compat.v1.set_random_seed",
"numpy.vstack",
"tensorflow.compat.v1.reset_default_graph",
"cPickle.load"
] | [((81, 106), 'sys.path.extend', 'sys.path.extend', (["['alg/']"], {}), "(['alg/'])\n", (96, 106), False, 'import sys\n'), ((4431, 4465), 'tensorflow.compat.v1.reset_default_graph', 'tf.compat.v1.reset_default_graph', ([], {}), '()\n', (4463, 4465), True, 'import tensorflow as tf\n'), ((4482, 4527), 'tensorflow.compat.v... |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
# this is a script generating *.docx Word document with PKUP report
from __future__ import unicode_literals
from docx import Document
from docx.shared import Inches
from datetime import date, datetime, timedelta
import sys, getopt
def generate_report():
create_docu... | [
"getopt.getopt",
"datetime.date.today",
"sys.exit",
"datetime.datetime.today",
"datetime.timedelta",
"docx.Document"
] | [((551, 561), 'docx.Document', 'Document', ([], {}), '()\n', (559, 561), False, 'from docx import Document\n'), ((854, 870), 'datetime.datetime.today', 'datetime.today', ([], {}), '()\n', (868, 870), False, 'from datetime import date, datetime, timedelta\n'), ((873, 891), 'datetime.timedelta', 'timedelta', ([], {'days'... |
import unittest
from datastax.trees import HuffmanTree
class TestHuffmanTree(unittest.TestCase):
def setUp(self) -> None:
self.hufT = HuffmanTree()
def test1(self):
tree = HuffmanTree("ABBCDBCCDAABBEEEBEAB")
print(tree)
tree = HuffmanTree("Espresso express")
print(t... | [
"datastax.trees.HuffmanTree"
] | [((149, 162), 'datastax.trees.HuffmanTree', 'HuffmanTree', ([], {}), '()\n', (160, 162), False, 'from datastax.trees import HuffmanTree\n'), ((200, 235), 'datastax.trees.HuffmanTree', 'HuffmanTree', (['"""ABBCDBCCDAABBEEEBEAB"""'], {}), "('ABBCDBCCDAABBEEEBEAB')\n", (211, 235), False, 'from datastax.trees import Huffma... |
import logging
import pandas as pd
import numpy as np
import gensim, os
TaggedDocument = gensim.models.doc2vec.TaggedDocument
#Input file path
USER_PARAGRAPH_INPUTS = "./train_domain_specific_user"
class LabeledLineSentence(object):
def __init__(self, doc_list, labels_list):
self.labels_list = labels_list... | [
"os.makedirs",
"os.path.exists",
"gensim.models.Doc2Vec",
"pandas.read_csv"
] | [((1015, 1122), 'gensim.models.Doc2Vec', 'gensim.models.Doc2Vec', ([], {'vector_size': '(100)', 'window': '(5)', 'min_count': '(2)', 'workers': '(11)', 'alpha': '(0.025)', 'min_alpha': '(0.025)'}), '(vector_size=100, window=5, min_count=2, workers=11,\n alpha=0.025, min_alpha=0.025)\n', (1036, 1122), False, 'import ... |
import datetime
import json
import logging
import os
import threading
import time
from typing import List, Optional, Tuple
from exceptions.depool import LowDePoolBalanceException
from routines.models.elections import Election
from secrets.interfaces.secretmanager import SecretManagerAbstract
from settings.elections im... | [
"logging.getLogger",
"os.path.exists",
"routines.models.elections.Election",
"routines.models.elections.Election.from_json",
"exceptions.depool.LowDePoolBalanceException",
"os.makedirs",
"datetime.datetime.utcnow",
"toncommon.models.TonAddress.TonAddress.set_address_prefix",
"toncommon.models.TonCoi... | [((1053, 1083), 'logging.getLogger', 'logging.getLogger', (['"""elections"""'], {}), "('elections')\n", (1070, 1083), False, 'import logging\n'), ((2148, 2201), 'os.path.join', 'os.path.join', (['self._work_dir', '"""active_elections.json"""'], {}), "(self._work_dir, 'active_elections.json')\n", (2160, 2201), False, 'i... |
"""
MIT License
Copyright (c) 2020 <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distri... | [
"unittest.main",
"plumbum.SshMachine",
"email.message.EmailMessage",
"rpyc.utils.zerodeploy.DeployedServer"
] | [((12647, 12662), 'unittest.main', 'unittest.main', ([], {}), '()\n', (12660, 12662), False, 'import unittest\n'), ((1365, 1379), 'email.message.EmailMessage', 'EmailMessage', ([], {}), '()\n', (1377, 1379), False, 'from email.message import EmailMessage\n'), ((1520, 1598), 'plumbum.SshMachine', 'pb.SshMachine', ([], {... |
from setuptools import setup
from os import path
with open(path.join(path.abspath(path.dirname(__file__)), 'README.md'), encoding='utf-8') as f:
readme_description = f.read()
setup(
name ="python-googlesearch",
packages = ["googlesearch"],
version = "1.1.1",
license = "MIT License",
descriptio... | [
"os.path.dirname",
"setuptools.setup"
] | [((181, 1533), 'setuptools.setup', 'setup', ([], {'name': '"""python-googlesearch"""', 'packages': "['googlesearch']", 'version': '"""1.1.1"""', 'license': '"""MIT License"""', 'description': '"""This module lets you use Google Searching capabilities right from your Python code"""', 'author': '"""<NAME>"""', 'author_em... |
import pandas as pd
import os
import time
import io
import http.client, urllib.request, urllib.parse, urllib.error, base64, json
import time
import requests
import operator
import numpy as np
def run_microsoft_classifier(microsoft_api_key, path_save, path_source, image_list):
print('Loading Microsoft classifier... | [
"pandas.DataFrame",
"os.listdir",
"time.sleep"
] | [((825, 848), 'os.listdir', 'os.listdir', (['path_source'], {}), '(path_source)\n', (835, 848), False, 'import os\n'), ((1091, 1112), 'os.listdir', 'os.listdir', (['path_save'], {}), '(path_save)\n', (1101, 1112), False, 'import os\n'), ((1975, 1988), 'time.sleep', 'time.sleep', (['(3)'], {}), '(3)\n', (1985, 1988), Fa... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
"""
from __future__ import annotations
from copy import deepcopy
from typing import Optional
from typing import Union
from munch import Munch
from torch.optim import Optimizer
# noinspection PyUnresolvedReferences
from torch.optim.lr_scheduler import _LRScheduler
f... | [
"onevision.type.is_list_of",
"onevision.utils.error_console.log",
"copy.deepcopy"
] | [((2579, 2592), 'copy.deepcopy', 'deepcopy', (['cfg'], {}), '(cfg)\n', (2587, 2592), False, 'from copy import deepcopy\n'), ((3548, 3562), 'copy.deepcopy', 'deepcopy', (['cfgs'], {}), '(cfgs)\n', (3556, 3562), False, 'from copy import deepcopy\n'), ((4840, 4854), 'copy.deepcopy', 'deepcopy', (['cfgs'], {}), '(cfgs)\n',... |
import os
import sys
from pbstools import PythonJob
from shutil import copyfile
import datetime
import numpy as np
python_file = r"/home/jeromel/Documents/Projects/Deep2P/repos/deepinterpolation/examples/cluster_lib/generic_ephys_process_sync.py"
output_folder = "/allen/programs/braintv/workgroups/neuralcoding/Neurop... | [
"numpy.memmap",
"os.path.join",
"os.path.realpath",
"datetime.datetime.now",
"os.mkdir",
"os.path.basename",
"pbstools.PythonJob"
] | [((867, 901), 'numpy.memmap', 'np.memmap', (['dat_file'], {'dtype': '"""int16"""'}), "(dat_file, dtype='int16')\n", (876, 901), True, 'import numpy as np\n'), ((1080, 1103), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (1101, 1103), False, 'import datetime\n'), ((1307, 1362), 'os.path.join', 'os.... |
import pathlib
def count_lines_of_code(directory):
lines_of_code = 0
for path in directory.iterdir():
if path.name.startswith("."): # is hidden file or directory
continue
elif path.is_dir(): # is a directory
lines_of_code += count_lines_of_code(path)
conti... | [
"pathlib.Path"
] | [((830, 847), 'pathlib.Path', 'pathlib.Path', (['"""."""'], {}), "('.')\n", (842, 847), False, 'import pathlib\n')] |
from django.contrib import admin
from simple_history.admin import SimpleHistoryAdmin
from pathways.models import Application, Document, ForgivenessApplication, EmailCommunication
# Register your models here.
@admin.register(Document)
class DocumentAdmin(SimpleHistoryAdmin):
pass
class DocumentInline(admin.Tabu... | [
"django.contrib.admin.register",
"pathways.models.Document.objects.filter"
] | [((212, 236), 'django.contrib.admin.register', 'admin.register', (['Document'], {}), '(Document)\n', (226, 236), False, 'from django.contrib import admin\n'), ((370, 397), 'django.contrib.admin.register', 'admin.register', (['Application'], {}), '(Application)\n', (384, 397), False, 'from django.contrib import admin\n'... |
# -*- coding: utf-8 -*-
"""
Showcases corresponding chromaticities prediction plotting examples.
"""
from colour.plotting import (colour_style,
plot_corresponding_chromaticities_prediction)
from colour.utilities import message_box
message_box('Corresponding Chromaticities Prediction Plots... | [
"colour.utilities.message_box",
"colour.plotting.plot_corresponding_chromaticities_prediction",
"colour.plotting.colour_style"
] | [((262, 322), 'colour.utilities.message_box', 'message_box', (['"""Corresponding Chromaticities Prediction Plots"""'], {}), "('Corresponding Chromaticities Prediction Plots')\n", (273, 322), False, 'from colour.utilities import message_box\n'), ((324, 338), 'colour.plotting.colour_style', 'colour_style', ([], {}), '()\... |
import numpy as np
from soco_openqa.soco_mrc.mrc_model import MrcModel
from collections import defaultdict
class Reader:
def __init__(self, model):
self.model_id = model
self.reader = MrcModel('us', n_gpu=1)
self.thresh = 0.8
def predict(self, query, top_passages):
batch ... | [
"soco_openqa.soco_mrc.mrc_model.MrcModel",
"collections.defaultdict",
"numpy.argmax"
] | [((207, 230), 'soco_openqa.soco_mrc.mrc_model.MrcModel', 'MrcModel', (['"""us"""'], {'n_gpu': '(1)'}), "('us', n_gpu=1)\n", (215, 230), False, 'from soco_openqa.soco_mrc.mrc_model import MrcModel\n'), ((628, 645), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (639, 645), False, 'from collections... |
from github3.orgs import ShortOrganization
from git_sentry.handlers.access_controlled_git_object import AccessControlledGitObject
from git_sentry.handlers.git_repo import GitRepo
from git_sentry.handlers.git_team import GitTeam
from git_sentry.handlers.git_user import GitUser
from git_sentry.parsing.org_config import ... | [
"git_sentry.handlers.git_repo.GitRepo",
"git_sentry.handlers.git_team.GitTeam",
"git_sentry.parsing.team_config.TeamConfig",
"git_sentry.handlers.git_user.GitUser"
] | [((1544, 1588), 'git_sentry.parsing.team_config.TeamConfig', 'TeamConfig', (['team_members', 'team_admins', 'repos'], {}), '(team_members, team_admins, repos)\n', (1554, 1588), False, 'from git_sentry.parsing.team_config import TeamConfig\n'), ((1725, 1735), 'git_sentry.handlers.git_user.GitUser', 'GitUser', (['m'], {}... |
import adventure_game.my_utils as utils
# # # # #
# ROOM 6
#
# Serves as a good template for blank rooms
room6_inventory = {
'gory simplicity': 1,
'pick axe': 1,
'happy little accidents': 1,
'pointless': 1
}
room_state = {
'door_locked': True
}
def run_room(player_invento... | [
"adventure_game.my_utils.room_status",
"adventure_game.my_utils.player_status",
"adventure_game.my_utils.drop_item",
"adventure_game.my_utils.ask_command",
"adventure_game.my_utils.take_item",
"adventure_game.my_utils.map",
"adventure_game.my_utils.scrub_response"
] | [((1465, 1528), 'adventure_game.my_utils.ask_command', 'utils.ask_command', (['"""What do you want to do?"""', 'commands', 'no_args'], {}), "('What do you want to do?', commands, no_args)\n", (1482, 1528), True, 'import adventure_game.my_utils as utils\n'), ((1549, 1579), 'adventure_game.my_utils.scrub_response', 'util... |
"""Derived agent class."""
from swarms.lib.agent import Agent
import numpy as np
from swarms.utils.bt import BTConstruct
# from swarms.utils.results import Results
from py_trees import Behaviour, Blackboard
# import copy
from py_trees.meta import inverter
import py_trees
from py_trees.composites import Sequence, Sele... | [
"swarms.behaviors.sbehaviors.NeighbourObjects",
"swarms.behaviors.scbehaviors.CompositeSingleCarry",
"ponyge.fitness.evaluation.evaluate_fitness",
"swarms.behaviors.scbehaviors.MoveTowards",
"ponyge.operators.mutation.mutation",
"swarms.behaviors.scbehaviors.Explore",
"swarms.behaviors.sbehaviors.IsVisi... | [((1707, 1730), 'swarms.utils.bt.BTConstruct', 'BTConstruct', (['None', 'self'], {}), '(None, self)\n', (1718, 1730), False, 'from swarms.utils.bt import BTConstruct\n'), ((2192, 2233), 'py_trees.composites.Sequence', 'py_trees.composites.Sequence', (['"""DSequence"""'], {}), "('DSequence')\n", (2220, 2233), False, 'im... |
import sys,re,webbrowser
i=0
while i <= 100:
webbrowser.open_new_tab('www.google.com')
i=i+1
print (i)
| [
"webbrowser.open_new_tab"
] | [((52, 93), 'webbrowser.open_new_tab', 'webbrowser.open_new_tab', (['"""www.google.com"""'], {}), "('www.google.com')\n", (75, 93), False, 'import sys, re, webbrowser\n')] |
import os
import numpy as np
import requests
from datetime import datetime, timedelta
from pykml import parser
import logging
from config import LOG_PATH, DATA_PATH
class Download:
def __init__(self, date_range=14, log_mame=''):
os.makedirs(LOG_PATH, exist_ok=True)
logger = logging... | [
"logging.getLogger",
"os.listdir",
"os.makedirs",
"pykml.parser.parse",
"logging.Formatter",
"os.path.join",
"requests.get",
"requests.head",
"datetime.datetime.now",
"datetime.timedelta"
] | [((258, 294), 'os.makedirs', 'os.makedirs', (['LOG_PATH'], {'exist_ok': '(True)'}), '(LOG_PATH, exist_ok=True)\n', (269, 294), False, 'import os\n'), ((313, 354), 'logging.getLogger', 'logging.getLogger', (['f"""{log_mame}_download"""'], {}), "(f'{log_mame}_download')\n", (330, 354), False, 'import logging\n'), ((447, ... |
import torch
import torch.nn as nn
import torch.optim as optim
import torch.optim.lr_scheduler as lr_scheduler
from dgl import model_zoo
from torch.utils.data import DataLoader
import math, random, sys
import argparse
from collections import deque
import rdkit
from jtnn import *
torch.multiprocessing.set_sharing_str... | [
"torch.optim.lr_scheduler.ExponentialLR",
"argparse.ArgumentParser",
"torch.nn.init.constant_",
"torch.load",
"rdkit.RDLogger.logger",
"torch.nn.init.xavier_normal_",
"dgl.model_zoo.chem.DGLJTNNVAE",
"torch.multiprocessing.set_sharing_strategy",
"sys.stdout.flush"
] | [((283, 340), 'torch.multiprocessing.set_sharing_strategy', 'torch.multiprocessing.set_sharing_strategy', (['"""file_system"""'], {}), "('file_system')\n", (325, 340), False, 'import torch\n'), ((475, 592), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Training for JTNN"""', 'formatter_... |
import multiprocessing as mp
from multiprocessing.context import TimeoutError
import sys
MP_INITIALIZED = False
def init_mp():
# change start method to avoid issues with crashes/freezes
# discussed in
# http://scikit-learn.org/stable/faq.html#why-do-i-sometime-get-a-crash-freeze-with-n-jobs-1-under-osx-o... | [
"multiprocessing.Pool",
"multiprocessing.set_start_method"
] | [((465, 498), 'multiprocessing.set_start_method', 'mp.set_start_method', (['"""forkserver"""'], {}), "('forkserver')\n", (484, 498), True, 'import multiprocessing as mp\n'), ((666, 686), 'multiprocessing.Pool', 'mp.Pool', ([], {'processes': '(1)'}), '(processes=1)\n', (673, 686), True, 'import multiprocessing as mp\n')... |
# -- FILE: features/environment.py
from behave import use_fixture
from features.fixtures import *
# USE: behave -D DEBUG (to enable debug-on-error)
# USE: behave -D DEBUG=yes (to enable debug-on-error)
# USE: behave -D DEBUG=no (to disable debug-on-error)
DEBUG = False
def setup_debug_on_error(user... | [
"behave.use_fixture",
"ipdb.post_mortem"
] | [((694, 730), 'ipdb.post_mortem', 'ipdb.post_mortem', (['step.exc_traceback'], {}), '(step.exc_traceback)\n', (710, 730), False, 'import ipdb\n'), ((799, 824), 'behave.use_fixture', 'use_fixture', (['app', 'context'], {}), '(app, context)\n', (810, 824), False, 'from behave import use_fixture\n'), ((867, 897), 'behave.... |
import re;
from mWindowsAPI import fds0GetProcessesExecutableName_by_uId;
def cCdbWrapper_fQueueAttachForProcessExecutableNames(oCdbWrapper, *asExecutableNames):
asExecutableNamesLowered = [s.lower() for s in asExecutableNames];
for (uProcessId, s0ExecutableName) in fds0GetProcessesExecutableName_by_uId().items()... | [
"mWindowsAPI.fds0GetProcessesExecutableName_by_uId"
] | [((273, 312), 'mWindowsAPI.fds0GetProcessesExecutableName_by_uId', 'fds0GetProcessesExecutableName_by_uId', ([], {}), '()\n', (310, 312), False, 'from mWindowsAPI import fds0GetProcessesExecutableName_by_uId\n')] |
import numpy as np
import pandas as pd
from munch import Munch
from plaster.run.priors import ParamsAndPriors, Prior, Priors
from plaster.tools.aaseq.aaseq import aa_str_to_list
from plaster.tools.schema import check
from plaster.tools.schema.schema import Schema as s
from plaster.tools.utils import utils
from plaster.... | [
"plaster.tools.schema.schema.Schema.is_bool",
"plaster.tools.schema.schema.Schema.is_str",
"plaster.tools.utils.utils.listi",
"numpy.ascontiguousarray",
"plaster.tools.schema.check.list_or_tuple_t",
"plaster.tools.utils.utils.easy_join",
"numpy.zeros",
"plaster.tools.aaseq.aaseq.aa_str_to_list",
"pl... | [((957, 1161), 'munch.Munch', 'Munch', ([], {'n_pres': '(1)', 'n_mocks': '(0)', 'n_edmans': '(1)', 'dyes': '[]', 'labels': '[]', 'allow_edman_cterm': '(False)', 'enable_ptm_labels': '(False)', 'use_lognormal_model': '(False)', 'is_survey': '(False)', 'n_samples_train': '(5000)', 'n_samples_test': '(1000)'}), '(n_pres=1... |
# Copyright 2016 Hewlett Packard Enterprise Development LP
#
# 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 ... | [
"test_graph.loadGraphFromTextFile",
"test_graph.countTrianglesNp",
"test_graph.countTrianglesCPU",
"six.moves.urllib.request.urlopen",
"gzip.GzipFile",
"test_graph.countTrianglesGPU"
] | [((1292, 1323), 'six.moves.urllib.request.urlopen', 'urllib.request.urlopen', (['urlName'], {}), '(urlName)\n', (1314, 1323), False, 'from six.moves import urllib\n'), ((1494, 1529), 'gzip.GzipFile', 'gzip.GzipFile', (['tmpNameGz'], {'mode': '"""rb"""'}), "(tmpNameGz, mode='rb')\n", (1507, 1529), False, 'import gzip\n'... |
import torch
import torch.nn as nn
import torch.optim as optim
from torch.utils.data import TensorDataset, DataLoader
import click
from utils import metrics_report_func
# Get cpu or gpu device for training.
device = "cuda" if torch.cuda.is_available() else "cpu"
print("Using {} device".format(device))
# Parameters
... | [
"torch.nn.CrossEntropyLoss",
"torch.nn.Flatten",
"torch.utils.data.TensorDataset",
"torch.nn.Conv2d",
"torch.randint",
"torch.cuda.is_available",
"torch.nn.Linear",
"torch.utils.data.DataLoader",
"click.progressbar",
"torch.randn"
] | [((382, 414), 'torch.randn', 'torch.randn', (['(1000, 3, 224, 224)'], {}), '((1000, 3, 224, 224))\n', (393, 414), False, 'import torch\n'), ((419, 448), 'torch.randint', 'torch.randint', (['(0)', '(10)', '(1000,)'], {}), '(0, 10, (1000,))\n', (432, 448), False, 'import torch\n'), ((459, 478), 'torch.utils.data.TensorDa... |
from django.shortcuts import render
from rest_framework.views import APIView
from rest_framework.response import Response
import environ
import boto3
import urllib
import json
env = environ.Env()
environ.Env.read_env()
transcribe_client = boto3.client('transcribe', aws_access_key_id=env(
'AWS_ACCESS_KEY_ID'), aws... | [
"rest_framework.response.Response",
"environ.Env",
"urllib.request.urlopen",
"environ.Env.read_env"
] | [((183, 196), 'environ.Env', 'environ.Env', ([], {}), '()\n', (194, 196), False, 'import environ\n'), ((197, 219), 'environ.Env.read_env', 'environ.Env.read_env', ([], {}), '()\n', (217, 219), False, 'import environ\n'), ((1420, 1484), 'rest_framework.response.Response', 'Response', (["{'message': 'Please provide all t... |
from __future__ import print_function
import os,sys,inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(os.path.dirname(currentdir))
sys.path.insert(0,parentdir)
from utils.args import args
import setup.categories.classifier_setup as CLSetup
from ... | [
"sys.path.insert",
"inspect.currentframe",
"os.path.join",
"os.path.dirname",
"models.classifiers.PCAMDense"
] | [((205, 234), 'sys.path.insert', 'sys.path.insert', (['(0)', 'parentdir'], {}), '(0, parentdir)\n', (220, 234), False, 'import os, sys, inspect\n'), ((176, 203), 'os.path.dirname', 'os.path.dirname', (['currentdir'], {}), '(currentdir)\n', (191, 203), False, 'import os, sys, inspect\n'), ((525, 583), 'models.classifier... |
from functools import partial
from typing import Any, Callable, Optional
import abstracts
from aio.core import event, functional, tasks
from aio.core.dev import debug
# TODO: split `IReactive.pool` to here
class IExecutive(event.IReactive, metaclass=abstracts.Interface):
"""Object that executes commands in a p... | [
"aio.core.dev.debug.logging",
"aio.core.functional.batch_jobs",
"abstracts.implementer"
] | [((1005, 1057), 'abstracts.implementer', 'abstracts.implementer', (['(event.AReactive, IExecutive)'], {}), '((event.AReactive, IExecutive))\n', (1026, 1057), False, 'import abstracts\n'), ((1115, 1179), 'aio.core.dev.debug.logging', 'debug.logging', ([], {'log': '__name__', 'format_result': '"""self._debug_execute"""'}... |
import itertools as itt
import numpy as np
from pytriqs.gf import BlockGf, GfImFreq, inverse, GfImTime, make_zero_tail, replace_by_tail, fit_tail_on_window, fit_hermitian_tail_on_window
class MatsubaraGreensFunction(BlockGf):
"""
Greens functions interface to TRIQS. Provides convenient initialization.
gf... | [
"numpy.identity",
"numpy.eye",
"matplotlib.pyplot.savefig",
"itertools.product",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.close",
"numpy.array",
"pytriqs.gf.BlockGf.__lshift__",
"pytriqs.gf.make_zero_tail",
"pytriqs.gf.replace_by_tail"
] | [((9404, 9441), 'numpy.array', 'np.array', (['[w.imag for w in self.mesh]'], {}), '([w.imag for w in self.mesh])\n', (9412, 9441), True, 'import numpy as np\n'), ((9772, 9794), 'matplotlib.pyplot.savefig', 'plt.savefig', (['file_name'], {}), '(file_name)\n', (9783, 9794), True, 'from matplotlib import pyplot as plt\n')... |
try:
from api.users import credentials
from api.trusted_curator import TrustedCurator
from api.policy import Policy
from api.models import DNN_CV, OurDataset, methodology2
except:
from project2.api.users import credentials
from project2.api.trusted_curator import TrustedCurator
from project2... | [
"numpy.mean",
"project2.api.policy.Policy",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"project2.api.trusted_curator.TrustedCurator",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.show"
] | [((539, 603), 'project2.api.trusted_curator.TrustedCurator', 'TrustedCurator', ([], {'user': '"""master"""', 'password': '"""<PASSWORD>"""', 'mode': '"""off"""'}), "(user='master', password='<PASSWORD>', mode='off')\n", (553, 603), False, 'from project2.api.trusted_curator import TrustedCurator\n'), ((640, 708), 'proje... |
# Standard library
import atexit
import os
import socket
import sys
import time
# Third-party
# Third-party
import theano
theano.config.optimizer = 'None'
theano.config.mode = 'FAST_COMPILE'
theano.config.reoptimize_unpickled_function = False
theano.config.cxx = ""
from astropy.table import QTable
import h5py
import n... | [
"hq.log.logger.warning",
"numpy.isin",
"sys.exit",
"numpy.random.RandomState",
"os.path.exists",
"hq.samples_analysis.extract_MAP_sample",
"hq.config.Config.from_run_name",
"socket.gethostname",
"atexit.register",
"hq.log.logger.log",
"run_apogee.tmpdir_combine",
"h5py.File",
"hq.log.logger.... | [((810, 858), 'os.path.join', 'os.path.join', (['tmpdir', 'f"""worker-{worker_id}.hdf5"""'], {}), "(tmpdir, f'worker-{worker_id}.hdf5')\n", (822, 858), False, 'import os\n'), ((874, 902), 'astropy.table.QTable.read', 'QTable.read', (['c.metadata_file'], {}), '(c.metadata_file)\n', (885, 902), False, 'from astropy.table... |
from __future__ import absolute_import
from htchirp import client
import sys
sys.exit(client.main()) | [
"htchirp.client.main"
] | [((87, 100), 'htchirp.client.main', 'client.main', ([], {}), '()\n', (98, 100), False, 'from htchirp import client\n')] |
"""
Copyright 2019 <NAME>, <NAME>, <NAME>.
Indian Institute of Science.
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... | [
"collections.namedtuple",
"regex.finditer"
] | [((888, 955), 'collections.namedtuple', 'collections.namedtuple', (['"""Token"""', "['typ', 'value', 'line', 'column']"], {}), "('Token', ['typ', 'value', 'line', 'column'])\n", (910, 955), False, 'import collections\n'), ((2764, 2792), 'regex.finditer', 're.finditer', (['tok_regex', 'code'], {}), '(tok_regex, code)\n'... |
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the 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.
#
import sys
import torch
from tor... | [
"fairseq.options.get_parser",
"fairseq.meters.StopwatchMeter",
"fairseq.options.add_dataset_args",
"fairseq.utils.load_ensemble_for_inference",
"fairseq.tokenizer.tokenize_line",
"fairseq.progress_bar.progress_bar",
"fairseq.tokenizer.Tokenizer.tokenize",
"fairseq.options.add_generation_args",
"torc... | [((584, 616), 'fairseq.options.get_parser', 'options.get_parser', (['"""Generation"""'], {}), "('Generation')\n", (602, 616), False, 'from fairseq import bleu, options, utils, tokenizer\n'), ((775, 807), 'fairseq.options.add_dataset_args', 'options.add_dataset_args', (['parser'], {}), '(parser)\n', (799, 807), False, '... |
import unittest
import numpy as np
import torch
from torch.autograd import Variable
import torch.nn
from pyoptmat import ode, models, flowrules, hardening, utility, damage
from pyoptmat.temperature import ConstantParameter as CP
torch.set_default_tensor_type(torch.DoubleTensor)
torch.autograd.set_detect_anomaly(Tru... | [
"numpy.copy",
"torch.autograd.set_detect_anomaly",
"numpy.abs",
"numpy.allclose",
"pyoptmat.hardening.NoKinematicHardeningModel",
"numpy.ndenumerate",
"torch.set_default_tensor_type",
"torch.tensor",
"numpy.zeros",
"numpy.linspace",
"torch.zeros_like",
"torch.autograd.Variable",
"pyoptmat.te... | [((233, 282), 'torch.set_default_tensor_type', 'torch.set_default_tensor_type', (['torch.DoubleTensor'], {}), '(torch.DoubleTensor)\n', (262, 282), False, 'import torch\n'), ((283, 322), 'torch.autograd.set_detect_anomaly', 'torch.autograd.set_detect_anomaly', (['(True)'], {}), '(True)\n', (316, 322), False, 'import to... |
import json
import falcon
class Resource(object):
def on_get(self, req, resp):
doc = {
'images': [
{
'href': '/images/1eaf6ef1-7f2d-4ecc-a8d5-6e8adba7cc0e.png'
}
]
}
resp.body = json.dumps(doc, ensure_ascii=False)... | [
"json.dumps"
] | [((285, 320), 'json.dumps', 'json.dumps', (['doc'], {'ensure_ascii': '(False)'}), '(doc, ensure_ascii=False)\n', (295, 320), False, 'import json\n')] |
"""
针对sku管理的视图
"""
from rest_framework.generics import ListAPIView
from rest_framework.viewsets import ModelViewSet
from meiduo_admin.serializers.sku_serializers import *
from meiduo_admin.paginations import MyPage
from django.db.models import Q
class SKUGoodsView(ModelViewSet):
queryset = SKU.objects.all()
s... | [
"django.db.models.Q"
] | [((536, 561), 'django.db.models.Q', 'Q', ([], {'name__contains': 'keyword'}), '(name__contains=keyword)\n', (537, 561), False, 'from django.db.models import Q\n'), ((564, 592), 'django.db.models.Q', 'Q', ([], {'caption__contains': 'keyword'}), '(caption__contains=keyword)\n', (565, 592), False, 'from django.db.models i... |
import requests
import json
import time
# 获取腾讯疫情数据
def get_tencent_data():
"""
:return: 返回历史数据和当日详细数据
"""
url = 'https://view.inews.qq.com/g2/getOnsInfo?name=disease_h5'
headers = {
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.414... | [
"time.strptime",
"json.loads",
"time.strftime",
"requests.get"
] | [((356, 382), 'requests.get', 'requests.get', (['url', 'headers'], {}), '(url, headers)\n', (368, 382), False, 'import requests\n'), ((413, 431), 'json.loads', 'json.loads', (['r.text'], {}), '(r.text)\n', (423, 431), False, 'import json\n'), ((514, 537), 'json.loads', 'json.loads', (["res['data']"], {}), "(res['data']... |
import FWCore.ParameterSet.Config as cms
JetResolutionESProducer_AK4PFchs = cms.ESProducer("JetResolutionESProducer",
label = cms.string('AK4PFchs')
)
JetResolutionESProducer_SF_AK4PFchs = cms.ESProducer("JetResolutionScaleFactorESProducer",
label = cms.string('AK4PFchs')
)
| [
"FWCore.ParameterSet.Config.string"
] | [((135, 157), 'FWCore.ParameterSet.Config.string', 'cms.string', (['"""AK4PFchs"""'], {}), "('AK4PFchs')\n", (145, 157), True, 'import FWCore.ParameterSet.Config as cms\n'), ((268, 290), 'FWCore.ParameterSet.Config.string', 'cms.string', (['"""AK4PFchs"""'], {}), "('AK4PFchs')\n", (278, 290), True, 'import FWCore.Param... |
import logging
import os
from PyQt5.QtCore import QObject, pyqtSignal
from PyQt5.QtGui import QKeySequence
from PyQt5.QtWidgets import QMenuBar, QAction, QMenu, QActionGroup, QFileDialog
from model.psFileType import psFileType
log = logging.getLogger("psNavbar")
class PsNavbar(QMenuBar):
"""
Navbar used... | [
"logging.getLogger",
"PyQt5.QtWidgets.QMenu",
"PyQt5.QtWidgets.QAction",
"PyQt5.QtWidgets.QActionGroup",
"PyQt5.QtGui.QKeySequence"
] | [((236, 265), 'logging.getLogger', 'logging.getLogger', (['"""psNavbar"""'], {}), "('psNavbar')\n", (253, 265), False, 'import logging\n'), ((1230, 1250), 'PyQt5.QtWidgets.QMenu', 'QMenu', (['"""&File"""', 'self'], {}), "('&File', self)\n", (1235, 1250), False, 'from PyQt5.QtWidgets import QMenuBar, QAction, QMenu, QAc... |