repo_name
stringlengths
7
94
repo_path
stringlengths
4
237
repo_head_hexsha
stringlengths
40
40
content
stringlengths
10
680k
apis
stringlengths
2
840k
jmarine/ezeeai
ezeeai/utils/hooks.py
091b4ce3bc5794c534084bff3301b15ba8a9be1a
from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.python.training import session_run_hook from tensorflow.python.training.basic_session_run_hooks import NeverTriggerTimer, SecondOrStepTimer from tensorflow.python.training.session_run_hook impor...
[((14, 1, 14, 35), 'tensorflow.python.util.tf_export.tf_export', 'tf_export', ({(14, 11, 14, 34): '"""train.EmailAtStepHook"""'}, {}), "('train.EmailAtStepHook')", False, 'from tensorflow.python.util.tf_export import tf_export\n'), ((63, 17, 63, 41), 'smtplib.SMTP', 'smtplib.SMTP', ({(63, 30, 63, 40): 'smtpserver'}, {}...
whiletrace/dwellinglybackend
tests/factory_fixtures/dummy_resource.py
e766b3d612b4c92fd337b82498ab8ef68bd95e1f
from flask import request from flask_restful import Resource from utils.gatekeeper import allowed_params class DummyResource(Resource): dummy_params = set() @allowed_params(dummy_params) def put(self): return request.json
[((9, 5, 9, 33), 'utils.gatekeeper.allowed_params', 'allowed_params', ({(9, 20, 9, 32): 'dummy_params'}, {}), '(dummy_params)', False, 'from utils.gatekeeper import allowed_params\n')]
JiniousChoi/encyclopedia-in-code
quizzes/00.organize.me/hackerrank/sorted_set/server2.py
77bc551a03a2a3e3808e50016ece14adb5cfbd96
#!/usr/bin/env python3 import socket, threading from queue import Queue import sys, struct # NOTE: Use this path to create the UDS Server socket SERVER_SOCKET_PATH = "./socket"; class Result: def __init__(self): self._evt = threading.Event() self._result = None def set_result(self, value...
[((148, 8, 148, 37), 'socket.socket', 'socket.socket', ({(148, 22, 148, 36): 'socket.AF_UNIX'}, {}), '(socket.AF_UNIX)', False, 'import socket, threading\n'), ((12, 20, 12, 37), 'threading.Event', 'threading.Event', ({}, {}), '()', False, 'import socket, threading\n'), ((28, 24, 28, 31), 'queue.Queue', 'Queue', ({}, {}...
funrunskypalace/vnpy
vnpy/gateway/rohon/__init__.py
2d87aede685fa46278d8d3392432cc127b797926
from .rohon_gateway import RohonGateway
[]
dndtools2/dndtools2
dnd/mobile/urls.py
6bd794349b84f3018dd0bd12712535924557c166
from django.conf.urls import patterns, url, include from .views import force_desktop_version, return_to_mobile_version app_name = 'mobile' urlpatterns = [ # force desktop url(r'^force-desktop-version/$', force_desktop_version, name='force_desktop_version'), # return to mobile version url(r'^return-to...
[((8, 4, 8, 89), 'django.conf.urls.url', 'url', (), '', False, 'from django.conf.urls import patterns, url, include\n'), ((11, 4, 11, 98), 'django.conf.urls.url', 'url', (), '', False, 'from django.conf.urls import patterns, url, include\n'), ((14, 14, 14, 46), 'django.conf.urls.include', 'include', ({(14, 22, 14, 45):...
esteng/guiding-multi-step
ros_aruco.py
3f0db0ba70b5851cc83878f4ed48cf82342a2ddf
""" Calibrate with the ROS package aruco_detect """ import rospy import roslib from geometry_msgs.msg import Transform class ROSArUcoCalibrate: def __init__(self, aruco_tag_len=0.0795): print("Please roslaunch roslaunch aruco_detect aruco_detect.launch before you run!") self.aruco_tf_topic = "/f...
[((15, 34, 15, 94), 'rospy.Subscriber', 'rospy.Subscriber', ({(15, 51, 15, 70): 'self.aruco_tf_topic', (15, 72, 15, 81): 'Transform', (15, 83, 15, 93): 'self._tfCb'}, {}), '(self.aruco_tf_topic, Transform, self._tfCb)', False, 'import rospy\n'), ((20, 12, 20, 51), 'rospy.logwarn', 'rospy.logwarn', ({(20, 26, 20, 50): '...
mmalandra-kb4/service-metrics-gatherer
utils/utils.py
f9a795a43d491ef59a32121ab4ed5c2c62cb968b
""" * Copyright 2019 EPAM Systems * * 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,...
[((24, 9, 24, 51), 'logging.getLogger', 'logging.getLogger', ({(24, 27, 24, 50): '"""metricsGatherer.utils"""'}, {}), "('metricsGatherer.utils')", False, 'import logging\n'), ((28, 17, 28, 30), 'urllib.parse.urlparse', 'urlparse', ({(28, 26, 28, 29): 'url'}, {}), '(url)', False, 'from urllib.parse import urlparse\n'), ...
nassermarafi/SRCSWArchetypes
OSAnalysisHelper.py
105a5e40ef0ba1951108dc52b382ae0c5457057a
from __future__ import absolute_import __author__ = 'marafi' def SolutionAlgorithim(OData, Dt, Tol, Steps): #Insert within the While loop, make sure parameter "ok" is defined import OpenSeesAPI OData.AddObject(OpenSeesAPI.TCL.TCLScript('if {$ok != 0} {')) OData.AddObject(OpenSeesAPI.TCL.TCLScript('put...
[((8, 20, 8, 64), 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', ({(8, 46, 8, 63): '"""if {$ok != 0} {"""'}, {}), "('if {$ok != 0} {')", False, 'import OpenSeesAPI\n'), ((9, 20, 9, 101), 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', ({(9, 46, 9, 100): '(\'puts "Trying Lower Dt: %f and Tol: %f ......
socialpoint-labs/unity-yaml-parser
unityparser/commands.py
91c175140ed32aed301bc34d4311f370da69a8ba
import re from argparse import ArgumentParser from multiprocessing import Pool, Manager, Process from pathlib import Path from .utils import UnityDocument YAML_HEADER = '%YAML' class UnityProjectTester: """ Class to run tests on a given Unity project folder """ AVAILABLE_COMMANDS = ('test_no_yaml_is...
[((21, 21, 21, 37), 'argparse.ArgumentParser', 'ArgumentParser', ({}, {}), '()', False, 'from argparse import ArgumentParser\n'), ((61, 23, 61, 54), 'pathlib.Path', 'Path', ({(61, 28, 61, 53): 'self.options.project_path'}, {}), '(self.options.project_path)', False, 'from pathlib import Path\n'), ((77, 13, 77, 22), 'mul...
kaizhengny/LeetCode
DP/Leetcode 221. Maximal Square.py
67d64536ab80f4966699fe7460d165f2a98d6a82
class Solution: def maximalSquare(self, matrix: List[List[str]]) -> int: if not matrix: return 0 m, n = len(matrix), len(matrix[0]) dp = [[0]*n for _ in range(m)] res = 0 for i in range(m): dp[i][0] = int(matrix[i][0]) for j in range(n): dp[0][...
[]
Polyconseil/dokang
dokang/harvesters/__init__.py
b0ab3e4aabfb97adb2a2e877a42fc1896e5fcf08
# -*- coding: utf-8 -*- # Copyright (c) Polyconseil SAS. All rights reserved. import hashlib import json import logging import os import re from .html import html_config, HtmlHarvester # pylint: disable=unused-import from .sphinx import ( # pylint: disable=unused-import sphinx_config, sphinx_rtd_config, Sph...
[((17, 9, 17, 36), 'logging.getLogger', 'logging.getLogger', ({(17, 27, 17, 35): '__name__'}, {}), '(__name__)', False, 'import logging\n'), ((31, 8, 31, 21), 'hashlib.md5', 'hashlib.md5', ({}, {}), '()', False, 'import hashlib\n'), ((67, 44, 67, 61), 'os.walk', 'os.walk', ({(67, 52, 67, 60): 'base_dir'}, {}), '(base_d...
semccomas/string-method-gmxapi
__init__.py
fb68dce792d35df739225b1048e0816a4a61d45e
__all__ = ["stringmethod"]
[]
yangtao4389/pinche
carPooling/migrations/0018_auto_20190521_1651.py
81463761058f67d47cea980f29a061b1e1b2d08a
# Generated by Django 2.0.4 on 2019-05-21 16:51 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('carPooling', '0017_carpoolingrecunbook'), ] operations = [ migrations.AlterField( model_name='carpoolinguserconf', n...
[((16, 18, 16, 90), 'django.db.models.CharField', 'models.CharField', (), '', False, 'from django.db import migrations, models\n'), ((21, 18, 21, 93), 'django.db.models.CharField', 'models.CharField', (), '', False, 'from django.db import migrations, models\n'), ((26, 18, 26, 101), 'django.db.models.CharField', 'models...
Zer0-One/fuckbot
src/fuckbot/ticker.py
02f5a112988e25a9f04a9a941a55f11cf51c3d8f
import discord import logging TRADING_API_URL='https://cloud.iexapis.com/stable/stock/{0}/quote' TRADING_API_ICON='https://iextrading.com/favicon.ico' def ticker_embed(symbol): ticker = discord.Embed(title=f"{symbol}".upper(), type="rich", color=3029236, url=TRADING_API_URL.format(symbol)) ticker.set_author(n...
[]
johny-c/minos
minos/lib/util/StateSet.py
660e991f44118382f4a3cb7566670c4159d33fe3
import bz2 import csv import collections import math from enum import Enum class Select(Enum): FIRST = 'first' RANGE_KEY = 'range_key' RANGE_VALUE = 'range_value' class SelectPolicy: def __init__(self, policy, field=None): self.policy = policy self.field = field class StateSet: ...
[((205, 13, 205, 66), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (), '', False, 'import argparse\n'), ((136, 21, 136, 38), 'csv.DictReader', 'csv.DictReader', ({(136, 36, 136, 37): 'f'}, {}), '(f)', False, 'import csv\n'), ((153, 21, 153, 38), 'csv.DictReader', 'csv.DictReader', ({(153, 36, 153, 37): 'f'}, {...
pmatigakis/pagetags
pagetags/configuration/development.py
5e81d01493548edc2677453819c32de3cf75d159
DEBUG = True TESTING = False
[]
SvenMarcus/hpc-rocket
hpcrocket/pyfilesystem/factory.py
b28917e7afe6e2e839d1ae58f2e21fba6e3eb61c
from hpcrocket.core.filesystem import Filesystem, FilesystemFactory from hpcrocket.core.launchoptions import Options from hpcrocket.pyfilesystem.localfilesystem import LocalFilesystem from hpcrocket.pyfilesystem.sshfilesystem import SSHFilesystem class PyFilesystemFactory(FilesystemFactory): def __init__(self, o...
[((13, 15, 13, 35), 'hpcrocket.pyfilesystem.localfilesystem.LocalFilesystem', 'LocalFilesystem', ({(13, 31, 13, 34): '"""."""'}, {}), "('.')", False, 'from hpcrocket.pyfilesystem.localfilesystem import LocalFilesystem\n'), ((18, 15, 18, 52), 'hpcrocket.pyfilesystem.sshfilesystem.SSHFilesystem', 'SSHFilesystem', ({(18, ...
vincewhite/cassandra-dtest
cqlsh_tests/cqlsh_tools.py
a01dce6af73a8656e8740227a811fe63025fb3f4
import csv import random import cassandra from cassandra.cluster import ResultSet from typing import List class DummyColorMap(object): def __getitem__(self, *args): return '' def csv_rows(filename, delimiter=None): """ Given a filename, opens a csv file and yields it line by line. """ ...
[((56, 19, 56, 55), 'cassandra.marshal.int64_unpack', 'cassandra.marshal.int64_unpack', ({(56, 50, 56, 54): 'byts'}, {}), '(byts)', False, 'import cassandra\n'), ((24, 19, 24, 53), 'csv.reader', 'csv.reader', ({(24, 30, 24, 37): 'csvfile'}, {}), '(csvfile, **reader_opts)', False, 'import csv\n'), ((49, 17, 49, 36), 'cs...
LastRemote/sagemaker-python-sdk
tests/unit/sagemaker/tensorflow/test_estimator_init.py
fddf29d9e4383cd3f939253eef47ee79a464dd37
# Copyright Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file accompan...
[((26, 1, 26, 17), 'pytest.fixture', 'pytest.fixture', ({}, {}), '()', False, 'import pytest\n'), ((42, 1, 42, 55), 'mock.patch', 'patch', ({(42, 7, 42, 54): '"""sagemaker.fw_utils.python_deprecation_warning"""'}, {}), "('sagemaker.fw_utils.python_deprecation_warning')", False, 'from mock import Mock, patch\n'), ((28, ...
sofwerx/mycroft-articlekeyword-skill
testing.py
7cab109db512d3a6465db241b18018e9415f4a9f
import subprocess proc = subprocess.Popen(['python3', 'articlekeywords.py', 'aih.txt' , '5'], stdout=subprocess.PIPE ) #print(type(proc.communicate()[0])) # path = '/opt/mycroft/skills/mycroft-bitcoinprice-skill/' text = proc.stdout.read() rows = text.splitlines() #print(text.splitlines()) count = 0 s = "" for ...
[((4, 7, 4, 101), 'subprocess.Popen', 'subprocess.Popen', (), '', False, 'import subprocess\n')]
mirrorcoloured/slcypi
slcyGeneral.py
c47975b3523f770d12a521c82e2dfca181e3f35b
# Python 2.7.1 import RPi.GPIO as GPIO from twython import Twython import time import sys import os import pygame APP_KEY='zmmlyAJzMDIntLpDYmSH98gbw' APP_SECRET='ksfSVa2hxvTQKYy4UR9tjpb57CAynMJDsygz9qOyzlH24NVwpW' OAUTH_TOKEN='794094183841566720-BagrHW91yH8C3Mdh9SOlBfpL6wrSVRW' OAUTH_TOKEN_SECRET='d0Uucq2dkSHrFHZGLM1...
[((14, 14, 14, 75), 'twython.Twython', 'Twython', ({(14, 22, 14, 29): 'APP_KEY', (14, 31, 14, 41): 'APP_SECRET', (14, 43, 14, 54): 'OAUTH_TOKEN', (14, 56, 14, 74): 'OAUTH_TOKEN_SECRET'}, {}), '(APP_KEY, APP_SECRET, OAUTH_TOKEN, OAUTH_TOKEN_SECRET)', False, 'from twython import Twython\n'), ((19, 4, 19, 18), 'RPi.GPIO.c...
PetervdPerk-NXP/pyarmnn-release
python/pyarmnn/scripts/generate_docs.py
2008c270f7c7c84a930842c845138628c8b95713
# Copyright © 2019 Arm Ltd. All rights reserved. # Copyright 2020 NXP # SPDX-License-Identifier: MIT import os import tarfile import pyarmnn as ann import shutil from typing import List, Union from pdoc.cli import main package_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..') d...
[((59, 22, 59, 72), 'os.path.join', 'os.path.join', ({(59, 35, 59, 46): 'package_dir', (59, 48, 59, 52): '""".."""', (59, 54, 59, 58): '""".."""', (59, 60, 59, 71): '"""README.md"""'}, {}), "(package_dir, '..', '..', 'README.md')", False, 'import os\n'), ((64, 4, 64, 10), 'pdoc.cli.main', 'main', ({}, {}), '()', False,...
jeffzhengye/pylearn
tests/gejun_sum.py
a140d0fca8a371faada194cb0126192675cc2045
__author__ = 'jeffye' def sum_consecutives(s): i = 1 li = [] if i < len(s): n = 1 while s[i] != s[i + 1] and s[i] != s[i - 1]: sum = s[i] i = i + 1 return sum while s[i] == s[i + 1]: n = n + 1 sum = s[i] * n i = i + 1 return sum ...
[]
tscher/PySDDP
PySDDP/term.py
ece69b77c951cbb1f046ac184f6fe4fc025ad690
class term(object): # Dados de cadastro das usinas termeletrica (presentes no TERM.DAT) Codigo = None Nome = None Potencia = None FCMax = None TEIF = None IP = None GTMin = None # Dados Adicionais Especificados no arquivo de configuracao termica (CONFT) Sist = None Status = ...
[]
b2bs-team/pylint-errors
plerr/__main__.py
f1362c8afbe6b7075f805560d7699f63ad35a10b
"""plerr entrypoint""" from plerr import cli if __name__ == '__main__': cli.main()
[((5, 4, 5, 14), 'plerr.cli.main', 'cli.main', ({}, {}), '()', False, 'from plerr import cli\n')]
CamouOkau/messenger_new_years_bot
code/send.py
38f3c26b6c5b4dae7fe48f8b61680ec903c0deac
import sys import time from datetime import datetime from bot import FbMessengerBot if __name__ == "__main__": if len(sys.argv) < 3: print("No email or password provided") else: bot = FbMessengerBot(sys.argv[1], sys.argv[2]) with open("users.txt", "r") as file: users = dict...
[((11, 14, 11, 54), 'bot.FbMessengerBot', 'FbMessengerBot', ({(11, 29, 11, 40): 'sys.argv[1]', (11, 42, 11, 53): 'sys.argv[2]'}, {}), '(sys.argv[1], sys.argv[2])', False, 'from bot import FbMessengerBot\n'), ((19, 19, 19, 33), 'datetime.datetime.now', 'datetime.now', ({}, {}), '()', False, 'from datetime import datetim...
ghanshyammann/senlin-tempest-plugin
senlin_tempest_plugin/api/policies/test_policy_update_negative.py
9f33bbe723eb381f93c2248a6a277efef3d92ec3
# 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, software # distributed under t...
[((22, 5, 22, 39), 'tempest.lib.decorators.attr', 'decorators.attr', (), '', False, 'from tempest.lib import decorators\n'), ((23, 5, 23, 69), 'tempest.lib.decorators.idempotent_id', 'decorators.idempotent_id', ({(23, 30, 23, 68): '"""5df90d82-9889-4c6f-824c-30272bcfa767"""'}, {}), "('5df90d82-9889-4c6f-824c-30272bcfa7...
hal0x2328/neo3-boa
boa3_test/test_sc/interop_test/contract/DestroyContract.py
6825a3533384cb01660773050719402a9703065b
from boa3.builtin import public from boa3.builtin.interop.contract import destroy_contract @public def Main(): destroy_contract()
[((7, 4, 7, 22), 'boa3.builtin.interop.contract.destroy_contract', 'destroy_contract', ({}, {}), '()', False, 'from boa3.builtin.interop.contract import destroy_contract\n')]
qinfeng2011/wltp
tests/test_vmax.py
317ad38fb96599a29d22e40f69b6aeb4d205611d
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2019 European Commission (JRC); # Licensed under the EUPL (the 'Licence'); # You may not use this work except in compliance with the Licence. # You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl import functools as fnt import logging impo...
[((24, 0, 24, 40), 'logging.basicConfig', 'logging.basicConfig', (), '', False, 'import logging\n'), ((25, 6, 25, 33), 'logging.getLogger', 'logging.getLogger', ({(25, 24, 25, 32): '__name__'}, {}), '(__name__)', False, 'import logging\n'), ((44, 16, 44, 59), 'wltp.engine.interpolate_wot_on_v_grid', 'engine.interpolate...
giuseppe/quay
util/canonicaljson.py
a1b7e4b51974edfe86f66788621011eef2667e6a
import collections def canonicalize(json_obj, preserve_sequence_order=True): """ This function canonicalizes a Python object that will be serialized as JSON. Example usage: json.dumps(canonicalize(my_obj)) Args: json_obj (object): the Python object that will later be serialized as JSON. Re...
[((21, 15, 21, 50), 'collections.OrderedDict', 'collections.OrderedDict', ({(21, 39, 21, 49): 'sorted_obj'}, {}), '(sorted_obj)', False, 'import collections\n')]
russss/datasette-geo
datasette_plugin_geo/inspect.py
d4cecc020848bbde91e9e17bf352f7c70bc3dccf
from datasette import hookimpl from datasette.utils import detect_spatialite from shapely import wkt def get_spatial_tables(conn): if not detect_spatialite(conn): return {} spatial_tables = {} c = conn.cursor() c.execute( """SELECT f_table_name, f_geometry_column, srid, spatial_index_...
[((7, 11, 7, 34), 'datasette.utils.detect_spatialite', 'detect_spatialite', ({(7, 29, 7, 33): 'conn'}, {}), '(conn)', False, 'from datasette.utils import detect_spatialite\n'), ((41, 15, 41, 30), 'shapely.wkt.loads', 'wkt.loads', ({(41, 25, 41, 29): 'data'}, {}), '(data)', False, 'from shapely import wkt\n')]
Sinon/microcosm-pubsub
microcosm_pubsub/context.py
c98a188fcd5b3f358c7171dae0c39a33c5774a4e
""" Message context. """ from typing import Dict from microcosm.api import defaults, typed from microcosm.config.types import boolean from microcosm_logging.decorators import logger from microcosm_pubsub.constants import TTL_KEY, URI_KEY from microcosm_pubsub.message import SQSMessage @defaults( enable_ttl=typ...
[((16, 15, 16, 49), 'microcosm.api.typed', 'typed', (), '', False, 'from microcosm.api import defaults, typed\n'), ((17, 16, 17, 44), 'microcosm.api.typed', 'typed', (), '', False, 'from microcosm.api import defaults, typed\n')]
murdockcrc/python-tricks
azure_ml/pytorch_classifier/train_parameterized.py
57f7ad9c00a045c1f9f18f89bed6e73be6c85b69
import os import argparse import torch import torch.optim as optim import torchvision import torchvision.transforms as transforms from model import Net from azureml.core import Run run = Run.get_context() if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument( '--data_path', ...
[((11, 6, 11, 23), 'azureml.core.Run.get_context', 'Run.get_context', ({}, {}), '()', False, 'from azureml.core import Run\n'), ((14, 11, 14, 36), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ({}, {}), '()', False, 'import argparse\n'), ((46, 13, 51, 3), 'torchvision.datasets.CIFAR10', 'torchvision.datasets.CI...
kazqvaizer/arq-sqlalchemy-boilerplate
src/tests/test_app_db.py
c14596ed358a061e6eb2a380f4bd962242b123f3
import pytest from app.db import session_scope pytestmark = pytest.mark.asyncio async def test_engine_configured(env): async with session_scope() as session: assert str(session.bind.engine.url) == env("SQLALCHEMY_DATABASE_URI")
[((9, 15, 9, 30), 'app.db.session_scope', 'session_scope', ({}, {}), '()', False, 'from app.db import session_scope\n')]
cgarciae/catalyst
catalyst/core/callbacks/formatters.py
391ff89ab0d9a1961b88719e894f917ac0fb7fc3
from abc import ABC, abstractmethod from datetime import datetime import json import logging from catalyst import utils from catalyst.core import _State class MetricsFormatter(ABC, logging.Formatter): """ Abstract metrics formatter """ def __init__(self, message_prefix): """ Args: ...
[((106, 15, 106, 63), 'json.dumps', 'json.dumps', (), '', False, 'import json\n'), ((62, 16, 62, 52), 'catalyst.utils.format_metric', 'utils.format_metric', ({(62, 36, 62, 42): 'm_name', (62, 44, 62, 51): 'm_value'}, {}), '(m_name, m_value)', False, 'from catalyst import utils\n'), ((104, 17, 104, 31), 'datetime.dateti...
Suraj1127/fuzzy-matcher
fuzzy/fuzzy.py
a3a6ecc6954d79ca65e2517f93db44cc432e7a90
#!/usr/bin/env python3 """ Description: Python script to append the common columns in one sheet from another sheet using fuzzy matching. """ import pip def import_or_install(package): try: __import__(package) except ImportError: pip.main(['install', package]) import os import sys im...
[((144, 13, 144, 38), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ({}, {}), '()', False, 'import argparse\n'), ((184, 7, 184, 39), 'os.path.isfile', 'os.path.isfile', ({(184, 22, 184, 38): 'args.destination'}, {}), '(args.destination)', False, 'import os\n'), ((198, 13, 198, 38), 'argparse.ArgumentParser', 'a...
zkbt/exopop
exoatlas/visualizations/panels/BubblePanel.py
5e8b9d391fe9e2d39c623d7ccd7eca8fd0f0f3f8
from .Panel import * __all__ = ['BubblePanel'] default_size = plt.matplotlib.rcParams['lines.markersize']**2 class BubblePanel(Panel): ''' BubblePanel is a general wrapper for making scatter plots where planets are represented as bubbles that can have informative sizes and/or colors. ''' def...
[]
pengwu/scapy_env
venv/lib/python2.7/dist-packages/landscape/sysinfo/load.py
3db9c5dea2e219048a2387649d6d89be342903d9
import os from twisted.internet.defer import succeed class Load(object): def register(self, sysinfo): self._sysinfo = sysinfo def run(self): self._sysinfo.add_header("System load", str(os.getloadavg()[0])) return succeed(None)
[((13, 15, 13, 28), 'twisted.internet.defer.succeed', 'succeed', ({(13, 23, 13, 27): 'None'}, {}), '(None)', False, 'from twisted.internet.defer import succeed\n'), ((12, 52, 12, 67), 'os.getloadavg', 'os.getloadavg', ({}, {}), '()', False, 'import os\n')]
dougmorato/bag-of-holding
src/boh_api/viewsets.py
8a7bc45ced8837bdb00da60dcfb496bb0271f161
from rest_framework import viewsets from boh import models from . import serializers class OrganizationViewSet(viewsets.ModelViewSet): queryset = models.Organization.objects.all() serializer_class = serializers.OrganizationSerializer class ApplicationViewSet(viewsets.ModelViewSet): queryset = models.A...
[((9, 15, 9, 48), 'boh.models.Organization.objects.all', 'models.Organization.objects.all', ({}, {}), '()', False, 'from boh import models\n'), ((14, 15, 14, 47), 'boh.models.Application.objects.all', 'models.Application.objects.all', ({}, {}), '()', False, 'from boh import models\n'), ((19, 15, 19, 39), 'boh.models.Ta...
TatendaNoreen/Python
githubintro-fe2d832af2bad7d6b27d036c205cc9d8414b2183/CommunicationAnimation.py
df9799bbea84af03c1fb3b29fada1e16c04bab80
import matplotlib matplotlib.use('TkAgg') import matplotlib.pyplot import agentframework import csv import matplotlib.animation #create environment in which agents will operate environment=[] #read csv downloaded file f = open('in.txt', newline='') reader = csv.reader(f, quoting=csv.QUOTE_NONNUMERIC) for row in ...
[((2, 0, 2, 23), 'matplotlib.use', 'matplotlib.use', ({(2, 15, 2, 22): '"""TkAgg"""'}, {}), "('TkAgg')", False, 'import matplotlib\n'), ((15, 9, 15, 52), 'csv.reader', 'csv.reader', (), '', False, 'import csv\n'), ((36, 6, 36, 46), 'matplotlib.pyplot.figure', 'matplotlib.pyplot.figure', (), '', False, 'import matplotli...
opencv/openvino_training_extensions
external/model-preparation-algorithm/tests/conftest.py
f5d809741e192a2345558efc75899a475019cf98
# Copyright (C) 2022 Intel Corporation # SPDX-License-Identifier: Apache-2.0 # try: import e2e.fixtures from e2e.conftest_utils import * # noqa from e2e.conftest_utils import pytest_addoption as _e2e_pytest_addoption # noqa from e2e import config # noqa from e2e.utils import get_plugins_...
[((37, 1, 37, 32), 'pytest.fixture', 'pytest.fixture', (), '', False, 'import pytest\n'), ((47, 1, 47, 32), 'pytest.fixture', 'pytest.fixture', (), '', False, 'import pytest\n'), ((12, 21, 12, 53), 'e2e.utils.get_plugins_from_packages', 'get_plugins_from_packages', ({(12, 47, 12, 52): '[e2e]'}, {}), '([e2e])', False, '...
rtpsw/ibis
ibis/udf/validate.py
d7318fdf87121cd8fadbcf0369a2b217aab3053a
"""Validation for UDFs. Warning: This is an experimental module and API here can change without notice. DO NOT USE DIRECTLY. """ from inspect import Parameter, Signature, signature from typing import Any, Callable, List import ibis.common.exceptions as com from ibis.expr.datatypes import DataType def _parameter_c...
[((54, 14, 54, 29), 'inspect.signature', 'signature', ({(54, 24, 54, 28): 'func'}, {}), '(func)', False, 'from inspect import Parameter, Signature, signature\n'), ((82, 14, 84, 9), 'ibis.common.exceptions.IbisTypeError', 'com.IbisTypeError', ({(83, 12, 83, 65): '"""The output type of a UDF must be a single datatype."""...
stattikcms/stattik
packages/stattik/stattik/schema/schema.py
5c96d600d105461edb95a11d8050dee3c32edd1e
import inspect from ariadne import make_executable_schema, QueryType, MutationType, SubscriptionType from .resolver import * # # Schema # class GrammarError(Exception): pass keywords = ['query', 'mutation', 'subscription', 'source'] class SchemaMetaDict(dict): ''' Dictionary that allows decorated sche...
[((148, 20, 148, 40), 'inspect.unwrap', 'inspect.unwrap', ({(148, 35, 148, 39): 'func'}, {}), '(func)', False, 'import inspect\n'), ((182, 26, 182, 37), 'ariadne.QueryType', 'QueryType', ({}, {}), '()', False, 'from ariadne import make_executable_schema, QueryType, MutationType, SubscriptionType\n'), ((183, 29, 183, 43...
DankMickey/Project-Altis-Educational-Source
toontown/battle/DistributedBattleBaseAI.py
0a74999fb52d4e690a41b984703119f63c372d20
import random from otp.ai.AIBase import * from direct.distributed.ClockDelta import * from toontown.battle.BattleBase import * from toontown.battle.BattleCalculatorAI import * from toontown.toonbase.ToontownBattleGlobals import * from toontown.battle.SuitBattleGlobals import * from pandac.PandaModules import * from too...
[((24, 13, 24, 83), 'direct.directnotify.DirectNotifyGlobal.directNotify.newCategory', 'DirectNotifyGlobal.directNotify.newCategory', ({(24, 57, 24, 82): '"""DistributedBattleBaseAI"""'}, {}), "('DistributedBattleBaseAI')", False, 'from direct.directnotify import DirectNotifyGlobal\n'), ((27, 8, 27, 67), 'direct.distri...
HsunGong/Augmented-Advertisement
tracking_test.py
ae9d0f5796c13e837a1a547d888647aeb61f0b04
# Copyright (c) Group Three-Forest SJTU. All Rights Reserved. from tracking.tracking import * # a = tracking_video_rectangle("video/","1.mp4",[[273,352],[266,616],[412,620],[416,369]]) a = tracking_video_rectangle_tovideo("video/","1.mp4", "1.png", [[273,352],[266,616],[412,620],[416,369]], result = 'result__.a...
[]
katetolstaya/gym-flock
gym_flock/envs/old/flocking_position.py
3236d1dafcb1b9be0cf78b471672e8becb2d37af
import gym from gym import spaces, error, utils from gym.utils import seeding import numpy as np from scipy.spatial.distance import pdist, squareform import configparser from os import path import matplotlib.pyplot as plt from matplotlib.pyplot import gca font = {'family' : 'sans-serif', 'weight' : 'bold', ...
[((20, 17, 20, 44), 'configparser.ConfigParser', 'configparser.ConfigParser', ({}, {}), '()', False, 'import configparser\n'), ((50, 21, 50, 86), 'numpy.zeros', 'np.zeros', ({(50, 30, 50, 85): '(self.n_nodes, self.nx * self.filter_len, self.n_pools)'}, {}), '((self.n_nodes, self.nx * self.filter_len, self.n_pools))', T...
codingwangfeng/GoodGoodName
conf/constants.py
02bfeb3ae65fd9ba0354f5b67237fcad4c0e11cb
# -*-coding:utf-8-*- # from functools import reduce from functools import reduce SANCAI_jixiang = [1, 3, 5, 7, 8, 11, 13, 15, 16, 18, 21, 23, 24, 25, 31, 32, 33, 35, 37, 39, 41, 45, 47, 48, 52, 57, 61, 63, 65, 67, 68, 81] # 吉祥运暗示数(代表健全,幸福,名誉等) SANCAI_xiaoji = [6, 17, 26, 27, 29, 30,...
[((34, 19, 34, 66), 'functools.reduce', 'reduce', ({(34, 27, 34, 45): 'lambda x, y: x + y', (34, 48, 34, 61): 'good_num_list', (34, 63, 34, 65): '[]'}, {}), '(lambda x, y: x + y, good_num_list, [])', False, 'from functools import reduce\n'), ((35, 18, 35, 64), 'functools.reduce', 'reduce', ({(35, 26, 35, 44): 'lambda x...
kevinmuturi5/farm-Management-system
main/migrations/0006_labourer_allproj.py
61929d7998d92d56daac67c2f8ace3cc76b6ee8b
# Generated by Django 3.1.2 on 2020-10-18 16:07 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('main', '0005_auto_20201018_1902'), ] operations = [ migrations.AddField( model_name='labourer', name='allproj', ...
[((16, 18, 16, 71), 'django.db.models.ManyToManyField', 'models.ManyToManyField', (), '', False, 'from django.db import migrations, models\n')]
beachwood23/taurus
bzt/modules/blazemeter/blazemeter_reporter.py
698ac747bae5d4940a879a8526add67c11ef42da
""" Module for reporting into http://www.blazemeter.com/ service Copyright 2015 BlazeMeter 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 Unles...
[((56, 34, 56, 45), 'time.time', 'time.time', ({}, {}), '()', False, 'import time\n'), ((64, 21, 64, 27), 'bzt.bza.User', 'User', ({}, {}), '()', False, 'from bzt.bza import User, Session, Test\n'), ((182, 16, 182, 25), 'io.BytesIO', 'BytesIO', ({}, {}), '()', False, 'from io import BytesIO\n'), ((392, 20, 392, 44), 'c...
wyli/nitorch
nitorch/nn/losses/_spatial.py
3ecd18944cf45fb9193c4c6ffc32953c4d1c71ac
""" Losses that assume an underlying spatial organization (gradients, curvature, etc.) """ import torch import torch.nn as tnn from nitorch.core.pyutils import make_list, prod from nitorch.core.utils import slice_tensor from nitorch.spatial import diff1d from ._base import Loss class LocalFeatures(tnn.Module): "...
[((90, 15, 90, 30), 'nitorch.core.pyutils.make_list', 'make_list', ({(90, 25, 90, 29): 'side'}, {}), '(side)', False, 'from nitorch.core.pyutils import make_list, prod\n'), ((94, 14, 94, 28), 'nitorch.core.pyutils.make_list', 'make_list', ({(94, 24, 94, 27): 'dim'}, {}), '(dim)', False, 'from nitorch.core.pyutils impor...
roberthtamayose/digitalmenu
items/models.py
19c6633844934fd95f861674946da386411a19c9
from django.db import models from django.utils import timezone class Categoria(models.Model): nome = models.CharField(max_length=255) def __str__(self): return self.nome class Item(models.Model): nome = models.CharField(max_length=255) data_criacao = models.DateTimeField(default=timezone.no...
[((6, 11, 6, 43), 'django.db.models.CharField', 'models.CharField', (), '', False, 'from django.db import models\n'), ((13, 11, 13, 43), 'django.db.models.CharField', 'models.CharField', (), '', False, 'from django.db import models\n'), ((14, 19, 14, 61), 'django.db.models.DateTimeField', 'models.DateTimeField', (), ''...
zeroday0619/XenXenXenSe
app/services/__init__.py
5af079e5edde3a6e4a1f5868052480d7b140d87c
from app.services.console import Console from app.services.server import Server __main__ = ["server", "console"]
[]
nuclearsandwich-ros/twist_mux-release
launch/twist_mux_launch.py
d92dcda0255e727b899d3bac62ef3d89c19cb38e
#!/usr/bin/env python3 # Copyright 2020 Gaitech Korea Co., Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
[((27, 40, 27, 80), 'ament_index_python.packages.get_package_share_directory', 'get_package_share_directory', ({(27, 68, 27, 79): '"""twist_mux"""'}, {}), "('twist_mux')", False, 'from ament_index_python.packages import get_package_share_directory\n'), ((29, 41, 29, 81), 'ament_index_python.packages.get_package_share_d...
psu-capstone-teamD/ElementalAuth
Tests/testLiveService.py
d896efad5a3e4cb453c324afc456aa82f82da239
import sys import unittest import requests_mock from mock import patch sys.path.append('services/LiveService') from LiveService import LiveService L = LiveService() baseURL = "https://yanexx65s8e1.live.elementalclouddev.com/api" class LiveServiceTest(unittest.TestCase): '''@patch('services.LiveService.LiveSe...
[((5, 0, 5, 39), 'sys.path.append', 'sys.path.append', ({(5, 16, 5, 38): '"""services/LiveService"""'}, {}), "('services/LiveService')", False, 'import sys\n'), ((10, 4, 10, 17), 'LiveService.LiveService', 'LiveService', ({}, {}), '()', False, 'from LiveService import LiveService\n'), ((26, 5, 26, 27), 'requests_mock.M...
LionelMassoulard/aikit
tests/models/test_stacking.py
98b2abaa3bf47ab46f2fd3c270010293de06dba9
# -*- coding: utf-8 -*- """ Created on Fri Sep 14 11:49:10 2018 @author: Lionel Massoulard """ import pytest import numpy as np import pandas as pd from sklearn.base import is_regressor, is_classifier from sklearn.exceptions import NotFittedError from sklearn.model_selection import KFold from sklearn.ensemble impo...
[((28, 4, 28, 23), 'numpy.random.seed', 'np.random.seed', ({(28, 19, 28, 22): '(123)'}, {}), '(123)', True, 'import numpy as np\n'), ((29, 8, 29, 32), 'numpy.random.randn', 'np.random.randn', ({(29, 24, 29, 27): '100', (29, 29, 29, 31): '10'}, {}), '(100, 10)', True, 'import numpy as np\n'), ((67, 4, 67, 23), 'numpy.ra...
odrolliv13/Hex-Photos
employee/views/check_rental.py
d1b42b63394783164f843fe6343491f04fe11e0c
from django import forms from django.conf import settings from django.http import HttpResponse, HttpResponseRedirect, Http404 from manager import models as pmod from . import templater from django.conf import settings import decimal, datetime # This view will display all users and then on a new page display al...
[((13, 9, 13, 38), 'django.http.HttpResponseRedirect', 'HttpResponseRedirect', ({(13, 30, 13, 37): '"""/shop"""'}, {}), "('/shop')", False, 'from django.http import HttpResponse, HttpResponseRedirect, Http404\n'), ((16, 9, 16, 38), 'django.http.HttpResponseRedirect', 'HttpResponseRedirect', ({(16, 30, 16, 37): '"""/sho...
nguyenngtt/GSE---TEAM-A
jupyter/settings.py
4f78c1ace051d4f2ff30a039aa481aa9b79d3242
import pandas as pd import numpy as np import os import logging # suppress warnings import warnings; warnings.filterwarnings('ignore'); from tqdm.autonotebook import tqdm # register `pandas.progress_apply` and `pandas.Series.map_apply` with `tqdm` tqdm.pandas() # https://pandas.pydata.org/pandas-docs/stable/user_g...
[((9, 0, 9, 33), 'warnings.filterwarnings', 'warnings.filterwarnings', ({(9, 24, 9, 32): '"""ignore"""'}, {}), "('ignore')", False, 'import warnings\n'), ((14, 0, 14, 13), 'tqdm.autonotebook.tqdm.pandas', 'tqdm.pandas', ({}, {}), '()', False, 'from tqdm.autonotebook import tqdm\n'), ((26, 0, 26, 34), 'numpy.set_printop...
jeanbez/spack
var/spack/repos/builtin/packages/py-cyvcf2/package.py
f4e51ce8f366c85bf5aa0eafe078677b42dae1ba
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack.package import * class PyCyvcf2(PythonPackage): """fast vcf parsing with cython + htslib""" homepage...
[]
mottaquikarim/pydev-psets
pset_functions/db_search/p1.py
9749e0d216ee0a5c586d0d3013ef481cc21dee27
""" GPA Calculator """ # Write a function called "simple_gpa" to find GPA when student enters a letter grade as a string. Assign the result to a variable called "gpa". """ Use these conversions: A+ --> 4.0 A --> 4.0 A- --> 3.7 B+ --> 3.3 B --> 3.0 B- --> 2.7 C+ --> 2.3 C --> 2.0 C- --> 1.7 D+ --> 1.3 D --> 1.0 D- -->...
[]
flying-sheep/SoundCard
test_soundcard.py
b476c8142b460fc8161d374b282fe846d72a0780
import sys import soundcard import numpy import pytest ones = numpy.ones(1024) signal = numpy.concatenate([[ones], [-ones]]).T def test_speakers(): for speaker in soundcard.all_speakers(): assert isinstance(speaker.name, str) assert hasattr(speaker, 'id') assert isinstance(speaker.channels...
[((6, 7, 6, 23), 'numpy.ones', 'numpy.ones', ({(6, 18, 6, 22): '1024'}, {}), '(1024)', False, 'import numpy\n'), ((7, 9, 7, 45), 'numpy.concatenate', 'numpy.concatenate', ({(7, 27, 7, 44): '[[ones], [-ones]]'}, {}), '([[ones], [-ones]])', False, 'import numpy\n'), ((10, 19, 10, 43), 'soundcard.all_speakers', 'soundcard...
jaiveergill/Last-Three-Digits-of-11-x
Last 3 digits of 11^x.py
def4519b9b46e41b4c4f2b3a5dbe5566316dd83e
# This is a simple program to find the last three digits of 11 raised to any given number. # The main algorithm that does the work is on line 10 def trim_num(num): if len(str(num)) > 3: # no need to trim if the number is 3 or less digits long return str(num)[(len(str(num)) - 3):] # trims the number ret...
[]
ljb2208/osr-rover-code
osr_odometry/scripts/osr_odom_ackerman2.py
f4791d835cd760446777a226d37bb3114256affd
#!/usr/bin/env python import time from osr_msgs.msg import Joystick, Commands, Encoder, RunStop from nav_msgs.msg import Odometry from geometry_msgs.msg import Point, Pose, Quaternion, Twist, Vector3 import rospy import tf import math import numpy class Odometry2(): def __init__(self, baseFrame, wheelTrack, mpt, d...
[((181, 4, 181, 36), 'rospy.init_node', 'rospy.init_node', ({(181, 20, 181, 35): '"""osr_odometry2"""'}, {}), "('osr_odometry2')", False, 'import rospy\n'), ((182, 4, 182, 52), 'rospy.loginfo', 'rospy.loginfo', ({(182, 18, 182, 51): '"""Starting the osr odometry2 node"""'}, {}), "('Starting the osr odometry2 node')", F...
alisiahkoohi/importance-of-transfer-learning
src/simulation-conditioning/utilities/data-generation-scripts/Wavefield_Marmousi_pml_401x301_1000-1287_120-232_4k_20kp100_A_train.py
bb4c7943f4ff64a2f1785503328b4cbb4f5111aa
import numpy as np import h5py import os from devito.logger import info from devito import TimeFunction, clear_cache from examples.seismic.acoustic import AcousticWaveSolver from examples.seismic import Model, RickerSource, Receiver, TimeAxis from math import floor from scipy.interpolate import griddata import argparse...
[((12, 9, 12, 48), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (), '', False, 'import argparse\n'), ((27, 5, 27, 32), 'numpy.reshape', 'np.reshape', ({(27, 16, 27, 18): 'vp', (27, 20, 27, 31): '(1601, 401)'}, {}), '(vp, (1601, 401))', True, 'import numpy as np\n'), ((31, 9, 31, 46), 'numpy.zeros', 'np.zeros',...
divine-coder/CODECHEF-PYTHON
facto.py
a1e34d6f9f75cf7b9497f1ef2f937cb4f64f1543
import math if __name__=='__main__': n=(int)(input()) for abc in range(n): t=(int)(input()) print math.factorial(t)
[]
johnmartingodo/pyKinematicsKineticsToolbox
setup.py
4ffc99885f3c637b8c33914a4e50ccb4595fc844
from setuptools import setup setup(name="pykinematicskineticstoolbox", version="0.0", description="Installable python package which collects useful kinematics and kinetics functions", author="John Martin K. Godø", author_email="john.martin.kleven.godo@gmail.com", license="MIT", packages=["pykinematic...
[((3, 0, 11, 1), 'setuptools.setup', 'setup', (), '', False, 'from setuptools import setup\n')]
bit0fun/plugins
summary/summary_avail.py
1f6f701bf1e60882b8fa61cb735e7033c8c29e3c
from datetime import datetime # ensure an rpc peer is added def addpeer(p, rpcpeer): pid = rpcpeer['id'] if pid not in p.persist['peerstate']: p.persist['peerstate'][pid] = { 'connected': rpcpeer['connected'], 'last_seen': datetime.now() if rpcpeer['connected'] else None, ...
[((28, 55, 28, 69), 'datetime.datetime.now', 'datetime.now', ({}, {}), '()', False, 'from datetime import datetime\n'), ((10, 25, 10, 39), 'datetime.datetime.now', 'datetime.now', ({}, {}), '()', False, 'from datetime import datetime\n')]
hugovk/python-terrascript
terrascript/dns/r.py
08fe185904a70246822f5cfbdc9e64e9769ec494
# terrascript/dns/r.py import terrascript class dns_a_record_set(terrascript.Resource): pass class dns_aaaa_record_set(terrascript.Resource): pass class dns_cname_record(terrascript.Resource): pass class dns_mx_record_set(terrascript.Resource): pass class dns_ns_record_set(terrascript.Resource...
[]
gneumann333/jumpscaleX_core
JumpscaleCore/clients/tcprouter/TCPRouterFactory.py
777d249fa3668c6e802c2f765f4b82fb39c3e5fa
from Jumpscale import j from .TCPRouterClient import TCPRouterClient JSConfigs = j.baseclasses.object_config_collection class TCPRouterFactory(JSConfigs): __jslocation__ = "j.clients.tcp_router" _CHILDCLASS = TCPRouterClient def test(self): """ kosmos 'j.clients.tcp_router.test()' ...
[]
miguelarbesu/nmrglue
nmrglue/fileio/spinsolve.py
6ca36de7af1a2cf109f40bf5afe9c1ce73c9dcdc
""" Functions for reading Magritek Spinsolve binary (dx/1d) files and parameter (acqu.par/proc.par) files. """ import os from warnings import warn import numpy as np from . import fileiobase from . import jcampdx __developer_info__ = """ Spinsolve is the software used on the Magritek benchtop NMR devices. A spect...
[((82, 14, 82, 40), 'os.path.join', 'os.path.join', ({(82, 27, 82, 30): 'dir', (82, 32, 82, 39): 'acqupar'}, {}), '(dir, acqupar)', False, 'import os\n'), ((83, 7, 83, 30), 'os.path.isfile', 'os.path.isfile', ({(83, 22, 83, 29): 'acqupar'}, {}), '(acqupar)', False, 'import os\n'), ((92, 14, 92, 39), 'os.path.join', 'os...
mielgosez/navigation_analytics
src/navigation_analytics/navigation_data.py
3c382e8200afe4d37fa0880f155bf1bb2f48b83f
import logging import copy import pickle import pandas as pd class BaseClass: def __init__(self, input_data: pd.DataFrame, logger: logging.Logger, metadata: dict): self.__input_data = input_data self.__logger = logger self.__metadata = met...
[((447, 24, 448, 58), 'logging.Logger', 'logging.Logger', (), '', False, 'import logging\n'), ((495, 23, 495, 47), 'pandas.ExcelWriter', 'pd.ExcelWriter', ({(495, 38, 495, 46): 'filename'}, {}), '(filename)', True, 'import pandas as pd\n'), ((503, 20, 503, 79), 'pandas.DataFrame', 'pd.DataFrame', ({(503, 33, 503, 78): ...
CalColson/openskill.py
openskill/statistics.py
ab61ca57fa6e60140d0a292c73440f22ceabd9a2
import sys import scipy.stats normal = scipy.stats.norm(0, 1) def phi_major(x): return normal.cdf(x) def phi_minor(x): return normal.pdf(x) def v(x, t): xt = x - t denom = phi_major(xt) return -xt if (denom < sys.float_info.epsilon) else phi_minor(xt) / denom def w(x, t): xt = x - t ...
[]
revesansparole/oacontainer
src/openalea/container/graph.py
066a15b8b1b22f857bf25ed443c5f39f4cbefb3e
# -*- coding: utf-8 -*- # # Graph : graph package # # Copyright or Copr. 2006 INRIA - CIRAD - INRA # # File author(s): Jerome Chopard <jerome.chopard@sophia.inria.fr> # # Distributed under the Cecill-C License. # See accompanying file LICENSE.txt or copy at # http://www.cecill.in...
[((60, 25, 60, 56), 'id_dict.IdDict', 'IdDict', (), '', False, 'from id_dict import IdDict\n'), ((61, 22, 61, 53), 'id_dict.IdDict', 'IdDict', (), '', False, 'from id_dict import IdDict\n')]
GT-AcerZhang/PaddlePaddle-SSD
nets/mobilenet_v2_ssd.py
3833afe3470b7dc811409b3d8111b98dc31c6d0e
import paddle.fluid as fluid from paddle.fluid.initializer import MSRA from paddle.fluid.param_attr import ParamAttr class MobileNetV2SSD: def __init__(self, img, num_classes, img_shape): self.img = img self.num_classes = num_classes self.img_shape = img_shape def ssd_net(self, scale=...
[((187, 11, 187, 61), 'paddle.fluid.data', 'fluid.data', (), '', True, 'import paddle.fluid as fluid\n'), ((48, 46, 59, 22), 'paddle.fluid.layers.multi_box_head', 'fluid.layers.multi_box_head', (), '', True, 'import paddle.fluid as fluid\n'), ((66, 15, 74, 51), 'paddle.fluid.layers.conv2d', 'fluid.layers.conv2d', (), '...
caishenghang/oneflow
oneflow/python/test/ops/test_object_bbox_scale.py
db239cc9f98e551823bf6ce2d4395bd5c339b1c5
""" Copyright 2020 The OneFlow 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 agr...
[((166, 1, 166, 33), 'oneflow.unittest.skip_unless_1n1d', 'flow.unittest.skip_unless_1n1d', ({}, {}), '()', True, 'import oneflow as flow\n'), ((33, 11, 33, 26), 'pycocotools.coco.COCO', 'COCO', ({(33, 16, 33, 25): 'anno_file'}, {}), '(anno_file)', False, 'from pycocotools.coco import COCO\n'), ((77, 25, 77, 54), 'nump...
BertRaeymaekers/scrapbook
vagrant/kafka/bin/init.py
3c8483d4594356fbc84deb8d6496db3d856492c1
#! /usr/bin/env python3 import json import os.path import jinja2 DEFAULT_PARAMS = { "ansible_user": "vagrant" } if __name__ == "__main__": # Reading configuration here = os.path.dirname(os.path.realpath(__file__ + "/../")) with open(here + "/config.json", "r") as rf: config = json.load(rf...
[((19, 17, 19, 30), 'json.load', 'json.load', ({(19, 27, 19, 29): 'rf'}, {}), '(rf)', False, 'import json\n'), ((20, 10, 20, 54), 'json.dumps', 'json.dumps', (), '', False, 'import json\n'), ((36, 36, 36, 81), 'jinja2.FileSystemLoader', 'jinja2.FileSystemLoader', ({(36, 60, 36, 80): "here + '/templates/'"}, {}), "(here...
lmaurits/harvest
harvest/models/beastsimulator.py
df6b549096da8ae2f4ed38aa2be19c7e82fa60e3
import os import harvest.dataframe from harvest.models.simulator import Simulator class BeastSimulator(Simulator): def __init__(self, tree, n_features): Simulator.__init__(self, tree, n_features) def generate_beast_xml(self): # Subclasses should implement this return None def ge...
[((9, 8, 9, 50), 'harvest.models.simulator.Simulator.__init__', 'Simulator.__init__', ({(9, 27, 9, 31): 'self', (9, 33, 9, 37): 'tree', (9, 39, 9, 49): 'n_features'}, {}), '(self, tree, n_features)', False, 'from harvest.models.simulator import Simulator\n'), ((20, 8, 20, 58), 'os.system', 'os.system', ({(20, 18, 20, 5...
DutChen18/slime-clusters-cuda
assimilator.py
186d198665a017cf0eacde33765b6cb3cb4aecb5
# pylint: skip-file import os from assimilator import * from Boinc import boinc_project_path class SlimeClustersAssimilator(Assimilator): def __init__(self): Assimilator.__init__(self) def assimilate_handler(self, wu, results, canonical_result): if canonical_result == None: return...
[((16, 18, 16, 67), 'Boinc.boinc_project_path.project_path', 'boinc_project_path.project_path', ({(16, 50, 16, 66): '"""slime-clusters"""'}, {}), "('slime-clusters')", False, 'from Boinc import boinc_project_path\n'), ((17, 19, 17, 55), 'os.path.join', 'os.path.join', ({(17, 32, 17, 39): 'dst_dir', (17, 41, 17, 54): '"...
Rubtsowa/modin
modin/core/execution/ray/implementations/cudf_on_ray/dataframe/dataframe.py
6550939753c76e896ef2bfd65bb9468d6ad161d7
# Licensed to Modin Development Team under one or more contributor license agreements. # See the NOTICE file distributed with this work for additional information regarding # copyright ownership. The Modin Development Team licenses this file to you under the # Apache License, Version 2.0 (the "License"); you may not u...
[((61, 8, 63, 9), 'modin.error_message.ErrorMessage.catch_bugs_and_request_email', 'ErrorMessage.catch_bugs_and_request_email', ({(62, 12, 62, 51): '(axis is not None and axis not in [0, 1])'}, {}), '(axis is not None and axis not in\n [0, 1])', False, 'from modin.error_message import ErrorMessage\n'), ((65, 26, 65,...
mw5868/University
Exoplanet_Population.py
076c9b001dbfe3765607877be4f89ccf86a88331
from astropy.table import Table, Column import matplotlib.pyplot as plt #url = "https://exoplanetarchive.ipac.caltech.edu/cgi-bin/nstedAPI/nph-nstedAPI?table=exoplanets&select=pl_hostname,ra,dec&order=dec&format=csv" url = "https://exoplanetarchive.ipac.caltech.edu/cgi-bin/nstedAPI/nph-nstedAPI?table=exoplanets" # This...
[((7, 4, 7, 33), 'astropy.table.Table.read', 'Table.read', (), '', False, 'from astropy.table import Table, Column\n'), ((18, 6, 18, 18), 'matplotlib.pyplot.figure', 'plt.figure', ({}, {}), '()', True, 'import matplotlib.pyplot as plt\n'), ((35, 0, 35, 61), 'matplotlib.pyplot.legend', 'plt.legend', (), '', True, 'impor...
marthoc/pykuna
pykuna/errors.py
f5bf02f26e1931b35becde6e1da58fb8bb0cc2d8
class KunaError(Exception): pass class AuthenticationError(KunaError): """Raised when authentication fails.""" pass class UnauthorizedError(KunaError): """Raised when an API call fails as unauthorized (401).""" pass
[]
henrimitte/Project-Euler
src/pe_problem74.py
77fd9f5b076d1ca2e5ed4ef94bf8d32d9ed611eb
from tools import factorial def solve(): fa = tuple(factorial(x) for x in range(10)) def _sum_factorial_of_digits(n: int) -> int: s = 0 while n > 0: s += fa[n % 10] n //= 10 return s limit = 1000000 loops = [0 for x in range(limit)] for i in range(...
[((5, 15, 5, 27), 'tools.factorial', 'factorial', ({(5, 25, 5, 26): 'x'}, {}), '(x)', False, 'from tools import factorial\n')]
ferguscan/thingsboard-gateway
thingsboard_gateway/connectors/modbus/modbus_connector.py
bc20fdb8e46f840b8538a010db2714ec6071fa5b
# Copyright 2022. ThingsBoard # # 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 ...
[((88, 23, 88, 32), 'queue.Queue', 'Queue', ({(88, 29, 88, 31): '-1'}, {}), '(-1)', False, 'from queue import Queue\n'), ((28, 4, 28, 52), 'thingsboard_gateway.tb_utility.tb_utility.TBUtility.install_package', 'TBUtility.install_package', ({(28, 30, 28, 40): '"""pymodbus"""', (28, 42, 28, 51): '""">=2.3.0"""'}, {}), "(...
xwu20/wmg_agent
specs/test_gru_on_flat_babyai.py
25378c8fc54eb6e0e8c9d969760a72e843572f09
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. ### CONTROLS (non-tunable) ### # general TYPE_OF_RUN = test_episodes # train, test, test_episodes, render NUM_EPISODES_TO_TEST = 1000 MIN_FINAL_REWARD_FOR_SUCCESS = 1.0 LOAD_MODEL_FROM = models/gru_flat_babyai.pth SAVE_MODELS_TO = None # wo...
[]
meisterT/rules_haskell
haskell/private/actions/runghc.bzl
7c0a867fc23da104ea8cbff26864894abcf137bc
"""runghc support""" load(":private/context.bzl", "render_env") load(":private/packages.bzl", "expose_packages", "pkg_info_to_compile_flags") load( ":private/path_utils.bzl", "link_libraries", "ln", "target_unique_name", ) load( ":private/set.bzl", "set", ) load(":providers.bzl", "get_ghci_extr...
[]
pymedphys/pymedphys-archive-2019
tests/dicom/test_header_tweaks.py
6bb7c8d0da2e93ff56469bb47e65b15ece2ea25e
# Copyright (C) 2019 Cancer Care Associates # 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 ...
[((33, 7, 33, 32), 'os.path.dirname', 'os.path.dirname', ({(33, 23, 33, 31): '__file__'}, {}), '(__file__)', False, 'import os\n'), ((43, 4, 43, 57), 'pydicom.write_file', 'pydicom.write_file', ({(43, 23, 43, 46): 'ORIGINAL_DICOM_FILENAME', (43, 48, 43, 56): 'original'}, {}), '(ORIGINAL_DICOM_FILENAME, original)', Fals...
itewk/home-assistant
tests/components/http/test_data_validator.py
769cf19052f8c9ef374d8ba8ae7705ccc7bf4cf4
"""Test data validator decorator.""" from unittest.mock import Mock from aiohttp import web import voluptuous as vol from homeassistant.components.http import HomeAssistantView from homeassistant.components.http.data_validator import RequestDataValidator async def get_client(aiohttp_client, validator): """Gener...
[((13, 10, 13, 27), 'aiohttp.web.Application', 'web.Application', ({}, {}), '()', False, 'from aiohttp import web\n'), ((14, 18, 14, 39), 'unittest.mock.Mock', 'Mock', (), '', False, 'from unittest.mock import Mock\n'), ((34, 57, 34, 77), 'voluptuous.Required', 'vol.Required', ({(34, 70, 34, 76): '"""test"""'}, {}), "(...
sam-aldis/Conversley
Conversely_Frontend/app/Server/ukjp/templates.py
1fc30d6b768cc03f727229a52e0879fac3af1e3a
import days STAGE_INIT = 0 STAGE_CHALLENGE_INIT = 1 STAGE_BOOKED = 2 def createJSONTemplate(data): pass messages = [ "Hey {{first_name}}, thankyou for your enquiry to be one of our Transformation Challengers", "We have 2 Challenges available for you:\n\nThe 8 Week Bikini Challenge which h...
[]
jeanbez/spack
var/spack/repos/builtin/packages/pagmo2/package.py
f4e51ce8f366c85bf5aa0eafe078677b42dae1ba
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack.package import * class Pagmo2(CMakePackage): """Parallel Global Multiobjective Optimizer (and its Python ...
[]
earthobservatory/ariamh-pub
interferogram/sentinel/fetchCalES.py
f33731e127f38ff33b02e02c07b16793c07651a6
#!/usr/bin/env python3 import os, sys, re, json, requests, datetime, tarfile, argparse from pprint import pprint import numpy as np from utils.UrlUtils import UrlUtils server = 'https://qc.sentinel1.eo.esa.int/' cal_re = re.compile(r'S1\w_AUX_CAL') def cmdLineParse(): ''' Command line parser. ''' ...
[((11, 9, 11, 36), 're.compile', 're.compile', ({(11, 20, 11, 35): '"""S1\\\\w_AUX_CAL"""'}, {}), "('S1\\\\w_AUX_CAL')", False, 'import os, sys, re, json, requests, datetime, tarfile, argparse\n'), ((18, 13, 18, 105), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (), '', False, 'import os, sys, re, json, reques...
stain/conservancy-website
www/conservancy/urls.py
9e41ddff766fe517a99198d60701193e8b68415e
# Copyright 2005-2008, James Garrison # Copyright 2010, 2012 Bradley M. Kuhn # This software's license gives you freedom; you can copy, convey, # propagate, redistribute, modify and/or redistribute modified versions of # this program under the terms of the GNU Affero General Public License # (AGPL) as published by the...
[((27, 0, 27, 20), 'django.contrib.admin.autodiscover', 'admin.autodiscover', ({}, {}), '()', False, 'from django.contrib import admin, admindocs\n'), ((30, 4, 30, 30), 'django.conf.urls.url', 'url', ({(30, 8, 30, 13): '"""^$"""', (30, 15, 30, 29): 'frontpage.view'}, {}), "('^$', frontpage.view)", False, 'from django.c...
FabienArcellier/spike-graphene-flask
graphene_spike_tests/acceptances/test_query.py
bc7bce571a21826c3da852eb1c2e1904bbab99b4
import unittest from unittest.mock import Mock from graphene import Schema from graphene.test import Client from graphene_spike.query import Query class MainTest(unittest.TestCase): def setUp(self): self.schema = Schema(query=Query) self.client = client = Client(self.schema) def test_hello_...
[((12, 22, 12, 41), 'graphene.Schema', 'Schema', (), '', False, 'from graphene import Schema\n'), ((13, 31, 13, 50), 'graphene.test.Client', 'Client', ({(13, 38, 13, 49): 'self.schema'}, {}), '(self.schema)', False, 'from graphene.test import Client\n')]
davidventasmarin/clikan
clikan.py
401fe4053a14873872bb246739d55c55f8f6dcfa
from rich import print from rich.console import Console from rich.table import Table import click from click_default_group import DefaultGroup import yaml import os ##from terminaltables import SingleTable import sys from textwrap import wrap import collections import datetime import configparser import pkg_resources ...
[((35, 14, 35, 60), 'click.make_pass_decorator', 'click.make_pass_decorator', (), '', False, 'import click\n'), ((84, 1, 84, 30), 'click.version_option', 'click.version_option', ({(84, 22, 84, 29): 'VERSION'}, {}), '(VERSION)', False, 'import click\n'), ((85, 1, 85, 73), 'click.command', 'click.command', (), '', False,...
RagtagOpen/python-social-auth-ragtag-id
social_auth_ragtag_id/backends.py
8d8e005231c09535098136213347934e9da7b3f2
from social_core.backends.oauth import BaseOAuth2 class RagtagOAuth2(BaseOAuth2): """Ragtag ID OAuth authentication backend""" name = "ragtag" AUTHORIZATION_URL = "https://id.ragtag.org/oauth/authorize/" ACCESS_TOKEN_URL = "https://id.ragtag.org/oauth/token/" ACCESS_TOKEN_METHOD = "POST" REVO...
[]
angeelgarr/DCPanel
panel/api/models/provider.py
1901a0f4b1b4273b60d3a218797fb6614d05b4c0
from django.db import models from django.contrib import admin class Provider(models.Model): name = models.CharField(max_length=50) domain = models.CharField(max_length=50) class Meta: ordering = ['name'] app_label = 'api' def __str__(self): return self.domain @admin.registe...
[((17, 1, 17, 25), 'django.contrib.admin.register', 'admin.register', ({(17, 16, 17, 24): 'Provider'}, {}), '(Provider)', False, 'from django.contrib import admin\n'), ((6, 11, 6, 42), 'django.db.models.CharField', 'models.CharField', (), '', False, 'from django.db import models\n'), ((7, 13, 7, 44), 'django.db.models....
siddharthumakarthikeyan/Cable-Driven-Parallel-Robots-CDPR-Modelling
trial/src/sender.py
4e8d991d55ae7da91b3c90773c679f3369a4dafa
#!/usr/bin/env python # license removed for brevity import rospy from std_msgs.msg import String from gazebo_msgs.msg import LinkState def talker(): pub = rospy.Publisher('/gazebo/set_link_state', LinkState, queue_size=10) ppp = LinkState() rospy.init_node('talker', anonymous=True) rate = rospy.R...
[((9, 10, 9, 77), 'rospy.Publisher', 'rospy.Publisher', (), '', False, 'import rospy\n'), ((10, 10, 10, 21), 'gazebo_msgs.msg.LinkState', 'LinkState', ({}, {}), '()', False, 'from gazebo_msgs.msg import LinkState\n'), ((11, 4, 11, 45), 'rospy.init_node', 'rospy.init_node', (), '', False, 'import rospy\n'), ((13, 11, 13...
kimmokal/CC-Art-Critics
discriminator_dataset.py
af83762a5f22043f279c167cbd58e16737e3ec87
import torch from os import listdir, path from PIL import Image import torchvision class DiscriminatorDataset(torch.utils.data.Dataset): def __init__(self): super(DiscriminatorDataset, self).__init__() currentDir = path.dirname(__file__) abstractDir = path.join(currentDir, 'image_data/abs...
[((11, 21, 11, 43), 'os.path.dirname', 'path.dirname', ({(11, 34, 11, 42): '__file__'}, {}), '(__file__)', False, 'from os import listdir, path\n'), ((12, 22, 12, 66), 'os.path.join', 'path.join', ({(12, 32, 12, 42): 'currentDir', (12, 44, 12, 65): '"""image_data/abstract"""'}, {}), "(currentDir, 'image_data/abstract')...
ionata/django-emailmeld
emailmeld/sender.py
28326933d22957f8737ab8a9564daa9cbfca6d06
from django.core.mail.message import EmailMessage, EmailMultiAlternatives from django.utils.translation import ugettext_lazy as _ from django.template.loader import render_to_string from django.utils.safestring import mark_safe def send_mail_task(subject, message, from_email, recipient_list): message = EmailMessa...
[((14, 62, 14, 85), 'django.utils.safestring.mark_safe', 'mark_safe', ({(14, 72, 14, 84): 'html_message'}, {}), '(html_message)', False, 'from django.utils.safestring import mark_safe\n')]
sander-vd/HAP-python
tests/test_hap_server.py
991761ceadfd7796d454d61c87be7f5d4b75d432
"""Tests for the HAPServer.""" from socket import timeout from unittest.mock import Mock, MagicMock, patch import pytest from pyhap import hap_server @patch('pyhap.hap_server.HAPServer.server_bind', new=MagicMock()) @patch('pyhap.hap_server.HAPServer.server_activate', new=MagicMock()) def test_finish_request_pops_s...
[((14, 12, 14, 18), 'unittest.mock.Mock', 'Mock', ({}, {}), '()', False, 'from unittest.mock import Mock, MagicMock, patch\n'), ((30, 13, 31, 54), 'pyhap.hap_server.HAPServer', 'hap_server.HAPServer', (), '', False, 'from pyhap import hap_server\n'), ((38, 13, 39, 67), 'pyhap.hap_server.HAPServer', 'hap_server.HAPServe...
charlesashby/marketvault-front-end
app/views/main.py
758cf8ba1d8486f45eac093ded78a15fc82df3dc
from flask import render_template, Blueprint, request from app.utils.search import MySQLClient from app.utils.preprocessor import TextPreprocessor mainbp = Blueprint("main", __name__) @mainbp.route("/search", methods=["GET"]) @mainbp.route("/", methods=["GET"]) def home(): stores_by_page = 10 topic = reque...
[((7, 9, 7, 36), 'flask.Blueprint', 'Blueprint', ({(7, 19, 7, 25): '"""main"""', (7, 27, 7, 35): '__name__'}, {}), "('main', __name__)", False, 'from flask import render_template, Blueprint, request\n'), ((14, 12, 14, 37), 'flask.request.args.get', 'request.args.get', ({(14, 29, 14, 36): '"""topic"""'}, {}), "('topic')...
tinapiao/Software-IC-Automation
bag_testbenches/ckt_dsn/analog/amplifier/opamp_two_stage.py
74b23cd94aa6e4658b110e93b5deb635e014f3a6
# -*- coding: utf-8 -*- """This module contains design algorithm for a traditional two stage operational amplifier.""" from typing import TYPE_CHECKING, List, Optional, Dict, Any, Tuple, Sequence from copy import deepcopy import numpy as np import scipy.optimize as sciopt from bag.math import gcd from bag.data.lti...
[((165, 23, 165, 56), 'bag.util.search.BinaryIterator', 'BinaryIterator', ({(165, 38, 165, 49): 'i1_min_size', (165, 51, 165, 55): 'None'}, {}), '(i1_min_size, None)', False, 'from bag.util.search import FloatBinaryIterator, BinaryIterator, minimize_cost_golden\n'), ((378, 20, 378, 39), 'copy.deepcopy', 'deepcopy', ({(...