code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import argparse
import logging
from .gcs_file_ingestor import GCSFileIngestor
class GCSFileIngestorCLI:
@classmethod
def run(cls):
cls.__setup_logging()
cls.__parse_args()
@classmethod
def __setup_logging(cls):
logging.basicConfig(level=logging.INFO)
@classmethod
de... | [
"logging.basicConfig",
"logging.info",
"argparse.ArgumentParser"
] | [((256, 295), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (275, 295), False, 'import logging\n'), ((358, 461), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '__doc__', 'formatter_class': 'argparse.RawDescriptionHelpFormatter'}), '... |
from datetime import datetime
from api.libs.date.formatter import DatetimeFormatter
from api.libs.representation.pretty import PrettyPrint
class Window(PrettyPrint):
START = 'start'
END = 'end'
date_formatter = DatetimeFormatter()
def __init__(self, start: datetime, end: datetime):
self.sta... | [
"datetime.datetime.fromtimestamp",
"api.libs.date.formatter.DatetimeFormatter"
] | [((227, 246), 'api.libs.date.formatter.DatetimeFormatter', 'DatetimeFormatter', ([], {}), '()\n', (244, 246), False, 'from api.libs.date.formatter import DatetimeFormatter\n'), ((1355, 1419), 'datetime.datetime.fromtimestamp', 'datetime.fromtimestamp', (['intersection_start'], {'tz': 'self.start.tzinfo'}), '(intersecti... |
from sqlalchemy import and_, or_, func
from datetime import datetime
from flask import Blueprint, request, make_response, render_template, flash, g, session, redirect, url_for, jsonify, abort, current_app
from flask.ext.babel import gettext
from dataviva import db, lm, view_cache
# from config import SITE_MIRROR
from ... | [
"dataviva.apps.ask.models.Question.language.desc",
"flask.request.args.get",
"dataviva.apps.ask.models.Question.body.like",
"sqlalchemy.and_",
"dataviva.apps.ask.models.Question.query.filter_by",
"dataviva.apps.ask.models.Question.timestamp.desc",
"flask.jsonify",
"dataviva.db.session.delete",
"sqla... | [((625, 682), 'flask.Blueprint', 'Blueprint', (['"""ask"""', '__name__'], {'url_prefix': '"""/<lang_code>/ask"""'}), "('ask', __name__, url_prefix='/<lang_code>/ask')\n", (634, 682), False, 'from flask import Blueprint, request, make_response, render_template, flash, g, session, redirect, url_for, jsonify, abort, curre... |
import tempfile, os, glob
from scipy.stats import norm as ndist
from traitlets import (HasTraits,
Integer,
Unicode,
Float,
Integer,
Instance,
Dict,
Bool... | [
"regreg.api.simple_problem",
"numpy.random.standard_normal",
"numpy.sqrt",
"numpy.array",
"scipy.stats.norm.cdf",
"rpy2.robjects.numpy2ri.activate",
"rpy2.robjects.r",
"os.path.exists",
"utils.BHfilter",
"numpy.asarray",
"os.mkdir",
"traitlets.Unicode",
"glob.glob",
"selection.randomized.l... | [((1071, 1081), 'traitlets.Float', 'Float', (['(0.2)'], {}), '(0.2)\n', (1076, 1081), False, 'from traitlets import HasTraits, Integer, Unicode, Float, Integer, Instance, Dict, Bool, default\n'), ((1100, 1125), 'traitlets.Unicode', 'Unicode', (['"""Generic method"""'], {}), "('Generic method')\n", (1107, 1125), False, ... |
import random
import torch
from tensorboardX import SummaryWriter
from plotting_utils import plot_alignment_to_numpy, plot_spectrogram_to_numpy
from plotting_utils import plot_gate_outputs_to_numpy
class Tacotron2Logger(SummaryWriter):
def __init__(self, logdir, hparams):
super(Tacotron2Logger, self).__ini... | [
"torch.nn.L1Loss"
] | [((3377, 3410), 'torch.nn.L1Loss', 'torch.nn.L1Loss', ([], {'reduction': '"""none"""'}), "(reduction='none')\n", (3392, 3410), False, 'import torch\n')] |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Aug 26 21:10:16 2017
@author: dhaval
"""
import argparse
import sys
from io import BytesIO
import matplotlib
import numpy as np
import requests
from PIL import Image
matplotlib.use('agg')
import matplotlib.pyplot as plt
from keras.preprocessing impo... | [
"keras.preprocessing.image.img_to_array",
"keras.applications.inception_v3.preprocess_input",
"io.BytesIO",
"sys.exit",
"matplotlib.pyplot.imshow",
"argparse.ArgumentParser",
"matplotlib.pyplot.barh",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.axis",
"matplotlib.p... | [((236, 257), 'matplotlib.use', 'matplotlib.use', (['"""agg"""'], {}), "('agg')\n", (250, 257), False, 'import matplotlib\n'), ((830, 853), 'keras.preprocessing.image.img_to_array', 'image.img_to_array', (['img'], {}), '(img)\n', (848, 853), False, 'from keras.preprocessing import image\n'), ((862, 887), 'numpy.expand_... |
import csv
import random
import pandas as pd
class DataGenerator:
def __init__(self, data_path, item_path):
"""
Load data from the DB MovieLens
List the users and the items
List all the users historic
"""
self.data = self.load_data(data_path, item_path)
self... | [
"random.shuffle",
"pandas.read_csv",
"random.Random",
"csv.writer",
"random.randint"
] | [((1352, 1439), 'pandas.read_csv', 'pd.read_csv', (['data_path'], {'sep': '"""\t"""', 'names': "['userId', 'itemId', 'rating', 'timestamp']"}), "(data_path, sep='\\t', names=['userId', 'itemId', 'rating',\n 'timestamp'])\n", (1363, 1439), True, 'import pandas as pd\n'), ((3425, 3460), 'random.randint', 'random.randi... |
from fastapi import Form, UploadFile, File
from typing import Optional, List
from pydantic import BaseModel
class Product(BaseModel):
title: str = Form(...)
description: Optional[str] = None
link: Optional[str] = None
image: Optional[str] = None
buy: Optional[bool] = False
# class Config:
# orm_mode = True... | [
"fastapi.Form",
"fastapi.File"
] | [((151, 160), 'fastapi.Form', 'Form', (['...'], {}), '(...)\n', (155, 160), False, 'from fastapi import Form, UploadFile, File\n'), ((717, 726), 'fastapi.Form', 'Form', (['...'], {}), '(...)\n', (721, 726), False, 'from fastapi import Form, UploadFile, File\n'), ((750, 760), 'fastapi.Form', 'Form', (['None'], {}), '(No... |
# Copyright 2019 ZTE 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.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | [
"lcm.pub.database.models.JobModel.objects.filter",
"lcm.pub.database.models.NSInstModel.objects.filter"
] | [((857, 885), 'lcm.pub.database.models.NSInstModel.objects.filter', 'NSInstModel.objects.filter', ([], {}), '()\n', (883, 885), False, 'from lcm.pub.database.models import NSInstModel, JobModel\n'), ((903, 928), 'lcm.pub.database.models.JobModel.objects.filter', 'JobModel.objects.filter', ([], {}), '()\n', (926, 928), ... |
#!/usr/bin/env python
import json
from storageclient import CleversafeClient, errors
import unittest
# XXX: tests to fix
import pytest
pytestmark = pytest.mark.skip
class TestStorage(unittest.TestCase):
@classmethod
def setUpClass(self):
with open("cred.json", "r") as f:
self.creds = j... | [
"storageclient.CleversafeClient",
"json.load"
] | [((350, 378), 'storageclient.CleversafeClient', 'CleversafeClient', (['self.creds'], {}), '(self.creds)\n', (366, 378), False, 'from storageclient import CleversafeClient, errors\n'), ((319, 331), 'json.load', 'json.load', (['f'], {}), '(f)\n', (328, 331), False, 'import json\n')] |
from django.db import models
class Food(models.Model):
foodon_id = models.CharField(max_length=100)
foodb_id = models.CharField(max_length=100)
name = models.CharField(max_length=100)
synonyms = models.CharField(max_length=100)
# Create your models here.
class Chemical(models.Model):
foodb_id ... | [
"django.db.models.TextField",
"django.db.models.FloatField",
"django.db.models.CharField",
"django.db.models.ForeignKey"
] | [((73, 105), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)'}), '(max_length=100)\n', (89, 105), False, 'from django.db import models\n'), ((121, 153), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)'}), '(max_length=100)\n', (137, 153), False, 'from django.db ... |
from gluonts.model.n_beats import NBEATSEnsembleEstimator
NBEATSEnsembleEstimator()
| [
"gluonts.model.n_beats.NBEATSEnsembleEstimator"
] | [((59, 84), 'gluonts.model.n_beats.NBEATSEnsembleEstimator', 'NBEATSEnsembleEstimator', ([], {}), '()\n', (82, 84), False, 'from gluonts.model.n_beats import NBEATSEnsembleEstimator\n')] |
from collections import Counter
import networkx as nx
import numpy as np
from features_infra.feature_calculators import NodeFeatureCalculator, FeatureMeta
class BfsMomentsCalculator(NodeFeatureCalculator):
def is_relevant(self):
return True
def weighted_avg_and_std(self, values, weights... | [
"networkx.single_source_shortest_path_length",
"numpy.sqrt",
"numpy.average",
"numpy.asarray",
"features_infra.feature_calculators.FeatureMeta",
"measure_tests.specific_feature_test.test_specific_feature"
] | [((1560, 1602), 'features_infra.feature_calculators.FeatureMeta', 'FeatureMeta', (['BfsMomentsCalculator', "{'bfs'}"], {}), "(BfsMomentsCalculator, {'bfs'})\n", (1571, 1602), False, 'from features_infra.feature_calculators import NodeFeatureCalculator, FeatureMeta\n'), ((1719, 1785), 'measure_tests.specific_feature_tes... |
#!/usr/bin/env python3
"""Manages the local system's iptables configuration.
The necessary iptables rules depends on what services are being used and
will have to be modified by other methods several times during execution.
These rules should be as restrictive as possible."""
import logging
import socket
import su... | [
"logging.getLogger",
"socket.gethostbyname",
"subprocess.run"
] | [((4973, 4992), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (4990, 4992), False, 'import logging\n'), ((531, 593), 'subprocess.run', 'subprocess.run', (["['iptables', *rule_split]"], {'capture_output': '(True)'}), "(['iptables', *rule_split], capture_output=True)\n", (545, 593), False, 'import subproces... |
# -*- coding: utf-8 -*-
"""Oscillators are lifeforms that returns to its initial configuration after
some time"""
# Import modules
import numpy as np
from .base import Lifeform
class Blinker(Lifeform):
"""A horizontal Blinker lifeform"""
def __init__(self, length=3):
"""Initialize the class
... | [
"numpy.array",
"numpy.zeros",
"numpy.ones"
] | [((569, 611), 'numpy.ones', 'np.ones', ([], {'shape': '(self.length, 1)', 'dtype': 'int'}), '(shape=(self.length, 1), dtype=int)\n', (576, 611), True, 'import numpy as np\n'), ((836, 874), 'numpy.array', 'np.array', (['[[1, 1, 1, 0], [0, 1, 1, 1]]'], {}), '([[1, 1, 1, 0], [0, 1, 1, 1]])\n', (844, 874), True, 'import nu... |
import copy
import json
from decimal import Decimal
from typing import Optional
from enum import Enum
import boto3
from boto3.dynamodb.types import TypeSerializer, TypeDeserializer
from botocore import exceptions
class InsufficientArgumentsException(Exception):
pass
class IndexNotValidException(Exception):
... | [
"boto3.client",
"json.dumps",
"boto3.dynamodb.types.TypeSerializer",
"boto3.dynamodb.types.TypeDeserializer",
"copy.deepcopy"
] | [((652, 668), 'boto3.dynamodb.types.TypeSerializer', 'TypeSerializer', ([], {}), '()\n', (666, 668), False, 'from boto3.dynamodb.types import TypeSerializer, TypeDeserializer\n'), ((688, 706), 'boto3.dynamodb.types.TypeDeserializer', 'TypeDeserializer', ([], {}), '()\n', (704, 706), False, 'from boto3.dynamodb.types im... |
#!/usr/bin/env python3
"""
Copyright 2017, <NAME>, HKUST.
Training script for local features.
"""
import os
import time
import yaml
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
from model import training
from preprocess import prepare_match_sets
from utils.npy_utils import EndPoints
fr... | [
"yaml.load",
"model.training",
"tensorflow.compat.v1.Session",
"tensorflow.compat.v1.global_variables_initializer",
"template.solver.solver",
"tensorflow.compat.v1.app.run",
"template.misc.summarizer",
"tensorflow.app.flags.DEFINE_boolean",
"tensorflow.compat.v1.global_variables",
"tensorflow.app.... | [((513, 584), 'tensorflow.app.flags.DEFINE_string', 'tf.app.flags.DEFINE_string', (['"""save_dir"""', 'None', '"""Path to save the model."""'], {}), "('save_dir', None, 'Path to save the model.')\n", (539, 584), True, 'import tensorflow as tf\n'), ((616, 681), 'tensorflow.app.flags.DEFINE_string', 'tf.app.flags.DEFINE_... |
# -*- coding: UTF-8 -*-
from .helpers import insights_upload_conf
from mock.mock import patch
from pytest import raises
collection_rules = {"version": "1.2.3"}
collection_rules_file = "/tmp/collection-rules"
@patch("insights.client.collection_rules.InsightsUploadConf.get_conf_file")
@patch("insights.client.collect... | [
"mock.mock.patch",
"pytest.raises"
] | [((214, 288), 'mock.mock.patch', 'patch', (['"""insights.client.collection_rules.InsightsUploadConf.get_conf_file"""'], {}), "('insights.client.collection_rules.InsightsUploadConf.get_conf_file')\n", (219, 288), False, 'from mock.mock import patch\n'), ((290, 399), 'mock.mock.patch', 'patch', (['"""insights.client.coll... |
#Screen functionality gets sent to different files e.g. ADCTK_ReportFunctionality or ADCTK_SecurityScan
#When functionality is done, data gets fed back to the screen and shown to user
#Please mind that the draw time of the screen impacts what is shown, as it does not update dynamically
###############
####Impor... | [
"nssrc.com.citrix.netscaler.nitro.resource.config.responder.responderglobal_responderpolicy_binding.responderglobal_responderpolicy_binding",
"nssrc.com.citrix.netscaler.nitro.resource.config.policy.policypatset_pattern_binding.policypatset_pattern_binding",
"nssrc.com.citrix.netscaler.nitro.resource.config.app... | [((1909, 1943), 'kivy.properties.StringProperty', 'StringProperty', (['"""security-network"""'], {}), "('security-network')\n", (1923, 1943), False, 'from kivy.properties import StringProperty\n'), ((20428, 20461), 'kivy.lang.Builder.load_file', 'Builder.load_file', (['"""Log4j_ADC.kv"""'], {}), "('Log4j_ADC.kv')\n", (... |
from database_controller import DatabaseClient
class CountryTopSites:
def __init__(self, country_name, sites_list):
self.country_name = country_name
self.sites_list = sites_list
self.sites_list.sort()
def save_to_db(self):
sites_list_string = ';'.join(self.sites_list)
... | [
"database_controller.DatabaseClient"
] | [((325, 341), 'database_controller.DatabaseClient', 'DatabaseClient', ([], {}), '()\n', (339, 341), False, 'from database_controller import DatabaseClient\n'), ((512, 528), 'database_controller.DatabaseClient', 'DatabaseClient', ([], {}), '()\n', (526, 528), False, 'from database_controller import DatabaseClient\n'), (... |
from flare.algorithm_zoo.distributional_rl_algorithms import C51
from flare.model_zoo.distributional_rl_models import C51Model
from flare.algorithm_zoo.distributional_rl_algorithms import QRDQN
from flare.model_zoo.distributional_rl_models import QRDQNModel
from flare.algorithm_zoo.distributional_rl_algorithms import I... | [
"torch.nn.ReLU",
"math.ceil",
"flare.model_zoo.distributional_rl_models.QRDQNModel",
"math.floor",
"flare.algorithm_zoo.distributional_rl_algorithms.C51",
"numpy.array",
"torch.tensor",
"flare.algorithm_zoo.distributional_rl_algorithms.IQN",
"torch.nn.Linear",
"unittest.main",
"flare.model_zoo.d... | [((8611, 8626), 'unittest.main', 'unittest.main', ([], {}), '()\n', (8624, 8626), False, 'import unittest\n'), ((702, 807), 'flare.model_zoo.distributional_rl_models.C51Model', 'C51Model', ([], {'dims': 'state_shape', 'num_actions': 'num_actions', 'perception_net': 'mlp', 'vmax': '(10)', 'vmin': '(-10)', 'bins': 'bins'... |
import itertools
import traceback
import pikepdf
from pdf_preflight.issue import Issue
class Profile:
rules = []
@classmethod
def get_preflight_check_text(cls, issues, exceptions):
if issues or exceptions:
exception_text = f"PDF failed Preflight checks with the following Issues & ex... | [
"traceback.format_exc",
"pdf_preflight.issue.Issue",
"pikepdf.open"
] | [((1381, 1399), 'pikepdf.open', 'pikepdf.open', (['file'], {}), '(file)\n', (1393, 1399), False, 'import pikepdf\n'), ((2526, 2577), 'pdf_preflight.issue.Issue', 'Issue', ([], {'rule': 'first.rule', 'page': 'pages', 'desc': 'first.desc'}), '(rule=first.rule, page=pages, desc=first.desc)\n', (2531, 2577), False, 'from p... |
from flask_wtf import Form
from wtforms import StringField, BooleanField, ValidationError
from wtforms.validators import DataRequired
from wtforms.widgets import TextArea
# validators.length(max=10)]
class CommentForm(Form):
username = StringField('username', validators=[DataRequired()])
comment = StringFiel... | [
"wtforms.widgets.TextArea",
"wtforms.validators.DataRequired"
] | [((368, 378), 'wtforms.widgets.TextArea', 'TextArea', ([], {}), '()\n', (376, 378), False, 'from wtforms.widgets import TextArea\n'), ((279, 293), 'wtforms.validators.DataRequired', 'DataRequired', ([], {}), '()\n', (291, 293), False, 'from wtforms.validators import DataRequired\n'), ((345, 359), 'wtforms.validators.Da... |
from tornado import gen
from tornado.httpclient import AsyncHTTPClient
@gen.coroutine
def fetch_coroutine(url):
http_client = AsyncHTTPClient()
response = yield http_client.fetch(url)
# in Python versions prior to 3.3
raise gen.Return(response.body)
# in Python versions after 3.3
# return respon... | [
"tornado.gen.sleep",
"tornado.ioloop.IOLoop.current",
"tornado.gen.Return",
"tornado.httpclient.AsyncHTTPClient",
"tornado.gen.Task"
] | [((130, 147), 'tornado.httpclient.AsyncHTTPClient', 'AsyncHTTPClient', ([], {}), '()\n', (145, 147), False, 'from tornado.httpclient import AsyncHTTPClient\n'), ((240, 265), 'tornado.gen.Return', 'gen.Return', (['response.body'], {}), '(response.body)\n', (250, 265), False, 'from tornado import gen\n'), ((531, 547), 't... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-08-10 04:22
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('server', '0042_auto_20160808_1021'),
]
operations = [
migrations.RemoveField(... | [
"django.db.migrations.DeleteModel",
"django.db.migrations.RemoveField",
"django.db.models.TextField",
"django.db.models.CharField"
] | [((297, 370), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""osquerycolumn"""', 'name': '"""osquery_result"""'}), "(model_name='osquerycolumn', name='osquery_result')\n", (319, 370), False, 'from django.db import migrations, models\n'), ((415, 481), 'django.db.migrations.RemoveFie... |
# http://github.com/timestocome
# train a raspberry pi robot to wander the house while avoiding obstacles
# and looking for cats
# this robot uses wheels for steering
# 4 wheel drive with separate controls each side
# change from off policy learning in first try
# adapted from https://morvanzhou.github.io/tutorial... | [
"numpy.zeros",
"numpy.load",
"numpy.argmax"
] | [((1191, 1218), 'numpy.zeros', 'np.zeros', (['n_distance_states'], {}), '(n_distance_states)\n', (1199, 1218), True, 'import numpy as np\n'), ((774, 789), 'numpy.load', 'np.load', (['qTable'], {}), '(qTable)\n', (781, 789), True, 'import numpy as np\n'), ((1336, 1363), 'numpy.argmax', 'np.argmax', (['q_table[i, j, :]']... |
from metacash.configuration import Configuration
from metacash.readers.inbank import InBankCSV
import logging
def test_load():
config = Configuration("fixtures/dataset1/config.py")
config.describe()
# verify that we've loaded three accounts
assert list(config["accounts"].keys()) == ['iban1', 'iban2',... | [
"metacash.configuration.Configuration"
] | [((142, 186), 'metacash.configuration.Configuration', 'Configuration', (['"""fixtures/dataset1/config.py"""'], {}), "('fixtures/dataset1/config.py')\n", (155, 186), False, 'from metacash.configuration import Configuration\n')] |
import torch
class TissueNormalizer(object):
def __init__(self, black_value=-4.0):
self.normer = torch.nn.InstanceNorm1d(1)
self.black_value = black_value
def __call__(self, x, plastic_mask):
assert x.shape[0] == 1
if plastic_mask:
assert plastic_mask.shape[0] == 1
... | [
"torch.nn.InstanceNorm1d"
] | [((110, 136), 'torch.nn.InstanceNorm1d', 'torch.nn.InstanceNorm1d', (['(1)'], {}), '(1)\n', (133, 136), False, 'import torch\n')] |
import torch
import random
from torch.utils.data import Dataset, DataLoader
from collections import defaultdict
import os
import unicodedata
import re
import time
from collections import defaultdict
from tqdm import tqdm
import numpy as np
from transformers import *
from helpers import *
class DatasetWebQSP(Dataset):
... | [
"torch.LongTensor",
"collections.defaultdict",
"torch.FloatTensor",
"torch.tensor"
] | [((519, 536), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (530, 536), False, 'from collections import defaultdict\n'), ((561, 578), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (572, 578), False, 'from collections import defaultdict\n'), ((2025, 2050), 'torch.LongTenso... |
#!/usr/bin/env python
#
# Scheduling daemon for applying highstate in a consistent and
# even schedule
#
# Author: <NAME> <evan/at/fatbox/dot/ca>
# Copyright (c) 2012 - FatBox Inc.
#
import salt.client
import logging
import time
# how often we want minions to reapply state
RUN_INTERVAL = 43200
# rediscover_interval... | [
"logging.basicConfig",
"logging.info",
"time.sleep",
"time.time"
] | [((3064, 3137), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO', 'format': '"""%(asctime)s %(message)s"""'}), "(level=logging.INFO, format='%(asctime)s %(message)s')\n", (3083, 3137), False, 'import logging\n'), ((698, 742), 'logging.info', 'logging.info', (['"""Salt commander - Starting up"... |
'''
Code generator for shader libraries.
'''
Version = 49
import os, platform, json
import genutil as util
from util import glslcompiler, shdc
from mod import log
import zlib # only for crc32
if platform.system() == 'Windows' :
from util import hlslcompiler
if platform.system() == 'Darwin' :
from util impor... | [
"genutil.setErrorLocation",
"os.path.splitext",
"util.shdc.compile",
"os.path.split",
"platform.system",
"genutil.fmtError",
"genutil.isDirty",
"util.hlslcompiler.compile",
"json.load",
"util.metalcompiler.compile",
"util.glslcompiler.compile"
] | [((198, 215), 'platform.system', 'platform.system', ([], {}), '()\n', (213, 215), False, 'import os, platform, json\n'), ((269, 286), 'platform.system', 'platform.system', ([], {}), '()\n', (284, 286), False, 'import os, platform, json\n'), ((21475, 21503), 'os.path.split', 'os.path.split', (['absSourcePath'], {}), '(a... |
from __future__ import absolute_import
from __future__ import unicode_literals
import pytz
from corehq.apps.sms.models import SMS
from corehq.apps.locations.models import SQLLocation
from corehq.apps.users.models import CommCareUser
from corehq.form_processor.utils import is_commcarecase
from corehq.messaging.smsbacken... | [
"couchexport.export.export_raw",
"pytz.timezone",
"corehq.apps.locations.models.SQLLocation.by_location_id",
"datetime.time",
"corehq.messaging.smsbackends.airtel_tcl.models.AirtelTCLBackend.get_api_id",
"io.open",
"corehq.apps.users.models.CommCareUser.get_by_user_id",
"corehq.form_processor.utils.is... | [((1967, 2006), 'corehq.apps.locations.models.SQLLocation.by_location_id', 'SQLLocation.by_location_id', (['location_id'], {}), '(location_id)\n', (1993, 2006), False, 'from corehq.apps.locations.models import SQLLocation\n'), ((2915, 2944), 'pytz.timezone', 'pytz.timezone', (['"""Asia/Kolkata"""'], {}), "('Asia/Kolkat... |
import numpy as np
import SimpleITK as sitk
# https://itk.org/SimpleITKDoxygen/html/classitk_1_1simple_1_1CurvatureFlowImageFilter.html#details
def curvatureFlowImageFilter(img, verbose=False):
imgOriginal = img
convertOutput = False
if type(img) != sitk.SimpleITK.Image:
imgOriginal = sitk.GetIma... | [
"SimpleITK.CurvatureFlow",
"SimpleITK.GetImageFromArray",
"SimpleITK.GetArrayFromImage"
] | [((391, 467), 'SimpleITK.CurvatureFlow', 'sitk.CurvatureFlow', ([], {'image1': 'imgOriginal', 'timeStep': '(0.125)', 'numberOfIterations': '(5)'}), '(image1=imgOriginal, timeStep=0.125, numberOfIterations=5)\n', (409, 467), True, 'import SimpleITK as sitk\n'), ((309, 336), 'SimpleITK.GetImageFromArray', 'sitk.GetImageF... |
import os
from dotenv import load_dotenv
# Load environmental variables
load_dotenv()
BUILD_ENGINE = os.environ["BUILD_ENGINE"]
base_path = ".output"
if not os.path.isdir(base_path):
os.makedirs(base_path, exist_ok=True)
# create .gitignore so that files in this directory aren't tracked
with open(f"{ba... | [
"os.path.isdir",
"os.makedirs",
"dotenv.load_dotenv"
] | [((74, 87), 'dotenv.load_dotenv', 'load_dotenv', ([], {}), '()\n', (85, 87), False, 'from dotenv import load_dotenv\n'), ((162, 186), 'os.path.isdir', 'os.path.isdir', (['base_path'], {}), '(base_path)\n', (175, 186), False, 'import os\n'), ((192, 229), 'os.makedirs', 'os.makedirs', (['base_path'], {'exist_ok': '(True)... |
from speaking import say_temp, say_shutdown
from temperature import get_temp
import os
import keyboard
import time
def key_press(key):
if "a down" in str(key):
say_shutdown()
time.sleep(5)
os.system("sudo shutdown now")
else:
say_temp(get_temp())
keyboard.on_press(key_press)
w... | [
"keyboard.on_press",
"time.sleep",
"speaking.say_shutdown",
"os.system",
"temperature.get_temp"
] | [((289, 317), 'keyboard.on_press', 'keyboard.on_press', (['key_press'], {}), '(key_press)\n', (306, 317), False, 'import keyboard\n'), ((335, 348), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (345, 348), False, 'import time\n'), ((173, 187), 'speaking.say_shutdown', 'say_shutdown', ([], {}), '()\n', (185, 187),... |
# Generated by Django 3.1.1 on 2020-10-26 21:37
from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
dependencies = [
("sleuthpr", "0016_auto_20201010_0654"),
]
operations = [
migrations.AlterField(
model_name="pullrequestreview... | [
"django.db.models.CharField"
] | [((369, 656), 'django.db.models.CharField', 'models.CharField', ([], {'choices': "[('approved', 'Approved'), ('dismissed', 'Dismissed'), ('changes_requested',\n 'Changes requested'), ('commented', 'Commented'), ('pending', 'Pending'\n ), ('submitted', 'Submitted')]", 'db_index': '(True)', 'default': '"""pending""... |
import os
import subprocess
import sys
from collections import namedtuple
from pathlib import Path
import jinja2
# import attr
THIS_DIR = Path(os.path.dirname(os.path.realpath(__file__)))
TEMPLATES_DIR = THIS_DIR / "templates"
DESIRED_PACKAGES = [
"Flask",
"IPython",
"pytest",
"sqlalchemy",
"att... | [
"os.listdir",
"collections.namedtuple",
"subprocess.check_call",
"subprocess.run",
"os.path.realpath",
"os.mkdir"
] | [((392, 441), 'collections.namedtuple', 'namedtuple', (['"""Author"""', "['name', 'email', 'github']"], {}), "('Author', ['name', 'email', 'github'])\n", (402, 441), False, 'from collections import namedtuple\n'), ((162, 188), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (178, 188), False... |
from rest_gae import RESTHandler, PERMISSION_ANYONE, PERMISSION_LOGGED_IN_USER, PERMISSION_OWNER_USER, PERMISSION_ADMIN
from rest_gae.users import UserRESTHandler
import webapp2
import data
config = {
'webapp2_extras.auth': {
'user_model': 'data.User',
'user_attributes': [
'email',
... | [
"rest_gae.RESTHandler",
"rest_gae.users.UserRESTHandler"
] | [((526, 762), 'rest_gae.RESTHandler', 'RESTHandler', (['"""/api/mymodel"""', 'data.MyModel'], {'permissions': "{'GET': PERMISSION_OWNER_USER, 'POST': PERMISSION_LOGGED_IN_USER, 'PUT':\n PERMISSION_OWNER_USER, 'DELETE': PERMISSION_OWNER_USER}", 'put_callback': '(lambda model, data: model)'}), "('/api/mymodel', data.M... |
from __future__ import annotations
import abc
from typing import Union, List, Set, Tuple
import numpy as np
import pandas as pd
from ete3 import Tree
from genomics_data_index.api.query.kind.IsaKind import IsaKind
from genomics_data_index.storage.SampleSet import SampleSet
from genomics_data_index.storage.model.Query... | [
"genomics_data_index.storage.SampleSet.SampleSet.create_all"
] | [((1189, 1211), 'genomics_data_index.storage.SampleSet.SampleSet.create_all', 'SampleSet.create_all', ([], {}), '()\n', (1209, 1211), False, 'from genomics_data_index.storage.SampleSet import SampleSet\n')] |
import keras
from keras.models import Sequential, load_model, Model
from keras.layers import Dense, Dropout, Flatten
from keras.layers import Conv2D, MaxPooling2D
from keras.layers import Input
from scipy import io
num_classes = 2 # number of classes for the classification
batch_size = ... | [
"keras.layers.Conv2D",
"keras.layers.Flatten",
"keras.layers.MaxPooling2D",
"scipy.io.loadmat",
"keras.models.Sequential",
"keras.utils.to_categorical",
"keras.layers.Input",
"keras.models.Model",
"keras.layers.Dense",
"keras.layers.Dropout",
"keras.optimizers.Adadelta"
] | [((585, 612), 'keras.optimizers.Adadelta', 'keras.optimizers.Adadelta', ([], {}), '()\n', (610, 612), False, 'import keras\n'), ((1066, 1096), 'scipy.io.loadmat', 'io.loadmat', (['"""Data/X_train.mat"""'], {}), "('Data/X_train.mat')\n", (1076, 1096), False, 'from scipy import io\n'), ((1146, 1176), 'scipy.io.loadmat', ... |
import pandas as pd
import numpy as np
from sklearn.decomposition import PCA
from sklearn import preprocessing
import matplotlib.pyplot as plt
#load and tranpose csv data
#Data fetched on 2021-05-08
csvDataT = pd.read_csv('ticks.norm.csv')
csvData = csvDataT.T
#Symbol column like AEFES,AKBNK,AKSA...
ticks = csvDa... | [
"pandas.read_csv",
"matplotlib.pyplot.ylabel",
"sklearn.decomposition.PCA",
"numpy.round",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.annotate",
"matplotlib.pyplot.scatter",
"pandas.DataFrame",
"matplotlib.pyplot.title",
"sklearn.preprocessing.scale",
"matplotlib.pyplot.show"
] | [((215, 244), 'pandas.read_csv', 'pd.read_csv', (['"""ticks.norm.csv"""'], {}), "('ticks.norm.csv')\n", (226, 244), True, 'import pandas as pd\n'), ((672, 702), 'sklearn.preprocessing.scale', 'preprocessing.scale', (['csvData.T'], {}), '(csvData.T)\n', (691, 702), False, 'from sklearn import preprocessing\n'), ((709, 7... |
""" This script is used to run just **one** parameter configuration for debugging purposes
"""
from polylidar_plane_benchmark.scripts.train_core import evaluate_with_params_visualize
def main():
params = {'fname': 'pc_02.pcd', 'tcomp': 0.80, 'variance': 1, 'kernel_size': 5,
'loops_bilateral': 2, 'lo... | [
"polylidar_plane_benchmark.scripts.train_core.evaluate_with_params_visualize"
] | [((471, 509), 'polylidar_plane_benchmark.scripts.train_core.evaluate_with_params_visualize', 'evaluate_with_params_visualize', (['params'], {}), '(params)\n', (501, 509), False, 'from polylidar_plane_benchmark.scripts.train_core import evaluate_with_params_visualize\n')] |
from ctapp import app
if __name__ == '__main__':
app.run(host='0.0.0.0', port=61011)
| [
"ctapp.app.run"
] | [((54, 89), 'ctapp.app.run', 'app.run', ([], {'host': '"""0.0.0.0"""', 'port': '(61011)'}), "(host='0.0.0.0', port=61011)\n", (61, 89), False, 'from ctapp import app\n')] |
from django.utils.translation import ugettext_lazy as _
MEETINGS_CONTRIBUTION_TYPES = [
('talk', _('Talk')),
('poster', _('Poster'))
]
MEETINGS_PAYMENT_CHOICES = (
('cash', _('cash')),
('wire', _('wire transfer')),
)
MEETINGS_PARTICIPANT_DETAIL_KEYS = []
MEETINGS_ABSTRACT_MAX_LENGTH = 2000
| [
"django.utils.translation.ugettext_lazy"
] | [((102, 111), 'django.utils.translation.ugettext_lazy', '_', (['"""Talk"""'], {}), "('Talk')\n", (103, 111), True, 'from django.utils.translation import ugettext_lazy as _\n'), ((129, 140), 'django.utils.translation.ugettext_lazy', '_', (['"""Poster"""'], {}), "('Poster')\n", (130, 140), True, 'from django.utils.transl... |
from scrapy.dupefilters import RFPDupeFilter
import redis
from crawler import redis_const
class MyDupeFilter(RFPDupeFilter):
def __init__(self, path=None, debug=False):
RFPDupeFilter.__init__(self, path=None, debug=False)
self.rclient = redis.StrictRedis(host="localhost", port=6379, db=0)
def... | [
"redis.StrictRedis",
"scrapy.dupefilters.RFPDupeFilter.__init__"
] | [((183, 235), 'scrapy.dupefilters.RFPDupeFilter.__init__', 'RFPDupeFilter.__init__', (['self'], {'path': 'None', 'debug': '(False)'}), '(self, path=None, debug=False)\n', (205, 235), False, 'from scrapy.dupefilters import RFPDupeFilter\n'), ((259, 311), 'redis.StrictRedis', 'redis.StrictRedis', ([], {'host': '"""localh... |
#!flask/bin/python
from flask import Flask, jsonify, render_template
from theoquotes import get_quotes_tq, get_authors_tq
from words import get_words_tq
import random
app = Flask(__name__)
quotes = get_quotes_tq()
authors = get_authors_tq()
words = get_words_tq()
@app.route('/')
def index():
return render_templat... | [
"flask.render_template",
"theoquotes.get_quotes_tq",
"flask.Flask",
"words.get_words_tq",
"theoquotes.get_authors_tq",
"flask.jsonify"
] | [((174, 189), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (179, 189), False, 'from flask import Flask, jsonify, render_template\n'), ((199, 214), 'theoquotes.get_quotes_tq', 'get_quotes_tq', ([], {}), '()\n', (212, 214), False, 'from theoquotes import get_quotes_tq, get_authors_tq\n'), ((225, 241), 'the... |
import functools
import typing
from django.http import HttpRequest
def do_not_track(view: typing.Callable) -> typing.Callable:
"""View decorator to disable tracking"""
@functools.wraps(view)
def untracked_view(request: HttpRequest, *args, **kwargs):
request.META["HEXA_DO_NOT_TRACK"] = "true"
... | [
"functools.wraps"
] | [((181, 202), 'functools.wraps', 'functools.wraps', (['view'], {}), '(view)\n', (196, 202), False, 'import functools\n')] |
from copy import deepcopy
from random import randint
from starkbank import Transfer
from .names.names import get_full_name
from .taxIdGenerator import generateCpf, generateCnpj
example_transfer = Transfer(
amount=10,
name="João",
tax_id="01234567890",
bank_code="01",
branch_code="0001",
accoun... | [
"random.randint",
"starkbank.Transfer",
"copy.deepcopy"
] | [((198, 318), 'starkbank.Transfer', 'Transfer', ([], {'amount': '(10)', 'name': '"""João"""', 'tax_id': '"""01234567890"""', 'bank_code': '"""01"""', 'branch_code': '"""0001"""', 'account_number': '"""10000-0"""'}), "(amount=10, name='João', tax_id='01234567890', bank_code='01',\n branch_code='0001', account_number=... |
import pickle
from socketserver import BaseRequestHandler, TCPServer, ThreadingMixIn
class Handler(BaseRequestHandler):
def handle(self):
while True:
buff = bytearray()
while not buff.endswith(b'.'):
buff += self.request.recv(256)
method, args, kwargs =... | [
"pickle.loads",
"pickle.dumps"
] | [((321, 339), 'pickle.loads', 'pickle.loads', (['buff'], {}), '(buff)\n', (333, 339), False, 'import pickle\n'), ((524, 544), 'pickle.dumps', 'pickle.dumps', (['result'], {}), '(result)\n', (536, 544), False, 'import pickle\n')] |
from anytree import NodeMixin, iterators, RenderTree
import math
def Make_Virtual():
return SwcNode(nid=-1)
def compute_platform_area(r1, r2, h):
return (r1 + r2) * h * math.pi
#to test
def compute_two_node_area(tn1, tn2, remain_dist):
"""Returns the surface area formed by two nodes
"""
r1 = tn1.... | [
"anytree.RenderTree",
"anytree.iterators.PreOrderIter",
"math.sqrt"
] | [((4528, 4562), 'anytree.iterators.PreOrderIter', 'iterators.PreOrderIter', (['self._root'], {}), '(self._root)\n', (4550, 4562), False, 'from anytree import NodeMixin, iterators, RenderTree\n'), ((6897, 6931), 'anytree.iterators.PreOrderIter', 'iterators.PreOrderIter', (['self._root'], {}), '(self._root)\n', (6919, 69... |
#!/usr/bin/env python3
#
# Copyright (c) <NAME>, 2020
# <EMAIL>
#
# SPDX-License-Identifier: MIT
#
# This module implements sore Sifu functionalities
#
import utils
import re
import os
def isUserInList(userName,userList,db):
uList = []
if type(userList) is str:
uList = [userList]
elif type(user... | [
"os.scandir",
"os.path.join",
"re.search"
] | [((1442, 1461), 're.search', 're.search', (['inRe', 'el'], {}), '(inRe, el)\n', (1451, 1461), False, 'import re\n'), ((1811, 1836), 'os.path.join', 'os.path.join', (['dirName', 'sf'], {}), '(dirName, sf)\n', (1823, 1836), False, 'import os\n'), ((1720, 1739), 'os.scandir', 'os.scandir', (['dirName'], {}), '(dirName)\n'... |
import datetime
import functools
import traceback
import pytz
from apscheduler.jobstores.memory import MemoryJobStore
from apscheduler.schedulers.asyncio import AsyncIOScheduler
job_stores = {
'default': MemoryJobStore()
}
transaction_scheduler: AsyncIOScheduler
def init_scheduler():
global transaction_sch... | [
"apscheduler.jobstores.memory.MemoryJobStore",
"functools.wraps",
"datetime.datetime.now",
"traceback.print_exc",
"datetime.timedelta",
"apscheduler.schedulers.asyncio.AsyncIOScheduler"
] | [((210, 226), 'apscheduler.jobstores.memory.MemoryJobStore', 'MemoryJobStore', ([], {}), '()\n', (224, 226), False, 'from apscheduler.jobstores.memory import MemoryJobStore\n'), ((355, 412), 'apscheduler.schedulers.asyncio.AsyncIOScheduler', 'AsyncIOScheduler', ([], {'jobstores': 'job_stores', 'timezone': 'pytz.utc'}),... |
import netCDF4
import matplotlib
import psycopg2
import numpy as np
from tqdm import tqdm
import geopandas as gpd
matplotlib.use('agg')
import matplotlib.pyplot as plt
PROJSTR = ('+proj=omerc +lat_0=37.5 +alpha=90.0 +lonc=264.0 +x_0=0. '
'+y_0=0. +ellps=sphere +a=6371229.0 +b=6371229.0 +units=m +no_defs')
... | [
"psycopg2.connect",
"matplotlib.use",
"netCDF4.Dataset",
"matplotlib.pyplot.close",
"geopandas.GeoDataFrame.from_postgis",
"geopandas.datasets.get_path",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.get_cmap"
] | [((115, 136), 'matplotlib.use', 'matplotlib.use', (['"""agg"""'], {}), "('agg')\n", (129, 136), False, 'import matplotlib\n'), ((498, 532), 'psycopg2.connect', 'psycopg2.connect', (['"""dbname=postgis"""'], {}), "('dbname=postgis')\n", (514, 532), False, 'import psycopg2\n'), ((543, 747), 'geopandas.GeoDataFrame.from_p... |
# Solution of;
# Project Euler Problem 8: Largest product in a series
# https://projecteuler.net/problem=8
#
# The four adjacent digits in the 1000-digit number that have
# the greatest product are 9 × 9 × 8 × 9 = 5832.
#
# 73167176531330624919225119674426574742355349194934
# 9698352031277450632623957831801698480186... | [
"timed.caller"
] | [((3156, 3193), 'timed.caller', 'timed.caller', (['fn_brute', 'n', 'i', 'prob_id'], {}), '(fn_brute, n, i, prob_id)\n', (3168, 3193), False, 'import timed\n')] |
def view_some_image(X,y,r_size=28,cmap="gray"):
"""
This function displays random images from the passed features.
X -> features or pixel values.
y -> target value
size -> it is the dimension of the image
cmap -> specifies color map of the image
"""
import numpy as np
import matplotlib.pyplo... | [
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.title",
"matplotlib.pyplot.axis"
] | [((431, 479), 'matplotlib.pyplot.title', 'plt.title', (['f"""Number: {y[random_index]}"""'], {'size': '(15)'}), "(f'Number: {y[random_index]}', size=15)\n", (440, 479), True, 'import matplotlib.pyplot as plt\n'), ((482, 513), 'matplotlib.pyplot.imshow', 'plt.imshow', (['rand_img'], {'cmap': 'cmap'}), '(rand_img, cmap=c... |
# Generated by Django 3.0.7 on 2021-02-05 16:10
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AU... | [
"django.db.models.TextField",
"django.db.models.IntegerField",
"django.db.models.ForeignKey",
"django.db.models.ManyToManyField",
"django.db.models.DateTimeField",
"django.db.models.SlugField",
"django.db.models.AutoField",
"django.db.models.ImageField",
"django.db.migrations.swappable_dependency",
... | [((277, 334), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (308, 334), False, 'from django.db import migrations, models\n'), ((2988, 3033), 'django.db.models.ManyToManyField', 'models.ManyToManyField', ([], {'to': '""... |
"""
created by @mrconfused
syntax :- `.song {song name}`
`.vsong {song name}`
"""
import glob
import os
from uniborg.util import admin_cmd
from userbot import catmusic, catmusicvideo
DEFAULTUSER = "𠘨 工 长 工 丅 卂"
@borg.on(admin_cmd(pattern="song( (.*)|$)", allow_sudo=True))
async def _(event):
reply_to_id... | [
"os.system",
"uniborg.util.admin_cmd",
"userbot.catmusicvideo",
"glob.glob"
] | [((839, 864), 'glob.glob', 'glob.glob', (['"""./temp/*.mp3"""'], {}), "('./temp/*.mp3')\n", (848, 864), False, 'import glob\n'), ((1528, 1560), 'os.system', 'os.system', (['"""rm -rf ./temp/*.mp3"""'], {}), "('rm -rf ./temp/*.mp3')\n", (1537, 1560), False, 'import os\n'), ((1565, 1597), 'os.system', 'os.system', (['"""... |
"""Test the TcEx Batch Module."""
# third-party
import pytest
class TestAttributes:
"""Test the TcEx Batch Module."""
@pytest.mark.parametrize(
'name,description,attr_type,attr_value,displayed,source',
[
(
'pytest-adversary-i1-001',
'Attribute Testi... | [
"pytest.mark.parametrize"
] | [((130, 326), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""name,description,attr_type,attr_value,displayed,source"""', "[('pytest-adversary-i1-001', 'Attribute Testing', 'Description', 'Pytest', \n True, 'pytest-testing')]"], {}), "(\n 'name,description,attr_type,attr_value,displayed,source', [(\n ... |
#!/usr/bin/python3
# IMPORTS
import logging
from modules import devMode
from website import create_app
# VARIABLES
app = create_app()
# MAIN
if __name__ == '__main__':
logging.basicConfig(filename='/var/log/peon/webui.log', filemode='a', format='%(asctime)s %(thread)d [%(levelname)s] - %(message)s', level=logging... | [
"logging.basicConfig",
"modules.devMode",
"website.create_app"
] | [((122, 134), 'website.create_app', 'create_app', ([], {}), '()\n', (132, 134), False, 'from website import create_app\n'), ((174, 335), 'logging.basicConfig', 'logging.basicConfig', ([], {'filename': '"""/var/log/peon/webui.log"""', 'filemode': '"""a"""', 'format': '"""%(asctime)s %(thread)d [%(levelname)s] - %(messag... |
import argparse
import asyncio
import logging
from pathlib import Path
from dvdp.ha_433 import HA433Light
from dvdp.recorder_433 import RECORDINGS_DIR, get_recordings
from dvdp.ha_mqtt.client import MQTTClient
def main():
logging.basicConfig(
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',... | [
"logging.basicConfig",
"dvdp.ha_mqtt.client.MQTTClient",
"argparse.ArgumentParser",
"dvdp.ha_433.HA433Light",
"dvdp.recorder_433.get_recordings",
"asyncio.gather",
"asyncio.get_event_loop"
] | [((229, 342), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s - %(name)s - %(levelname)s - %(message)s"""', 'level': 'logging.DEBUG'}), "(format=\n '%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.DEBUG\n )\n", (248, 342), False, 'import logging\n'), ((369, 515),... |
# django-salesforce
#
# by <NAME>
# (c) 2012-2013 Freelancers Union (http://www.freelancersunion.org)
# See LICENSE.md for details
#
"""
Salesforce object query and queryset customizations. (like django.db.models.query)
"""
import warnings
from django.db import NotSupportedError
from django.db.models import query
f... | [
"warnings.warn",
"django.db.NotSupportedError"
] | [((1612, 1706), 'warnings.warn', 'warnings.warn', (['"""Obsoleted method .simple_select_related(), use .select_related() instead"""'], {}), "(\n 'Obsoleted method .simple_select_related(), use .select_related() instead')\n", (1625, 1706), False, 'import warnings\n'), ((1510, 1608), 'django.db.NotSupportedError', 'No... |
#!/usr/bin/env python
import argparse
import os
import tempfile
from logzero import logger
from . import misc
from . import matchscores
from . import cnv_calling
from . import visualize_scores
from . import workflow_cnv_calling
from . import workflow_reassignment
from . import __version__
#: The executables require... | [
"tempfile.TemporaryDirectory",
"logzero.logger.error",
"os.makedirs",
"argparse.ArgumentParser",
"os.path.join",
"logzero.logger.info"
] | [((479, 586), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""clearCNV can compute matchscores, CNV-calls and visualizations."""'}), "(description=\n 'clearCNV can compute matchscores, CNV-calls and visualizations.')\n", (502, 586), False, 'import argparse\n'), ((25332, 25407), 'logzer... |
import random
import os
import time
import neat
import visualize
import pickle
from bareSnake import snakeGame
import numpy as np
import math
from neat.graphs import feed_forward_layers
from neat.graphs import required_for_output
import tensorflow as tf
tf.config.run_functions_eagerly(True)
import pandas as pd
df = ... | [
"pandas.read_csv",
"neat.Population",
"tensorflow.config.run_functions_eagerly",
"os.path.join",
"neat.nn.FeedForwardNetwork.create",
"numpy.argsort",
"numpy.array",
"os.path.dirname",
"neat.config.Config"
] | [((255, 292), 'tensorflow.config.run_functions_eagerly', 'tf.config.run_functions_eagerly', (['(True)'], {}), '(True)\n', (286, 292), True, 'import tensorflow as tf\n'), ((320, 348), 'pandas.read_csv', 'pd.read_csv', (['"""testData3.csv"""'], {}), "('testData3.csv')\n", (331, 348), True, 'import pandas as pd\n'), ((165... |
import sys
import os
import glob
import logging
import operator
import time
import pickle
import multiprocessing as mp
import numpy as np
from datetime import datetime
from Bio.PDB import *
import copy
import gc
# python 3 compatibility
from functools import reduce
from past.builtins import map
sys.path.append('../..... | [
"numpy.sqrt",
"numpy.array",
"pymol.finish_launching",
"copy.deepcopy",
"sys.exit",
"pymol.cmd.zoom",
"sys.path.append",
"pymol.cmd.png",
"numpy.dot",
"pymol.cmd.color",
"pymol.cmd.show",
"pickle.load",
"pymol.cmd.hide",
"os.path.isfile",
"numpy.linalg.svd",
"pymol.cmd.alignto",
"num... | [((298, 323), 'sys.path.append', 'sys.path.append', (['"""../../"""'], {}), "('../../')\n", (313, 323), False, 'import sys\n'), ((345, 373), 'sys.path.append', 'sys.path.append', (['scripts_dir'], {}), '(scripts_dir)\n', (360, 373), False, 'import sys\n'), ((629, 646), 'numpy.sqrt', 'np.sqrt', (['(rmsd / N)'], {}), '(r... |
from globals import Posts
import globals, telegram
def newPost(request, bot):
thisPost = Posts(request.values['text'], request.values['type'], [0, 0])
text = request.values['text'] + '\n\nAccept: {}, Reject:{}'.format(0,0)
post_id = request.values['id']
buttons = [[telegram.InlineKeyboardButton('Accept', callback... | [
"telegram.InlineKeyboardMarkup",
"globals.Posts"
] | [((91, 152), 'globals.Posts', 'Posts', (["request.values['text']", "request.values['type']", '[0, 0]'], {}), "(request.values['text'], request.values['type'], [0, 0])\n", (96, 152), False, 'from globals import Posts\n'), ((451, 489), 'telegram.InlineKeyboardMarkup', 'telegram.InlineKeyboardMarkup', (['buttons'], {}), '... |
from keras import backend as K
from overrides import overrides
from ..masked_layer import MaskedLayer
class CollapseToBatch(MaskedLayer):
"""
Reshapes a higher order tensor, taking the first ``num_to_collapse`` dimensions after the batch
dimension and folding them into the batch dimension. For example, ... | [
"keras.backend.reshape",
"keras.backend.shape"
] | [((3196, 3224), 'keras.backend.reshape', 'K.reshape', (['tensor', 'new_shape'], {}), '(tensor, new_shape)\n', (3205, 3224), True, 'from keras import backend as K\n'), ((3133, 3148), 'keras.backend.shape', 'K.shape', (['tensor'], {}), '(tensor)\n', (3140, 3148), True, 'from keras import backend as K\n')] |
from corehq.dbaccessors.couchapps.all_docs import \
get_all_doc_ids_for_domain_grouped_by_db, get_doc_count_by_type, \
delete_all_docs_by_doc_type
from dimagi.utils.couch.database import get_db
from django.test import TestCase
class AllDocsTest(TestCase):
@classmethod
def setUpClass(cls):
cls.... | [
"corehq.dbaccessors.couchapps.all_docs.get_all_doc_ids_for_domain_grouped_by_db",
"corehq.dbaccessors.couchapps.all_docs.delete_all_docs_by_doc_type",
"dimagi.utils.couch.database.get_db"
] | [((330, 342), 'dimagi.utils.couch.database.get_db', 'get_db', (['None'], {}), '(None)\n', (336, 342), False, 'from dimagi.utils.couch.database import get_db\n'), ((366, 381), 'dimagi.utils.couch.database.get_db', 'get_db', (['"""users"""'], {}), "('users')\n", (372, 381), False, 'from dimagi.utils.couch.database import... |
import gym
import gym_fishing
import numpy as np
from gym_fishing.models.policies import msy, escapement, user_action
def run_optimal(env_name, r=0.1, K=1, sigma=0.01):
'''
:param env_name: 'v0','v1', 'v2','v4'
:param r:
:param K:
:param sigma:
:return:
'''
if env_name != 'v4':
... | [
"gym_fishing.models.policies.msy",
"gym_fishing.models.policies.escapement",
"gym.make"
] | [((464, 472), 'gym_fishing.models.policies.msy', 'msy', (['env'], {}), '(env)\n', (467, 472), False, 'from gym_fishing.models.policies import msy, escapement, user_action\n'), ((560, 575), 'gym_fishing.models.policies.escapement', 'escapement', (['env'], {}), '(env)\n', (570, 575), False, 'from gym_fishing.models.polic... |
from pyyjj import hash_str_32
from kungfu.wingchun.constants import *
from kungfu.wingchun.utils import *
import datetime
DATE_FORMAT = "%Y%m%d"
def get_uname(instrument_id, exchange_id, direction):
return "{}.{}.{}".format(instrument_id, exchange_id, int(direction))
def get_uid(instrument_id, exchange_id, dire... | [
"datetime.datetime.strptime",
"pyyjj.hash_str_32"
] | [((400, 418), 'pyyjj.hash_str_32', 'hash_str_32', (['uname'], {}), '(uname)\n', (411, 418), False, 'from pyyjj import hash_str_32\n'), ((1122, 1180), 'datetime.datetime.strptime', 'datetime.datetime.strptime', (['self._trading_day', 'DATE_FORMAT'], {}), '(self._trading_day, DATE_FORMAT)\n', (1148, 1180), False, 'import... |
import sys
from flask import Flask, redirect
from flask.ext import admin
from flask.ext.admin.datastore.sqlalchemy import SQLAlchemyDatastore
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Bool... | [
"wtforms.fields.BooleanField",
"sqlalchemy.orm.sessionmaker",
"werkzeug.check_password_hash",
"wtforms.fields.PasswordField",
"flask.ext.admin.create_admin_blueprint",
"flask.Flask",
"wtforms.validators.required",
"sqlalchemy.create_engine",
"wtforms.validators.equal_to",
"wtforms.validators.optio... | [((580, 598), 'sqlalchemy.ext.declarative.declarative_base', 'declarative_base', ([], {}), '()\n', (596, 598), False, 'from sqlalchemy.ext.declarative import declarative_base\n'), ((656, 689), 'sqlalchemy.Column', 'Column', (['Integer'], {'primary_key': '(True)'}), '(Integer, primary_key=True)\n', (662, 689), False, 'f... |
from wsgiref.util import FileWrapper
from django.http import HttpResponseNotFound, StreamingHttpResponse
from django.urls import reverse
from django.utils.decorators import method_decorator
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_lazy
from django.views.generic import... | [
"corehq.apps.export.models.incremental.IncrementalExport.objects.filter",
"django.utils.translation.ugettext_lazy",
"corehq.apps.export.models.incremental.IncrementalExportCheckpoint.objects.get",
"corehq.apps.export.forms.IncrementalExportFormSetHelper",
"django.utils.safestring.mark_safe",
"django.urls.... | [((1235, 1270), 'django.utils.translation.ugettext_lazy', 'ugettext_lazy', (['"""Incremental Export"""'], {}), "('Incremental Export')\n", (1248, 1270), False, 'from django.utils.translation import ugettext_lazy\n'), ((1059, 1099), 'corehq.toggles.INCREMENTAL_EXPORTS.required_decorator', 'INCREMENTAL_EXPORTS.required_d... |
from django.contrib import admin
from .models import S3File
admin.site.register(S3File) | [
"django.contrib.admin.site.register"
] | [((62, 89), 'django.contrib.admin.site.register', 'admin.site.register', (['S3File'], {}), '(S3File)\n', (81, 89), False, 'from django.contrib import admin\n')] |
"""Test the shef_currents service."""
from fastapi.testclient import TestClient
from iemws.main import app
client = TestClient(app)
def test_basic():
"""Test that we can walk."""
params = {
"pe": "TA",
"duration": "D",
}
req = client.get("/shef_currents.json", params=params)
ass... | [
"fastapi.testclient.TestClient"
] | [((119, 134), 'fastapi.testclient.TestClient', 'TestClient', (['app'], {}), '(app)\n', (129, 134), False, 'from fastapi.testclient import TestClient\n')] |
import csv
import numpy as np
def getDataSource(data_path):
coffee_in_ml = []
sleep_in_hours = []
with open(data_path) as csv_file:
csv_reader = csv.DictReader(csv_file)
for row in csv_reader:
coffee_in_ml.append(float(row["Coffee in ml"]))
sleep_in_hours... | [
"csv.DictReader",
"numpy.corrcoef"
] | [((469, 514), 'numpy.corrcoef', 'np.corrcoef', (["datasource['x']", "datasource['y']"], {}), "(datasource['x'], datasource['y'])\n", (480, 514), True, 'import numpy as np\n'), ((175, 199), 'csv.DictReader', 'csv.DictReader', (['csv_file'], {}), '(csv_file)\n', (189, 199), False, 'import csv\n')] |
#scroll down for example
import socket
from threading import Thread, Lock
import sys
lock = Lock()
host = socket.gethostbyname(socket.gethostname())
serversocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
clients = {}
addresses = {}
client_messages = {}
client_threads = []
server_messa... | [
"socket.socket",
"threading.Lock",
"sys.exit",
"threading.Thread",
"socket.gethostname"
] | [((100, 106), 'threading.Lock', 'Lock', ([], {}), '()\n', (104, 106), False, 'from threading import Thread, Lock\n'), ((176, 225), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_STREAM'], {}), '(socket.AF_INET, socket.SOCK_STREAM)\n', (189, 225), False, 'import socket\n'), ((2642, 2691), 'socket.soc... |
# MIT License
#
# Copyright (c) 2020 <NAME> <<EMAIL>>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, me... | [
"datetime.datetime.today",
"datetime.timedelta"
] | [((1533, 1549), 'datetime.datetime.today', 'datetime.today', ([], {}), '()\n', (1547, 1549), False, 'from datetime import datetime, timedelta\n'), ((2405, 2448), 'datetime.timedelta', 'timedelta', ([], {'days': 'days', 'seconds': 'remainSeconds'}), '(days=days, seconds=remainSeconds)\n', (2414, 2448), False, 'from date... |
from __future__ import print_function
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim as optim
import torch.utils.data
import torchvision.datasets as dset
import torchvision.transforms as transforms
import torchvision.utils as vutils
from torchvision.u... | [
"numpy.array",
"torch.cuda.is_available",
"torchvision.utils.make_grid",
"numpy.save",
"argparse.ArgumentParser",
"shutil.copy2",
"torch.set_default_tensor_type",
"matplotlib.pyplot.close",
"torchvision.transforms.ToTensor",
"torch.autograd.Variable",
"random.randint",
"matplotlib.pyplot.savef... | [((539, 560), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (553, 560), False, 'import matplotlib\n'), ((740, 765), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (763, 765), False, 'import argparse\n'), ((4317, 4369), 'utils.Logger', 'Logger', (["(opt.experiment + '/log... |
# Set the debug flags to True when testing dicod.
import os
TESTING_DICOD = os.environ.get("TESTING_DICOD", "0") == "1"
# Start interactive child processes when set to True
INTERACTIVE_PROCESSES = False
# If set to True, check that inactive segments do not have any coefficient
# with update over tol.
CHECK_ACTIVE_S... | [
"os.environ.get"
] | [((77, 113), 'os.environ.get', 'os.environ.get', (['"""TESTING_DICOD"""', '"""0"""'], {}), "('TESTING_DICOD', '0')\n", (91, 113), False, 'import os\n')] |
#!/usr/bin/python
import csv
import sys
with open("input.txt") as tsv:
checksum = 0
for line in csv.reader(tsv, dialect="excel-tab"): #You can also use delimiter="\t" rather than giving a dialect.
lineLargest = 0
lineSmallest = sys.maxint
for valueString in line:
value = in... | [
"csv.reader"
] | [((106, 142), 'csv.reader', 'csv.reader', (['tsv'], {'dialect': '"""excel-tab"""'}), "(tsv, dialect='excel-tab')\n", (116, 142), False, 'import csv\n')] |
# -*- coding: utf-8 -*-
"""Test user registration endpoint."""
from flask import url_for
from servicedesk.user.models import User
from tests.factories import UserFactory
def test_can_register(user, testapp):
"""Register a new user."""
old_count = len(User.query.all())
# Goes to homepage
res = testapp... | [
"tests.factories.UserFactory",
"servicedesk.user.models.User.query.all",
"flask.url_for"
] | [((1409, 1433), 'tests.factories.UserFactory', 'UserFactory', ([], {'active': '(True)'}), '(active=True)\n', (1420, 1433), False, 'from tests.factories import UserFactory\n'), ((262, 278), 'servicedesk.user.models.User.query.all', 'User.query.all', ([], {}), '()\n', (276, 278), False, 'from servicedesk.user.models impo... |
"""Module for managing a notification via KNX."""
from xknx.exceptions import CouldNotParseTelegram
from xknx.knx import DPTArray, DPTString, GroupAddress
from .device import Device
class Notification(Device):
"""Class for managing a notification."""
def __init__(self,
xknx,
... | [
"xknx.exceptions.CouldNotParseTelegram",
"xknx.knx.DPTString",
"xknx.knx.GroupAddress"
] | [((674, 701), 'xknx.knx.GroupAddress', 'GroupAddress', (['group_address'], {}), '(group_address)\n', (686, 701), False, 'from xknx.knx import DPTArray, DPTString, GroupAddress\n'), ((792, 825), 'xknx.knx.GroupAddress', 'GroupAddress', (['group_address_state'], {}), '(group_address_state)\n', (804, 825), False, 'from xk... |
# -*- coding: utf-8 -*-
"""Add docstring."""
import pandas as pd
from electricitylci.coal_upstream import read_eia923_fuel_receipts
from os.path import join
from electricitylci.globals import data_dir, output_dir
import electricitylci.PhysicalQuantities as pq
import electricitylci.eia923_generation as eia923
import ... | [
"logging.getLogger",
"pandas.Series",
"pandas.read_csv",
"os.path.join",
"electricitylci.PhysicalQuantities.convert",
"electricitylci.coal_upstream.read_eia923_fuel_receipts",
"pandas.ExcelFile",
"pandas.concat",
"electricitylci.eia923_generation.eia923_generation_and_fuel"
] | [((343, 385), 'logging.getLogger', 'logging.getLogger', (['"""petroleum_upstream.py"""'], {}), "('petroleum_upstream.py')\n", (360, 385), False, 'import logging\n'), ((721, 752), 'electricitylci.coal_upstream.read_eia923_fuel_receipts', 'read_eia923_fuel_receipts', (['year'], {}), '(year)\n', (746, 752), False, 'from e... |
from typing import List
import pytest
from didcomm.common.types import DID_URL
from didcomm.core.keys.authcrypt_keys_selector import (
find_authcrypt_pack_sender_and_recipient_keys,
AuthcryptPackKeys,
find_authcrypt_unpack_sender_and_recipient_keys,
AuthcryptUnpackKeys,
)
from didcomm.did_doc.did_doc ... | [
"tests.test_vectors.utils.get_key_agreement_methods_in_secrets",
"didcomm.core.keys.authcrypt_keys_selector.AuthcryptUnpackKeys",
"tests.test_vectors.utils.get_key_agreement_methods_not_in_secrets",
"tests.test_vectors.utils.get_key_agreement_methods",
"didcomm.core.keys.authcrypt_keys_selector.find_authcry... | [((1362, 1491), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""curve_type"""', '[KeyAgreementCurveType.X25519, KeyAgreementCurveType.P256,\n KeyAgreementCurveType.P521]'], {}), "('curve_type', [KeyAgreementCurveType.X25519,\n KeyAgreementCurveType.P256, KeyAgreementCurveType.P521])\n", (1385, 1491), ... |
import numpy as np
import fvcore.nn.weight_init as weight_init
import torch.nn.functional as F
from torch import nn
import torch
from torch.nn.modules.utils import _pair
from detectron2.layers import CNNBlockBase,ShapeSpec,Conv2d,get_norm,FrozenBatchNorm2d
from detectron2.layers.deform_conv import deform_conv
from de... | [
"torch.nn.ReLU",
"torch.nn.Dropout",
"torch.nn.init.constant_",
"detectron2.layers.Conv2d",
"torch.nn.Sequential",
"detectron2.layers.ShapeSpec",
"detectron2.modeling.BACKBONE_REGISTRY.register",
"detectron2.layers.deform_conv.deform_conv",
"torch.Tensor",
"torch.nn.functional.avg_pool2d",
"torc... | [((9035, 9063), 'detectron2.modeling.BACKBONE_REGISTRY.register', 'BACKBONE_REGISTRY.register', ([], {}), '()\n', (9061, 9063), False, 'from detectron2.modeling import Backbone, BACKBONE_REGISTRY\n'), ((1199, 1247), 'detectron2.layers.FrozenBatchNorm2d.convert_frozen_batchnorm', 'FrozenBatchNorm2d.convert_frozen_batchn... |
#!/usr/bin/env python3
import rospy
from tbd_audio_msgs.msg import (
AudioDataStamped,
VADStamped
)
import webrtcvad
class WebRTCVadNode:
def __init__(self):
self._vad = webrtcvad.Vad()
self._aggressiveness = rospy.get_param('~aggressiveness', 3)
self._vad.set_mode(self._aggress... | [
"rospy.Subscriber",
"rospy.logwarn",
"rospy.init_node",
"rospy.get_param",
"tbd_audio_msgs.msg.VADStamped",
"rospy.spin",
"rospy.get_name",
"webrtcvad.Vad",
"rospy.Publisher"
] | [((1159, 1186), 'rospy.init_node', 'rospy.init_node', (['"""vad_node"""'], {}), "('vad_node')\n", (1174, 1186), False, 'import rospy\n'), ((1217, 1229), 'rospy.spin', 'rospy.spin', ([], {}), '()\n', (1227, 1229), False, 'import rospy\n'), ((194, 209), 'webrtcvad.Vad', 'webrtcvad.Vad', ([], {}), '()\n', (207, 209), Fals... |
import os
import json
import re
# Getting dictionary paths
file_path = os.getcwd()
dict_path = file_path + "\Dictionaries\大辞林"
# dict_path = file_path + "\Dictionaries\jmdict_english"
# Creates a list of the dictionary files, fixing the order
def get_file_list(path):
arr = os.listdir(path)
arr2 = ... | [
"json.load",
"os.listdir",
"os.getcwd"
] | [((77, 88), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (86, 88), False, 'import os\n'), ((291, 307), 'os.listdir', 'os.listdir', (['path'], {}), '(path)\n', (301, 307), False, 'import os\n'), ((722, 737), 'json.load', 'json.load', (['file'], {}), '(file)\n', (731, 737), False, 'import json\n')] |
import re
import sys
with open('README.md') as f:
data = f.read()
print(re.sub(
r'\n>>> \n>>> # (.*)\n',
r'\n```\n- \1\n```python\n',
sys.stdin.read(),
))
| [
"sys.stdin.read"
] | [((152, 168), 'sys.stdin.read', 'sys.stdin.read', ([], {}), '()\n', (166, 168), False, 'import sys\n')] |
import numpy as np
import logging
import time
from stereovis.framed.algorithms import StereoMRF
from spinn_utilities.progress_bar import ProgressBar
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
logger = logging.getLogger(__file__)
class FramebasedStereoMatching(object):
def __init__(... | [
"logging.getLogger",
"matplotlib.use",
"numpy.searchsorted",
"numpy.asarray",
"spinn_utilities.progress_bar.ProgressBar",
"stereovis.framed.algorithms.StereoMRF",
"time.time"
] | [((168, 189), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (182, 189), False, 'import matplotlib\n'), ((233, 260), 'logging.getLogger', 'logging.getLogger', (['__file__'], {}), '(__file__)\n', (250, 260), False, 'import logging\n'), ((1364, 1393), 'numpy.asarray', 'np.asarray', (['self.depth_fr... |
from docker.errors import DockerException, ImageNotFound
from pytest import raises
from yellowbox import build_image
def test_valid_image_build(docker_client):
with build_image(docker_client, "yellowbox", path=".", dockerfile="tests/resources/valid_dockerfile/Dockerfile") \
as image:
containe... | [
"yellowbox.build_image",
"pytest.raises"
] | [((172, 284), 'yellowbox.build_image', 'build_image', (['docker_client', '"""yellowbox"""'], {'path': '"""."""', 'dockerfile': '"""tests/resources/valid_dockerfile/Dockerfile"""'}), "(docker_client, 'yellowbox', path='.', dockerfile=\n 'tests/resources/valid_dockerfile/Dockerfile')\n", (183, 284), False, 'from yello... |
from __future__ import print_function
import os
import sys
import time
import argparse
import numpy as np
import xml.dom.minidom as xdom
from os.path import realpath, join, isdir, isfile, dirname, splitext
from ..core.environ import environ
U_ROOT = u"SimulationData"
U_JOB = u"job"
U_DATE = u"date"
U_EVAL = u"Evaluati... | [
"xml.dom.minidom.parse",
"matplotlib.pyplot.savefig",
"argparse.ArgumentParser",
"numpy.corrcoef",
"numpy.polyfit",
"numpy.delete",
"matplotlib.pyplot.clf",
"os.path.splitext",
"numpy.argsort",
"numpy.array",
"bokeh.plotting.gridplot",
"os.path.realpath",
"os.path.dirname",
"os.path.isfile... | [((3815, 3835), 'xml.dom.minidom.parse', 'xdom.parse', (['filepath'], {}), '(filepath)\n', (3825, 3835), True, 'import xml.dom.minidom as xdom\n'), ((5415, 5429), 'numpy.array', 'np.array', (['data'], {}), '(data)\n', (5423, 5429), True, 'import numpy as np\n'), ((6756, 6769), 'numpy.argsort', 'np.argsort', (['y'], {})... |
import attr
@attr.s
class Ellipsoid:
"""Ellipsoid used for mesh calculations
Args:
a (float): semi-major axis
b (float): semi-minor axis
"""
a: float = attr.ib()
b: float = attr.ib()
e2: float = attr.ib(init=False)
def __attrs_post_init__(self):
self.e2 = 1 - (se... | [
"attr.ib"
] | [((188, 197), 'attr.ib', 'attr.ib', ([], {}), '()\n', (195, 197), False, 'import attr\n'), ((213, 222), 'attr.ib', 'attr.ib', ([], {}), '()\n', (220, 222), False, 'import attr\n'), ((239, 258), 'attr.ib', 'attr.ib', ([], {'init': '(False)'}), '(init=False)\n', (246, 258), False, 'import attr\n')] |
import time
a=open("1.txt","r+",errors='ignore')
b=a.read()
c=''
for x in b:
if x=='\n':
print(c)
time.sleep(.5)
c=''
else:
c+=x
if 'color' in c:
print ("Yes")
a.close()
| [
"time.sleep"
] | [((118, 133), 'time.sleep', 'time.sleep', (['(0.5)'], {}), '(0.5)\n', (128, 133), False, 'import time\n')] |
'''
This code will produce a porkchop plot of the J function over a range of launch times and flight times
'''
import math
import numpy
import PyKEP as pk
import matplotlib.pyplot as plt
import Vector
p1 = pk.planet.jpl_lp('earth')
p2 = pk.planet.mpcorb('99942 19.2 0.15 K107N 202.49545 126.41859 204.43202 3.3... | [
"PyKEP.planet.mpcorb",
"matplotlib.pyplot.colorbar",
"PyKEP.planet.jpl_lp",
"matplotlib.pyplot.figure",
"numpy.linspace",
"numpy.isnan",
"PyKEP.epoch",
"numpy.nanmax",
"numpy.nanmin",
"numpy.meshgrid",
"math.exp",
"PyKEP.lambert_exposin",
"matplotlib.pyplot.show"
] | [((207, 232), 'PyKEP.planet.jpl_lp', 'pk.planet.jpl_lp', (['"""earth"""'], {}), "('earth')\n", (223, 232), True, 'import PyKEP as pk\n'), ((238, 470), 'PyKEP.planet.mpcorb', 'pk.planet.mpcorb', (['"""99942 19.2 0.15 K107N 202.49545 126.41859 204.43202 3.33173 0.1911104 1.11267324 0.9223398 1 MPO164109 13... |
import os
import sys
import click
import logging
from . import get_rezup_version, __version__
from .container import Container, iter_containers
_default_cname = Container.DEFAULT_NAME
_log = logging.getLogger("rezup")
def _disable_rezup_if_entered(ctx):
_con = os.getenv("REZUP_CONTAINER")
if _con:
... | [
"logging.getLogger",
"click.argument",
"os.getenv",
"click.option",
"click.group",
"click.help_option",
"sys.argv.index",
"urllib.urlopen"
] | [((194, 220), 'logging.getLogger', 'logging.getLogger', (['"""rezup"""'], {}), "('rezup')\n", (211, 220), False, 'import logging\n'), ((1556, 1724), 'click.option', 'click.option', (['"""-D"""', '"""--debug"""'], {'help': '"""Show debug level logging messages."""', 'is_eager': '(True)', 'is_flag': '(True)', 'expose_val... |
import numpy as np
import scipy.constants as c
import math, cmath
from sympy import *
from math import e
import numba
from numba import jit
import sympy as sp
r, x, a, theta = symbols('r x a theta')
init_printing(use_unicode=True)
@jit(nopython=True, cache=True, parallel=True)
def spherical_to_cartesian(r, theta, phi)... | [
"math.factorial",
"math.sqrt",
"numpy.array",
"cmath.exp",
"numba.jit",
"numpy.linspace",
"numpy.cos",
"numpy.sin",
"numpy.meshgrid",
"numpy.vectorize",
"numpy.round",
"numpy.arctan"
] | [((233, 278), 'numba.jit', 'jit', ([], {'nopython': '(True)', 'cache': '(True)', 'parallel': '(True)'}), '(nopython=True, cache=True, parallel=True)\n', (236, 278), False, 'from numba import jit\n'), ((449, 494), 'numba.jit', 'jit', ([], {'nopython': '(True)', 'cache': '(True)', 'parallel': '(True)'}), '(nopython=True,... |
import decimal
from flask import Flask, request
from flask.json import dumps
from piecewise.aggregate import AverageRTT
from piecewise.config import parse_date
from piecewise.query import query
from sqlalchemy import create_engine, select, MetaData, Table, Column, String, Integer
import StringIO
import csv
app = Flask(... | [
"StringIO.StringIO",
"flask.request.args.get",
"json.loads",
"flask.Flask",
"logging.handlers.RotatingFileHandler",
"flask.request.args.iteritems",
"csv.writer",
"piecewise.query.query",
"flask.json.dumps"
] | [((314, 329), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (319, 329), False, 'from flask import Flask, request\n'), ((409, 522), 'logging.handlers.RotatingFileHandler', 'logging.handlers.RotatingFileHandler', (['"""/var/log/piecewise/wsgi.log"""'], {'maxBytes': '(10 * 1000 * 1000)', 'backupCount': '(5)'... |
## Bootstrapped from https://github.com/cfld/locusts
import os
import random
import backoff
import rasterio
import ee
ee.Initialize()
from polygon_geohasher.polygon_geohasher import geohash_to_polygon, polygon_to_geohashes
from shapely import geometry
import urllib
from urllib.request import urlretrieve
import numpy ... | [
"os.makedirs",
"urllib.request.urlretrieve",
"numpy.random.choice",
"rasterio.open",
"os.path.join",
"ee.ImageCollection",
"shapely.geometry.mapping",
"backoff.on_exception",
"scipy.spatial.ConvexHull",
"numpy.array",
"shapely.geometry.Polygon",
"polygon_geohasher.polygon_geohasher.geohash_to_... | [((120, 135), 'ee.Initialize', 'ee.Initialize', ([], {}), '()\n', (133, 135), False, 'import ee\n'), ((849, 940), 'backoff.on_exception', 'backoff.on_exception', (['backoff.constant', 'urllib.error.HTTPError'], {'max_tries': '(4)', 'interval': '(2)'}), '(backoff.constant, urllib.error.HTTPError, max_tries=4,\n inter... |
#!python3
# -*- coding: utf-8 -*-
import urllib.request
import ssl
import json
context = ssl._create_unverified_context()
resp = urllib.request.urlopen('https://www.livenewsnow.com/wp-json/wp/v2/pages?per_page=10', context=context)
pages = json.load(resp)
print('no of pages=', len(pages))
for page in pages:
# prin... | [
"json.load",
"ssl._create_unverified_context"
] | [((90, 122), 'ssl._create_unverified_context', 'ssl._create_unverified_context', ([], {}), '()\n', (120, 122), False, 'import ssl\n'), ((242, 257), 'json.load', 'json.load', (['resp'], {}), '(resp)\n', (251, 257), False, 'import json\n'), ((550, 565), 'json.load', 'json.load', (['resp'], {}), '(resp)\n', (559, 565), Fa... |
import os
from pathlib import Path
from enum import Enum
import yaml
from lib.model import DotDict
BASE_DIR = Path(os.path.dirname(os.path.abspath(__file__)))
class ResultType(Enum):
TIME = 'time'
POINTS = 'points'
class CompetitionType(Enum):
SINGLE = 'single'
RACE = 'race'
TOURNAMENT = 'tou... | [
"os.path.abspath",
"lib.model.DotDict",
"yaml.load"
] | [((134, 159), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (149, 159), False, 'import os\n'), ((443, 455), 'yaml.load', 'yaml.load', (['f'], {}), '(f)\n', (452, 455), False, 'import yaml\n'), ((533, 547), 'lib.model.DotDict', 'DotDict', (['sport'], {}), '(sport)\n', (540, 547), False, 'from... |
from threading import Thread, Timer, Condition
import time
import random
import traceback
import animations
DITHER_CEIL=173
class ImageManager:
def __init__(self):
self.gamma = bytearray(256)
for i in range(256):
if i>0 and i<28:
self.gamma[i] = 0x81
else:
... | [
"threading.Thread.__init__",
"traceback.format_exc",
"threading.Timer",
"animations.getAnimator",
"time.sleep",
"threading.Condition"
] | [((4324, 4376), 'animations.getAnimator', 'animations.getAnimator', (['animationName', 'self.STRIPLEN'], {}), '(animationName, self.STRIPLEN)\n', (4346, 4376), False, 'import animations\n'), ((5851, 5872), 'threading.Thread.__init__', 'Thread.__init__', (['self'], {}), '(self)\n', (5866, 5872), False, 'from threading i... |