repo_name
stringlengths
7
94
repo_path
stringlengths
4
237
repo_head_hexsha
stringlengths
40
40
content
stringlengths
10
680k
apis
stringlengths
2
680k
NHGmaniac/voctoconfig
playground.py
55a803a5f9bc81b48eaa72ced1fddd402aa7a2e9
#!/usr/bin/env python3 import signal import logging import sys from gi.repository import GObject GObject.threads_init() import time from lib.args import Args from lib.loghandler import LogHandler import lib.connection as Connection def testCallback(args): log = logging.getLogger("Test") log.info(str(args...
[((102, 124), 'gi.repository.GObject.threads_init', 'GObject.threads_init', ([], {}), '()\n', (122, 124), False, 'from gi.repository import GObject\n'), ((273, 298), 'logging.getLogger', 'logging.getLogger', (['"""Test"""'], {}), "('Test')\n", (290, 298), False, 'import logging\n'), ((982, 1017), 'lib.loghandler.LogHan...
Aceticia/tianshou
tianshou/utils/logger/tensorboard.py
6377dc5006ba1111adac42472447b9de4a021c2d
import warnings from typing import Any, Callable, Optional, Tuple from tensorboard.backend.event_processing import event_accumulator from torch.utils.tensorboard import SummaryWriter from tianshou.utils.logger.base import LOG_DATA_TYPE, BaseLogger class TensorboardLogger(BaseLogger): """A logger that relies on ...
[((2143, 2198), 'tensorboard.backend.event_processing.event_accumulator.EventAccumulator', 'event_accumulator.EventAccumulator', (['self.writer.log_dir'], {}), '(self.writer.log_dir)\n', (2177, 2198), False, 'from tensorboard.backend.event_processing import event_accumulator\n'), ((3068, 3160), 'warnings.warn', 'warnin...
InsightGit/JetfuelGameEngine
PythonAPI/pythonwrappers/jetfuel/gui/menu.py
3ea0bf2fb5e09aadf304b7b5a16882d72336c408
# Jetfuel Game Engine- A SDL-based 2D game-engine # Copyright (C) 2018 InfernoStudios # # 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...
[((3591, 3613), 'jetfuel.draw.image.image', 'image', (['jetfuelsoloader'], {}), '(jetfuelsoloader)\n', (3596, 3613), False, 'from jetfuel.draw.image import image\n')]
ParikhKadam/google-research
latent_programmer/decomposition_transformer_attention/train.py
00a282388e389e09ce29109eb050491c96cfab85
# coding=utf-8 # Copyright 2021 The Google Research Authors. # # 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 applicab...
[((1590, 1615), 'sys.path.append', 'sys.path.append', (['"""../../"""'], {}), "('../../')\n", (1605, 1615), False, 'import sys\n'), ((1658, 1724), 'absl.flags.DEFINE_integer', 'flags.DEFINE_integer', (['"""seed"""', '(0)', '"""Fixed random seed for training."""'], {}), "('seed', 0, 'Fixed random seed for training.')\n"...
ziyixi/SeisScripts
plot/profile_interpolation/plot_profile.py
a484bc1747eae52b2441f0bfd47ac7e093150f1d
import matplotlib.pyplot as plt import numpy as np import pandas as pd import click import numba def prepare_data(data_pd, parameter): lon_set = set(data_pd["lon"]) lat_set = set(data_pd["lat"]) dep_set = set(data_pd["dep"]) lon_list = sorted(lon_set) lat_list = sorted(lat_set) dep_list = sor...
[((1443, 1455), 'numba.njit', 'numba.njit', ([], {}), '()\n', (1453, 1455), False, 'import numba\n'), ((1691, 1703), 'numba.njit', 'numba.njit', ([], {}), '()\n', (1701, 1703), False, 'import numba\n'), ((1753, 1765), 'numba.njit', 'numba.njit', ([], {}), '()\n', (1763, 1765), False, 'import numba\n'), ((2009, 2021), '...
edpaget/flask-appconfig
tests/test_heroku.py
5264719ac9229339070b219a4358a3203ffd05b0
from flask import Flask from flask_appconfig import HerokuConfig def create_sample_app(): app = Flask('testapp') HerokuConfig(app) return app def test_herokupostgres(monkeypatch): monkeypatch.setenv('HEROKU_POSTGRESQL_ORANGE_URL', 'heroku-db-uri') app = create_sample_app() assert app.config...
[((102, 118), 'flask.Flask', 'Flask', (['"""testapp"""'], {}), "('testapp')\n", (107, 118), False, 'from flask import Flask\n'), ((123, 140), 'flask_appconfig.HerokuConfig', 'HerokuConfig', (['app'], {}), '(app)\n', (135, 140), False, 'from flask_appconfig import HerokuConfig\n')]
Dev-Jahn/cms
flask/util/logger.py
84ea115bdb865daff83d069502f6f0dd105fc4f0
import logging """ Formatter """ formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s', datefmt='%Y-%m-%d:%H:%M:%S') """ Set Flask logger """ logger = logging.getLogger('FLASK_LOG') logger.setLevel(logging.DEBUG) stream_log = logging.StreamHandler() stream_log.setFormatter(form...
[((50, 156), 'logging.Formatter', 'logging.Formatter', (['"""%(asctime)s - %(name)s - %(levelname)s - %(message)s"""'], {'datefmt': '"""%Y-%m-%d:%H:%M:%S"""'}), "('%(asctime)s - %(name)s - %(levelname)s - %(message)s',\n datefmt='%Y-%m-%d:%H:%M:%S')\n", (67, 156), False, 'import logging\n'), ((193, 223), 'logging.ge...
Krovatkin/NewsBlur
utils/backups/backup_psql.py
2a5b52984c9d29c864eb80e9c60c658b1f25f7c5
#!/usr/bin/python3 import os import sys import socket CURRENT_DIR = os.path.dirname(__file__) NEWSBLUR_DIR = ''.join([CURRENT_DIR, '/../../']) sys.path.insert(0, NEWSBLUR_DIR) os.environ['DJANGO_SETTINGS_MODULE'] = 'newsblur_web.settings' import threading class ProgressPercentage(object): def __init__(self, fil...
[((69, 94), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (84, 94), False, 'import os\n'), ((144, 176), 'sys.path.insert', 'sys.path.insert', (['(0)', 'NEWSBLUR_DIR'], {}), '(0, NEWSBLUR_DIR)\n', (159, 176), False, 'import sys\n'), ((1037, 1143), 'boto3.client', 'boto3.client', (['"""s3"""']...
Orange-OpenSource/xtesting-onap-tests
onap_tests/scenario/solution.py
ce4237f49089a91c81f5fad552f78fec384fd504
#!/usr/bin/python # # This program and the accompanying materials # are made available under the terms of the Apache License, Version 2.0 # which accompanies this distribution, and is available at # # http://www.apache.org/licenses/LICENSE-2.0 # # pylint: disable=missing-docstring # pylint: disable=duplicate-c...
[((620, 658), 'onap_tests.utils.utils.get_config', 'onap_utils.get_config', (['"""general.proxy"""'], {}), "('general.proxy')\n", (641, 658), True, 'import onap_tests.utils.utils as onap_utils\n'), ((950, 977), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (967, 977), False, 'import logg...
dominic-dev/pyformsd
tutorials/Controls4Docs/ControlEventsGraph.py
23e31ceff2943bc0f7286d25dd14450a14b986af
#!/usr/bin/python # -*- coding: utf-8 -*- __author__ = "Ricardo Ribeiro" __credits__ = ["Ricardo Ribeiro"] __license__ = "MIT" __version__ = "0.0" __maintainer__ = "Ricardo Ribeiro" __email__ = "ricardojvr@gmail.com" __status__ = "Development" from __init__ import * import random, time f...
[((1188, 1199), 'time.time', 'time.time', ([], {}), '()\n', (1197, 1199), False, 'import random, time\n'), ((2379, 2390), 'time.time', 'time.time', ([], {}), '()\n', (2388, 2390), False, 'import random, time\n'), ((2404, 2428), 'PyQt4.QtCore.QTimer', 'QtCore.QTimer', (['self.form'], {}), '(self.form)\n', (2417, 2428), ...
lioncorpo/sfm.lion-judge-corporation
annotation_gui_gcp/orthophoto_view.py
95fb11bff263c3faab62269cc907eec18b527e22
from typing import Tuple import numpy as np import rasterio.warp from opensfm import features from .orthophoto_manager import OrthoPhotoManager from .view import View class OrthoPhotoView(View): def __init__( self, main_ui, path: str, init_lat: float, init_lon: float, ...
[((3748, 3761), 'numpy.mean', 'np.mean', (['xlim'], {}), '(xlim)\n', (3755, 3761), True, 'import numpy as np\n'), ((3763, 3776), 'numpy.mean', 'np.mean', (['ylim'], {}), '(ylim)\n', (3770, 3776), True, 'import numpy as np\n'), ((2286, 2304), 'numpy.array', 'np.array', (['[[x, y]]'], {}), '([[x, y]])\n', (2294, 2304), T...
mail2nsrajesh/tempest
tempest/tests/lib/services/compute/test_security_group_default_rules_client.py
1a3b3dc50b418d3a15839830d7d1ff88c8c76cff
# Copyright 2015 NEC Corporation. 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 ...
[((1162, 1199), 'tempest.tests.lib.fake_auth_provider.FakeAuthProvider', 'fake_auth_provider.FakeAuthProvider', ([], {}), '()\n', (1197, 1199), False, 'from tempest.tests.lib import fake_auth_provider\n'), ((1223, 1329), 'tempest.lib.services.compute.security_group_default_rules_client.SecurityGroupDefaultRulesClient',...
itsyaboyrocket/pirates
pirates/leveleditor/worldData/interior_spanish_npc_b.py
6ca1e7d571c670b0d976f65e608235707b5737e3
# uncompyle6 version 3.2.0 # Python bytecode 2.4 (62061) # Decompiled from: Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:19:30) [MSC v.1500 32 bit (Intel)] # Embedded file name: pirates.leveleditor.worldData.interior_spanish_npc_b from pandac.PandaModules import Point3, VBase3, Vec4, Vec3 objectStruct = {'Objects...
[((29376, 29393), 'pandac.PandaModules.Point3', 'Point3', (['(0)', '(-14)', '(0)'], {}), '(0, -14, 0)\n', (29382, 29393), False, 'from pandac.PandaModules import Point3, VBase3, Vec4, Vec3\n'), ((29405, 29420), 'pandac.PandaModules.VBase3', 'VBase3', (['(0)', '(0)', '(0)'], {}), '(0, 0, 0)\n', (29411, 29420), False, 'f...
Light-Lens/PassGen
main.py
8f4f2ef08299d6243b939d0f08ac75bde3cabf5e
# PassGen # These imports will be used for this project. from colorama import Fore, Style from colorama import init import datetime import string import random import sys import os # Initilaze File organizer. os.system('title PassGen') init(autoreset = True) # Create Log Functions. class LOG: def INF...
[((221, 247), 'os.system', 'os.system', (['"""title PassGen"""'], {}), "('title PassGen')\n", (230, 247), False, 'import os\n'), ((249, 269), 'colorama.init', 'init', ([], {'autoreset': '(True)'}), '(autoreset=True)\n', (253, 269), False, 'from colorama import init\n'), ((1796, 1806), 'sys.exit', 'sys.exit', ([], {}), ...
iotexpert/docmgr
memos/memos/models/Memo.py
735c7bcbaeb73bc44efecffb175f268f2438ac3a
""" The model file for a Memo """ import re import os import shutil import json from datetime import datetime from flask import current_app from memos import db from memos.models.User import User from memos.models.MemoState import MemoState from memos.models.MemoFile import MemoFile from memos.models.MemoSignature i...
[((661, 700), 'memos.db.Column', 'db.Column', (['db.Integer'], {'primary_key': '(True)'}), '(db.Integer, primary_key=True)\n', (670, 700), False, 'from memos import db\n'), ((714, 735), 'memos.db.Column', 'db.Column', (['db.Integer'], {}), '(db.Integer)\n', (723, 735), False, 'from memos import db\n'), ((801, 821), 'me...
mitodl/open-discussions
course_catalog/etl/conftest.py
ab6e9fac70b8a1222a84e78ba778a7a065c20541
"""Common ETL test fixtures""" import json import pytest @pytest.fixture(autouse=True) def mitx_settings(settings): """Test settings for MITx import""" settings.EDX_API_CLIENT_ID = "fake-client-id" settings.EDX_API_CLIENT_SECRET = "fake-client-secret" settings.EDX_API_ACCESS_TOKEN_URL = "http://local...
[((61, 89), 'pytest.fixture', 'pytest.fixture', ([], {'autouse': '(True)'}), '(autouse=True)\n', (75, 89), False, 'import pytest\n'), ((552, 580), 'pytest.fixture', 'pytest.fixture', ([], {'autouse': '(True)'}), '(autouse=True)\n', (566, 580), False, 'import pytest\n')]
PageotD/juliaset
juliaset/juliaset.py
7c1f98020eeff291fcf040cfcdf25a89e72f46a9
import numpy as np import matplotlib.pyplot as plt import matplotlib.cm as cm import random class JuliaSet: def __init__(self): """ Constructor of the JuliaSet class :param size: size in pixels (for both width and height) :param dpi: dots per inch (default 300) """ ...
[((3661, 3683), 'random.choice', 'random.choice', (['cpxList'], {}), '(cpxList)\n', (3674, 3683), False, 'import random\n'), ((4146, 4172), 'random.randrange', 'random.randrange', (['(-1)', '(1)', '(2)'], {}), '(-1, 1, 2)\n', (4162, 4172), False, 'import random\n'), ((4374, 4400), 'random.uniform', 'random.uniform', ([...
ShivanS93/VAtest_withOKN
eye_detection.py
8da76f4c3ff526c9e16268194accfdc6221b0a66
#!python3 # eye_detection.py - detect eyes using webcam # tutorial: https://www.roytuts.com/real-time-eye-detection-in-webcam-using-python-3/ import cv2 import math import numpy as np def main(): faceCascade = cv2.CascadeClassifier("haarcascade_frontalface_alt.xml") eyeCascade = cv2.CascadeClassifier("haarc...
[((218, 274), 'cv2.CascadeClassifier', 'cv2.CascadeClassifier', (['"""haarcascade_frontalface_alt.xml"""'], {}), "('haarcascade_frontalface_alt.xml')\n", (239, 274), False, 'import cv2\n'), ((292, 336), 'cv2.CascadeClassifier', 'cv2.CascadeClassifier', (['"""haarcascade_eye.xml"""'], {}), "('haarcascade_eye.xml')\n", (...
lmdu/bioinfo
scripts/make_gene_table.py
4542b0718410d15f3956c6545d9824a16608e02b
#!/usr/bin/env python descripts = {} with open('macaca_genes.txt') as fh: fh.readline() for line in fh: cols = line.strip('\n').split('\t') if cols[1]: descripts[cols[0]] = cols[1].split('[')[0].strip() else: descripts[cols[0]] = cols[1] with open('gene_info.txt') as fh: for line in fh: cols = line....
[]
nussl/cookiecutter
{{cookiecutter.repo_name}}/src/mix_with_scaper.py
5df8512592778ea7155b05e3e4b54676227968b0
import gin from scaper import Scaper, generate_from_jams import copy import logging import p_tqdm import nussl import os import numpy as np def _reset_event_spec(sc): sc.reset_fg_event_spec() sc.reset_bg_event_spec() def check_mixture(path_to_mix): mix_signal = nussl.AudioSignal(path_to_mix) if mix_si...
[((276, 306), 'nussl.AudioSignal', 'nussl.AudioSignal', (['path_to_mix'], {}), '(path_to_mix)\n', (293, 306), False, 'import nussl\n'), ((1177, 1208), 'copy.deepcopy', 'copy.deepcopy', (['event_parameters'], {}), '(event_parameters)\n', (1190, 1208), False, 'import copy\n'), ((3193, 3215), 'nussl.utils.seed', 'nussl.ut...
DaneRosa/adventure-cards
adventure-cards/package/main.py
0685feeec8b56627795e685ff4fffad187881e1c
import json def hydrateCards(rawDeckDataPath): pack = [] rawDeckData = json.load(open(rawDeckDataPath,)) for index, item in enumerate(rawDeckData): deck = [] # print(index,item) for i in rawDeckData[item]: card ={ f'{index}': { ...
[]
huynhtnhut97/keras-video-classifier
demo/cnn_predict.py
3ea6a8d671f3bd3cc8eddef64ad75abc2a2d593a
import numpy as np from keras import backend as K import os import sys K.set_image_dim_ordering('tf') def patch_path(path): return os.path.join(os.path.dirname(__file__), path) def main(): sys.path.append(patch_path('..')) data_dir_path = patch_path('very_large_data') model_dir_path = patch_path('...
[((72, 102), 'keras.backend.set_image_dim_ordering', 'K.set_image_dim_ordering', (['"""tf"""'], {}), "('tf')\n", (96, 102), True, 'from keras import backend as K\n'), ((545, 600), 'keras_video_classifier.library.convolutional.CnnVideoClassifier.get_config_file_path', 'CnnVideoClassifier.get_config_file_path', (['model_...
EuroPython/djep
pyconde/context_processors.py
afcccbdda483e5f6962ac97f0dc4c4c5ea67fd21
from django.conf import settings def less_settings(request): return { 'use_dynamic_less_in_debug': getattr(settings, 'LESS_USE_DYNAMIC_IN_DEBUG', True) }
[]
tuomijal/pmdarima
pmdarima/preprocessing/endog/boxcox.py
5bf84a2a5c42b81b949bd252ad3d4c6c311343f8
# -*- coding: utf-8 -*- from scipy import stats import numpy as np import warnings from ...compat import check_is_fitted, pmdarima as pm_compat from .base import BaseEndogTransformer __all__ = ['BoxCoxEndogTransformer'] class BoxCoxEndogTransformer(BaseEndogTransformer): r"""Apply the Box-Cox transformation t...
[((2802, 2848), 'scipy.stats.boxcox', 'stats.boxcox', (['(y + lam2)'], {'lmbda': 'None', 'alpha': 'None'}), '(y + lam2, lmbda=None, alpha=None)\n', (2814, 2848), False, 'from scipy import stats\n'), ((4344, 4353), 'numpy.log', 'np.log', (['y'], {}), '(y)\n', (4350, 4353), True, 'import numpy as np\n'), ((4233, 4264), '...
ashishdhngr/baserow
backend/src/baserow/api/user/registries.py
b098678d2165eb7c42930ee24dc6753a3cb520c3
from baserow.core.registry import Instance, Registry class UserDataType(Instance): """ The user data type can be used to inject an additional payload to the API JWT response. This is the response when a user authenticates or refreshes his token. The returned dict of the `get_user_data` method is added...
[]
aklsh/EE2703
Week 2/code.py
546b70c9adac4a4de294d83affbb74e480c2f65d
''' ------------------------------------- Assignment 2 - EE2703 (Jan-May 2020) Done by Akilesh Kannan (EE18B122) Created on 18/01/20 Last Modified on 04/02/20 ------------------------------------- ''' # importing necessary libraries import sys import cmath import numpy as np import pandas as pd # To improve reada...
[((3532, 3572), 'sys.exit', 'sys.exit', (['"""Invalid number of arguments!"""'], {}), "('Invalid number of arguments!')\n", (3540, 3572), False, 'import sys\n'), ((17158, 17196), 'sys.exit', 'sys.exit', (['"""Given file does not exist!"""'], {}), "('Given file does not exist!')\n", (17166, 17196), False, 'import sys\n'...
M507/Guessing-passwords-using-machine-learning
Lib/Co.py
da90cfa30ce2e7a5e08ee528f594fa047ecea75c
import subprocess import os.path """ Stylish input() """ def s_input(string): return input(string+">").strip("\n") """ Execute command locally """ def execute_command(command): if len(command) > 0: print(command) proc = subprocess.Popen(command.split(" "), stdout=subprocess.PIPE, cwd="/tmp")...
[]
rachelbrown347/CS294-26_code
project3_code/part_0/main.py
72a20a9ab75345091d2a743b13857d7a88adf9be
import numpy as np import matplotlib.pyplot as plt from skimage.exposure import rescale_intensity from unsharp import * # Load file and normalize to 0-1 fname = 'iguana.jpg' im = plt.imread(fname) if im.mean() >= 1: im = im/255. sigma = 5 amplitude = 1.5 imsharp = unsharp_mask(im, sigma, amplitude) imsharp = re...
[((182, 199), 'matplotlib.pyplot.imread', 'plt.imread', (['fname'], {}), '(fname)\n', (192, 199), True, 'import matplotlib.pyplot as plt\n'), ((318, 379), 'skimage.exposure.rescale_intensity', 'rescale_intensity', (['imsharp'], {'in_range': '(0, 1)', 'out_range': '(0, 1)'}), '(imsharp, in_range=(0, 1), out_range=(0, 1)...
MERegistro/meregistro
meregistro/apps/registro/models/EstablecimientoDomicilio.py
6cde3cab2bd1a8e3084fa38147de377d229391e3
# -*- coding: utf-8 -*- from django.db import models from apps.registro.models.TipoDomicilio import TipoDomicilio from apps.registro.models.Localidad import Localidad from apps.registro.models.Establecimiento import Establecimiento from django.core.exceptions import ValidationError from apps.seguridad.audit import audi...
[((462, 523), 'django.db.models.ForeignKey', 'models.ForeignKey', (['Establecimiento'], {'related_name': '"""domicilios"""'}), "(Establecimiento, related_name='domicilios')\n", (479, 523), False, 'from django.db import models\n'), ((542, 574), 'django.db.models.ForeignKey', 'models.ForeignKey', (['TipoDomicilio'], {}),...
timothyyu/p4e-prac
python_for_everybody/py2_p4i_old/6.5findslicestringextract.py
f978b71ce147b6e9058372929f2666c2e67d0741
# 6.5 Write code using find() and string slicing (see section 6.10) to extract # the number at the end of the line below. # Convert the extracted value to a floating point number and print it out. text = "X-DSPAM-Confidence: 0.8475"; pos = text.find(':') text = float(text[pos+1:]) print text
[]
Petr-By/qtpyvis
tools/lucid/engine.py
0b9a151ee6b9a56b486c2bece9c1f03414629efc
import logging logger = logging.getLogger(__name__) print(f"!!!!!!!!!! getEffectiveLevel: {logger.getEffectiveLevel()} !!!!!!!!!!!!!") from dltb.base.observer import Observable, change from network import Network, loader from network.lucid import Network as LucidNetwork # lucid.modelzoo.vision_models: # A module ...
[((24, 51), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (41, 51), False, 'import logging\n'), ((5696, 5740), 'lucid.optvis.objectives.channel', 'objectives.channel', (['self.layer_id', 'self.unit'], {}), '(self.layer_id, self.unit)\n', (5714, 5740), True, 'import lucid.optvis.objective...
natamelo/synapse
synapse/storage/events.py
3d870ecfc5353e455917166cb5c2bb8ba48a6ebd
# -*- coding: utf-8 -*- # Copyright 2014-2016 OpenMarket Ltd # Copyright 2018-2019 New Vector Ltd # Copyright 2019 The Matrix.org Foundation C.I.C. # # 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 Licens...
[((2138, 2165), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (2155, 2165), False, 'import logging\n'), ((2191, 2245), 'prometheus_client.Counter', 'Counter', (['"""synapse_storage_events_persisted_events"""', '""""""'], {}), "('synapse_storage_events_persisted_events', '')\n", (2198, 22...
premm1983/Spinnaker
dev/buildtool/metrics.py
535f78b8f5402eea942c260cb9ca26682772a3e6
# Copyright 2017 Google 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 applicable law or a...
[((1330, 1386), 'buildtool.in_memory_metrics.init_argument_parser', 'in_memory_metrics.init_argument_parser', (['parser', 'defaults'], {}), '(parser, defaults)\n', (1368, 1386), False, 'from buildtool import in_memory_metrics\n'), ((1391, 1448), 'buildtool.prometheus_metrics.init_argument_parser', 'prometheus_metrics.i...
hythloday/pants
src/python/pants/backend/android/tasks/aapt_builder.py
107e9b0957f6949ac4bd535fbef8d2d8cba05c5c
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (nested_scopes, generators, division, absolute_import, with_statement, print_function, unicode_literals) import os import sub...
[((2585, 2609), 'pants.util.dirutil.safe_mkdir', 'safe_mkdir', (['self.workdir'], {}), '(self.workdir)\n', (2595, 2609), False, 'from pants.util.dirutil import safe_mkdir\n'), ((2410, 2471), 'os.path.join', 'os.path.join', (['self.workdir', "(target.app_name + '-unsigned.apk')"], {}), "(self.workdir, target.app_name + ...
kiss2u/google-research
fat/fat_bert_nq/ppr/apr_lib.py
2cd66234656f9e2f4218ed90a2d8aa9cf3139093
# coding=utf-8 # Copyright 2020 The Google Research Authors. # # 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 applicab...
[((1590, 1599), 'fat.fat_bert_nq.ppr.kb_csr_io.CsrData', 'CsrData', ([], {}), '()\n', (1597, 1599), False, 'from fat.fat_bert_nq.ppr.kb_csr_io import CsrData\n'), ((2084, 2148), 'fat.fat_bert_nq.ppr.apr_algo.csr_personalized_pagerank', 'csr_personalized_pagerank', (['seeds', 'self.data.adj_mat_t_csr', 'alpha'], {}), '(...
evanlynch/optimal-gardening
src/optimal_gardening.py
447ca8575efac1ad5cdd975091f3cbb67721e167
import os import sys import time from IPython.display import Image import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sb sb.set_style("dark") #### Initial Setup #### #plant info plant_info = pd.read_csv('../data/plant_data.csv') plant_info.index.name = 'plant_index' plants = pla...
[((160, 180), 'seaborn.set_style', 'sb.set_style', (['"""dark"""'], {}), "('dark')\n", (172, 180), True, 'import seaborn as sb\n'), ((232, 269), 'pandas.read_csv', 'pd.read_csv', (['"""../data/plant_data.csv"""'], {}), "('../data/plant_data.csv')\n", (243, 269), True, 'import pandas as pd\n'), ((721, 788), 'numpy.avera...
Daulbaev/adversarial-library
adv_lib/utils/attack_utils.py
6f979a511ad78908374cd55855a9e2c5a874be7d
import warnings from collections import OrderedDict from distutils.version import LooseVersion from functools import partial from inspect import isclass from typing import Callable, Optional, Dict, Union import numpy as np import torch import tqdm from torch import Tensor, nn from torch.nn import functional as F from...
[((5060, 5169), 'collections.OrderedDict', 'OrderedDict', (["[('linf', linf_distances), ('l0', l0_distances), ('l1', l1_distances), (\n 'l2', l2_distances)]"], {}), "([('linf', linf_distances), ('l0', l0_distances), ('l1',\n l1_distances), ('l2', l2_distances)])\n", (5071, 5169), False, 'from collections import O...
Summer0328/ChangeDet_DL-1
thawSlumpChangeDet/polygons_compare.py
f2474ee4200d9ad093c0e5a27a94bfbd3bd038e7
#!/usr/bin/env python # Filename: polygons_cd """ introduction: compare two polygons in to shape file authors: Huang Lingcao email:huanglingcao@gmail.com add time: 26 February, 2020 """ import sys,os from optparse import OptionParser # added path of DeeplabforRS sys.path.insert(0, os.path.expanduser('~/codes/Pychar...
[((286, 344), 'os.path.expanduser', 'os.path.expanduser', (['"""~/codes/PycharmProjects/DeeplabforRS"""'], {}), "('~/codes/PycharmProjects/DeeplabforRS')\n", (304, 344), False, 'import sys, os\n'), ((655, 694), 'basic_src.io_function.is_file_exist', 'io_function.is_file_exist', (['new_shp_path'], {}), '(new_shp_path)\n...
brotich/andela_bootcamp_X
andela_labs/Car Class Lab (OOP)/car.py
19fc5bb66d3c930d4e6b9afeb45abc00bbc4c2ea
class Car(object): """ Car class that can be used to instantiate various vehicles. It takes in arguments that depict the type, model, and name of the vehicle """ def __init__(self, name="General", model="GM", car_type="saloon"): num_of_wheels = 4 num_of_doors = 4 ...
[]
fcsiba/Smart-Cart
CV Model/Model - JupyterNotebook/mrcnn/tfliteconverter.py
7d45b9f2a2be2015936c2a61068b2fd8b6c95fe5
import tensorflow as tf # Convert the model. converter = tf.lite.TFLiteConverter.from_saved_model('model.py') tflite_model = converter.convert() open("trash_ai.tflite", "wb").write(tflite_model)
[((58, 110), 'tensorflow.lite.TFLiteConverter.from_saved_model', 'tf.lite.TFLiteConverter.from_saved_model', (['"""model.py"""'], {}), "('model.py')\n", (98, 110), True, 'import tensorflow as tf\n')]
shivamsinghal212/Url-Shortener
basicapp/cron.py
4127a993272744f6f8592415314c8e8514d43153
from django_cron import CronJobBase, Schedule from .models import Link from django.utils import timezone class MyCronJob(CronJobBase): RUN_EVERY_MINS = 1 # every 2 hours schedule = Schedule(run_every_mins=RUN_EVERY_MINS) code = 'basicapp.cron' # a unique code def do(self): current_time = t...
[((191, 230), 'django_cron.Schedule', 'Schedule', ([], {'run_every_mins': 'RUN_EVERY_MINS'}), '(run_every_mins=RUN_EVERY_MINS)\n', (199, 230), False, 'from django_cron import CronJobBase, Schedule\n'), ((319, 333), 'django.utils.timezone.now', 'timezone.now', ([], {}), '()\n', (331, 333), False, 'from django.utils impo...
Smylers/WeasyPrint
weasyprint/tests/test_stacking.py
25ce91a34755386b3350d898aa1638c349723b57
# coding: utf8 """ weasyprint.tests.stacking ------------------------- :copyright: Copyright 2011-2012 Simon Sapin and contributors, see AUTHORS. :license: BSD, see LICENSE for details. """ from __future__ import division, unicode_literals from ..stacking import StackingContext from .test_boxes impo...
[]
industrydive/sourcelist
django-magic-link/customers/views.py
9db4ec5c9cb9246a644615ca401a3c8f8d560b6e
from django.shortcuts import render from django.contrib.auth.models import User from django.contrib.auth.decorators import login_required from sesame import utils from django.core.mail import send_mail def login_page(request): if request.method == "POST": email = request.POST.get("emailId") user =...
[((1012, 1041), 'django.shortcuts.render', 'render', (['request', '"""login.html"""'], {}), "(request, 'login.html')\n", (1018, 1041), False, 'from django.shortcuts import render\n'), ((1104, 1143), 'django.shortcuts.render', 'render', (['request', '"""customers/index.html"""'], {}), "(request, 'customers/index.html')\...
dataiku/dss-plugin-nlp-analysis
python-lib/config/dss_parameter.py
ff9dce56500dc8f28f83158afbdf7db01074ee38
from .custom_check import CustomCheck, CustomCheckError from typing import Any, List import logging logger = logging.getLogger(__name__) class DSSParameterError(Exception): """Exception raised when at least one CustomCheck fails.""" pass class DSSParameter: """Object related to one parameter. It is m...
[((111, 138), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (128, 138), False, 'import logging\n')]
mstarikov/transitfeed
misc/import_ch_zurich.py
c018d7b14f6fccaa670629c00c83a390b5461fc1
#!/usr/bin/python2.4 # Copyright (C) 2008 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
[((2709, 2735), 'csv.reader', 'csv.reader', (['s', 'csv_dialect'], {}), '(s, csv_dialect)\n', (2719, 2735), False, 'import csv\n'), ((20623, 20646), 'optparse.OptionParser', 'optparse.OptionParser', ([], {}), '()\n', (20644, 20646), False, 'import optparse\n'), ((5975, 6008), 'zipfile.ZipFile', 'zipfile.ZipFile', (['in...
rotsee/protokollen
modules/documents.py
a001a1db86df57adcf5c53c95c4c2fae426340f1
# -*- coding: utf-8 -*- """This module contains classes for documents, and lists of documents. Documents are defined by the document rules in settings.py A file can contain one or more document. However, a document can not be constructed from more than one file. This is a limitation, obvious in cases like ...
[]
saratkumar/galaxy
tools/amp_segment/ina_speech_segmenter.py
35cd0987239c1b006d6eaf70b4a03a58fb857a12
#!/usr/bin/env python3 import os import os.path import shutil import subprocess import sys import tempfile import uuid import mgm_utils def main(): (root_dir, input_file, json_file) = sys.argv[1:4] tmpName = str(uuid.uuid4()) tmpdir = "/tmp" temp_input_file = f"{tmpdir}/{tmpName}.dat" temp_output_file = f"{tmpd...
[((341, 381), 'shutil.copy', 'shutil.copy', (['input_file', 'temp_input_file'], {}), '(input_file, temp_input_file)\n', (352, 381), False, 'import shutil\n'), ((453, 531), 'subprocess.run', 'subprocess.run', (["['singularity', 'run', sif, temp_input_file, temp_output_file]"], {}), "(['singularity', 'run', sif, temp_inp...
jhill1/thetis
test/tracerEq/test_steady_adv-diff_mms.py
1be5d28d5d0d7248f2bbce4986b3e886116e103a
""" Testing 3D tracer advection-diffusion equation with method of manufactured solution (MMS). """ from thetis import * import numpy from scipy import stats import pytest class Setup1: """ Constant bathymetry and u velocty, zero diffusivity, non-trivial tracer """ def bath(self, x, y, lx, ly): ...
[((11695, 11741), 'pytest.fixture', 'pytest.fixture', ([], {'params': "['LeapFrog', 'SSPRK22']"}), "(params=['LeapFrog', 'SSPRK22'])\n", (11709, 11741), False, 'import pytest\n'), ((11801, 11906), 'pytest.fixture', 'pytest.fixture', ([], {'params': '[Setup1, Setup2, Setup3, Setup4]', 'ids': "['setup1', 'setup2', 'setup...
GaretJax/csat
csat/django/fields.py
db63441136369436140a91c9657444353c8944e6
from lxml import etree from django import forms from django.db import models class XMLFileField(models.FileField): def __init__(self, *args, **kwargs): self.schema = kwargs.pop('schema') super(XMLFileField, self).__init__(*args, **kwargs) def clean(self, *args, **kwargs): data = supe...
[((409, 424), 'lxml.etree.parse', 'etree.parse', (['fh'], {}), '(fh)\n', (420, 424), False, 'from lxml import etree\n'), ((574, 664), 'django.forms.ValidationError', 'forms.ValidationError', (['"""The XML file failed to validate against the supplied schema."""'], {}), "(\n 'The XML file failed to validate against th...
RishabhSehgal/keras_cv_attention_models
keras_cv_attention_models/yolox/yolox.py
c1e20e45815339d70a987ec7dd9e6f926b4eb21d
import tensorflow as tf from tensorflow import keras from keras_cv_attention_models.attention_layers import ( activation_by_name, batchnorm_with_activation, conv2d_no_bias, depthwise_conv2d_no_bias, add_pre_post_process, ) from keras_cv_attention_models import model_surgery from keras_cv_attention_m...
[((1365, 1441), 'keras_cv_attention_models.attention_layers.conv2d_no_bias', 'conv2d_no_bias', (['nn', 'filters', 'kernel_size', 'strides'], {'padding': '"""SAME"""', 'name': 'name'}), "(nn, filters, kernel_size, strides, padding='SAME', name=name)\n", (1379, 1441), False, 'from keras_cv_attention_models.attention_laye...
mrod0101/opentrons
robot-server/tests/service/json_api/test_response.py
6450edb0421f1c2484c292f8583602d8f6fd13b8
from pytest import raises from pydantic import ValidationError from robot_server.service.json_api.response import ( ResponseDataModel, ResponseModel, MultiResponseModel, ) from tests.service.helpers import ItemResponseModel def test_attributes_as_dict() -> None: MyResponse = ResponseModel[ResponseDat...
[((2783, 2850), 'tests.service.helpers.ItemResponseModel', 'ItemResponseModel', ([], {'id': '"""abc123"""', 'name': '"""pear"""', 'price': '(1.2)', 'quantity': '(10)'}), "(id='abc123', name='pear', price=1.2, quantity=10)\n", (2800, 2850), False, 'from tests.service.helpers import ItemResponseModel\n'), ((2121, 2144), ...
MichaelMcFarland98/cse210-project
stickmanZ/__main__.py
9e5a45a75f465fe123e33712d3c19dd88e98246a
from game.game_view import GameView from game.menu_view import menu_view from game import constants import arcade SCREEN_WIDTH = constants.SCREEN_WIDTH SCREEN_HEIGHT = constants.SCREEN_HEIGHT SCREEN_TITLE = constants.SCREEN_TITLE window = arcade.Window(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TITLE) start_view = menu_vi...
[((243, 299), 'arcade.Window', 'arcade.Window', (['SCREEN_WIDTH', 'SCREEN_HEIGHT', 'SCREEN_TITLE'], {}), '(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TITLE)\n', (256, 299), False, 'import arcade\n'), ((313, 324), 'game.menu_view.menu_view', 'menu_view', ([], {}), '()\n', (322, 324), False, 'from game.menu_view import menu_vie...
congnt95/neutron
neutron/db/migration/alembic_migrations/versions/mitaka/contract/c6c112992c9_rbac_qos_policy.py
6a73a362c5ff5b7c28c15a49f47a9900c0d2b4e1
# Copyright 2015 OpenStack Foundation # # 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 ...
[((1021, 1034), 'sqlalchemy.MetaData', 'sa.MetaData', ([], {}), '()\n', (1032, 1034), True, 'import sqlalchemy as sa\n'), ((1521, 1534), 'sqlalchemy.MetaData', 'sa.MetaData', ([], {}), '()\n', (1532, 1534), True, 'import sqlalchemy as sa\n'), ((1852, 1892), 'alembic.op.drop_column', 'op.drop_column', (['"""qos_policies...
ericchou1/network-devops-kafka-up-and-running
chapter5/ch5_gcp_subscriber.py
c128cf7359ba40c3005a02d3033b16b67c196779
from concurrent.futures import TimeoutError from google.cloud import pubsub_v1 project_id = "pubsub-testing-331300" subscription_id = "test-sub" # Number of seconds the subscriber should listen for messages timeout = 5.0 subscriber = pubsub_v1.SubscriberClient() # The `subscription_path` method creates a fully qualif...
[((236, 264), 'google.cloud.pubsub_v1.SubscriberClient', 'pubsub_v1.SubscriberClient', ([], {}), '()\n', (262, 264), False, 'from google.cloud import pubsub_v1\n')]
VaibhavBhujade/Blockchain-ERP-interoperability
odoo-13.0/addons/google_drive/models/res_config_settings.py
b5190a037fb6615386f7cbad024d51b0abd4ba03
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, fields, models, _ class ResConfigSettings(models.TransientModel): _inherit = "res.config.settings" google_drive_authorization_code = fields.Char(string='Authorization Code', config_parame...
[((266, 363), 'odoo.fields.Char', 'fields.Char', ([], {'string': '"""Authorization Code"""', 'config_parameter': '"""google_drive_authorization_code"""'}), "(string='Authorization Code', config_parameter=\n 'google_drive_authorization_code')\n", (277, 363), False, 'from odoo import api, fields, models, _\n'), ((382,...
sanger640/attMPTI
dataloaders/loader.py
a2784b784e0900f3603baa3779631da67bcd0562
""" Data Loader for Generating Tasks Author: Zhao Na, 2020 """ import os import random import math import glob import numpy as np import h5py as h5 import transforms3d from itertools import combinations import torch from torch.utils.data import Dataset def sample_K_pointclouds(data_path, num_point, pc_attribs, pc_...
[((868, 894), 'numpy.stack', 'np.stack', (['ptclouds'], {'axis': '(0)'}), '(ptclouds, axis=0)\n', (876, 894), True, 'import numpy as np\n'), ((908, 932), 'numpy.stack', 'np.stack', (['labels'], {'axis': '(0)'}), '(labels, axis=0)\n', (916, 932), True, 'import numpy as np\n'), ((2424, 2444), 'numpy.amin', 'np.amin', (['...
grayfallstown/greendoge-blockchain
greendoge/types/condition_with_args.py
31e325913374d694dc0859140d006a642e7f95ac
from dataclasses import dataclass from typing import List from greendoge.types.condition_opcodes import ConditionOpcode from greendoge.util.streamable import Streamable, streamable @dataclass(frozen=True) @streamable class ConditionWithArgs(Streamable): """ This structure is used to store parsed CLVM conditi...
[((185, 207), 'dataclasses.dataclass', 'dataclass', ([], {'frozen': '(True)'}), '(frozen=True)\n', (194, 207), False, 'from dataclasses import dataclass\n')]
pp81381/home-assistant
homeassistant/components/hunterdouglas_powerview/entity.py
23e362faf387c1535be0abab81b30d8e4631df4b
"""The nexia integration base entity.""" from aiopvapi.resources.shade import ATTR_TYPE from homeassistant.const import ATTR_MODEL, ATTR_SW_VERSION import homeassistant.helpers.device_registry as dr from homeassistant.helpers.entity import DeviceInfo from homeassistant.helpers.update_coordinator import CoordinatorEnt...
[((1314, 1646), 'homeassistant.helpers.entity.DeviceInfo', 'DeviceInfo', ([], {'identifiers': '{(DOMAIN, self._device_info[DEVICE_SERIAL_NUMBER])}', 'connections': '{(dr.CONNECTION_NETWORK_MAC, self._device_info[DEVICE_MAC_ADDRESS])}', 'name': 'self._device_info[DEVICE_NAME]', 'suggested_area': 'self._room_name', 'mode...
daxter-army/key-cast
keycast_env/lib/python3.8/site-packages/Xlib/ext/res.py
cadc88c6760839b37b7fef969294800d4c38fb1b
# Xlib.ext.res -- X-Resource extension module # # Copyright (C) 2021 Aleksei Bavshin <alebastr89@gmail.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public License # as published by the Free Software Foundation; either version 2.1 ...
[((2634, 2660), 'Xlib.protocol.rq.Card32', 'rq.Card32', (['"""resource_base"""'], {}), "('resource_base')\n", (2643, 2660), False, 'from Xlib.protocol import rq\n'), ((2671, 2697), 'Xlib.protocol.rq.Card32', 'rq.Card32', (['"""resource_mask"""'], {}), "('resource_mask')\n", (2680, 2697), False, 'from Xlib.protocol impo...
scwatts/rubra
rubra/cmdline_args.py
0be2c1e8d56badf134954baab9705f3aeb38d426
# Process the unix command line of the pipeline. import argparse from version import rubra_version def get_cmdline_args(): return parser.parse_args() parser = argparse.ArgumentParser( description='A bioinformatics pipeline system.') parser.add_argument( 'pipeline', metavar='PIPELINE_FILE', type=...
[((166, 238), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""A bioinformatics pipeline system."""'}), "(description='A bioinformatics pipeline system.')\n", (189, 238), False, 'import argparse\n')]
KH241/Geohashing
main.py
d5d51278776c4dc0e3d6e6c39cbd31c1f4442fc1
import webbrowser import config from Generator import Generator def main(): generator = Generator() latitude, longitude = generator.getCoordinates() webbrowser.open(config.api_request.format(latitude, longitude)) if __name__ == '__main__': main()
[((94, 105), 'Generator.Generator', 'Generator', ([], {}), '()\n', (103, 105), False, 'from Generator import Generator\n'), ((180, 226), 'config.api_request.format', 'config.api_request.format', (['latitude', 'longitude'], {}), '(latitude, longitude)\n', (205, 226), False, 'import config\n')]
WAvdBeek/CoAPthon3
knx-test.py
5aa9d6a6d9a2903d86b113da538df9bd970e6b44
#!/usr/bin/env python import getopt import socket import sys import cbor #from cbor2 import dumps, loads import json import time import traceback from coapthon.client.helperclient import HelperClient from coapthon.utils import parse_uri from coapthon import defines client = None paths = {} paths_extend = {} my_base ...
[((1660, 1682), 'cbor.loads', 'cbor.loads', (['sn.payload'], {}), '(sn.payload)\n', (1670, 1682), False, 'import cbor\n'), ((23947, 23964), 'coapthon.utils.parse_uri', 'parse_uri', (['mypath'], {}), '(mypath)\n', (23956, 23964), False, 'from coapthon.utils import parse_uri\n'), ((24095, 24128), 'coapthon.client.helperc...
alexsigaras/SWIM
SWIM-Executables/Windows/pyinstaller-2.0 for windows/PyInstaller/hooks/hook-PyQt4.phonon.py
1a35df8acb26bdcb307a1b8f60e9feba68ed1715
hiddenimports = ['sip', 'PyQt4.QtGui', 'PyQt4._qt'] from PyInstaller.hooks.hookutils import qt4_plugins_binaries def hook(mod): mod.binaries.extend(qt4_plugins_binaries('phonon_backend')) return mod
[((155, 193), 'PyInstaller.hooks.hookutils.qt4_plugins_binaries', 'qt4_plugins_binaries', (['"""phonon_backend"""'], {}), "('phonon_backend')\n", (175, 193), False, 'from PyInstaller.hooks.hookutils import qt4_plugins_binaries\n')]
zlopez101/PyTradier
PyTradier/data.py
83397cf38bd636c471993b57fb71a12885affcb7
from PyTradier.base import BasePyTradier from typing import Union from datetime import datetime class MarketData(BasePyTradier): """All Methods currently only support string API calls, no datetime, bools, etc """ def quotes(self, symbols: Union[str, list], greeks: bool = False) -> dict: """Get a ...
[((6561, 6578), 'utils.printer', 'printer', (['response'], {}), '(response)\n', (6568, 6578), False, 'from utils import printer\n')]
Axel-Jacobsen/pyjoulescope_ui
joulescope_ui/meter_widget.py
7d296b1ead0d36c6524dc399372f7888a340e9fa
# Copyright 2018 Jetperch 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 agreed to in writing,...
[((713, 740), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (730, 740), False, 'import logging\n'), ((2592, 2609), 'PySide2.QtCore.Slot', 'QtCore.Slot', (['bool'], {}), '(bool)\n', (2603, 2609), False, 'from PySide2 import QtCore, QtWidgets\n'), ((967, 1016), 'PySide2.QtWidgets.QWidget._...
bbonf/rpyc
rpyc/core/service.py
2c66dd6936a0d9e6e36c1ba0cda1139676acf95c
""" Services are the heart of RPyC: each side of the connection exposes a *service*, which define the capabilities available to the other side. Note that the services by both parties need not be symmetric, e.g., one side may exposed *service A*, while the other may expose *service B*. As long as the two can interopera...
[((4665, 4694), 'rpyc.lib.compat.execute', 'execute', (['text', 'self.namespace'], {}), '(text, self.namespace)\n', (4672, 4694), False, 'from rpyc.lib.compat import execute, is_py3k\n'), ((7188, 7220), 'functools.partial', 'partial', (['teleport_function', 'conn'], {}), '(teleport_function, conn)\n', (7195, 7220), Fal...
altenia/taskmator
tests/task/manager_test.py
4090d414125614a57649c5c92a017c12a231a2ef
import unittest from testbase import TaskmatorTestBase from taskmator.task import core, util from taskmator import context class ManagerTest(TaskmatorTestBase): def testManager(self): print ("Pending") def main(): unittest.main() if __name__ == '__main__': unittest.main()
[((291, 306), 'unittest.main', 'unittest.main', ([], {}), '()\n', (304, 306), False, 'import unittest\n'), ((242, 257), 'unittest.main', 'unittest.main', ([], {}), '()\n', (255, 257), False, 'import unittest\n')]
tbarbette/core
tests/components/zwave_js/test_discovery.py
8e58c3aa7bc8d2c2b09b6bd329daa1c092d52d3c
"""Test discovery of entities for device-specific schemas for the Z-Wave JS integration.""" async def test_iblinds_v2(hass, client, iblinds_v2, integration): """Test that an iBlinds v2.0 multilevel switch value is discovered as a cover.""" node = iblinds_v2 assert node.device_class.specific.label == "Unus...
[]
cowboygneox/boto3_type_annotations
boto3_type_annotations/boto3_type_annotations/guardduty/client.py
450dce1de4e066b939de7eac2ec560ed1a7ddaa2
from typing import Optional from botocore.client import BaseClient from typing import Dict from typing import Union from botocore.paginate import Paginator from botocore.waiter import Waiter from typing import List class Client(BaseClient): def accept_invitation(self, DetectorId: str, InvitationId: str, MasterId:...
[]
ChenYi015/Raven
test/workload/tpch_loop_workload_test.py
e732e03f8dd118ed805a143fc6916f0e5fc53c2c
# Copyright 2021 Raven Authors. 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 applicable law or ...
[((849, 867), 'benchmark.workload.tpch.TpchLoopWorkload', 'TpchLoopWorkload', ([], {}), '()\n', (865, 867), False, 'from benchmark.workload.tpch import TpchLoopWorkload\n'), ((901, 908), 'queue.Queue', 'Queue', ([], {}), '()\n', (906, 908), False, 'from queue import Queue\n'), ((932, 1024), 'threading.Thread', 'Thread'...
wendy006/Web-Dev-Course
Final-Project/server/art/serializers.py
2f0cfddb7ab4db88ffb4483c7cd4a00abf36c720
from rest_framework import serializers from .models import * class CollectionSerializer(serializers.ModelSerializer): class Meta: model = Collection fields = ('collectionID', 'name', 'display_name', 'description', 'img_url') class ArtSerializer(serializers.ModelSerializer): img_url = ...
[((320, 347), 'rest_framework.serializers.ReadOnlyField', 'serializers.ReadOnlyField', ([], {}), '()\n', (345, 347), False, 'from rest_framework import serializers\n'), ((365, 392), 'rest_framework.serializers.ReadOnlyField', 'serializers.ReadOnlyField', ([], {}), '()\n', (390, 392), False, 'from rest_framework import ...
joezqren/google-cloud-cpp
google/cloud/google_cloud_cpp_common_unit_tests.bzl
325d312b0a21569f3c57515aec7d91f3540d3b48
# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
[]
codacy-badger/politico-api
api/tests/ver1/test_base.py
10d926bf34f12631cb19bb9c82ccded36557c790
import unittest from api import create_app class TestBase(unittest.TestCase): """Default super class for api ver 1 tests""" # setup testing def setUp(self): self.app = create_app('testing') self.client = self.app.test_client() self.item_list = [] # deconstructs test elements ...
[((190, 211), 'api.create_app', 'create_app', (['"""testing"""'], {}), "('testing')\n", (200, 211), False, 'from api import create_app\n')]
CMPUT404-Project-Group/CMPUT404-Group-Project
socialdistribution/app/templatetags/filters.py
e541cc609f260d7221fe0be8975c5b2444d74af0
from django import template from django.template.defaultfilters import stringfilter from django.utils.safestring import SafeString import markdown import urllib register = template.Library() @register.filter def strip_space(value): return value.replace(' ', '') @register.filter @stringfilter def commonmark(value...
[((173, 191), 'django.template.Library', 'template.Library', ([], {}), '()\n', (189, 191), False, 'from django import template\n'), ((660, 685), 'urllib.parse.quote', 'urllib.parse.quote', (['value'], {}), '(value)\n', (678, 685), False, 'import urllib\n'), ((334, 353), 'markdown.Markdown', 'markdown.Markdown', ([], {}...
antopen/alipay-sdk-python-all
alipay/aop/api/domain/MetroOdItem.py
8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * from alipay.aop.api.domain.CloudbusUserInfo import CloudbusUserInfo class MetroOdItem(object): def __init__(self): self._dest_geo = None self._od = None self._time = None ...
[((1063, 1103), 'alipay.aop.api.domain.CloudbusUserInfo.CloudbusUserInfo.from_alipay_dict', 'CloudbusUserInfo.from_alipay_dict', (['value'], {}), '(value)\n', (1096, 1103), False, 'from alipay.aop.api.domain.CloudbusUserInfo import CloudbusUserInfo\n')]
vsalat/djangocms-redirect
djangocms_redirect/migrations/0003_auto_20190810_1009.py
a2577f08430b6b65ae4a51293f861b697bf4ab9d
# Generated by Django 2.2.4 on 2019-08-10 08:09 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('djangocms_redirect', '0002_auto_20170321_1807'), ] operations = [ migrations.AddField( model_name='redirect', name='...
[((358, 552), 'django.db.models.BooleanField', 'models.BooleanField', ([], {'default': '(False)', 'help_text': '"""If selected all the pages starting with the given string will be redirected to the given redirect path"""', 'verbose_name': '"""Catchall redirect"""'}), "(default=False, help_text=\n 'If selected all th...
nicholaschiang/dl-datasheets
octopart/scrape_octopart.py
1c5ab2545a85c1ea7643fc655005259544617d90
#! /usr/bin/env python import sys import json import urllib import urllib2 import time import argparse import re # Category ID for Discrete Semiconductors > Transistors > BJTs TRANSISTOR_ID = b814751e89ff63d3 def find_total_hits(search_query): """ Function: find_total_hits -------------------- Return...
[]
foglamp/FogLAMP
extras/python/fogbench/__main__.py
918dff88b440e6ad580efdaa5f0fbdf4143a73d4
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # FOGLAMP_BEGIN # See: http://foglamp.readthedocs.io/ # FOGLAMP_END """ fogbench -- a Python script used to test FogLAMP. The objective is to simulate payloads for input, REST and other requests against one or more FogLAMP instances. This version of fogbench is meant ...
[((10456, 10496), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'prog': '"""fogbench"""'}), "(prog='fogbench')\n", (10479, 10496), False, 'import argparse\n'), ((5351, 5375), 'asyncio.get_event_loop', 'asyncio.get_event_loop', ([], {}), '()\n', (5373, 5375), False, 'import asyncio\n'), ((2696, 2716), 'jso...
paulineollitrault/qiskit-ignis
qiskit/ignis/mitigation/measurement/filters.py
99f24ea6533cd284be4c44a48d43e54f62f05674
# -*- coding: utf-8 -*- # This code is part of Qiskit. # # (C) Copyright IBM 2019. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modif...
[((8879, 8905), 'copy.deepcopy', 'deepcopy', (['new_cal_matrices'], {}), '(new_cal_matrices)\n', (8887, 8905), False, 'from copy import deepcopy\n'), ((13514, 13538), 'qiskit.ignis.verification.tomography.count_keys', 'count_keys', (['self.nqubits'], {}), '(self.nqubits)\n', (13524, 13538), False, 'from qiskit.ignis.ve...
fcharlier/AdventOfCode
2017/adv2017-1.py
6b2765da9e4d6f6b1f201897bb56043482a65bb2
#!/usr/bin/python def meh(captcha): """Returns the sum of the digits which match the next one in the captcha input string. >>> meh('1122') 3 >>> meh('1111') 4 >>> meh('1234') 0 >>> meh('91212129') 9 """ result = 0 for n in range(len(captcha)): if captcha[n]...
[]
Roy027/pymatgen
pymatgen/analysis/graphs.py
a4aa91d011033c1151b82335abd080e2b1a310d5
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. """ Module for graph representations of crystals. """ import copy import logging import os.path import subprocess import warnings from collections import defaultdict, namedtuple from itertools import combinati...
[((1010, 1037), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1027, 1037), False, 'import logging\n'), ((1284, 1348), 'collections.namedtuple', 'namedtuple', (['"""ConnectedSite"""', '"""site, jimage, index, weight, dist"""'], {}), "('ConnectedSite', 'site, jimage, index, weight, dist')...
akashdhruv/maple
maple/backend/singularity/__init__.py
11e562f51b18b2251ea507c629a1981b031d2f35
from . import image from . import container from . import system
[]
Ahmed-skb/blogyfy
articles/views.py
2cfa3d9503f1846ccd89c2bf1934293eb97ad44a
from django.shortcuts import render, redirect from django.http import HttpResponse from .models import Article from django.contrib.auth.decorators import login_required from . import forms def Articles(request): articles = Article.objects.all().order_by('date') return render(request, 'articles/article_list.htm...
[((548, 591), 'django.contrib.auth.decorators.login_required', 'login_required', ([], {'login_url': '"""/accounts/login"""'}), "(login_url='/accounts/login')\n", (562, 591), False, 'from django.contrib.auth.decorators import login_required\n'), ((278, 347), 'django.shortcuts.render', 'render', (['request', '"""articles...
russell/sifter
sifter/grammar/grammar.py
03e85349fd2329439ae3f7eb3c1f484ba2ebf807
# Parser based on RFC 5228, especially the grammar as defined in section 8. All # references are to sections in RFC 5228 unless stated otherwise. import ply.yacc import sifter.grammar from sifter.grammar.lexer import tokens import sifter.handler import logging __all__ = ('parser',) def parser(**kwargs): return...
[((2021, 2048), 'logging.getLogger', 'logging.getLogger', (['"""sifter"""'], {}), "('sifter')\n", (2038, 2048), False, 'import logging\n'), ((2708, 2735), 'logging.getLogger', 'logging.getLogger', (['"""sifter"""'], {}), "('sifter')\n", (2725, 2735), False, 'import logging\n'), ((3239, 3266), 'logging.getLogger', 'logg...
dropofwill/author-attr-experiments
multidoc_mnb.py
a90e2743591358a6253f3b3664f5e398517f84bc
from sklearn import datasets from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.feature_extraction.text import CountVectorizer from sklearn.cross_validation import train_test_split from sklearn.cross_validation import cross_val_score from sklearn.cross_validation import ShuffleSplit from sklearn....
[]
yamins81/tabular
tabular/__init__.py
1caf091c8c395960a9ad7078f95158b533cc52dd
import io import fast import spreadsheet import tab import utils import web from io import * from fast import * from spreadsheet import * from tab import * from utils import * from web import * __all__ = [] __all__.extend(io.__all__) __all__.extend(fast.__all__) __all__.extend(spreadsheet.__all__) __all__.extend(tab....
[]
KSchopmeyer/smipyping
smipyping/_targetstable.py
9c60b3489f02592bd9099b8719ca23ae43a9eaa5
# (C) Copyright 2017 Inova Development 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 appl...
[((3808, 4429), 'collections.OrderedDict', 'OrderedDict', (["[('TargetID', ('ID', 2, int)), ('CompanyName', ('CompanyName', 12, str)), (\n 'Namespace', ('Namespace', 12, str)), ('SMIVersion', ('SMIVersion', 12,\n str)), ('Product', ('Product', 15, str)), ('Principal', ('Principal', \n 12, str)), ('Credential',...
jeikabu/lumberyard
dev/Code/Framework/AzFramework/CodeGen/AzEBusInline.py
07228c605ce16cbf5aaa209a94a3cb9d6c1a4115
# # All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or # its licensors. # # For complete copyright and license terms please see the LICENSE at the root of this # distribution (the "License"). All use of this software is governed by the License, # or, if provided, by the license below or th...
[((719, 754), 'AzReflectionCpp.format_cpp_annotations', 'format_cpp_annotations', (['json_object'], {}), '(json_object)\n', (741, 754), False, 'from AzReflectionCpp import format_cpp_annotations\n'), ((861, 889), 'os.path.splitext', 'os.path.splitext', (['input_file'], {}), '(input_file)\n', (877, 889), False, 'import ...
QUANTAXISER/QUANTAXIS
QUANTAXIS/QASU/crawl_eastmoney.py
6ebd727b2900e8910fa45814bf45eeffca395250
import os from QUANTAXIS.QASetting import QALocalize #from QUANTAXIS_CRAWLY.run_selenium_alone import (read_east_money_page_zjlx_to_sqllite, open_chrome_driver, close_chrome_dirver) from QUANTAXIS_CRAWLY.run_selenium_alone import * import urllib import pandas as pd import time from QUANTAXIS.QAUtil import (DATABASE) ...
[((488, 505), 'time.sleep', 'time.sleep', (['(1.223)'], {}), '(1.223)\n', (498, 505), False, 'import time\n'), ((522, 552), 'urllib.request.urlopen', 'urllib.request.urlopen', (['strUrl'], {}), '(strUrl)\n', (544, 552), False, 'import urllib\n'), ((3133, 3150), 'time.sleep', 'time.sleep', (['(1.456)'], {}), '(1.456)\n'...
javicacheiro/salt-git-synchronizer-proxy
wsgi.py
c93de5c0b26afe2b9ec72156497894df7f15d692
#!/usr/bin/env python import logging import sys from app import app as application def setup_flask_logging(): # Log to stdout handler = logging.StreamHandler(sys.stdout) # Log to a file #handler = logging.FileHandler('./application.log') handler.setLevel(logging.INFO) handler.setFormatter(logg...
[((552, 593), 'app.app.logger.setLevel', 'application.logger.setLevel', (['logging.INFO'], {}), '(logging.INFO)\n', (579, 593), True, 'from app import app as application\n'), ((146, 179), 'logging.StreamHandler', 'logging.StreamHandler', (['sys.stdout'], {}), '(sys.stdout)\n', (167, 179), False, 'import logging\n'), ((...
PythonixCoders/PyWeek29
game/base/enemy.py
5c7492466481dec40619272a3da7fa4b9a72c1d6
#!/usr/bin/env python from game.base.being import Being class Enemy(Being): def __init__(self, app, scene, **kwargs): super().__init__(app, scene, **kwargs) self.friendly = False
[]
Hawk94/coin_tracker
main/rates/migrations/0002_auto_20170625_1510.py
082909e17308a8dd460225c1b035751d12a27106
# -*- coding: utf-8 -*- # Generated by Django 1.11.1 on 2017-06-25 15:10 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('rates', '0001_initial'), ] operations = [ migrations.RenameField( model...
[((279, 368), 'django.db.migrations.RenameField', 'migrations.RenameField', ([], {'model_name': '"""rate"""', 'old_name': '"""euro_rate"""', 'new_name': '"""eur_rate"""'}), "(model_name='rate', old_name='euro_rate', new_name=\n 'eur_rate')\n", (301, 368), False, 'from django.db import migrations\n'), ((420, 511), 'd...
dojeda/quetzal-openapi-client
setup.py
d9d4dc99bb425a3f89dcbb80d5096f554bc42fff
# coding: utf-8 """ Quetzal API Quetzal: an API to manage data files and their associated metadata. OpenAPI spec version: 0.5.0 Contact: support@quetz.al Generated by: https://openapi-generator.tech """ from setuptools import setup, find_packages # noqa: H301 NAME = "quetzal-openapi-client" V...
[((1168, 1207), 'setuptools.find_packages', 'find_packages', ([], {'exclude': "['test', 'docs']"}), "(exclude=['test', 'docs'])\n", (1181, 1207), False, 'from setuptools import setup, find_packages\n')]
jonyg80/youtube-dl
youtube_dl/extractor/turner.py
ef3a87fb77891329de1d3dbebfee53bf50645261
# coding: utf-8 from __future__ import unicode_literals import re from .adobepass import AdobePassIE from ..compat import compat_str from ..utils import ( fix_xml_ampersands, xpath_text, int_or_none, determine_ext, float_or_none, parse_duration, xpath_attr, update_url_query, Extrac...
[((2585, 2660), 're.compile', 're.compile', (['"""(?P<width>[0-9]+)x(?P<height>[0-9]+)(?:_(?P<bitrate>[0-9]+))?"""'], {}), "('(?P<width>[0-9]+)x(?P<height>[0-9]+)(?:_(?P<bitrate>[0-9]+))?')\n", (2595, 2660), False, 'import re\n'), ((4294, 4326), 're.match', 're.match', (['"""https?://"""', 'video_url'], {}), "('https?:...
robk-dev/algo-trading
ml/sandbox/00-data.py
aa8d76ee739431ab24407fe094e0753c588dc8c6
from alpha_vantage.timeseries import TimeSeries from pprint import pprint import json import argparse def save_dataset(symbol='MSFT', time_window='daily_adj'): credentials = json.load(open('creds.json', 'r')) api_key = credentials['av_api_key'] print(symbol, time_window) ts = TimeSeries(key=api_key, o...
[((295, 342), 'alpha_vantage.timeseries.TimeSeries', 'TimeSeries', ([], {'key': 'api_key', 'output_format': '"""pandas"""'}), "(key=api_key, output_format='pandas')\n", (305, 342), False, 'from alpha_vantage.timeseries import TimeSeries\n'), ((813, 838), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '...
al3pht/cloud-custodian
tests/zpill.py
ce6613d1b716f336384c5e308eee300389e6bf50
# Copyright The Cloud Custodian Authors. # SPDX-License-Identifier: Apache-2.0 import fnmatch from io import StringIO import json import os import shutil import zipfile import re from datetime import datetime, timedelta, tzinfo from distutils.util import strtobool import boto3 import placebo from botocore.response imp...
[((7861, 7889), 'placebo.pill.attach', 'pill.attach', (['session', 'prefix'], {}), '(session, prefix)\n', (7872, 7889), False, 'from placebo import pill\n'), ((1130, 1142), 'datetime.timedelta', 'timedelta', (['(0)'], {}), '(0)\n', (1139, 1142), False, 'from datetime import datetime, timedelta, tzinfo\n'), ((1230, 1242...
metaMMA/Flexget
flexget/tests/test_next_series_seasons.py
a38986422461d7935ead1e2b4ed4c88bcd0a90f5
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin import pytest from flexget.entry import Entry # TODO Add more standard tests class TestNextSeriesSeasonSeasonsPack(object): _config = """ templates: ...
[((8759, 8775), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (8773, 8775), False, 'import pytest\n'), ((9106, 13381), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""task_name,inject,result_find"""', "[('test_next_series_seasons_season_pack', ['Test Series 1 S02'], [\n 'Test Series 1 S03']), ('t...
hpatel1567/pymatgen
pymatgen/analysis/wulff.py
8304b25464206c74305214e45935df90bab95500
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. """ This module define a WulffShape class to generate the Wulff shape from a lattice, a list of indices and their corresponding surface energies, and the total area and volume of the wulff shape,the weighted su...
[((1180, 1207), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1197, 1207), False, 'import logging\n'), ((1792, 1803), 'numpy.array', 'np.array', (['b'], {}), '(b)\n', (1800, 1803), True, 'import numpy as np\n'), ((1806, 1817), 'numpy.array', 'np.array', (['a'], {}), '(a)\n', (1814, 1817...
stanojevic/ccgtools
ccg/supertagger/any2int.py
d87521d66fcd1b3110fbecc6b78b15a60e5095a3
class Any2Int: def __init__(self, min_count: int, include_UNK: bool, include_PAD: bool): self.min_count = min_count self.include_UNK = include_UNK self.include_PAD = include_PAD self.frozen = False self.UNK_i = -1 self.UNK_s = "<UNK>" self.PAD_i = -2 ...
[]
sosprz/nettemp
app/sensor.py
334b3124263267c931bd7dc5c1bd8eb70614b4ef
from app import app from flask import Flask, request, jsonify, g import sqlite3 import os import json from random import randint from flask_jwt_extended import jwt_required import datetime from flask_mysqldb import MySQL mysql = MySQL() def get_db(rom): db = getattr(g, '_database', None) if db is None: ...
[((229, 236), 'flask_mysqldb.MySQL', 'MySQL', ([], {}), '()\n', (234, 236), False, 'from flask_mysqldb import MySQL\n'), ((6543, 6581), 'app.app.route', 'app.route', (['"""/sensor"""'], {'methods': "['POST']"}), "('/sensor', methods=['POST'])\n", (6552, 6581), False, 'from app import app\n'), ((6645, 6682), 'app.app.ro...