repo_name
stringlengths
7
94
repo_path
stringlengths
4
237
repo_head_hexsha
stringlengths
40
40
content
stringlengths
10
680k
apis
stringlengths
2
840k
vijayraavi/azure-devops-cli-extension
azure-devops/azext_devops/vstsCompressed/work_item_tracking_process/v4_0/models/models.py
88f1420c5815cb09bea15b050f4c553e0f326dad
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
[]
ziggyzacks/pyrecs
responder.py
06e760aad4b49a62322f1d46660c52c81eeb1b11
import abc from utils import LogMixin class Reponse(object): __metaclass__ = abc.ABCMeta @abc.abstractmethod def redis(self): """ redis connection """ return @abc.abstractmethod def fetch(self, ids): """ hydrate relevant ids with data """ return class Movies(Rep...
[]
robfig/rules_proto
python/library.bzl
6a85b0e4c3eeddf8863890ef48f2daab7a524ab7
load("//python:compile.bzl", "py_proto_compile", "py_grpc_compile") load("@grpc_py_deps//:requirements.bzl", "all_requirements") def py_proto_library(**kwargs): name = kwargs.get("name") deps = kwargs.get("deps") verbose = kwargs.get("verbose") visibility = kwargs.get("visibility") name_pb = name ...
[]
qianlong4526888/haha
src/mem/slicc/ast/TypeDeclAST.py
01baf923693873c11ae072ce4dde3d8f1d7b6239
# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood # Copyright (c) 2009 The Hewlett-Packard Development Company # 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 co...
[((56, 19, 57, 43), 'slicc.symbols.Type.Type', 'Type', ({(56, 24, 56, 35): 'self.symtab', (56, 37, 56, 42): 'ident', (56, 44, 56, 57): 'self.location', (56, 59, 56, 69): 'self.pairs', (57, 24, 57, 42): 'self.state_machine'}, {}), '(self.symtab, ident, self.location, self.pairs, self.state_machine)', False, 'from slicc....
vpv11110000/pyss
tests/test_preempt_return.py
bc2226e2e66e0b551a09ae6ab6835b0bb6c7f32b
# #!/usr/bin/python # -*- coding: utf-8 -*- # test_preempt_return.py # pylint: disable=line-too-long,missing-docstring,bad-whitespace, unused-argument, too-many-locals import sys import os import random import unittest DIRNAME_MODULE = os.path.dirname(os.path.dirname(os.path.dirname(os.path.realpath(sys.argv[0]))))...
[]
songqing/ray
python/ray/rllib/ddpg2/ddpg_evaluator.py
166000b089ee15d44635ebca00f12320f51ce587
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import ray from ray.rllib.ddpg2.models import DDPGModel from ray.rllib.models.catalog import ModelCatalog from ray.rllib.optimizers import PolicyEvaluator from ray.rllib.utils.filter import ...
[((75, 22, 75, 47), 'ray.remote', 'ray.remote', ({(75, 33, 75, 46): 'DDPGEvaluator'}, {}), '(DDPGEvaluator)', False, 'import ray\n'), ((23, 21, 23, 58), 'ray.rllib.ddpg2.models.DDPGModel', 'DDPGModel', ({(23, 31, 23, 39): 'registry', (23, 41, 23, 49): 'self.env', (23, 51, 23, 57): 'config'}, {}), '(registry, self.env, ...
harryherold/sysmap
python/sysmap/graph.py
293e5f0dc22ed709c8fd5c170662e433c039eeab
from graphviz import Digraph from collections import namedtuple class NetworkGraph: ''' Representation of the network connections. This class contains the entities in the network e.g. hosts or switches. And the connections between them. ''' Vertex = namedtuple('Vertexes', ['hosts', 'switc...
[((11, 13, 11, 58), 'collections.namedtuple', 'namedtuple', ({(11, 24, 11, 34): '"""Vertexes"""', (11, 36, 11, 57): "['hosts', 'switches']"}, {}), "('Vertexes', ['hosts', 'switches'])", False, 'from collections import namedtuple\n'), ((97, 16, 97, 36), 'graphviz.Digraph', 'Digraph', ({}, {}), '(**graphargs)', False, 'f...
bodastage/bts-database
alembic/versions/1d092815507a_add_huawei_2g_managedobjects.py
96df7915621dd46daf55016eedf5cfc84dd0e3a2
"""Add Huawei 2G managedobjects Revision ID: 1d092815507a Revises: 3fa514f1b7a9 Create Date: 2018-02-13 01:38:59.965000 """ from alembic import op import sqlalchemy as sa import datetime # revision identifiers, used by Alembic. revision = '1d092815507a' down_revision = '3fa514f1b7a9' branch_labels = None depends_on ...
[((36, 4, 446, 6), 'alembic.op.bulk_insert', 'op.bulk_insert', ({(36, 19, 36, 33): 'managedobjects', (36, 35, 446, 5): "[{'name': 'BTSCABINET', 'parent_pk': 0, 'vendor_pk': 2, 'tech_pk': 1,\n 'modified_by': 0, 'added_by': 0}, {'name': 'AITFOTHPARA', 'parent_pk': \n 0, 'vendor_pk': 2, 'tech_pk': 1, 'modified_by': ...
tanthanadon/senior
png/imageRecognition_Simple.py
89fc24889b34860982b551e5ea5e0d3550505f65
from math import sqrt from skimage import data from skimage.feature import blob_dog, blob_log, blob_doh from skimage.color import rgb2gray from skimage import io import matplotlib.pyplot as plt image = io.imread("star.jpg") image_gray = rgb2gray(image) blobs_log = blob_log(image_gray, max_sigma=30, num_sigma=10, th...
[((10, 8, 10, 29), 'skimage.io.imread', 'io.imread', ({(10, 18, 10, 28): '"""star.jpg"""'}, {}), "('star.jpg')", False, 'from skimage import io\n'), ((11, 13, 11, 28), 'skimage.color.rgb2gray', 'rgb2gray', ({(11, 22, 11, 27): 'image'}, {}), '(image)', False, 'from skimage.color import rgb2gray\n'), ((13, 12, 13, 74), '...
gnuchev/homework
indexof.py
4083d44561cc9738d3cd8da99f8ef91b69961b6c
def indexof(listofnames, value): if value in listofnames: value_index = listofnames.index(value) return(listofnames, value_index) else: return(-1)
[]
syt1209/PythonProjects
Day22_Pong/ball.py
0409dbd3c0b0ddf00debc38875059c828eb31dec
from turtle import Turtle SPEED = 10 class Ball(Turtle): def __init__(self): super().__init__() self.penup() self.color("white") self.shape("circle") self.move_speed = 0.1 self.y_bounce = 1 self.x_bounce = 1 def move(self): new_x = self.xcor() ...
[]
lsrcz/SyGuS
programs/combine/jry2/treedef.py
5aab1b2c324d8a3c20e51f8acb2866190a1431d3
from jry2.semantics import Expr class TreeNode: pass class TreeLeaf(TreeNode): def __init__(self, term): self.term = term def getExpr(self): return self.term class TreeInnerNode(TreeNode): def __init__(self, pred, left, right): self.pred = pred self.left = left ...
[]
hsm207/sage
src/sage/modular/dirichlet.py
020bd59ec28717bfab9af44d2231c53da1ff99f1
# -*- coding: utf-8 -*- r""" Dirichlet characters A :class:`DirichletCharacter` is the extension of a homomorphism .. MATH:: (\ZZ/N\ZZ)^* \to R^*, for some ring `R`, to the map `\ZZ/N\ZZ \to R` obtained by sending those `x\in\ZZ/N\ZZ` with `\gcd(N,x)>1` to `0`. EXAMPLES:: sage: G = DirichletGroup(35) ...
[((89, 35, 89, 56), 'sage.rings.all.RationalField', 'rings.RationalField', ({}, {}), '()', True, 'import sage.rings.all as rings\n'), ((129, 8, 129, 24), 'sage.rings.all.Integer', 'rings.Integer', ({(129, 22, 129, 23): 'd'}, {}), '(d)', True, 'import sage.rings.all as rings\n'), ((133, 8, 133, 35), 'sage.arith.all.fund...
danijoo/biotite
src/biotite/file.py
22072e64676e4e917236eac8493eed4c6a22cc33
# This source code is part of the Biotite package and is distributed # under the 3-Clause BSD License. Please see 'LICENSE.rst' for further # information. __name__ = "biotite" __author__ = "Patrick Kunzmann" __all__ = ["File", "TextFile", "InvalidFileError"] import abc import io import warnings from .copyable import ...
[((63, 8, 67, 9), 'warnings.warn', 'warnings.warn', ({(64, 12, 65, 38): '"""Instance method \'read()\' is deprecated, use class method instead"""', (66, 12, 66, 30): 'DeprecationWarning'}, {}), '(\n "Instance method \'read()\' is deprecated, use class method instead",\n DeprecationWarning)', False, 'import warnin...
mckinly/cms-django
src/cms/views/push_notifications/push_notification_sender.py
c9995a3bfab6ee2d02f2406a7f83cf91b7ccfcca
""" Module for sending Push Notifications """ import logging import requests from django.conf import settings from ...models import PushNotificationTranslation from ...models import Region from ...constants import push_notifications as pnt_const logger = logging.getLogger(__name__) # pylint: disable=too-few-public...
[((13, 9, 13, 36), 'logging.getLogger', 'logging.getLogger', ({(13, 27, 13, 35): '__name__'}, {}), '(__name__)', False, 'import logging\n'), ((119, 15, 119, 73), 'requests.post', 'requests.post', (), '', False, 'import requests\n')]
reevespaul/firebird-qa
tests/functional/index/create/test_03.py
98f16f425aa9ab8ee63b86172f959d63a2d76f21
#coding:utf-8 # # id: functional.index.create.03 # title: CREATE ASC INDEX # decription: CREATE ASC INDEX # # Dependencies: # CREATE DATABASE # CREATE TABLE # SHOW INDEX # tracker_id: # min_versions: [] # versions: 1.0 # qm...
[((27, 7, 27, 52), 'firebird.qa.db_factory', 'db_factory', (), '', False, 'from firebird.qa import db_factory, isql_act, Action\n'), ((32, 8, 32, 70), 'firebird.qa.isql_act', 'isql_act', (), '', False, 'from firebird.qa import db_factory, isql_act, Action\n'), ((36, 1, 36, 29), 'pytest.mark.version', 'pytest.mark.versi...
imvu/bluesteel
app/logic/httpcommon/Page.py
ab52133249a693b3cd2d8593c5d47408a3b0fce6
""" Page object file """ class Page(): """ Page object, it contains information about the pare we are refering, index, items per page, etc. """ page_index = 0 items_per_page = 0 def __init__(self, items_per_page, page_index): """ Creates the page """ self.page_index = int(page_index) ...
[]
guochunhe/Vitis-AI
models/AI-Model-Zoo/VAI-1.3-Model-Zoo-Code/PyTorch/pt_personreid-res18_market1501_176_80_1.1G_1.3/code/core/data_manager.py
e86b6efae11f8703ee647e4a99004dc980b84989
# Copyright 2019 Xilinx 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, ...
[]
yash5OG/PythonChallengeW3-Y5
PyBank/.ipynb_checkpoints/Pymain-checkpoint.py
4a20ea5bae2d88af5a7d56f43ddc63ac64eaee67
{ "cells": [ { "cell_type": "code", "execution_count": 64, "metadata": {}, "outputs": [], "source": [ "# Import libraries\n", "import os, csv" ] }, { "cell_type": "code", "execution_count": 65, "metadata": {}, "outputs": [], "source": [ "#variables for the script\n", ...
[]
jkennedyvz/DeepFaceLive
xlib/api/win32/oleaut32/oleaut32.py
274c20808da089eb7fc0fc0e8abe649379a29ffe
from ctypes import POINTER, Structure from ..wintypes import VARIANT, dll_import @dll_import('OleAut32') def VariantInit( pvarg : POINTER(VARIANT) ) -> None: ...
[((7, 25, 7, 41), 'ctypes.POINTER', 'POINTER', ({(7, 33, 7, 40): 'VARIANT'}, {}), '(VARIANT)', False, 'from ctypes import POINTER, Structure\n')]
vijayraavi/azure-devops-cli-extension
azure-devops/azext_devops/vstsCompressed/service_hooks/v4_0/models/__init__.py
88f1420c5815cb09bea15b050f4c553e0f326dad
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
[]
DeathAdder1999/Pizdyuk
pizdyuk/pzd_logging.py
3fd7c71508c79b36e3cc801d78cd1a87eee5aa0b
import datetime as date from pzd_utils import datetime_to_str class PizdyukLogger: __logger = None def __init__(self): global __logger if self.__logger: raise RuntimeError("Logger instance already exists") @staticmethod def get_logger(): global __logger ...
[((34, 35, 34, 54), 'datetime.datetime.now', 'date.datetime.now', ({}, {}), '()', True, 'import datetime as date\n')]
LightForm-group/beta-reconstruction
beta_reconstruction/crystal_relations.py
67584f75ee08690226595c5f9dc75dfd164a11a0
import numpy as np from defdap.quat import Quat hex_syms = Quat.symEqv("hexagonal") # subset of hexagonal symmetries that give unique orientations when the # Burgers transformation is applied unq_hex_syms = [ hex_syms[0], hex_syms[5], hex_syms[4], hex_syms[2], hex_syms[10], hex_syms[11] ] cubi...
[((4, 11, 4, 35), 'defdap.quat.Quat.symEqv', 'Quat.symEqv', ({(4, 23, 4, 34): '"""hexagonal"""'}, {}), "('hexagonal')", False, 'from defdap.quat import Quat\n'), ((16, 13, 16, 33), 'defdap.quat.Quat.symEqv', 'Quat.symEqv', ({(16, 25, 16, 32): '"""cubic"""'}, {}), "('cubic')", False, 'from defdap.quat import Quat\n'), (...
Changhong-Jiang/test
a2.py
b907b984cbd9703711f52c9f497cf36b5b4e8752
print('222')
[]
emdeechege/Questionaire-API
app/api/v1/views/auth_views.py
1dd05dc25f96ea8ecdce82fe28449ea684991251
from flask import jsonify, Blueprint, request, json, make_response from werkzeug.security import generate_password_hash, check_password_hash from datetime import datetime from ..utils.validators import Validation from ..models.auth_models import Users v1_auth_blueprint = Blueprint('auth', __name__, url_prefix='/api/v...
[((8, 20, 8, 69), 'flask.Blueprint', 'Blueprint', (), '', False, 'from flask import jsonify, Blueprint, request, json, make_response\n'), ((95, 15, 96, 56), 'werkzeug.security.generate_password_hash', 'generate_password_hash', (), '', False, 'from werkzeug.security import generate_password_hash, check_password_hash\n')...
s-avni/pint
pint/testsuite/test_definitions.py
4e33d44437991bf7c5e30977643f42ebd6ed40da
# -*- coding: utf-8 -*- from __future__ import division, unicode_literals, print_function, absolute_import from pint.util import (UnitsContainer) from pint.converters import (ScaleConverter, OffsetConverter) from pint.definitions import (Definition, PrefixDefinition, UnitDefinition, Dime...
[((28, 12, 28, 55), 'pint.definitions.Definition.from_string', 'Definition.from_string', ({(28, 35, 28, 54): '"""kilo- = 1e-3 = k-"""'}, {}), "('kilo- = 1e-3 = k-')", False, 'from pint.definitions import Definition, PrefixDefinition, UnitDefinition, DimensionDefinition, AliasDefinition\n'), ((36, 12, 36, 67), 'pint.def...
Jesusown/electrum
electrum/dnssec.py
0df05dd914c823acae1828cad3b20bdeb13150e9
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2015 Thomas Voegtlin # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to deal in the Software without restriction, # including without...
[((64, 4, 64, 411), 'dns.rrset.from_text', 'dns.rrset.from_text', ({(64, 24, 64, 27): '"""."""', (64, 29, 64, 30): '(1)', (64, 36, 64, 40): '"""IN"""', (64, 42, 64, 50): '"""DNSKEY"""', (64, 52, 64, 410): '"""257 3 8 AwEAAaz/tAm8yTn4Mfeh5eyI96WSVexTBAvkMgJzkKTOiW1vkIbzxeF3+/4RgWOq7HrxRixHlFlExOLAJr5emLvN7SWXgnLh4+B5xQl...
ds-hwang/apitrace
specs/d3d11.py
b74347ebae0d033a013c4de3efb0e9165e9cea8f
########################################################################## # # Copyright 2012 Jose Fonseca # All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without res...
[]
Pil0u/adventofcode2020
day08.py
97a6c291fc1653bcb1ea7abd7f38e71e2c0458f8
from copy import deepcopy def boot(seq): index = 0 played_indices = set() acc = 0 while True: if index == len(seq): return True, acc if index in played_indices: return False, acc played_indices.add(index) line = seq[index].split() op ...
[((38, 18, 38, 33), 'copy.deepcopy', 'deepcopy', ({(38, 27, 38, 32): 'list_'}, {}), '(list_)', False, 'from copy import deepcopy\n'), ((43, 18, 43, 33), 'copy.deepcopy', 'deepcopy', ({(43, 27, 43, 32): 'list_'}, {}), '(list_)', False, 'from copy import deepcopy\n')]
onlyNata/segModel
train_fcn.py
7a823e096b3ed7f554a331c5fba39e24c9e0d8bf
# -*- coding: utf-8 -*- """ Created on Tue Jun 26 16:34:21 2018 @author: LiHongWang """ import os import tensorflow as tf from model import fcn_vgg from model import fcn_mobile from model import fcn_resnet_v2 from data import input_data slim = tf.contrib.slim def main(): num_classes...
[((26, 11, 26, 36), 'os.path.exists', 'os.path.exists', ({(26, 26, 26, 35): 'train_dir'}, {}), '(train_dir)', False, 'import os\n'), ((27, 8, 27, 30), 'os.makedirs', 'os.makedirs', ({(27, 20, 27, 29): 'train_dir'}, {}), '(train_dir)', False, 'import os\n'), ((30, 22, 30, 70), 'tensorflow.contrib.framework.get_or_create...
xbabka01/filetype.py
setup.py
faba42b86988bd21a50d5b20919ecff0c6a84957
#!/usr/bin/env python # -*- coding: utf-8 -*- import codecs from setuptools import find_packages, setup setup( name='filetype', version='1.0.7', description='Infer file type and MIME type of any file/buffer. ' 'No external dependencies.', long_description=codecs.open('README.rst', 'r',...
[((39, 13, 40, 48), 'setuptools.find_packages', 'find_packages', (), '', False, 'from setuptools import find_packages, setup\n'), ((12, 21, 13, 67), 'codecs.open', 'codecs.open', (), '', False, 'import codecs\n')]
ryanaa08/NPA
demos/netmiko_textfsm.py
45173efa60713858bb8b1d884fe12c50fe69920c
# make sure templates are present and netmiko knows about them # git clone https://github.com/networktocode/ntc-templates # export NET_TEXTFSM=/home/ntc/ntc-templates/templates/ # see https://github.com/networktocode/ntc-templates/tree/master/templates # for list of templates from netmiko import ConnectHandler import...
[]
spitfire55/python-docs-samples
iap/validate_jwt.py
b8fe0d1c5c9f7f5d27965fa3367117af7b1f0aed
# Copyright 2016 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 ...
[((77, 22, 80, 39), 'jwt.decode', 'jwt.decode', (), '', False, 'import jwt\n'), ((95, 15, 96, 60), 'requests.get', 'requests.get', ({(96, 12, 96, 59): '"""https://www.gstatic.com/iap/verify/public_key"""'}, {}), "('https://www.gstatic.com/iap/verify/public_key')", False, 'import requests\n'), ((73, 17, 73, 51), 'jwt.ge...
manatlan/htag
examples/calc.py
cf085077adf04bec8a2b059497efedb210c59936
import os,sys; sys.path.insert(0,os.path.dirname(os.path.dirname(__file__))) from htag import Tag """ This example show you how to make a "Calc App" (with physical buttons + keyboard events) There is no work for rendering the layout ;-) Can't be simpler ! """ class Calc(Tag.div): statics=[Tag.H.style(""" .myc...
[((1, 49, 1, 74), 'os.path.dirname', 'os.path.dirname', ({(1, 65, 1, 73): '__file__'}, {}), '(__file__)', False, 'import os, sys\n'), ((16, 13, 18, 4), 'htag.Tag.H.style', 'Tag.H.style', ({(16, 25, 18, 3): '"""\n.mycalc *,button {font-size:2em;font-family: monospace}\n"""'}, {}), '("""\n.mycalc *,button {font-size:2em;...
tghira16/Giraphics
res/example1.py
74265c4c0220c677e0fa3e5e65fd0b7087401106
from giraphics.graphing.graph import Graph def func(x): return (x-3)*(x+2)*x*0.2 g = Graph(800,600,8,6, 'example1.svg') g.bg() g.grid() g.axes() g.graph(func) g.save() g.display()
[((7, 4, 7, 38), 'giraphics.graphing.graph.Graph', 'Graph', ({(7, 10, 7, 13): '800', (7, 14, 7, 17): '600', (7, 18, 7, 19): '8', (7, 20, 7, 21): '6', (7, 23, 7, 37): '"""example1.svg"""'}, {}), "(800, 600, 8, 6, 'example1.svg')", False, 'from giraphics.graphing.graph import Graph\n')]
seanys/2D-Irregular-Packing-Algorithm
tools/data.py
cc10edff2bc2631fcbcb47acf7bb3215e5c5023c
from tools.geofunc import GeoFunc import pandas as pd import json def getData(index): '''报错数据集有(空心):han,jakobs1,jakobs2 ''' '''形状过多暂时未处理:shapes、shirt、swim、trousers''' name=["ga","albano","blaz1","blaz2","dighe1","dighe2","fu","han","jakobs1","jakobs2","mao","marques","shapes","shirts","swim","trousers"] ...
[((13, 9, 13, 48), 'pandas.read_csv', 'pd.read_csv', ({(13, 21, 13, 47): "'data/' + name[index] + '.csv'"}, {}), "('data/' + name[index] + '.csv')", True, 'import pandas as pd\n'), ((17, 17, 17, 45), 'json.loads', 'json.loads', ({(17, 28, 17, 44): "df['polygon'][i]"}, {}), "(df['polygon'][i])", False, 'import json\n'),...
civodlu/trw
src/trw/reporting/__init__.py
b9a1cf045f61d6df9c65c014ef63b4048972dcdc
#from trw.utils import collect_hierarchical_module_name, collect_hierarchical_parameter_name, get_batch_n, to_value, \ # safe_lookup, len_batch from .export import as_image_ui8, as_rgb_image, export_image, export_sample, export_as_image from .table_sqlite import TableStream, SQLITE_TYPE_PATTERN, get_table_number_of_...
[]
julescarbon/vframe
vframe_cli/commands/templates/image-mp.py
0798841fa9eb7e1252e4cdf71d68d991c26acab8
############################################################################# # # VFRAME # MIT License # Copyright (c) 2020 Adam Harvey and VFRAME # https://vframe.io # ############################################################################# import click @click.command('') @click.option('-i', '--input', 'opt_...
[((13, 1, 13, 18), 'click.command', 'click.command', ({(13, 15, 13, 17): '""""""'}, {}), "('')", False, 'import click\n'), ((14, 1, 14, 59), 'click.option', 'click.option', (), '', False, 'import click\n'), ((15, 1, 15, 65), 'click.option', 'click.option', (), '', False, 'import click\n'), ((16, 1, 17, 24), 'click.opti...
MarkMacDon/learndash-python
src/learndash/api_resources/user.py
a3fbfc45567a524b80c732d735f2ae101119f2e4
import learndash from learndash.api_resources.abstract import ListableAPIResource from learndash.api_resources.abstract import RetrievableAPIResource from learndash.api_resources.abstract import UpdateableAPIResource from learndash.api_resources.abstract import NestedAPIResource from learndash.api_resources.typing imp...
[]
sneumann/galaxy
lib/galaxy/tool_util/deps/container_resolvers/__init__.py
f6011bab5b8adbabae4986a45849bb9158ffc8bb
"""The module defines the abstract interface for resolving container images for tool execution.""" from abc import ( ABCMeta, abstractmethod, abstractproperty, ) import six from galaxy.util.dictifiable import Dictifiable @six.python_2_unicode_compatible @six.add_metaclass(ABCMeta) class ContainerResolve...
[((14, 1, 14, 27), 'six.add_metaclass', 'six.add_metaclass', ({(14, 19, 14, 26): 'ABCMeta'}, {}), '(ABCMeta)', False, 'import six\n')]
nirdslab/streaminghub
projects/eyetracking/gen_adhd_sin.py
a0d9f5f8be0ee6f090bd2b48b9f596695497c2bf
#!/usr/bin/env python3 import glob import os import pandas as pd import dfs SRC_DIR = f"{dfs.get_data_dir()}/adhd_sin_orig" OUT_DIR = f"{dfs.get_data_dir()}/adhd_sin" if __name__ == '__main__': files = glob.glob(f"{SRC_DIR}/*.csv") file_names = list(map(os.path.basename, files)) for file_name in file_names: ...
[((14, 10, 14, 39), 'glob.glob', 'glob.glob', ({(14, 20, 14, 38): 'f"""{SRC_DIR}/*.csv"""'}, {}), "(f'{SRC_DIR}/*.csv')", False, 'import glob\n'), ((10, 13, 10, 31), 'dfs.get_data_dir', 'dfs.get_data_dir', ({}, {}), '()', False, 'import dfs\n'), ((11, 13, 11, 31), 'dfs.get_data_dir', 'dfs.get_data_dir', ({}, {}), '()',...
TauferLab/PENGUIN
dataProcessing.py
af789163078310f2504b8a0163df4395ccf119f1
import pandas as pd import numpy as np import matplotlib.pyplot as plt import os import matplotlib.pyplot as plt import CurveFit import shutil #find all DIRECTORIES containing non-hidden files ending in FILENAME def getDataDirectories(DIRECTORY, FILENAME="valLoss.txt"): directories=[] for directory in os.scand...
[((12, 21, 12, 42), 'os.scandir', 'os.scandir', ({(12, 32, 12, 41): 'DIRECTORY'}, {}), '(DIRECTORY)', False, 'import os\n'), ((21, 16, 21, 37), 'os.scandir', 'os.scandir', ({(21, 27, 21, 36): 'DIRECTORY'}, {}), '(DIRECTORY)', False, 'import os\n'), ((41, 16, 41, 37), 'os.scandir', 'os.scandir', ({(41, 27, 41, 36): 'SEA...
Jackthebighead/recruiment-2022
algo_probs/newcoder/classic/nc52.py
a81007908e3c2f65a6be3ff2d62dfb92d0753b0d
# 题意:给出一个仅包含字符'(',')','{','}','['和']',的字符串,判断给出的字符串是否是合法的括号序列。括号必须以正确的顺序关闭,"()"和"()[]{}"都是合法的括号序列,但"(]"和"([)]"不合法。 # @param s string字符串 # @return bool布尔型 # class Solution: def isValid(self , s ): # write code here if not s: return True stack = [] dic = {'{':'}','[':']','(':')'} ...
[]
airbornemint/PieCrust2
piecrust/processing/util.py
bd8e44a1a3ba646a9ebfbb4d4f1fa01a1daa3beb
import os.path import time import logging import yaml from piecrust.processing.base import Processor logger = logging.getLogger(__name__) class _ConcatInfo(object): timestamp = 0 files = None delim = "\n" class ConcatProcessor(Processor): PROCESSOR_NAME = 'concat' def __init__(self): ...
[((8, 9, 8, 36), 'logging.getLogger', 'logging.getLogger', ({(8, 27, 8, 35): '__name__'}, {}), '(__name__)', False, 'import logging\n'), ((54, 19, 54, 30), 'time.time', 'time.time', ({}, {}), '()', False, 'import time\n'), ((66, 21, 66, 34), 'yaml.load', 'yaml.load', ({(66, 31, 66, 33): 'fp'}, {}), '(fp)', False, 'impo...
ArcosJuan/Get-out-of-my-fucking-maze
src/events/cell_pressed.py
ca2cfeaaeecb6c6f583ad647d020f25176170805
from src.events import Event class CellPressed(Event): def __init__(self, position): self.position = position def get_position(self): return self.position
[]
ckamtsikis/cmssw
TopQuarkAnalysis/TopJetCombination/python/TtSemiLepJetCombMaxSumPtWMass_cfi.py
ea19fe642bb7537cbf58451dcf73aa5fd1b66250
import FWCore.ParameterSet.Config as cms # # module to make the MaxSumPtWMass jet combination # findTtSemiLepJetCombMaxSumPtWMass = cms.EDProducer("TtSemiLepJetCombMaxSumPtWMass", ## jet input jets = cms.InputTag("selectedPatJets"), ## lepton input leps = cms.InputTag("selectedPatMuons"), ## ma...
[((8, 12, 8, 43), 'FWCore.ParameterSet.Config.InputTag', 'cms.InputTag', ({(8, 25, 8, 42): '"""selectedPatJets"""'}, {}), "('selectedPatJets')", True, 'import FWCore.ParameterSet.Config as cms\n'), ((10, 12, 10, 44), 'FWCore.ParameterSet.Config.InputTag', 'cms.InputTag', ({(10, 25, 10, 43): '"""selectedPatMuons"""'}, {...
runapp/xortool
xortool/__init__.py
9dac27387e7883775936a31e67598eaba182e053
#!/usr/bin/env python #-*- coding:utf-8 -*- __all__ = ["args", "colors", "libcolors", "routine"] __version__ = "0.96"
[]
ChreSyr/baopig
baopig/ressources/ressources.py
6264ab9a851b1ed0a031292abe7f159a53b3fc5e
from baopig.pybao.objectutilities import Object from baopig.pybao.issomething import * class RessourcePack: def config(self, **kwargs): for name, value in kwargs.items(): self.__setattr__('_'+name, value) class FontsRessourcePack(RessourcePack): def __init__(self, file=None,...
[]
glamod/glamod-misc
bufr_extract_unique_stations.py
4c8743dd3aa436377017c49bec990b11fe1c6f7d
#!/usr/bin/python2.7 """ Extract unique set of station locations (and names) along with number of obs RJHD - Exeter - October 2017 """ # ECMWF import defaults import traceback import sys from eccodes import * # RJHD imports import cartopy import numpy as np import matplotlib as mpl mpl.use('Agg') import matplotli...
[]
MidtownFellowship/libsaas
libsaas/services/twilio/applications.py
541bb731b996b08ede1d91a235cb82895765c38a
from libsaas import http, parsers from libsaas.services import base from libsaas.services.twilio import resource class ApplicationsBase(resource.TwilioResource): path = 'Applications' class Application(ApplicationsBase): def create(self, *args, **kwargs): raise base.MethodNotSupported() class A...
[((15, 14, 15, 39), 'libsaas.services.base.MethodNotSupported', 'base.MethodNotSupported', ({}, {}), '()', False, 'from libsaas.services import base\n'), ((48, 14, 48, 39), 'libsaas.services.base.MethodNotSupported', 'base.MethodNotSupported', ({}, {}), '()', False, 'from libsaas.services import base\n'), ((51, 14, 51,...
leelige/mindspore
research/gnn/sgcn/postprocess.py
5199e05ba3888963473f2b07da3f7bca5b9ef6dc
# Copyright 2021 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
[((27, 12, 27, 44), 'numpy.max', 'np.max', (), '', True, 'import numpy as np\n'), ((28, 10, 28, 27), 'numpy.exp', 'np.exp', ({(28, 17, 28, 26): 'x - t_max'}, {}), '(x - t_max)', True, 'import numpy as np\n'), ((29, 12, 29, 46), 'numpy.sum', 'np.sum', (), '', True, 'import numpy as np\n'), ((45, 22, 46, 84), 'numpy.conc...
dvolgyes/keops
pykeops/common/get_options.py
58b2c5f7822a7468a6da2ce439939e7dad04d7f3
import re import numpy as np from collections import OrderedDict import pykeops import pykeops.config ############################################################ # define backend ############################################################ class SetBackend(): """ This class is used to centralized the op...
[((16, 10, 16, 44), 'collections.OrderedDict', 'OrderedDict', ({(16, 22, 16, 43): "[('CPU', 0), ('GPU', 1)]"}, {}), "([('CPU', 0), ('GPU', 1)])", False, 'from collections import OrderedDict\n'), ((17, 11, 17, 43), 'collections.OrderedDict', 'OrderedDict', ({(17, 23, 17, 42): "[('1D', 0), ('2D', 1)]"}, {}), "([('1D', 0)...
tkm2261/dnn-voice-changer
prepare_features_vc.py
63a4ca0b2d8a33a26fc5aaec168180152df1b429
"""Prepare acoustic features for one-to-one voice conversion. usage: prepare_features_vc.py [options] <DATA_ROOT> <source_speaker> <target_speaker> options: --max_files=<N> Max num files to be collected. [default: 100] --dst_dir=<d> Destination directory [default: data/cmu_arctic_vc]. --ov...
[((65, 11, 65, 26), 'docopt.docopt', 'docopt', ({(65, 18, 65, 25): '__doc__'}, {}), '(__doc__)', False, 'from docopt import docopt\n'), ((44, 16, 44, 38), 'scipy.io.wavfile.read', 'wavfile.read', ({(44, 29, 44, 37): 'wav_path'}, {}), '(wav_path)', False, 'from scipy.io import wavfile\n'), ((46, 23, 46, 71), 'pyworld.di...
zgtz/streamlit
lib/tests/streamlit/pydeck_test.py
be797682394955ef2b94a5f7641b6f9d8fd1dbfc
# Copyright 2018-2021 Streamlit 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 wr...
[((24, 6, 24, 66), 'pandas.DataFrame', 'pd.DataFrame', ({(24, 19, 24, 65): "{'lat': [1, 2, 3, 4], 'lon': [10, 20, 30, 40]}"}, {}), "({'lat': [1, 2, 3, 4], 'lon': [10, 20, 30, 40]})", True, 'import pandas as pd\n'), ((40, 17, 40, 55), 'json.loads', 'json.loads', ({(40, 28, 40, 54): 'el.deck_gl_json_chart.json'}, {}), '(...
Doctusoft/beam
sdks/python/apache_beam/io/gcp/bigquery_tools.py
91d59e78ffec3771a1d646c4e320fff571393829
# # 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"); you may not us...
[((106, 16, 106, 41), 'json.loads', 'json.loads', ({(106, 27, 106, 40): 'schema_string'}, {}), '(schema_string)', False, 'import json\n'), ((131, 9, 131, 44), 'apache_beam.io.gcp.internal.clients.bigquery.TableSchema', 'bigquery.TableSchema', (), '', False, 'from apache_beam.io.gcp.internal.clients import bigquery\n'),...
workingyifei/display-pattern-generator
VENV/lib/python3.6/site-packages/PyInstaller/hooks/hook-PyQt5.py
b27be84c6221fa93833f283109870737b05bfbf6
#----------------------------------------------------------------------------- # Copyright (c) 2005-2017, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License with exception # for distributing bootloader. # # The full license is in the file COPYING.txt, distributed with this s...
[((40, 17, 40, 71), 'PyInstaller.utils.hooks.get_module_attribute', 'get_module_attribute', ({(40, 38, 40, 52): '"""PyQt5.QtCore"""', (40, 54, 40, 70): '"""QT_VERSION_STR"""'}, {}), "('PyQt5.QtCore', 'QT_VERSION_STR')", False, 'from PyInstaller.utils.hooks import get_module_attribute, is_module_satisfies, qt_menu_nib_d...
upgradvisor/vyper
tests/ast/nodes/test_from_node.py
642884ea938a25793c1b2fac866e8458e63a7b49
from vyper import ast as vy_ast def test_output_class(): old_node = vy_ast.parse_to_ast("foo = 42") new_node = vy_ast.Int.from_node(old_node, value=666) assert isinstance(new_node, vy_ast.Int) def test_source(): old_node = vy_ast.parse_to_ast("foo = 42") new_node = vy_ast.Int.from_node(old_node...
[((5, 15, 5, 46), 'vyper.ast.parse_to_ast', 'vy_ast.parse_to_ast', ({(5, 35, 5, 45): '"""foo = 42"""'}, {}), "('foo = 42')", True, 'from vyper import ast as vy_ast\n'), ((6, 15, 6, 56), 'vyper.ast.Int.from_node', 'vy_ast.Int.from_node', (), '', True, 'from vyper import ast as vy_ast\n'), ((12, 15, 12, 46), 'vyper.ast.p...
dayta-ai/deepo
generator/modules/opencv.py
fa720e39052e63adfe0f2b9dbd8444a0d69c2540
# -*- coding: utf-8 -*- from .__module__ import Module, dependency, source, version from .tools import Tools from .boost import Boost from .python import Python @dependency(Tools, Python, Boost) @source('git') @version('4.0.1') class Opencv(Module): def build(self): return r''' RUN ln -fs /usr/sh...
[]
jmacarthur/aoc2017
day16/solve16.py
2a3096aabf464ef52c05f9437498035cfb5ca1a6
#!/usr/bin/python import sys import copy stage_length = 16 stage = map(chr, range(ord('a'),ord('a')+stage_length)) def spin(amount): """To save time, this function isn't used except at the end. Normally, a counter marks the start of the stage and this changes instead. """ global stage stage = stag...
[]
jaberg/scikits-image
skimage/segmentation/tests/test_felzenszwalb.py
2ab3e2dfb341189ef2ff9370c6cf3d33ef6ec88d
import numpy as np from numpy.testing import assert_equal, assert_array_equal from nose.tools import assert_greater from skimage.segmentation import felzenszwalb def test_grey(): # very weak tests. This algorithm is pretty unstable. img = np.zeros((20, 21)) img[:10, 10:] = 0.2 img[10:, :10] = 0.4 ...
[((9, 10, 9, 28), 'numpy.zeros', 'np.zeros', ({(9, 19, 9, 27): '(20, 21)'}, {}), '((20, 21))', True, 'import numpy as np\n'), ((13, 10, 13, 36), 'skimage.segmentation.felzenszwalb', 'felzenszwalb', (), '', False, 'from skimage.segmentation import felzenszwalb\n'), ((24, 10, 24, 31), 'numpy.zeros', 'np.zeros', ({(24, 19...
w3x10e8/core
tests/middleware/test_csrf_middleware.py
d8f0ca29c2bd5e86d199391fa916ce2f5c9b0f49
from masonite.request import Request from masonite.view import View from masonite.auth.Csrf import Csrf from masonite.app import App from masonite.middleware import CsrfMiddleware from masonite.testsuite.TestSuite import generate_wsgi import pytest from masonite.exceptions import InvalidCSRFToken class TestCSRFMiddle...
[((14, 19, 14, 24), 'masonite.app.App', 'App', ({}, {}), '()', False, 'from masonite.app import App\n'), ((16, 20, 16, 34), 'masonite.view.View', 'View', ({(16, 25, 16, 33): 'self.app'}, {}), '(self.app)', False, 'from masonite.view import View\n'), ((15, 31, 15, 46), 'masonite.testsuite.TestSuite.generate_wsgi', 'gene...
ltxom/phoible
phoible/views.py
7ce6f5e62d885f142dba61937d920e68fa7f9fca
from pyramid.view import view_config import os @view_config(route_name='faq', renderer='faq.mako') def faq_view(request): dir_path = os.path.dirname(__file__) faq_file = os.path.join(dir_path, 'static/faq_with_indexes.html') with open(faq_file, 'r') as f: faq_page = f.read() return {'content':...
[((5, 1, 5, 51), 'pyramid.view.view_config', 'view_config', (), '', False, 'from pyramid.view import view_config\n'), ((14, 1, 14, 67), 'pyramid.view.view_config', 'view_config', (), '', False, 'from pyramid.view import view_config\n'), ((7, 15, 7, 40), 'os.path.dirname', 'os.path.dirname', ({(7, 31, 7, 39): '__file__'...
aiace9/aiida-core
tests/restapi/test_routes.py
09ac91654648adb684a58d5d2d7b1c11a503dae8
# -*- coding: utf-8 -*- ########################################################################### # Copyright (c), The AiiDA team. All rights reserved. # # This file is part of the AiiDA code. # # ...
[((39, 14, 39, 55), 'aiida.restapi.run_api.configure_api', 'configure_api', (), '', False, 'from aiida.restapi.run_api import configure_api\n'), ((45, 20, 45, 48), 'aiida.orm.StructureData', 'orm.StructureData', (), '', False, 'from aiida import orm\n'), ((54, 21, 54, 52), 'aiida.orm.Dict', 'orm.Dict', (), '', False, '...
yletallec/processmonitor
processmonitor.py
95db3416ec35fcb1325a1ac6c5a26807e4c3a474
"""Process Monitor Usage: processmonitor.py <process_name> <overall_duration> [<sampling_interval>] processmonitor.py -h|--help processmonitor.py -v|--version Options: <process_name> Process name argument. <overall_duration> Overall duration of the monitoring in seconds. <sampling_interval> Sam...
[((33, 14, 33, 21), 'threading.Event', 'Event', ({}, {}), '()', False, 'from threading import Event, Thread\n'), ((43, 34, 43, 59), 'process.Process.metrics_average', 'Process.metrics_average', ({}, {}), '()', False, 'from process import Process\n'), ((70, 8, 70, 38), 'process.Process.has_memory_leaks', 'Process.has_me...
Tim232/Python-Things
Projects/DeepLearningTechniques/MobileNet_v2/tiny_imagenet/data_loader.py
05f0f373a4cf298e70d9668c88a6e3a9d1cd8146
import os import re import numpy as np from Projects.DeepLearningTechniques.MobileNet_v2.tiny_imagenet.constants import * class DataLoader: # todo train/test/validation => (클래스 당 500/50/50) def __init__(self): self.image_width = flags.FLAGS.image_width self.image_height = flags.FLAGS.image_he...
[((15, 23, 15, 61), 're.compile', 're.compile', ({(15, 34, 15, 45): '""".*\\\\.jpeg"""', (15, 47, 15, 60): 're.IGNORECASE'}, {}), "('.*\\\\.jpeg', re.IGNORECASE)", False, 'import re\n'), ((45, 22, 45, 59), 'numpy.random.permutation', 'np.random.permutation', ({(45, 44, 45, 58): 'self.train_len'}, {}), '(self.train_len)...
dedukun/MarkReport
MarkReport/MarkReport.py
2d92c87a69db5868d14b7a59e815b9ee72d439f9
#!/usr/bin/env python3 # Command line flags import os import glob import re import pyinotify import subprocess from sys import stdout, stderr from time import time, sleep from tempfile import gettempdir from distutils.dir_util import copy_tree from shutil import copyfile from weasyprint import HTML import argparse p...
[((18, 9, 19, 59), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (), '', False, 'import argparse\n'), ((37, 12, 37, 27), 'os.listdir', 'os.listdir', ({(37, 23, 37, 26): '"""."""'}, {}), "('.')", False, 'import os\n'), ((56, 0, 56, 35), 'os.makedirs', 'os.makedirs', (), '', False, 'import os\n'), ((137, 16, 137,...
kjh9267/BOJ_Python
DFS/13023.py
b4d2ae09c252cc9280df93ccecbd07880947827e
# https://www.acmicpc.net/problem/13023 import sys sys.setrecursionlimit(999999999) def dfs_all(): is_possible = [False] for node in range(N): visited = [False for _ in range(N)] dfs(node, 0, visited, is_possible) if is_possible[0]: return 1 return 0 def dfs(cur, ...
[((4, 0, 4, 32), 'sys.setrecursionlimit', 'sys.setrecursionlimit', ({(4, 22, 4, 31): '(999999999)'}, {}), '(999999999)', False, 'import sys\n')]
bigchaindb/privacy-protocols
experiments/bst/setup.py
d220f642c7c056e5ec179b47a8d0863dbc373d9d
"""bst: BigchainDB Sharing Tools""" from setuptools import setup, find_packages install_requires = [ 'base58~=0.2.2', 'PyNaCl~=1.1.0', 'bigchaindb-driver', 'click==6.7', 'colorama', ] setup( name='bst', version='0.1.0', description='bst: BigchainDB Sharing Tools', long_descriptio...
[((42, 13, 42, 28), 'setuptools.find_packages', 'find_packages', ({}, {}), '()', False, 'from setuptools import setup, find_packages\n')]
elyase/polyaxon
polyaxon/db/admin/job_resources.py
1c19f059a010a6889e2b7ea340715b2bcfa382a0
from django.contrib import admin from db.models.job_resources import JobResources admin.site.register(JobResources)
[((5, 0, 5, 33), 'django.contrib.admin.site.register', 'admin.site.register', ({(5, 20, 5, 32): 'JobResources'}, {}), '(JobResources)', False, 'from django.contrib import admin\n')]
tommy-waltmann/voting-ml
voting_ml/main.py
327de4515d8f2f7b8e072833df20eca651621ea6
import numpy as np import sklearn import subprocess from sklearn import model_selection, tree import data import feature_selection import model_sel import os import matplotlib.pyplot as plt import seaborn as sns def main(): #parameter space list_test_size = [0.1,0.15,0.2] # decide this list_ftsel_method...
[((46, 16, 46, 76), 'data.PollDataProxy', 'data.PollDataProxy', (), '', False, 'import data\n'), ((148, 17, 148, 31), 'numpy.argmax', 'np.argmax', ({(148, 27, 148, 30): 'acc'}, {}), '(acc)', True, 'import numpy as np\n'), ((170, 18, 170, 63), 'numpy.delete', 'np.delete', (), '', True, 'import numpy as np\n'), ((39, 11,...
al-arz/the-tale
src/the_tale/the_tale/game/heroes/tests/test_logic.py
542770257eb6ebd56a5ac44ea1ef93ff4ab19eb5
import smart_imports smart_imports.all() class HeroDescriptionTests(utils_testcase.TestCase): def setUp(self): super().setUp() game_logic.create_test_map() account = self.accounts_factory.create_account(is_fast=True) self.storage = game_logic_storage.LogicStorage() se...
[((4, 0, 4, 19), 'smart_imports.all', 'smart_imports.all', ({}, {}), '()', False, 'import smart_imports\n')]
brad/django-tinylinks
tinylinks/tests/test_app/models.py
b3ae58ebe0d0292b7f618e9b0f1a08d2fb61b173
"""Dummy model needed for tests.""" pass
[]
timofeymukha/postcipes
postcipes/hydraulic_jump.py
f37b349038e26bb0295a2511295a46ef63fcd851
# This file is part of postcipes # (c) Timofey Mukha # The code is released under the MIT Licence. # See LICENCE.txt and the Legal section in the README for more information from __future__ import absolute_import from __future__ import division from __future__ import print_function from .postcipe import Postcipe impor...
[((22, 20, 22, 34), 'turbulucid.Case', 'tbl.Case', ({(22, 29, 22, 33): 'path'}, {}), '(path)', True, 'import turbulucid as tbl\n'), ((27, 28, 27, 64), 'turbulucid.edge_lengths', 'tbl.edge_lengths', ({(27, 45, 27, 54): 'self.case', (27, 56, 27, 63): '"""inlet"""'}, {}), "(self.case, 'inlet')", True, 'import turbulucid a...
JulianoGianlupi/nh-cc3d-4x-base-tool
main/SimulationSettings/ScreenshotsSteppable/Simulation/screenshots_steppables.py
c0f4aceebd4c5bf3ec39e831ef851e419b161259
from cc3d.core.PySteppables import * from cc3d import CompuCellSetup from random import random class ScreenshotSteppable(SteppableBasePy): def __init__(self, frequency=10): SteppableBasePy.__init__(self, frequency) def step(self, mcs): if mcs in [3, 5, 19,20, 23, 29, 31]: self.req...
[]
anirudhacharya/aesara
aesara/gpuarray/optdb.py
cbf91122296b68ee2ad592b2312d56f6ff65ba53
from aesara.compile import optdb from aesara.graph.opt import GraphToGPULocalOptGroup, TopoOptimizer, local_optimizer from aesara.graph.optdb import ( EquilibriumDB, LocalGroupDB, OptimizationDatabase, SequenceDB, ) gpu_optimizer = EquilibriumDB() gpu_cut_copies = EquilibriumDB() # Not used for an Eq...
[((11, 16, 11, 31), 'aesara.graph.optdb.EquilibriumDB', 'EquilibriumDB', ({}, {}), '()', False, 'from aesara.graph.optdb import EquilibriumDB, LocalGroupDB, OptimizationDatabase, SequenceDB\n'), ((12, 17, 12, 32), 'aesara.graph.optdb.EquilibriumDB', 'EquilibriumDB', ({}, {}), '()', False, 'from aesara.graph.optdb impor...
imsardine/jenkinsapi
jenkinsapi/node.py
d4bfac62a4d01394ff41540c4d8d897ab566f4eb
""" Module for jenkinsapi Node class """ from jenkinsapi.jenkinsbase import JenkinsBase from jenkinsapi.custom_exceptions import PostRequired import logging try: from urllib import quote as urlquote except ImportError: # Python3 from urllib.parse import quote as urlquote log = logging.getLogger(__name__)...
[((15, 6, 15, 33), 'logging.getLogger', 'logging.getLogger', ({(15, 24, 15, 32): '__name__'}, {}), '(__name__)', False, 'import logging\n'), ((35, 8, 35, 43), 'jenkinsapi.jenkinsbase.JenkinsBase.__init__', 'JenkinsBase.__init__', ({(35, 29, 35, 33): 'self', (35, 35, 35, 42): 'baseurl'}, {}), '(self, baseurl)', False, '...
srcarter3/awips2
edexOsgi/com.raytheon.edex.plugin.gfe/utility/common_static/base/gfe/textproducts/templates/product/GenericHazards.py
37f31f5e88516b9fd576eaa49d43bfb762e1d174
## # This software was developed and / or modified by Raytheon Company, # pursuant to Contract DG133W-05-CQ-1067 with the US Government. # # U.S. EXPORT CONTROLLED TECHNICAL DATA # This software product contains export-restricted data whose # export/transfer/disclosure is restricted by U.S. law. Dissemination # to non...
[]
rodrigofaccioli/drugdesign
virtualscreening/vina/spark/buried_areas.py
de15880af361a010729b1f4fbc8a75a2b36688a6
from pyspark import SparkContext, SparkConf, SparkFiles from pyspark.sql import SQLContext, Row import ConfigParser as configparser from subprocess import Popen, PIPE from datetime import datetime from vina_utils import get_directory_complex_pdb_analysis, get_files_pdb, get_name_model_pdb, get_ligand_from_receptor_liga...
[((14, 10, 14, 24), 'pyspark.sql.SQLContext', 'SQLContext', ({(14, 21, 14, 23): 'sc'}, {}), '(sc)', False, 'from pyspark.sql import SQLContext, Row\n'), ((79, 26, 79, 41), 'os.walk', 'os.walk', ({(79, 34, 79, 40): 'mypath'}, {}), '(mypath)', False, 'import os, sys\n'), ((88, 16, 88, 27), 'os.getcwd', 'os.getcwd', ({}, ...
Masa-Yasuno/oase
oase-root/web_app/views/system/mail/action_mail.py
90f3cee73c0d9b3153808a4a72bd19984a4873f9
# Copyright 2019 NEC Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
[((45, 9, 45, 34), 'libs.commonlibs.oase_logger.OaseLogger.get_instance', 'OaseLogger.get_instance', ({}, {}), '()', False, 'from libs.commonlibs.oase_logger import OaseLogger\n'), ((92, 17, 92, 44), 'libs.commonlibs.aes_cipher.AESCipher', 'AESCipher', ({(92, 27, 92, 43): 'settings.AES_KEY'}, {}), '(settings.AES_KEY)',...
cozek/code-practice
queue/animal_queue.py
bf3098dbeb502cab2e22ce7ea73c2aa05a3caf80
#!/usr/bin/env python3 from typing import Any, Union class Animal: def __init__(self, name: str) -> None: self.name = name def set_order(self, order: int) -> None: self.order = order def peek_order(self) -> int: return self.order def __str__(self) -> str: return f"{...
[]
NSLS-II/ophyd
ophyd/areadetector/detectors.py
d5fc722eef4d3d83845b1d523004302ec3aadb78
# vi: ts=4 sw=4 '''AreaDetector Devices `areaDetector`_ detector abstractions .. _areaDetector: https://areadetector.github.io/master/index.html ''' import warnings from .base import (ADBase, ADComponent as C) from . import cam __all__ = ['DetectorBase', 'AreaDetector', 'AdscDetector', ...
[((93, 8, 96, 9), 'warnings.warn', 'warnings.warn', (), '', False, 'import warnings\n')]
debor4h/exerciciosPython
python/EXERCICIO 96 - FUNCAO QUE CALCULA A AREA.py
a18d88c6e98bc49005bfcb8badeb712007c16d69
def area(msg):#declaracao da funcao com o parametro msg print(msg)#aqui msg e a area print('Controle de Terrenos') print('-' * 20) l = float(input('Largura (m): ')) c = float(input('Comprimento (m): ')) area(f'A área do seu terreno {l}X{c} é de {l*c}m².')
[]
santiher/dash-auth-example
auth_iam/dashboard/auth/routes.py
9854bfe953f86a0c7ed97660da30b7b7d1d3069f
import os from functools import wraps from os.path import join as join_path from dash import Dash from flask import make_response, render_template_string, redirect excluded_resources_endpoints = ( 'static', '_dash_assets.static', '/_favicon.ico', '/login', '/logout', '/_user', '/auth') def add_routes(app,...
[((78, 11, 78, 56), 'os.path.join', 'join_path', ({(78, 21, 78, 32): 'pyfile_path', (78, 34, 78, 45): '"""templates"""', (78, 47, 78, 55): 'filename'}, {}), "(pyfile_path, 'templates', filename)", True, 'from os.path import join as join_path\n'), ((45, 15, 45, 53), 'flask.render_template_string', 'render_template_strin...
gabrielkarras/SOEN341
amazon/model_api/migrations/0005_remove_order_datetimecreated_alter_order__id_and_more.py
da7241abd894bda4d5f7465b3de70e51afacf3f5
# Generated by Django 4.0.1 on 2022-04-07 01:20 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('model_api', '0004_remove_order_created_remove_order_id_and_more'), ] operations = [ migrations.RemoveField( model_name='order', ...
[((13, 8, 16, 9), 'django.db.migrations.RemoveField', 'migrations.RemoveField', (), '', False, 'from django.db import migrations, models\n'), ((20, 18, 20, 85), 'django.db.models.AutoField', 'models.AutoField', (), '', False, 'from django.db import migrations, models\n'), ((25, 18, 25, 85), 'django.db.models.AutoField'...
tony-joseph/livre
items/migrations/0001_initial.py
3a6a851ed58029d5d14edde647b15ed22d65f24b
# -*- coding: utf-8 -*- # Generated by Django 1.9 on 2015-12-21 12:22 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations....
[((15, 8, 15, 65), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', ({(15, 40, 15, 64): 'settings.AUTH_USER_MODEL'}, {}), '(settings.AUTH_USER_MODEL)', False, 'from django.db import migrations, models\n'), ((109, 18, 109, 101), 'django.db.models.ForeignKey', 'models.ForeignKey', (), '', F...
alextsaihi/rnaget-compliance-suite
compliance_suite/exceptions/user_config_exception.py
a3accae431b9e4f7791dfa5ae867e70da2dd6278
# -*- coding: utf-8 -*- """Module compliance_suite.exceptions.user_config_exception.py This module contains class definition for user config file exceptions. """ class UserConfigException(Exception): """Exception for user config file-related errors""" pass
[]
bbornstein/aoc
2021/day15/aoc-2021-d15.py
624dacfe591a46aa34e3071b894076cf60091e7d
#!/usr/bin/env python3 # Advent of Code 2021, Day 15 (https://adventofcode.com/2021/day/15) # Author: Ben Bornstein import collections import heapq Point = collections.namedtuple('Point', ['x', 'y']) Point.__add__ = lambda self, q: Point(self[0] + q[0], self[1] + q[1]) class RiskMap: def __init__ (se...
[((11, 16, 11, 59), 'collections.namedtuple', 'collections.namedtuple', ({(11, 39, 11, 46): '"""Point"""', (11, 48, 11, 58): "['x', 'y']"}, {}), "('Point', ['x', 'y'])", False, 'import collections\n'), ((106, 4, 106, 24), 'heapq.heapify', 'heapq.heapify', ({(106, 18, 106, 23): 'queue'}, {}), '(queue)', False, 'import h...
aiforrural/Digital-Events-Example
indico/modules/events/abstracts/compat.py
628aaa8727b259b9367ac0ae1c5ba8e9e95eca82
# This file is part of Indico. # Copyright (C) 2002 - 2020 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from flask import redirect from indico.modules.events.abstracts.models.abstracts import Abstract from ind...
[((18, 20, 18, 85), 'indico.web.flask.util.url_for', 'url_for', (), '', False, 'from indico.web.flask.util import url_for\n'), ((17, 15, 17, 70), 'indico.modules.events.abstracts.models.abstracts.Abstract.find', 'Abstract.find', (), '', False, 'from indico.modules.events.abstracts.models.abstracts import Abstract\n')]
limingu/azure-cli-extensions
src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/database_account_list_keys_result_py3.py
1bc29f089f4da42ab8905e440f2f46d6b5b0aa97
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
[]
dimitryzub/blog-posts-archive
Google/google_books/scrape_google_books.py
0978aaa0c9f0142d6f996b81ce391930c5e3be35
from parsel import Selector import requests, json, re params = { "q": "richard branson", "tbm": "bks", "gl": "us", "hl": "en" } headers = { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.87 Safari/537.36", } html = requests.get("ht...
[((15, 7, 15, 96), 'requests.get', 'requests.get', (), '', False, 'import requests, json, re\n'), ((16, 11, 16, 35), 'parsel.Selector', 'Selector', (), '', False, 'from parsel import Selector\n')]
AustinTSchaffer/DailyProgrammer
Python/Higher-Or-Lower/hol/__init__.py
b16d9babb298ac5e879c514f9c4646b99c6860a8
r""" Contains classes and methods that can be used when simulating the game Higher-or-Lower and performing statistical analysis on different games. """ from hol import ( cards, constants, ) from hol._hol import ( generate_all_games, should_pick_higher, is_a_winning_game, generate_win_statist...
[]
gferreira/hTools2
Lib/hTools2/dialogs/glyphs/slide.py
a75a671b81a0f4ce5c82b2ad3e2f971ca3e3d98c
# [h] slide selected glyphs from mojo.roboFont import CurrentFont, CurrentGlyph, version from vanilla import * from hTools2 import hDialog from hTools2.modules.fontutils import get_full_name, get_glyphs from hTools2.modules.messages import no_font_open, no_glyph_selected class slideGlyphsDialog(hDialog): '''A di...
[]
lilac/WeRobot
werobot/utils.py
29fd70631b736a0c339f16f7729ea89f986c8bae
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import io import json import os import random import re import string import time from functools import wraps from hashlib import sha1 import six try: from secrets import choice except ImportError: from random import choice str...
[((23, 15, 23, 39), 're.compile', 're.compile', ({(23, 26, 23, 38): '"""regex_test"""'}, {}), "('regex_test')", False, 'import re\n'), ((41, 11, 41, 49), 're.match', 're.match', ({(41, 20, 41, 41): '"""^[A-Za-z0-9]{3,32}$"""', (41, 43, 41, 48): 'token'}, {}), "('^[A-Za-z0-9]{3,32}$', token)", False, 'import re\n'), ((4...
ashutom/tensorflow-upstream
tensorflow/python/ops/standard_ops.py
c16069c19de9e286dd664abb78d0ea421e9f32d4
# Copyright 2015 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...
[((114, 3, 114, 21), 'platform.system', '_platform.system', ({}, {}), '()', True, 'import platform as _platform\n')]
rtobar/sdp-prototype
src/tango_scaling_test/TestDeviceServer/__main__.py
9f1527b884bf80daa509a7fe3722160c77260f4f
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Test Tango device server for use with scaling tests.""" import sys import time import argparse import tango from tango.server import run from TestDevice import TestDevice def init_callback(): """Report server start up times. This callback is executed post ...
[((22, 9, 22, 25), 'tango.Database', 'tango.Database', ({}, {}), '()', False, 'import tango\n'), ((35, 9, 35, 25), 'tango.Database', 'tango.Database', ({}, {}), '()', False, 'import tango\n'), ((49, 9, 49, 25), 'tango.Database', 'tango.Database', ({}, {}), '()', False, 'import tango\n'), ((50, 18, 50, 35), 'tango.DbDev...
ParikhKadam/haystack
test/test_pipeline.py
8a57f6b16af0bdd41dc02bf1200e0adbdf1da39b
from pathlib import Path import pytest from haystack.document_store.elasticsearch import ElasticsearchDocumentStore from haystack.pipeline import TranslationWrapperPipeline, JoinDocuments, ExtractiveQAPipeline, Pipeline, FAQPipeline, \ DocumentSearchPipeline, RootNode from haystack.retriever.dense import DensePas...
[((12, 1, 12, 86), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (), '', False, 'import pytest\n'), ((32, 1, 34, 1), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (), '', False, 'import pytest\n'), ((55, 1, 55, 73), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (), '', False, 'import pytest\n'),...
dominik-handler/TELR
src/telr/TELR_assembly.py
3e34e54fc959c13fa45dc911facf0d5179fbb34b
import sys import os import subprocess import shutil import time import logging from Bio import SeqIO from multiprocessing import Pool import pysam from telr.TELR_utility import mkdir, check_exist, format_time def get_local_contigs( assembler, polisher, contig_dir, vcf_parsed, out, sample_name...
[((29, 19, 29, 48), 'os.path.join', 'os.path.join', ({(29, 32, 29, 35): 'out', (29, 37, 29, 47): '"""sv_reads"""'}, {}), "(out, 'sv_reads')", False, 'import os\n'), ((40, 4, 40, 21), 'telr.TELR_utility.mkdir', 'mkdir', ({(40, 10, 40, 20): 'contig_dir'}, {}), '(contig_dir)', False, 'from telr.TELR_utility import mkdir, ...
aliciaha1997/pygmt
pygmt/tests/test_clib.py
a10af5d8deb3bf3090eab4b6492bcf8cf722cb71
# pylint: disable=protected-access """ Test the wrappers for the C API. """ import os from contextlib import contextmanager import numpy as np import numpy.testing as npt import pandas as pd import pytest import xarray as xr from packaging.version import Version from pygmt import Figure, clib from pygmt.clib.conversio...
[((435, 1, 435, 48), 'pytest.mark.parametrize', 'pytest.mark.parametrize', ({(435, 25, 435, 32): '"""dtype"""', (435, 34, 435, 47): '[str, object]'}, {}), "('dtype', [str, object])", False, 'import pytest\n'), ((454, 1, 454, 48), 'pytest.mark.parametrize', 'pytest.mark.parametrize', ({(454, 25, 454, 32): '"""dtype"""',...
questioneer-ltd/scrut
stubs/_pytest/_code.py
8cb914c9c35eee0d9e17a6051683c970db2649b5
"""Type stubs for _pytest._code.""" # This class actually has more functions than are specified here. # We don't use these features, so I don't think its worth including # them in our type stub. We can always change it later. class ExceptionInfo: @property def value(self) -> Exception: ...
[]
rayvantsahni/Let-us-Math
Prime Factorization/prime_factorization_II.py
571ee70452feae0b15f37d46de658b0c0251bd3d
def get_primes(n): primes = [] # stores the prime numbers within the reange of the number sieve = [False] * (n + 1) # stores boolean values indicating whether a number is prime or not sieve[0] = sieve[1] = True # marking 0 and 1 as not prime for i in range(2, n + 1): # loops over all the numbers to...
[]