repo_name
stringlengths
7
94
repo_path
stringlengths
4
237
repo_head_hexsha
stringlengths
40
40
content
stringlengths
10
680k
apis
stringlengths
2
840k
mashton/policyk
policykit/django_db_logger/migrations/0002_initial.py
623523d76d63c06b6d559ad7b477d80512fbd2e7
# Generated by Django 3.2.2 on 2021-09-02 15:10 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('django_db_logger', '0001_initial'), ('policyengine', '0001_initial'), ] operations = [ ...
[((20, 18, 20, 133), 'django.db.models.ForeignKey', 'models.ForeignKey', (), '', False, 'from django.db import migrations, models\n'), ((25, 18, 25, 132), 'django.db.models.ForeignKey', 'models.ForeignKey', (), '', False, 'from django.db import migrations, models\n')]
TanyaAdams1/Charm
Charm/models/risk_functions.py
cc6dd64d01f8cb4cf0eb92dadefcb7575d75ec9d
import numpy as np from mcerp import * from uncertainties.core import AffineScalarFunc class RiskFunction(object): def get_risk(self, bar, p): """ Computes risk for perf array w.r.t. bar. Args: bar: reference performance bar. perfs: performance array-like. Returns:...
[((64, 15, 64, 28), 'numpy.mean', 'np.mean', ({(64, 23, 64, 27): 'risk'}, {}), '(risk)', True, 'import numpy as np\n'), ((80, 15, 80, 28), 'numpy.mean', 'np.mean', ({(80, 23, 80, 27): 'risk'}, {}), '(risk)', True, 'import numpy as np\n'), ((94, 15, 94, 28), 'numpy.mean', 'np.mean', ({(94, 23, 94, 27): 'risk'}, {}), '(r...
verazuo/douban_crawler
code/doubanUtils.py
042e870c74df8b6f4eb1cd2af3b90d5b6699ab8f
import requests import re from bs4 import BeautifulSoup def nextPageLink(sess,soup,page,head=""): NextPage=soup.find(class_='next').link.get('href') req=sess.get(head + NextPage) print(f'第{page}页:',req.status_code) return BeautifulSoup(req.text,'html.parser')
[((10, 11, 10, 48), 'bs4.BeautifulSoup', 'BeautifulSoup', ({(10, 25, 10, 33): 'req.text', (10, 34, 10, 47): '"""html.parser"""'}, {}), "(req.text, 'html.parser')", False, 'from bs4 import BeautifulSoup\n')]
kaixiang1992/python-flask
491/491.py
2b4c597d83f5a6ed662d42d7ff692e563a9adbf8
from sqlalchemy import create_engine, Column, Integer, String, ForeignKey from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker, relationship # TODO: db_uri # dialect+driver://username:password@host:port/database?charset=utf8 DB_URI = 'mysql+pymysql://root:root123@127.0.0.1:33...
[((9, 9, 9, 30), 'sqlalchemy.create_engine', 'create_engine', ({(9, 23, 9, 29): 'DB_URI'}, {}), '(DB_URI)', False, 'from sqlalchemy import create_engine, Column, Integer, String, ForeignKey\n'), ((11, 7, 11, 36), 'sqlalchemy.ext.declarative.declarative_base', 'declarative_base', (), '', False, 'from sqlalchemy.ext.decl...
TerminalWitchcraft/spaCy
spacy/tests/tagger/test_lemmatizer.py
29adbef095c04e21a691e912671e4ec21082b047
# coding: utf-8 from __future__ import unicode_literals from ...lemmatizer import read_index, read_exc import pytest @pytest.mark.models @pytest.mark.parametrize('text,lemmas', [("aardwolves", ["aardwolf"]), ("aardwolf", ["aardwolf"]), ...
[((10, 1, 14, 74), 'pytest.mark.parametrize', 'pytest.mark.parametrize', ({(10, 25, 10, 38): '"""text,lemmas"""', (10, 40, 14, 73): "[('aardwolves', ['aardwolf']), ('aardwolf', ['aardwolf']), ('planets', [\n 'planet']), ('ring', ['ring']), ('axes', ['axis', 'axe', 'ax'])]"}, {}), "('text,lemmas', [('aardwolves', ['a...
RAY-316/azure-sdk-for-python
sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/__init__.py
4f7790deaf46c6f4e965f099f36eb73a7954ad5b
# 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 may ...
[]
Bhaney44/AlgorandDevelopment
AlgoNet2/Helper.py
309e68337227af879f5c4e92c72156928a39fe32
import numpy as np from keras.models import Sequential from keras.layers import LSTM, Dense, Dropout def visualize_training_results(results): """ Plots the loss and accuracy for the training and testing data """ history = results.history plt.figure(figsize=(12,4)) plt.plot(history['val_loss']) ...
[((55, 12, 55, 24), 'keras.models.Sequential', 'Sequential', ({}, {}), '()', False, 'from keras.models import Sequential\n'), ((47, 11, 47, 22), 'numpy.array', 'np.array', ({(47, 20, 47, 21): 'X'}, {}), '(X)', True, 'import numpy as np\n'), ((47, 24, 47, 35), 'numpy.array', 'np.array', ({(47, 33, 47, 34): 'y'}, {}), '(...
Muflhi01/apex
apex/contrib/multihead_attn/self_multihead_attn_func.py
79c018776129aad13abeb4ce63d24e1fbb4cd29e
import torch import torch.nn.functional as F class SelfAttnFunc(torch.autograd.Function): @staticmethod def forward( ctx, use_time_mask, is_training, heads, scale, inputs, input_weights, output_weights, input_biases, output_biases...
[((22, 23, 22, 63), 'torch.tensor', 'torch.tensor', ({(22, 36, 22, 62): '[input_biases is not None]'}, {}), '([input_biases is not None])', False, 'import torch\n'), ((23, 18, 23, 39), 'torch.tensor', 'torch.tensor', ({(23, 31, 23, 38): '[heads]'}, {}), '([heads])', False, 'import torch\n'), ((24, 18, 24, 39), 'torch.t...
NikolaSiplakova/Baobab
api/app/reviews/models.py
180cd3cb492ed47d38ca0b473572fad0ac6f604b
from datetime import datetime from app import db from app.utils import misc class ReviewForm(db.Model): id = db.Column(db.Integer(), primary_key=True) application_form_id = db.Column(db.Integer(), db.ForeignKey('application_form.id'), nullable=False) is_open = db.Column(db.Boolean(), nullable=False)...
[((11, 23, 11, 93), 'app.db.relationship', 'db.relationship', (), '', False, 'from app import db\n'), ((12, 23, 12, 56), 'app.db.relationship', 'db.relationship', ({(12, 39, 12, 55): '"""ReviewQuestion"""'}, {}), "('ReviewQuestion')", False, 'from app import db\n'), ((24, 9, 24, 48), 'app.db.Column', 'db.Column', (), '...
Abhranta/speednet
speednet/vae/ConvVae.py
d15971e946cddc62a644d6a6f3be10a4df5b2ce2
import torch.nn as nn import torch from utils import Flatten , Unflatten , weights_init , down_conv , up_conv class Net(nn.Module): def __init__(self , num_layers , img_dim , in_chan , act_func , latent_vector_size): super(Net , self).__init__() assert act_func in ("ReLU" , "LeakyReLU") , ...
[((33, 18, 33, 80), 'torch.nn.Linear', 'nn.Linear', ({(33, 28, 33, 53): 'self.latent_vector_size * 2', (33, 56, 33, 79): 'self.latent_vector_size'}, {}), '(self.latent_vector_size * 2, self.latent_vector_size)', True, 'import torch.nn as nn\n'), ((34, 22, 34, 84), 'torch.nn.Linear', 'nn.Linear', ({(34, 32, 34, 57): 'se...
IsaacBusaleh/nelpy
nelpy/utils.py
f2663cf6f028c9bd0e630fbf8a527c236f4e0f41
"""This module contains helper functions and utilities for nelpy.""" __all__ = ['spatial_information', 'frange', 'swap_cols', 'swap_rows', 'pairwise', 'is_sorted', 'linear_merge', 'PrettyDuration', 'ddt_asa', 'get_contig...
[((58, 10, 58, 33), 'numpy.array', 'np.array', ({(58, 19, 58, 32): 'n_elem * [None]'}, {}), '(n_elem * [None])', True, 'import numpy as np\n'), ((79, 14, 79, 40), 'numpy.array', 'np.array', (), '', True, 'import numpy as np\n'), ((91, 11, 91, 66), 'numpy.linspace', 'np.linspace', (), '', True, 'import numpy as np\n'), ...
logan-siyao-peng/Paddle
python/paddle/fluid/contrib/slim/quantization/imperative/qat.py
10a8f3e5c3151c1abb810fba2994cc30e1232bec
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
[((34, 10, 35, 73), 'paddle.fluid.log_helper.get_logger', 'get_logger', (), '', False, 'from paddle.fluid.log_helper import get_logger\n'), ((329, 31, 329, 56), 'collections.OrderedDict', 'collections.OrderedDict', ({}, {}), '()', False, 'import collections\n'), ((385, 11, 385, 35), 'paddle.in_dynamic_mode', 'paddle.in...
elliotgunn/DS-Unit-3-Sprint-2-SQL-and-Databases
sc/northwind.py
c730e2b3e66199226fa7549511cbb7801eb7a694
import pandas as pd import sqlite3 from pandas import DataFrame n_conn = sqlite3.connect('northwind_small.sqlite3') n_curs = n_conn.cursor() # What are the ten most expensive items (per unit price) in the database? query = """ SELECT ProductName, UnitPrice FROM Product ORDER BY UnitPrice DESC LIMIT 10 """ n_curs.ex...
[((5, 9, 5, 51), 'sqlite3.connect', 'sqlite3.connect', ({(5, 25, 5, 50): '"""northwind_small.sqlite3"""'}, {}), "('northwind_small.sqlite3')", False, 'import sqlite3\n')]
Pijuli/django-jazzmin
tests/test_app/library/loans/admin.py
e3f9d45183d58f78bf4c6793969490631a84681d
from django.contrib import admin from django.urls import path from .models import BookLoan, Library from .views import CustomView class BookLoanInline(admin.StackedInline): model = BookLoan extra = 1 readonly_fields = ("id", "duration") fields = ( "book", "imprint", "status", ...
[((23, 1, 23, 25), 'django.contrib.admin.register', 'admin.register', ({(23, 16, 23, 24): 'BookLoan'}, {}), '(BookLoan)', False, 'from django.contrib import admin\n'), ((51, 1, 51, 24), 'django.contrib.admin.register', 'admin.register', ({(51, 16, 51, 23): 'Library'}, {}), '(Library)', False, 'from django.contrib impor...
jeffkimbrel/MergeMetabolicAnnotations
lib/MergeMetabolicAnnotations/utils/CompareAnnotationsUtil.py
ec971d114d57942cef73dc2980c8faf48cea7afe
import os import datetime import logging import json import uuid from installed_clients.WorkspaceClient import Workspace as Workspace from installed_clients.KBaseReportClient import KBaseReport from installed_clients.annotation_ontology_apiServiceClient import annotation_ontology_api import MergeMetabolicAnnotations....
[((21, 19, 21, 49), 'installed_clients.KBaseReportClient.KBaseReport', 'KBaseReport', ({(21, 31, 21, 48): 'self.callback_url'}, {}), '(self.callback_url)', False, 'from installed_clients.KBaseReportClient import KBaseReport\n'), ((22, 24, 22, 49), 'installed_clients.annotation_ontology_apiServiceClient.annotation_ontol...
TvSeriesFans/CineMonster
models/__init__.py
036a3223618afd536932d21b0e86d18d0fba3b28
from models.Model import Player, Group, Session, engine
[]
ToJestKrzysio/TheJungleGame
src/backend/tests/test_game/test_models.py
904dd4adc937145df2c8c353eb83bec3b5dd1f7e
from unittest.mock import Mock, patch import numpy as np from game.models import ValuePolicyModel def test_predict(): mask = np.zeros((9, 7, 8), dtype=bool) mask[1, 2, 3] = 1 mask[6, 6, 6] = 1 tensor_mock = Mock() policy_tensor = np.zeros((9, 7, 8), dtype=float) policy_tensor[0, 0, 0] = 10...
[((9, 11, 9, 42), 'numpy.zeros', 'np.zeros', (), '', True, 'import numpy as np\n'), ((13, 18, 13, 24), 'unittest.mock.Mock', 'Mock', ({}, {}), '()', False, 'from unittest.mock import Mock, patch\n'), ((15, 20, 15, 52), 'numpy.zeros', 'np.zeros', (), '', True, 'import numpy as np\n'), ((21, 12, 21, 42), 'numpy.array', '...
yanwen0614/Weibo
sina_spider/items.py
5d85e39d0cf7fc848bf5a06df08acbf38661db8d
# -*- coding: utf-8 -*- # Define here the models for your scraped items # # See documentation in: # http://doc.scrapy.org/en/latest/topics/items.html from scrapy import Item, Field class TweetsItem(Item): # define the fields for your item here like: Author = Field() Title = Field() Create_time = Fie...
[((13, 13, 13, 20), 'scrapy.Field', 'Field', ({}, {}), '()', False, 'from scrapy import Item, Field\n'), ((14, 12, 14, 19), 'scrapy.Field', 'Field', ({}, {}), '()', False, 'from scrapy import Item, Field\n'), ((15, 18, 15, 25), 'scrapy.Field', 'Field', ({}, {}), '()', False, 'from scrapy import Item, Field\n'), ((16, 9...
Andrew-Tan/e-mission-server
emission/core/wrapper/client.py
91d59bee86e63d803e401f10f4b6a2502effedda
import json import logging import dateutil.parser from datetime import datetime # Our imports from emission.core.get_database import get_profile_db, get_client_db, get_pending_signup_db import emission.clients.common class Client: def __init__(self, clientName): # TODO: write background process to ensure that t...
[]
karianjahi/advent_of_code
setup.py
16939cc7c475465c35d8750328b9b7aef60fc4d6
import setuptools setuptools.setup(name='advent_of_code')
[((2, 0, 2, 39), 'setuptools.setup', 'setuptools.setup', (), '', False, 'import setuptools\n')]
imco/nmx
src/csvutils.py
5c6303ece6148a83963b2e6524d6f94b450ad659
def escapeQuotes(string): return string.replace('"','""');
[]
amithbraj/vpp
test/sanity_import_vpp_papi.py
edf1da94dc099c6e2ab1d455ce8652fada3cdb04
#!/usr/bin/env python3 """ sanity check script """ import vpp_papi
[]
yarikoptic/nipy
examples/labs/demo_dmtx.py
749302c7ffa8ea714cc32d405f0df521102bbc6f
#!/usr/bin/env python # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: from __future__ import print_function # Python 2/3 compatibility __doc__ = """ Examples of design matrices specification and and computation (event-related design, FIR design, etc) Re...
[((29, 13, 29, 54), 'numpy.linspace', 'np.linspace', ({(29, 25, 29, 26): '0', (29, 28, 29, 45): '(nscans - 1) * tr', (29, 47, 29, 53): 'nscans'}, {}), '(0, (nscans - 1) * tr, nscans)', True, 'import numpy as np\n'), ((39, 11, 39, 51), 'nipy.modalities.fmri.experimental_paradigm.EventRelatedParadigm', 'EventRelatedParad...
yelixu2/fbpcs
fbpcs/private_computation/test/service/test_private_computation.py
31b1154bf1a207471fa207a0b0e4c74693f09608
#!/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. import unittest from collections import defaultdict from typing import List, Optional, Tuple from unittest.mock import ...
[((296, 5, 296, 42), 'libfb.py.testutil.data_provider', 'data_provider', ({(296, 19, 296, 41): '_get_valid_stages_data'}, {}), '(_get_valid_stages_data)', False, 'from libfb.py.testutil import data_provider\n'), ((319, 5, 319, 42), 'libfb.py.testutil.data_provider', 'data_provider', ({(319, 19, 319, 41): '_get_valid_st...
Eubule/Store-Manager-With-Datastructure
app.py
c21a7307cc59b53516fb40437b1a359ca48a4f2e
from app import app from app.database.db import Database if __name__ == "__main__": db = Database() db.create_tables() db.create_admin() app.run(debug=True)
[((6, 9, 6, 19), 'app.database.db.Database', 'Database', ({}, {}), '()', False, 'from app.database.db import Database\n'), ((9, 4, 9, 23), 'app.app.run', 'app.run', (), '', False, 'from app import app\n')]
ryuichi1208/scraping-py
src/main.py
43036dff75cc47d3169e012096f0de70dea0296b
# -*- coding: utf-8 -*- # flake8: noqa from flask import Flask from flask_themes2 import Themes import config from util.auth import is_admin from util.converter import RegexConverter from util.csrf import generate_csrf_token app = Flask(__name__.split('.')[0]) app.secret_key = config.SECRET_KEY app.url_map.converter...
[]
Maxahoy/ClassVolumeSilencer
HoursSelect.py
9a05f9dd4efbbbddc74377a27027fa40b2167d02
""" This is how I'm gonna schedule hours IDEA: import the format example file that I'm using and is saved in the same directory """ import csv import pprint from tkinter import * from tkinter.filedialog import askopenfilename import StringProcessing def selectHoursFile(): Tk().withdraw() # we don't want a fu...
[((19, 15, 19, 32), 'tkinter.filedialog.askopenfilename', 'askopenfilename', ({}, {}), '()', False, 'from tkinter.filedialog import askopenfilename\n'), ((53, 20, 53, 69), 'csv.reader', 'csv.reader', (), '', False, 'import csv\n'), ((64, 13, 64, 43), 'pprint.PrettyPrinter', 'pprint.PrettyPrinter', (), '', False, 'impor...
IvanKosik/bone-age-models
src/bsmu/bone_age/models/dense_net/configs.py
07f20a94951a3b584ee7b6d9a11805c37878214a
from pathlib import Path from bsmu.bone_age.models import constants IMAGE_DIR = Path('C:/MyDiskBackup/Projects/BoneAge/Data/SmallImages500_NoPads') TRAIN_DATA_CSV_PATH = constants.TRAIN_DATA_CSV_PATH VALID_DATA_CSV_PATH = constants.VALID_DATA_CSV_PATH TEST_DATA_CSV_PATH = constants.TEST_DATA_CSV_PATH BATC...
[((5, 12, 5, 79), 'pathlib.Path', 'Path', ({(5, 17, 5, 78): '"""C:/MyDiskBackup/Projects/BoneAge/Data/SmallImages500_NoPads"""'}, {}), "('C:/MyDiskBackup/Projects/BoneAge/Data/SmallImages500_NoPads')", False, 'from pathlib import Path\n')]
ogawan/nisa
projection.py
d758e41e4983cc35477e81d944689b0226f00ef5
from matplotlib import pyplot as plt def nisa_projection(years=30, annual_deposit=80, initial_budget=100): """ This is a function to plot deposit of TSUMITATE NISA Parameters: --------------- years: integer How many years are you going to continue? annual_depoist: integer Annual deposit in...
[((89, 7, 89, 25), 'pandas.DataFrame', 'pd.DataFrame', ({(89, 20, 89, 24): 'dic_'}, {}), '(dic_)', True, 'import pandas as pd\n'), ((91, 8, 91, 19), 'plotly.graph_objects.Figure', 'go.Figure', ({}, {}), '()', True, 'import plotly.graph_objects as go\n'), ((41, 4, 41, 52), 'matplotlib.pyplot.legend', 'plt.legend', ({(41...
wumo/sim-world
tensorflow-ops-generator/resources/gen_ops/gen_math_ops.py
2a3a5118239b27eeb268cd1e7bdbfe5f5604dab6
"""Python wrappers around TensorFlow ops. This file is MACHINE GENERATED! Do not edit. Original C++ source file: math_ops.cc """ import collections as _collections import six as _six from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow from tensorflow.python.eager import context as _context from ten...
[((167, 1, 167, 31), 'tensorflow.python.util.tf_export.tf_export', 'tf_export', ({(167, 11, 167, 22): '"""math.acos"""', (167, 24, 167, 30): '"""acos"""'}, {}), "('math.acos', 'acos')", False, 'from tensorflow.python.util.tf_export import tf_export\n'), ((223, 1, 223, 33), 'tensorflow.python.util.tf_export.tf_export', ...
yamiacat/indico
indico/modules/oauth/models/applications.py
754c02cd7cd25bf1eab0ca5f497eb24b135dd51c
# This file is part of Indico. # Copyright (C) 2002 - 2021 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 uuid import uuid4 from sqlalchemy.dialects.postgresql import ARRAY, UUID from sqlalchemy.ext.declara...
[((21, 23, 21, 56), 'indico.util.i18n._', '_', ({(21, 25, 21, 55): '"""User information (read only)"""'}, {}), "('User information (read only)')", False, 'from indico.util.i18n import _\n'), ((22, 29, 22, 56), 'indico.util.i18n._', '_', ({(22, 31, 22, 55): '"""Legacy API (read only)"""'}, {}), "('Legacy API (read only)...
FrancisLiang/models-1
PaddleNLP/unarchived/deep_attention_matching_net/utils/layers.py
e14d5bc1ab36d0dd11977f27cff54605bf99c945
import paddle.fluid as fluid def loss(x, y, clip_value=10.0): """Calculate the sigmoid cross entropy with logits for input(x). Args: x: Variable with shape with shape [batch, dim] y: Input label Returns: loss: cross entropy logits: prediction """ logits = fluid.l...
[((20, 11, 20, 76), 'paddle.fluid.layers.sigmoid_cross_entropy_with_logits', 'fluid.layers.sigmoid_cross_entropy_with_logits', (), '', True, 'import paddle.fluid as fluid\n'), ((75, 13, 76, 62), 'paddle.fluid.layers.matmul', 'fluid.layers.matmul', (), '', True, 'import paddle.fluid as fluid\n'), ((97, 16, 97, 44), 'pad...
TheWardoctor/wardoctors-repo
plugin.video.saltsrd.lite/js2py/translators/jsregexps.py
893f646d9e27251ffc00ca5f918e4eb859a5c8f0
from salts_lib.pyjsparser.pyjsparserdata import * REGEXP_SPECIAL_SINGLE = {'\\', '^', '$', '*', '+', '?', '.'} NOT_PATTERN_CHARS = {'^', '$', '\\', '.', '*', '+', '?', '(', ')', '[', ']', '|'} # what about '{', '}', ??? CHAR_CLASS_ESCAPE = {'d', 'D', 's', 'S', 'w', 'W'} CONTROL_ESCAPE_CHARS = {'f', 'n', 'r', 't',...
[]
yixinliao/pytorch_connectomics
connectomics/model/block/squeeze_excitation.py
0f6de546e6da1e0f3258b2c84f7e16b3a993c70c
import torch.nn as nn from .basic import * class squeeze_excitation_2d(nn.Module): """Squeeze-and-Excitation Block 2D Args: channel (int): number of input channels. channel_reduction (int): channel squeezing factor. spatial_reduction (int): pooling factor for x,y axes. """ def ...
[((20, 18, 20, 40), 'torch.nn.Sequential', 'nn.Sequential', ({(20, 32, 20, 39): '*layers'}, {}), '(*layers)', True, 'import torch.nn as nn\n'), ((45, 18, 45, 40), 'torch.nn.Sequential', 'nn.Sequential', ({(45, 32, 45, 39): '*layers'}, {}), '(*layers)', True, 'import torch.nn as nn\n'), ((15, 18, 15, 81), 'torch.nn.AvgP...
blueshed/duckdown
duckdown/handlers/site_handler.py
e6d0e62d378bd2d9ed0cd5ce4bc7ab3476b86020
# pylint: disable=W0201, E1101 """ handle request for markdown pages """ import logging import os import importlib from tornado.web import RequestHandler, HTTPError from tornado.escape import url_escape from ..utils.converter_mixin import ConverterMixin from .access_control import UserMixin from ..utils.nav import nav ...
[((13, 9, 13, 36), 'logging.getLogger', 'logging.getLogger', ({(13, 27, 13, 35): '__name__'}, {}), '(__name__)', False, 'import logging\n'), ((58, 17, 58, 38), 'os.path.dirname', 'os.path.dirname', ({(58, 33, 58, 37): 'path'}, {}), '(path)', False, 'import os\n'), ((74, 24, 74, 53), 'importlib.import_module', 'importli...
KivenCkl/LeetCode
Problemset/binary-search-tree-to-greater-sum-tree/binary-search-tree-to-greater-sum-tree.py
fcc97c66f8154a5d20c2aca86120cb37b9d2d83d
# @Title: 从二叉搜索树到更大和树 (Binary Search Tree to Greater Sum Tree) # @Author: KivenC # @Date: 2019-05-15 19:52:08 # @Runtime: 48 ms # @Memory: 13 MB # Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solu...
[]
robinson96/GRAPE
vine/clone.py
f6404ae6ee2933647e515a9480077ab01fb2c430
import os import option import utility import grapeMenu import grapeGit as git import grapeConfig class Clone(option.Option): """ grape-clone Clones a git repo and configures it for use with git. Usage: grape-clone <url> <path> [--recursive] [--allNested] Arguments: <url> The URL of th...
[((38, 8, 38, 120), 'utility.printMsg', 'utility.printMsg', ({(38, 25, 38, 119): "('Cloning %s into %s %s' % (remotepath, destpath, 'recursively' if args[\n '--recursive'] else ''))"}, {}), "('Cloning %s into %s %s' % (remotepath, destpath, \n 'recursively' if args['--recursive'] else ''))", False, 'import utilit...
pearsonlab/python-neo
neo/test/iotest/test_nixio.py
8915dfe9e55fd3a36be83d820bdd83ab085e9402
# -*- coding: utf-8 -*- # Copyright (c) 2016, German Neuroinformatics Node (G-Node) # Achilleas Koutsou <achilleas.k@gmail.com> # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted under the terms of the BSD License. See # LICE...
[((47, 1, 47, 46), 'unittest.skipUnless', 'unittest.skipUnless', ({(47, 21, 47, 29): 'HAVE_NIX', (47, 31, 47, 45): '"""Requires NIX"""'}, {}), "(HAVE_NIX, 'Requires NIX')", False, 'import unittest\n'), ((1160, 1, 1160, 46), 'unittest.skipUnless', 'unittest.skipUnless', ({(1160, 21, 1160, 29): 'HAVE_NIX', (1160, 31, 116...
taudata-indonesia/elearning
lib/taudataNlpTm.py
6f9db8b829357cde1ae678255cc251629dfc25d2
# -*- coding: utf-8 -*- """ Created on Wed Mar 28 11:25:43 2019 @author: Taufik Sutanto taufik@tau-data.id https://tau-data.id ~~Perjanjian Penggunaan Materi & Codes (PPMC) - License:~~ * Modul Python dan gambar-gambar (images) yang digunakan adalah milik dari berbagai sumber sebagaimana yang telah dicantumkan...
[((21, 41, 21, 56), 'nltk.stem.PorterStemmer', 'PorterStemmer', ({}, {}), '()', False, 'from nltk.stem import PorterStemmer\n'), ((23, 17, 23, 48), 'warnings.simplefilter', 'warnings.simplefilter', ({(23, 39, 23, 47): '"""ignore"""'}, {}), "('ignore')", False, 'import warnings\n'), ((30, 14, 30, 40), 'nltk.corpus.wordn...
Eve-ning/reamber_base_py
reamber/base/MapSet.py
6d19c84f2c110b60e633b82b73e0516396466f56
from __future__ import annotations from copy import deepcopy from dataclasses import dataclass, field from typing import List, Iterator, TypeVar, Union, Any, Generic import pandas as pd from pandas.core.indexing import _LocIndexer from reamber.base.Map import Map from reamber.base.Property import stack_props NoteLi...
[((13, 12, 13, 32), 'typing.TypeVar', 'TypeVar', ({(13, 20, 13, 31): '"""NoteListT"""'}, {}), "('NoteListT')", False, 'from typing import List, Iterator, TypeVar, Union, Any, Generic\n'), ((14, 11, 14, 30), 'typing.TypeVar', 'TypeVar', ({(14, 19, 14, 29): '"""HitListT"""'}, {}), "('HitListT')", False, 'from typing impo...
uwmisl/poretitioner
src/poretitioner/utils/filtering.py
0ff9f67a3b25fdcb460b11c970b2ed366da07da7
""" ========= filtering.py ========= This module provides more granular filtering for captures. You can customize your own filters too. """ from __future__ import annotations import re from abc import ABC, ABCMeta, abstractmethod from dataclasses import dataclass from json import JSONEncoder from pathlib import Posi...
[((51, 14, 51, 41), 'typing.NewType', 'NewType', ({(51, 22, 51, 35): '"""FilterSetId"""', (51, 37, 51, 40): 'str'}, {}), "('FilterSetId', str)", False, 'from typing import Any, Dict, Iterable, Mapping, NewType, Optional, Protocol, Type, TypedDict, Union\n'), ((54, 13, 54, 39), 'typing.NewType', 'NewType', ({(54, 21, 54...
nescience8/starting-out-with-python-global-4th-edition
Chapter 11/wrong_type.py
c16f93b7cbb4c7ae7b57653a7190bf192fe6b472
def main(): # Pass a string to show_mammal_info... show_mammal_info('I am a string') # The show_mammal_info function accepts an object # as an argument, and calls its show_species # and make_sound methods. def show_mammal_info(creature): creature.show_species() creature.make_sound() # Call th...
[]
Leodf/FIAP
fase2-exercicios/cap2/lista-de-exercicios/RM94336_EX04.py
e2acf897017c4f49357112f67702070b7dcbfe9d
""" 4 – Um grande cliente seu sofreu um ataque hacker: o servidor foi sequestrado por um software malicioso, que criptografou todos os discos e pede a digitação de uma senha para a liberação da máquina. E é claro que os criminosos exigem um pagamento para informar a senha. Ao analisar o código do programa deles, porém...
[]
yasen-m/dosage
dosagelib/helpers.py
81fe088621ad335cac2a53fcbc7b9b37f49ddce2
# -*- coding: iso-8859-1 -*- # Copyright (C) 2004-2005 Tristan Seligmann and Jonathan Jacobs # Copyright (C) 2012-2014 Bastian Kleineidam from .util import fetchUrl, getPageContent, getQueryParams def queryNamer(paramName, usePageUrl=False): """Get name from URL query part.""" @classmethod def _namer(cls, ...
[]
akshit-protonn/models
research/object_detection/data_decoders/tf_example_decoder_test.py
38c8c6fe4144c93d6aadd19981c2b90570c29eba
# Copyright 2017 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...
[((1650, 2, 1650, 16), 'tensorflow.compat.v1.test.main', 'tf.test.main', ({}, {}), '()', True, 'import tensorflow.compat.v1 as tf\n'), ((183, 20, 183, 60), 'numpy.stack', 'np.stack', ({(183, 29, 183, 59): '[decoded_png_1, decoded_png_2]'}, {}), '([decoded_png_1, decoded_png_2])', True, 'import numpy as np\n'), ((518, 2...
m10singh94/Python-programs
counting_capitals.py
a83083044b4a85afcf70c4b7024287a808b01fee
# -*- coding: utf-8 -*- """ Created on Tue Apr 21 08:09:31 2020 @author: Shivadhar SIngh """ def count_capitals(string): count = 0 for ch in string: if ord(ch) >= 65 and ord(ch) <= 90: count += 1 return count def remove_substring_everywhere(string, substring): ''' Remove all o...
[]
astroumd/admit
admit/at/GenerateSpectrum_AT.py
bbf3d79bb6e1a6f7523553ed8ede0d358d106f2c
""" .. _GenerateSpectrum-at-api: **GenerateSpectrum_AT** --- Generates synthetic test spectra. ------------------------------------------------------------- This module defines the GenerateSpectrum_AT class. """ from admit.AT import AT import admit.util.bdp_types as bt from admit.bdp.CubeSpectrum_BDP import ...
[]
nahidupa/grr
lib/flows/general/discovery_test.py
100a9d85ef2abb234e12e3ac2623caffb4116be7
#!/usr/bin/env python # -*- mode: python; encoding: utf-8 -*- """Tests for Interrogate.""" import socket from grr.client import vfs from grr.lib import action_mocks from grr.lib import aff4 from grr.lib import artifact_test from grr.lib import client_index from grr.lib import config_lib from grr.lib import flags fro...
[((23, 26, 23, 72), 'grr.lib.rdfvalue.SessionID', 'rdfvalue.SessionID', (), '', False, 'from grr.lib import rdfvalue\n'), ((29, 3, 29, 40), 'grr.lib.flow.EventHandler', 'flow.EventHandler', (), '', False, 'from grr.lib import flow\n'), ((284, 2, 284, 36), 'grr.lib.test_lib.GrrTestProgram', 'test_lib.GrrTestProgram', ()...
liff-engineer/articles
practices/20210112/GraphicsView.py
ad3386ef9cda5083793f485e309a9f85ab36f664
import sys from PySide2.QtWidgets import QGraphicsView, QGraphicsScene, QApplication from PySide2.QtCore import * from PySide2.QtGui import * class GraphicsView(QGraphicsView): def __init__(self, parent=None): super().__init__(parent) # 画布视图尺寸 self.w = 64000.0 self.h = 32000.0 ...
[((93, 10, 93, 32), 'PySide2.QtWidgets.QApplication', 'QApplication', ({(93, 23, 93, 31): 'sys.argv'}, {}), '(sys.argv)', False, 'from PySide2.QtWidgets import QGraphicsView, QGraphicsScene, QApplication\n'), ((31, 22, 31, 38), 'PySide2.QtWidgets.QGraphicsScene', 'QGraphicsScene', ({}, {}), '()', False, 'from PySide2.Q...
joncotton/armstrong.hatband
armstrong/hatband/tests/_utils.py
c71aed4bd0b03a78d68a6b306e8a0ba9cd92324e
from armstrong.dev.tests.utils import ArmstrongTestCase import random def random_range(): # TODO: make sure this can only be generated once return range(random.randint(1000, 2000)) class HatbandTestCase(ArmstrongTestCase): pass class HatbandTestMixin(object): script_code = """ <script type="t...
[((7, 17, 7, 43), 'random.randint', 'random.randint', ({(7, 32, 7, 36): '(1000)', (7, 38, 7, 42): '(2000)'}, {}), '(1000, 2000)', False, 'import random\n')]
ariroffe/logics
tests/propositional/test_natural_deduction.py
fb918ae8cf243a452e5b030f0df17add83f47f8b
import unittest from logics.classes.propositional import Inference, Formula from logics.classes.propositional.proof_theories import NaturalDeductionStep, NaturalDeductionRule from logics.utils.parsers import classical_parser from logics.instances.propositional.natural_deduction import classical_natural_deduction_syste...
[((184, 4, 184, 19), 'unittest.main', 'unittest.main', ({}, {}), '()', False, 'import unittest\n'), ((25, 16, 30, 35), 'logics.utils.parsers.classical_parser.parse_derivation', 'classical_parser.parse_derivation', (), '', False, 'from logics.utils.parsers import classical_parser\n'), ((54, 19, 57, 35), 'logics.utils.pa...
cohortfsllc/cohort-cocl2-sandbox
src/trusted/validator_arm/dgen_decoder_output.py
0ac6669d1a459d65a52007b80d5cffa4ef330287
#!/usr/bin/python # # Copyright (c) 2012 The Native Client Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # """ Responsible for generating the decoder based on parsed table representations. """ import dgen_opt import dgen_output imp...
[((135, 22, 135, 54), 'dgen_output.ifdef_name', 'dgen_output.ifdef_name', ({(135, 45, 135, 53): 'filename'}, {}), '(filename)', False, 'import dgen_output\n')]
ilinum/compose
compose/progress_stream.py
d1633d8e9df3c2dd4fa6f562c6b037cfe1af8ddb
from __future__ import absolute_import from __future__ import unicode_literals from compose import utils class StreamOutputError(Exception): pass def stream_output(output, stream): is_terminal = hasattr(stream, 'isatty') and stream.isatty() stream = utils.get_output_stream(stream) all_events = [] ...
[((13, 13, 13, 44), 'compose.utils.get_output_stream', 'utils.get_output_stream', ({(13, 37, 13, 43): 'stream'}, {}), '(stream)', False, 'from compose import utils\n'), ((18, 17, 18, 42), 'compose.utils.json_stream', 'utils.json_stream', ({(18, 35, 18, 41): 'output'}, {}), '(output)', False, 'from compose import utils\...
beloglazov/openstack-neat
tests/test_db.py
a5a853ae2affb0cdc582e3ab641737f5ebd3d0a7
# Copyright 2012 Anton Beloglazov # # 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 writ...
[]
GuillermoPerez32/EE2BIDS_backend
libs/BIDS.py
2cab240840e11e227ad60e4c8e17ac9ac87defd4
import os from bids_validator import BIDSValidator def validate(bids_directory): print('- Validate: init started.') file_paths = [] result = [] validator = BIDSValidator() for path, dirs, files in os.walk(bids_directory): for filename in files: if filename == '.bidsignore': ...
[((9, 16, 9, 31), 'bids_validator.BIDSValidator', 'BIDSValidator', ({}, {}), '()', False, 'from bids_validator import BIDSValidator\n'), ((10, 29, 10, 52), 'os.walk', 'os.walk', ({(10, 37, 10, 51): 'bids_directory'}, {}), '(bids_directory)', False, 'import os\n'), ((21, 19, 21, 47), 'os.path.join', 'os.path.join', ({(2...
peterbrazil/brazil
src/python/triangula/chassis.py
3823dca6f05b6946251800125d45069048d1bca1
from math import cos, sin, degrees, radians, pi from time import time from euclid import Vector2, Point2 from numpy import array as np_array from numpy.linalg import solve as np_solve __author__ = 'tom' def test(): chassis = HoloChassis(wheels=[ HoloChassis.OmniWheel(position=Point2(1, 0), angle=0, radi...
[]
rocketbot-cl/genesysCloud
libs/PureCloudPlatformClientV2/models/management_unit.py
dd9d9b5ebb90a82bab98c0d88b9585c22c91f333
# coding: utf-8 """ Copyright 2016 SmartBear Software 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...
[((371, 23, 371, 52), 'six.iteritems', 'iteritems', ({(371, 33, 371, 51): 'self.swagger_types'}, {}), '(self.swagger_types)', False, 'from six import iteritems\n')]
a1fred/guitar_gammas
harmony_tools/core/colors.py
9933fe899af7a8e7f490f61d58004bb59f03271c
COLOR_BLUE = '\033[0;34m' COLOR_GREEN = '\033[0;32m' COLOR_CYAN = '\033[0;36m' COLOR_RED = '\033[0;31m' COLOR_PURPLE = '\033[0;35m' COLOR_BROWN = '\033[0;33m' COLOR_YELLOW = '\033[1;33m' COLOR_GRAY = '\033[1;30m' COLOR_RESET = '\033[0m' FG_COLORS = [ # COLOR_BLUE, COLOR_GREEN, # COLOR_CYAN, # COLOR_R...
[]
tegamax/ProjectCode
Common_Questions/TextBookQuestions/PythonCrashCourse/Chapter_8/8_5.py
0ed86e227fba50b453c5c4a2596afbadc39a167e
''' 8-5. Cities: Write a function called describe_city() that accepts the name of a city and its country. The function should print a simple sentence, such as Reykjavik is in Iceland. Give the parameter for the country a default value. Call your function for three different cities, at least one of which is not in the...
[]
trnielsen/nexus-constructor
tests/test_geometry_loader.py
65efb6eedca30250b75f142dd29a46bc909958df
from nexus_constructor.geometry import OFFGeometryNoNexus from nexus_constructor.geometry.geometry_loader import load_geometry_from_file_object from nexus_constructor.off_renderer import repeat_shape_over_positions from PySide2.QtGui import QVector3D from io import StringIO def test_GIVEN_off_file_containing_geometry...
[((9, 12, 9, 32), 'nexus_constructor.geometry.OFFGeometryNoNexus', 'OFFGeometryNoNexus', ({}, {}), '()', False, 'from nexus_constructor.geometry import OFFGeometryNoNexus\n'), ((84, 22, 84, 40), 'PySide2.QtGui.QVector3D', 'QVector3D', ({(84, 32, 84, 33): '0', (84, 35, 84, 36): '0', (84, 38, 84, 39): '0'}, {}), '(0, 0, ...
Chum4k3r/Verteste
verteste/ui/ui_about.py
216c04468ff14c392ee3c6aebe12a0fa0e98767c
# -*- coding: utf-8 -*- ################################################################################ ## Form generated from reading UI file 'aboutdialog.ui' ## ## Created by: Qt User Interface Compiler version 6.1.1 ## ## WARNING! All changes made in this file will be lost when recompiling UI file! ###############...
[]
Qix-/aiohttp
tests/test_base_protocol.py
aee067dccad3dc0e79778a1b213105f20bf39baf
import asyncio from contextlib import suppress from unittest import mock import pytest from aiohttp.base_protocol import BaseProtocol async def test_loop() -> None: loop = asyncio.get_event_loop() asyncio.set_event_loop(None) pr = BaseProtocol(loop) assert pr._loop is loop async def test_pause_wri...
[((11, 11, 11, 35), 'asyncio.get_event_loop', 'asyncio.get_event_loop', ({}, {}), '()', False, 'import asyncio\n'), ((12, 4, 12, 32), 'asyncio.set_event_loop', 'asyncio.set_event_loop', ({(12, 27, 12, 31): 'None'}, {}), '(None)', False, 'import asyncio\n'), ((13, 9, 13, 27), 'aiohttp.base_protocol.BaseProtocol', 'BaseP...
marcusviniciusteixeira/RPAPython
main.py
8055e7283e6a8dd8910139cbbaa914761e2924f2
import PySimpleGUI as sg import os import time import pyautogui class TelaPython: def __init__(self): layout = [ [sg.Text('Usuário',size=(10,0)), sg.Input(size=(20,0),key='usuario')], [sg.Text('Senha',size=(10,0)), sg.Input(size=(20,0),key='senha')], [sg.Text('Número',si...
[((27, 8, 27, 39), 'os.startfile', 'os.startfile', ({(27, 21, 27, 38): '"""PortalClaro.exe"""'}, {}), "('PortalClaro.exe')", False, 'import os\n'), ((28, 8, 28, 25), 'time.sleep', 'time.sleep', ({(28, 19, 28, 24): 'time1'}, {}), '(time1)', False, 'import time\n'), ((29, 8, 29, 34), 'pyautogui.moveTo', 'pyautogui.moveTo...
eliben/deep-learning-samples
logistic-regression/plot_binary_losses.py
d5ca86c5db664fabfb302cbbc231c50ec3d6a103
# Helper code to plot binary losses. # # Eli Bendersky (http://eli.thegreenplace.net) # This code is in the public domain from __future__ import print_function import matplotlib.pyplot as plt import numpy as np if __name__ == '__main__': fig, ax = plt.subplots() fig.set_tight_layout(True) xs = np.linspac...
[((11, 14, 11, 28), 'matplotlib.pyplot.subplots', 'plt.subplots', ({}, {}), '()', True, 'import matplotlib.pyplot as plt\n'), ((14, 9, 14, 32), 'numpy.linspace', 'np.linspace', ({(14, 21, 14, 23): '-2', (14, 25, 14, 26): '2', (14, 28, 14, 31): '500'}, {}), '(-2, 2, 500)', True, 'import numpy as np\n'), ((29, 4, 29, 21)...
K-Fitzpatrick/crop_planner
utils/watch-less.py
2605c0886fd3b4681c2ea3ac5e88e1d8555178f5
#!/usr/bin/env python3 ################################ # Development tool # Auto-compiles style.less to style.css # # Requires lessc and less clean css to be installed: # npm install -g less # npm install -g less-plugin-clean-css ################################ import os, time from os import path from math import fl...
[((24, 2, 24, 17), 'os.chdir', 'os.chdir', ({(24, 11, 24, 16): '"""../"""'}, {}), "('../')", False, 'import os, time\n'), ((41, 10, 41, 21), 'time.time', 'time.time', ({}, {}), '()', False, 'import os, time\n'), ((42, 2, 42, 79), 'os.system', 'os.system', ({(42, 12, 42, 78): "('lessc ' + self.style_less + ' ' + self.st...
instituciones-abiertas/django-admin-export-action
testapp/app/app/tests/test_export_action.py
bb089180e418915e1bba31927554537249fbec78
# -- encoding: UTF-8 -- import json import uuid from admin_export_action import report from admin_export_action.admin import export_selected_objects from admin_export_action.config import default_config, get_config from django.contrib.admin.sites import AdminSite from django.contrib.auth.models import User from djang...
[((58, 18, 58, 34), 'django.test.RequestFactory', 'RequestFactory', ({}, {}), '()', False, 'from django.test import TestCase, RequestFactory\n'), ((65, 8, 65, 56), 'admin_export_action.admin.export_selected_objects', 'export_selected_objects', ({(65, 32, 65, 42): 'modeladmin', (65, 44, 65, 51): 'request', (65, 53, 65, ...
martinogden/django-shapeshifter
shapeshifter/tests/conftest.py
dbcba74c0a6914af181c1e8f0ba23369d4c3c94b
from pytest_djangoapp import configure_djangoapp_plugin pytest_plugins = configure_djangoapp_plugin( extend_INSTALLED_APPS=[ 'django.contrib.sessions', 'django.contrib.messages', ], extend_MIDDLEWARE=[ 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.m...
[((3, 17, 12, 1), 'pytest_djangoapp.configure_djangoapp_plugin', 'configure_djangoapp_plugin', (), '', False, 'from pytest_djangoapp import configure_djangoapp_plugin\n')]
seymayucer/FacialPhenotypes
face_attribute_verification.py
043f3ecf956cad53095d93f19383c4c94e033692
import argparse import numpy as np from sklearn.model_selection import StratifiedKFold import sklearn import cv2 import datetime import mxnet as mx from mxnet import ndarray as nd import pandas as pd from numpy import linalg as line import logging logging.basicConfig( format="%(asctime)s %(message)s", datefmt="%m/...
[((13, 0, 15, 1), 'logging.basicConfig', 'logging.basicConfig', (), '', False, 'import logging\n'), ((266, 13, 266, 77), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (), '', False, 'import argparse\n'), ((21, 8, 21, 50), 'logging.info', 'logging.info', ({(21, 21, 21, 49): '"""Face Verification for RFW."""'}, {...
mornfall/nixpkgs
pkgs/applications/virtualization/virt-manager/custom_runner.py
0eb6f056b9ce3e32dbc3297f298472aef19f8c73
#!/usr/bin/python -t # this script was written to use /etc/nixos/nixpkgs/pkgs/development/python-modules/generic/wrap.sh # which already automates python executable wrapping by extending the PATH/pythonPath # from http://docs.python.org/library/subprocess.html # Warning Invoking the system shell with shell=True can be...
[]
Pix-00/jsonform
jsonform/fields.py
d62543474d96b258606ec38dd427693232daeda3
import base64 import datetime from abc import ABC, abstractmethod from .conditions import AnyValue from .errors import FieldError, FormError __all__ = [ 'Field', 'StringField', 'IntegerField', 'FloatField', 'BooleanField', 'DateTimeField', 'DateField', 'TimeField', 'ListField','SetField', 'EnumField', 'BytesF...
[((109, 25, 109, 72), 'datetime.datetime.strptime', 'datetime.datetime.strptime', ({(109, 52, 109, 57): 'value', (109, 59, 109, 71): 'self.pattern'}, {}), '(value, self.pattern)', False, 'import datetime\n'), ((160, 24, 160, 49), 'base64.decodebytes', 'base64.decodebytes', ({(160, 43, 160, 48): 'value'}, {}), '(value)'...
napari/napari-gui
napari/layers/_source.py
9beb1a0b797890718e1c4f372cbd6256747f9101
from __future__ import annotations from contextlib import contextmanager from contextvars import ContextVar from typing import Optional, Tuple from magicgui.widgets import FunctionGui from pydantic import BaseModel class Source(BaseModel): """An object to store the provenance of a layer. Parameters ---...
[((48, 34, 48, 73), 'contextvars.ContextVar', 'ContextVar', (), '', False, 'from contextvars import ContextVar\n')]
vpalex999/project-mars
tests/unit/test_BaseDirection.py
6e21c5acfe6105a7b7c87a79770e7420bda46f26
import pytest import src.constants as cnst from src.directions import BaseDirection @pytest.fixture def base_direction(): return BaseDirection() def test_init_BaseDirection(base_direction): assert isinstance(base_direction, BaseDirection) def test_current_direction_is(base_direction): assert base_dir...
[((9, 11, 9, 26), 'src.directions.BaseDirection', 'BaseDirection', ({}, {}), '()', False, 'from src.directions import BaseDirection\n')]
Payal197bhadra/ComputerVision
OpenCV-Computer-Vision-Examples-with-Python-A-Complete-Guide-for-Dummies-master/Source Code/opencv_operations/draw-circles.py
d66b5037ece99b6189dd4306b2c9be67cffd14af
import numpy as np import cv2 #define a canvas of size 300x300 px, with 3 channels (R,G,B) and data type as 8 bit unsigned integer canvas = np.zeros((300,300,3), dtype ="uint8") #define color #draw a circle #arguments are canvas/image, midpoint, radius, color, thickness(optional) #display in cv2 window green = (0,255...
[((5, 9, 5, 46), 'numpy.zeros', 'np.zeros', (), '', True, 'import numpy as np\n'), ((12, 0, 12, 39), 'cv2.circle', 'cv2.circle', ({(12, 11, 12, 17): 'canvas', (12, 18, 12, 27): '(100, 100)', (12, 29, 12, 31): '(10)', (12, 33, 12, 38): 'green'}, {}), '(canvas, (100, 100), 10, green)', False, 'import cv2\n'), ((13, 0, 13...
cscutcher/tmux_cssh
tmux_cssh/main.py
bfbb7eb26d5f5864c0888fa8e614122401ed4f5f
# -*- coding: utf-8 -*- """ Main Script """ import logging import argh import sarge import tmuxp DEV_LOGGER = logging.getLogger(__name__) def get_current_session(server=None): ''' Seems to be no easy way to grab current attached session in tmuxp so this provides a simple alternative. ''' server ...
[((11, 13, 11, 40), 'logging.getLogger', 'logging.getLogger', ({(11, 31, 11, 39): '__name__'}, {}), '(__name__)', False, 'import logging\n'), ((25, 1, 25, 32), 'argh.arg', 'argh.arg', (), '', False, 'import argh\n'), ((50, 1, 50, 29), 'argh.arg', 'argh.arg', (), '', False, 'import argh\n'), ((19, 13, 19, 27), 'tmuxp.Se...
david-kn/nautobot-plugin-capacity-metrics
nautobot_capacity_metrics/management/commands/__init__.py
df2a635257a464b8340b788d8723b5f00e3e238f
"""Additional Django management commands added by nautobot_capacity_metrics plugin."""
[]
kmedian/nptweak
nptweak/__init__.py
222f46b8abb9b00f1ae8065d38d0514193aa8a4b
from .to_2darray import to_2darray
[]
sphildreth/roadie-python
resources/models/Image.py
1465ac0f4282356ab5a074020b4f0a9f28058a86
import io from PIL import Image as PILImage from sqlalchemy import Column, ForeignKey, LargeBinary, Index, Integer, String from resources.models.ModelBase import Base class Image(Base): # If this is used then the image is stored in the database image = Column(LargeBinary(length=16777215), default=None) #...
[((10, 19, 10, 47), 'sqlalchemy.LargeBinary', 'LargeBinary', (), '', False, 'from sqlalchemy import Column, ForeignKey, LargeBinary, Index, Integer, String\n'), ((12, 17, 12, 28), 'sqlalchemy.String', 'String', ({(12, 24, 12, 27): '500'}, {}), '(500)', False, 'from sqlalchemy import Column, ForeignKey, LargeBinary, Ind...
gabrielasuchopar/arch2vec
arch2vec/search_methods/reinforce_darts.py
1fc47d2cc7d63832e0d6337b8482669366b4aef2
import os import sys import argparse import json import random import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from arch2vec.models.pretraining_nasbench101 import configs from arch2vec.utils import load_json, preprocessing, one_hot_darts from arch2vec.preprocessing.gen_is...
[((154, 14, 154, 42), 'torch.Tensor', 'torch.Tensor', ({(154, 27, 154, 41): 'policy.rewards'}, {}), '(policy.rewards)', False, 'import torch\n'), ((155, 19, 155, 38), 'torch.sort', 'torch.sort', ({(155, 30, 155, 37): 'returns'}, {}), '(returns)', False, 'import torch\n'), ((172, 14, 172, 21), 'arch2vec.darts.cnn.train_...
mentaal/r_map
setup.py
42986e90b31018b1e7fc992a53b0f5f6e559253f
"""A setuptools based setup module. See: https://packaging.python.org/en/latest/distributing.html https://github.com/pypa/sampleproject """ # Always prefer setuptools over distutils from setuptools import setup, find_packages # To use a consistent encoding from codecs import open from os import path here = path.abspa...
[((22, 0, 67, 1), 'setuptools.setup', 'setup', (), '', False, 'from setuptools import setup, find_packages\n'), ((13, 20, 13, 42), 'os.path.dirname', 'path.dirname', ({(13, 33, 13, 41): '__file__'}, {}), '(__file__)', False, 'from os import path\n'), ((16, 10, 16, 38), 'os.path.join', 'path.join', ({(16, 20, 16, 24): '...
karianjahi/fahrer_minijob
dont_worry.py
020a9de27b77f8e0bcdec198a37cfb7f1d4736ed
class Hey: def __init__(jose, name="mours"): jose.name = name def get_name(jose): return jose.name class Person(object): def __init__(self, name, phone): self.name = name self.phone = phone class Teenager(Person): def __init__(self, *args, **kwargs): self.website...
[]
dynalz/odmantic
tests/zoo/tree.py
f20f08f8ab1768534c1e743f7539bfe4f8c73bdd
import enum from typing import Dict, List from odmantic.field import Field from odmantic.model import Model class TreeKind(str, enum.Enum): BIG = "big" SMALL = "small" class TreeModel(Model): name: str = Field(primary_key=True, default="Acacia des montagnes") average_size: float = Field(mongo_name=...
[((14, 16, 14, 71), 'odmantic.field.Field', 'Field', (), '', False, 'from odmantic.field import Field\n'), ((15, 26, 15, 50), 'odmantic.field.Field', 'Field', (), '', False, 'from odmantic.field import Field\n')]
eustomaqua/adanet
adanet/core/estimator_test.py
9c1de82428a4e661768af8e764041afebfec2e6f
"""Test AdaNet estimator single graph implementation. Copyright 2018 The AdaNet 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 https://www.apache.org/licenses/LI...
[((60, 0, 60, 35), 'absl.logging.set_verbosity', 'logging.set_verbosity', ({(60, 22, 60, 34): 'logging.INFO'}, {}), '(logging.INFO)', False, 'from absl import logging\n'), ((1654, 3, 1675, 8), 'absl.testing.parameterized.named_parameters', 'parameterized.named_parameters', ({(1655, 6, 1660, 7): "{'testcase_name': 'sing...
nyg1/classroom-finder
ua_roomseeker/uploader.py
13b6332187c2afb9833a1acd82bdf31ab81af5c8
from seeker.models import Building, Classroom, Time import json import os os.chdir('../data') fileList = os.listdir() #loops through each json file for jsonfile in fileList: #opens the jsonfile and loads the data f = open(jsonfile, 'r') data = f.read() jsondata = json.loads(data) #create the build...
[((5, 0, 5, 19), 'os.chdir', 'os.chdir', ({(5, 9, 5, 18): '"""../data"""'}, {}), "('../data')", False, 'import os\n'), ((6, 11, 6, 23), 'os.listdir', 'os.listdir', ({}, {}), '()', False, 'import os\n'), ((13, 15, 13, 31), 'json.loads', 'json.loads', ({(13, 26, 13, 30): 'data'}, {}), '(data)', False, 'import json\n'), (...
luiztauffer/dash-daq
dash_daq/Slider.py
4975093449bdc4d7ff4cd366ac82a847cdf24c34
# AUTO GENERATED FILE - DO NOT EDIT from dash.development.base_component import Component, _explicitize_args class Slider(Component): """A Slider component. A slider component with support for a target value. Keyword arguments: - id (string; optional): The ID used to identify this component in Dash callbac...
[]
ooshyun/filterdesign
src/util/__init__.py
59dbea191b8cd44aa9f2d02d3787b5805d486ae2
"""Utility function for process to raw data """ from .util import ( cvt_pcm2wav, cvt_float2fixed, cvt_char2num, plot_frequency_response, plot_pole_zero_analysis, ) from .fi import fi __all__ = [ "fi", "cvt_pcm2wav", "cvt_float2fixed", "cvt_char2num", "plot_frequency_response", ...
[]
datosgobar/infra.datos.gob.ar
infra/apps/catalog/tests/views/distribution_upload_tests.py
9f6ae7f0fc741aad79d074e7b2eb2a7dddf8b2cf
import pytest from django.core.files import File from django.urls import reverse from freezegun import freeze_time from infra.apps.catalog.tests.helpers.open_catalog import open_catalog pytestmark = pytest.mark.django_db @pytest.fixture(autouse=True) def give_user_edit_rights(user, node): node.admins.add(user) ...
[((11, 1, 11, 29), 'pytest.fixture', 'pytest.fixture', (), '', False, 'import pytest\n'), ((17, 22, 19, 77), 'django.urls.reverse', 'reverse', (), '', False, 'from django.urls import reverse\n'), ((24, 9, 24, 34), 'freezegun.freeze_time', 'freeze_time', ({(24, 21, 24, 33): '"""2019-01-01"""'}, {}), "('2019-01-01')", Fa...
Embracing/unrealcv
examples/model_zoo/build_binaries.py
19305da8554c3a0e683a5e27a1e487cc2cf42776
import subprocess, os ue4_win = r"C:\Program Files\Epic Games\UE_4.16" ue4_linux = "/home/qiuwch/workspace/UE416" ue4_mac = '/Users/Shared/Epic Games/UE_4.16' win_uprojects = [ r'C:\qiuwch\workspace\uprojects\UE4RealisticRendering\RealisticRendering.uproject', r'C:\qiuwch\workspace\uprojects\UE4ArchinteriorsV...
[((18, 4, 18, 97), 'os.path.expanduser', 'os.path.expanduser', ({(18, 23, 18, 96): '"""~/workspace/uprojects/UE4RealisticRendering/RealisticRendering.uproject"""'}, {}), "(\n '~/workspace/uprojects/UE4RealisticRendering/RealisticRendering.uproject')", False, 'import subprocess, os\n'), ((19, 4, 19, 107), 'os.path.ex...
NeonJarbas/skill-ddg
__init__.py
48476ad650e72f68ee7e96dd92c6d18f841ce6ec
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the...
[((30, 5, 30, 41), 'mycroft.skills.core.intent_handler', 'intent_handler', ({(30, 20, 30, 40): '"""search_duck.intent"""'}, {}), "('search_duck.intent')", False, 'from mycroft.skills.core import intent_handler\n'), ((23, 20, 23, 31), 'neon_solver_ddg_plugin.DDGSolver', 'DDGSolver', ({}, {}), '()', False, 'from neon_sol...
LAL/openstack-lease-it
openstack_lease_it/openstack_lease_it/settings.py
4ff983911825eac886fa6f76d6efc25225a698b7
""" Django settings for openstack_lease_it project. Generated by 'django-admin startproject' using Django 1.8.7. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ #...
[((23, 0, 23, 13), 'openstack_lease_it.config.load_config', 'load_config', ({}, {}), '()', False, 'from openstack_lease_it.config import GLOBAL_CONFIG, load_config\n'), ((29, 8, 29, 55), 'ast.literal_eval', 'ast.literal_eval', ({(29, 25, 29, 54): "GLOBAL_CONFIG['DJANGO_DEBUG']"}, {}), "(GLOBAL_CONFIG['DJANGO_DEBUG'])",...
vishalbelsare/rigl
rigl/experimental/jax/pruning/pruning.py
f18abc7d82ae3acc6736068408a0186c9efa575c
# coding=utf-8 # Copyright 2021 RigL Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
[((29, 9, 29, 30), 'jax.numpy.absolute', 'jnp.absolute', ({(29, 22, 29, 29): 'weights'}, {}), '(weights)', True, 'import jax.numpy as jnp\n'), ((66, 32, 66, 57), 'rigl.experimental.jax.pruning.masked.iterate_mask', 'masked.iterate_mask', ({(66, 52, 66, 56): 'mask'}, {}), '(mask)', False, 'from rigl.experimental.jax.pru...
hanzzhu/chadle
venv/Lib/site-packages/dash_bootstrap_components/_components/CardLink.py
ac1d63b0410bb43f3fab362bb00abfc2e8790b9d
# AUTO GENERATED FILE - DO NOT EDIT from dash.development.base_component import Component, _explicitize_args class CardLink(Component): """A CardLink component. Use card link to add consistently styled links to your cards. Links can be used like buttons, external links, or internal Dash style links. Keyword arg...
[]
antfootAlex/HanLP
plugins/hanlp_demo/hanlp_demo/zh/tf/train/train_ctb9_pos_electra.py
e8044b27ae1de54b9070db08549853d3ca8271e2
# -*- coding:utf-8 -*- # Author: hankcs # Date: 2019-12-28 23:15 from hanlp.components.taggers.transformers.transformer_tagger_tf import TransformerTaggerTF from tests import cdroot cdroot() tagger = TransformerTaggerTF() save_dir = 'data/model/pos/ctb9_electra_small_zh_epoch_20' tagger.fit('data/pos/ctb9/train.tsv', ...
[((7, 0, 7, 8), 'tests.cdroot', 'cdroot', ({}, {}), '()', False, 'from tests import cdroot\n'), ((8, 9, 8, 30), 'hanlp.components.taggers.transformers.transformer_tagger_tf.TransformerTaggerTF', 'TransformerTaggerTF', ({}, {}), '()', False, 'from hanlp.components.taggers.transformers.transformer_tagger_tf import Transf...
Wedding-APIs-System/Backend-APi
src/app/main.py
5a03be5f36ce8ca7e3abba2d64b63c55752697f3
from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware from app.api import landing, login, attendance_confirmation from sql_app.database import orm_connection app = FastAPI(title="Sergio's wedding backend API", description="REST API which serves login, attendance confirmation and other fea...
[((7, 6, 9, 19), 'fastapi.FastAPI', 'FastAPI', (), '', False, 'from fastapi import FastAPI\n')]
NextGenTechBar/twandora
tests/test_pydora/test_utils.py
f626717a5580f82250bbe66d4ebc357e0882382c
from unittest import TestCase from pandora.client import APIClient from pandora.errors import InvalidAuthToken, ParameterMissing from pandora.models.pandora import Station, AdItem, PlaylistItem from pandora.py2compat import Mock, patch from pydora.utils import iterate_forever class TestIterateForever(TestCase): ...
[((14, 22, 14, 71), 'pandora.client.APIClient', 'APIClient', ({(14, 32, 14, 46): 'self.transport', (14, 48, 14, 52): 'None', (14, 54, 14, 58): 'None', (14, 60, 14, 64): 'None', (14, 66, 14, 70): 'None'}, {}), '(self.transport, None, None, None, None)', False, 'from pandora.client import APIClient\n'), ((15, 36, 15, 42)...
mdlama/pydstool
PyDSTool/PyCont/BifPoint.py
3d298e908ff55340cd3612078508be0c791f63a8
""" Bifurcation point classes. Each class locates and processes bifurcation points. * _BranchPointFold is a version based on BranchPoint location algorithms * BranchPoint: Branch process is broken (can't find alternate branch -- see MATCONT notes) Drew LaMar, March 2006 """ from __future__ import absolu...
[((39, 20, 39, 26), 'PyDSTool.common.args', 'args', ({}, {}), '()', False, 'from PyDSTool.common import args\n'), ((59, 12, 59, 62), 'numpy.average', 'average', (), '', False, 'from numpy import Inf, NaN, isfinite, r_, c_, sign, mod, subtract, divide, transpose, eye, real, imag, conjugate, average\n'), ((60, 12, 60, 62...
OmenApps/marion
src/marion/marion/urls/__init__.py
f501674cafbd91f0bbad7454e4dcf3527cf4445e
"""Urls for the marion application""" from django.urls import include, path from rest_framework import routers from .. import views router = routers.DefaultRouter() router.register(r"requests", views.DocumentRequestViewSet) urlpatterns = [ path("", include(router.urls)), ]
[((9, 9, 9, 32), 'rest_framework.routers.DefaultRouter', 'routers.DefaultRouter', ({}, {}), '()', False, 'from rest_framework import routers\n'), ((13, 13, 13, 33), 'django.urls.include', 'include', ({(13, 21, 13, 32): 'router.urls'}, {}), '(router.urls)', False, 'from django.urls import include, path\n')]
TanKingsley/pyxll-jupyter
setup.py
4f7b3eb361079b74683d89340dfff9576fb2ff41
""" PyXLL-Jupyter This package integrated Jupyter notebooks into Microsoft Excel. To install it, first install PyXLL (see https://www.pyxll.com). Briefly, to install PyXLL do the following:: pip install pyxll pyxll install Once PyXLL is installed then installing this package will add a button to the PyXLL ...
[((25, 30, 25, 52), 'os.path.dirname', 'path.dirname', ({(25, 43, 25, 51): '__file__'}, {}), '(__file__)', False, 'from os import path\n'), ((26, 10, 26, 48), 'os.path.join', 'path.join', ({(26, 20, 26, 34): 'this_directory', (26, 36, 26, 47): '"""README.md"""'}, {}), "(this_directory, 'README.md')", False, 'from os im...
albi23/Pyra
board/views.py
1c1ceece15d55cd0e0ecf41d7224683b93b72555
from typing import List from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User from django.http import JsonResponse from django.shortcuts import render from django.urls import reverse_lazy from django.views import generic, View from board.forms import SignUpForm from .co...
[((24, 11, 24, 49), 'django.shortcuts.render', 'render', ({(24, 18, 24, 25): 'request', (24, 27, 24, 39): '"""index.html"""', (24, 41, 24, 48): 'context'}, {}), "(request, 'index.html', context)", False, 'from django.shortcuts import render\n'), ((42, 11, 42, 49), 'django.shortcuts.render', 'render', ({(42, 18, 42, 25)...
lazmond3/pylib-instagram-type
setup.py
9683a7fb1dad9b1a770a3f98317f1cde1085f0a7
# -*- coding: utf-8 -*- # Learn more: https://github.com/kennethreitz/setup.py from setuptools import setup, find_packages import os with open('README.md') as f: readme = f.read() with open('LICENSE') as f: license = f.read() def take_package_name(name): if name.startswith("-e"): return name[...
[((37, 13, 37, 53), 'setuptools.find_packages', 'find_packages', (), '', False, 'from setuptools import setup, find_packages\n')]
arush15june/wagtail-torchbox
tbx/core/migrations/0111_move_sign_up_form_into_new_app.py
c4d06e096c72bd8007975dc016133024f9d27fab
# -*- coding: utf-8 -*- # Generated by Django 1.11.16 on 2019-01-15 22:49 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('wagtailsearchpromotions', '0002_capitalizeverbose'), ('wagtailcore', '0040_page_draft_title...
[((19, 8, 19, 99), 'django.db.migrations.AlterModelTable', 'migrations.AlterModelTable', ({(19, 35, 19, 59): '"""SignUpFormPageResponse"""', (19, 61, 19, 98): '"""sign_up_form_signupformpageresponse"""'}, {}), "('SignUpFormPageResponse',\n 'sign_up_form_signupformpageresponse')", False, 'from django.db import migrat...