repo_name
stringlengths
7
94
repo_path
stringlengths
4
237
repo_head_hexsha
stringlengths
40
40
content
stringlengths
10
680k
apis
stringlengths
2
680k
pooja-bs-3003/Project_21
prgm6.py
dc46e66ccf10937be6f2f8369ef02eb52e139eff
str1= input("enter a string :") l1 ="" for i in str1 [::-1]: l1 = i+l1 print(l1) if str1 == l1: print("string is a palindrome") else : print("string is not a palindrome")
[]
Pandaaaa906/product_spider
product_spider/spiders/jk_spider.py
cc7f865f53fd3ed68f4869be3ba917c8373dfcf2
import json import re from string import ascii_uppercase from time import time from urllib.parse import urljoin import scrapy from more_itertools import first from scrapy import Request from product_spider.items import JkProduct, JKPackage from product_spider.utils.functions import strip class JkPrdSpider(scrapy.Sp...
[((2746, 2759), 'json.loads', 'json.loads', (['s'], {}), '(s)\n', (2756, 2759), False, 'import json\n'), ((2824, 2843), 'more_itertools.first', 'first', (['packages', '{}'], {}), '(packages, {})\n', (2829, 2843), False, 'from more_itertools import first\n'), ((2678, 2724), 're.findall', 're.findall', (['"""(?<=\\\\().+...
byq-luo/Lane_change_RL
env/LaneChangeEnv_v2.py
3409238db939e6722441219b4c2dc66033611069
import os import sys import random import datetime import gym from gym import spaces import numpy as np from env.IDM import IDM from env.Road import Road from env.Vehicle import Vehicle import math # add sumo/tools into python environment if 'SUMO_HOME' in os.environ: tools = os.path.join(os.environ['SUMO_HOME'], ...
[((282, 328), 'os.path.join', 'os.path.join', (["os.environ['SUMO_HOME']", '"""tools"""'], {}), "(os.environ['SUMO_HOME'], 'tools')\n", (294, 328), False, 'import os\n'), ((333, 355), 'sys.path.append', 'sys.path.append', (['tools'], {}), '(tools)\n', (348, 355), False, 'import sys\n'), ((387, 446), 'sys.exit', 'sys.ex...
jblukach/distillery
cidr/o365/o365.py
4087debb496d7dfc4c425c2e68246e1b0726168b
import boto3 import ipaddress import json import logging import os import requests import uuid logger = logging.getLogger() logger.setLevel(logging.INFO) dynamodb = boto3.resource('dynamodb') table = dynamodb.Table(os.environ['DYNAMODB_TABLE']) client = boto3.client('ssm') def downloader(instance, latest, param...
[((105, 124), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (122, 124), False, 'import logging\n'), ((167, 193), 'boto3.resource', 'boto3.resource', (['"""dynamodb"""'], {}), "('dynamodb')\n", (181, 193), False, 'import boto3\n'), ((261, 280), 'boto3.client', 'boto3.client', (['"""ssm"""'], {}), "('ssm')\...
zulip/finbot
exampleinc.py
dcb6bfe54a674f4ff98370677a648b6cc1706e16
#!/usr/bin/python from money import * c = Company("Example Inc") c.add_flow(FixedCost("Initial Cash", -500000)) c.add_flow(FixedCost("Incorporation", 500)) c.add_flow(ConstantCost("Office", 50000)) c.add_flow(PeriodicCost("Subscription", 4000, "2012-01-05", 14)) c.add_flow(DelayedCost("2012-02-01", ConstantCost("Offic...
[]
dawid1stanek/guardian
guardian/validators.py
89359c93d5f36c8b458428e147000352fa7ad01d
#!/usr/bin/env python import os import socket import subprocess import argparse import logging LOGGER = logging.getLogger(__name__) class ValidatorError(Exception): pass def ping(address): try: subprocess.check_call(('ping', '-c 1', '-W 1', address), stdout=subprocess.PIPE, stderr=subprocess.PIPE)...
[((106, 133), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (123, 133), False, 'import logging\n'), ((569, 584), 'socket.socket', 'socket.socket', ([], {}), '()\n', (582, 584), False, 'import socket\n'), ((216, 325), 'subprocess.check_call', 'subprocess.check_call', (["('ping', '-c 1', '...
Open-EO/openeo-geopyspark-driver
tests/data/udf_noop.py
afd5902f426d2aa456d70ed6f2d51b6907de1cab
from openeo.udf import XarrayDataCube def apply_datacube(cube: XarrayDataCube, context: dict) -> XarrayDataCube: return cube
[]
LHGames-2017/superintelligence
StateGoHome.py
bd9ea3d444e571a0f9607bf0f6799807f7e644ca
from PlayerState import * from pathFinder import PathFinder from StateLook4Resources import * class StateGoHome(PlayerState): """ State Implementation: has a resource and go back home """ def __init__(self, player): self.player = player self.player.setTarget(self.player.playerData.HouseLocati...
[((450, 481), 'pathFinder.PathFinder', 'PathFinder', (['self.player.mapView'], {}), '(self.player.mapView)\n', (460, 481), False, 'from pathFinder import PathFinder\n')]
schwendp/hoomd-blue
hoomd/mpcd/test-py/stream_slit_test.py
df7970121b19bc4f8674348ab3241055ac87153b
# Copyright (c) 2009-2019 The Regents of the University of Michigan # This file is part of the HOOMD-blue project, released under the BSD 3-Clause License. # Maintainer: mphoward import unittest import numpy as np import hoomd from hoomd import md from hoomd import mpcd # unit tests for mpcd slit streaming geometry ...
[((9563, 9600), 'unittest.main', 'unittest.main', ([], {'argv': "['test.py', '-v']"}), "(argv=['test.py', '-v'])\n", (9576, 9600), False, 'import unittest\n'), ((440, 466), 'hoomd.context.initialize', 'hoomd.context.initialize', ([], {}), '()\n', (464, 466), False, 'import hoomd\n'), ((816, 844), 'hoomd.mpcd.data.make_...
haoyuchen1992/CourseBuilder
tests/functional/model_models.py
ba8f0e05c53cc74bb4e46235a7855fdfbd63dff7
# Copyright 2013 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 ...
[((1007, 1055), 'models.models.EventEntity', 'models.EventEntity', ([], {'source': '"""source"""', 'user_id': '"""1"""'}), "(source='source', user_id='1')\n", (1025, 1055), False, 'from models import models\n'), ((1544, 1565), 'datetime.date.today', 'datetime.date.today', ([], {}), '()\n', (1563, 1565), False, 'import ...
iseessel/audio
torchaudio/functional/functional.py
64551a69186d28db1f499ba373f1b19c6a7ed894
# -*- coding: utf-8 -*- import io import math import warnings from typing import Optional, Tuple import torch from torch import Tensor from torchaudio._internal import module_utils as _mod_utils import torchaudio __all__ = [ "spectrogram", "griffinlim", "amplitude_to_DB", "DB_to_amplitude", "comp...
[((36149, 36174), 'torchaudio._internal.module_utils.requires_sox', '_mod_utils.requires_sox', ([], {}), '()\n', (36172, 36174), True, 'from torchaudio._internal import module_utils as _mod_utils\n'), ((38218, 38245), 'torchaudio._internal.module_utils.requires_kaldi', '_mod_utils.requires_kaldi', ([], {}), '()\n', (38...
Faust-Wang/vswarm
src/status_node.py
d18ce643218c18ef1e762f40562104b2a0926ad7
#!/usr/bin/env python3 from __future__ import absolute_import, division, print_function import curses import sys from collections import deque from datetime import datetime import numpy as np import rospy from diagnostic_msgs.msg import DiagnosticArray, DiagnosticStatus from geometry_msgs.msg import PoseStamped from ...
[((831, 855), 'curses.color_pair', 'curses.color_pair', (['color'], {}), '(color)\n', (848, 855), False, 'import curses\n'), ((1120, 1139), 'numpy.isnan', 'np.isnan', (['frequency'], {}), '(frequency)\n', (1128, 1139), True, 'import numpy as np\n'), ((1094, 1112), 'numpy.mean', 'np.mean', (['durations'], {}), '(duratio...
mo-schmid/MIALab
bin/boxplot_param.py
8a7e183df7007993e8a28513a73dca20bfd60737
import argparse import os import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import pandas as pd from pathlib import Path class ResultParam(): """Result Parameter""" def __init__(self, path: Path, param_str: str): """Initializes a new instance of the Result Parameter Arg...
[((45, 66), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (59, 66), False, 'import matplotlib\n'), ((580, 614), 'matplotlib.pyplot.setp', 'plt.setp', (["bp['boxes']"], {'color': 'color'}), "(bp['boxes'], color=color)\n", (588, 614), True, 'import matplotlib.pyplot as plt\n'), ((619, 656), 'matpl...
NREL/EMeRGE
EMeRGE/dssmetrics/constants.py
573e86ca8e62080c664998e8cc79e9231e7ad502
""" Default values : DO NOT CHANGE !!!""" LOG_FORMAT = "%(asctime)s: %(levelname)s: %(message)s" DATE_FORMAT = "%Y-%m-%d %H:%M:%S" MAXITERATIONS = 100 LIFE_PARAMETERS = {"theta_i":30,"theta_fl":36,"theta_gfl":28.6, "R":4.87,"n":1,"tau":3.5,"m":1,"A":-13.391, "B":6972.15,"num_...
[]
MathisFederico/Minesweeper
minesweeper/game.py
b66b41066e325813b24497d2caca0a11c048e18b
try: import importlib.resources as pkg_resources except ImportError: # Try backported to PY<37 `importlib_resources`. import importlib_resources as pkg_resources from . import images from gym import Env, spaces from time import time import numpy as np from copy import copy import colorsys import pygame f...
[((567, 586), 'numpy.prod', 'np.prod', (['grid_shape'], {}), '(grid_shape)\n', (574, 586), True, 'import numpy as np\n'), ((1274, 1312), 'gym.spaces.MultiDiscrete', 'spaces.MultiDiscrete', (['nvec_observation'], {}), '(nvec_observation)\n', (1294, 1312), False, 'from gym import Env, spaces\n'), ((1336, 1368), 'numpy.ar...
BReduardokramer/gaia
tests/python/gaia-ui-tests/gaiatest/tests/functional/lockscreen/test_lockscreen_unlock_to_camera_with_passcode.py
c00302cdcd435ab193e8365917cfc6abac9e4f2e
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from gaiatest import GaiaTestCase from gaiatest.apps.lockscreen.app import LockScreen class TestCameraUnlockWithPassco...
[((415, 439), 'gaiatest.GaiaTestCase.setUp', 'GaiaTestCase.setUp', (['self'], {}), '(self)\n', (433, 439), False, 'from gaiatest import GaiaTestCase\n'), ((813, 840), 'gaiatest.apps.lockscreen.app.LockScreen', 'LockScreen', (['self.marionette'], {}), '(self.marionette)\n', (823, 840), False, 'from gaiatest.apps.lockscr...
CallumMcMahon/MeshCNN
models/layers/mesh_conv.py
343950a8d69807ed4afa13f1843edb37c4cd042c
import torch import torch.nn as nn import torch.nn.functional as F class MeshConv(nn.Module): """ Computes convolution between edges and 4 incident (1-ring) edge neighbors in the forward pass takes: x: edge features (Batch x Features x Edges) mesh: list of mesh data-structure (len(mesh) == Batch) a...
[((479, 576), 'torch.nn.Conv2d', 'nn.Conv2d', ([], {'in_channels': 'in_channels', 'out_channels': 'out_channels', 'kernel_size': '(1, k)', 'bias': 'bias'}), '(in_channels=in_channels, out_channels=out_channels, kernel_size=(\n 1, k), bias=bias)\n', (488, 576), True, 'import torch.nn as nn\n'), ((1678, 1755), 'torch....
AvinWangZH/3D-convolutional-speaker-recognition
code/0-input/create_hdf5/check_hdf5.py
61969eb2dba6004bdecb4f7100047015ca665348
import tables import numpy as np import matplotlib.pyplot as plt # Reading the file. fileh = tables.open_file('development.hdf5', mode='r') # Dimentionality of the data structure. print(fileh.root.utterance_test.shape) print(fileh.root.utterance_train.shape) print(fileh.root.label_train.shape) print(fileh.root.label_...
[((94, 140), 'tables.open_file', 'tables.open_file', (['"""development.hdf5"""'], {'mode': '"""r"""'}), "('development.hdf5', mode='r')\n", (110, 140), False, 'import tables\n')]
LinkTsang/qtask-legacy-python
qtask/utils/testing.py
9b264b8e33313e4d3615472d59a2a39948eeeaa1
import asyncio import traceback import unittest def async_test(f): def wrapper(test_case: unittest.TestCase, *args, **kwargs): loop = asyncio.get_event_loop() task = loop.create_task(f(test_case, *args, **kwargs)) try: loop.run_until_complete(task) except Exception: ...
[((148, 172), 'asyncio.get_event_loop', 'asyncio.get_event_loop', ([], {}), '()\n', (170, 172), False, 'import asyncio\n'), ((329, 350), 'traceback.print_exc', 'traceback.print_exc', ([], {}), '()\n', (348, 350), False, 'import traceback\n')]
theflatladder/kyrsovaya
landing/views.py
d6d661854cd955e544a199e201f325decc360cc1
from django.shortcuts import render, render_to_response, redirect from django.contrib import auth from django.contrib.auth.forms import UserCreationForm from django.template.context_processors import csrf from django.http import HttpResponseRedirect def login(request): args = {} args.update(csrf(request)) ...
[((863, 883), 'django.contrib.auth.logout', 'auth.logout', (['request'], {}), '(request)\n', (874, 883), False, 'from django.contrib import auth\n'), ((1597, 1617), 'django.contrib.auth.logout', 'auth.logout', (['request'], {}), '(request)\n', (1608, 1617), False, 'from django.contrib import auth\n'), ((1629, 1659), 'd...
yecfly/DEPRESSIONEST
FPRun11.py
21b72906aac9f310e264f7a5eea348480a647197
from Facepatchindependenttrain import runPatch import sys if len(sys.argv)==6: runPatch(GPU_Device_ID=1, FacePatchID=int(sys.argv[1]), trainpklID=int(sys.argv[2]), testpklID=int(sys.argv[3]), NetworkType=int(sys.argv[4]), runs=int(sys.argv[5])) ...
[]
jgmize/kitsune
vendor/packages/translate-toolkit/translate/convert/test_po2tmx.py
8f23727a9c7fcdd05afc86886f0134fb08d9a2f0
#!/usr/bin/env python # -*- coding: utf-8 -*- from translate.convert import po2tmx from translate.convert import test_convert from translate.misc import wStringIO from translate.storage import tmx from translate.storage import lisa class TestPO2TMX: def po2tmx(self, posource, sourcelanguage='en', targetlanguage=...
[]
mesabib/kodi.yatp
plugin.video.yatp/libs/client/commands.py
d874df43047b5b58f84cb3760fc891d9a133a69f
# coding: utf-8 # Module: commands # Created on: 28.07.2015 # Author: Roman Miroshnychenko aka Roman V.M. (romanvm@yandex.ua) # Licence: GPL v.3: http://www.gnu.org/copyleft/gpl.html """ Context menu commands """ import sys import xbmc import xbmcgui import json_requests as jsonrq from simpleplugin import Addon addon...
[((323, 349), 'simpleplugin.Addon', 'Addon', (['"""plugin.video.yatp"""'], {}), "('plugin.video.yatp')\n", (328, 349), False, 'from simpleplugin import Addon\n'), ((518, 552), 'json_requests.get_torrent_info', 'jsonrq.get_torrent_info', (['info_hash'], {}), '(info_hash)\n', (541, 552), True, 'import json_requests as js...
GeorgeDittmar/MarkovTextGenerator
setup.py
df6a56e23051e1f263ba22889dc3b5d0dc03e370
#!/usr/bin/env python from distutils.core import setup setup(name='Mimik', version='1.0', description='Python framework for markov models', author='George Dittmar', author_email='georgedittmar@gmail.com', url='https://www.python.org/sigs/distutils-sig/', packages=['distutils', 'dis...
[((57, 319), 'distutils.core.setup', 'setup', ([], {'name': '"""Mimik"""', 'version': '"""1.0"""', 'description': '"""Python framework for markov models"""', 'author': '"""George Dittmar"""', 'author_email': '"""georgedittmar@gmail.com"""', 'url': '"""https://www.python.org/sigs/distutils-sig/"""', 'packages': "['distu...
deplatformr/open-images
pipeline/scripts/package.py
3726c9802bda1d7ecbbbd9920d5566daaecc9faa
import os import shutil import sqlite3 import tarfile from datetime import datetime import bagit def create_package(images, batch_dir): package_threshold = 838860800 # 800 Mib to the next power of 2 = 1GiB print("Package threshold: " + get_human_readable_file_size(package_threshold)) abs_path = os.getc...
[((313, 324), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (322, 324), False, 'import os\n'), ((1870, 2625), 'bagit.make_bag', 'bagit.make_bag', (['batch_dir', "{'Source-Organization': 'Deplatformr Project', 'Organization-Address':\n 'https://open-images.deplatformr.com', 'External-Description':\n 'This package co...
don4apaev/anfisa
app/search/hot_eval/hl_reportable.py
2e4bdd83c584c0000f037413ccc1f9067c07fa70
def evalRec(env, rec): """hl_reportable""" return (len(set(rec.Genes) & { 'ABHD12', 'ACTG1', 'ADGRV1', 'AIFM1', 'ATP6V1B1', 'BCS1L', 'BSND', 'CABP2', 'CACNA1D', 'CDC14A', '...
[]
fau-is/grm
eval/util/metrics.py
78b1559ea0dda1b817283adecd58da50ca232223
import sklearn import pandas import seaborn as sns import matplotlib.pyplot as pyplot from functools import reduce # import numpy as np def metrics_from_prediction_and_label(labels, predictions, verbose=False): measures = { "accuracy": sklearn.metrics.accuracy_score(labels, predictions), "balance...
[((4466, 4560), 'sklearn.metrics.classification_report', 'sklearn.metrics.classification_report', ([], {'y_true': 'labels', 'y_pred': 'predictions', 'output_dict': '(True)'}), '(y_true=labels, y_pred=predictions,\n output_dict=True)\n', (4503, 4560), False, 'import sklearn\n'), ((4637, 4675), 'sklearn.preprocessing....
gabrielpiassetta/django-pgschemas
dpgs_sandbox/tests/test_bug_migrations_in_base_models.py
1e76db4cef31c7534bf4ba109961e835a1dd3c96
import warnings from unittest.mock import patch from django.apps import apps from django.core import management from django.core.management.base import CommandError from django.db import models from django.db.utils import ProgrammingError from django.test import TransactionTestCase, tag from django_pgschemas.checks i...
[((460, 478), 'django_pgschemas.utils.get_tenant_model', 'get_tenant_model', ([], {}), '()\n', (476, 478), False, 'from django_pgschemas.utils import get_tenant_model\n'), ((706, 716), 'django.test.tag', 'tag', (['"""bug"""'], {}), "('bug')\n", (709, 716), False, 'from django.test import TransactionTestCase, tag\n'), (...
pingsutw/tfx
tfx/components/transform/component.py
bf0d1d74e3f6ea429989fc7b80b82bea08077857
# Lint as: python2, python3 # Copyright 2019 Google LLC. 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 req...
[((2529, 2579), 'tfx.components.base.executor_spec.ExecutorClassSpec', 'executor_spec.ExecutorClassSpec', (['executor.Executor'], {}), '(executor.Executor)\n', (2560, 2579), False, 'from tfx.components.base import executor_spec\n'), ((5985, 6176), 'tfx.types.standard_component_specs.TransformSpec', 'TransformSpec', ([]...
anderslatif/alg
objects/GitIndexEntry.py
d5902a05a4cb249e554f65a7e8016d7d050b6da9
# https://github.com/git/git/blob/master/Documentation/technical/index-format.txt class GitIndexEntry(object): # The last time a file's metadata changed. This is a tuple (seconds, nanoseconds) ctime = None # The last time a file's data changed. This is a tuple (seconds, nanoseconds) mtime = None #...
[]
huzongxiang/CrystalNetwork
matdgl/layers/partitionpaddinglayer.py
a434f76fa4347d42b3c905852ce265cd0bcefca3
# -*- coding: utf-8 -*- """ Created on Wed Oct 13 14:47:13 2021 @author: huzongxiang """ import tensorflow as tf from tensorflow.keras import layers class PartitionPadding(layers.Layer): def __init__(self, batch_size, **kwargs): super().__init__(**kwargs) self.batch_size = batch_size def ...
[((428, 490), 'tensorflow.dynamic_partition', 'tf.dynamic_partition', (['features', 'graph_indices', 'self.batch_size'], {}), '(features, graph_indices, self.batch_size)\n', (448, 490), True, 'import tensorflow as tf\n'), ((624, 651), 'tensorflow.reduce_max', 'tf.reduce_max', (['num_features'], {}), '(num_features)\n',...
khchine5/book
lino_book/projects/min9/settings/memory.py
b6272d33d49d12335d25cf0a2660f7996680b1d1
from .demo import * SITE.verbose_name = SITE.verbose_name + " (:memory:)" # SITE = Site(globals(), title=Site.title+" (:memory:)") DATABASES['default']['NAME'] = ':memory:'
[]
aryamanak10/diner-restaurant-website
reservation/urls.py
6d2d9de89a73c5535ebf782c4d8bbfc6ca9489fc
from django.urls import path from . import views app_name = 'reservation' urlpatterns = [ path('', views.reserve_table, name = 'reserve_table'), ]
[((96, 147), 'django.urls.path', 'path', (['""""""', 'views.reserve_table'], {'name': '"""reserve_table"""'}), "('', views.reserve_table, name='reserve_table')\n", (100, 147), False, 'from django.urls import path\n')]
yumetov/chainer
chainer/_version.py
522e017a18008ee00e39f4ae4b30f4f9db3824b2
__version__ = '7.8.0' _optional_dependencies = [ { 'name': 'CuPy', 'packages': [ 'cupy-cuda120', 'cupy-cuda114', 'cupy-cuda113', 'cupy-cuda112', 'cupy-cuda111', 'cupy-cuda110', 'cupy-cuda102', 'cupy-cud...
[]
qwerasdf887/image_augmentation
image_aug.py
7d465eba4d6af5d9a4cd79bf1981c8ef206ffe42
# coding=UTF-8 # This Python file uses the following encoding: utf-8 import cv2 import numpy as np import xml.etree.cElementTree as ET from random import sample #default args: default_args = {'noise_prob': 0.1, 'gasuss_mean': 0, 'gasuss_var': 0.001, 'rand_hug': 30, ...
[((700, 720), 'numpy.random.rand', 'np.random.rand', (['h', 'w'], {}), '(h, w)\n', (714, 720), True, 'import numpy as np\n'), ((988, 1074), 'numpy.random.normal', 'np.random.normal', (["kwargs['gasuss_mean']", "(kwargs['gasuss_var'] ** 0.5)", 'image.shape'], {}), "(kwargs['gasuss_mean'], kwargs['gasuss_var'] ** 0.5, im...
intimanipuchi/tiny_python_projects
03_picnic/picnic.py
5e419620ae07b0bcf8df073ba3f6c6c3d7d1a93c
#!/usr/bin/env python3 """ Author : Roman Koziy <koziyroman@gmail.com> Date : 2021-12-15 Purpose: Working with lists """ import argparse # -------------------------------------------------- def get_args(): """Get command-line arguments""" parser = argparse.ArgumentParser( description="Working with...
[((262, 380), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Working with lists"""', 'formatter_class': 'argparse.ArgumentDefaultsHelpFormatter'}), "(description='Working with lists', formatter_class=\n argparse.ArgumentDefaultsHelpFormatter)\n", (285, 380), False, 'import argparse\n'...
montyshyama/python-basics
triangle.py
d71156d70fdadc722a192b984e9bff66401ab894
side_a=int(input("Enter the first side(a):")) side_b=int(input("Enter the second side(b):")) side_c=int(input("Enter the third side(c):")) if side_a==side_b and side_a==side_c: print("The triangle is an equilateral triangle.") elif side_a==side_b or side_a==side_c or side_b==side_c: print("The triangle is...
[]
ktmud/david
david/modules/artist/view.py
4b8d6f804b73cdfa1a8ddf784077fa9a39f1e36f
# -*- coding: utf-8 -*- from flask import Blueprint, request from david.lib.template import st from .model import Artist bp = Blueprint('artist', __name__) @bp.app_template_global('artists') def artists(): return Artist.query.all() @bp.route('/artist/<uid>/') def intro(uid): artist = Artist.get_or_404(uid) ...
[((127, 156), 'flask.Blueprint', 'Blueprint', (['"""artist"""', '__name__'], {}), "('artist', __name__)\n", (136, 156), False, 'from flask import Blueprint, request\n')]
JessieRamaux/Food-Volume-Estimation
Volume Estimation/volume.py
260b0e78a3b6a7b8bbe9daf98956502beea92552
import numpy as np import cv2 import os import json import glob from PIL import Image, ImageDraw plate_diameter = 25 #cm plate_depth = 1.5 #cm plate_thickness = 0.2 #cm def Max(x, y): if (x >= y): return x else: return y def polygons_to_mask(img_shape, polygons): mask = np.zeros(img_shape...
[((2774, 2798), 'cv2.imread', 'cv2.imread', (['"""out.png"""', '(0)'], {}), "('out.png', 0)\n", (2784, 2798), False, 'import cv2\n'), ((302, 337), 'numpy.zeros', 'np.zeros', (['img_shape'], {'dtype': 'np.uint8'}), '(img_shape, dtype=np.uint8)\n', (310, 337), True, 'import numpy as np\n'), ((349, 370), 'PIL.Image.fromar...
tianluyuan/pyutils
t2k/bin/cmttags.py
2cd3a90dbbd3d0eec3054fb9493ca0f6e0272e50
#!/usr/bin/env python """ A script to create tags for CMT managed packages. Call from within cmt/ directory """ import subprocess import sys import os from optparse import OptionParser __author__ = 'Tianlu Yuan' __email__ = 'tianlu.yuan [at] colorado.edu' # Ignore large external packages for now IGNORES = ['CMT', ...
[]
rickh563/salt
salt/daemons/masterapi.py
02822d6466c47d0daafd6e98b4e767a396b0ed48
# -*- coding: utf-8 -*- ''' This module contains all of the routines needed to set up a master server, this involves preparing the three listeners and the workers needed by the master. ''' from __future__ import absolute_import # Import python libs import fnmatch import logging import os import re import time import s...
[]
Mohitbalwani26/oppia
core/domain/role_services_test.py
a3d1de8b428b8216bb61ba70315583fe077f5b8a
# coding: utf-8 # # Copyright 2017 The Oppia 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 requi...
[((1141, 1173), 'core.domain.role_services.get_role_actions', 'role_services.get_role_actions', ([], {}), '()\n', (1171, 1173), False, 'from core.domain import role_services\n'), ((1807, 1849), 'core.domain.role_services.get_all_actions', 'role_services.get_all_actions', (['"""TEST_ROLE"""'], {}), "('TEST_ROLE')\n", (1...
xpennec/applications
deep_learning/keras/keras/backend/cntk_backend.py
50aefdf14de308fc3c132784ebba9d329e47b087
from __future__ import absolute_import from __future__ import division from __future__ import print_function import cntk as C import numpy as np from .common import floatx, epsilon, image_dim_ordering, image_data_format from collections import defaultdict from contextlib import contextmanager import warnings C.set_g...
[((313, 349), 'cntk.set_global_option', 'C.set_global_option', (['"""align_axis"""', '(1)'], {}), "('align_axis', 1)\n", (332, 349), True, 'import cntk as C\n'), ((371, 400), 'cntk.device.use_default_device', 'C.device.use_default_device', ([], {}), '()\n', (398, 400), True, 'import cntk as C\n'), ((854, 933), 'cntk.co...
nVoid/Yale-TouchDesigner-April2016
Project Files/Prebuilt tools/twitter/Twitter/pylib/oauthlib/oauth1/rfc5849/endpoints/resource.py
40eb36f515fa3935f3e9ddaa923664e88308262c
# -*- coding: utf-8 -*- """ oauthlib.oauth1.rfc5849.endpoints.resource ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This module is an implementation of the resource protection provider logic of OAuth 1.0 RFC 5849. """ from __future__ import absolute_import, unicode_literals from oauthlib.common import log from .base i...
[((6638, 6688), 'oauthlib.common.log.info', 'log.info', (['"""[Failure] request verification failed."""'], {}), "('[Failure] request verification failed.')\n", (6646, 6688), False, 'from oauthlib.common import log\n'), ((6701, 6743), 'oauthlib.common.log.info', 'log.info', (['"""Valid client: %s"""', 'valid_client'], {...
AymenSe/Geometric-operations-DIP
python/ex_1.py
ef0b0bc86210a8da5e63136bf5a239179b869722
#################################################### # # @ Authors : SEKHRI Aymen # MOHAMMED HACENE Tarek # # @ Hint: you have to install all requirements # from requirements.txt # #################################################### import numpy as np import cv2 as cv import matplotl...
[((368, 390), 'cv2.imread', 'cv.imread', (['"""onion.png"""'], {}), "('onion.png')\n", (377, 390), True, 'import cv2 as cv\n'), ((726, 740), 'cv2.imread', 'cv.imread', (['img'], {}), '(img)\n', (735, 740), True, 'import cv2 as cv\n'), ((917, 967), 'numpy.float32', 'np.float32', (['[[1, 0, col_trans], [0, 1, row_trans]]...
h-zcc/ref-nms
utils/hit_rate_utils.py
8f83f350c497d0ef875c778a8ce76725552abb3c
from utils.misc import calculate_iou, xywh_to_xyxy __all__ = ['NewHitRateEvaluator', 'CtxHitRateEvaluator'] class NewHitRateEvaluator: def __init__(self, refer, top_N=None, threshold=0.5): """Evaluate refexp-based hit rate. Args: refdb: `refdb` dict. split: Dataset spli...
[((1365, 1390), 'utils.misc.xywh_to_xyxy', 'xywh_to_xyxy', (["ann['bbox']"], {}), "(ann['bbox'])\n", (1377, 1390), False, 'from utils.misc import calculate_iou, xywh_to_xyxy\n'), ((1854, 1892), 'utils.misc.calculate_iou', 'calculate_iou', (['gt_box', "proposal['box']"], {}), "(gt_box, proposal['box'])\n", (1867, 1892),...
amukher3/Problem_solutions
LeetCode_ReorderDataLogFiles.py
8fa6014a91f295d08cafb989024caa91d99211d9
# -*- coding: utf-8 -*- """ Created on Sat Aug 22 19:07:30 2020 @author: Abhishek Mukherjee """ class Solution: def reorderLogFiles(self, logs: List[str]) -> List[str]: letLog=[] digLog=[] for i in range(len(logs)): temp=[] temp=logs...
[]
fairhopeweb/saleor
saleor/core/transactions.py
9ac6c22652d46ba65a5b894da5f1ba5bec48c019
from contextlib import contextmanager from django.db import DatabaseError from ..core.tracing import traced_atomic_transaction @contextmanager def transaction_with_commit_on_errors(): """Perform transaction and raise an error in any occurred.""" error = None with traced_atomic_transaction(): try...
[]
diberry/azure-cli
src/command_modules/azure-cli-policyinsights/azure/cli/command_modules/policyinsights/tests/latest/test_policyinsights_scenario.py
302999245cbb13b890b0a74f03443c577bd4bfae
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
[((405, 418), 'azure.cli.testsdk.record_only', 'record_only', ([], {}), '()\n', (416, 418), False, 'from azure.cli.testsdk import ScenarioTest, record_only\n')]
Aslic/rmats_turbo_4.1.0
tests/prep_post/test.py
c651509a5d32799315054fa37a2210fab2aae5e5
import glob import os.path import subprocess import sys import unittest import tests.bam import tests.base_test import tests.gtf import tests.output_parser as output_parser import tests.test_config import tests.util class Test(tests.base_test.BaseTest): def setUp(self): super().setUp() self._tes...
[((25413, 25439), 'unittest.main', 'unittest.main', ([], {'verbosity': '(2)'}), '(verbosity=2)\n', (25426, 25439), False, 'import unittest\n'), ((13604, 13691), 'subprocess.run', 'subprocess.run', (['command'], {'stdout': 'subprocess.PIPE', 'stderr': 'subprocess.PIPE', 'check': '(True)'}), '(command, stdout=subprocess....
kruskod/nltk
nltk/align/util.py
dba7b5431b1d57a75d50e048961c1a203b98c3da
# Natural Language Toolkit: Aligner Utilities # # Copyright (C) 2001-2015 NLTK Project # Author: Anna Garbar # URL: <http://www.nltk.org/> # For license information, see LICENSE.TXT from nltk.align.api import Alignment def pharaohtext2tuples(pharaoh_text): """ Converts pharaoh text format into an Alignment ob...
[((898, 923), 'nltk.align.api.Alignment', 'Alignment', (['list_of_tuples'], {}), '(list_of_tuples)\n', (907, 923), False, 'from nltk.align.api import Alignment\n')]
khanhgithead/grr
grr/server/grr_response_server/databases/db_yara_test_lib.py
8ad8a4d2c5a93c92729206b7771af19d92d4f915
#!/usr/bin/env python # -*- encoding: utf-8 -*- """A module with test cases for the YARA database method.""" import os from grr_response_server.databases import db from grr_response_server.rdfvalues import objects as rdf_objects class DatabaseTestYaraMixin(object): """A mixin class for testing YARA methods of dat...
[((442, 456), 'os.urandom', 'os.urandom', (['(32)'], {}), '(32)\n', (452, 456), False, 'import os\n'), ((778, 792), 'os.urandom', 'os.urandom', (['(32)'], {}), '(32)\n', (788, 792), False, 'import os\n'), ((1130, 1144), 'os.urandom', 'os.urandom', (['(32)'], {}), '(32)\n', (1140, 1144), False, 'import os\n'), ((1376, 1...
4aHxKzD/gpytorch
gpytorch/kernels/inducing_point_kernel.py
7193545f88820ea04588b983f1d7ed603a59a27c
#!/usr/bin/env python3 import copy import math import torch from ..distributions import MultivariateNormal from ..lazy import DiagLazyTensor, LowRankRootAddedDiagLazyTensor, LowRankRootLazyTensor, MatmulLazyTensor, delazify from ..mlls import InducingPointKernelAddedLossTerm from ..models import exact_prediction_str...
[((2083, 2102), 'torch.equal', 'torch.equal', (['x1', 'x2'], {}), '(x1, x2)\n', (2094, 2102), False, 'import torch\n'), ((848, 883), 'torch.nn.Parameter', 'torch.nn.Parameter', (['inducing_points'], {}), '(inducing_points)\n', (866, 883), False, 'import torch\n'), ((1790, 1823), 'torch.triangular_solve', 'torch.triangu...
Jotasenpai/DigitalMediaStoreRESTfull
app/__init__.py
bb776d398e1756b1ff2fd4f392b80479ae29847d
import logging import os from flask import Flask from flask_cors import CORS from app.extensions import api from app.extensions.database import db from app.extensions.schema import ma from app.views import albums, artists, hello, tracks def create_app(config, **kwargs): logging.basicConfig(level=logging.INFO) ...
[((280, 319), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (299, 319), False, 'import logging\n'), ((331, 356), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__, **kwargs)\n', (336, 356), False, 'from flask import Flask\n'), ((361, 410), 'flask_cors.CORS...
SASHA-PAIS/A-Flask-web-app-for-inventory-management
app.py
e6ed1b0d1d06ba04f9930f7653ce0504ecf81dd3
from flask import Flask, url_for, request, redirect from flask import render_template as render from flask_mysqldb import MySQL import yaml import json import MySQLdb import decimal class Encoder(json.JSONEncoder): def default(self, obj): if isinstance(obj, decimal.Decimal): return str(obj) ...
[((359, 374), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (364, 374), False, 'from flask import Flask, url_for, request, redirect\n'), ((622, 632), 'flask_mysqldb.MySQL', 'MySQL', (['app'], {}), '(app)\n', (627, 632), False, 'from flask_mysqldb import MySQL\n'), ((2494, 2604), 'flask.render_template', '...
zmxdream/Paddle
python/paddle/fluid/tests/unittests/ir/inference/test_trt_reduce_mean_op.py
04f042a5d507ad98f7f2cfc3cbc44b06d7a7f45c
# Copyright (c) 2021 PaddlePaddle 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 appli...
[((9538, 9553), 'unittest.main', 'unittest.main', ([], {}), '()\n', (9551, 9553), False, 'import unittest\n'), ((1836, 1864), 'paddle.fluid.core.is_compiled_with_cuda', 'core.is_compiled_with_cuda', ([], {}), '()\n', (1862, 1864), True, 'import paddle.fluid.core as core\n'), ((3028, 3056), 'paddle.fluid.core.is_compile...
SeHwanJoo/mmdetection_vinbig
configs/vinbig/detectors_resnext.py
9a27d2b5cd8b3ec9ed1a94e4704a7c883f15dce3
_base_ = [ '../_base_/models/cascade_rcnn_r50_fpn.py', './dataset_base.py', './scheduler_base.py', '../_base_/default_runtime.py' ] model = dict( pretrained='open-mmlab://resnext101_32x4d', backbone=dict( type='DetectoRS_ResNeXt', pretrained='open-mmlab://resnext101_32x4d', ...
[]
johnchase/scikit-bio
skbio/draw/tests/test_distributions.py
340e6153b6c93053d923d344e63481860e03731e
# ---------------------------------------------------------------------------- # Copyright (c) 2013--, scikit-bio development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. # --------------------------------------------...
[((26694, 26700), 'unittest.main', 'main', ([], {}), '()\n', (26698, 26700), False, 'from unittest import TestCase, main\n'), ((2568, 2584), 'matplotlib.pyplot.close', 'plt.close', (['"""all"""'], {}), "('all')\n", (2577, 2584), True, 'import matplotlib.pyplot as plt\n'), ((3118, 3175), 'skbio.draw._distributions._vali...
jjwatts/gigantum-client
packages/gtmapi/lmsrvcore/api/interfaces/__init__.py
88ce0475fb6880322bdd06d987c494e29064f278
from lmsrvcore.api.interfaces.user import User from lmsrvcore.api.interfaces.git import GitCommit, GitRef, GitRepository
[]
matthieucoquet/probability
tensorflow_probability/python/bijectors/invert_test.py
2426f4fc4743ceedc1a638a03d19ce6654ebff76
# Copyright 2018 The TensorFlow Probability 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 applicable law o...
[((3555, 3569), 'tensorflow.compat.v2.test.main', 'tf.test.main', ([], {}), '()\n', (3567, 3569), True, 'import tensorflow.compat.v2 as tf\n'), ((2413, 2534), 'tensorflow_probability.python.bijectors.bijector_test_util.assert_scalar_congruency', 'bijector_test_util.assert_scalar_congruency', (['bijector'], {'lower_x': ...
ZSD-tim/dayu_widgets
dayu_widgets/alert.py
31c2530bdc4161d9311574d9850c2e9471e53072
#!/usr/bin/env python # -*- coding: utf-8 -*- ################################################################### # Author: Mu yanru # Date : 2019.2 # Email : muyanru345@163.com ################################################################### """ MAlert class. """ import six import functools from dayu_widgets.avat...
[((3649, 3702), 'dayu_widgets.qt.Property', 'Property', (['six.text_type', 'get_dayu_text', 'set_dayu_text'], {}), '(six.text_type, get_dayu_text, set_dayu_text)\n', (3657, 3702), False, 'from dayu_widgets.qt import QWidget, QHBoxLayout, MPixmap, Qt, MIcon, Property\n'), ((3719, 3762), 'dayu_widgets.qt.Property', 'Prop...
byeongal/KMUCP
week03/code05.py
5bafe02c40aae67fc53d9e6cdcb727929368587e
input_str = input("문자열을 입력해 주세요. >> ") print("입력받은 문자열의 길이는", len(input_str), "입니다.")
[]
bibinvasudev/EBI_Project
jobs/SCH/JB_SALES_HIERARCHY_FLAG_N_SR.py
df2560139e463d68a37e67e0bb683c06fa9ef91b
# SCH1101.sh --> JB_SALES_HIERARCHY_FLAG_N_SR.py #************************************************************************************************************** # # Created by : bibin # Version : 1.0 # # Description : # 1. This script will load the data into 'SALES_HIERARCHY' table based on stre...
[((874, 901), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (891, 901), False, 'import logging\n'), ((1008, 1016), 'time.gmtime', 'gmtime', ([], {}), '()\n', (1014, 1016), False, 'from time import gmtime, strftime\n'), ((3717, 3747), 'dependencies.spark.start_spark', 'start_spark', ([], ...
amanbhandari2002/mythproto
myth/util.py
b03764485dad5178127307a3b3e4ddc508158143
def decodeLongLong(lst): high = int(lst[0]) << 32 low = int(lst[1]) if low < 0: low += 4294967296 if high < 0: high += 4294967296 return high + low def encodeLongLong(i): high = int(i / 4294967296) low = i - high return high, low def parseOk(str): if str == 'ok': return True else: return False def ...
[]
openem-team/openem
scripts/tator_tracker.py
45222c9c77084eacab278da25a8734ae7d43f677
#!/usr/bin/env python3 import argparse import openem import os import cv2 import numpy as np from openem.tracking import * import json import sys import datetime import tator from pprint import pprint from collections import defaultdict import yaml import math import subprocess import sys def crop_localization(fram...
[((793, 810), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (804, 810), False, 'from collections import defaultdict\n'), ((4086, 4130), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '__doc__'}), '(description=__doc__)\n', (4109, 4130), False, 'import argparse\n'), ((...
Darkar25/HyperGAN
hypergan/losses/multi_loss.py
76ef7e0c20569ceece88dc76396d92c77050692b
import tensorflow as tf import numpy as np import hyperchamber as hc from hypergan.losses.base_loss import BaseLoss from hypergan.multi_component import MultiComponent TINY=1e-8 class MultiLoss(BaseLoss): """Takes multiple distributions and does an additional approximator""" def _create(self, d_real, d_fake):...
[((908, 959), 'hypergan.multi_component.MultiComponent', 'MultiComponent', ([], {'combine': '"""concat"""', 'components': 'losses'}), "(combine='concat', components=losses)\n", (922, 959), False, 'from hypergan.multi_component import MultiComponent\n'), ((692, 708), 'tensorflow.add_n', 'tf.add_n', (['ds[1:]'], {}), '(d...
mohan-pogala/fidesops
src/fidesops/api/v1/endpoints/policy_endpoints.py
5c686362d4fb3b85253dd7e2898be1131a5071ab
import logging from typing import Any, Dict, List from fastapi import APIRouter, Body, Depends, Security from fastapi_pagination import ( Page, Params, ) from fastapi_pagination.bases import AbstractPage from fastapi_pagination.ext.sqlalchemy import paginate from fidesops.schemas.shared_schemas import FidesOp...
[((1199, 1252), 'fastapi.APIRouter', 'APIRouter', ([], {'tags': "['Policy']", 'prefix': 'urls.V1_URL_PREFIX'}), "(tags=['Policy'], prefix=urls.V1_URL_PREFIX)\n", (1208, 1252), False, 'from fastapi import APIRouter, Body, Depends, Security\n'), ((1263, 1290), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}),...
oliveriopt/mood-analytics
engage-analytics/sentiment_analysis/src/report/interface_report.py
c98eb8c483a05af938a2f6f49d8ea803f5711572
import emoji import sentiment_analysis.src.report.cons_report as cons import sentiment_analysis.src.constants as global_cons from utils.data_connection.api_data_manager import APISourcesFetcher from utils.utilities import read_json_file, CUSTOM_YEAR_WEEK_AGG, extract_dimension, extract_question from sentiment_analysis...
[((1160, 1188), 'utils.utilities.read_json_file', 'read_json_file', (['"""en_US.json"""'], {}), "('en_US.json')\n", (1174, 1188), False, 'from utils.utilities import read_json_file, CUSTOM_YEAR_WEEK_AGG, extract_dimension, extract_question\n'), ((4289, 4346), 'sentiment_analysis.src.word_cloud.words_clouds', 'words_clo...
dnguyenngoc/analytic
dwh_analytic/dags/data_warehouse_prod/schema/dim_process.py
d609a93e96e7c546ad3ee3ebd4e13309ddf575f8
resource ='human ad machime' class DimProcess: def __init__( self, *kwargs, process_key: int, module: str, type: str, step: str, sub_step: str, resource: str = 'human', ): def step(self): return ['qc', 'auto_qc', 'apr_qc', 'ke...
[]
NewRGB/lino
lino/modlib/gfks/mixins.py
43799e42107169ff173d3b8bc0324d5773471499
# -*- coding: UTF-8 -*- # Copyright 2010-2018 Rumma & Ko Ltd # License: BSD (see file COPYING for details) from builtins import object from django.contrib.contenttypes.models import * from django.conf import settings from django.utils.translation import ugettext_lazy as _ from django.utils.text import format_lazy ...
[((568, 586), 'django.utils.translation.ugettext_lazy', '_', (['"""Controlled by"""'], {}), "('Controlled by')\n", (569, 586), True, 'from django.utils.translation import ugettext_lazy as _\n'), ((1465, 1507), 'lino.api.dd.update_field', 'dd.update_field', (['cls', '"""owner_id"""'], {}), "(cls, 'owner_id', **kwargs)\n...
1enes/optical_form_reader
optical_form_reader/main.py
fab99f2403c25f84fcb5bdac50148ab248432516
import cv2 import numpy as np from imutils import contours from imutils.perspective import four_point_transform import imutils import cv2 import matplotlib.pyplot as plt import numpy as np from imutils import contours from imutils.perspective import four_point_transform,order_points import imutils cevap_an...
[((1561, 1659), 'cv2.adaptiveThreshold', 'cv2.adaptiveThreshold', (['isim_gri', '(255)', 'cv2.ADAPTIVE_THRESH_MEAN_C', 'cv2.THRESH_BINARY_INV', '(9)', '(8)'], {}), '(isim_gri, 255, cv2.ADAPTIVE_THRESH_MEAN_C, cv2.\n THRESH_BINARY_INV, 9, 8)\n', (1582, 1659), False, 'import cv2\n'), ((1673, 1740), 'cv2.findContours',...
Tigge/script.filmtipset-grade
service.py
a5b438dc478d6ef40f611585e9cd196c2ff49cf6
# Copyright (c) 2013, Gustav Tiger # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of conditions and th...
[]
turkeydonkey/nzmath3
test/testMatrix.py
a48ae9efcf0d9ad1485c2e9863c948a7f1b20311
import unittest from nzmath.matrix import * import nzmath.vector as vector import nzmath.rational as rational import nzmath.poly.uniutil as uniutil Ra = rational.Rational Poly = uniutil.polynomial Int = rational.theIntegerRing # sub test try: from test.testMatrixFiniteField import * except: try: from...
[((1955, 1976), 'nzmath.vector.Vector', 'vector.Vector', (['[1, 4]'], {}), '([1, 4])\n', (1968, 1976), True, 'import nzmath.vector as vector\n'), ((1982, 2000), 'nzmath.vector.Vector', 'vector.Vector', (['[8]'], {}), '([8])\n', (1995, 2000), True, 'import nzmath.vector as vector\n'), ((2006, 2030), 'nzmath.vector.Vecto...
li-ma/homework
python/test-nose-3.py
d75b1752a02bd028af0806683abe079c7b0a9b29
# Module Level def setUp(): print 'test setup' def tearDown(): print 'test teardown' # Function Level def func_1_setup(): print 'test_func_1 setup' def func_1_teardown(): print 'test_func_1_teardown' # Target Func def test_func_1(): print 'test_func_1 run' assert True test_func_1.setUp = f...
[]
scality/utapi
lib/reindex/reporting.py
29475f1b9aa25cf3c883262bfb6f4573f846a5b7
import requests import redis import json import ast import sys import time import urllib import re import sys from threading import Thread from concurrent.futures import ThreadPoolExecutor import argparse def get_options(): parser = argparse.ArgumentParser() parser.add_argument("-i", "--sentinel-ip", default=...
[((239, 264), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (262, 264), False, 'import argparse\n'), ((2664, 2697), 'concurrent.futures.ThreadPoolExecutor', 'ThreadPoolExecutor', ([], {'max_workers': '(1)'}), '(max_workers=1)\n', (2682, 2697), False, 'from concurrent.futures import ThreadPoolE...
recitalAI/skim-attention
src/skim/modeling/skim_attention/modeling_skim.py
a37a277072d1f70ea615cfd19e5b84a6effd2464
from collections import namedtuple import logging from dataclasses import dataclass from typing import Optional, Tuple import math import torch from torch import nn from torch.nn import CrossEntropyLoss, LayerNorm from torch.autograd.function import Function from transformers.file_utils import ( ModelOutput, ) ...
[((1007, 1034), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1024, 1034), False, 'import logging\n'), ((1062, 1139), 'collections.namedtuple', 'namedtuple', (['"""SkimformerEncoderOutput"""', "['hidden_states', 'all_hidden_states']"], {}), "('SkimformerEncoderOutput', ['hidden_states',...
xming521/coco_API
api/routers/dashboard.py
51d7ac3141e58f1d6a5438af135fba3ea101bd53
import time import psutil import pymysql from fastapi import APIRouter from api.utils import response_code router = APIRouter() @router.get('/dashboard/getinfo') def getinfo(): from init_global import g res = {} db = g.db_pool.connection() cur = db.cursor() cur.execute(f'select count(app_name) ...
[((119, 130), 'fastapi.APIRouter', 'APIRouter', ([], {}), '()\n', (128, 130), False, 'from fastapi import APIRouter\n'), ((234, 256), 'init_global.g.db_pool.connection', 'g.db_pool.connection', ([], {}), '()\n', (254, 256), False, 'from init_global import g\n'), ((810, 851), 'api.utils.response_code.resp_200', 'respons...
yujiatay/deep-motion-editing
retargeting/models/Kinematics.py
0a6fc5fd20059c5074f68a452cd49cf6ede36ea8
import torch import torch.nn as nn import numpy as np import math class ForwardKinematics: def __init__(self, args, edges): self.topology = [-1] * (len(edges) + 1) self.rotation_map = [] for i, edge in enumerate(edges): self.topology[edge[1]] = edge[0] self.rotation...
[((2281, 2344), 'torch.empty', 'torch.empty', (['(rotation.shape[:-1] + (3,))'], {'device': 'position.device'}), '(rotation.shape[:-1] + (3,), device=position.device)\n', (2292, 2344), False, 'import torch\n'), ((2363, 2405), 'torch.norm', 'torch.norm', (['rotation'], {'dim': '(-1)', 'keepdim': '(True)'}), '(rotation, ...
Ryan-Miao/airflow
tests/operators/test_hive_operator.py
a2aca8714fac014ed7da97229d7877f1bc6e5a59
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...
[((1093, 1122), 'datetime.datetime', 'datetime.datetime', (['(2015)', '(1)', '(1)'], {}), '(2015, 1, 1)\n', (1110, 1122), False, 'import datetime\n'), ((4517, 4584), 'unittest.mock.patch', 'mock.patch', (['"""airflow.operators.hive_operator.HiveOperator.get_hook"""'], {}), "('airflow.operators.hive_operator.HiveOperato...
OrionDark7/Alakajam12
main.py
4f9f8f87a05feb718baddb12aa8cbbed3e36a071
import pygame, math from game import map, ui window = pygame.display.set_mode([800, 600]) ui.window = window screen = "game" s = {"fullscreen": False} running = True gamedata = {"level": 0, "coal": 0, "iron": 1, "copper":0} tiles = pygame.sprite.Group() rails = pygame.sprite.Group() carts = pygame.sprite.Group() inter...
[((55, 90), 'pygame.display.set_mode', 'pygame.display.set_mode', (['[800, 600]'], {}), '([800, 600])\n', (78, 90), False, 'import pygame, math\n'), ((233, 254), 'pygame.sprite.Group', 'pygame.sprite.Group', ([], {}), '()\n', (252, 254), False, 'import pygame, math\n'), ((263, 284), 'pygame.sprite.Group', 'pygame.sprit...
AbdullahNoori/CS-2.1-Trees-Sorting
Code/extract_method3.py
59ba182d60abe6171a3d7d64981f79ee192de3bb
# Written by Kamran Bigdely # Example for Compose Methods: Extract Method. import math def get_distance(xc1=5, xc2=7.25, yc1=22, yc2=-4.84): # Calculate the distance between the two circle return math.sqrt((xc1-xc2)**2 + (yc1 - yc2)**2) print('distance', get_distance()) # *** somewhere else in your progra...
[((206, 252), 'math.sqrt', 'math.sqrt', (['((xc1 - xc2) ** 2 + (yc1 - yc2) ** 2)'], {}), '((xc1 - xc2) ** 2 + (yc1 - yc2) ** 2)\n', (215, 252), False, 'import math\n'), ((473, 529), 'math.sqrt', 'math.sqrt', (['((xa - xb) * (xa - xb) + (ya - yb) * (ya - yb))'], {}), '((xa - xb) * (xa - xb) + (ya - yb) * (ya - yb))\n', ...
Abhi58/sympy
sympy/integrals/prde.py
5ca228b17a7d44ef08a268ba1fa959d5763634af
""" Algorithms for solving Parametric Risch Differential Equations. The methods used for solving Parametric Risch Differential Equations parallel those for solving Risch Differential Equations. See the outline in the docstring of rde.py for more information. The Parametric Risch Differential Equation problem is, giv...
[((1901, 1920), 'sympy.integrals.risch.splitfactor', 'splitfactor', (['fd', 'DE'], {}), '(fd, DE)\n', (1912, 1920), False, 'from sympy.integrals.risch import gcdex_diophantine, frac_in, derivation, residue_reduce, splitfactor, residue_reduce_derivation, DecrementLevel, recognize_log_derivative\n'), ((2022, 2041), 'symp...
levs72/pyneng-examples
ssh_telnet/netmiko/ex07_netmiko_command_mult_prompts.py
d6288292dcf9d1ebc5a9db4a0d620bd11b4a2df9
from pprint import pprint import yaml import netmiko import paramiko def send_cmd_with_prompt(device, command, *, wait_for, confirmation): if type(wait_for) == str: wait_for = [wait_for] if type(confirmation) == str: confirmation = [confirmation] with netmiko.Netmiko(**device) as ssh: ...
[((282, 307), 'netmiko.Netmiko', 'netmiko.Netmiko', ([], {}), '(**device)\n', (297, 307), False, 'import netmiko\n'), ((782, 799), 'yaml.safe_load', 'yaml.safe_load', (['f'], {}), '(f)\n', (796, 799), False, 'import yaml\n')]
marcodalessandro76/MPPI
mppi/Utilities/AttributeDict.py
ad60b73270b1f376ac501d47285146f1c3af457a
class AttributeDict(object): """ A class to convert a nested Dictionary into an object with key-values accessibly using attribute notation (AttributeDict.attribute) instead of key notation (Dict["key"]). This class recursively sets Dicts to objects, allowing you to recurse down nested dicts (like: A...
[]
Growing-Beyond-Earth/GettingStarted
LightTestLoop.py
04c2fd5fa36224ac25a6c6c62c4d6e558b27e700
# GROWNG BEYOND EARTH CONTROL BOX Traning # RASPBERRY PI PICO / MICROPYTHON # FAIRCHILD TROPICAL BOTANIC GARDEN, Oct 18, 2021 # The Growing Beyond Earth (GBE) control box is a device that controls # the LED lights and fan in a GBE growth chamber. It can also control # accessories including a 12v water pump and enviro...
[((2409, 2422), 'time.sleep', 'time.sleep', (['(3)'], {}), '(3)\n', (2419, 2422), False, 'import time\n'), ((1639, 1653), 'machine.Pin', 'machine.Pin', (['(0)'], {}), '(0)\n', (1650, 1653), False, 'import machine\n'), ((1700, 1714), 'machine.Pin', 'machine.Pin', (['(2)'], {}), '(2)\n', (1711, 1714), False, 'import mach...
nicolasbock/hotsos
core/known_bugs_utils.py
6a0d650a8d76b5a5f85f4ddc8c0a9f8939e1de7a
import os import yaml from core import plugintools from core import constants from core.searchtools import SearchDef from core.issues.issue_utils import IssueEntry LAUNCHPAD = "launchpad" MASTER_YAML_KNOWN_BUGS_KEY = "bugs-detected" KNOWN_BUGS = {MASTER_YAML_KNOWN_BUGS_KEY: []} class BugSearchDef(SearchDef): de...
[((1781, 1838), 'os.path.join', 'os.path.join', (['constants.PLUGIN_TMP_DIR', '"""known_bugs.yaml"""'], {}), "(constants.PLUGIN_TMP_DIR, 'known_bugs.yaml')\n", (1793, 1838), False, 'import os\n'), ((2581, 2623), 'core.issues.issue_utils.IssueEntry', 'IssueEntry', (['new_bug', 'description'], {'key': '"""id"""'}), "(new...
keobox/yap101
examples/xml-rpc/echoserver.py
26913da9f61ef3d0d9cb3ef54bbfc451a9ef9de9
import SimpleXMLRPCServer as xmls def echo(msg): print 'Got', msg return msg class echoserver(xmls.SimpleXMLRPCServer): allow_reuse_address = True server = echoserver(('127.0.0.1', 8001)) server.register_function(echo, 'echo') print 'Listening on port 8001' try: server.serve_forever() except: ser...
[]
gpspelle/pose-estimation
tf_pose/slim/nets/mobilenet/mobilenet_v2_test.py
b817dcc120092002984d8a41431046f323bc02c8
# Copyright 2018 The TensorFlow 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 applica...
[((1190, 1212), 'tensorflow.get_default_graph', 'tf.get_default_graph', ([], {}), '()\n', (1210, 1212), True, 'import tensorflow as tf\n'), ((7068, 7082), 'tensorflow.test.main', 'tf.test.main', ([], {}), '()\n', (7080, 7082), True, 'import tensorflow as tf\n'), ((1348, 1372), 'tensorflow.reset_default_graph', 'tf.rese...
darwin/firebase-gist
firebase-gist.py
5aa4eb89e82fbf2971d7afca07471e1f51ff6e51
from firebase import firebase import os import datetime import json import logging from boto.s3.connection import S3Connection from boto.s3.key import Key from github3 import login firebase_url = os.environ['FIREBASE_DB'] firebase_secret = os.environ['FIREBASE_SECRET'] firebase_path = os.environ['FIREBASE_PATH'] fireb...
[((487, 526), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (506, 526), False, 'import logging\n'), ((536, 563), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (553, 563), False, 'import logging\n'), ((916, 978), 'json.dumps', 'js...
victorWeiFreelancer/CodeJam
practice/2008/qualification/C-Fly_swatter/c.py
edb8f921860a35985823cb3dbd3ebec8a8f3c12f
import sys sys.dont_write_bytecode = True def hitP(f, R, t, r, g): if f>=g/2 : return 0.0 missArea = 0.0 gridL = g+2*r nGrids = (R - t) // gridL missGridSideLength = g - 2*f print("gridL %.12f; nGrids %d" %(gridL, nGrids) ) indentSquareLength = nGrids*gridL remain = (R - t) - in...
[]
rkfg/synapse
synapse/notifier.py
0b3112123da5fae4964db784e3bab0c4d83d9d62
# -*- coding: utf-8 -*- # Copyright 2014 - 2016 OpenMarket 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 applic...
[((1703, 1730), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1720, 1730), False, 'import logging\n'), ((1758, 1805), 'prometheus_client.Counter', 'Counter', (['"""synapse_notifier_notified_events"""', '""""""'], {}), "('synapse_notifier_notified_events', '')\n", (1765, 1805), False, 'f...
nestfiy/saleor
saleor/checkout/tests/test_base_calculations.py
6fce3bc5c0ca72ac28db99553e6d2b49249c6dac
from decimal import Decimal from prices import Money, TaxedMoney from ...discount import DiscountValueType, VoucherType from ...discount.utils import get_product_discount_on_sale from ..base_calculations import ( base_checkout_total, base_tax_rate, calculate_base_line_total_price, calculate_base_line_...
[((1447, 1463), 'decimal.Decimal', 'Decimal', (['"""12.22"""'], {}), "('12.22')\n", (1454, 1463), False, 'from decimal import Decimal\n'), ((1957, 1988), 'prices.Money', 'Money', (['price_override', 'currency'], {}), '(price_override, currency)\n', (1962, 1988), False, 'from prices import Money, TaxedMoney\n'), ((3930,...
andy-z/ged4py
tests/test_date.py
2270bd8366174dcc98424cc6671bdaecf770fda0
#!/usr/bin/env python # -*- coding: utf-8 -*- """Tests for `ged4py.date` module.""" import unittest from ged4py.calendar import ( CalendarType, CalendarDate, FrenchDate, GregorianDate, HebrewDate, JulianDate, CalendarDateVisitor ) from ged4py.date import ( DateValue, DateValueAbout, DateValueAfter, DateV...
[((3455, 3484), 'ged4py.calendar.GregorianDate', 'GregorianDate', (['(2017)', '"""OCT"""', '(9)'], {}), "(2017, 'OCT', 9)\n", (3468, 3484), False, 'from ged4py.calendar import CalendarType, CalendarDate, FrenchDate, GregorianDate, HebrewDate, JulianDate, CalendarDateVisitor\n'), ((3858, 3893), 'ged4py.calendar.Gregoria...
Dunkledore/quart
src/quart/local.py
803c8678b083895f4ece35fccb6aca56e189ee0a
from __future__ import annotations import asyncio import copy from contextvars import ContextVar # noqa # contextvars not understood as stdlib from typing import Any # noqa # contextvars not understood as stdlib from typing import Callable, Dict, Optional class TaskLocal: """An object local to the current task...
[((1186, 1210), 'asyncio.get_event_loop', 'asyncio.get_event_loop', ([], {}), '()\n', (1208, 1210), False, 'import asyncio\n'), ((511, 532), 'contextvars.ContextVar', 'ContextVar', (['"""storage"""'], {}), "('storage')\n", (521, 532), False, 'from contextvars import ContextVar\n'), ((1260, 1282), 'asyncio.current_task'...
searobbersduck/pytorch-3dunet
pytorch3dunet/unet3d/predictor.py
5bb8ed2b6966b2cd06b1dc676b62d1ad98329305
import time import h5py import hdbscan import numpy as np import torch from sklearn.cluster import MeanShift from pytorch3dunet.datasets.hdf5 import SliceBuilder from pytorch3dunet.unet3d.utils import get_logger from pytorch3dunet.unet3d.utils import unpad logger = get_logger('UNet3DPredictor') class _AbstractPred...
[((269, 298), 'pytorch3dunet.unet3d.utils.get_logger', 'get_logger', (['"""UNet3DPredictor"""'], {}), "('UNet3DPredictor')\n", (279, 298), False, 'from pytorch3dunet.unet3d.utils import get_logger\n'), ((3293, 3325), 'h5py.File', 'h5py.File', (['self.output_file', '"""w"""'], {}), "(self.output_file, 'w')\n", (3302, 33...
electronicvisions/spack
var/spack/repos/builtin/packages/visionary-dev-tools/package.py
d6121eb35b4948f7d8aef7ec7a305a5123a7439e
# Copyright 2013-2019 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) import os.path as osp class VisionaryDevTools(Package): """Developer convenience packages common to all visionary ...
[((3313, 3334), 'os.path.dirname', 'osp.dirname', (['__file__'], {}), '(__file__)\n', (3324, 3334), True, 'import os.path as osp\n')]
MartaLoBalastegui/XICRA
extra/convertBAMtoPILFER.py
74a7e74379c7e1b3fc1360d2c609994e884ee37a
#usr/bin/env python ## useful imports import time import io import os import re import sys from sys import argv import subprocess ## ARGV if len (sys.argv) < 5: print ("\nUsage:") print ("python3 %s bam_file folder bedtools_bin samtools_bin logfile\n" %os.path.realpath(__file__)) exit() bam_file = os.path.abspath...
[((305, 329), 'os.path.abspath', 'os.path.abspath', (['argv[1]'], {}), '(argv[1])\n', (320, 329), False, 'import os\n'), ((542, 567), 'os.path.dirname', 'os.path.dirname', (['bam_file'], {}), '(bam_file)\n', (557, 567), False, 'import os\n'), ((976, 1000), 'os.path.isfile', 'os.path.isfile', (['bed_file'], {}), '(bed_f...
nikhilsamninan/python-files
day7/main5list.py
15198459081097058a939b40b5e8ef754e578fe0
a="Betty Bought a butter the butter was bitter so betty bought a better butter which was not bitter" v=[a[-1] for a in a.split() if(len(a)%2==0)] print(v)
[]
lcarnevale/proxy-mqtt2influx
app/reader.py
89b3cd354b465d7451556a2d2ec49ac8688b4f17
# -*- coding: utf-8 -*- #!/usr/bin/env python """Writer class based on InfluxDB This implementation does its best to follow the Robert Martin's Clean code guidelines. The comments follows the Google Python Style Guide: https://github.com/google/styleguide/blob/gh-pages/pyguide.md """ __copyright__ = 'Copyright 2...
[((1349, 1451), 'logging.basicConfig', 'logging.basicConfig', ([], {'filename': 'filename', 'filemode': '"""a"""', 'format': 'format', 'level': 'level', 'datefmt': 'datefmt'}), "(filename=filename, filemode='a', format=format, level=\n level, datefmt=datefmt)\n", (1368, 1451), False, 'import logging\n'), ((1494, 160...
DottaPaperella/TALight
example_problems/tutorial/tiling_mxn-boards_with_1x2-boards/services/tell_if_tilable/tell_if_tilable_server.py
580322c3121c9acde9827f996fd4e39e31d93a6f
#!/usr/bin/env python3 from sys import stderr, exit, argv from random import randrange #from TALinputs import TALinput from multilanguage import Env, Lang, TALcolors # METADATA OF THIS TAL_SERVICE: problem="tiling_mxn-boards_with_1x2-boards" service="is_tilable" args_list = [ ('m',int), ('n',int), ('my_co...
[((413, 445), 'multilanguage.Env', 'Env', (['problem', 'service', 'args_list'], {}), '(problem, service, args_list)\n', (416, 445), False, 'from multilanguage import Env, Lang, TALcolors\n'), ((451, 465), 'multilanguage.TALcolors', 'TALcolors', (['ENV'], {}), '(ENV)\n', (460, 465), False, 'from multilanguage import Env...