code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
from flask import json, jsonify
from datetime import datetime
LOGFAILS = "chats.txt"
def lasi(adresats):
chata_rindas = []
with open(LOGFAILS, "r", encoding="utf-8") as f:
for rinda in f:
r = json.loads(rinda)
if "adresats" in r:
if r["adresats"] == adresats or ... | [
"flask.json.dumps",
"flask.jsonify",
"datetime.datetime.now",
"flask.json.loads"
] | [((426, 458), 'flask.jsonify', 'jsonify', (["{'chats': chata_rindas}"], {}), "({'chats': chata_rindas})\n", (433, 458), False, 'from flask import json, jsonify\n'), ((640, 654), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (652, 654), False, 'from datetime import datetime\n'), ((222, 239), 'flask.json.loa... |
import sys
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import (QApplication, QMainWindow, QCheckBox, QVBoxLayout,
QLineEdit, QPushButton, QWidget, QHBoxLayout)
class SuperCheckbox(QHBoxLayout):
def __init__(self, parent=None):
super(SuperCheckbox, self).__init__(parent... | [
"PyQt5.QtGui.QIcon",
"PyQt5.QtWidgets.QLineEdit",
"PyQt5.QtWidgets.QPushButton",
"PyQt5.QtWidgets.QCheckBox",
"PyQt5.QtWidgets.QVBoxLayout",
"PyQt5.QtWidgets.QApplication"
] | [((1690, 1706), 'PyQt5.QtWidgets.QApplication', 'QApplication', (['[]'], {}), '([])\n', (1702, 1706), False, 'from PyQt5.QtWidgets import QApplication, QMainWindow, QCheckBox, QVBoxLayout, QLineEdit, QPushButton, QWidget, QHBoxLayout\n'), ((347, 358), 'PyQt5.QtWidgets.QCheckBox', 'QCheckBox', ([], {}), '()\n', (356, 35... |
"""
Burp utility module for Python Burp extensions. Author: <NAME>
License: MIT
# Usage
1. Add it as a Python Burp module and use `from burputils import BurpUtils`.
For more info see:
https://parsiya.net/blog/2018-12-19-python-utility-modules-for-burp-extensions/
2. Copy the... | [
"headers.Headers",
"sys.stdout.write",
"subprocess.Popen"
] | [((3942, 3951), 'headers.Headers', 'Headers', ([], {}), '()\n', (3949, 3951), False, 'from headers import Headers\n'), ((5729, 5766), 'subprocess.Popen', 'Popen', (['args'], {'stdout': 'PIPE', 'stderr': 'PIPE'}), '(args, stdout=PIPE, stderr=PIPE)\n', (5734, 5766), False, 'from subprocess import Popen, PIPE\n'), ((5905,... |
"""Utilities for querying the Windows registry.
@see: Cake Build System (http://sourceforge.net/projects/cake-build)
@copyright: Copyright (c) 2010 <NAME>, <NAME>.
@license: Licensed under the MIT license.
"""
import _winreg as winreg # Do this so Python 2to3 conversion works.
import sys
import cake.system
_shownWow... | [
"_winreg.QueryValueEx",
"_winreg.CloseKey",
"_winreg.OpenKey"
] | [((1348, 1383), '_winreg.OpenKey', 'winreg.OpenKey', (['key', 'subKey', '(0)', 'sam'], {}), '(key, subKey, 0, sam)\n', (1362, 1383), True, 'import _winreg as winreg\n'), ((1478, 1504), '_winreg.CloseKey', 'winreg.CloseKey', (['keyHandle'], {}), '(keyHandle)\n', (1493, 1504), True, 'import _winreg as winreg\n'), ((1414,... |
import random
lives = 5 #this is a starting live
words = ['antelope', 'planet', 'science', 'measurement',
'africa', 'space', 'systems', 'continental']
secret_word = random.choice(words)
clue = list('?????')
heart_symbol = u'\u2764'
print(heart_symbol * 5)
guessed_word_correctly = False
def... | [
"random.choice"
] | [((180, 200), 'random.choice', 'random.choice', (['words'], {}), '(words)\n', (193, 200), False, 'import random\n')] |
import numpy as np
import mpnum as mp
import tmps
from tmps.utils import state_reduction_as_ndarray, convert, broadcast_number_ground_state, get_thermal_state
import time
from scipy.special import factorial
import math
def get_spin_initial_state(theta, mpa_type='mps'):
"""
Returns the initial state for the... | [
"scipy.special.factorial",
"numpy.abs",
"numpy.log",
"tmps.utils.state_reduction_as_ndarray",
"mpnum.chain",
"tmps.utils.convert.to_mparray",
"time.perf_counter",
"time.clock",
"numpy.max",
"tmps.chain.thermal.from_hamiltonian",
"numpy.sin",
"numpy.arange",
"numpy.cos",
"numpy.exp",
"tmp... | [((551, 597), 'tmps.utils.convert.to_mparray', 'convert.to_mparray', (['(ground + excited)', 'mpa_type'], {}), '(ground + excited, mpa_type)\n', (569, 597), False, 'from tmps.utils import state_reduction_as_ndarray, convert, broadcast_number_ground_state, get_thermal_state\n'), ((905, 968), 'tmps.utils.broadcast_number... |
# Generated by Django 3.0.4 on 2020-04-13 21:48
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('profiles', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='profile',
name='active',
f... | [
"django.db.models.BooleanField"
] | [((325, 390), 'django.db.models.BooleanField', 'models.BooleanField', ([], {'default': '(True)', 'verbose_name': '"""Activo/Inactivo"""'}), "(default=True, verbose_name='Activo/Inactivo')\n", (344, 390), False, 'from django.db import migrations, models\n')] |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import math
import os
from dataclasses import dataclass, field
from typing import List, Tuple
import numpy as np
import torch
import torch.nn... | [
"torch.nn.Dropout",
"fairseq.modules.SamePad",
"torch.nn.GLU",
"torch.nn.functional.dropout",
"torch.cat",
"fairseq.modules.Fp32GroupNorm",
"torch.nn.init.constant_",
"torch.arange",
"torch.nn.utils.weight_norm",
"torch.nn.functional.normalize",
"torch.no_grad",
"os.path.join",
"torch.flatte... | [((963, 1000), 'fairseq.dataclass.ChoiceEnum', 'ChoiceEnum', (["['default', 'layer_norm']"], {}), "(['default', 'layer_norm'])\n", (973, 1000), False, 'from fairseq.dataclass import ChoiceEnum, FairseqDataclass\n'), ((1032, 1086), 'fairseq.dataclass.ChoiceEnum', 'ChoiceEnum', (["['static', 'uniform', 'normal', 'poisson... |
from keras.models import Sequential
from keras.models import Model
from keras.layers import Cropping2D, Conv2D, MaxPool2D, Flatten, Dense, Dropout, ELU, BatchNormalization, Lambda
from keras.layers import concatenate
import numpy as np
import tensorflow as tf
def to_yuv(img, in_cspace='RGB'):
img_float = tf.cast(... | [
"tensorflow.image.rgb_to_yuv",
"tensorflow.image.bgr_to_yuv",
"keras.layers.Cropping2D",
"keras.layers.Dropout",
"numpy.asarray",
"keras.layers.MaxPool2D",
"keras.layers.Flatten",
"keras.models.Model",
"keras.layers.ELU",
"tensorflow.cast",
"keras.layers.Dense",
"keras.layers.Lambda",
"keras... | [((2546, 2582), 'keras.models.Model', 'Model', ([], {'inputs': 'img', 'outputs': 'out_steer'}), '(inputs=img, outputs=out_steer)\n', (2551, 2582), False, 'from keras.models import Model\n'), ((312, 342), 'tensorflow.cast', 'tf.cast', (['img'], {'dtype': 'tf.float32'}), '(img, dtype=tf.float32)\n', (319, 342), True, 'im... |
import os
import pickle
import cv2
import numpy as np
import streamlit as st
import tensorflow as tf
import grpc
from tensorflow_serving.apis import (
prediction_service_pb2_grpc,
predict_pb2
)
from consts import (
TRAIN_FD,
TRAIN_PKL_FP,
TRAIN_LABEL_FP
)
@st.cache
def load_prec_embs():
with... | [
"os.path.join",
"tensorflow_serving.apis.predict_pb2.PredictRequest",
"numpy.std",
"os.walk",
"numpy.expand_dims",
"tensorflow_serving.apis.prediction_service_pb2_grpc.PredictionServiceStub",
"pickle.load",
"numpy.mean",
"tensorflow.contrib.util.make_ndarray",
"tensorflow.contrib.util.make_tensor_... | [((679, 692), 'os.walk', 'os.walk', (['root'], {}), '(root)\n', (686, 692), False, 'import os\n'), ((373, 387), 'pickle.load', 'pickle.load', (['f'], {}), '(f)\n', (384, 387), False, 'import pickle\n'), ((454, 468), 'pickle.load', 'pickle.load', (['f'], {}), '(f)\n', (465, 468), False, 'import pickle\n'), ((1261, 1324)... |
"""
This module contains EveryAction objects, such as :class:`.Person` or :class:`.CanvassResponse`, which represent
structured EveryAction data directly corresponding to objects in the
`EveryAction 8 VAN API docs <https://developers.everyaction.com/van-api>`__.
"""
from datetime import datetime
from typing import Any... | [
"everyaction.core.EAProperty",
"everyaction.exception.EAException",
"everyaction.core.EAProperty.shared"
] | [((40152, 40170), 'everyaction.core.EAProperty', 'EAProperty', (['"""type"""'], {}), "('type')\n", (40162, 40170), False, 'from everyaction.core import EAObject, EAObjectWithID, EAObjectWithIDAndName, EAObjectWithName, EAProperty, EAValue\n'), ((60390, 60425), 'everyaction.core.EAProperty', 'EAProperty', (['"""creator"... |
# Based on intern/cycles/blender/blender_camera.cpp
from mathutils import Matrix
class BlenderCamera:
def __init__(self, b_render):
self.nearclip = 1e-5
self.type = 'CAMERA_PERSPECTIVE'
self.ortho_scale = 1.0
self.lens = 50.0
self.aperturesize = 0.0
... | [
"mathutils.Matrix"
] | [((1133, 1141), 'mathutils.Matrix', 'Matrix', ([], {}), '()\n', (1139, 1141), False, 'from mathutils import Matrix\n')] |
from unittest.mock import create_autospec
from jgikbase.idmapping.storage.id_mapping_storage import IDMappingStorage
from jgikbase.idmapping.core.user_lookup import LocalUserLookup, UserLookupSet, UserLookup
from jgikbase.idmapping.core.user import AuthsourceID, User, Username
from jgikbase.idmapping.core.tokens import... | [
"jgikbase.idmapping.core.user_lookup.LocalUserLookup",
"unittest.mock.create_autospec",
"jgikbase.test.idmapping.core.tokens_test.is_base64",
"jgikbase.test.idmapping.test_utils.assert_exception_correct",
"jgikbase.idmapping.core.tokens.HashedToken",
"jgikbase.idmapping.core.errors.NoSuchAuthsourceError",... | [((620, 677), 'unittest.mock.create_autospec', 'create_autospec', (['UserLookup'], {'spec_set': '(True)', 'instance': '(True)'}), '(UserLookup, spec_set=True, instance=True)\n', (635, 677), False, 'from unittest.mock import create_autospec\n'), ((935, 980), 'jgikbase.test.idmapping.test_utils.assert_exception_correct',... |
"""Map of short links to the full urls."""
from google.cloud import firestore
from google.cloud.firestore import Increment
LINKS_COLLECTION_NAME = u'links'
TOTAL_VISITS_COLLECTION_NAME = u'total_visits'
URL_KEY = u'url'
VISIT_COUNT_KEY = u'visit_count'
COUNT_KEY = u'count'
class Links:
def __init__(self):
... | [
"google.cloud.firestore.Client",
"google.cloud.firestore.Increment"
] | [((332, 350), 'google.cloud.firestore.Client', 'firestore.Client', ([], {}), '()\n', (348, 350), False, 'from google.cloud import firestore\n'), ((1184, 1196), 'google.cloud.firestore.Increment', 'Increment', (['(1)'], {}), '(1)\n', (1193, 1196), False, 'from google.cloud.firestore import Increment\n'), ((1454, 1466), ... |
import os
import sys
curr_path = os.path.abspath(__file__)
root_path = os.path.abspath(
os.path.join(curr_path, os.path.pardir, os.path.pardir))
sys.path.append(root_path)
from pyjuque.Exchanges.CcxtExchange import CcxtExchange
from pyjuque.Plotting import PlotData
import plotly.graph_objs as go
def horizontal_lin... | [
"sys.path.append",
"os.path.abspath",
"os.path.join",
"pyjuque.Exchanges.CcxtExchange.CcxtExchange"
] | [((33, 58), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (48, 58), False, 'import os\n'), ((149, 175), 'sys.path.append', 'sys.path.append', (['root_path'], {}), '(root_path)\n', (164, 175), False, 'import sys\n'), ((92, 147), 'os.path.join', 'os.path.join', (['curr_path', 'os.path.pardir',... |
# -*- coding: utf-8 -*-
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | [
"proto.RepeatedField",
"proto.MapField",
"proto.module",
"proto.Field"
] | [((700, 878), 'proto.module', 'proto.module', ([], {'package': '"""google.cloud.aiplatform.v1beta1"""', 'manifest': "{'ModelMonitoringObjectiveConfig', 'ModelMonitoringAlertConfig',\n 'ThresholdConfig', 'SamplingStrategy'}"}), "(package='google.cloud.aiplatform.v1beta1', manifest={\n 'ModelMonitoringObjectiveConf... |
import json as js
import logging
from .baseoutput import baseoutput
log = logging.getLogger("MPP-Solar")
class json(baseoutput):
def __str__(self):
return "json - outputs the results to standard out in json format"
def __init__(self, *args, **kwargs) -> None:
log.debug(f"processor.json __in... | [
"logging.getLogger",
"json.dumps"
] | [((76, 106), 'logging.getLogger', 'logging.getLogger', (['"""MPP-Solar"""'], {}), "('MPP-Solar')\n", (93, 106), False, 'import logging\n'), ((849, 865), 'json.dumps', 'js.dumps', (['output'], {}), '(output)\n', (857, 865), True, 'import json as js\n')] |
import urllib.request
import os
class ImageHandler:
def __init__(self, dir_prefix):
self.poster_dir_path = "./poster/" + dir_prefix + "/"
self.poster_url = "http://image.tmdb.org/t/p/w185"
def download_all_posters(self, df):
directory = os.path.dirname(self.poster_dir_path)
... | [
"os.path.dirname",
"os.path.exists",
"os.makedirs"
] | [((273, 310), 'os.path.dirname', 'os.path.dirname', (['self.poster_dir_path'], {}), '(self.poster_dir_path)\n', (288, 310), False, 'import os\n'), ((327, 352), 'os.path.exists', 'os.path.exists', (['directory'], {}), '(directory)\n', (341, 352), False, 'import os\n'), ((366, 388), 'os.makedirs', 'os.makedirs', (['direc... |
# -*- coding: utf-8 -*-
# file: train_utils.py
# author: songyouwei <<EMAIL>>
# Copyright (C) 2018. All Rights Reserved.
from data_utils import ABSADatesetReader
import torch
import torch.nn as nn
from torch.utils.data import DataLoader
from tensorboardX import SummaryWriter
device = torch.device('cuda' if torch.cuda... | [
"torch.utils.data.DataLoader",
"torch.argmax",
"data_utils.ABSADatesetReader",
"torch.nn.CrossEntropyLoss",
"torch.optim.Adam",
"torch.cuda.is_available",
"torch.no_grad"
] | [((310, 335), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (333, 335), False, 'import torch\n'), ((507, 592), 'data_utils.ABSADatesetReader', 'ABSADatesetReader', ([], {'dataset': 'dataset', 'embed_dim': 'embed_dim', 'max_seq_len': 'max_seq_len'}), '(dataset=dataset, embed_dim=embed_dim, max_... |
import secrets
def max_pow_2(n):
i = 0
while n % (2 ** i) != 0:
i += 1
return i
# def miller_rabin_p(n, r, d):
def miller_rabin(k, n):
if k == 1:
return False
elif k in (2, 3):
return True
elif k % 2 == 0:
return False
else:
r = max_pow_2(n)
... | [
"secrets.randbelow"
] | [((387, 411), 'secrets.randbelow', 'secrets.randbelow', (['(n - 3)'], {}), '(n - 3)\n', (404, 411), False, 'import secrets\n')] |
"""!
@brief Cluster analysis algorithm: ROCK
@details Implementation based on paper @cite inproceedings::rock::1.
@authors <NAME> (<EMAIL>)
@date 2014-2020
@copyright BSD-3-Clause
"""
from pyclustering.cluster.encoder import type_encoding
from pyclustering.utils import euclidean_distance
from pyc... | [
"pyclustering.core.rock_wrapper.rock",
"pyclustering.core.wrapper.ccore_library.workable",
"pyclustering.utils.euclidean_distance"
] | [((2536, 2560), 'pyclustering.core.wrapper.ccore_library.workable', 'ccore_library.workable', ([], {}), '()\n', (2558, 2560), False, 'from pyclustering.core.wrapper import ccore_library\n'), ((3402, 3494), 'pyclustering.core.rock_wrapper.rock', 'wrapper.rock', (['self.__pointer_data', 'self.__eps', 'self.__number_clust... |
import itertools
from language.heuristic.hardcore_annotated_expression import eT, apply_fun_to_nested, eL, eD, ltd_ify, Argu
from language.heuristic.littletools.generator_tools import count_up
from language.heuristic.pairix import Pairix
from language.heuristic.littletools.nested_list_tools import flatten_reduce, coll... | [
"language.heuristic.hardcore_annotated_expression.ltd_ify",
"language.heuristic.similaritymixer.SimilarityMixer.multi_paral_tup_sim",
"language.heuristic.hardcore_annotated_expression.apply_fun_to_nested",
"language.heuristic.littletools.generator_tools.count_up",
"itertools.permutations",
"helpers.time_t... | [((450, 479), 'logging.captureWarnings', 'logging.captureWarnings', (['(True)'], {}), '(True)\n', (473, 479), False, 'import logging\n'), ((7826, 7836), 'language.heuristic.littletools.generator_tools.count_up', 'count_up', ([], {}), '()\n', (7834, 7836), False, 'from language.heuristic.littletools.generator_tools impo... |
# -*- coding=utf-8 -*-
import random
def randomResult(inputFilePath, outputFilePath):
fr = open(inputFilePath, 'rb')
fw = open(outputFilePath, 'w')
userList = []
for line in fr.readlines():
list = line.split('\t')
userList.append(list[0])
# print len(userList)
# for i in user... | [
"random.randint"
] | [((406, 426), 'random.randint', 'random.randint', (['(0)', '(6)'], {}), '(0, 6)\n', (420, 426), False, 'import random\n'), ((444, 464), 'random.randint', 'random.randint', (['(0)', '(2)'], {}), '(0, 2)\n', (458, 464), False, 'import random\n'), ((485, 505), 'random.randint', 'random.randint', (['(0)', '(6)'], {}), '(0,... |
import subprocess
from typing import Union
class Jtalk:
def __init__(self,
dict_dir,
voice_file,
output_file='/dev/null',
trace_file='/dev/null',
sampling='auto',
frame_period='auto',
all_pass='a... | [
"subprocess.Popen"
] | [((5652, 5700), 'subprocess.Popen', 'subprocess.Popen', (['command'], {'stdin': 'subprocess.PIPE'}), '(command, stdin=subprocess.PIPE)\n', (5668, 5700), False, 'import subprocess\n'), ((7193, 7241), 'subprocess.Popen', 'subprocess.Popen', (['command'], {'stdin': 'subprocess.PIPE'}), '(command, stdin=subprocess.PIPE)\n'... |
from flask import Flask, render_template, redirect, url_for, flash
from forms import addContactForm
import db_utils
# initialize the Flask app
app = Flask(__name__)
# Note: This is a demo application hence secret is hardcoded for simplicity.
# For all practical purposes, take the key from OS environment variables or ... | [
"flask.flash",
"db_utils.delete_contact",
"forms.addContactForm",
"db_utils.add_contact",
"flask.Flask",
"flask.url_for",
"flask.render_template",
"db_utils.get_contacts"
] | [((150, 165), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (155, 165), False, 'from flask import Flask, render_template, redirect, url_for, flash\n'), ((489, 512), 'db_utils.get_contacts', 'db_utils.get_contacts', ([], {}), '()\n', (510, 512), False, 'import db_utils\n'), ((643, 699), 'flask.render_templ... |
from models import Notebook, TextNote, VideoNote
bio = Notebook("Bio 201 Notes")
bio.notes.append(TextNote("This is the first day of Bio 201"))
bio.notes.append(TextNote("Final exam is 95%."))
bio.notes.append(VideoNote("https://www.youtube.com/watch?v=PKffm2uI4dk"))
bio.display()
bio.save("bio201.txt")
bio.load("bi... | [
"models.VideoNote",
"models.Notebook",
"models.TextNote"
] | [((56, 81), 'models.Notebook', 'Notebook', (['"""Bio 201 Notes"""'], {}), "('Bio 201 Notes')\n", (64, 81), False, 'from models import Notebook, TextNote, VideoNote\n'), ((100, 144), 'models.TextNote', 'TextNote', (['"""This is the first day of Bio 201"""'], {}), "('This is the first day of Bio 201')\n", (108, 144), Fal... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import csv
from math import sqrt
import numpy as np
import yaml
from scipy.interpolate import interp1d
class PlanetVariables:
def __init__(self, name):
self.name = name
self._getDataFromFile()
def _getDataFromFile(self):
with open("plan... | [
"scipy.interpolate.interp1d",
"yaml.load",
"csv.reader",
"math.sqrt"
] | [((1094, 1121), 'scipy.interpolate.interp1d', 'interp1d', (['thetas', 'sinValues'], {}), '(thetas, sinValues)\n', (1102, 1121), False, 'from scipy.interpolate import interp1d\n'), ((1165, 1192), 'scipy.interpolate.interp1d', 'interp1d', (['sinValues', 'thetas'], {}), '(sinValues, thetas)\n', (1173, 1192), False, 'from ... |
"""
Start a Parameterized Build
"""
from __future__ import print_function
from jenkinsapi.jenkins import Jenkins
jenkins = Jenkins('http://localhost:8080')
params = {'VERSION': '1.2.3', 'PYTHON_VER': '2.7'}
# This will start the job in non-blocking manner
jenkins.build_job('foo', params)
# This will start the job... | [
"jenkinsapi.jenkins.Jenkins"
] | [((125, 157), 'jenkinsapi.jenkins.Jenkins', 'Jenkins', (['"""http://localhost:8080"""'], {}), "('http://localhost:8080')\n", (132, 157), False, 'from jenkinsapi.jenkins import Jenkins\n')] |
"""change_schedules_repeat_cycle_column
Revision ID: 73340f5f1adf
Revises: acf23daeb12b
Create Date: 2020-08-23 12:09:49.948494
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "73340f5f1adf"
down_revision = "<KEY>"
branch_labels = None
depends_on = None
def up... | [
"sqlalchemy.String",
"alembic.op.drop_column",
"sqlalchemy.Column"
] | [((333, 376), 'alembic.op.drop_column', 'op.drop_column', (['"""schedules"""', '"""repeat_cycle"""'], {}), "('schedules', 'repeat_cycle')\n", (347, 376), False, 'from alembic import op\n'), ((485, 528), 'alembic.op.drop_column', 'op.drop_column', (['"""schedules"""', '"""repeat_cycle"""'], {}), "('schedules', 'repeat_c... |
from openprocurement.tender.openua.procedure.models.document import (
PostDocument as BasePostDocument,
PatchDocument as BasePatchDocument,
Document as BaseDocument,
)
from schematics.types import StringType
class PostDocument(BasePostDocument):
language = StringType(required=True, choices=["uk", "en"... | [
"schematics.types.StringType"
] | [((275, 342), 'schematics.types.StringType', 'StringType', ([], {'required': '(True)', 'choices': "['uk', 'en', 'ru']", 'default': '"""uk"""'}), "(required=True, choices=['uk', 'en', 'ru'], default='uk')\n", (285, 342), False, 'from schematics.types import StringType\n')] |
import pygame
class Player(pygame.sprite.Sprite):
def __init__(self, *groups):
super().__init__(*groups)
self.image = pygame.image.load("img/baixo1.png")
self.image = pygame.transform.scale(self.image, [45, 45])
self.rect = pygame.Rect(540, 360, 45, 45)
self.spee... | [
"pygame.image.load",
"pygame.transform.scale",
"pygame.Rect",
"pygame.key.get_pressed"
] | [((146, 181), 'pygame.image.load', 'pygame.image.load', (['"""img/baixo1.png"""'], {}), "('img/baixo1.png')\n", (163, 181), False, 'import pygame\n'), ((204, 248), 'pygame.transform.scale', 'pygame.transform.scale', (['self.image', '[45, 45]'], {}), '(self.image, [45, 45])\n', (226, 248), False, 'import pygame\n'), ((2... |
from pkg_resources import parse_version
def process_version(identifier, data):
# parse version to test against:
data["version_raw"] = data["version"]
try:
version = parse_version(data["version"])
except TypeError:
return
try:
parts = version.base_version.split(".")
... | [
"pkg_resources.parse_version"
] | [((187, 217), 'pkg_resources.parse_version', 'parse_version', (["data['version']"], {}), "(data['version'])\n", (200, 217), False, 'from pkg_resources import parse_version\n')] |
#IN THE NAME OF ALLAH
#Nike Name: Pcrlth0n
#(C) 2008
#a simple way to create and change your registry on windows
import win32api
def new_key():
reg1 = open('C:\\reg1.reg', 'w')
reg1.write("""REGEDIT4\n[HKEY_CURRENT_USER\\Example""")
reg1.close()
win32api.WinExec('reg import C:\\reg1.reg', 0)
def new_s... | [
"win32api.WinExec"
] | [((264, 310), 'win32api.WinExec', 'win32api.WinExec', (['"""reg import C:\\\\reg1.reg"""', '(0)'], {}), "('reg import C:\\\\reg1.reg', 0)\n", (280, 310), False, 'import win32api\n'), ((476, 522), 'win32api.WinExec', 'win32api.WinExec', (['"""reg import C:\\\\reg2.reg"""', '(0)'], {}), "('reg import C:\\\\reg2.reg', 0)\... |
# Copyright (c) 2015 SONATA-NFV, UBIWHERE
# ALL RIGHTS RESERVED.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | [
"son.workspace.workspace.Project",
"son.package.package.Packager",
"son.workspace.workspace.Workspace"
] | [((1775, 1788), 'son.workspace.workspace.Workspace', 'Workspace', (['""""""'], {}), "('')\n", (1784, 1788), False, 'from son.workspace.workspace import Workspace\n'), ((1803, 1819), 'son.workspace.workspace.Project', 'Project', (['ws', '"""/"""'], {}), "(ws, '/')\n", (1810, 1819), False, 'from son.workspace.workspace i... |
#!/usr/bin/env python3
import subprocess as sp
def system_update():
sp.call(["sudo", "apt-get","update"])
sp.call(["sudo", "apt", "upgrade", "-y"])
def install_apache_php():
sp.call(["sudo", "apt", "install", "-y", "apache2", "libapache2-mod-php", "php-cli", "php-mbstring", "php-sqlite3", "php-opcache",... | [
"subprocess.call"
] | [((75, 113), 'subprocess.call', 'sp.call', (["['sudo', 'apt-get', 'update']"], {}), "(['sudo', 'apt-get', 'update'])\n", (82, 113), True, 'import subprocess as sp\n'), ((116, 157), 'subprocess.call', 'sp.call', (["['sudo', 'apt', 'upgrade', '-y']"], {}), "(['sudo', 'apt', 'upgrade', '-y'])\n", (123, 157), True, 'import... |
from sqlalchemy import select
from ..core import Base
thesaurusDictTraduction = {}
invertedThesaurusDict = {'en': {}, 'fr': {}}
userOAuthDict = {}
def loadThesaurusTrad(config):
session = config.registry.dbmaker()
thesTable = Base.metadata.tables['ERDThesaurusTerm']
query = select(thesTable.c)
res... | [
"sqlalchemy.select"
] | [((292, 311), 'sqlalchemy.select', 'select', (['thesTable.c'], {}), '(thesTable.c)\n', (298, 311), False, 'from sqlalchemy import select\n')] |
# @Author ZhangGJ
# @Date 2021/01/13 21:59
from plotly import offline
from plotly.graph_objs import Bar, Layout
from die import Die
die = Die()
# 掷几次骰子并将结果存储在一个列表中
results = []
for roll_num in range(1000):
result = die.roll()
results.append(result)
# 分析结果
frequencies = []
for value in range(1, die.num_sides ... | [
"plotly.graph_objs.Layout",
"plotly.graph_objs.Bar",
"die.Die",
"plotly.offline.plot"
] | [((139, 144), 'die.Die', 'Die', ([], {}), '()\n', (142, 144), False, 'from die import Die\n'), ((574, 646), 'plotly.graph_objs.Layout', 'Layout', ([], {'title': '"""掷一个D6 1000次的结果"""', 'xaxis': 'x_axis_config', 'yaxis': 'y_axis_config'}), "(title='掷一个D6 1000次的结果', xaxis=x_axis_config, yaxis=y_axis_config)\n", (580, 646... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import sys
import logging
from opencorpora import reader
from opencorpora.reader import CorpusReader
from russian_tagsets import converters
from pymorphy2.opencorpora_dict.parse import parse_opencorpora_xml
class UDConverter(object):
"""
Tries to ... | [
"opencorpora.reader.CorpusReader",
"opencorpora.reader.iter_documents",
"pymorphy2.opencorpora_dict.parse.parse_opencorpora_xml",
"russian_tagsets.converters.converter"
] | [((2107, 2132), 'opencorpora.reader.CorpusReader', 'CorpusReader', (['sys.argv[1]'], {}), '(sys.argv[1])\n', (2119, 2132), False, 'from opencorpora.reader import CorpusReader\n'), ((702, 743), 'opencorpora.reader.iter_documents', 'reader.iter_documents', (['docids', 'categories'], {}), '(docids, categories)\n', (723, 7... |
import numpy as np
from PIL import Image
import matplotlib.pyplot as plt
# Open the image
img = np.array(Image.open('house.jpg')).astype(np.uint8)
# Apply gray scale
gray_img = np.round(0.299 * img[:, :, 0] +
0.587 * img[:, :, 1] +
0.114 * img[:, :, 2]).astype(np.uint... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"matplotlib.pyplot.imshow",
"numpy.zeros",
"PIL.Image.open",
"matplotlib.pyplot.figure",
"numpy.array",
"matplotlib.pyplot.imsave",
"numpy.round"
] | [((400, 446), 'numpy.array', 'np.array', (['[[-1, 0, 1], [-1, 0, 1], [-1, 0, 1]]'], {}), '([[-1, 0, 1], [-1, 0, 1], [-1, 0, 1]])\n', (408, 446), True, 'import numpy as np\n'), ((465, 511), 'numpy.array', 'np.array', (['[[-1, -1, -1], [0, 0, 0], [1, 1, 1]]'], {}), '([[-1, -1, -1], [0, 0, 0], [1, 1, 1]])\n', (473, 511), ... |
##
# File: ChemCompSearchWrapper.py
# Author: jdw
# Date: 9-Mar-2020
# Version: 0.001
#
# Updates:
#
##
"""
Wrapper for chemical component search operations.
"""
__docformat__ = "restructuredtext en"
__author__ = "<NAME>"
__email__ = "<EMAIL>"
__license__ = "Apache 2.0"
import copy
import logging
import platfo... | [
"resource.getrusage",
"rcsb.utils.io.SftpUtil.SftpUtil",
"os.path.join",
"rcsb.utils.chem.ChemCompIndexProvider.ChemCompIndexProvider",
"os.path.dirname",
"time.localtime",
"copy.deepcopy",
"rcsb.utils.chem.OeSearchUtils.OeSearchUtils",
"rcsb.utils.chem.OeSearchMoleculeProvider.OeSearchMoleculeProvi... | [((1192, 1219), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1209, 1219), False, 'import logging\n'), ((1236, 1367), 'collections.namedtuple', 'namedtuple', (['"""MatchResults"""', '"""ccId oeMol searchType matchOpts screenType fpType fpScore oeIdx formula"""'], {'defaults': '((None,) ... |
import logging
from copy import deepcopy
from contextlib import contextmanager
from algoliasearch.http.verb import Verb
from algoliasearch.search_client import SearchClient
from algoliasearch.exceptions import AlgoliaException
from pyramid.exceptions import ConfigurationError
logger = logging.getLogger(__name__)
c... | [
"algoliasearch.search_client.SearchClient.create",
"copy.deepcopy",
"pyramid.exceptions.ConfigurationError",
"logging.getLogger"
] | [((289, 316), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (306, 316), False, 'import logging\n'), ((429, 473), 'algoliasearch.search_client.SearchClient.create', 'SearchClient.create', (['application_id', 'api_key'], {}), '(application_id, api_key)\n', (448, 473), False, 'from algolias... |
# Generated by Django 3.1.4 on 2021-07-13 07:22
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('stationery', '0004_auto_20210710_0307'),
]
operations = [
migrations.DeleteModel(
name='Document',
),
migrations... | [
"django.db.models.CharField",
"django.db.models.PositiveIntegerField",
"django.db.migrations.DeleteModel"
] | [((238, 277), 'django.db.migrations.DeleteModel', 'migrations.DeleteModel', ([], {'name': '"""Document"""'}), "(name='Document')\n", (260, 277), False, 'from django.db import migrations, models\n'), ((417, 472), 'django.db.models.CharField', 'models.CharField', ([], {'default': '"""self taking"""', 'max_length': '(255)... |
import json
import logging
import mock
from django.test import TestCase, override_settings
from grpc._cython.cygrpc import _Metadatum
from django_socio_grpc.services import Service
from django_socio_grpc.settings import grpc_settings
from .utils import FakeContext
logger = logging.getLogger()
class FakeAuthentica... | [
"mock.patch",
"json.dumps",
"grpc._cython.cygrpc._Metadatum",
"mock.MagicMock",
"django.test.override_settings",
"logging.getLogger"
] | [((278, 297), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (295, 297), False, 'import logging\n'), ((2471, 2575), 'mock.patch', 'mock.patch', (['"""django_socio_grpc.servicer_proxy.ServicerProxy.create_service"""'], {'new': 'fake_create_service'}), "('django_socio_grpc.servicer_proxy.ServicerProxy.create... |
#!/usr/bin/env python3
"""Fusearch daemon"""
import argparse
import os
import signal
import sys
import logging
import textract
import functools
import progressbar
import tempfile
import pickle
import io
from fusearch.index import Index
from fusearch.model import Document
from fusearch.tokenizer import get_tokenizer, ... | [
"fusearch.util.filename_without_extension",
"pickle.dump",
"progressbar.Counter",
"argparse.ArgumentParser",
"fusearch.util.mtime",
"fusearch.tokenizer.get_tokenizer",
"fusearch.util.file_generator_ext",
"progressbar.ETA",
"os.path.isfile",
"fusearch.config.Config.from_file",
"multiprocessing.Qu... | [((606, 653), 'progressbar.Timer', 'progressbar.Timer', ([], {'format': '"""Elapsed %(elapsed)s"""'}), "(format='Elapsed %(elapsed)s')\n", (623, 653), False, 'import progressbar\n'), ((669, 697), 'progressbar.SimpleProgress', 'progressbar.SimpleProgress', ([], {}), '()\n', (695, 697), False, 'import progressbar\n'), ((... |
#!/usr/bin/env python
import rospy
from pyproj import Proj, transform
import numpy as np
from math import cos, sin, pi
from geometry_msgs.msg import Pose
from std_msgs.msg import Float64
from sensor_msgs.msg import NavSatFix
from ublox_msgs.msg import NavPVT
#Projection definition
#UTM-K
proj_UTMK = Proj(init='epsg:51... | [
"rospy.Subscriber",
"rospy.Publisher",
"rospy.Rate",
"std_msgs.msg.Float64",
"rospy.is_shutdown",
"pyproj.Proj",
"rospy.init_node",
"geometry_msgs.msg.Pose",
"pyproj.transform"
] | [((302, 324), 'pyproj.Proj', 'Proj', ([], {'init': '"""epsg:5178"""'}), "(init='epsg:5178')\n", (306, 324), False, 'from pyproj import Proj, transform\n'), ((347, 369), 'pyproj.Proj', 'Proj', ([], {'init': '"""epsg:4326"""'}), "(init='epsg:4326')\n", (351, 369), False, 'from pyproj import Proj, transform\n'), ((1336, 1... |
# Test ability of OWSLib.wfs to interact with USDA SSURGO WFS 1.0.0 web service
# Contact e-mail: <EMAIL>
import unittest
from owslib.wfs import WebFeatureService
class USDASSURGOWFSTestCase(unittest.TestCase):
def runTest(self):
minX = -76.766960
minY = 39.283611
maxX = -76.684120
... | [
"owslib.wfs.WebFeatureService"
] | [((551, 663), 'owslib.wfs.WebFeatureService', 'WebFeatureService', (['"""http://SDMDataAccess.nrcs.usda.gov/Spatial/SDMWGS84Geographic.wfs"""'], {'version': '"""1.0.0"""'}), "(\n 'http://SDMDataAccess.nrcs.usda.gov/Spatial/SDMWGS84Geographic.wfs',\n version='1.0.0')\n", (568, 663), False, 'from owslib.wfs import ... |
import inspect
from itertools import islice
import pytest
import isle.show
from isle import Show
def test_get_latest():
show = isle.show.get_latest()
assert isinstance(show, Show)
def test_get_popular():
shows = isle.show.get_popular()
assert inspect.isgenerator(shows)
show = next(shows)
a... | [
"inspect.isgenerator"
] | [((265, 291), 'inspect.isgenerator', 'inspect.isgenerator', (['shows'], {}), '(shows)\n', (284, 291), False, 'import inspect\n'), ((426, 452), 'inspect.isgenerator', 'inspect.isgenerator', (['shows'], {}), '(shows)\n', (445, 452), False, 'import inspect\n'), ((593, 619), 'inspect.isgenerator', 'inspect.isgenerator', ([... |
import numpy
from discrete_fuzzy_operators.base.operators.binary_operators.fuzzy_discrete_binary_operator import \
FuzzyDiscreteBinaryOperator
from discrete_fuzzy_operators.builtin_operators.discrete.tnorms import TnormExamples
if __name__ == "__main__":
# EXAMPLE: Plot of some known t-norms.
lukasiewicz... | [
"discrete_fuzzy_operators.builtin_operators.discrete.tnorms.TnormExamples.get_tnorm"
] | [((332, 393), 'discrete_fuzzy_operators.builtin_operators.discrete.tnorms.TnormExamples.get_tnorm', 'TnormExamples.get_tnorm', ([], {'tnorm': 'TnormExamples.LUKASIEWICZ', 'n': '(7)'}), '(tnorm=TnormExamples.LUKASIEWICZ, n=7)\n', (355, 393), False, 'from discrete_fuzzy_operators.builtin_operators.discrete.tnorms import ... |
__license__ = 'MIT License <http://www.opensource.org/licenses/mit-license.php>'
__author__ = '<NAME> <<EMAIL>>'
__docformat__ = 'epytext'
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.contrib.admin.views.decorators import staff_member_required
from django.contr... | [
"publications.utils.import_bibtex",
"django.contrib.admin.views.decorators.staff_member_required",
"django.contrib.messages.add_message",
"publications.models.Type.objects.all",
"django.http.HttpResponseRedirect",
"django.db.transaction.atomic",
"django.template.RequestContext"
] | [((1897, 1933), 'django.contrib.admin.views.decorators.staff_member_required', 'staff_member_required', (['import_bibtex'], {}), '(import_bibtex)\n', (1918, 1933), False, 'from django.contrib.admin.views.decorators import staff_member_required\n'), ((1472, 1514), 'django.contrib.messages.add_message', 'messages.add_mes... |
# Copyright 2019 NetApp, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | [
"manila.db.api.availability_zone_get",
"manila.db.api.share_snapshot_get",
"manila.context.get_admin_context",
"manila.share.utils.extract_host"
] | [((1414, 1441), 'manila.context.get_admin_context', 'context.get_admin_context', ([], {}), '()\n', (1439, 1441), False, 'from manila import context\n'), ((1924, 1967), 'manila.db.api.share_snapshot_get', 'db_api.share_snapshot_get', (['ctx', 'snapshot_id'], {}), '(ctx, snapshot_id)\n', (1949, 1967), True, 'from manila.... |
#!/usr/bin/env python
# (c) 2020 <NAME>
# 2-clause BSD license
from setuptools import setup
from nattka import __version__
setup(
name='nattka',
version=__version__,
description='A New Arch Tester Toolkit (open source replacement '
'for stable-bot)',
author='<NAME>',
author_emai... | [
"setuptools.setup"
] | [((127, 825), 'setuptools.setup', 'setup', ([], {'name': '"""nattka"""', 'version': '__version__', 'description': '"""A New Arch Tester Toolkit (open source replacement for stable-bot)"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'license': '"""BSD"""', 'url': '"""http://github.com/mgorny/nattka"""',... |
"""
SAVGOL INTERP.
--------------
"""
import argparse
from pathlib import Path
import matplotlib
import numpy as np
from embers.rf_tools.align_data import savgol_interp
from embers.rf_tools.colormaps import spectral
from matplotlib import pyplot as plt
matplotlib.use("Agg")
_spec, _ = spectral()
parser = argparse.A... | [
"argparse.ArgumentParser",
"matplotlib.pyplot.plot",
"numpy.median",
"matplotlib.pyplot.scatter",
"embers.rf_tools.colormaps.spectral",
"matplotlib.pyplot.legend",
"embers.rf_tools.align_data.savgol_interp",
"pathlib.Path",
"matplotlib.use",
"matplotlib.pyplot.style.use",
"matplotlib.pyplot.rcPa... | [((256, 277), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (270, 277), False, 'import matplotlib\n'), ((289, 299), 'embers.rf_tools.colormaps.spectral', 'spectral', ([], {}), '()\n', (297, 299), False, 'from embers.rf_tools.colormaps import spectral\n'), ((310, 407), 'argparse.ArgumentParser', ... |
"""
Provides authorization functions for Mojang's login and session servers
"""
import hashlib
import json
# This is for python2 compatibility
try:
import urllib.request as request
from urllib.error import URLError
except ImportError:
import urllib2 as request
from urllib2 import URLError
import loggin... | [
"urllib2.urlopen",
"urllib2.Request",
"spockbot.mcp.yggdrasil.YggdrasilCore",
"json.dumps",
"spockbot.plugins.base.pl_announce",
"os.urandom",
"logging.getLogger"
] | [((450, 479), 'logging.getLogger', 'logging.getLogger', (['"""spockbot"""'], {}), "('spockbot')\n", (467, 479), False, 'import logging\n'), ((3756, 3775), 'spockbot.plugins.base.pl_announce', 'pl_announce', (['"""Auth"""'], {}), "('Auth')\n", (3767, 3775), False, 'from spockbot.plugins.base import PluginBase, pl_announ... |
# Generated by Django 4.0.1 on 2022-03-15 04:15
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('exam', '0004_remove_exam_name_exam_exam_name_alter_exam_cls_and_more'),
]
operations = [
migrations.AlterField(
model_name='mark... | [
"django.db.models.IntegerField"
] | [((371, 489), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'blank': '(True)', 'help_text': '"""Maximum marks in the subject"""', 'null': '(True)', 'verbose_name': '"""Maximum Marks"""'}), "(blank=True, help_text='Maximum marks in the subject',\n null=True, verbose_name='Maximum Marks')\n", (390, 489... |
"""
Copyright (C) 2015, <NAME>
Contributed by <NAME> (<EMAIL>)
This file is part of BSD license
<https://opensource.org/licenses/BSD-3-Clause>
"""
import unittest
import logging
import time
from mops.xlwtwrapper import XlwtWrapper
"""
測試 excel 寫入
"""
class XlwtWrapperTest(unittest.TestCase):
#準備
def setUp(s... | [
"unittest.main",
"logging.info",
"mops.xlwtwrapper.XlwtWrapper",
"logging.basicConfig"
] | [((777, 802), 'unittest.main', 'unittest.main', ([], {'exit': '(False)'}), '(exit=False)\n', (790, 802), False, 'import unittest\n'), ((334, 373), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (353, 373), False, 'import logging\n'), ((498, 545), 'logging.info',... |
# Sa se scrie o functie cu numele problema1 ce returneaza o lista ordonata crescator ce contine toate cuvintele
# din sirul de caractere s dat ca parametru. Un cuvant este format din: litere mici si mari, cifre si
# caracterul underscore '_'.
import re
import os
import urllib
from urllib import request
import hashlib
... | [
"hashlib.md5",
"zipfile.ZipFile",
"os.path.basename",
"socket.socket",
"urllib.request.urlopen",
"hashlib.sha256",
"os.path.isfile",
"re.findall",
"os.path.join",
"os.listdir"
] | [((408, 435), 're.findall', 're.findall', (['word_pattern', 's'], {}), '(word_pattern, s)\n', (418, 435), False, 'import re\n'), ((809, 836), 'urllib.request.urlopen', 'urllib.request.urlopen', (['url'], {}), '(url)\n', (831, 836), False, 'import urllib\n'), ((1862, 1878), 'os.listdir', 'os.listdir', (['path'], {}), '(... |
from django.shortcuts import get_object_or_404
from rest_framework import status
from rest_framework.response import Response
from rest_framework.views import APIView
from v1.filters.albums.album import album_filter
from v1.music.models.album import Album
from v1.music.serializers.album import AlbumSerializer, AlbumSer... | [
"v1.music.serializers.album.AlbumSerializerUpdate",
"v1.filters.albums.album.album_filter",
"v1.music.serializers.album.AlbumSerializerCreate",
"v1.music.serializers.album.AlbumSerializer",
"django.shortcuts.get_object_or_404",
"v1.music.serializers.album.AlbumSerializerFull",
"rest_framework.response.R... | [((518, 537), 'v1.music.models.album.Album.objects.all', 'Album.objects.all', ([], {}), '()\n', (535, 537), False, 'from v1.music.models.album import Album\n'), ((555, 584), 'v1.filters.albums.album.album_filter', 'album_filter', (['request', 'albums'], {}), '(request, albums)\n', (567, 584), False, 'from v1.filters.al... |
from typing import Callable, TypeVar
from matroids.core.set_operator import powset
from matroids.construct import independent_sets
T = TypeVar('T')
def from_independent_matroid(matroid: tuple[set[T], list[set[T]]]) -> Callable[[set[T]], int]:
"""Construct a nulity function from a matroid defined by independen... | [
"matroids.construct.independent_sets.from_bases_matroid",
"matroids.construct.independent_sets.from_spanning_matroid",
"matroids.construct.independent_sets.from_hyperplanes_matroid",
"matroids.construct.independent_sets.from_flats_matroid",
"matroids.core.set_operator.powset",
"matroids.construct.independ... | [((140, 152), 'typing.TypeVar', 'TypeVar', (['"""T"""'], {}), "('T')\n", (147, 152), False, 'from typing import Callable, TypeVar\n'), ((1083, 1131), 'matroids.construct.independent_sets.from_dependent_matroid', 'independent_sets.from_dependent_matroid', (['matroid'], {}), '(matroid)\n', (1122, 1131), False, 'from matr... |
# -*- coding: utf-8 -*-
from odoo.addons.account.tests.common import AccountTestInvoicingCommon
from odoo.tests import tagged, Form
import time
@tagged('post_install', '-at_install')
class TestTransferWizard(AccountTestInvoicingCommon):
@classmethod
def setUpClass(cls, chart_template_ref=None):
super(... | [
"odoo.tests.tagged",
"time.strftime"
] | [((146, 183), 'odoo.tests.tagged', 'tagged', (['"""post_install"""', '"""-at_install"""'], {}), "('post_install', '-at_install')\n", (152, 183), False, 'from odoo.tests import tagged, Form\n'), ((1483, 1502), 'time.strftime', 'time.strftime', (['"""%Y"""'], {}), "('%Y')\n", (1496, 1502), False, 'import time\n'), ((1720... |
from world import World
from player import Player
import mc_objects as mco
class Game:
def __init__(self) -> None:
self.world = World(20, 20)
self.player = Player(self.world)
print("Game started.")
def play(self):
stone_block = mco.Block(mco.Blocks.Stone)
pick = mco... | [
"mc_objects.Block",
"mc_objects.Tool",
"player.Player",
"world.World"
] | [((144, 157), 'world.World', 'World', (['(20)', '(20)'], {}), '(20, 20)\n', (149, 157), False, 'from world import World\n'), ((180, 198), 'player.Player', 'Player', (['self.world'], {}), '(self.world)\n', (186, 198), False, 'from player import Player\n'), ((274, 301), 'mc_objects.Block', 'mco.Block', (['mco.Blocks.Ston... |
import numpy as np
from config import GOPARAMETERS
def stone_features(board_state):
# 16 planes, where every other plane represents the stones of a particular color
# which means we track the stones of the last 8 moves.
features = np.zeros([16, GOPARAMETERS.N, GOPARAMETERS.N], dtype=np.uint8)
num_del... | [
"numpy.zeros",
"numpy.ones",
"numpy.cumsum",
"numpy.tile",
"numpy.rollaxis",
"numpy.concatenate"
] | [((245, 307), 'numpy.zeros', 'np.zeros', (['[16, GOPARAMETERS.N, GOPARAMETERS.N]'], {'dtype': 'np.uint8'}), '([16, GOPARAMETERS.N, GOPARAMETERS.N], dtype=np.uint8)\n', (253, 307), True, 'import numpy as np\n'), ((390, 433), 'numpy.cumsum', 'np.cumsum', (['board_state.board_deltas'], {'axis': '(0)'}), '(board_state.boar... |
import sys
import struct
import asyncio
import threading
import functools
from concurrent.futures import Future
from .. import pb
__all__ = ['DebugProxy', 'DebugCommand', 'AgentController']
class DebugProxy(threading.Thread):
"""
Debugging class, creating a connection between RobotControl and the Nao (naoth... | [
"functools.partial",
"asyncio.get_event_loop",
"asyncio.sleep",
"asyncio.set_event_loop",
"asyncio.Event",
"struct.unpack",
"asyncio.StreamReader",
"asyncio.Task.current_task",
"struct.pack",
"asyncio.StreamWriter",
"threading.Event",
"asyncio.Queue",
"asyncio.new_event_loop"
] | [((2486, 2510), 'asyncio.new_event_loop', 'asyncio.new_event_loop', ([], {}), '()\n', (2508, 2510), False, 'import asyncio\n'), ((2925, 2959), 'asyncio.set_event_loop', 'asyncio.set_event_loop', (['self._loop'], {}), '(self._loop)\n', (2947, 2959), False, 'import asyncio\n'), ((14202, 14226), 'asyncio.new_event_loop', ... |
#!/usr/bin/env python3
from argparse import ArgumentParser
from elftools.elf.constants import P_FLAGS
from elftools.elf.elffile import ELFFile
import io
def segment_is_text(segment):
return segment['p_flags'] & P_FLAGS.PF_X == P_FLAGS.PF_X
def segment_is_data(segment):
return not segment_is_text(segment) a... | [
"elftools.elf.elffile.ELFFile",
"argparse.ArgumentParser"
] | [((1066, 1082), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (1080, 1082), False, 'from argparse import ArgumentParser\n'), ((1271, 1288), 'elftools.elf.elffile.ELFFile', 'ELFFile', (['elf_file'], {}), '(elf_file)\n', (1278, 1288), False, 'from elftools.elf.elffile import ELFFile\n')] |
import importlib
from pprint import pprint
import ast
def get_imports_from_file(file_name):
with open(file_name, "r") as source:
tree = ast.parse(source.read())
analyzer = Analyzer()
analyzer.visit(tree)
imports = analyzer.report()
ret = []
for i in imports:
print(i)
t... | [
"importlib.util.find_spec"
] | [((340, 367), 'importlib.util.find_spec', 'importlib.util.find_spec', (['i'], {}), '(i)\n', (364, 367), False, 'import importlib\n')] |
"""
@brief test log(time=2s)
"""
import sys
import os
import unittest
from pyquickhelper.loghelper import fLOG
try:
import src
except ImportError:
path = os.path.normpath(
os.path.abspath(
os.path.join(
os.path.split(__file__)[0],
"..",
... | [
"unittest.main",
"sys.path.append",
"pyquickhelper.loghelper.fLOG",
"src.ensae_teaching_cs.automation_students.ProjectsRepository._link_regex.findall",
"os.path.split"
] | [((1290, 1305), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1303, 1305), False, 'import unittest\n'), ((579, 651), 'pyquickhelper.loghelper.fLOG', 'fLOG', (['__file__', 'self._testMethodName'], {'OutputPrint': "(__name__ == '__main__')"}), "(__file__, self._testMethodName, OutputPrint=__name__ == '__main__')\n... |
from numpy import array, copy, concatenate
from torch import Tensor
from botorch.acquisition.multi_objective.monte_carlo import (
qExpectedHypervolumeImprovement, qNoisyExpectedHypervolumeImprovement
)
from botorch.posteriors import GPyTorchPosterior, Posterior, DeterministicPosterior
from gpytorch.distributions im... | [
"numpy.copy",
"gpytorch.lazy.BlockDiagLazyTensor",
"gpytorch.distributions.MultitaskMultivariateNormal",
"torch.cat",
"numpy.concatenate"
] | [((2408, 2442), 'torch.cat', 'torch.cat', (['[baseline_X, X]'], {'dim': '(-2)'}), '([baseline_X, X], dim=-2)\n', (2417, 2442), False, 'import torch\n'), ((2482, 2510), 'numpy.copy', 'copy', (['self.X_baseline_string'], {}), '(self.X_baseline_string)\n', (2486, 2510), False, 'from numpy import array, copy, concatenate\n... |
from blog_site.common.database import Database
from blog_site.terminal_blog.model.menu import Menu
__author__ = '<NAME>'
Database.initialize()
menu = Menu()
menu.run_menu()
| [
"blog_site.common.database.Database.initialize",
"blog_site.terminal_blog.model.menu.Menu"
] | [((123, 144), 'blog_site.common.database.Database.initialize', 'Database.initialize', ([], {}), '()\n', (142, 144), False, 'from blog_site.common.database import Database\n'), ((152, 158), 'blog_site.terminal_blog.model.menu.Menu', 'Menu', ([], {}), '()\n', (156, 158), False, 'from blog_site.terminal_blog.model.menu im... |
from django.shortcuts import render, redirect
from StudentManager.functions import viewStudents
from StudentManager.models import Students, Allowed, CurrentSeason, Seasons, CheckIn, Pointers
import concurrent.futures
import threading
from django.utils import timezone
import datetime
from Manager.functions import increm... | [
"django.core.mail.send_mail",
"django.contrib.messages.error",
"StudentManager.models.Pointers.objects.filter",
"StudentManager.models.Pointers.save",
"StudentManager.models.Allowed.objects.create",
"StudentManager.models.Allowed.objects.get",
"django.contrib.auth.decorators.login_required",
"django.u... | [((708, 741), 'django.contrib.auth.decorators.login_required', 'login_required', ([], {'login_url': '"""login"""'}), "(login_url='login')\n", (722, 741), False, 'from django.contrib.auth.decorators import login_required\n'), ((1525, 1558), 'django.contrib.auth.decorators.login_required', 'login_required', ([], {'login_... |
import sys
sys.path.append('/Users/ADB/Desktop/ /cryptopals')
from cryptotools import *
key = generate_key()
def enc_oracle(m):
m = b''.join(m.split(b';'))
m = b''.join(m.split(b'='))
prefix = b'comment1=cooking%20MCs;userdata='
suffix = b';comment2=%20like%20a%20pound%20of%20bacon'
plaintext = prefix + m + suff... | [
"sys.path.append"
] | [((11, 61), 'sys.path.append', 'sys.path.append', (['"""/Users/ADB/Desktop/ /cryptopals"""'], {}), "('/Users/ADB/Desktop/ /cryptopals')\n", (26, 61), False, 'import sys\n')] |
from AutoEncoder.denoising_AE.denoising_ae import DAE
from AutoEncoder.denoising_AE.data import Data
from AutoEncoder.denoising_AE.learner import Learner
from AutoEncoder.denoising_AE.visualizer import Visualizer
if __name__ == '__main__':
DATA_DIR = 'D:/rawDataFiles/digit_train.csv'
LEARNING_RATE = ... | [
"AutoEncoder.denoising_AE.learner.Learner",
"AutoEncoder.denoising_AE.data.Data",
"AutoEncoder.denoising_AE.denoising_ae.DAE",
"AutoEncoder.denoising_AE.visualizer.Visualizer"
] | [((380, 394), 'AutoEncoder.denoising_AE.data.Data', 'Data', (['DATA_DIR'], {}), '(DATA_DIR)\n', (384, 394), False, 'from AutoEncoder.denoising_AE.data import Data\n'), ((446, 464), 'AutoEncoder.denoising_AE.denoising_ae.DAE', 'DAE', (['LEARNING_RATE'], {}), '(LEARNING_RATE)\n', (449, 464), False, 'from AutoEncoder.deno... |
import sys
import pickle
import numpy as np
import smplx
import torch
import trimesh
from copy import deepcopy
from psbody.mesh import Mesh
import cv2
import os
import natsort
from tqdm import tqdm
def show(verts = None, faces = None, colors = None):
if torch.is_tensor(verts):
verts = verts.detach().numpy(... | [
"tqdm.tqdm",
"trimesh.Trimesh",
"psbody.mesh.Mesh",
"smplx.create",
"pickle.load",
"trimesh.PointCloud",
"torch.tensor",
"torch.is_tensor",
"os.listdir",
"trimesh.scene.Scene"
] | [((259, 281), 'torch.is_tensor', 'torch.is_tensor', (['verts'], {}), '(verts)\n', (274, 281), False, 'import torch\n'), ((330, 352), 'torch.is_tensor', 'torch.is_tensor', (['faces'], {}), '(faces)\n', (345, 352), False, 'import torch\n'), ((794, 815), 'trimesh.scene.Scene', 'trimesh.scene.Scene', ([], {}), '()\n', (813... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
from scipy import linalg
from numpy.testing import assert_almost_equal
from megamix.online import GaussianMixture
from megamix.online.base import _log_normal_matrix
from megamix.online import dist_matrix
from megamix.utils_testing import checking
from sc... | [
"numpy.sum",
"megamix.online.dist_matrix",
"scipy.linalg.cholesky",
"numpy.argmin",
"numpy.exp",
"scipy.special.logsumexp",
"megamix.online.GaussianMixture",
"numpy.random.randn",
"numpy.testing.assert_almost_equal",
"numpy.empty_like",
"numpy.finfo",
"pytest.raises",
"megamix.utils_testing.... | [((595, 634), 'megamix.utils_testing.checking.remove', 'checking.remove', (["(self.file_name + '.h5')"], {}), "(self.file_name + '.h5')\n", (610, 634), False, 'from megamix.utils_testing import checking\n'), ((699, 739), 'numpy.random.randn', 'np.random.randn', (['self.n_points', 'self.dim'], {}), '(self.n_points, self... |
from __future__ import division
import torch
# from BNNs.base_net import *
def softmax_CE_preact_hessian(last_layer_acts):
side = last_layer_acts.shape[1]
I = torch.eye(side).type(torch.ByteTensor)
# for i != j H = -ai * aj -- Note that these are activations not pre-activations
Hl = - last_layer_ac... | [
"torch.t",
"torch.eye",
"torch.bmm",
"torch.cholesky",
"torch.inverse",
"torch.matmul"
] | [((1285, 1301), 'torch.bmm', 'torch.bmm', (['B', 'Hl'], {}), '(B, Hl)\n', (1294, 1301), False, 'import torch\n'), ((1311, 1330), 'torch.matmul', 'torch.matmul', (['Hl', 'B'], {}), '(Hl, B)\n', (1323, 1330), False, 'import torch\n'), ((1565, 1593), 'torch.inverse', 'torch.inverse', (['scaled_factor'], {}), '(scaled_fact... |
import json
from urllib.parse import urlencode
class Resource(object):
def __init__(self, api_client):
self.api_client = api_client
def get_machine(self, resid):
params = {'resid': resid}
resp = self.api_client.session.get(self.api_client.get_server() + '/common/resources/getMachineJ... | [
"urllib.parse.urlencode",
"json.dumps"
] | [((505, 529), 'json.dumps', 'json.dumps', (['machine_data'], {}), '(machine_data)\n', (515, 529), False, 'import json\n'), ((371, 388), 'urllib.parse.urlencode', 'urlencode', (['params'], {}), '(params)\n', (380, 388), False, 'from urllib.parse import urlencode\n')] |
import numpy as np
import random
from time import time
random.seed(42)
def semi_greedy_construction(window, number_items, weight_max, values_items, weight_items):
efficiency = np.divide(values_items, weight_items)
items = {}
for i in range(number_items):
items[i] = efficiency[i], values_items[i], weight_items[i... | [
"numpy.zeros",
"numpy.divide",
"random.seed",
"random.randint"
] | [((56, 71), 'random.seed', 'random.seed', (['(42)'], {}), '(42)\n', (67, 71), False, 'import random\n'), ((179, 216), 'numpy.divide', 'np.divide', (['values_items', 'weight_items'], {}), '(values_items, weight_items)\n', (188, 216), True, 'import numpy as np\n'), ((816, 854), 'numpy.zeros', 'np.zeros', (['number_items'... |
"""
"""
# Global imports
from functools import wraps
from cornflow_core.authentication import BaseAuth
from cornflow_core.exceptions import InvalidData, NoPermission
from cornflow_core.models import ViewBaseModel, PermissionViewRoleBaseModel
# Partial imports
from flask import request, g, current_app
# Internal mo... | [
"cornflow_core.models.ViewBaseModel.query.filter_by",
"functools.wraps",
"flask.request.json.get",
"cornflow_core.models.PermissionViewRoleBaseModel.get_permission",
"cornflow_core.exceptions.NoPermission",
"cornflow_core.exceptions.InvalidData"
] | [((888, 899), 'functools.wraps', 'wraps', (['func'], {}), '(func)\n', (893, 899), False, 'from functools import wraps\n'), ((3018, 3111), 'cornflow_core.exceptions.NoPermission', 'NoPermission', ([], {'error': '"""You do not have permission to access this endpoint"""', 'status_code': '(403)'}), "(error='You do not have... |
#!/usr/bin/env python3
# Copyright (c) 2020-2022 The Bitcoin developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the quorum detection of avalanche."""
from time import time
from test_framework.avatools import (
... | [
"test_framework.avatools.get_ava_p2p_interface",
"time.time",
"test_framework.messages.AvalancheVote",
"test_framework.avatools.create_coinbase_stakes",
"test_framework.util.assert_equal",
"test_framework.key.ECKey",
"test_framework.key.ECPubKey"
] | [((1404, 1431), 'test_framework.avatools.get_ava_p2p_interface', 'get_ava_p2p_interface', (['node'], {}), '(node)\n', (1425, 1431), False, 'from test_framework.avatools import create_coinbase_stakes, get_ava_p2p_interface\n'), ((1459, 1469), 'test_framework.key.ECPubKey', 'ECPubKey', ([], {}), '()\n', (1467, 1469), Fal... |
# ----------------------------------------------------------------------------
# OpenBootcamp - Reto Diario 06
# Created By : Rikhen
# version =' 1.0'
# ---------------------------------------------------------------------------
import sys
import calculator as calc
import converter as conv
import validations as valid... | [
"converter.convert_to_integer",
"validations.is_string",
"validations.is_exists",
"calculator.calculate",
"sys.exit"
] | [((954, 978), 'validations.is_exists', 'valid.is_exists', (['num1str'], {}), '(num1str)\n', (969, 978), True, 'import validations as valid\n'), ((1221, 1245), 'validations.is_exists', 'valid.is_exists', (['num2str'], {}), '(num2str)\n', (1236, 1245), True, 'import validations as valid\n'), ((478, 516), 'sys.exit', 'sys... |
import pytest
from sym_lis3 import GlobalEnv
def test_map_basic():
g = GlobalEnv()
assert list(g.eval_str('(map (lambda (x) (* 2 x)) (list 1 2 3))')) == [2, 4, 6]
def test_map_curry():
g = GlobalEnv()
g.eval_str('(define "foo" (lambda (x y) (* x y)))')
assert list(g.eval_str('(map (curry foo 2... | [
"sym_lis3.GlobalEnv"
] | [((77, 88), 'sym_lis3.GlobalEnv', 'GlobalEnv', ([], {}), '()\n', (86, 88), False, 'from sym_lis3 import GlobalEnv\n'), ((205, 216), 'sym_lis3.GlobalEnv', 'GlobalEnv', ([], {}), '()\n', (214, 216), False, 'from sym_lis3 import GlobalEnv\n')] |
import os
import ast
import pytest
from flake8.options.manager import OptionManager
from flake8_fine_pytest.checker import FinePytestChecker
def parse_options(allowed_test_directories, allowed_test_arguments_count, allowed_assert_count):
options = OptionManager()
options.allowed_test_directories = allowed_... | [
"flake8_fine_pytest.checker.FinePytestChecker.parse_options",
"flake8_fine_pytest.checker.FinePytestChecker",
"os.path.abspath",
"flake8.options.manager.OptionManager",
"ast.parse"
] | [((256, 271), 'flake8.options.manager.OptionManager', 'OptionManager', ([], {}), '()\n', (269, 271), False, 'from flake8.options.manager import OptionManager\n'), ((470, 510), 'flake8_fine_pytest.checker.FinePytestChecker.parse_options', 'FinePytestChecker.parse_options', (['options'], {}), '(options)\n', (501, 510), F... |
from . import models
from .initialize import initialize_db
from async_asgi_testclient import TestClient
from fastapi.applications import FastAPI
from fastapi_asyncpg import configure_asyncpg
from fastapi_asyncpg import create_pool_test
from fastapi_iam import configure_iam
from pathlib import Path
from pytest_docker_fi... | [
"asyncpg.connect",
"async_asgi_testclient.TestClient",
"fastapi.applications.FastAPI",
"pytest_docker_fixtures.images.configure",
"fastapi_iam.configure_iam",
"pathlib.Path",
"fastapi_asyncpg.create_pool_test",
"fastapi_asyncpg.configure_asyncpg"
] | [((401, 487), 'pytest_docker_fixtures.images.configure', 'images.configure', (['"""postgresql"""', '"""postgres"""', '"""11.1"""'], {'env': "{'POSTGRES_DB': 'test_db'}"}), "('postgresql', 'postgres', '11.1', env={'POSTGRES_DB':\n 'test_db'})\n", (417, 487), False, 'from pytest_docker_fixtures import images\n'), ((37... |
from starlette.responses import PlainTextResponse, RedirectResponse
from starlette.applications import Starlette
from starlette.templating import Jinja2Templates
from starlette.routing import Mount, Route
from starlette.staticfiles import StaticFiles
from starlette.exceptions import HTTPException
from template_functio... | [
"config.config",
"config.database.fetch_one",
"data.stats_power_line",
"data.get_plant_generator_summary",
"data.get_wikidata",
"util.cache_for",
"starlette.exceptions.HTTPException",
"starlette.staticfiles.StaticFiles",
"starlette.responses.PlainTextResponse",
"data.get_countries",
"data.get_pl... | [((717, 758), 'config.config', 'config', (['"""DEBUG"""'], {'cast': 'bool', 'default': '(False)'}), "('DEBUG', cast=bool, default=False)\n", (723, 758), False, 'from config import database, config\n'), ((771, 809), 'starlette.templating.Jinja2Templates', 'Jinja2Templates', ([], {'directory': '"""templates"""'}), "(dire... |
import pytest
from cle_parcel_lookup import create_app
@pytest.fixture
def app():
return create_app()
@pytest.fixture
def client(app):
return app.test_client()
| [
"cle_parcel_lookup.create_app"
] | [((95, 107), 'cle_parcel_lookup.create_app', 'create_app', ([], {}), '()\n', (105, 107), False, 'from cle_parcel_lookup import create_app\n')] |
import numpy as np
m,n = [int(i) for i in '2 7'.strip().split(' ')]
data1=[
'0.18 0.89 109.85',
'1.0 0.26 155.72',
'0.92 0.11 137.66',
'0.07 0.37 76.17',
'0.85 0.16 139.75',
'0.99 0.41 162.6',
'0.87 0.47 151.77'
]
X = []
Y = []
for item in data1:
data = item.strip().split(' ')
X.append(data[:m])
Y.append(data... | [
"numpy.dot",
"numpy.mean",
"numpy.array"
] | [((467, 485), 'numpy.array', 'np.array', (['X', 'float'], {}), '(X, float)\n', (475, 485), True, 'import numpy as np\n'), ((489, 507), 'numpy.array', 'np.array', (['Y', 'float'], {}), '(Y, float)\n', (497, 507), True, 'import numpy as np\n'), ((515, 537), 'numpy.array', 'np.array', (['X_new', 'float'], {}), '(X_new, fl... |
from components.material import Material
# This Assumes most pieces of armor will have 1 AC as base.
Skin = Material('skin', 'Skin', hardness=0, sharpness=0, potency=0.2, weight=0.1, value=0)
Flesh = Material('flesh', 'Flesh', hardness=0, sharpness=0, potency=0.2, weight=0.15, value=0)
Fur = Material('fur', 'Fur', ... | [
"components.material.Material"
] | [((112, 199), 'components.material.Material', 'Material', (['"""skin"""', '"""Skin"""'], {'hardness': '(0)', 'sharpness': '(0)', 'potency': '(0.2)', 'weight': '(0.1)', 'value': '(0)'}), "('skin', 'Skin', hardness=0, sharpness=0, potency=0.2, weight=0.1,\n value=0)\n", (120, 199), False, 'from components.material imp... |
# coding: utf-8
"""
Reseplaneraren
Provides access to Västtrafik journey planner
OpenAPI spec version: 1.10.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class Vehicle(object):
"""
NOTE: This clas... | [
"six.iteritems"
] | [((7801, 7830), 'six.iteritems', 'iteritems', (['self.swagger_types'], {}), '(self.swagger_types)\n', (7810, 7830), False, 'from six import iteritems\n')] |
from easydict import EasyDict
cartpole_dqfd_config = dict(
exp_name='cartpole_dqfd_seed0',
env=dict(
collector_env_num=8,
evaluator_env_num=5,
n_evaluator_episode=5,
stop_value=195,
),
policy=dict(
cuda=True,
priority=True,
model=dict(
... | [
"ding.entry.serial_entry_dqfd.serial_pipeline_dqfd",
"easydict.EasyDict"
] | [((1687, 1717), 'easydict.EasyDict', 'EasyDict', (['cartpole_dqfd_config'], {}), '(cartpole_dqfd_config)\n', (1695, 1717), False, 'from easydict import EasyDict\n'), ((2007, 2044), 'easydict.EasyDict', 'EasyDict', (['cartpole_dqfd_create_config'], {}), '(cartpole_dqfd_create_config)\n', (2015, 2044), False, 'from easyd... |
import argparse
import yaml
import os
from glob import glob
import inspect
import sys
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parent_dir = os.path.dirname(current_dir)
sys.path.insert(0, parent_dir)
import time
import numpy as np
import torch
from torch.ut... | [
"argparse.ArgumentParser",
"segmentation_dataset.RawChromosomeDataset",
"models.UNet.UNet",
"yaml.dump",
"numpy.mean",
"models.Segnet.SegNet",
"models.AttentionUnet.AttU_Net",
"loss.DiceLoss",
"os.path.join",
"torch.utils.data.DataLoader",
"os.path.dirname",
"torch.load",
"models.FCN.FCN_Res... | [((196, 224), 'os.path.dirname', 'os.path.dirname', (['current_dir'], {}), '(current_dir)\n', (211, 224), False, 'import os\n'), ((226, 256), 'sys.path.insert', 'sys.path.insert', (['(0)', 'parent_dir'], {}), '(0, parent_dir)\n', (241, 256), False, 'import sys\n'), ((3355, 3398), 'torch.load', 'torch.load', (['model_na... |
import os
import struct
import numpy as np
import xarray as xr
import netCDF4 as ds
from pathlib import Path
import matplotlib.pyplot as plt
import struct
import itertools
import Homogenizer_GUI
from enum import Enum
from collections import OrderedDict
import pickle
class UserPrefs(Enum):
ScanFolde... | [
"matplotlib.pyplot.title",
"Homogenizer_GUI.Homogenizer_GUI",
"numpy.polyfit",
"numpy.angle",
"numpy.fft.ifft2",
"matplotlib.pyplot.imshow",
"os.path.exists",
"matplotlib.pyplot.colorbar",
"numpy.reshape",
"numpy.conj",
"matplotlib.pyplot.show",
"struct.unpack",
"itertools.tee",
"matplotli... | [((13222, 13237), 'collections.OrderedDict', 'OrderedDict', (['[]'], {}), '([])\n', (13233, 13237), False, 'from collections import OrderedDict\n'), ((13260, 13275), 'collections.OrderedDict', 'OrderedDict', (['[]'], {}), '([])\n', (13271, 13275), False, 'from collections import OrderedDict\n'), ((13545, 13578), 'Homog... |
import numpy as np
import math
Esubo = 8.854 * pow(10,-12)
k = 8.988 * pow(10,9)
def fluxDisk():
radius = float(input("Radius: "))
radius = radius /1000
electricField = float(input("Electric Field: "))
electricField = (electricField*pow(10,3))
theta = float(input("Theta: "))
actualTh... | [
"math.radians"
] | [((360, 385), 'math.radians', 'math.radians', (['actualTheta'], {}), '(actualTheta)\n', (372, 385), False, 'import math\n')] |
"""Optimization
* :function:`.single_nested_cvrs`
* :function:`.dual_nested_cvrs`
* :function:`.single_cv`
* :function:`.chi2_test`
"""
# data wrangling
import numpy as np
import pandas as pd
from itertools import product
from scipy import stats
# validation
from sklearn.metrics import balanced_accuracy... | [
"pandas.DataFrame",
"sklearn.metrics.accuracy_score",
"sklearn.preprocessing.MinMaxScaler",
"sklearn.metrics.balanced_accuracy_score",
"sklearn.model_selection.KFold",
"sklearn.metrics.roc_auc_score",
"sklearn.metrics.f1_score",
"numpy.mean"
] | [((3295, 3323), 'pandas.DataFrame', 'pd.DataFrame', ([], {'columns': 'hp_set'}), '(columns=hp_set)\n', (3307, 3323), True, 'import pandas as pd\n'), ((3350, 3400), 'pandas.DataFrame', 'pd.DataFrame', ([], {'columns': "['hp_hat', 't_bcr', 'v_bcr']"}), "(columns=['hp_hat', 't_bcr', 'v_bcr'])\n", (3362, 3400), True, 'impo... |
import sys
import logging
from gifi.utils import git_utils
from gifi.command import Command, AggregatedCommand, UnknownCommandException, CommandException
import gifi.epic
import gifi.feature
import pkg_resources
import gifi.queue
import gifi.git_hub
logging.basicConfig(filename='/tmp/gifi.log', level=logging.DEBUG)
... | [
"pkg_resources.require",
"gifi.utils.git_utils.get_repo",
"logging.basicConfig"
] | [((252, 318), 'logging.basicConfig', 'logging.basicConfig', ([], {'filename': '"""/tmp/gifi.log"""', 'level': 'logging.DEBUG'}), "(filename='/tmp/gifi.log', level=logging.DEBUG)\n", (271, 318), False, 'import logging\n'), ((1519, 1539), 'gifi.utils.git_utils.get_repo', 'git_utils.get_repo', ([], {}), '()\n', (1537, 153... |
import subprocess,sys,random
import GreenLib
#Mensagens
sys.path.insert(0, 'messages')
import msg_control
import msg_logo
sys.path.insert(0, 'core')
import core_cripto
import core_recon
import core_menu
#--
# Função Menu principal
#--
def main_menu():
subprocess.run(["clear"])
logos = [msg_logo.msg_logo1,ms... | [
"subprocess.run",
"random.choice",
"sys.path.insert",
"core_cripto.Cripto",
"GreenLib.exec_menu",
"core_recon.Recon",
"sys.exit"
] | [((58, 88), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""messages"""'], {}), "(0, 'messages')\n", (73, 88), False, 'import subprocess, sys, random\n'), ((125, 151), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""core"""'], {}), "(0, 'core')\n", (140, 151), False, 'import subprocess, sys, random\n'), ((260, 28... |
from Bio.SeqUtils import ProtParam, ProtParamData
from warnings import warn
# mod for DIWV
def mod(sequence):
"""
This is a not implemented function. It is a fix for ProtParam.ProteinAnalysis().protein_scale and the DIWV scale.
As the latter requires knowldge of the preceeding amino acid it will fail.
... | [
"warnings.warn",
"Bio.SeqUtils.ProtParam.ProteinAnalysis"
] | [((608, 643), 'Bio.SeqUtils.ProtParam.ProteinAnalysis', 'ProtParam.ProteinAnalysis', (['sequence'], {}), '(sequence)\n', (633, 643), False, 'from Bio.SeqUtils import ProtParam, ProtParamData\n'), ((1478, 1534), 'warnings.warn', 'warn', (['f"""warning: {middle} is not a standard amino acid."""'], {}), "(f'warning: {midd... |
from __future__ import print_function
import smbus
import time
import struct
import argparse
import sys
import math
# Argument definition and handling
parser = argparse.ArgumentParser(description="Read an Atari 2600 cartridge via I2C")
parser.add_argument("-s", dest="rom_size", metavar="size", type=int, required=Tru... | [
"argparse.ArgumentParser",
"math.floor",
"struct.pack",
"time.sleep",
"sys.stdout.flush",
"smbus.SMBus"
] | [((163, 238), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Read an Atari 2600 cartridge via I2C"""'}), "(description='Read an Atari 2600 cartridge via I2C')\n", (186, 238), False, 'import argparse\n'), ((7469, 7489), 'smbus.SMBus', 'smbus.SMBus', (['I2C_BUS'], {}), '(I2C_BUS)\n', (7480... |
import json
f = open('removed_duplicates_sorted_2.json')
data = json.load(f)
f.close()
ones = []
for i in data["ones"]:
if "ali" in i["comment"]:
i["scam"] = 1
ones.append(i)
else:
ones.append(i)
data["ones"] = ones
with open('removed_duplicates_sorted_2.json', 'w') as outfile:
j... | [
"json.dump",
"json.load"
] | [((65, 77), 'json.load', 'json.load', (['f'], {}), '(f)\n', (74, 77), False, 'import json\n'), ((319, 343), 'json.dump', 'json.dump', (['data', 'outfile'], {}), '(data, outfile)\n', (328, 343), False, 'import json\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""This module provides basic and minimum necessary functions for carrying out
data query and download for Xena GDC ETL pipelines.
"""
# Ensure Python 2 and 3 compatibility
from __future__ import division
from __future__ import print_function
import json
import os
import... | [
"os.path.abspath",
"pandas.merge",
"pandas.io.json.json_normalize",
"os.path.dirname",
"json.dumps",
"warnings.warn",
"sys.stdout.flush",
"requests.get",
"requests.post",
"pandas.concat"
] | [((16041, 16091), 'pandas.io.json.json_normalize', 'pd.io.json.json_normalize', (['reduced_no_samples_json'], {}), '(reduced_no_samples_json)\n', (16066, 16091), True, 'import pandas as pd\n'), ((16654, 16762), 'pandas.io.json.json_normalize', 'pd.io.json.json_normalize', (["[r for r in res if 'samples' in r]", '"""sam... |
#!/usr/bin/python3
import defusedxml.ElementTree as ET
import urllib.request
import urllib.parse
import sys
import ssl
__author__ = '<NAME> <<EMAIL>>'
class NexposeException(Exception):
'''Raise this exception when the Nexpose API returns errors.'''
pass
class Nexpose:
'''
Nexpose API wrapper.
'''
def __init__... | [
"defusedxml.ElementTree.tostring",
"ssl.create_default_context",
"defusedxml.ElementTree.fromstring"
] | [((590, 618), 'ssl.create_default_context', 'ssl.create_default_context', ([], {}), '()\n', (616, 618), False, 'import ssl\n'), ((1156, 1179), 'defusedxml.ElementTree.fromstring', 'ET.fromstring', (['response'], {}), '(response)\n', (1169, 1179), True, 'import defusedxml.ElementTree as ET\n'), ((5187, 5244), 'defusedxm... |
import re, collections
def count_valid(passwords, valid):
count = 0
m = re.compile(r"(\d+)-(\d+) (.): (.+)")
for p in passwords:
n1, n2, c, password = m.match(p).groups()
if valid(int(n1), int(n2), c, password):
count += 1
return count
def policy1(lo, hi, c, password):
... | [
"collections.Counter",
"re.compile"
] | [((81, 118), 're.compile', 're.compile', (['"""(\\\\d+)-(\\\\d+) (.): (.+)"""'], {}), "('(\\\\d+)-(\\\\d+) (.): (.+)')\n", (91, 118), False, 'import re, collections\n'), ((333, 362), 'collections.Counter', 'collections.Counter', (['password'], {}), '(password)\n', (352, 362), False, 'import re, collections\n')] |
"""
Basic extension tests.
The tests are structured as .txt files, parsed and executed here.
The structure of the file is::
number of expected autolinks
# split
lines to add to the default conf.py
# split
index.html content
"""
import re
import sys
import pytest
from pathlib import Path
from bs4 impor... | [
"pytest.xfail",
"pathlib.Path",
"bs4.BeautifulSoup",
"pytest.mark.parametrize",
"re.compile"
] | [((735, 753), 're.compile', 're.compile', (['"""\\\\s*"""'], {}), "('\\\\s*')\n", (745, 753), False, 'import re\n'), ((941, 983), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""file"""', 'txt_tests'], {}), "('file', txt_tests)\n", (964, 983), False, 'import pytest\n'), ((1652, 1686), 'bs4.BeautifulSoup', '... |