repo_name
stringlengths
7
94
repo_path
stringlengths
4
237
repo_head_hexsha
stringlengths
40
40
content
stringlengths
10
680k
apis
stringlengths
2
680k
kevinxucs/pyston
minibenchmarks/go.py
bdb87c1706ac74a0d15d9bc2bae53798678a5f14
# from pypy-benchmarks/own/chaos.py, with some minor modifications # (more output, took out the benchmark harness) # import random, math, sys, time SIZE = 9 GAMES = 200 KOMI = 7.5 EMPTY, WHITE, BLACK = 0, 1, 2 SHOW = {EMPTY: '.', WHITE: 'o', BLACK: 'x'} PASS = -1 MAXMOVES = SIZE*SIZE*3 TIMESTAMP = 0 MOVES = 0 def to...
[]
BrianPugh/circuitpython
tools/gen_usb_descriptor.py
f0bb9635bf311013e7b1ff69d1a0542575cf9d0a
# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) # # SPDX-License-Identifier: MIT import argparse import os import sys sys.path.append("../../tools/usb_descriptor") from adafruit_usb_descriptor import audio, audio10, cdc, hid, mi...
[((209, 254), 'sys.path.append', 'sys.path.append', (['"""../../tools/usb_descriptor"""'], {}), "('../../tools/usb_descriptor')\n", (224, 254), False, 'import sys\n'), ((821, 885), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Generate USB descriptors."""'}), "(description='Generate USB...
Columbine21/THUIAR-ERC
bclstm/train_meld.py
90e928e1ce777152e459dbc487acf04c32cbc645
from tqdm import tqdm import pandas as pd import numpy as np, argparse, time, pickle, random, os, datetime import torch import torch.optim as optim from model import MaskedNLLLoss, BC_LSTM from dataloader import MELDDataLoader from sklearn.metrics import f1_score, confusion_matrix, accuracy_score, classification_re...
[((427, 450), 'torch.manual_seed', 'torch.manual_seed', (['seed'], {}), '(seed)\n', (444, 450), False, 'import torch\n'), ((455, 483), 'torch.cuda.manual_seed', 'torch.cuda.manual_seed', (['seed'], {}), '(seed)\n', (477, 483), False, 'import torch\n'), ((488, 520), 'torch.cuda.manual_seed_all', 'torch.cuda.manual_seed_...
emkailu/PAT3DEM
bin/p3starcoordcheck.py
74e7a0f30179e49ea5c7da1bea893e21a3ed601a
#!/usr/bin/env python import os import sys import argparse import pat3dem.star as p3s import math def main(): progname = os.path.basename(sys.argv[0]) usage = progname + """ [options] <coord star files> Output the coord star files after deleting duplicate particles """ args_def = {'mindis':150} parser = argp...
[]
ryankirkland/voice-of-the-customer
src/review_scraper.py
0214af45cc6aa76bfce64065f07c3f4781ee045e
from bs4 import BeautifulSoup import pandas as pd import requests import time import sys def reviews_scraper(asin_list, filename): ''' Takes a list of asins, retrieves html for reviews page, and parses out key data points Parameters ---------- List of ASINs (list of strings) Returns: -----...
[((3894, 4012), 'pandas.DataFrame', 'pd.DataFrame', (['reviews'], {'columns': "['asin', 'product', 'date', 'verified', 'title', 'desc', 'reviewer_name',\n 'rating']"}), "(reviews, columns=['asin', 'product', 'date', 'verified',\n 'title', 'desc', 'reviewer_name', 'rating'])\n", (3906, 4012), True, 'import pandas ...
cglumberjack/lumber_metadata
lumberdata/metadata.py
aebca5dbecb8d7684b1b169bf2961e4ab0daca2b
# noinspection PyUnresolvedReferences import os import re # TODO I'm going to need to make a dictionary for my big list of stuff i care about and what's needed for # every file type.... RAF = ['EXIF:LensModel', 'MakerNotes:RawImageHeight', 'MakerNotes:RawImageWidth', 'EXIF:CreateDate', 'EXIF:ModifyDate', 'EXI...
[((3281, 3305), 'os.path.splitext', 'os.path.splitext', (['filein'], {}), '(filein)\n', (3297, 3305), False, 'import os\n'), ((1764, 1788), 'os.path.splitext', 'os.path.splitext', (['filein'], {}), '(filein)\n', (1780, 1788), False, 'import os\n'), ((2026, 2053), 're.split', 're.split', (['"""\\\\s+:\\\\s+"""', 'each']...
robfiras/RLBench
rlbench/task_environment.py
97ab9526b6efb718f2b5aae40897ccd75aeff11e
import logging from typing import List, Callable import numpy as np from pyquaternion import Quaternion from pyrep import PyRep from pyrep.errors import IKError from pyrep.objects import Dummy, Object from rlbench import utils from rlbench.action_modes import ArmActionMode, ActionMode from rlbench.backend.exceptions ...
[((1721, 1735), 'pyrep.objects.Dummy.create', 'Dummy.create', ([], {}), '()\n', (1733, 1735), False, 'from pyrep.objects import Dummy, Object\n'), ((8536, 8557), 'numpy.array', 'np.array', (['action[:-1]'], {}), '(action[:-1])\n', (8544, 8557), True, 'import numpy as np\n'), ((14997, 15012), 'numpy.transpose', 'np.tran...
Yoann-Vie/esgi-hearthstone
tests/generic_relations/test_forms.py
115d03426c7e8e80d89883b78ac72114c29bed12
from django import forms from django.contrib.contenttypes.forms import generic_inlineformset_factory from django.contrib.contenttypes.models import ContentType from django.db import models from django.test import TestCase from django.test.utils import isolate_apps from .models import ( Animal, ForProxyMode...
[((7814, 7847), 'django.test.utils.isolate_apps', 'isolate_apps', (['"""generic_relations"""'], {}), "('generic_relations')\n", (7826, 7847), False, 'from django.test.utils import isolate_apps\n'), ((692, 742), 'django.contrib.contenttypes.forms.generic_inlineformset_factory', 'generic_inlineformset_factory', (['Tagged...
tamnguyen135/sage
src/sage/rings/polynomial/pbori/fglm.py
2c87dc16f26604033bb1b2d1dc6796d279c88b16
from .PyPolyBoRi import (BooleSet, Polynomial, BoolePolynomialVector, FGLMStrategy) def _fglm(I, from_ring, to_ring): r""" Unchecked variant of fglm """ vec = BoolePolynomialVector(I) return FGLMStrategy(from_ring, to_ring, vec).main() def fglm(I, from_ring, to_ring): ...
[]
coursetable/ferry
ferry/embed/umap_reduce.py
f369b9588557c359af8589f2575a03493d6b08b6
""" Uses UMAP (https://umap-learn.readthedocs.io/en/latest/index.html) to reduce course embeddings to two dimensions for visualization. """ import pandas as pd import umap from sklearn.preprocessing import StandardScaler from ferry import config courses = pd.read_csv( config.DATA_DIR / "course_embeddings/courses_...
[((258, 350), 'pandas.read_csv', 'pd.read_csv', (["(config.DATA_DIR / 'course_embeddings/courses_deduplicated.csv')"], {'index_col': '(0)'}), "(config.DATA_DIR / 'course_embeddings/courses_deduplicated.csv',\n index_col=0)\n", (269, 350), True, 'import pandas as pd\n'), ((394, 489), 'pandas.read_hdf', 'pd.read_hdf',...
zhumakova/ClassProject
flora_fauna.py
b869258706dae7c8e8ab723c61a45fd78e26494f
import inheritance class Flora: def __init__(self, name, lifespan, habitat, plant_type): self.name = name self.lifespan = lifespan self.habitat = habitat self.plant_type = plant_type self.plant_size = 0 class Fauna: def __init__(self, name): self.name = name...
[]
rdenham/jug
jug/subcommands/demo.py
40925445a5f96f9eec237de37e46e6fabcce6526
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2017, Luis Pedro Coelho <luis@luispedro.org> # vim: set ts=4 sts=4 sw=4 expandtab smartindent: # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in...
[((2271, 2294), 'os.path.exists', 'path.exists', (['"""jug-demo"""'], {}), "('jug-demo')\n", (2282, 2294), False, 'from os import path\n'), ((2372, 2392), 'os.mkdir', 'os.mkdir', (['"""jug-demo"""'], {}), "('jug-demo')\n", (2380, 2392), False, 'import os\n')]
ID2797370/arxiv-search
search/controllers/simple/tests.py
889402e8eef9a2faaa8e900978cd27ff2784ce33
"""Tests for simple search controller, :mod:`search.controllers.simple`.""" from http import HTTPStatus from unittest import TestCase, mock from werkzeug.datastructures import MultiDict from werkzeug.exceptions import InternalServerError, NotFound, BadRequest from search.domain import SimpleQuery from search.control...
[((603, 656), 'unittest.mock.patch', 'mock.patch', (['"""search.controllers.simple.SearchSession"""'], {}), "('search.controllers.simple.SearchSession')\n", (613, 656), False, 'from unittest import TestCase, mock\n'), ((1324, 1377), 'unittest.mock.patch', 'mock.patch', (['"""search.controllers.simple.SearchSession"""']...
hcrlab/kuri_wandering_robot
kuri_wandering_robot/scripts/kuri_wandering_robot_executive_node.py
9c747bfe27e3c3450fd4717e26b866af2ef70149
#!/usr/bin/env python # ROS Libraries import actionlib from actionlib_msgs.msg import GoalStatus from control_msgs.msg import JointTrajectoryControllerState, FollowJointTrajectoryAction, FollowJointTrajectoryGoal from kuri_wandering_robot.msg import Power from wandering_behavior.msg import WanderAction, WanderGoal impo...
[((19163, 19202), 'rospy.init_node', 'rospy.init_node', (['"""kuri_wandering_robot"""'], {}), "('kuri_wandering_robot')\n", (19178, 19202), False, 'import rospy\n'), ((19257, 19269), 'rospy.spin', 'rospy.spin', ([], {}), '()\n', (19267, 19269), False, 'import rospy\n'), ((2419, 2451), 'rospy.get_param', 'rospy.get_para...
montehoover/NimbusML
src/python/nimbusml/internal/entrypoints/trainers_lightgbmbinaryclassifier.py
f6be39ce9359786976429bab0ccd837e849b4ba5
# - Generated by tools/entrypoint_compiler.py: do not edit by hand """ Trainers.LightGbmBinaryClassifier """ import numbers from ..utils.entrypoints import EntryPoint from ..utils.utils import try_set, unlist def trainers_lightgbmbinaryclassifier( training_data, predictor_model=None, number_...
[]
Candida18/Job-Portal-with-Automated-Resume-Screening
Job Portal with Automated Resume Screening/gensim-4.1.2/gensim/test/test_rpmodel.py
19d19464ad3d1714da856656753a4afdfe257b31
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """ Automated tests for checking transformation algorithms (the models package). """ import logging import unittest import numpy as n...
[((2240, 2336), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s : %(levelname)s : %(message)s"""', 'level': 'logging.DEBUG'}), "(format='%(asctime)s : %(levelname)s : %(message)s',\n level=logging.DEBUG)\n", (2259, 2336), False, 'import logging\n'), ((2337, 2352), 'unittest.main', 'unit...
tianhaoz95/mangekyo
playground/tianhaoz95/gan_getting_started/cgan_model.py
fd2b151538d0c15cca60e05a844baffcbe08e68c
import tensorflow as tf from tensorflow import keras class CondGeneratorModel(keras.Model): def __init__(self): super(CondGeneratorModel, self).__init__() # Expand 7*7*128 features into a (7,7,128) tensor self.dense_1 = keras.layers.Dense(7*7*256) self.reshape_1 = keras.layers.Resh...
[((250, 281), 'tensorflow.keras.layers.Dense', 'keras.layers.Dense', (['(7 * 7 * 256)'], {}), '(7 * 7 * 256)\n', (268, 281), False, 'from tensorflow import keras\n'), ((303, 336), 'tensorflow.keras.layers.Reshape', 'keras.layers.Reshape', (['(7, 7, 256)'], {}), '((7, 7, 256))\n', (323, 336), False, 'from tensorflow imp...
miracum/ahd2fhir
ahd2fhir/utils/resource_handler.py
0c1bf3e0d86278145f9f1fa5c99a121f8e961d5f
import base64 import datetime import logging import os import time from typing import List, Tuple import structlog import tenacity from averbis import Pipeline from fhir.resources.bundle import Bundle from fhir.resources.codeableconcept import CodeableConcept from fhir.resources.composition import Composition, Composi...
[((1026, 1082), 'prometheus_client.Counter', 'Counter', (['"""mapping_failures"""', '"""Exceptions during mapping"""'], {}), "('mapping_failures', 'Exceptions during mapping')\n", (1033, 1082), False, 'from prometheus_client import Counter, Histogram, Summary\n'), ((1110, 1251), 'prometheus_client.Histogram', 'Histogra...
Infinityloopsistemas/SIVA
maestros/lookups.py
92b6c82f018d39ef405989639974d1f2757476ed
# -*- coding: utf-8 -*- from selectable.decorators import login_required from maestros.models import TiposMedidasActuacion, TiposLimitesCriticos, TiposMedidasVigilancia, TiposTemperaturas, TiposFrecuencias, Zonas, Terceros, CatalogoEquipos, Personal, Consumibles, ParametrosAnalisis, Actividades, Etapas, Peligros, Tipos...
[((1100, 1140), 'selectable.registry.registry.register', 'registry.register', (['TPActuacionPrevLookup'], {}), '(TPActuacionPrevLookup)\n', (1117, 1140), False, 'from selectable.registry import registry\n'), ((1686, 1726), 'selectable.registry.registry.register', 'registry.register', (['TPActuacionCorrLookup'], {}), '(...
dew-uff/julynter
julynter/oldcmd.py
f4657aba4fa3e17af2cd241f0c3170b76df7c57c
"""Define commands for Python 2.7""" import argparse import traceback from . import util from .cmd import run from .cmd import extractpipenv def main(): """Main function""" print("This version is not supported! It has limitted analysis features") parser = argparse.ArgumentParser(description='Analyze Jupyt...
[((270, 334), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Analyze Jupyter Notebooks"""'}), "(description='Analyze Jupyter Notebooks')\n", (293, 334), False, 'import argparse\n'), ((778, 799), 'traceback.print_exc', 'traceback.print_exc', ([], {}), '()\n', (797, 799), False, 'import tr...
nurikk/gpdb
gpMgmt/bin/gppylib/test/unit/test_unit_gpcrondump.py
04fe0202c59721826d1eda2b19d73e5572893fcb
#!/usr/bin/env python import os import imp gpcrondump_path = os.path.abspath('gpcrondump') gpcrondump = imp.load_source('gpcrondump', gpcrondump_path) import unittest2 as unittest from datetime import datetime from gppylib import gplog from gpcrondump import GpCronDump from gppylib.operations.utils import DEFAULT_NUM_...
[((62, 91), 'os.path.abspath', 'os.path.abspath', (['"""gpcrondump"""'], {}), "('gpcrondump')\n", (77, 91), False, 'import os\n'), ((105, 151), 'imp.load_source', 'imp.load_source', (['"""gpcrondump"""', 'gpcrondump_path'], {}), "('gpcrondump', gpcrondump_path)\n", (120, 151), False, 'import imp\n'), ((516, 543), 'gppy...
vsosrc/ambari
ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_service_check.py
e3cc898672707bedf7597f2e16d684c8a00bba3b
#!/usr/bin/env python ''' 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 "License")...
[]
chlorm-forks/gyp
test/linux/gyptest-ldflags-from-environment.py
a8921fcaab1a18c8cf7e4ab09ceb940e336918ec
#!/usr/bin/env python # Copyright (c) 2017 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies the use of linker flags in environment variables. In this test, gyp and build both run in same local environment. """ import ...
[((401, 433), 'sys.platform.startswith', 'sys.platform.startswith', (['"""linux"""'], {}), "('linux')\n", (424, 433), False, 'import sys\n'), ((444, 476), 'TestGyp.TestGyp', 'TestGyp.TestGyp', ([], {'formats': 'FORMATS'}), '(formats=FORMATS)\n', (459, 476), False, 'import TestGyp\n'), ((522, 658), 'TestGyp.LocalEnv', '...
dhaitz/python-package-template
tests/test_advanced.py
b4c636e48ae192e5efe30fe71af37be6f8273d29
# -*- coding: utf-8 -*- from .context import sample def test_thoughts(): assert(sample.hmm() is None)
[]
dhrubach/python-code-recipes
binary_tree/m_post_order_traversal.py
14356c6adb1946417482eaaf6f42dde4b8351d2f
###################################################################### # LeetCode Problem Number : 145 # Difficulty Level : Medium # URL : https://leetcode.com/problems/binary-tree-postorder-traversal/ ###################################################################### from binary_search_tree.tree_node import TreeNo...
[]
luminisward/python-dokuwiki
dokuwiki.py
329862e6c91a79b2ad9f0b7616f7591459f2d4fd
# -*- coding: utf-8 -*- """This python module aims to manage `DokuWiki <https://www.dokuwiki.org/dokuwiki>`_ wikis by using the provided `XML-RPC API <https://www.dokuwiki.org/devel:xmlrpc>`_. It is compatible with python2.7 and python3+. Installation ------------ It is on `PyPi <https://pypi.python.org/pypi/dokuwik...
[((945, 1007), 're.compile', 're.compile', (['"""(?P<proto>https?)://(?P<host>[^/]*)(?P<uri>/.*)?"""'], {}), "('(?P<proto>https?)://(?P<host>[^/]*)(?P<uri>/.*)?')\n", (955, 1007), False, 'import re\n'), ((1261, 1310), 'datetime.datetime.strptime', 'datetime.strptime', (['date[:-5]', '"""%Y-%m-%dT%H:%M:%S"""'], {}), "(d...
lvgig/test-aide
setup.py
60a9420062dd778ce9dad43993dd8ab4f300ac4e
import setuptools import re with open("README.md", "r") as fh: long_description = fh.read() # get version from _version.py file, from below # https://stackoverflow.com/questions/458550/standard-way-to-embed-version-into-python-package VERSION_FILE = "test_aide/_version.py" version_file_str = open(VERSION_FILE, "r...
[((391, 440), 're.search', 're.search', (['VERSION_STR_RE', 'version_file_str', 're.M'], {}), '(VERSION_STR_RE, version_file_str, re.M)\n', (400, 440), False, 'import re\n'), ((999, 1025), 'setuptools.find_packages', 'setuptools.find_packages', ([], {}), '()\n', (1023, 1025), False, 'import setuptools\n')]
jbbrokaw/matplotlib
examples/pylab_examples/matshow.py
86ec1b6fc5628bfb2d09797c58d7eed0ca8c2427
"""Simple matshow() example.""" from matplotlib.pylab import * def samplemat(dims): """Make a matrix with all zeros and increasing elements on the diagonal""" aa = zeros(dims) for i in range(min(dims)): aa[i, i] = i return aa # Display 2 matrices of different sizes dimlist = [(12, 12), (15, ...
[]
HeyLifeHD/rp-bp
setup.py
9c59b1bc0267400747477467c45f96364d5528e1
#! /usr/bin/env python3 import importlib import logging import os import subprocess from setuptools import setup from setuptools.command.install import install as install from setuptools.command.develop import develop as develop logger = logging.getLogger(__name__) stan_model_files = [ os.path.join("nonperiod...
[((242, 269), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (259, 269), False, 'import logging\n'), ((4350, 4416), 'setuptools.setup', 'setup', ([], {'cmdclass': "{'install': SetupInstall, 'develop': SetupDevelop}"}), "(cmdclass={'install': SetupInstall, 'develop': SetupDevelop})\n", (43...
BorisMansencal/quickNAT_pytorch
utils/data_utils.py
1853afbe409f2fec6db298c70a3dd0ae088091f0
import os import h5py import nibabel as nb import numpy as np import torch import torch.utils.data as data from torchvision import transforms import utils.preprocessor as preprocessor # transform_train = transforms.Compose([ # transforms.RandomCrop(200, padding=56), # transforms.ToTensor(), # ]) class Imdb...
[((4062, 4083), 'nibabel.load', 'nb.load', (['file_path[0]'], {}), '(file_path[0])\n', (4069, 4083), True, 'import nibabel as nb\n'), ((4766, 4828), 'utils.preprocessor.rotate_orientation', 'preprocessor.rotate_orientation', (['volume', 'labelmap', 'orientation'], {}), '(volume, labelmap, orientation)\n', (4797, 4828),...
auho/python-ETL
lib/common/app.py
761589814b04e076ba6fa1c0e64b83ce62ce8556
import argparse import yaml import sys from .conf import MysqlConf from lib.db import mysql parser = argparse.ArgumentParser() parser.add_argument("--config", help="config file name", type=str, required=False, default='office') input_args = parser.parse_args() class PartConfig: def __init__(self): self._...
[((102, 127), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (125, 127), False, 'import argparse\n'), ((811, 839), 'yaml.safe_load', 'yaml.safe_load', (['yaml_content'], {}), '(yaml_content)\n', (825, 839), False, 'import yaml\n'), ((1606, 1635), 'lib.db.mysql.Mysql', 'mysql.Mysql', (['self.mys...
StrangeArcturus/QtAndRequestParser-Project
design.py
5205420ff06c91917ce0c1d890da85e9d72a06ea
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'design.ui' # # Created by: PyQt5 UI code generator 5.15.4 # # WARNING: Any manual changes made to this file will be lost when pyuic5 is # run again. Do not edit this file unless you know what you are doing. from PyQt5 import QtC...
[((527, 556), 'PyQt5.QtWidgets.QWidget', 'QtWidgets.QWidget', (['MainWindow'], {}), '(MainWindow)\n', (544, 556), False, 'from PyQt5 import QtCore, QtGui, QtWidgets\n'), ((638, 674), 'PyQt5.QtWidgets.QLabel', 'QtWidgets.QLabel', (['self.centralwidget'], {}), '(self.centralwidget)\n', (654, 674), False, 'from PyQt5 impo...
Alisa-lisa/conferences
EP_2019/py_impl/main.py
d93014747dc9d18493295dbc33fa51c8fb9467dc
from simulation.car import spawn_drivers from simulation.passenger import spawn_passengers from simulation.core import World, Clock conf = { "x": 100, "y": 100, "drivers": 200, "users": 1000, "start": "2019-07-08T00:00:00", "end": "2019-07-08T00:01:00" } clock = Clock(conf["start"], conf["end"...
[((289, 322), 'simulation.core.Clock', 'Clock', (["conf['start']", "conf['end']"], {}), "(conf['start'], conf['end'])\n", (294, 322), False, 'from simulation.core import World, Clock\n'), ((363, 405), 'simulation.core.World', 'World', (["[conf['x'], conf['y']]"], {'clock': 'clock'}), "([conf['x'], conf['y']], clock=clo...
avulaankith/Python
Python/reverse_with_swap.py
71269b1a36b45150edb7834c559386a91618e723
#!/bin/python3 import math import os import random import re import sys # # Complete the 'reverse_words_order_and_swap_cases' function below. # # The function is expected to return a STRING. # The function accepts STRING sentence as parameter. # def reverse_words_order_and_swap_cases(sentence): # Write your cod...
[]
INK-USC/hypter
playground/check_equal.py
732551e1e717b66ad26ba538593ed184957ecdea
import json d1 = {} with open("/home/qinyuan/zs/out/bart-large-with-description-grouped-1e-5-outerbsz4-innerbsz32-adapterdim4-unfreeze-dec29/test_predictions.jsonl") as fin: for line in fin: d = json.loads(line) d1[d["id"]] = d["output"][0]["answer"] d2 = {} dq = {} with open("/home/qinyuan/zs/out...
[((208, 224), 'json.loads', 'json.loads', (['line'], {}), '(line)\n', (218, 224), False, 'import json\n'), ((450, 466), 'json.loads', 'json.loads', (['line'], {}), '(line)\n', (460, 466), False, 'import json\n'), ((663, 679), 'json.loads', 'json.loads', (['line'], {}), '(line)\n', (673, 679), False, 'import json\n')]
MaayanLab/creeds
creeds/static/api1.py
7d580c91ca45c03e34bbc0d1928668f266ff13d9
import json, requests from pprint import pprint CREEDS_URL = 'http://amp.pharm.mssm.edu/CREEDS/' response = requests.get(CREEDS_URL + 'search', params={'q':'STAT3'}) if response.status_code == 200: pprint(response.json()) json.dump(response.json(), open('api1_result.json', 'wb'), indent=4)
[((109, 167), 'requests.get', 'requests.get', (["(CREEDS_URL + 'search')"], {'params': "{'q': 'STAT3'}"}), "(CREEDS_URL + 'search', params={'q': 'STAT3'})\n", (121, 167), False, 'import json, requests\n')]
rodlukas/UP-admin
admin/migrations/0041_course_color.py
08f36de0773f39c6222da82016bf1384af2cce18
# Generated by Django 2.2.3 on 2019-07-31 13:54 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("admin", "0040_auto_20190718_0938")] operations = [ migrations.AddField( model_name="course", name="color", field=models.CharField(default="#0...
[((292, 338), 'django.db.models.CharField', 'models.CharField', ([], {'default': '"""#000"""', 'max_length': '(7)'}), "(default='#000', max_length=7)\n", (308, 338), False, 'from django.db import migrations, models\n')]
pedrosimoes-programmer/exercicios-python
exercicios-Python/ex083.py
150de037496d63d76086678d87425a8ccfc74573
# Forma sem bugs expressao = (str(input('Digite a expressão: '))) pilhaParenteses = [] for v in expressao: if v == '(': pilhaParenteses.append('(') elif v == ')': if len(pilhaParenteses) > 0: pilhaParenteses.pop() else: pilhaParenteses.append(')') bre...
[]
code-acrobat/InspectorTodo
src/inspectortodo/todo.py
342bd0840d4f087cf2914f906ebc69bf2b21d9ce
# Copyright 2018 TNG Technology Consulting GmbH, Unterföhring, Germany # Licensed under the Apache License, Version 2.0 - see LICENSE.md in project root directory import logging from xml.sax.saxutils import escape log = logging.getLogger() class Todo: def __init__(self, file_path, line_number, content): ...
[((223, 242), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (240, 242), False, 'import logging\n'), ((1538, 1558), 'xml.sax.saxutils.escape', 'escape', (['self.content'], {}), '(self.content)\n', (1544, 1558), False, 'from xml.sax.saxutils import escape\n')]
FabLabUTFSM/fusm_usage_report
generators.py
92b18ad81f97482d6e8428b6c7cbdfc23d0ca440
import dash_core_components as dcc import dash_html_components as html import plotly.graph_objs as go import plotly.express as px from plotly.subplots import make_subplots import pandas as pd import math from datetime import datetime, time from utils import MONTH_NAMES, month_range def section(title, content, gray=Fa...
[((3304, 3323), 'utils.month_range', 'month_range', (['months'], {}), '(months)\n', (3315, 3323), False, 'from utils import MONTH_NAMES, month_range\n'), ((3654, 3665), 'plotly.graph_objs.Figure', 'go.Figure', ([], {}), '()\n', (3663, 3665), True, 'import plotly.graph_objs as go\n'), ((4464, 4483), 'utils.month_range',...
greck2908/gamification-engine
gengine/app/tests_old/test_groups.py
4a74086bde4505217e4b9ba36349a427a7042b4b
# -*- coding: utf-8 -*- from gengine.app.tests.base import BaseDBTest from gengine.app.tests.helpers import create_user, update_user, delete_user, get_or_create_language from gengine.metadata import DBSession from gengine.app.model import AuthUser class TestUserCreation(BaseDBTest): def test_user_creation(self):...
[((337, 365), 'gengine.app.tests.helpers.get_or_create_language', 'get_or_create_language', (['"""en"""'], {}), "('en')\n", (359, 365), False, 'from gengine.app.tests.helpers import create_user, update_user, delete_user, get_or_create_language\n'), ((381, 533), 'gengine.app.tests.helpers.create_user', 'create_user', ([...
guorenxi/fonttools
Lib/fontTools/designspaceLib/__init__.py
cefb41e6c261eeff0062a7b4017061982ed87aa7
from __future__ import annotations import collections import copy import itertools import math import os import posixpath from io import BytesIO, StringIO from textwrap import indent from typing import Any, Dict, List, MutableMapping, Optional, Tuple, Union from fontTools.misc import etree as ET from fontTools.misc i...
[((8905, 8922), 'fontTools.misc.textTools.tostr', 'tostr', (['familyName'], {}), '(familyName)\n', (8910, 8922), False, 'from fontTools.misc.textTools import tobytes, tostr\n'), ((20148, 20164), 'fontTools.misc.textTools.tostr', 'tostr', (['styleName'], {}), '(styleName)\n', (20153, 20164), False, 'from fontTools.misc....
dme65/Ax
ax/models/torch/posterior_mean.py
c460eab90d464df87e6478b5765fd02fb5126adb
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from typing import Any, Optional, Tuple import torch from botorch.acquisition.acquisition import AcquisitionFunction ...
[((3168, 3209), 'botorch.acquisition.monte_carlo.qSimpleRegret', 'qSimpleRegret', (['model'], {'objective': 'objective'}), '(model, objective=objective)\n', (3181, 3209), False, 'from botorch.acquisition.monte_carlo import qSimpleRegret\n'), ((2622, 2672), 'botorch.utils.get_objective_weights_transform', 'get_objective...
fanyu2021/fyAutowareAuto
src/drivers/velodyne_nodes/test/velodyne_node.test.py
073661c0634de671ff01bda8a316a5ce10c96ca9
# Copyright 2018 the Autoware Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # #    http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
[((2139, 2176), 'lidar_integration.make_active_tests', 'lidar_integration.make_active_tests', ([], {}), '()\n', (2174, 2176), False, 'import lidar_integration\n'), ((2195, 2239), 'lidar_integration.make_post_shutdown_tests', 'lidar_integration.make_post_shutdown_tests', ([], {}), '()\n', (2237, 2239), False, 'import li...
manhcuogntin4/Color-transfer
example.py
14b139efa86bb49a07a118c905d9d82cd7ad10d3
# USAGE # python example.py --source images/ocean_sunset.jpg --target images/ocean_day.jpg # import the necessary packages from color_transfer import color_transfer import numpy as np import argparse import cv2 def show_image(title, image, width = 300): # resize the image to have a constant width, just to # make di...
[((633, 658), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (656, 658), False, 'import argparse\n'), ((970, 996), 'cv2.imread', 'cv2.imread', (["args['source']"], {}), "(args['source'])\n", (980, 996), False, 'import cv2\n'), ((1006, 1032), 'cv2.imread', 'cv2.imread', (["args['target']"], {}),...
heethesh/Argoverse-HDMap-Update
scripts/registration_pipeline.py
61e9bf965a1fa7a0c74a2671457a2778d849bfe5
import copy import numpy as np import open3d as o3d from tqdm import tqdm from scipy import stats import utils_o3d as utils def remove_ground_plane(pcd, z_thresh=-2.7): cropped = copy.deepcopy(pcd) cropped_points = np.array(cropped.points) cropped_points = cropped_points[cropped_points[:, -1] > z_thresh...
[((187, 205), 'copy.deepcopy', 'copy.deepcopy', (['pcd'], {}), '(pcd)\n', (200, 205), False, 'import copy\n'), ((227, 251), 'numpy.array', 'np.array', (['cropped.points'], {}), '(cropped.points)\n', (235, 251), True, 'import numpy as np\n'), ((338, 363), 'open3d.geometry.PointCloud', 'o3d.geometry.PointCloud', ([], {})...
michaelcraige/neo4j-python-driver
neo4j/aio/__init__.py
27d0ce3f1941c4b29d0f050c6186a4f48ae4d30a
#!/usr/bin/env python # -*- encoding: utf-8 -*- # Copyright (c) 2002-2019 "Neo4j," # Neo4j Sweden AB [http://neo4j.com] # # This file is part of Neo4j. # # 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 L...
[((1531, 1550), 'logging.getLogger', 'getLogger', (['__name__'], {}), '(__name__)\n', (1540, 1550), False, 'from logging import getLogger\n'), ((35280, 35321), 'neo4j.addressing.Address.parse_list', 'Address.parse_list', (['""":7687 :17601 :17687"""'], {}), "(':7687 :17601 :17687')\n", (35298, 35321), False, 'from neo4...
bubriks/feature-store-api
python/setup.py
fa286f257b87a09c081e86811b853b3e564ce197
import os import imp from setuptools import setup, find_packages __version__ = imp.load_source( "hsfs.version", os.path.join("hsfs", "version.py") ).__version__ def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name="hsfs", version=__version__, install_...
[((118, 152), 'os.path.join', 'os.path.join', (['"""hsfs"""', '"""version.py"""'], {}), "('hsfs', 'version.py')\n", (130, 152), False, 'import os\n'), ((1456, 1471), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (1469, 1471), False, 'from setuptools import setup, find_packages\n'), ((215, 240), 'os.pat...
kfrime/yonder
src/server_py3/aps/src/wes/api/v1/users/__init__.py
cd2f491c24f8552aeadd6ee48c601e1194a2e082
#!/usr/bin/env python3 from . import signup, signin, signout, update, info, detail
[]
jamesmcclain/pytorch-multi-class-focal-loss
hubconf.py
de74657769e07dc40be838a6277dea269bfddad0
# Optional list of dependencies required by the package dependencies = ['torch'] from focal_loss import FocalLoss, focal_loss
[]
HongqiangWei/gdal
autotest/ogr/ogr_gpx.py
f7c427926438cc39d31e4459fa6401321f8e62f0
#!/usr/bin/env python ############################################################################### # $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test GPX driver functionality. # Author: Even Rouault <even dot rouault at mines dash paris dot org> # ###########################################################...
[((1597, 1624), 'sys.path.append', 'sys.path.append', (['"""../pymod"""'], {}), "('../pymod')\n", (1612, 1624), False, 'import sys\n'), ((2400, 2443), 'gdaltest.gpx_ds.GetLayerByName', 'gdaltest.gpx_ds.GetLayerByName', (['"""waypoints"""'], {}), "('waypoints')\n", (2430, 2443), False, 'import gdaltest\n'), ((2484, 2539...
max-stack/MWP-SS-Metrics
mwp_solver/models/sausolver.py
01268f2d6da716596216b04de4197e345b96c219
# Code Taken from https://github.com/LYH-YF/MWPToolkit # -*- encoding: utf-8 -*- # @Author: Yihuai Lan # @Time: 2021/08/21 04:59:55 # @File: sausolver.py import random import torch from torch import nn import copy from module.Encoder.rnn_encoder import BasicRNNEncoder from module.Embedder.basic_embedder import BasicE...
[((2643, 2714), 'module.Embedder.basic_embedder.BasicEmbedder', 'BasicEmbedder', (['self.vocab_size', 'self.embedding_size', 'self.dropout_ratio'], {}), '(self.vocab_size, self.embedding_size, self.dropout_ratio)\n', (2656, 2714), False, 'from module.Embedder.basic_embedder import BasicEmbedder\n'), ((2877, 3011), 'mod...
rafacarrascosa/rosetta
rosetta/tests/test_parallel.py
d5a964756b4f51e1032df40ee24f18398e3193b7
import unittest from functools import partial import pandas as pd from pandas.util.testing import assert_frame_equal, assert_series_equal import numpy as np import threading from StringIO import StringIO from rosetta.parallel import parallel_easy, pandas_easy from rosetta.parallel.threading_easy import threading_easy...
[((503, 525), 'functools.partial', 'partial', (['_abfunc', '(2)', '(3)'], {}), '(_abfunc, 2, 3)\n', (510, 525), False, 'from functools import partial\n'), ((1164, 1211), 'rosetta.parallel.parallel_easy.map_easy', 'parallel_easy.map_easy', (['abfunc', 'self.numbers', '(1)'], {}), '(abfunc, self.numbers, 1)\n', (1186, 12...
sdelcore/video-event-notifier-old
modules/helper/subtitles/subtitles.py
16bd322f2b81efbb3e08e63ed407ab098d610c88
import time import srt import re import datetime from mqtthandler import MQTTHandler INIT_STATUS={ "video": { "title": None, "series_title": None, "season": None, "episode": None }, "time": None, "events": None } class SubtitleHandler: subtitles = [] phrases = ...
[((380, 399), 'mqtthandler.MQTTHandler', 'MQTTHandler', (['broker'], {}), '(broker)\n', (391, 399), False, 'from mqtthandler import MQTTHandler\n'), ((1112, 1139), 're.search', 're.search', (['phrase', 'sub_line'], {}), '(phrase, sub_line)\n', (1121, 1139), False, 'import re\n'), ((1333, 1373), 'datetime.timedelta.tota...
rbago/CEBD1160_Class4_hwk
thecsvparser.py
1012c81663dc60ea9d139d96f368f8289d4b363e
#!/usr/bin/env python import os import numpy as np import pandas as pd os.getcwd() # Request for the filename # Current version of this script works only with TSV type files mainFilename = input('Input your file name (diabetes.tab.txt or housing.data.txt): ') print() # To create proper dataframe, transforming it wi...
[((73, 84), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (82, 84), False, 'import os\n'), ((375, 415), 'numpy.genfromtxt', 'np.genfromtxt', (['mainFilename'], {'dtype': '"""str"""'}), "(mainFilename, dtype='str')\n", (388, 415), True, 'import numpy as np\n'), ((432, 458), 'pandas.DataFrame', 'pd.DataFrame', (['filenameD...
wenxichen/donkeycar
donkeycar/tests/test_web_socket.py
d70ee60d35d7e0e004b885e6f6062fb51916dad1
from donkeycar.parts.web_controller.web import WebSocketCalibrateAPI from functools import partial from tornado import testing import tornado.websocket import tornado.web import tornado.ioloop import json from unittest.mock import Mock from donkeycar.parts.actuator import PWMSteering, PWMThrottle class WebSocketCal...
[((978, 984), 'unittest.mock.Mock', 'Mock', ([], {}), '()\n', (982, 984), False, 'from unittest.mock import Mock\n'), ((1607, 1613), 'unittest.mock.Mock', 'Mock', ([], {}), '()\n', (1611, 1613), False, 'from unittest.mock import Mock\n'), ((2237, 2243), 'unittest.mock.Mock', 'Mock', ([], {}), '()\n', (2241, 2243), Fals...
weese/seqan
misc/trac_plugins/IncludeMacro/includemacro/macros.py
1acb1688969c7b61497f2328af54b4d11228a484
# TracIncludeMacro macros import re import urllib2 from StringIO import StringIO from trac.core import * from trac.wiki.macros import WikiMacroBase from trac.wiki.formatter import system_message from trac.wiki.model import WikiPage from trac.mimeview.api import Mimeview, get_mimetype, Context from trac.perm import IPe...
[]
rjcuevas/Email-Frontend-AngularJS-
packages/google/cloud/logging/client.py
753dbd190582ed953058c9e15c2be920716c7985
# Copyright 2016 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
[((2148, 2178), 'os.getenv', 'os.getenv', (['DISABLE_GRPC', '(False)'], {}), '(DISABLE_GRPC, False)\n', (2157, 2178), False, 'import os\n'), ((5172, 5197), 'google.cloud.logging.logger.Logger', 'Logger', (['name'], {'client': 'self'}), '(name, client=self)\n', (5178, 5197), False, 'from google.cloud.logging.logger impo...
wwwidonja/changed_plotly
tests/test_core/test_graph_objs/test_instantiate_hierarchy.py
1bda35a438539a97c84a3ab3952e95e8848467bd
from __future__ import absolute_import from unittest import TestCase import os import importlib import inspect from plotly.basedatatypes import BasePlotlyType, BaseFigure datatypes_root = "new_plotly/graph_objs" datatype_modules = [ dirpath.replace("/", ".") for dirpath, _, _ in os.walk(datatypes_root) if...
[((290, 313), 'os.walk', 'os.walk', (['datatypes_root'], {}), '(datatypes_root)\n', (297, 313), False, 'import os\n'), ((503, 544), 'importlib.import_module', 'importlib.import_module', (['datatypes_module'], {}), '(datatypes_module)\n', (526, 544), False, 'import importlib\n')]
lyrl/mycli
mycli/packages/special/main.py
d62eefdc819a11ecdb97d93dd7ad1922d28a3795
import logging from collections import namedtuple from . import export log = logging.getLogger(__name__) NO_QUERY = 0 PARSED_QUERY = 1 RAW_QUERY = 2 SpecialCommand = namedtuple('SpecialCommand', ['handler', 'command', 'shortcut', 'description', 'arg_type', 'hidden', 'case_sensitive']) COMMANDS ...
[((79, 106), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (96, 106), False, 'import logging\n'), ((170, 293), 'collections.namedtuple', 'namedtuple', (['"""SpecialCommand"""', "['handler', 'command', 'shortcut', 'description', 'arg_type', 'hidden',\n 'case_sensitive']"], {}), "('Spec...
ShreyasTheOne/Super-Duper-Fuzzer
core/sample_fuzzer/data_generators/base.py
b667e2dca3e49a370634ad4b0bd826aca06136b7
from abc import ABC, abstractmethod class BaseDataGenerator(ABC): def __init__(self): pass @staticmethod @abstractmethod def generate(cls): pass
[]
TungTNg/itc110_python
Mon_08_06/convert2.py
589ca1398f26d39b05a0b798100df0b05e556e3c
# convert2.py # A program to convert Celsius temps to Fahrenheit. # This version issues heat and cold warnings. def main(): celsius = float(input("What is the Celsius temperature? ")) fahrenheit = 9 / 5 * celsius + 32 print("The temperature is", fahrenheit, "degrees fahrenheit.") if fahrenhei...
[]
basicpail/core
homeassistant/components/wolflink/__init__.py
5cc54618c5af3f75c08314bf2375cc7ac40d2b7e
"""The Wolf SmartSet Service integration.""" from datetime import timedelta import logging from httpx import ConnectError, ConnectTimeout from wolf_smartset.token_auth import InvalidAuth from wolf_smartset.wolf_client import FetchFailed, ParameterReadError, WolfClient from homeassistant.config_entries import ConfigEn...
[((708, 735), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (725, 735), False, 'import logging\n'), ((1321, 1351), 'wolf_smartset.wolf_client.WolfClient', 'WolfClient', (['username', 'password'], {}), '(username, password)\n', (1331, 1351), False, 'from wolf_smartset.wolf_client import F...
chunribu/python-algorithms
src/levenshtein_distance.py
0483df09b5b4f93bd96712d78e3ad34bcb7e57cc
class LevenshteinDistance: def solve(self, str_a, str_b): a, b = str_a, str_b dist = {(x,y):0 for x in range(len(a)) for y in range(len(b))} for x in range(len(a)): dist[(x,-1)] = x+1 for y in range(len(b)): dist[(-1,y)] = y+1 dist[(-1,-1)] = 0 for i in range(len(a)):...
[]
ConnectedSystems/pyapprox
pyapprox/benchmarks/test_spectral_diffusion.py
4f405654c707cba83d211f327c0f0fdbc95efa29
import numpy as np import unittest from pyapprox.benchmarks.spectral_diffusion import ( kronecker_product_2d, chebyshev_derivative_matrix, SteadyStateDiffusionEquation2D, SteadyStateDiffusionEquation1D ) from pyapprox.univariate_polynomials.quadrature import gauss_jacobi_pts_wts_1D import pyapprox as pya cla...
[((6532, 6570), 'unittest.skip', 'unittest.skip', (['"""Not fully implemented"""'], {}), "('Not fully implemented')\n", (6545, 6570), False, 'import unittest\n'), ((396, 413), 'numpy.random.seed', 'np.random.seed', (['(1)'], {}), '(1)\n', (410, 413), True, 'import numpy as np\n'), ((533, 565), 'pyapprox.benchmarks.spec...
wconnell/torchdrug
torchdrug/layers/flow.py
a710097cb4ad4c48e0de0d18fbb77ef0e806cdc8
import torch from torch import nn from torch.nn import functional as F from torchdrug import layers class ConditionalFlow(nn.Module): """ Conditional flow transformation from `Masked Autoregressive Flow for Density Estimation`_. .. _Masked Autoregressive Flow for Density Estimation: https://arxi...
[((999, 1013), 'torch.zeros', 'torch.zeros', (['(1)'], {}), '(1)\n', (1010, 1013), False, 'import torch\n'), ((1449, 1462), 'torch.nn.functional.tanh', 'F.tanh', (['scale'], {}), '(scale)\n', (1455, 1462), True, 'from torch.nn import functional as F\n'), ((2016, 2029), 'torch.nn.functional.tanh', 'F.tanh', (['scale'], ...
lowandrew/OLCTools
olctools/accessoryFunctions/metadataprinter.py
c74e9d18e2ebe0159aa824e095091045ed227e95
#!/usr/bin/env python3 import logging import json import os __author__ = 'adamkoziol' class MetadataPrinter(object): def printmetadata(self): # Iterate through each sample in the analysis for sample in self.metadata: # Set the name of the json file jsonfile = os.path.join(...
[((973, 1079), 'logging.debug', 'logging.debug', (['f"""Encountered TypeError writing metadata to file with the following details: {e}"""'], {}), "(\n f'Encountered TypeError writing metadata to file with the following details: {e}'\n )\n", (986, 1079), False, 'import logging\n')]
aman-gupta-1995/Machine-Learning-Mindware
mindware/estimators.py
8b3050720711730520683c89949e3dbdfb168961
import numpy as np from sklearn.utils.multiclass import type_of_target from mindware.base_estimator import BaseEstimator from mindware.components.utils.constants import type_dict, MULTILABEL_CLS, IMG_CLS, TEXT_CLS, OBJECT_DET from mindware.components.feature_engineering.transformation_graph import DataNode class Clas...
[((591, 619), 'sklearn.utils.multiclass.type_of_target', 'type_of_target', (['data.data[1]'], {}), '(data.data[1])\n', (605, 619), False, 'from sklearn.utils.multiclass import type_of_target\n'), ((2957, 2987), 'lightgbm.LGBMClassifier', 'LGBMClassifier', ([], {'random_state': '(1)'}), '(random_state=1)\n', (2971, 2987...
xiaowenwen1995/AnimeSpider
AnimeSpider/spiders/AinmeLinkList.py
11c676b772508fd4e14565a7adbfc7336d69b982
# -*- coding: utf-8 -*- import scrapy import json import os import codecs from AnimeSpider.items import AnimespiderItem class AinmelinklistSpider(scrapy.Spider): name = 'AinmeLinkList' allowed_domains = ['bilibili.com'] start_urls = ['http://bilibili.com/'] def start_requests(self): jsonpath ...
[((379, 451), 'codecs.open', 'codecs.open', (["('%s/AinmeList_items.json' % jsonpath)", '"""r"""'], {'encoding': '"""utf-8"""'}), "('%s/AinmeList_items.json' % jsonpath, 'r', encoding='utf-8')\n", (390, 451), False, 'import codecs\n'), ((756, 773), 'AnimeSpider.items.AnimespiderItem', 'AnimespiderItem', ([], {}), '()\n...
PacktPublishing/Raspberry-Pi-Making-Amazing-Projects-Right-from-Scratch-
Module 1/Chapter 7/prog1.py
49fd30ca8e1e30e7d85cf14e9dcb6e1d24d4a445
import cv2 print cv2.__version__
[]
darlenew/pytest-testplan
setup.py
85ef0c196efced681b6559328b3db3d409b2612d
"""Setup for pytest-testplan plugin.""" from setuptools import setup setup( name='pytest-testplan', version='0.1.0', description='A pytest plugin to generate a CSV test report.', author='Darlene Wong', author_email='darlene.py@gmail.com', license='MIT', py_modules=['pytest_testplan'], ...
[((71, 393), 'setuptools.setup', 'setup', ([], {'name': '"""pytest-testplan"""', 'version': '"""0.1.0"""', 'description': '"""A pytest plugin to generate a CSV test report."""', 'author': '"""Darlene Wong"""', 'author_email': '"""darlene.py@gmail.com"""', 'license': '"""MIT"""', 'py_modules': "['pytest_testplan']", 'in...
petr-kalinin/PaddleX
examples/industrial_quality_inspection/train_yolov3.py
e4f08b50dab01f3720570702a071188d1efd4042
# 环境变量配置,用于控制是否使用GPU # 说明文档:https://paddlex.readthedocs.io/zh_CN/develop/appendix/parameters.html#gpu import os os.environ['CUDA_VISIBLE_DEVICES'] = '0' from paddlex.det import transforms import paddlex as pdx # 下载和解压铝材缺陷检测数据集 aluminum_dataset = 'https://bj.bcebos.com/paddlex/examples/industrial_quality_inspection/da...
[((355, 417), 'paddlex.utils.download_and_decompress', 'pdx.utils.download_and_decompress', (['aluminum_dataset'], {'path': '"""./"""'}), "(aluminum_dataset, path='./')\n", (388, 417), True, 'import paddlex as pdx\n'), ((1091, 1299), 'paddlex.datasets.VOCDetection', 'pdx.datasets.VOCDetection', ([], {'data_dir': '"""al...
bartoszper/Django-REST-API-movierater
api/migrations/0004_auto_20210107_2032.py
a145f087d9c59167ea3503dde5fa74ab7f3e3e72
# Generated by Django 3.1.4 on 2021-01-07 19:32 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('api', '0003_auto_20210107_2010'), ] operations = [ migrations.AlterField( model_name='extrainfo...
[((368, 490), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'choices': "[(2, 'Sci-Fi'), (0, 'Nieznany'), (5, 'Komedia'), (3, 'Dramat'), (1, 'Horror')]", 'default': '(0)'}), "(choices=[(2, 'Sci-Fi'), (0, 'Nieznany'), (5, 'Komedia'),\n (3, 'Dramat'), (1, 'Horror')], default=0)\n", (387, 490), False, 'f...
macdaliot/Wooey
wooey/migrations/0009_script_versioning.py
3a0f40e3b3ab4d905f9acc72f5cd5d6453e14834
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import wooey.models.mixins class Migration(migrations.Migration): dependencies = [ ('wooey', '0008_short_param_admin'), ] operations = [ migrations.CreateModel( name='Scr...
[((1321, 1375), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'null': '(True)', 'to': '"""wooey.ScriptVersion"""'}), "(null=True, to='wooey.ScriptVersion')\n", (1338, 1375), False, 'from django.db import models, migrations\n'), ((1553, 1607), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'null':...
menamegaly/MR
vendor/munkireport/firewall/scripts/firewall.py
18d042639d9b45ca81a9b58659f45c6e2c3ac87f
#!/usr/bin/python """ Firewall for munkireport. By Tuxudo Will return all details about how the firewall is configured """ import subprocess import os import sys import platform import re import plistlib import json sys.path.insert(0,'/usr/local/munki') sys.path.insert(0, '/usr/local/munkireport') from munkilib impo...
[]
dpoulopoulos/cf_step
cf_step/metrics.py
c0ed1d0fbdedb863a630e90a7c7b6f95141a3e30
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/metrics.ipynb (unless otherwise specified). __all__ = ['recall_at_k', 'precision_at_k'] # Cell from typing import List # Cell def recall_at_k(predictions: List[int], targets: List[int], k: int = 10) -> float: """Computes `Recall@k` from the given predictions and ta...
[]
sandertyu/Simple-Geometry-Plot
bicycleparameters/period.py
6fa4dfb50aebc4215818f75ff56f916fc32f8cfa
#!/usr/bin/env/ python import os from math import pi import numpy as np from numpy import ma from scipy.optimize import leastsq import matplotlib.pyplot as plt from uncertainties import ufloat # local modules from .io import load_pendulum_mat_file def average_rectified_sections(data): '''Returns a slice of an o...
[((1695, 1711), 'numpy.mean', 'np.mean', (['secMean'], {}), '(secMean)\n', (1702, 1711), True, 'import numpy as np\n'), ((3127, 3212), 'os.path.join', 'os.path.join', (['pathToRawDataParts[0]', 'pathToRawDataParts[1]', 'pathToRawDataParts[2]'], {}), '(pathToRawDataParts[0], pathToRawDataParts[1],\n pathToRawDataPart...
tbenthompson/BIE_tutorials
tectosaur2/analyze.py
02cd56ab7e63e36afc4a10db17072076541aab77
import time import warnings import matplotlib.pyplot as plt import numpy as np import sympy as sp from .global_qbx import global_qbx_self from .mesh import apply_interp_mat, gauss_rule, panelize_symbolic_surface, upsample def find_dcutoff_refine(kernel, src, tol, plot=False): # prep step 1: find d_cutoff and d_...
[((951, 980), 'numpy.ones_like', 'np.ones_like', (['src.pts[:, (0)]'], {}), '(src.pts[:, (0)])\n', (963, 980), True, 'import numpy as np\n'), ((1130, 1149), 'numpy.arange', 'np.arange', (['(1)', '(55)', '(3)'], {}), '(1, 55, 3)\n', (1139, 1149), True, 'import numpy as np\n'), ((6070, 6091), 'numpy.argmin', 'np.argmin',...
hustbeta/python-examples
celery-getting-started/celeryconfig.py
9052a080cb27b1c8c2bc36222ece409e236ba076
# -*- coding: utf-8 -*- BROKER_URL = 'amqp://guest@localhost//' CELERY_ACCEPT_CONTENT = ['json'], CELERY_RESULT_BACKEND = 'amqp://guest@localhost//' CELERY_RESULT_SERIALIZER = 'json' CELERY_TASK_SERIALIZER = 'json' CELERY_TIMEZONE = 'Asia/Shanghai' CELERY_ENABLE_UTC = False
[]
msgi/nlp-tour
smartnlp/utils/basic_log.py
ffed8c32da69c2427c92a7043f47bfc91e7feb64
import logging as log class Log: def __init__(self, level): self.level = level log.basicConfig(format='%(asctime)s - %(pathname)s[line:%(lineno)d] - %(levelname)s: %(message)s', level=level) self.log = log def info(self, msg): self.log.info(msg) de...
[((101, 221), 'logging.basicConfig', 'log.basicConfig', ([], {'format': '"""%(asctime)s - %(pathname)s[line:%(lineno)d] - %(levelname)s: %(message)s"""', 'level': 'level'}), "(format=\n '%(asctime)s - %(pathname)s[line:%(lineno)d] - %(levelname)s: %(message)s',\n level=level)\n", (116, 221), True, 'import logging...
dluvizon/3d-pose-consensus
people/losses-bkp.py
7a829d5713d2c45c6b265c9886add0b69e0050a8
def structural_loss_dst68j3d(p_pred, v_pred): v_pred = K.stop_gradient(v_pred) def getlength(v): return K.sqrt(K.sum(K.square(v), axis=-1)) """Arms segments""" joints_arms = p_pred[:, :, 16:37+1, :] conf_arms = v_pred[:, :, 16:37+1] diff_arms_r = joints_arms[:, :, 2:-1:2, :] - joint...
[]
Muzammil-khan/Aspose.Email-Python-Dotnet
Examples/IMAP/FilteringMessagesFromIMAPMailbox.py
04ca3a6f440339f3ddf316218f92d15d66f24e7e
import aspose.email from aspose.email.clients.imap import ImapClient from aspose.email.clients import SecurityOptions from aspose.email.clients.imap import ImapQueryBuilder import datetime as dt def run(): dataDir = "" #ExStart: FetchEmailMessageFromServer client = ImapClient("imap.gmail.com", 993, "user...
[((281, 338), 'aspose.email.clients.imap.ImapClient', 'ImapClient', (['"""imap.gmail.com"""', '(993)', '"""username"""', '"""password"""'], {}), "('imap.gmail.com', 993, 'username', 'password')\n", (291, 338), False, 'from aspose.email.clients.imap import ImapClient\n'), ((387, 405), 'aspose.email.clients.imap.ImapQuer...
010001111/Vx-Suites
Python.FancyBear/settings.py
6b4b90a60512cce48aa7b87aec5e5ac1c4bb9a79
# Server UID SERVER_UID = 45158729 # Setup Logging system ######################################### # import os from FileConsoleLogger import FileConsoleLogger ServerLogger = FileConsoleLogger( os.path.join(os.path.dirname(os.path.abspath(__file__)), "_w3server.log") ) W3Logger = FileConsoleLogger( os.path.join(os.pa...
[((741, 909), 'P2Scheme.P2Scheme', 'P2Scheme', ([], {'_url_token': 'P2_URL_TOKEN', '_data_token': 'P2_DATA_TOKEN', '_mark': 'MARK', '_subj_token': 'P2_SUBJECT_TOKEN', '_b64junk_len': 'B64_JUNK_LEN', '_binary_junk_len': 'BIN_JUNK_LEN'}), '(_url_token=P2_URL_TOKEN, _data_token=P2_DATA_TOKEN, _mark=MARK,\n _subj_token=...
HoundThe/retdec-regression-tests
tools/fileinfo/features/certificates-info/test.py
760639deb1ee52e88a14523b4a908d3e69d6fcd3
from regression_tests import * class Test1(Test): settings = TestSettings( tool='fileinfo', input='8b280f2b7788520de214fa8d6ea32a30ebb2a51038381448939530fd0f7dfc16', args='--json --verbose' ) def test_certificates(self): assert self.fileinfo.succeeded assert self....
[]
AmitSrourDev/darn
app/darn.py
c04b681881620ffed2e1e0788d9cd80da7f806c4
import subprocess def run(cmd): subprocess.run(cmd.split(' ')) def ls(): subprocess.call(["ls", "-l"])
[((82, 111), 'subprocess.call', 'subprocess.call', (["['ls', '-l']"], {}), "(['ls', '-l'])\n", (97, 111), False, 'import subprocess\n')]
lakhlaifi/RedHat-Ansible
virt/ansible-latest/lib/python2.7/site-packages/ansible/plugins/become/runas.py
27c5077cced9d416081fcd5d69ea44bca0317fa4
# -*- coding: utf-8 -*- # Copyright: (c) 2018, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = """ become: runas short_description: Run As user ...
[]
JustHitTheCore/ctf_workshops
2017/lab_dh/utils.py
d50e8a5c90e80cdae3e17a92bce83955f0618570
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' ~Gros ''' from hashlib import sha256 import random def add_padding(data, block_size=16): """add PKCS#7 padding""" size = block_size - (len(data)%block_size) return data+chr(size)*size def strip_padding(data, block_size=16): """strip PKCS#7 padding"...
[((563, 585), 'random.randint', 'random.randint', (['(0)', '(255)'], {}), '(0, 255)\n', (577, 585), False, 'import random\n')]
nparkstar/nauta
applications/cli/commands/model/tests/test_export.py
1bda575a01f782d1dc2cd5221122651f184f7167
# # Copyright (c) 2019 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
[((1034, 1147), 'platform_resources.workflow.ArgoWorkflow', 'ArgoWorkflow', ([], {'name': 'FEM_NAME', 'started_at': 'FEM_START_DATE', 'finished_at': 'None', 'namespace': 'FEM_NAMESPACE', 'phase': 'None'}), '(name=FEM_NAME, started_at=FEM_START_DATE, finished_at=None,\n namespace=FEM_NAMESPACE, phase=None)\n', (1046,...
LiamBindle/spack
var/spack/repos/builtin/packages/py-mdanalysis/package.py
e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1
# Copyright 2013-2021 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 import * class PyMdanalysis(PythonPackage): """MDAnalysis is a Python toolkit to analyze molecular dynami...
[]
lesley-byte/enviroplus-python
lesley-byte/graphpressure.py
df08c238c8b550c9041ff06a0b6bef6b330af611
from requests import get import matplotlib.pyplot as plt import matplotlib.animation as animation import datetime as dt from bme280 import BME280 try: from smbus2 import SMBus except ImportError: from smbus import SMBus fig = plt.figure() ax = fig.add_subplot(1, 1, 1) xs = [] ys =[] bus = SMBus(1) bme280 = ...
[((237, 249), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (247, 249), True, 'import matplotlib.pyplot as plt\n'), ((302, 310), 'smbus.SMBus', 'SMBus', (['(1)'], {}), '(1)\n', (307, 310), False, 'from smbus import SMBus\n'), ((320, 339), 'bme280.BME280', 'BME280', ([], {'i2c_dev': 'bus'}), '(i2c_dev=bus)...
brett-smith/bootstrap-vz
bootstrapvz/plugins/ova/tasks.py
2eaa98db684b85186f3ecd6e5d1304aaceca6b73
from bootstrapvz.base import Task from bootstrapvz.common import phases from bootstrapvz.common.tasks import workspace import os import shutil assets = os.path.normpath(os.path.join(os.path.dirname(__file__), 'assets')) class CheckOVAPath(Task): description = 'Checking if the OVA file already exists' phase = phase...
[((183, 208), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (198, 208), False, 'import os\n'), ((483, 546), 'os.path.join', 'os.path.join', (["info.manifest.bootstrapper['workspace']", 'ova_name'], {}), "(info.manifest.bootstrapper['workspace'], ova_name)\n", (495, 546), False, 'import os\n'...
PhilippJunk/homelette
docs/conf.py
d6e585a215d7eef75ef6c837d1faf2d0ad8025c1
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If ex...
[((3421, 3455), 'os.path.exists', 'os.path.exists', (['"""../logo/logo.png"""'], {}), "('../logo/logo.png')\n", (3435, 3455), False, 'import os\n'), ((607, 628), 'os.path.abspath', 'os.path.abspath', (['""".."""'], {}), "('..')\n", (622, 628), False, 'import os\n'), ((3276, 3300), 'os.path.exists', 'os.path.exists', ([...
Cologler/bytecode2ast-python
bytecode2ast/parsers/bases.py
407b261a493e018bc86388040ddfb6fb0e4b96d9
# -*- coding: utf-8 -*- # # Copyright (c) 2019~2999 - Cologler <skyoflw@gmail.com> # ---------- # some object for parser # ---------- from typing import List import enum import dis from collections import defaultdict class ID: def __init__(self, name): self._name = name # a name use to debug def __r...
[((458, 469), 'enum.auto', 'enum.auto', ([], {}), '()\n', (467, 469), False, 'import enum\n'), ((481, 492), 'enum.auto', 'enum.auto', ([], {}), '()\n', (490, 492), False, 'import enum\n'), ((504, 515), 'enum.auto', 'enum.auto', ([], {}), '()\n', (513, 515), False, 'import enum\n'), ((529, 540), 'enum.auto', 'enum.auto'...
orphanedgamboa/netbox
netbox/extras/forms.py
5cdc38ec3adb5278480b267a6c8e674e9d3fca39
from django import forms from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType from django.utils.safestring import mark_safe from django.utils.translation import gettext as _ from dcim.models import DeviceRole, DeviceType, Platform, Region, Site, SiteGroup from tenancy....
[((4906, 4917), 'utilities.forms.SlugField', 'SlugField', ([], {}), '()\n', (4915, 4917), False, 'from utilities.forms import add_blank_choice, APISelectMultiple, BootstrapMixin, BulkEditForm, BulkEditNullBooleanSelect, ColorSelect, CommentField, ContentTypeMultipleChoiceField, CSVModelForm, DateTimePicker, DynamicMode...
zgjslc/Film-Recovery-master1
unwarp_models.py
4497a9930398c9e826ac364056a79e5bcbf6c953
import torch import torch.nn as nn import torch.nn.functional as F from models.misc import modules constrain_path = { ('threeD', 'normal'): (True, True, ''), ('threeD', 'depth'): (True, True, ''), ('normal', 'depth'): (True, True, ''), ('depth', 'normal'): (True, True, ''), } class UnwarpNet(nn.Modu...
[((680, 724), 'models.misc.modules.Encoder', 'modules.Encoder', ([], {'downsample': '(6)', 'in_channels': '(3)'}), '(downsample=6, in_channels=3)\n', (695, 724), False, 'from models.misc import modules\n'), ((755, 830), 'models.misc.modules.Decoder', 'modules.Decoder', ([], {'downsample': '(6)', 'out_channels': '(3)', ...
pansila/Auto-Test-System
endpoint/test_endpoint/update.py
bfe51a277466939a32daa08f27a89cf3c1900def
import configparser import os import hashlib import json import shutil import sys import tempfile import subprocess import tarfile import re import stat from functools import cmp_to_key from contextlib import closing from gzip import GzipFile from pathlib import Path from urllib.error import HTTPError from urllib.reque...
[((2422, 2446), 'os.path.expanduser', 'os.path.expanduser', (['path'], {}), '(path)\n', (2440, 2446), False, 'import os\n'), ((2598, 2766), 're.compile', 're.compile', (['"""v?(\\\\d+)(?:\\\\.(\\\\d+))?(?:\\\\.(\\\\d+))?(?:\\\\.(\\\\d+))?([._-]?(?:(stable|beta|b|RC|alpha|a|patch|pl|p)((?:[.-]?\\\\d+)*)?)?([.-]?dev)?)?(...
routedo/junos-pyez-example
lib/jbgp/jbgpneighbor.py
b89df2d40ca0a233529e4a26b42dd605c00aae46
""" Query BGP neighbor table on a Juniper network device. """ import sys from jnpr.junos import Device from jnpr.junos.factory import loadyaml def juniper_bgp_state(dev, bgp_neighbor): """ This function queries the BGP neighbor table on a Juniper network device. dev = Juniper device connection bgp_ne...
[((441, 474), 'jnpr.junos.factory.loadyaml', 'loadyaml', (['"""yaml/bgp_neighbor.yml"""'], {}), "('yaml/bgp_neighbor.yml')\n", (449, 474), False, 'from jnpr.junos.factory import loadyaml\n'), ((651, 662), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (659, 662), False, 'import sys\n')]
MiCHiLU/google_appengine_sdk
lib/cherrypy/cherrypy/test/test_sessionauthenticate.py
3da9f20d7e65e26c4938d2c4054bc4f39cbc5522
import cherrypy from cherrypy.test import helper class SessionAuthenticateTest(helper.CPWebCase): def setup_server(): def check(username, password): # Dummy check_username_and_password function if username != 'test' or password != 'password': return 'Wrong...
[((651, 717), 'cherrypy.Tool', 'cherrypy.Tool', (['"""before_handler"""', 'augment_params', 'None'], {'priority': '(30)'}), "('before_handler', augment_params, None, priority=30)\n", (664, 717), False, 'import cherrypy\n')]
amochtar/adventofcode
2021/day-12/solve.py
292e7f00a1e19d2149d00246b0a77fedfcd3bd08
#!/usr/bin/env python from typing import List import aoc from collections import defaultdict @aoc.timing def solve(inp: str, part2=False): def find_path(current: str, path: List[str] = []): if current == 'end': yield path return for nxt in caves[current]: if n...
[((634, 651), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (645, 651), False, 'from collections import defaultdict\n')]
suytingwan/models
PaddleCV/tracking/ltr/data/processing.py
ccdbfe77d071cc19b55fb9f4b738912e35d982ef
import numpy as np from ltr.data import transforms import ltr.data.processing_utils as prutils from pytracking.libs import TensorDict class BaseProcessing: """ Base class for Processing. Processing class is used to process the data returned by a dataset, before passing it through the network. For e...
[((488, 508), 'ltr.data.transforms.ToArray', 'transforms.ToArray', ([], {}), '()\n', (506, 508), False, 'from ltr.data import transforms\n'), ((2916, 2994), 'numpy.concatenate', 'np.concatenate', (['(jittered_center - 0.5 * jittered_size, jittered_size)'], {'axis': '(0)'}), '((jittered_center - 0.5 * jittered_size, jit...