code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import datetime
from datetime import date
from datetime import timedelta
import shutil
import openpyxl
from files.calweek import calweek
from files.planning import planning
import os
from files.read_data import read_eBas
file = input('Dateiname eingeben: ')
input('\nDie Datei eBas_Export: '+file+' in den Programmordne... | [
"files.planning.planning",
"openpyxl.load_workbook",
"os.path.isfile",
"files.read_data.read_eBas",
"shutil.copyfile",
"files.calweek.calweek"
] | [((520, 529), 'files.calweek.calweek', 'calweek', ([], {}), '()\n', (527, 529), False, 'from files.calweek import calweek\n'), ((1188, 1217), 'openpyxl.load_workbook', 'openpyxl.load_workbook', (['fname'], {}), '(fname)\n', (1210, 1217), False, 'import openpyxl\n'), ((1396, 1411), 'files.read_data.read_eBas', 'read_eBa... |
from django.db import models
from django.db.models.signals import pre_save
from .utils import unique_slug_generator
class Post(models.Model):
title = models.CharField(max_length=150)
body = models.TextField()
date = models.DateTimeField(auto_now_add=True)
updated = models.DateTimeField(auto_now=True)
... | [
"django.db.models.TextField",
"django.db.models.signals.pre_save.connect",
"django.db.models.SlugField",
"django.db.models.DateTimeField",
"django.db.models.CharField"
] | [((569, 622), 'django.db.models.signals.pre_save.connect', 'pre_save.connect', (['post_pre_save_receiver'], {'sender': 'Post'}), '(post_pre_save_receiver, sender=Post)\n', (585, 622), False, 'from django.db.models.signals import pre_save\n'), ((156, 188), 'django.db.models.CharField', 'models.CharField', ([], {'max_len... |
# -*- coding: utf-8 -*-
# @Time : 2021/1/8 下午7:32
# @Author : 司云中
# @File : decorator.py
# @Software: Pycharm
from Emall import drf_validators
from Emall.exceptions import DataFormatError
def validate_url_data(model, field, null=None):
"""
通用校验字段装饰器工厂函数
校验GET请求方式下不同Model中字段的数据格式
:param model: 具体fiel... | [
"Emall.exceptions.DataFormatError"
] | [((784, 810), 'Emall.exceptions.DataFormatError', 'DataFormatError', (['"""缺少必要的数据"""'], {}), "('缺少必要的数据')\n", (799, 810), False, 'from Emall.exceptions import DataFormatError\n'), ((1134, 1151), 'Emall.exceptions.DataFormatError', 'DataFormatError', ([], {}), '()\n', (1149, 1151), False, 'from Emall.exceptions import ... |
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
# Lean CLI v1.0. Copyright 2021 QuantConnect Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at http://www.apache... | [
"lean.container.container.temp_manager",
"lean.container.container.update_manager",
"lean.container.container.lean_runner",
"click.option",
"lean.container.container.project_manager",
"lean.container.container.project_config_manager",
"lean.models.data_providers.QuantConnectDataProvider.get_name",
"le... | [((1479, 1558), 'click.command', 'click.command', ([], {'cls': 'LeanCommand', 'requires_lean_config': '(True)', 'requires_docker': '(True)'}), '(cls=LeanCommand, requires_lean_config=True, requires_docker=True)\n', (1492, 1558), False, 'import click\n'), ((1652, 1761), 'click.option', 'click.option', (['"""--port"""'],... |
import json
import re
import base64
import os
import requests
import jwt
from collections import defaultdict
from flask import Flask, jsonify, abort, make_response, request, current_app, _request_ctx_stack
from flask.ext.cors import cross_origin
from functools import wraps
from datetime import timedelta
from functool... | [
"re.split",
"os.getenv",
"flask.Flask",
"flasgger.Swagger",
"functools.wraps",
"flask.ext.cors.cross_origin",
"dotenv.Dotenv",
"flask.request.get_json",
"py2neo.Graph",
"flask.request.headers.get",
"flask.jsonify"
] | [((959, 974), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (964, 974), False, 'from flask import Flask, jsonify, abort, make_response, request, current_app, _request_ctx_stack\n'), ((975, 987), 'flasgger.Swagger', 'Swagger', (['app'], {}), '(app)\n', (982, 987), False, 'from flasgger import Swagger\n'), ... |
import sys
import math
if sys.version_info.minor >= 5:
from math import gcd
else:
from fractions import gcd
A, B = map(int, input().split())
g = gcd(A, B)
print(A * B // g)
| [
"fractions.gcd"
] | [((154, 163), 'fractions.gcd', 'gcd', (['A', 'B'], {}), '(A, B)\n', (157, 163), False, 'from fractions import gcd\n')] |
import os
import boto3
from common import AWSServiceCollector, AWS_REGIONS_SET
sns = boto3.client('sns')
sts = boto3.client('sts')
class ElasticBeanstalkCollector(AWSServiceCollector):
boto3_service_name = 'elasticbeanstalk'
def _collect_assets(self):
# collect Elastic Beanstalk domains and endpoi... | [
"boto3.Session",
"boto3.client"
] | [((88, 107), 'boto3.client', 'boto3.client', (['"""sns"""'], {}), "('sns')\n", (100, 107), False, 'import boto3\n'), ((114, 133), 'boto3.client', 'boto3.client', (['"""sts"""'], {}), "('sts')\n", (126, 133), False, 'import boto3\n'), ((1507, 1696), 'boto3.Session', 'boto3.Session', ([], {'aws_access_key_id': "credentia... |
from celery import Celery
from django.core.mail import send_mail
from django.conf import settings
from goods.models import GoodsCategory, Goods, GoodsSKU, IndexPromotionBanner, IndexGoodsBanner, IndexCategoryGoodsBanner
from django.template import loader
import os
# 创建celery客户端 或者叫做celery对象
# 参数1: 指定任务所在的路径,从包名开始
# 参数... | [
"goods.models.IndexGoodsBanner.objects.all",
"goods.models.IndexPromotionBanner.objects.all",
"django.core.mail.send_mail",
"celery.Celery",
"goods.models.GoodsCategory.objects.all",
"os.path.join",
"goods.models.IndexCategoryGoodsBanner.objects.filter",
"django.template.loader.get_template"
] | [((380, 443), 'celery.Celery', 'Celery', (['"""celery_tasks.tasks"""'], {'broker': '"""redis://127.0.0.1:6379/4"""'}), "('celery_tasks.tasks', broker='redis://127.0.0.1:6379/4')\n", (386, 443), False, 'from celery import Celery\n'), ((901, 966), 'django.core.mail.send_mail', 'send_mail', (['subject', 'body', 'sender', ... |
"""Script for running mass balance checking tools."""
from SBMLLint.common import config
from SBMLLint.common import constants as cn
from SBMLLint.common.simple_sbml import SimpleSBML
from SBMLLint.common import util
from SBMLLint.games.games_pp import GAMES_PP
from SBMLLint.games.games_report import GAMESReport
from... | [
"libsbml.SBMLReader",
"SBMLLint.games.games_pp.GAMES_PP",
"SBMLLint.moiety_analysis.moiety_comparator.MoietyComparator.analyzeReactions",
"SBMLLint.common.config.setConfiguration",
"SBMLLint.common.util.isSBMLModel",
"SBMLLint.common.util.getXML",
"SBMLLint.common.config.getConfiguration",
"SBMLLint.c... | [((1127, 1166), 'SBMLLint.common.config.setConfiguration', 'config.setConfiguration', ([], {'fid': 'config_fid'}), '(fid=config_fid)\n', (1150, 1166), False, 'from SBMLLint.common import config\n'), ((1182, 1207), 'SBMLLint.common.config.getConfiguration', 'config.getConfiguration', ([], {}), '()\n', (1205, 1207), Fals... |
import json
from collections import OrderedDict
res = {}
for dbname in odoo.service.db.list_dbs(True):
res[dbname] = OrderedDict()
registry = odoo.registry(dbname)
with registry.cursor() as cr:
cr.execute("SELECT key, value FROM ir_config_parameter WHERE key IN ('database.create_date', 'database.e... | [
"collections.OrderedDict",
"json.dumps"
] | [((123, 136), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (134, 136), False, 'from collections import OrderedDict\n'), ((528, 543), 'json.dumps', 'json.dumps', (['res'], {}), '(res)\n', (538, 543), False, 'import json\n')] |
from django import forms
class ClaimFundsForm(forms.Form):
email = forms.EmailField()
| [
"django.forms.EmailField"
] | [((76, 94), 'django.forms.EmailField', 'forms.EmailField', ([], {}), '()\n', (92, 94), False, 'from django import forms\n')] |
import sys
from PyQt5.QtWidgets import QDialog, QApplication
import DataCollectTool.RecToolUI as RecToolUI
import DataCollectTool.CommandRecord as rec
import _thread
FILE_PATH = ""
count = 1
class MyForm(QDialog):
def __init__(self):
super().__init__()
self.ui = RecToolUI.Ui_Dialog()
self... | [
"DataCollectTool.RecToolUI.Ui_Dialog",
"DataCollectTool.CommandRecord.record"
] | [((286, 307), 'DataCollectTool.RecToolUI.Ui_Dialog', 'RecToolUI.Ui_Dialog', ([], {}), '()\n', (305, 307), True, 'import DataCollectTool.RecToolUI as RecToolUI\n'), ((1219, 1231), 'DataCollectTool.CommandRecord.record', 'rec.record', ([], {}), '()\n', (1229, 1231), True, 'import DataCollectTool.CommandRecord as rec\n')] |
from abc import abstractmethod
from sequential_inference.envs.vec_env.vec_env import VecEnv
from typing import Dict
import gym
import torch
from sequential_inference.util.data import gather_trajectory_data
from sequential_inference.data.data import (
BatchTrajectorySampler,
TrajectoryReplayBuffer,
)
from sequ... | [
"sequential_inference.rl.agents.RandomAgent",
"sequential_inference.util.data.gather_trajectory_data",
"sequential_inference.data.data.BatchTrajectorySampler",
"torch.Tensor"
] | [((1439, 1473), 'sequential_inference.rl.agents.RandomAgent', 'RandomAgent', (['self.env.action_space'], {}), '(self.env.action_space)\n', (1450, 1473), False, 'from sequential_inference.rl.agents import RandomAgent\n'), ((1482, 1547), 'sequential_inference.util.data.gather_trajectory_data', 'gather_trajectory_data', (... |
# This file is part of Pynguin.
#
# Pynguin is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pynguin is distributed in the ho... | [
"logging.getLogger",
"sys.path.insert",
"logging.StreamHandler",
"pynguin.utils.statistics.statistics.StatisticsTracker",
"pynguin.testcase.execution.executiontracer.ExecutionTracer",
"pynguin.testcase.execution.testcaseexecutor.TestCaseExecutor",
"pynguin.testsuite.testsuitechromosome.TestSuiteChromoso... | [((7478, 7526), 'sys.path.insert', 'sys.path.insert', (['(0)', 'config.INSTANCE.project_path'], {}), '(0, config.INSTANCE.project_path)\n', (7493, 7526), False, 'import sys\n'), ((7659, 7676), 'pynguin.testcase.execution.executiontracer.ExecutionTracer', 'ExecutionTracer', ([], {}), '()\n', (7674, 7676), False, 'from p... |
import os
import random
import pathlib
from unittest.mock import patch
import numpy as np
from word_vectors import FileType
from word_vectors.read import read
from word_vectors.convert import convert
from utils import vocab, vectors, DATA, GLOVE, W2V, W2V_TEXT, LEADER, rand_str
INPUT_MAPPING = {
GLOVE: FileType.G... | [
"random.choice",
"word_vectors.convert.convert",
"numpy.testing.assert_allclose",
"os.path.splitext",
"utils.rand_str",
"word_vectors.read.read",
"unittest.mock.patch",
"os.remove"
] | [((446, 491), 'random.choice', 'random.choice', (['[GLOVE, W2V, W2V_TEXT, LEADER]'], {}), '([GLOVE, W2V, W2V_TEXT, LEADER])\n', (459, 491), False, 'import random\n'), ((1099, 1144), 'random.choice', 'random.choice', (['[GLOVE, W2V, W2V_TEXT, LEADER]'], {}), '([GLOVE, W2V, W2V_TEXT, LEADER])\n', (1112, 1144), False, 'im... |
from config import config
from BODtoJSON.BODtoJSON import convert
print(convert(config.input_var, 'Sync'))
| [
"BODtoJSON.BODtoJSON.convert"
] | [((73, 106), 'BODtoJSON.BODtoJSON.convert', 'convert', (['config.input_var', '"""Sync"""'], {}), "(config.input_var, 'Sync')\n", (80, 106), False, 'from BODtoJSON.BODtoJSON import convert\n')] |
"""
In reduce_embeddings.py we don't filter out duplicated sentences.
However, for analysis with the TK data we need to make sure all the
job ids are used.
e.g. if the same sentence is used in two job adverts only one of them is brought
forward, and thus the analysis will miss out including the second job advert in th... | [
"logging.getLogger",
"skills_taxonomy_v2.getters.s3_data.save_to_s3",
"skills_taxonomy_v2.getters.s3_data.get_s3_data_paths",
"tqdm.tqdm",
"boto3.resource",
"skills_taxonomy_v2.getters.s3_data.load_s3_data"
] | [((600, 627), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (617, 627), False, 'import logging\n'), ((634, 654), 'boto3.resource', 'boto3.resource', (['"""s3"""'], {}), "('s3')\n", (648, 654), False, 'import boto3\n'), ((788, 875), 'skills_taxonomy_v2.getters.s3_data.get_s3_data_paths', ... |
"""
Matching pennies environment.
"""
import gym
import numpy as np
from gym.spaces import Discrete, Tuple
from .common import OneHot
class IteratedMatchingPennies(gym.Env):
"""
A two-agent vectorized environment for the Matching Pennies game.
"""
NAME = 'IMP'
NUM_AGENTS = 2
NUM_ACTIONS = 2
... | [
"numpy.array",
"numpy.zeros",
"gym.spaces.Discrete"
] | [((436, 464), 'numpy.array', 'np.array', (['[[1, -1], [-1, 1]]'], {}), '([[1, -1], [-1, 1]])\n', (444, 464), True, 'import numpy as np\n'), ((778, 803), 'numpy.zeros', 'np.zeros', (['self.NUM_STATES'], {}), '(self.NUM_STATES)\n', (786, 803), True, 'import numpy as np\n'), ((1084, 1109), 'numpy.zeros', 'np.zeros', (['se... |
"""
Add new "dimension_chart" and "dimension_table" tables.
These will initially be used to hold just the ethnicity classifications of charts and tables of a dimension.
In future the chart and table data itself will be moved from the dimension tables into these new tables.
Revision ID: 2018_10_02_chart_and_table
Revis... | [
"sqlalchemy.ForeignKeyConstraint",
"alembic.op.drop_table",
"sqlalchemy.Boolean",
"sqlalchemy.PrimaryKeyConstraint",
"sqlalchemy.Integer"
] | [((1816, 1848), 'alembic.op.drop_table', 'op.drop_table', (['"""dimension_chart"""'], {}), "('dimension_chart')\n", (1829, 1848), False, 'from alembic import op\n'), ((1853, 1885), 'alembic.op.drop_table', 'op.drop_table', (['"""dimension_table"""'], {}), "('dimension_table')\n", (1866, 1885), False, 'from alembic impo... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import re
import tensorflow as tf
class AdamWeightDecayOptimizer(tf.train.Optimizer):
"""A basic Adam optimizer that includes "correct" L2 weight decay."""
def __init__(self,
learning_rate,
... | [
"tensorflow.variable_scope",
"tensorflow.logging.info",
"tensorflow.summary.merge",
"tensorflow.multiply",
"re.match",
"tensorflow.nn.zero_fraction",
"tensorflow.zeros_initializer",
"tensorflow.group",
"tensorflow.sqrt",
"tensorflow.square",
"tensorflow.cast",
"re.search"
] | [((4543, 4575), 'tensorflow.summary.merge', 'tf.summary.merge', (['grad_summaries'], {}), '(grad_summaries)\n', (4559, 4575), True, 'import tensorflow as tf\n'), ((3044, 3077), 'tensorflow.group', 'tf.group', (['*assignments'], {'name': 'name'}), '(*assignments, name=name)\n', (3052, 3077), True, 'import tensorflow as ... |
import unittest
import urllib
import datetime
from hamcrest import assert_that, is_
from mock import patch
import pytz
from backdrop.core.timeseries import WEEK
from backdrop.read import api
from backdrop.core.query import Query
from tests.support.performanceplatform_client import fake_data_set_exists, fake_no_data_set... | [
"backdrop.read.api.app.test_client",
"tests.support.performanceplatform_client.fake_no_data_sets_exist",
"tests.support.performanceplatform_client.fake_data_set_exists",
"mock.patch",
"datetime.datetime",
"backdrop.core.query.Query.create",
"tests.support.test_helpers.has_header",
"hamcrest.is_",
"b... | [((580, 655), 'tests.support.performanceplatform_client.fake_data_set_exists', 'fake_data_set_exists', (['"""foo"""'], {'data_group': '"""some-group"""', 'data_type': '"""some-type"""'}), "('foo', data_group='some-group', data_type='some-type')\n", (600, 655), False, 'from tests.support.performanceplatform_client impor... |
__author__ = "Cobbin"
from flask import Flask, render_template, request, url_for, flash
import os, requests
import smtplib, ssl
import src.models.msgs.constants as MsgsConstants #src.
from werkzeug.utils import redirect
app = Flask(__name__)
app.config.from_object('src.config') #src.
app.secret_key = app.sec... | [
"flask.render_template",
"flask.flash",
"flask.Flask",
"os.environ.get",
"flask.url_for"
] | [((234, 249), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (239, 249), False, 'from flask import Flask, render_template, request, url_for, flash\n'), ((330, 359), 'os.environ.get', 'os.environ.get', (['"""SECRETE_KEY"""'], {}), "('SECRETE_KEY')\n", (344, 359), False, 'import os, requests\n'), ((415, 443)... |
from jobbergate.cli import flatten, parse_field, ask_questions
import inquirer
from jobbergate import appform
def test_flatten():
assert flatten([1, 2, [3, 4]]) == [1, 2, 3, 4]
def test_parse_field():
textfield = parse_field(appform.Text("var", "Variable"))
assert isinstance(textfield, inquirer.Text)
... | [
"jobbergate.cli.flatten",
"jobbergate.appform.Integer",
"jobbergate.appform.Text"
] | [((143, 166), 'jobbergate.cli.flatten', 'flatten', (['[1, 2, [3, 4]]'], {}), '([1, 2, [3, 4]])\n', (150, 166), False, 'from jobbergate.cli import flatten, parse_field, ask_questions\n'), ((237, 268), 'jobbergate.appform.Text', 'appform.Text', (['"""var"""', '"""Variable"""'], {}), "('var', 'Variable')\n", (249, 268), F... |
from urllib.request import urlopen
from pathlib import Path
inputs = Path("day1_input.txt").read_text()
module_weights = map(int, inputs.split())
def sum_with_fuel(weight: int) -> int:
weights = [weight]
while weights[-1] // 3 - 2 > 0:
weights.append( weights[-1] // 3 - 2 )
return ... | [
"pathlib.Path"
] | [((73, 95), 'pathlib.Path', 'Path', (['"""day1_input.txt"""'], {}), "('day1_input.txt')\n", (77, 95), False, 'from pathlib import Path\n')] |
#!/venv/bin/python
import unittest
from utils import oracle, converter
from utils.aesencryption import AESEncryption
from utils.attacks import find_xor_single_char_key, break_repeating_key_xor
from utils.binary_data_operators import fixed_xor, repeating_xor
class CryptoChallenge(unittest.TestCase):
def test_Se... | [
"utils.converter.str_to_bytes",
"utils.converter.encode_hex",
"utils.aesencryption.AESEncryption",
"utils.oracle.is_ECB_encrypted",
"utils.converter.encode_base64",
"utils.binary_data_operators.repeating_xor",
"utils.converter.decode_hex",
"utils.converter.decode_base64",
"utils.attacks.find_xor_sin... | [((5924, 5939), 'unittest.main', 'unittest.main', ([], {}), '()\n', (5937, 5939), False, 'import unittest\n'), ((653, 685), 'utils.converter.decode_hex', 'converter.decode_hex', (['hex_string'], {}), '(hex_string)\n', (673, 685), False, 'from utils import oracle, converter\n'), ((703, 740), 'utils.converter.encode_base... |
"""
LP Files
https://www.ibm.com/support/knowledgecenter/SSSA5P_12.5.0/ilog.odms.cplex.help/CPLEX/FileFormats/topics/LP.html
http://www.gurobi.com/documentation/8.0/refman/lp_format.html
"""
from math import isinf
from os import path
import pyflip as flp
def write_lp_file(model, filename, directory='.'):
full_fi... | [
"os.path.join",
"math.isinf"
] | [((329, 359), 'os.path.join', 'path.join', (['directory', 'filename'], {}), '(directory, filename)\n', (338, 359), False, 'from os import path\n'), ((1693, 1720), 'math.isinf', 'isinf', (['variable.lower_bound'], {}), '(variable.lower_bound)\n', (1698, 1720), False, 'from math import isinf\n'), ((1725, 1752), 'math.isi... |
from setuptools import setup, find_packages
setup(
name='htmls',
description='Makes it easy to write use CSS selectors with HTML in your unit tests.',
version='2.0.0',
license='BSD',
url='https://github.com/espenak/htmls',
author='<NAME>',
author_email='<EMAIL>',
packages=find_packages... | [
"setuptools.find_packages"
] | [((307, 322), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (320, 322), False, 'from setuptools import setup, find_packages\n')] |
# -*- coding: utf8 -*-
from __future__ import absolute_import
import os
from celery import Celery
from django.conf import settings
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'docato_proj.settings')
#app = Celery('docato_proj')
app = Celery('docato_proj',backend='rpc://') #,include=['test_celery.tasks'] # broker='... | [
"os.environ.setdefault",
"celery.Celery"
] | [((131, 202), 'os.environ.setdefault', 'os.environ.setdefault', (['"""DJANGO_SETTINGS_MODULE"""', '"""docato_proj.settings"""'], {}), "('DJANGO_SETTINGS_MODULE', 'docato_proj.settings')\n", (152, 202), False, 'import os\n'), ((239, 278), 'celery.Celery', 'Celery', (['"""docato_proj"""'], {'backend': '"""rpc://"""'}), "... |
import os
import pytest
import pandas as pd
from spectraml import xmatch
@pytest.fixture
def candidates_catalogue(datadir):
"""Catalogue with candidates file fixture."""
return pd.read_csv(os.path.join(datadir, 'candidates-catalogue.csv'))
@pytest.fixture
def hou_catalogue(datadir):
"""Catalogue with Ho... | [
"spectraml.xmatch.xmatch",
"os.path.join"
] | [((560, 610), 'spectraml.xmatch.xmatch', 'xmatch.xmatch', (['candidates_catalogue', 'hou_catalogue'], {}), '(candidates_catalogue, hou_catalogue)\n', (573, 610), False, 'from spectraml import xmatch\n'), ((199, 248), 'os.path.join', 'os.path.join', (['datadir', '"""candidates-catalogue.csv"""'], {}), "(datadir, 'candid... |
#!/usr/bin/env python
# Filename: planet_svm_classify
"""
introduction: Using SVM in sklearn library to perform classification on Planet images
authors: <NAME>
email:<EMAIL>
add time: 4 January, 2019
"""
import sys, os
from optparse import OptionParser
import rasterio
import numpy as np
HOME = os.path.expanduser('~... | [
"sys.path.insert",
"sklearn.externals.joblib.load",
"multiprocessing.cpu_count",
"basic_src.basic.outputlogMessage",
"sys.exit",
"basic_src.io_function.is_file_exist",
"numpy.concatenate",
"datasets.build_RS_data.make_dataset",
"os.path.expanduser",
"numpy.ones",
"datasets.build_RS_data.read_pat... | [((299, 322), 'os.path.expanduser', 'os.path.expanduser', (['"""~"""'], {}), "('~')\n", (317, 322), False, 'import sys, os\n'), ((391, 420), 'sys.path.insert', 'sys.path.insert', (['(0)', 'codes_dir'], {}), '(0, codes_dir)\n', (406, 420), False, 'import sys, os\n'), ((559, 589), 'sys.path.insert', 'sys.path.insert', ([... |
import torch
x = torch.randn(3, requires_grad=True)
print(x)
y = x + 2
print(y)
z = y * y * 2
print(z)
z = z.mean()
print(z)
z.backward()
print(x.grad)
x = torch.randn(3, requires_grad=True)
print(x)
x.requires_grad_(False)
print(x)
x = torch.randn(3, requires_grad=True)
print(x)
x = x.detach()
print(x)
x = t... | [
"torch.no_grad",
"torch.randn",
"torch.ones"
] | [((18, 52), 'torch.randn', 'torch.randn', (['(3)'], {'requires_grad': '(True)'}), '(3, requires_grad=True)\n', (29, 52), False, 'import torch\n'), ((164, 198), 'torch.randn', 'torch.randn', (['(3)'], {'requires_grad': '(True)'}), '(3, requires_grad=True)\n', (175, 198), False, 'import torch\n'), ((246, 280), 'torch.ran... |
from app import db
from datetime import datetime
class Subscribe(db.Model):
__tablename__ = 'subscribers'
id = db.Column(db.Integer, primary_key=True, autoincrement=True)
subscriber = db.Column(db.String(), nullable=False,unique=True)
def save_subscriber(self):
db.session.add(self)
db... | [
"app.db.String",
"app.db.Column",
"app.db.session.commit",
"app.db.session.add"
] | [((121, 180), 'app.db.Column', 'db.Column', (['db.Integer'], {'primary_key': '(True)', 'autoincrement': '(True)'}), '(db.Integer, primary_key=True, autoincrement=True)\n', (130, 180), False, 'from app import db\n'), ((208, 219), 'app.db.String', 'db.String', ([], {}), '()\n', (217, 219), False, 'from app import db\n'),... |
#create vertices for the brick tess pattern
# ==============================================================================
#Imports
# ==============================================================================
import compas_rhino
from compas_rhino.geometry import RhinoMesh
from compas.datastructures import Mesh
fr... | [
"compas_rhino.geometry.RhinoMesh.from_guid",
"compas.datastructures.Mesh",
"compas_rhino.artists.MeshArtist",
"compas_rhino.select_mesh"
] | [((547, 573), 'compas_rhino.select_mesh', 'compas_rhino.select_mesh', ([], {}), '()\n', (571, 573), False, 'import compas_rhino\n'), ((676, 682), 'compas.datastructures.Mesh', 'Mesh', ([], {}), '()\n', (680, 682), False, 'from compas.datastructures import Mesh\n'), ((3726, 3796), 'compas_rhino.artists.MeshArtist', 'Mes... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-03-21 16:13
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('xwing_data', '0012_auto_20170313_2203'),
]
operati... | [
"django.db.models.ManyToManyField",
"django.db.models.ForeignKey"
] | [((439, 498), 'django.db.models.ManyToManyField', 'models.ManyToManyField', ([], {'blank': '(True)', 'to': '"""xwing_data.Faction"""'}), "(blank=True, to='xwing_data.Faction')\n", (461, 498), False, 'from django.db import migrations, models\n'), ((621, 678), 'django.db.models.ManyToManyField', 'models.ManyToManyField',... |
import pyglet
from pyglet.window import key
class Resources():
elevator_img = pyglet.image.load("img/elevator.png")
doors_img = pyglet.image.load("img/doors.png")
stop_img = pyglet.image.load("img/stop.png")
signal_img = pyglet.image.load("img/signal.png")
arrow_img = pyglet.image.load("img/arrow.p... | [
"pyglet.image.load"
] | [((83, 120), 'pyglet.image.load', 'pyglet.image.load', (['"""img/elevator.png"""'], {}), "('img/elevator.png')\n", (100, 120), False, 'import pyglet\n'), ((137, 171), 'pyglet.image.load', 'pyglet.image.load', (['"""img/doors.png"""'], {}), "('img/doors.png')\n", (154, 171), False, 'import pyglet\n'), ((187, 220), 'pygl... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# king_phisher/client/tabs/campaign.py
#
# 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
# not... | [
"logging.getLogger",
"king_phisher.client.gui_utilities.UtilityFileChooser",
"king_phisher.client.gui_utilities.glib_idle_add_wait",
"gi.repository.Gtk.SeparatorMenuItem",
"king_phisher.client.gui_utilities.show_dialog_yes_no",
"king_phisher.client.gui_utilities.gtk_sync",
"threading.Lock",
"gi.reposi... | [((2249, 2281), 'gi.repository.Gtk.Label', 'Gtk.Label', ([], {'label': 'self.label_text'}), '(label=self.label_text)\n', (2258, 2281), False, 'from gi.repository import Gtk\n'), ((2487, 2504), 'threading.Event', 'threading.Event', ([], {}), '()\n', (2502, 2504), False, 'import threading\n'), ((2990, 3006), 'threading.L... |
# Library Imports
import tensorflow as tf
import numpy as np
# Internal Imports
import configs
image_size = 128
seed = 147854
def get_plant_diseases_dataset(batch_size, supervised_samples_ratio):
training_path = configs.dataset_path + "train/"
validation_path = configs.dataset_path + "valid/"
... | [
"tensorflow.cast",
"tensorflow.keras.preprocessing.image_dataset_from_directory"
] | [((344, 551), 'tensorflow.keras.preprocessing.image_dataset_from_directory', 'tf.keras.preprocessing.image_dataset_from_directory', (['training_path'], {'validation_split': 'supervised_samples_ratio', 'subset': '"""training"""', 'seed': 'seed', 'image_size': '(image_size, image_size)', 'batch_size': 'batch_size'}), "(t... |
#!/usr/bin/env python3
from __future__ import division
from builtins import str
from builtins import range
from builtins import object
from past.utils import old_div
import isce
from isceobj.Scene.Frame import Frame
from isceobj.Planet.AstronomicalHandbook import Const
from isceobj.Planet.Planet import Planet
from Sen... | [
"numpy.mean",
"traceback.format_exc",
"FrameInfoExtractor.FrameInfoExtractor",
"argparse.ArgumentParser",
"re.compile",
"json.dumps",
"builtins.str",
"past.utils.old_div",
"Sentinel1_TOPS.Sentinel1_TOPS",
"numpy.array",
"builtins.range",
"isceobj.Scene.Frame.Frame",
"lxml.objectify.parse",
... | [((603, 628), 're.compile', 're.compile', (['"""-(raw|slc)-"""'], {}), "('-(raw|slc)-')\n", (613, 628), False, 'import os, sys, re, requests, json, shutil, traceback, logging, hashlib, math\n'), ((644, 665), 're.compile', 're.compile', (['"""S1(\\\\w)"""'], {}), "('S1(\\\\w)')\n", (654, 665), False, 'import os, sys, re... |
import os
import sys
import unittest
from nose.config import Config
from nose.plugins import doctests
from mock import Bucket
class TestDoctestErrorHandling(unittest.TestCase):
def setUp(self):
self._path = sys.path[:]
here = os.path.dirname(__file__)
testdir = os.path.join(here, 'support'... | [
"sys.path.insert",
"nose.plugins.doctests.Doctest",
"mock.Bucket",
"os.path.join",
"os.path.dirname",
"unittest.main",
"nose.config.Config"
] | [((1136, 1151), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1149, 1151), False, 'import unittest\n'), ((248, 273), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (263, 273), False, 'import os\n'), ((292, 332), 'os.path.join', 'os.path.join', (['here', '"""support"""', '"""doctest"""'... |
"""
URLs mapped to the views
Copyright 2021 <NAME>, <NAME>, and <NAME>. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licen... | [
"rest_framework_simplejwt.views.TokenVerifyView.as_view",
"rest_framework_simplejwt.views.TokenObtainPairView.as_view",
"hyfed_server.view.hyfed_views.ProjectInfoView.as_view",
"rest_framework_simplejwt.views.TokenRefreshView.as_view",
"hyfed_server.view.hyfed_views.ProjectStartedView.as_view",
"django.ur... | [((1458, 1481), 'rest_framework.routers.DefaultRouter', 'routers.DefaultRouter', ([], {}), '()\n', (1479, 1481), False, 'from rest_framework import routers\n'), ((1707, 1738), 'django.urls.path', 'path', (['"""admin/"""', 'admin.site.urls'], {}), "('admin/', admin.site.urls)\n", (1711, 1738), False, 'from django.urls i... |
from rest_framework import generics, status
from rest_framework import viewsets
from rest_framework.response import Response
from apps.base.api import GeneralListApiView
from apps.products.api.serializers.product_serializer import ProductSerializer
from apps.users.authentication_mixins import Authentication
class Pr... | [
"rest_framework.response.Response"
] | [((797, 857), 'rest_framework.response.Response', 'Response', (['product_serializer.data'], {'status': 'status.HTTP_200_OK'}), '(product_serializer.data, status=status.HTTP_200_OK)\n', (805, 857), False, 'from rest_framework.response import Response\n'), ((1179, 1242), 'rest_framework.response.Response', 'Response', ([... |
"""Hourly Temp Frequencies"""
import calendar
from collections import OrderedDict
from pandas.io.sql import read_sql
from pyiem.util import get_autoplot_context, get_dbconn
from pyiem.plot.use_agg import plt
from pyiem.exceptions import NoDataFound
PDICT = OrderedDict([
('above', 'At or Above Temperature'),
(... | [
"collections.OrderedDict",
"pandas.io.sql.read_sql",
"pyiem.util.get_dbconn",
"pyiem.exceptions.NoDataFound",
"pyiem.plot.use_agg.plt.subplots"
] | [((259, 346), 'collections.OrderedDict', 'OrderedDict', (["[('above', 'At or Above Temperature'), ('below', 'Below Temperature')]"], {}), "([('above', 'At or Above Temperature'), ('below',\n 'Below Temperature')])\n", (270, 346), False, 'from collections import OrderedDict\n'), ((1186, 1219), 'pyiem.util.get_dbconn'... |
import os
import sys
from lxml import etree
from pyro.Logger import Logger
class ElementHelper(Logger):
@staticmethod
def validate_schema(parent_element: etree.ElementBase, program_path: str) -> object:
namespace = [ns for ns in parent_element.nsmap.values()]
if namespace:
... | [
"os.path.exists",
"lxml.etree.XMLSchema",
"lxml.etree.parse",
"os.path.join"
] | [((343, 383), 'os.path.join', 'os.path.join', (['program_path', 'namespace[0]'], {}), '(program_path, namespace[0])\n', (355, 383), False, 'import os\n'), ((402, 429), 'os.path.exists', 'os.path.exists', (['schema_path'], {}), '(schema_path)\n', (416, 429), False, 'import os\n'), ((457, 481), 'lxml.etree.parse', 'etree... |
import os
os.system("clear")
print("\nassembling crt0...\n")
if(os.system("sdasz80 -o crt0_fap.s") != 0):
exit()
print("\ncompiling hellofap.c...\n")
# code-loc is where main() is, data-loc is where RAM starts
if os.system("sdcc -mz80 --code-loc 0x200 --data-loc 0xc000 --no-std-crt0 crt0_fap.rel hellofap.c") != 0:... | [
"os.system"
] | [((11, 29), 'os.system', 'os.system', (['"""clear"""'], {}), "('clear')\n", (20, 29), False, 'import os\n'), ((364, 397), 'os.system', 'os.system', (['"""hex2bin hellofap.ihx"""'], {}), "('hex2bin hellofap.ihx')\n", (373, 397), False, 'import os\n'), ((66, 100), 'os.system', 'os.system', (['"""sdasz80 -o crt0_fap.s"""'... |
import os
from .dataset_cls import DatalakeClientDataset
from .utils import _get_tenant, _get_stage, _get_default_api_url
def get_project_config():
return dict(
tenant=_get_tenant(),
stage=_get_stage(),
api_key=os.getenv("C360_API_KEY"),
api_url=os.getenv("C360_API_URL", _get_defau... | [
"os.getenv"
] | [((241, 266), 'os.getenv', 'os.getenv', (['"""C360_API_KEY"""'], {}), "('C360_API_KEY')\n", (250, 266), False, 'import os\n')] |
# Copyright (c) 2014 Shotgun Software Inc.
#
# CONFIDENTIAL AND PROPRIETARY
#
# This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit
# Source Code License included in this distribution package. See LICENSE.
# By accessing, using, copying or modifying this work you indicate your
# agreement to t... | [
"sgtk.TankError",
"sgtk.get_hook_baseclass"
] | [((508, 533), 'sgtk.get_hook_baseclass', 'sgtk.get_hook_baseclass', ([], {}), '()\n', (531, 533), False, 'import sgtk\n'), ((6265, 6325), 'sgtk.TankError', 'TankError', (['("Unknown video export preset \'%s\'!" % preset_name)'], {}), '("Unknown video export preset \'%s\'!" % preset_name)\n', (6274, 6325), False, 'from ... |
from rest_framework.routers import DefaultRouter
from wastd.users import api as users_api
from wastd.observations import api as observations_api
from conservation import api as conservation_api
from occurrence import api as occurrence_api
from taxonomy import api as taxonomy_api
router = DefaultRouter()
# meta: users,... | [
"rest_framework.routers.DefaultRouter"
] | [((290, 305), 'rest_framework.routers.DefaultRouter', 'DefaultRouter', ([], {}), '()\n', (303, 305), False, 'from rest_framework.routers import DefaultRouter\n')] |
# -*- coding: utf-8 -*-
import pandas as pd
import dash
import dash_html_components as html
import dash_core_components as dcc
import dash_table_experiments as dt
from dash.dependencies import Input, Output
from flask import Flask, send_from_directory
import os
from functions import *
json_filename = '2018.1_SA.json'
... | [
"dash_table_experiments.DataTable",
"dash_html_components.Button",
"dash.dependencies.Output",
"dash.dependencies.Input",
"dash_html_components.H2",
"dash_html_components.H1",
"pandas.DataFrame",
"dash_html_components.P",
"dash_html_components.Div"
] | [((434, 452), 'pandas.DataFrame', 'pd.DataFrame', (['[{}]'], {}), '([{}])\n', (446, 452), True, 'import pandas as pd\n'), ((4306, 4334), 'dash.dependencies.Output', 'Output', (['"""list-table"""', '"""rows"""'], {}), "('list-table', 'rows')\n", (4312, 4334), False, 'from dash.dependencies import Input, Output\n'), ((47... |
# Copyright 2020 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
"tfx.components.tuner.component.TunerFnResult",
"absl.logging.info",
"tensorflow.keras.layers.Dense",
"kerastuner.engine.hyperparameters.HyperParameters.from_config",
"kerastuner.HyperParameters.from_config",
"tensorflow.keras.layers.DenseFeatures",
"tensorflow.estimator.train_and_evaluate",
"tensorfl... | [((1672, 1700), 'kerastuner.HyperParameters', 'kerastuner.HyperParameters', ([], {}), '()\n', (1698, 1700), False, 'import kerastuner\n'), ((3220, 3332), 'nitroml.automl.autodata.trainer_adapters.keras_model_adapter.KerasModelAdapter', 'kma.KerasModelAdapter', ([], {'problem_statement': 'problem_statement', 'transform_... |
from setuptools import find_packages, setup
with open("README.md", "r") as f:
long_description = f.read()
setup(
name="eln",
version="0.0.0-beta.10",
author="<NAME>",
author_email="<EMAIL>",
url="https://github.com/lehvitus/eln",
description="A command-line tool for quick access to web se... | [
"setuptools.find_packages"
] | [((1599, 1614), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (1612, 1614), False, 'from setuptools import find_packages, setup\n')] |
"""
This is intended for starting the app with
gunicorn --certfile file.crt --keyfile file.key -b 0.0.0.0:443 app.gunicorn_app:app
This due to starting a production server with flask development server is not advised.
"""
import os
from app.main import create_app
try:
VERSION = os.environ['VERSION']
except:
... | [
"app.main.create_app"
] | [((345, 357), 'app.main.create_app', 'create_app', ([], {}), '()\n', (355, 357), False, 'from app.main import create_app\n')] |
import numpy as np
from forge.blade.action import action
from forge.blade.systems import skill, droptable
class Entity():
def __init__(self, pos):
self.pos = pos
self.alive = True
self.skills = skill.Skills()
self.entityIndex=0
self.health = -1
self.lastAttacker = None
def a... | [
"forge.blade.systems.skill.Skills"
] | [((217, 231), 'forge.blade.systems.skill.Skills', 'skill.Skills', ([], {}), '()\n', (229, 231), False, 'from forge.blade.systems import skill, droptable\n')] |
import numpy as np
from numba import njit, b1, i1, int64, float64
@njit(b1(i1[:, :], i1, i1))
def was_winning_move(board, row, col):
if col == -1:
return False
player = board[row, col]
player_pieces = board == player
win_len = 4
row_win = player_pieces[row, :]
for i in range(row_win.s... | [
"numba.b1",
"numpy.random.choice",
"numpy.where",
"numpy.diag",
"numpy.array",
"numpy.zeros",
"numba.float64",
"time.time"
] | [((423, 456), 'numpy.diag', 'np.diag', (['player_pieces', '(col - row)'], {}), '(player_pieces, col - row)\n', (430, 456), True, 'import numpy as np\n'), ((613, 659), 'numpy.diag', 'np.diag', (['player_pieces[:, ::-1]', '(new_col - row)'], {}), '(player_pieces[:, ::-1], new_col - row)\n', (620, 659), True, 'import nump... |
from flask import Flask,request
from predict import predict_on_text
import json
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello, World!"
@app.route("/predict/<msg>")
def predict_toxicity(msg):
return str(predict_on_text(msg))
| [
"predict.predict_on_text",
"flask.Flask"
] | [((87, 102), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (92, 102), False, 'from flask import Flask, request\n'), ((233, 253), 'predict.predict_on_text', 'predict_on_text', (['msg'], {}), '(msg)\n', (248, 253), False, 'from predict import predict_on_text\n')] |
"""
Sphinx Theme
~~~~~~~~~~~~
A sphinx theme with accessibility in mind.
:copyright: (c) 2021-present ooliver1
:license: MIT, see LICENSE for more details.
"""
# credit to tooty as I kinda took a decent chunk
from __future__ import annotations
__version__ = "0.0.0a"
__title__ = "tooty-theme"
__author__ = "<NAME> - ... | [
"logging.getLogger",
"sphinx.highlighting.PygmentsBridge",
"pathlib.Path",
"pygments.formatters.HtmlFormatter",
"os.path.join",
"os.path.abspath",
"functools.lru_cache"
] | [((995, 1022), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1012, 1022), False, 'import logging\n'), ((2025, 2048), 'functools.lru_cache', 'lru_cache', ([], {'maxsize': 'None'}), '(maxsize=None)\n', (2034, 2048), False, 'from functools import lru_cache\n'), ((953, 983), 'os.path.abspat... |
from typing import Tuple, Union
import numpy as np
from models import SVMModel
class predictor:
def __init__(self):
self.model = SVMModel()
self.model.load_model()
def predict(self, data_or_filename: Union[np.ndarray, str]) -> Tuple[str, float]:
if isinstance(data_or_filename, str):
... | [
"models.SVMModel"
] | [((144, 154), 'models.SVMModel', 'SVMModel', ([], {}), '()\n', (152, 154), False, 'from models import SVMModel\n')] |
import nltk
from nltk.stem import PorterStemmer, WordNetLemmatizer
import pandas as pd
def lemmatize_text(text):
w_tokenizer = nltk.tokenize.WhitespaceTokenizer()
lemmatizer = nltk.stem.WordNetLemmatizer()
lem_text = []
for w in w_tokenizer.tokenize(text):
lem_text.append(lemmatizer.lemmatize(w... | [
"nltk.tokenize.WhitespaceTokenizer",
"nltk.stem.WordNetLemmatizer",
"nltk.stem.PorterStemmer"
] | [((132, 167), 'nltk.tokenize.WhitespaceTokenizer', 'nltk.tokenize.WhitespaceTokenizer', ([], {}), '()\n', (165, 167), False, 'import nltk\n'), ((185, 214), 'nltk.stem.WordNetLemmatizer', 'nltk.stem.WordNetLemmatizer', ([], {}), '()\n', (212, 214), False, 'import nltk\n'), ((552, 567), 'nltk.stem.PorterStemmer', 'Porter... |
import time
import os
import sys
import requests
COLORS = {\
"black":"\u001b[30;1m",
"red": "\u001b[31;1m",
"green":"\u001b[32m",
"yellow":"\u001b[33;1m",
"blue":"\u001b[34;1m",
"magenta":"\u001b[35m",
"cyan": "\u001b[36m",
"white":"\u001b[37m",
"yellow-background":"\u001b[43m",
"black-background":"\u00... | [
"os.system",
"time.sleep",
"requests.get",
"sys.exit"
] | [((506, 539), 'os.system', 'os.system', (['"""pip install requests"""'], {}), "('pip install requests')\n", (515, 539), False, 'import os\n'), ((541, 559), 'os.system', 'os.system', (['"""clear"""'], {}), "('clear')\n", (550, 559), False, 'import os\n'), ((1093, 1111), 'os.system', 'os.system', (['"""clear"""'], {}), "... |
from .data_extraction_cpt import data_extraction_cpt
from .data_extraction_sitec import data_extraction_sitec
from multiprocessing import Pool
import dask
dataset_cpt = 'CPT'
dataset_sitec = 'SITEC'
def data_extraction_schedule(v_dask_data_extraction, raw_files, pool_size, dataset):
if dataset == dataset... | [
"dask.delayed",
"multiprocessing.Pool",
"dask.compute"
] | [((815, 844), 'dask.compute', 'dask.compute', (['delayed_results'], {}), '(delayed_results)\n', (827, 844), False, 'import dask\n'), ((551, 566), 'multiprocessing.Pool', 'Pool', (['pool_size'], {}), '(pool_size)\n', (555, 566), False, 'from multiprocessing import Pool\n'), ((763, 792), 'dask.delayed', 'dask.delayed', (... |
import asyncio
import aiohttp
import datetime
import argparse
import random
import uvloop
async def make_request(session, id, port):
try:
async with session.get('http://localhost:%s' % port) as resp:
if resp.status != 200:
print("Server error --%s-- returned for request %d" %... | [
"aiohttp.ClientSession",
"random.choice",
"argparse.ArgumentParser",
"uvloop.install",
"datetime.datetime.now",
"asyncio.gather",
"aiohttp.TCPConnector"
] | [((1209, 1234), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1232, 1234), False, 'import argparse\n'), ((1731, 1747), 'uvloop.install', 'uvloop.install', ([], {}), '()\n', (1745, 1747), False, 'import uvloop\n'), ((666, 703), 'aiohttp.TCPConnector', 'aiohttp.TCPConnector', ([], {'limit': 'po... |
# This file is part of fionautil.
# http://github.com/fitnr/fionautil
# Licensed under the GPLv3 license:
# http://http://opensource.org/licenses/GPL-3.0
# Copyright (c) 2015-6, <NAME> <<EMAIL>>
import itertools
from functools import reduce
import sys
import fiona
import fiona.transform
try:
from shapely.geometr... | [
"itertools.chain",
"fiona.transform.transform_geom",
"functools.reduce",
"shapely.geometry.mapping",
"fiona.FIELD_TYPES_MAP.items",
"fiona.open",
"shapely.geometry.shape",
"fiona.drivers"
] | [((2619, 2645), 'itertools.chain', 'itertools.chain', (['filenames'], {}), '(filenames)\n', (2634, 2645), False, 'import itertools\n'), ((519, 534), 'fiona.drivers', 'fiona.drivers', ([], {}), '()\n', (532, 534), False, 'import fiona\n'), ((732, 747), 'fiona.drivers', 'fiona.drivers', ([], {}), '()\n', (745, 747), Fals... |
import argparse
import matplotlib.pyplot as plt
import numpy as np
import torch
from sklearn.manifold import TSNE
from src.data.make_dataset import CorruptMnist
from src.models.model import MyAwesomeModel
def tsne_embedding_plot() -> None:
parser = argparse.ArgumentParser(description="Training arguments")
p... | [
"matplotlib.pyplot.savefig",
"numpy.unique",
"src.models.model.MyAwesomeModel",
"argparse.ArgumentParser",
"torch.load",
"sklearn.manifold.TSNE",
"torch.cat",
"torch.cuda.is_available",
"src.data.make_dataset.CorruptMnist",
"torch.utils.data.DataLoader",
"torch.no_grad",
"matplotlib.pyplot.leg... | [((257, 314), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Training arguments"""'}), "(description='Training arguments')\n", (280, 314), False, 'import argparse\n'), ((433, 508), 'src.data.make_dataset.CorruptMnist', 'CorruptMnist', ([], {'train': '(True)', 'in_folder': '"""data/raw"""... |
import torch
import torch.nn as nn
import torch.nn.functional as F
class Transformer(nn.Module):
def __init__(self, vocab_size: int, max_seq_len: int, embed_dim: int, hidden_dim: int, n_layer: int, n_head: int, ff_dim: int, embed_drop: float, hidden_drop: float):
super().__init__()
self.tok_embedd... | [
"torch.nn.TransformerEncoder",
"torch.nn.Dropout",
"torch.nn.LSTM",
"torch.nn.LayerNorm",
"torch.arange",
"torch.nn.MultiheadAttention",
"torch.nn.Linear",
"torch.nn.TransformerEncoderLayer",
"torch.nn.Conv1d",
"torch.nn.Embedding"
] | [((326, 361), 'torch.nn.Embedding', 'nn.Embedding', (['vocab_size', 'embed_dim'], {}), '(vocab_size, embed_dim)\n', (338, 361), True, 'import torch.nn as nn\n'), ((391, 427), 'torch.nn.Embedding', 'nn.Embedding', (['max_seq_len', 'embed_dim'], {}), '(max_seq_len, embed_dim)\n', (403, 427), True, 'import torch.nn as nn\... |
# Generated by Django 3.2.5 on 2021-12-02 07:56
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('threephase', '0001_initial'),
]
operations = [
migrations.RenameModel(
old_name='TwoPhaseParticipant',
new_name='ThreePhaseP... | [
"django.db.migrations.RenameModel"
] | [((219, 312), 'django.db.migrations.RenameModel', 'migrations.RenameModel', ([], {'old_name': '"""TwoPhaseParticipant"""', 'new_name': '"""ThreePhaseParticipant"""'}), "(old_name='TwoPhaseParticipant', new_name=\n 'ThreePhaseParticipant')\n", (241, 312), False, 'from django.db import migrations\n'), ((352, 428), 'dj... |
from flask import Flask, request, jsonify
from flask_restful import Resource, Api, reqparse
from flask_cors import CORS
from pathlib import Path
import pandas as pd
import os
import shutil
from pyzbar import pyzbar
import argparse
import cv2
import datetime
from PIL import Image
# import psycopg2
import mysql.connector... | [
"pyzbar.pyzbar.decode",
"requests.post",
"os.path.splitext",
"pathlib.Path"
] | [((599, 616), 'pathlib.Path', 'Path', (['SOURCE_PATH'], {}), '(SOURCE_PATH)\n', (603, 616), False, 'from pathlib import Path\n'), ((1145, 1165), 'pyzbar.pyzbar.decode', 'pyzbar.decode', (['image'], {}), '(image)\n', (1158, 1165), False, 'from pyzbar import pyzbar\n'), ((1717, 1792), 'requests.post', 'requests.post', ([... |
# Python Program to Measure the Elapsed Time in Python
import time
start = time.time()
print(23*2.3)
end = time.time()
print(end - start)
| [
"time.time"
] | [((77, 88), 'time.time', 'time.time', ([], {}), '()\n', (86, 88), False, 'import time\n'), ((111, 122), 'time.time', 'time.time', ([], {}), '()\n', (120, 122), False, 'import time\n')] |
from pathlib import Path
"""Class for setting the default path for the logs,
depending on the operating system"""
class Logs:
__path = Path('Data')
def get_path(self):
return self.__path
def set_path(self, new_path):
self.__path = Path(new_path)
custom_path = Logs()
| [
"pathlib.Path"
] | [((146, 158), 'pathlib.Path', 'Path', (['"""Data"""'], {}), "('Data')\n", (150, 158), False, 'from pathlib import Path\n'), ((268, 282), 'pathlib.Path', 'Path', (['new_path'], {}), '(new_path)\n', (272, 282), False, 'from pathlib import Path\n')] |
import numpy as np
import tensorflow as tf
from .sac import SAC, td_target
from softlearning.misc.utils import mixup
from softlearning.models.utils import flatten_input_structure
class SACClassifierMultiGoal(SAC):
def __init__(
self,
classifiers,
goal_example_pools,
goal_example_v... | [
"tensorflow.contrib.layers.optimize_loss",
"numpy.mean",
"tensorflow.equal",
"numpy.ones",
"softlearning.models.utils.flatten_input_structure",
"tensorflow.placeholder",
"numpy.std",
"numpy.max",
"tensorflow.where",
"numpy.random.randint",
"numpy.split",
"numpy.zeros",
"numpy.concatenate",
... | [((1715, 1773), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32'], {'shape': '(None, 1)', 'name': '"""labels"""'}), "(tf.float32, shape=(None, 1), name='labels')\n", (1729, 1773), True, 'import tensorflow as tf\n'), ((3061, 3188), 'softlearning.models.utils.flatten_input_structure', 'flatten_input_structure',... |
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output, State
from server import app
from datapy import subjects, semesters, schedUpdate
import csv
import sqlite3
layout = html.Div([
dcc.Location(id='main', refresh=True),
html.Div([
html.P([
'Generado... | [
"sqlite3.connect",
"dash_html_components.Button",
"dash.dependencies.Output",
"csv.writer",
"dash_core_components.Location",
"dash.dependencies.Input",
"dash_core_components.Dropdown",
"dash_html_components.P",
"dash_html_components.Div"
] | [((1312, 1338), 'sqlite3.connect', 'sqlite3.connect', (['"""data.db"""'], {}), "('data.db')\n", (1327, 1338), False, 'import sqlite3\n'), ((1208, 1242), 'dash.dependencies.Output', 'Output', (['"""output-state"""', '"""children"""'], {}), "('output-state', 'children')\n", (1214, 1242), False, 'from dash.dependencies im... |
"""Bulk delete test functions."""
from unittest import TestCase
from companion.api import deletebulk, util
from . import create_test_data, es_url
class TestDeleteByQuery(TestCase):
def setUp(self):
self.client = util.get_client(es_url)
def test_empty_arguments(self):
"""It should require u... | [
"companion.api.deletebulk.delete_by_query",
"companion.api.util.get_client"
] | [((229, 252), 'companion.api.util.get_client', 'util.get_client', (['es_url'], {}), '(es_url)\n', (244, 252), False, 'from companion.api import deletebulk, util\n'), ((544, 611), 'companion.api.deletebulk.delete_by_query', 'deletebulk.delete_by_query', (['es_url', '"""companiontest"""', '"""simple"""', 'None'], {}), "(... |
import pytest
from jason import token
def test_validate():
check = token.HasScopes("read:thing", "write:thing")
check.validate({"scp": ["read:thing", "write:thing"]})
def test_fails_to_validate():
check = token.HasScopes("read:thing", "write:thing")
with pytest.raises(token.BatchValidationError):
... | [
"pytest.raises",
"jason.token.HasScopes"
] | [((74, 118), 'jason.token.HasScopes', 'token.HasScopes', (['"""read:thing"""', '"""write:thing"""'], {}), "('read:thing', 'write:thing')\n", (89, 118), False, 'from jason import token\n'), ((222, 266), 'jason.token.HasScopes', 'token.HasScopes', (['"""read:thing"""', '"""write:thing"""'], {}), "('read:thing', 'write:th... |
import numpy as np
from prml.linear.classifier import Classifier
class Perceptron(Classifier):
"""
Perceptron model
"""
def fit(self, X, t, max_epoch=100):
"""
fit perceptron model on given input pair
Parameters
----------
X : (N, D) np.ndarray
tra... | [
"numpy.size",
"numpy.sign"
] | [((560, 573), 'numpy.size', 'np.size', (['X', '(1)'], {}), '(X, 1)\n', (567, 573), True, 'import numpy as np\n'), ((1171, 1190), 'numpy.sign', 'np.sign', (['(X @ self.w)'], {}), '(X @ self.w)\n', (1178, 1190), True, 'import numpy as np\n'), ((632, 651), 'numpy.sign', 'np.sign', (['(X @ self.w)'], {}), '(X @ self.w)\n',... |
import logging
import json
from functools import wraps, update_wrapper, partialmethod
import tornado.web
import tornado.httpclient
from tornado.platform.asyncio import to_asyncio_future
from rest_tools.client import RestClient
from rest_tools.server import Auth, RestHandlerSetup, authenticated, catch_error
from rest_... | [
"logging.getLogger",
"rest_tools.server.RestHandlerSetup",
"rest_tools.client.RestClient",
"functools.wraps"
] | [((397, 422), 'logging.getLogger', 'logging.getLogger', (['"""rest"""'], {}), "('rest')\n", (414, 422), False, 'import logging\n'), ((477, 501), 'rest_tools.server.RestHandlerSetup', 'RestHandlerSetup', (['config'], {}), '(config)\n', (493, 501), False, 'from rest_tools.server import Auth, RestHandlerSetup, authenticat... |
#!/usr/bin/env python
#
# Copyright 2011-2015 Splunk, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"): you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | [
"os.path.exists",
"os.listdir",
"unittest._TextTestResult.addError",
"os.makedirs",
"subprocess.check_call",
"setuptools.setup",
"os.path.join",
"os.getcwd",
"os.chdir",
"unittest._TextTestResult.addFailure",
"shutil.copyfile",
"coverage.coverage",
"sys.exit",
"xmlrunner.XMLTestRunner",
... | [((6434, 7334), 'setuptools.setup', 'setup', ([], {'author': '"""<NAME>."""', 'author_email': '"""<EMAIL>"""', 'cmdclass': "{'coverage': CoverageCommand, 'test': TestCommand, 'testjunit':\n JunitXmlTestCommand, 'dist': DistCommand}", 'description': '"""The Splunk Software Development Kit for Python."""', 'license': ... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-04-10 06:14
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('cms', '0018_pagenode'),
]
ope... | [
"django.db.models.OneToOneField",
"django.db.models.EmailField",
"django.db.models.TextField",
"django.db.models.AutoField",
"django.db.models.DateTimeField",
"django.db.models.CharField"
] | [((449, 660), 'django.db.models.OneToOneField', 'models.OneToOneField', ([], {'auto_created': '(True)', 'on_delete': 'django.db.models.deletion.CASCADE', 'parent_link': '(True)', 'primary_key': '(True)', 'related_name': '"""contact_me_plugin_contactme"""', 'serialize': '(False)', 'to': '"""cms.CMSPlugin"""'}), "(auto_c... |
# Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | [
"os.path.exists",
"mindinsight.datavisual.data_transform.loader_generators.data_loader_generator.DataLoaderGenerator",
"os.path.join",
"shutil.rmtree",
"tempfile.NamedTemporaryFile",
"datetime.datetime.now",
"os.removedirs",
"pytest.raises",
"os.mkdir",
"unittest.mock.patch.object"
] | [((2886, 2951), 'unittest.mock.patch.object', 'patch.object', (['data_loader_generator.DataLoader', '"""has_valid_files"""'], {}), "(data_loader_generator.DataLoader, 'has_valid_files')\n", (2898, 2951), False, 'from unittest.mock import patch\n'), ((2957, 3035), 'unittest.mock.patch.object', 'patch.object', (['data_lo... |
# Original code by:
# <NAME>: Mapping Your Music Collection
# http://www.christianpeccei.com/musicmap/
import numpy as np
import os
import struct
import wave
from shlex import split
from subprocess import call
from uuid import uuid4
class Analyzer:
FEATURES_LENGTH = 42
SECONDS_PER_SONG = 90
SAMPLING... | [
"wave.open",
"shlex.split",
"numpy.fft.fft",
"uuid.uuid4",
"numpy.array_split",
"numpy.array",
"numpy.zeros",
"struct.unpack",
"os.remove"
] | [((710, 729), 'numpy.fft.fft', 'np.fft.fft', (['wavdata'], {}), '(wavdata)\n', (720, 729), True, 'import numpy as np\n'), ((825, 846), 'numpy.array_split', 'np.array_split', (['f', '(10)'], {}), '(f, 10)\n', (839, 846), True, 'import numpy as np\n'), ((969, 983), 'numpy.array', 'np.array', (['data'], {}), '(data)\n', (... |
# coding: utf-8
"""
FRITZ!Box SmartHome Client
~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
from __future__ import print_function, division
import re
import time
import json
import socket
import click
from .fritz import FritzBox
@click.group()
@click.option('--host', default='169.254.1.1') # fritzbox "emergency" IP
@c... | [
"click.Choice",
"click.argument",
"socket.socket",
"re.compile",
"click.group",
"click.option",
"json.dumps",
"time.sleep",
"click.echo",
"time.time"
] | [((231, 244), 'click.group', 'click.group', ([], {}), '()\n', (242, 244), False, 'import click\n'), ((246, 291), 'click.option', 'click.option', (['"""--host"""'], {'default': '"""169.254.1.1"""'}), "('--host', default='169.254.1.1')\n", (258, 291), False, 'import click\n'), ((319, 366), 'click.option', 'click.option',... |
# coding=utf-8
from datetime import datetime
from mongoengine import Document, StringField, ListField,DateTimeField,\
EmbeddedDocumentField,IntField,LongField,EmbeddedDocument
from analytic.utils import UnixEpochDateTimeField
class Transaction(EmbeddedDocument):
method = StringField(max_length=20)
price =... | [
"analytic.utils.UnixEpochDateTimeField",
"mongoengine.EmbeddedDocumentField",
"mongoengine.StringField",
"mongoengine.LongField"
] | [((282, 308), 'mongoengine.StringField', 'StringField', ([], {'max_length': '(20)'}), '(max_length=20)\n', (293, 308), False, 'from mongoengine import Document, StringField, ListField, DateTimeField, EmbeddedDocumentField, IntField, LongField, EmbeddedDocument\n'), ((321, 346), 'mongoengine.LongField', 'LongField', ([]... |
from Functions import model_input_func
from Functions import read_func
from Functions import plot_pred_func
from Functions import model_input_func
"""
This example:
1. creates a multi-index DataFrame from the predictions of all of the compositional profiles for every model,
2. saves the DataFrame as a CSV file,
3. plo... | [
"Functions.read_func",
"Functions.model_input_func"
] | [((582, 611), 'Functions.model_input_func', 'model_input_func', (['folder_path'], {}), '(folder_path)\n', (598, 611), False, 'from Functions import model_input_func\n'), ((636, 683), 'Functions.read_func', 'read_func', (['folder_paths', 'folder_names', 'filename'], {}), '(folder_paths, folder_names, filename)\n', (645,... |
import DataJsonLoader
def test_get_config():
r = DataJsonLoader.get_blog_config_json()
print(r['title'])
| [
"DataJsonLoader.get_blog_config_json"
] | [((55, 92), 'DataJsonLoader.get_blog_config_json', 'DataJsonLoader.get_blog_config_json', ([], {}), '()\n', (90, 92), False, 'import DataJsonLoader\n')] |
import re
import numpy as np
from rdkit import Chem
from rdkit.Chem.rdchem import ChiralType
from EFGs import standize
pat = r'\d+(?:\.\d+)?%'
p2f = lambda x: float(x.strip('%'))/100
def mols_from_smiles_list(all_smiles):
'''Given a list of smiles strings, this function creates rdkit
molecules'''
mols =... | [
"numpy.abs",
"rdkit.Chem.MolFragmentToSmiles",
"numpy.average",
"rdkit.Chem.MolFromSmiles",
"re.sub",
"re.findall",
"EFGs.standize"
] | [((492, 522), 're.sub', 're.sub', (['"""\\\\[2H\\\\]"""', '"""[H]"""', 'smi'], {}), "('\\\\[2H\\\\]', '[H]', smi)\n", (498, 522), False, 'import re\n'), ((3664, 3798), 'rdkit.Chem.MolFragmentToSmiles', 'Chem.MolFragmentToSmiles', (['mol', 'ids_to_include'], {'isomericSmiles': '(True)', 'atomSymbols': 'symbols', 'allBon... |
import logging
from pathlib import Path
from StyleFrame import StyleFrame, Styler, utils
class DfExporter():
def export_dfs(self, results_df_list, report_type, report_name, report_path):
### export alerts and muts df to csv/xls
folder_path = Path.cwd() / report_path / report_name
# extract ... | [
"pathlib.Path.cwd",
"StyleFrame.StyleFrame.ExcelWriter",
"StyleFrame.StyleFrame",
"logging.info"
] | [((1336, 1399), 'logging.info', 'logging.info', (['"""WARNING: Nothing to export. Both dfs are empty."""'], {}), "('WARNING: Nothing to export. Both dfs are empty.')\n", (1348, 1399), False, 'import logging\n'), ((1467, 1512), 'logging.info', 'logging.info', (['"""WARNING: Invalid report type."""'], {}), "('WARNING: In... |
__author__ = '<NAME>'
import time
import sys
from asip_client import AsipClient
from threading import Thread
try:
from Queue import Queue
except ImportError:
from queue import Queue
from asip_writer import AsipWriter
import paho.mqtt.client as mqtt
class SimpleMQTTBoard:
# ************ BEGIN CONSTANTS... | [
"threading.Thread.__init__",
"paho.mqtt.client.Client",
"time.sleep",
"queue.Queue",
"sys.stdout.write"
] | [((614, 623), 'queue.Queue', 'Queue', (['(10)'], {}), '(10)\n', (619, 623), False, 'from queue import Queue\n'), ((1255, 1282), 'paho.mqtt.client.Client', 'mqtt.Client', (['self._ClientID'], {}), '(self._ClientID)\n', (1266, 1282), True, 'import paho.mqtt.client as mqtt\n'), ((2906, 2954), 'sys.stdout.write', 'sys.stdo... |
from celery_tasks.main import app
# 1.任务 发短信
@app.task
def ccp_send_sms_code(mobile, sms_code):
from libs.yuntongxun.sms import CCP
result = CCP().send_template_sms(mobile, [sms_code, 5], 1)
print('当前的短信验证码:', sms_code)
return result
# 2. 添加装饰器 app
| [
"libs.yuntongxun.sms.CCP"
] | [((151, 156), 'libs.yuntongxun.sms.CCP', 'CCP', ([], {}), '()\n', (154, 156), False, 'from libs.yuntongxun.sms import CCP\n')] |
from troposphere import Ref, FindInMap, Output, GetAZs, Select
import troposphere.ec2 as ec2
from . import ha_nat
import netaddr
from toolz import groupby, assoc
from environmentbase.template import Template
class BaseNetwork(Template):
DEFAULT_CONFIG = {
"network": {
"network_cidr_base": "10... | [
"troposphere.ec2.SecurityGroupRule",
"troposphere.ec2.Tag",
"troposphere.GetAZs",
"troposphere.Ref",
"troposphere.ec2.InternetGateway",
"toolz.assoc",
"troposphere.Output",
"troposphere.ec2.VPCGatewayAttachment",
"troposphere.FindInMap",
"troposphere.ec2.RouteTable",
"netaddr.IPNetwork"
] | [((6100, 6148), 'troposphere.FindInMap', 'FindInMap', (['"""networkAddresses"""', '"""vpcBase"""', '"""cidr"""'], {}), "('networkAddresses', 'vpcBase', 'cidr')\n", (6109, 6148), False, 'from troposphere import Ref, FindInMap, Output, GetAZs, Select\n'), ((11564, 11592), 'netaddr.IPNetwork', 'netaddr.IPNetwork', (['base... |
import re
try:
import cStringIO
StringIO = cStringIO
except ImportError:
import StringIO
__version__ = "0.1.1"
def _get_trace_and_errortype(tracestack):
error = tracestack[-1].strip()
return ("\n".join(tracestack), error)
def grep(txt):
ret = []
tracestack, in_trace = [], False
fo... | [
"StringIO.StringIO",
"re.match"
] | [((330, 352), 'StringIO.StringIO', 'StringIO.StringIO', (['txt'], {}), '(txt)\n', (347, 352), False, 'import StringIO\n'), ((533, 561), 're.match', 're.match', (['"""( {2})+\\\\w"""', 'line'], {}), "('( {2})+\\\\w', line)\n", (541, 561), False, 'import re\n')] |
from panda3d.core import *
from CCDIK.IKChain import IKChain
from CCDIK.Utils import *
from WalkCycle import WalkCycle
from CCDIK.ArmatureUtils import ArmatureUtils
class Biped():
def __init__( self ):
##################################
# Set up main body:
self.torsoHeight = 1.6
... | [
"CCDIK.ArmatureUtils.ArmatureUtils",
"direct.showbase.ShowBase.ShowBase.__init__",
"CCDIK.CameraControl.CameraControl",
"WalkCycle.WalkCycle"
] | [((1011, 1026), 'CCDIK.ArmatureUtils.ArmatureUtils', 'ArmatureUtils', ([], {}), '()\n', (1024, 1026), False, 'from CCDIK.ArmatureUtils import ArmatureUtils\n'), ((5545, 5563), 'WalkCycle.WalkCycle', 'WalkCycle', (['(2)', '(0.75)'], {}), '(2, 0.75)\n', (5554, 5563), False, 'from WalkCycle import WalkCycle\n'), ((10235, ... |
#!/bin/python3
# Important: requires manually classified idns, called
import csv
clusters = dict()
with open('../data/manually-classified-idns-20170501.csv') as f:
rows = csv.reader(f, strict=True)
for row in rows:
if row[6].startswith('Third Party'):
k = row[4] + row[5]
if k ... | [
"csv.reader"
] | [((178, 204), 'csv.reader', 'csv.reader', (['f'], {'strict': '(True)'}), '(f, strict=True)\n', (188, 204), False, 'import csv\n')] |
import json
from copy import deepcopy
import random
from datetime import datetime
from stat_util import Stat
random.seed(datetime.now())
filename = "voca.json"
with open(filename, "r") as f:
data = json.load(f)
# Save the original one, since we will delete keys.
dict = deepcopy(data)
words = list(dict.keys())
# N... | [
"random.uniform",
"stat_util.Stat",
"datetime.datetime.now",
"copy.deepcopy",
"json.load"
] | [((275, 289), 'copy.deepcopy', 'deepcopy', (['data'], {}), '(data)\n', (283, 289), False, 'from copy import deepcopy\n'), ((490, 496), 'stat_util.Stat', 'Stat', ([], {}), '()\n', (494, 496), False, 'from stat_util import Stat\n'), ((122, 136), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (134, 136), False... |
# -*- coding: utf-8 -*-
## 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... | [
"documents.Doclist"
] | [((4999, 5018), 'documents.Doclist', 'documents.Doclist', ([], {}), '()\n', (5016, 5018), False, 'import documents\n')] |
#!/usr/bin/env python
import pickle
import tensorflow as tf
import numpy as np
import tf_util
import gym
import load_policy
from tensorflow import keras
def main():
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('behavioral_cloning_file', type=str)
parser.add_argument('envname'... | [
"numpy.mean",
"argparse.ArgumentParser",
"tensorflow.keras.models.load_model",
"numpy.std",
"gym.make"
] | [((200, 225), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (223, 225), False, 'import argparse\n'), ((655, 708), 'tensorflow.keras.models.load_model', 'keras.models.load_model', (['args.behavioral_cloning_file'], {}), '(args.behavioral_cloning_file)\n', (678, 708), False, 'from tensorflow imp... |
import sys
assert sys.version_info[0] == 2
import rosbag
import numpy as np
from rospy_message_converter import message_converter
bag = rosbag.Bag('out.bag')
nb_event = 0
x_fin = []
y_fin = []
ts_fin = []
p_fin = []
for topic, msg, t in bag.read_messages(topics=['/cam0/events']):
msg_str = message_converter.conver... | [
"rospy_message_converter.message_converter.convert_ros_message_to_dictionary",
"numpy.concatenate",
"numpy.save",
"rosbag.Bag"
] | [((137, 158), 'rosbag.Bag', 'rosbag.Bag', (['"""out.bag"""'], {}), "('out.bag')\n", (147, 158), False, 'import rosbag\n'), ((1014, 1037), 'numpy.save', 'np.save', (['"""x.npy"""', 'x_fin'], {}), "('x.npy', x_fin)\n", (1021, 1037), True, 'import numpy as np\n'), ((1038, 1061), 'numpy.save', 'np.save', (['"""y.npy"""', '... |
"""Tests for the /sessions/.../commands routes."""
import pytest
from datetime import datetime
from decoy import Decoy
from opentrons.protocol_engine import (
CommandStatus,
EngineStatus,
commands as pe_commands,
errors as pe_errors,
)
from robot_server.errors import ApiError
from robot_server.servic... | [
"datetime.datetime",
"robot_server.service.json_api.RequestModel",
"opentrons.protocol_engine.errors.CommandDoesNotExistError",
"robot_server.sessions.router.commands_router.get_session_command",
"opentrons.protocol_engine.commands.PauseData",
"robot_server.sessions.session_models.SessionCommandSummary",
... | [((1605, 1704), 'robot_server.sessions.session_models.SessionCommandSummary', 'SessionCommandSummary', ([], {'id': '"""command-id"""', 'commandType': '"""moveToWell"""', 'status': 'CommandStatus.RUNNING'}), "(id='command-id', commandType='moveToWell', status=\n CommandStatus.RUNNING)\n", (1626, 1704), False, 'from r... |
#
# Roli Tweet printer
# Written by <NAME>, www.r00li.com
#
import praw
import datetime
from Singleton import *
from TextTools import *
import PrinterManager
import MiniLogger
import SettingsManager
class RedditPrinter(Singleton):
def __init__(self):
self.clientId = None
self.clientSecret = No... | [
"SettingsManager.SettingsManager",
"praw.Reddit",
"PrinterManager.PrinterManager",
"MiniLogger.MiniLogger"
] | [((627, 660), 'SettingsManager.SettingsManager', 'SettingsManager.SettingsManager', ([], {}), '()\n', (658, 660), False, 'import SettingsManager\n'), ((704, 737), 'SettingsManager.SettingsManager', 'SettingsManager.SettingsManager', ([], {}), '()\n', (735, 737), False, 'import SettingsManager\n'), ((785, 818), 'Setting... |
import os
import glob
import pathlib
import shutil
from pprint import pprint
from termcolor import colored, cprint
from colorama import init
class Sorter:
def __init__(self):
init()
self.path = ''
self.header = """ ______ __ __
/ ____/___ / /___/ /__ _____
/ /_ ... | [
"os.path.exists",
"pathlib.Path",
"os.path.join",
"os.mkdir",
"termcolor.cprint",
"pprint.pprint",
"colorama.init"
] | [((190, 196), 'colorama.init', 'init', ([], {}), '()\n', (194, 196), False, 'from colorama import init\n'), ((1503, 1532), 'os.path.join', 'os.path.join', (['self.path', 'name'], {}), '(self.path, name)\n', (1515, 1532), False, 'import os\n'), ((2847, 2871), 'pprint.pprint', 'pprint', (['self.moved_files'], {}), '(self... |
import numpy as np
import math
import sys, copy
sys.path.insert(0,'../Robots')
import robot_toy_example as robot_moel
import uvs as uvss
import time
robot = robot_moel.toy_blocks_robot()
estimate_jacobian_random_motion_range = [2, 5]
step_normalize_range = [2, 3]
uvs = uvss.UVS(robot, 0.5, 0.1, 2, step_normalize_rang... | [
"numpy.asarray",
"sys.path.insert",
"uvs.UVS",
"robot_toy_example.toy_blocks_robot"
] | [((48, 79), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""../Robots"""'], {}), "(0, '../Robots')\n", (63, 79), False, 'import sys, copy\n'), ((159, 188), 'robot_toy_example.toy_blocks_robot', 'robot_moel.toy_blocks_robot', ([], {}), '()\n', (186, 188), True, 'import robot_toy_example as robot_moel\n'), ((272, 365)... |
from flask import Flask, render_template, request, session, redirect, flash
from markupsafe import escape
from surveys import satisfaction_survey
from flask_debugtoolbar import DebugToolbarExtension
app = Flask(__name__, static_url_path='/static')
app.config['SECRET_KEY'] = "secrete key!"
app.config['DEBUG_TB_INTERCE... | [
"flask.render_template",
"flask.session.get",
"flask.flash",
"flask.Flask",
"flask.redirect"
] | [((207, 249), 'flask.Flask', 'Flask', (['__name__'], {'static_url_path': '"""/static"""'}), "(__name__, static_url_path='/static')\n", (212, 249), False, 'from flask import Flask, render_template, request, session, redirect, flash\n'), ((702, 773), 'flask.render_template', 'render_template', (['"""satisfaction_survey.h... |
#!/usr/bin/python
import os
os.system("cgx -b pre.fbd")
os.system("ccx nodal")
os.system("ccx element")
os.system("cgx -b post-n.fbd")
os.system("cgx -b post-e.fbd")
| [
"os.system"
] | [((29, 56), 'os.system', 'os.system', (['"""cgx -b pre.fbd"""'], {}), "('cgx -b pre.fbd')\n", (38, 56), False, 'import os\n'), ((57, 79), 'os.system', 'os.system', (['"""ccx nodal"""'], {}), "('ccx nodal')\n", (66, 79), False, 'import os\n'), ((80, 104), 'os.system', 'os.system', (['"""ccx element"""'], {}), "('ccx ele... |
# Copyright (c) 2020.
import firebase_admin
from firebase_admin import db
import datetime
import json
# firebase = firebase.FirebaseApplication("https://traffic-dt.firebaseio.com/",None)
cred = firebase_admin.credentials.Certificate("movies-d342f-e5d62f5dcb69.json")
firebase = firebase_admin.initialize_... | [
"firebase_admin.db.reference",
"firebase_admin.initialize_app",
"datetime.datetime.strptime",
"json.dumps",
"datetime.datetime.now",
"firebase_admin.credentials.Certificate"
] | [((209, 281), 'firebase_admin.credentials.Certificate', 'firebase_admin.credentials.Certificate', (['"""movies-d342f-e5d62f5dcb69.json"""'], {}), "('movies-d342f-e5d62f5dcb69.json')\n", (247, 281), False, 'import firebase_admin\n'), ((294, 390), 'firebase_admin.initialize_app', 'firebase_admin.initialize_app', (['cred'... |