repo_name
stringlengths
7
94
repo_path
stringlengths
4
237
repo_head_hexsha
stringlengths
40
40
content
stringlengths
10
680k
apis
stringlengths
2
680k
pombreda/swarming
appengine/components/tests/datastore_utils_properties_test.py
c70f311f3db8f25752c793a0d7b36cf537d95580
#!/usr/bin/env python # Copyright 2014 The Swarming Authors. All rights reserved. # Use of this source code is governed by the Apache v2.0 license that can be # found in the LICENSE file. import sys import unittest import test_env test_env.setup_test_env() from google.appengine.ext import ndb from components.datast...
[((233, 258), 'test_env.setup_test_env', 'test_env.setup_test_env', ([], {}), '()\n', (256, 258), False, 'import test_env\n'), ((410, 460), 'components.datastore_utils.properties.BytesComputedProperty', 'properties.BytesComputedProperty', (["(lambda _: '\\x00')"], {}), "(lambda _: '\\x00')\n", (442, 460), False, 'from ...
dangervon/neutron
neutron/tests/unit/services/qos/test_qos_plugin.py
06ce0c2c94d2256a8f6804a1eacb0733747dcf46
# 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 # d...
[((30625, 30711), 'unittest.mock.patch', 'mock.patch', (['"""neutron.objects.rbac_db.RbacNeutronDbObjectMixin.create_rbac_policy"""'], {}), "(\n 'neutron.objects.rbac_db.RbacNeutronDbObjectMixin.create_rbac_policy')\n", (30635, 30711), False, 'from unittest import mock\n'), ((30732, 30782), 'unittest.mock.patch', 'm...
fixator10/Trusty-cogs
covfefe/covfefe.py
3d47a63f562cb64eb44da6bb53cfe9f8324026e7
import re import discord from redbot.core import commands class Covfefe(commands.Cog): """ Convert almost any word into covfefe """ def __init__(self, bot): self.bot = bot async def covfefe(self, x, k="aeiouy])"): """ https://codegolf.stackexchange.com/a/123697 "...
[((661, 679), 'redbot.core.commands.command', 'commands.command', ([], {}), '()\n', (677, 679), False, 'from redbot.core import commands\n'), ((358, 398), 're.findall', 're.findall', (['f"""(.*?[{k}([^{k}.*?([{k}"""', 'x'], {}), "(f'(.*?[{k}([^{k}.*?([{k}', x)\n", (368, 398), False, 'import re\n')]
trueware/bk-user
src/api/bkuser_core/audit/views.py
8c633e0a3821beb839ed120c4514c5733e675862
# -*- coding: utf-8 -*- """ TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-用户管理(Bk-User) available. Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in compliance with the Lic...
[]
ronghanghu/gqa_single_hop_baseline
exp_gqa/test.py
332d342da60dfefd40f2364d60215ed2f191aa2d
import os import numpy as np import tensorflow as tf from models_gqa.model import Model from models_gqa.config import build_cfg_from_argparse from util.gqa_train.data_reader import DataReader import json # Load config cfg = build_cfg_from_argparse() # Start session os.environ["CUDA_VISIBLE_DEVICES"] = str(cfg.GPU_ID...
[((226, 251), 'models_gqa.config.build_cfg_from_argparse', 'build_cfg_from_argparse', ([], {}), '()\n', (249, 251), False, 'from models_gqa.config import build_cfg_from_argparse\n'), ((615, 1173), 'util.gqa_train.data_reader.DataReader', 'DataReader', (['imdb_file'], {'shuffle': '(False)', 'one_pass': '(True)', 'batch_...
kamerons/dde-extract-gear
extract_gear/armor_visitor.py
44464ae470bd5de6279d32e3587b469ce006ea42
class ArmorVisitor: def __init__(self, num_pages, first_page_col_start, first_page_row_start, last_page_row_start, last_page_col_end, last_page_row_end, num_col_page=5, num_row_page=3): self.num_pages = num_pages self.first_page_col_start = first_page_col_start self.first_page_row_start = first_page_...
[]
hyroai/gamla
gamla/url_utils_test.py
bfa05807685bd51cba7c4c9cc47f1f5e73e6f7ee
from gamla import url_utils def test_add_to_query_string1(): assert ( url_utils.add_to_query_string( {"a": 123}, "https://www.domain.com/path?param1=param1#anchor", ) == "https://www.domain.com/path?param1=param1&a=123#anchor" ) def test_add_to_query_string2()...
[((84, 181), 'gamla.url_utils.add_to_query_string', 'url_utils.add_to_query_string', (["{'a': 123}", '"""https://www.domain.com/path?param1=param1#anchor"""'], {}), "({'a': 123},\n 'https://www.domain.com/path?param1=param1#anchor')\n", (113, 181), False, 'from gamla import url_utils\n'), ((343, 445), 'gamla.url_uti...
nilsmkMET/roppy
examples/temp_feie_shetland.py
c68d698fa4970174af2c7f7137bd4a3e5983b644
import numpy as np from netCDF4 import Dataset # Import development version of roppy import sys sys.path = ['..'] + sys.path import roppy # --- EDIT ----------------- # ROMS file romsfile = 'data/ocean_avg_example.nc' # Section definition lon0, lat0 = -0.67, 60.75 # Shetland lon1, lat1 = 4.72, 60.75 # Feie # --...
[]
gemini3d/pv-gemini
examples/test_scalar_field.py
99dff15b43a2c93cbcb63d2f8946d425d0555ef3
#!/usr/bin/env python3 """ example of 3D scalar field If you get this error, ParaView doesn't know your data file format: TypeError: TestFileReadability argument %Id: %V """ from pathlib import Path import argparse import paraview.simple as pvs p = argparse.ArgumentParser() p.add_argument("fn", help="data file to l...
[((253, 278), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (276, 278), False, 'import argparse\n'), ((380, 390), 'pathlib.Path', 'Path', (['P.fn'], {}), '(P.fn)\n', (384, 390), False, 'from pathlib import Path\n')]
S10MC2015/cms-django
src/cms/forms/languages/language_form.py
b08f2be60a9db6c8079ee923de2cd8912f550b12
from django import forms from ...models import Language class LanguageForm(forms.ModelForm): """ Form for creating and modifying language objects """ class Meta: model = Language fields = [ "code", "english_name", "native_name", "text_d...
[]
gregneagle/sal
search/forms.py
74c583fb1c1b33d3201b308b147376b3dcaca33f
from django import forms from .models import * from server.models import * class ChoiceFieldNoValidation(forms.ChoiceField): def validate(self, value): pass class SaveSearchForm(forms.ModelForm): class Meta: model = SavedSearch fields = ('name',) class SearchRowForm(forms.ModelForm):...
[((1317, 1336), 'django.forms.HiddenInput', 'forms.HiddenInput', ([], {}), '()\n', (1334, 1336), False, 'from django import forms\n')]
agustinhenze/mibs.snmplabs.com
pysnmp-with-texts/InternetThruway-MIB.py
1fc5c07860542b89212f4c8ab807057d9a9206c7
# # PySNMP MIB module InternetThruway-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/InternetThruway-MIB # Produced by pysmi-0.3.4 at Wed May 1 13:58:27 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default...
[]
antoreep-jana/BBC-News-Analyzer
newsparser.py
0a6e54ddf4baefa4532213c5e6f60e712ff3a1ca
from bs4 import BeautifulSoup as bs import requests class BBC: def __init__(self, url:str): article = requests.get(url) self.soup = bs(article.content, "html.parser") #print(dir(self.soup)) #print(self.soup.h1.text) self.body = self.get_body() self.link = url ...
[((116, 133), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (128, 133), False, 'import requests\n'), ((154, 188), 'bs4.BeautifulSoup', 'bs', (['article.content', '"""html.parser"""'], {}), "(article.content, 'html.parser')\n", (156, 188), True, 'from bs4 import BeautifulSoup as bs\n')]
Caroline-Odevall/final-project-team-18
SIR_model-Copy.Caroline.1.py
fbf00ae4ec554dee9245a9834ff4108b3d339842
# In[42]: from scipy.integrate import odeint import numpy as np import matplotlib.pyplot as plt # In[43]: # describe the model def deriv(y, t, N, beta, gamma, delta): S, E, I, R = y dSdt = -beta * S * I / N # S(t) – susceptible (de som är mottagliga för infektion). dEdt = beta * S * I / N - gamma * ...
[((1045, 1068), 'numpy.linspace', 'np.linspace', (['(0)', '(99)', '(100)'], {}), '(0, 99, 100)\n', (1056, 1068), True, 'import numpy as np\n'), ((1210, 1260), 'scipy.integrate.odeint', 'odeint', (['deriv', 'y0', 't'], {'args': '(N, beta, gamma, delta)'}), '(deriv, y0, t, args=(N, beta, gamma, delta))\n', (1216, 1260), ...
gcardosov/PythonAprendeOrg
Condicionales anidados.py
0cad81f0a584c98389ca729a337d30581780e520
pregunta = input('trabajas desde casa? ') if pregunta == True: print 'Eres afortunado' if pregunta == False: print 'Trabajas fuera de casa' tiempo = input('Cuantos minutos haces al trabajo: ') if tiempo == 0: print 'trabajas desde casa' elif tiempo <=20: print 'Es po...
[]
Niclnx/service-stac
app/middleware/cache_headers.py
ad9129a7130d09b2bed387d8e82575eb86fdfa7b
import logging import re from urllib.parse import urlparse from django.conf import settings from django.utils.cache import add_never_cache_headers from django.utils.cache import patch_cache_control from django.utils.cache import patch_response_headers logger = logging.getLogger(__name__) STAC_BASE = settings.STAC_BA...
[((263, 290), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (280, 290), False, 'import logging\n'), ((1067, 1116), 're.match', 're.match', (['f"""^(/{STAC_BASE})?/\\\\w+$"""', 'request.path'], {}), "(f'^(/{STAC_BASE})?/\\\\w+$', request.path)\n", (1075, 1116), False, 'import re\n'), ((11...
anorthman/mmdetection
mmdet/models/detectors/knowledge_distilling/kd_single_stage.py
52e28154364f0e19d11c206bb357d88f29fc4a2d
# author huangchuanhong import torch from mmcv.runner import load_checkpoint from ..base import BaseDetector from ..single_stage import SingleStageDetector from ...registry import DETECTORS from ...builder import build_detector @DETECTORS.register_module class KDSingleStageDetector(SingleStageDetector): def __ini...
[((1066, 1124), 'mmcv.runner.load_checkpoint', 'load_checkpoint', (['self.teacher_detector', 'teacher.checkpoint'], {}), '(self.teacher_detector, teacher.checkpoint)\n', (1081, 1124), False, 'from mmcv.runner import load_checkpoint\n'), ((1937, 1952), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (1950, 1952), Fa...
yiwc/robotics-world
metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_dial_turn_v2.py
48efda3a8ea6741b35828b02860f45753252e376
import numpy as np from gym.spaces import Box from metaworld.envs import reward_utils from metaworld.envs.asset_path_utils import full_v2_path_for from metaworld.envs.mujoco.sawyer_xyz.sawyer_xyz_env import SawyerXYZEnv, _assert_task_is_set class SawyerDialTurnEnvV2(SawyerXYZEnv): TARGET_RADIUS = 0.07 def _...
[((873, 900), 'numpy.array', 'np.array', (['[0.0, 0.73, 0.08]'], {}), '([0.0, 0.73, 0.08])\n', (881, 900), True, 'import numpy as np\n'), ((1265, 1311), 'metaworld.envs.asset_path_utils.full_v2_path_for', 'full_v2_path_for', (['"""sawyer_xyz/sawyer_dial.xml"""'], {}), "('sawyer_xyz/sawyer_dial.xml')\n", (1281, 1311), F...
dcloutman/obviforum
obviforum/obviforum.wsgi
31af0cf6f2e243bff9d920276831415bd5210cf9
#!/usr/bin/env python import sys import logging import os logging.basicConfig(stream=sys.stderr) file_dir = os.path.dirname(os.path.realpath(__file__)) sys.path.insert(0, file_dir) from main import app as application from main import db
[((58, 96), 'logging.basicConfig', 'logging.basicConfig', ([], {'stream': 'sys.stderr'}), '(stream=sys.stderr)\n', (77, 96), False, 'import logging\n'), ((152, 180), 'sys.path.insert', 'sys.path.insert', (['(0)', 'file_dir'], {}), '(0, file_dir)\n', (167, 180), False, 'import sys\n'), ((124, 150), 'os.path.realpath', '...
ragsagar/yezdi
yezdi/parser/parser.py
5b97bedc56d5af7f28b244a0d7c0c8259f643102
from yezdi.lexer.token import TokenType from yezdi.parser.ast import Program, Statement, Participant, Title, LineStatement class Parser: def __init__(self, lexer): self.lexer = lexer self.current_token = None self.peek_token = None self.next_token() self.next_token() ...
[((507, 516), 'yezdi.parser.ast.Program', 'Program', ([], {}), '()\n', (514, 516), False, 'from yezdi.parser.ast import Program, Statement, Participant, Title, LineStatement\n'), ((1260, 1292), 'yezdi.parser.ast.Participant', 'Participant', (['participant_literal'], {}), '(participant_literal)\n', (1271, 1292), False, ...
oberron/entolusis
scripts/check_categories.py
209e1e245d8e501e5e6ea2f52dd5b0da7d886f5c
# list categories in category folder from os import walk from os.path import abspath,join, pardir categories_folder = abspath(join(__file__,pardir,pardir,"category")) post_folder = abspath(join(__file__,pardir,pardir,"_posts")) site_categories = [] for root,directories,files in walk(categories_folder): for f in ...
[((282, 305), 'os.walk', 'walk', (['categories_folder'], {}), '(categories_folder)\n', (286, 305), False, 'from os import walk\n'), ((464, 481), 'os.walk', 'walk', (['post_folder'], {}), '(post_folder)\n', (468, 481), False, 'from os import walk\n'), ((128, 170), 'os.path.join', 'join', (['__file__', 'pardir', 'pardir'...
syoyo/soloud
docsrc/makedoc.py
cce88a2408a4b1e88ccbc75de9897b39bc3e7dda
#!/usr/bin/env python3 """ builds documentation files from multimarkdown (mmd) source to various formats, including the web site and pdf. """ import subprocess import glob import os import sys import time import shutil src = [ "intro.mmd", "downloads.mmd", "quickstart.mmd", "faq.mmd", "dirstr...
[((1396, 1414), 'glob.glob', 'glob.glob', (['"""*.mmd"""'], {}), "('*.mmd')\n", (1405, 1414), False, 'import glob\n'), ((1631, 1654), 'time.strftime', 'time.strftime', (['"""%Y%m%d"""'], {}), "('%Y%m%d')\n", (1644, 1654), False, 'import time\n'), ((2209, 2231), 'subprocess.call', 'subprocess.call', (['callp'], {}), '(c...
ladike/912_project
6 复试/2 笔试/4 编译原理/hw/2016_黄家晖_PA/550405220_4_decaf_PA3/TestCases/S3/output/t9.tac
5178c1c93ac6ca30ffc72dd689f5c6932704b4ab
VTABLE(_Main) { <empty> Main _Main.COPY; } VTABLE(_Base) { <empty> Base _Base.COPY; } VTABLE(_Sub1) { _Base Sub1 _Sub1.COPY; } VTABLE(_Sub2) { _Base Sub2 _Sub2.COPY; } VTABLE(_Sub3) { _Sub1 Sub3 _Sub3.COPY; } VTABLE(_Sub4) { _Sub3 Sub4 _Sub4.C...
[]
yzjba/FATE
arch/api/base/utils/party.py
9a6d252da637b2583a0f8a51f6cb4c615850bab9
# # Copyright 2019 The FATE Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
[((1296, 1360), 'arch.api.proto.federation_pb2.Party', 'federation_pb2.Party', ([], {'partyId': 'f"""{self.party_id}"""', 'name': 'self.role'}), "(partyId=f'{self.party_id}', name=self.role)\n", (1316, 1360), False, 'from arch.api.proto import federation_pb2\n')]
faulkner/sentry
src/sentry/options/defaults.py
f9dd4d0d7c683632cf02810c03bd42d7051ad010
""" sentry.options.defaults ~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import, print_function from sentry.logging import LoggingFormat from sentry.options import ( FLAG_IMMUTAB...
[((589, 640), 'sentry.options.register', 'register', (['"""system.admin-email"""'], {'flags': 'FLAG_REQUIRED'}), "('system.admin-email', flags=FLAG_REQUIRED)\n", (597, 640), False, 'from sentry.options import FLAG_IMMUTABLE, FLAG_NOSTORE, FLAG_PRIORITIZE_DISK, FLAG_REQUIRED, FLAG_ALLOW_EMPTY, register\n'), ((641, 720),...
henryiii/backrefs
tools/unidatadownload.py
ec82844098bc3bdc7bcaa61b32f80271e6a73da6
"""Download `Unicodedata` files.""" from __future__ import unicode_literals import os import zipfile import codecs from urllib.request import urlopen __version__ = '2.2.0' HOME = os.path.dirname(os.path.abspath(__file__)) def zip_unicode(output, version): """Zip the Unicode files.""" zipper = zipfile.ZipFi...
[((197, 222), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (212, 222), False, 'import os\n'), ((420, 464), 'os.path.join', 'os.path.join', (['output', '"""unicodedata"""', 'version'], {}), "(output, 'unicodedata', version)\n", (432, 464), False, 'import os\n'), ((537, 552), 'os.walk', 'os.w...
biarmic/OpenCache
generator/cache/cache.py
bb9e110e434deb83900de328cc76b63901ba582f
# See LICENSE for licensing information. # # Copyright (c) 2021 Regents of the University of California and The Board # of Regents for the Oklahoma Agricultural and Mechanical College # (acting for and on behalf of Oklahoma State University) # All rights reserved. # import debug import datetime from policy import assoc...
[((1151, 1176), 'n_way_cache.n_way_cache', 'cache', (['cache_config', 'name'], {}), '(cache_config, name)\n', (1156, 1176), True, 'from n_way_cache import n_way_cache as cache\n'), ((1475, 1516), 'debug.print_raw', 'debug.print_raw', (['"""Saving output files..."""'], {}), "('Saving output files...')\n", (1490, 1516), ...
elieser1101/loglizer
utils/data_loader.py
985c5f582fbbe4d6365184086ac091134a5b5d07
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'Shilin He' import pandas as pd import os import numpy as np def hdfs_data_loader(para): """ load the log sequence matrix and labels from the file path. Args: -------- para: the parameters dictionary Returns: -------- raw_data: log sequences matrix...
[((498, 560), 'pandas.read_csv', 'pd.read_csv', (['file_path'], {'nrows': '(1)', 'header': 'None', 'delimiter': '"""\\\\s+"""'}), "(file_path, nrows=1, header=None, delimiter='\\\\s+')\n", (509, 560), True, 'import pandas as pd\n'), ((672, 758), 'pandas.read_csv', 'pd.read_csv', (['file_path'], {'delimiter': '"""\\\\s+...
marcocucinato/aspx2url
aspx2url/aspx2url.py
985a0e51865bb7be15618155ff9844730c2eaaf6
from __future__ import print_function import re, sys, glob, getopt, os def usage(): print('aspx2url v1.0') print('Usage:') print(sys.argv[0]+' -d -h filename(s)') print('-d : Delete original file') print('-h : This help') def main(): try: opts, args = getopt.getopt(sys.argv[1:], "hd")...
[((287, 320), 'getopt.getopt', 'getopt.getopt', (['sys.argv[1:]', '"""hd"""'], {}), "(sys.argv[1:], 'hd')\n", (300, 320), False, 'import re, sys, glob, getopt, os\n'), ((729, 794), 're.compile', 're.compile', (['"""\\\\<mso\\\\:URL.*?\\\\>(.*?),.*?\\\\<\\\\/mso\\\\:URL\\\\>"""', 're.M'], {}), "('\\\\<mso\\\\:URL.*?\\\\...
souravbadami/pytype
pytype/tests/py2/test_stdlib.py
804fa97e7f9208df2711976085a96f756b3949e6
"""Tests of selected stdlib functions.""" from pytype.tests import test_base class StdlibTests(test_base.TargetPython27FeatureTest): """Tests for files in typeshed/stdlib.""" def testPosix(self): ty = self.Infer(""" import posix x = posix.urandom(10) """) self.assertTypesMatchPytd(ty, ""...
[]
oicr-gsi/pysmmips
smmips/__init__.py
ccf209b13862a5533a11fbe02e80d3265ccef313
# -*- coding: utf-8 -*- """ Created on Tue Oct 20 16:04:52 2020 @author: rjovelin """
[]
tarent/socialwall-backend
tarentsocialwall/MongoDBClient.py
2f09b8ccdd62a15daaa281d6ff568cb6ef749ab6
import random from datetime import datetime from passlib.handlers.sha2_crypt import sha256_crypt from pymongo import MongoClient from pymongo.errors import ConnectionFailure from tarentsocialwall.SocialPost import SocialPost from tarentsocialwall.User import User from tarentsocialwall.Util import Util class MongoDB...
[((745, 761), 'pymongo.MongoClient', 'MongoClient', (['uri'], {}), '(uri)\n', (756, 761), False, 'from pymongo import MongoClient\n'), ((2588, 2600), 'tarentsocialwall.SocialPost.SocialPost', 'SocialPost', ([], {}), '()\n', (2598, 2600), False, 'from tarentsocialwall.SocialPost import SocialPost\n'), ((5643, 5662), 'ta...
Sodki/efs-utils
src/mount_efs/__init__.py
493d9ea0dde93b560519b184219f6f71e32a8fcf
#!/usr/bin/env python # # Copyright 2017-2018 Amazon.com, Inc. and its affiliates. All Rights Reserved. # # Licensed under the MIT License. See the LICENSE accompanying this file # for the specific language governing permissions and limitations under # the License. # # # Copy this script to /sbin/mount.efs and make sur...
[((4023, 4062), 're.compile', 're.compile', (['"""^(?P<fs_id>fs-[0-9a-f]+)$"""'], {}), "('^(?P<fs_id>fs-[0-9a-f]+)$')\n", (4033, 4062), False, 'import re\n'), ((4077, 4191), 're.compile', 're.compile', (['"""^(?P<fs_id>fs-[0-9a-f]+)\\\\.efs\\\\.(?P<region>[a-z0-9-]+)\\\\.(?P<dns_name_suffix>[a-z0-9.]+)$"""'], {}), "(\n...
ProfessorSean/Kasutamaiza
upcfcardsearch/c8.py
7a69a69258f67bbb88bebbac6da4e6e1434947e6
import discord from discord.ext import commands from discord.utils import get class c8(commands.Cog, name="c8"): def __init__(self, bot: commands.Bot): self.bot = bot @commands.command(name='Sacrosanct_Devouring_Pyre', aliases=['c8']) async def example_embed(self, ctx): embed = discord.Emb...
[((186, 252), 'discord.ext.commands.command', 'commands.command', ([], {'name': '"""Sacrosanct_Devouring_Pyre"""', 'aliases': "['c8']"}), "(name='Sacrosanct_Devouring_Pyre', aliases=['c8'])\n", (202, 252), False, 'from discord.ext import commands\n'), ((309, 373), 'discord.Embed', 'discord.Embed', ([], {'title': '"""Sa...
tameney22/DCI-Capstone
SVMmodel_withSKF.py
6f59541f16030bfa3f0a706fd9f0e4394e1ee974
""" This script is where the preprocessed data is used to train the SVM model to perform the classification. I am using Stratified K-Fold Cross Validation to prevent bias and/or any imbalance that could affect the model's accuracy. REFERENCE: https://medium.com/@bedigunjit/simple-guide-to-text-classification-nlp-usin...
[((686, 730), 'pandas.read_csv', 'pd.read_csv', (['"""preprocessed.csv"""'], {'index_col': '(0)'}), "('preprocessed.csv', index_col=0)\n", (697, 730), True, 'import pandas as pd\n'), ((857, 944), 'sklearn.model_selection.train_test_split', 'model_selection.train_test_split', (["df['Text']", "df['PublicationTitle']"], {...
JesseMaitland/red-dwarf
red_dwarf/entrypoints/project_management.py
f606ada43f4be72c5cab61049182b58c0c348602
from rsterm import EntryPoint from red_dwarf.project import provide_project_context, ProjectContext class InitProject(EntryPoint): @provide_project_context def run(self, project_context: ProjectContext) -> None: project_context.init_project()
[]
dschwoerer/samscripts
src/consensus.py
caee697e96a0639b7a4f9db02f70f4fd92b39ef9
#! /usr/bin/env python # Copyright Ivan Sovic, 2015. www.sovic.org # # Creates a pileup from a given SAM/BAM file, and calls consensus bases (or variants). import os import sys import operator import subprocess def increase_in_dict(dict_counter, value): try: dict_counter[value] += 1 except: ...
[((26782, 26804), 'sys.stderr.write', 'sys.stderr.write', (['"""\n"""'], {}), "('\\n')\n", (26798, 26804), False, 'import sys\n'), ((27663, 27701), 'sys.stderr.write', 'sys.stderr.write', (["(summary_lines + '\\n')"], {}), "(summary_lines + '\\n')\n", (27679, 27701), False, 'import sys\n'), ((27706, 27728), 'sys.stderr...
diogocs1/comps
web/addons/account_payment/wizard/account_payment_populate_statement.py
63df07f6cf21c41e4527c06e2d0499f23f4322e7
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
[((1249, 1348), 'openerp.osv.fields.many2many', 'fields.many2many', (['"""payment.line"""', '"""payment_line_rel_"""', '"""payment_id"""', '"""line_id"""', '"""Payment Lines"""'], {}), "('payment.line', 'payment_line_rel_', 'payment_id',\n 'line_id', 'Payment Lines')\n", (1265, 1348), False, 'from openerp.osv import...
akloster/qtile
libqtile/widget/imapwidget.py
bd21d0744e177b8ca01ac129081472577d53ed66
# -*- coding: utf-8 -*- # Copyright (c) 2015 David R. Andersen # # 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 limitation the rights # to use, copy, m...
[((2840, 2888), 'libqtile.widget.base.ThreadPoolText.__init__', 'base.ThreadPoolText.__init__', (['self', '""""""'], {}), "(self, '', **config)\n", (2868, 2888), False, 'from libqtile.widget import base\n'), ((2955, 3000), 'keyring.get_password', 'keyring.get_password', (['"""imapwidget"""', 'self.user'], {}), "('imapw...
dimadk24/english-fight-api
game/views/tests/game_definition_view_test.py
506a3eb2cb4cb91203b1e023b5248c27975df075
from rest_framework.response import Response from rest_framework.test import APIClient from game.models import GameDefinition, AppUser def create_game_definition(api_client: APIClient) -> Response: return api_client.post("/api/game_definition") def get_game_definition(api_client: APIClient, game_def_id: str) -...
[((1165, 1208), 'game.models.AppUser.objects.create', 'AppUser.objects.create', ([], {'vk_id': '(2)', 'username': '(2)'}), '(vk_id=2, username=2)\n', (1187, 1208), False, 'from game.models import GameDefinition, AppUser\n'), ((1691, 1733), 'game.models.GameDefinition.objects.get', 'GameDefinition.objects.get', ([], {'p...
karolinanikolova/SoftUni-Software-Engineering
2-Python-Fundamentals (Jan 2021)/Course-Exercises-and-Exams/08-Text-Processing/01_Lab/02-Repeat-Strings.py
7891924956598b11a1e30e2c220457c85c40f064
# 2. Repeat Strings # Write a Program That Reads a list of strings. Each string is repeated N times, where N is the length of the string. Print the concatenated string. strings = input().split() output_string = "" for string in strings: N = len(string) output_string += string * N print(output_string)
[]
mesosphere/cloudkeeper
cloudkeeperV1/plugins/cleanup_aws_loadbalancers/test/test_args.py
11be262df5874c1033cfec9964bba1596cab6a36
from cklib.args import get_arg_parser, ArgumentParser from cloudkeeper_plugin_cleanup_aws_loadbalancers import CleanupAWSLoadbalancersPlugin def test_args(): arg_parser = get_arg_parser() CleanupAWSLoadbalancersPlugin.add_args(arg_parser) arg_parser.parse_args() assert ArgumentParser.args.cleanup_aws_...
[((177, 193), 'cklib.args.get_arg_parser', 'get_arg_parser', ([], {}), '()\n', (191, 193), False, 'from cklib.args import get_arg_parser, ArgumentParser\n'), ((198, 248), 'cloudkeeper_plugin_cleanup_aws_loadbalancers.CleanupAWSLoadbalancersPlugin.add_args', 'CleanupAWSLoadbalancersPlugin.add_args', (['arg_parser'], {})...
prezi/mayan-edms
mayan/apps/metadata/migrations/0011_auto_20180917_0645.py
e9bc10a056c3379b57115c6e83022f48c6298e1d
# -*- coding: utf-8 -*- # Generated by Django 1.11.11 on 2018-09-17 06:45 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('metadata', '0010_auto_20180823_2353'), ] operations = [ migrations.AlterFi...
[((412, 595), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'db_index': '(True)', 'help_text': '"""The actual value stored in the metadata type field for the document."""', 'max_length': '(255)', 'null': '(True)', 'verbose_name': '"""Value"""'}), "(blank=True, db_index=True, help_text=\n ...
ruslanlvivsky/python-algorithm
algorithm/dfs/boj_1260.py
2b49bed33cd0e95b8a1e758008191f4392b3f667
def dfs(V): print(V, end=' ') visited[V] = True for n in graph[V]: if not visited[n]: dfs(n) def dfs_s(V): stack = [V] visited[V] = True while stack: now = stack.pop() print(now, end=' ') for n in graph[now]: if not visited[n]: ...
[]
UKPLab/DiGAT
redirector.py
b044648a6c79428872a778908d3a8a689f0ac3e6
from google.appengine.ext import webapp from google.appengine.ext.webapp.util import run_wsgi_app __author__ = "Artem Vovk, Roland Kluge, and Christian Kirschner" __copyright__ = "Copyright 2013-2015 UKP TU Darmstadt" __credits__ = ["Artem Vovk", "Roland Kluge", "Christian Kirschner"] __license__ = "ASL" class Redire...
[((483, 540), 'google.appengine.ext.webapp.WSGIApplication', 'webapp.WSGIApplication', (["[('/.*', Redirector)]"], {'debug': '(True)'}), "([('/.*', Redirector)], debug=True)\n", (505, 540), False, 'from google.appengine.ext import webapp\n'), ((568, 593), 'google.appengine.ext.webapp.util.run_wsgi_app', 'run_wsgi_app',...
pAoenix/image-Augmented
imgaug/augmenters/flip.py
4acaa7dc48c6167c1716e39e9e78b1cea2067b4a
""" Augmenters that apply mirroring/flipping operations to images. Do not import directly from this file, as the categorization is not final. Use instead :: from imgaug import augmenters as iaa and then e.g. :: seq = iaa.Sequential([ iaa.Fliplr((0.0, 1.0)), iaa.Flipud((0.0, 1.0)) ]) Lis...
[((1759, 1779), 'six.moves.xrange', 'sm.xrange', (['nb_images'], {}), '(nb_images)\n', (1768, 1779), True, 'import six.moves as sm\n'), ((4093, 4113), 'six.moves.xrange', 'sm.xrange', (['nb_images'], {}), '(nb_images)\n', (4102, 4113), True, 'import six.moves as sm\n'), ((1841, 1861), 'numpy.fliplr', 'np.fliplr', (['im...
Dharaneeshwar/Leetcode
2. Add Two Numbers DC(12-1-21).py
cc3ed07f6ac5f4d6e3f60c57a94a06a8be2f5287
# Time Complexity - O(n) ; Space Complexity - O(n) class Solution: def addTwoNumbers(self, l1: ListNode, l2: ListNode) -> ListNode: carry = 0 out = temp = ListNode() while l1 is not None and l2 is not None: tempsum = l1.val + l2.val tempsum += carry ...
[]
dks28/Deep-Gaussian-Process
deepgp_dsvi/demos/step_function.py
a7aace43e78aae81468849aee7d172742e6ecf86
import numpy as np import tensorflow as tf import matplotlib.pyplot as plt from gpflow.kernels import White, RBF from gpflow.likelihoods import Gaussian from deep_gp import DeepGP np.random.seed(0) tf.random.set_seed(0) def get_data(): Ns = 300 Xs = np.linspace(-0.5, 1.5, Ns)[:, None] N, M = 50, 25 ...
[((182, 199), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (196, 199), True, 'import numpy as np\n'), ((200, 221), 'tensorflow.random.set_seed', 'tf.random.set_seed', (['(0)'], {}), '(0)\n', (218, 221), True, 'import tensorflow as tf\n'), ((1177, 1230), 'tensorflow.optimizers.Adam', 'tf.optimizers.Ada...
METASPACE2020/METASPACE
metaspace/engine/sm/engine/annotation_lithops/moldb_pipeline.py
e1acd9a409f84a78eed7ca9713258c09b0e137ca
from __future__ import annotations import json import logging from contextlib import contextmanager, ExitStack from typing import List, Dict import pandas as pd from lithops.storage import Storage from lithops.storage.utils import CloudObject, StorageNoSuchKeyError from sm.engine.annotation_lithops.build_moldb impor...
[((886, 926), 'logging.getLogger', 'logging.getLogger', (['"""annotation-pipeline"""'], {}), "('annotation-pipeline')\n", (903, 926), False, 'import logging\n'), ((1614, 1638), 'sm.engine.annotation_lithops.utils.jsonhash', 'jsonhash', (['self.ds_config'], {}), '(self.ds_config)\n', (1622, 1638), False, 'from sm.engine...
anglebinbin/Barista-tool
gui/main_window/node_editor/items/connector_top_item.py
2d51507fb3566881923f0b273127f59d23ed317f
from PyQt5.QtWidgets import QMenu from gui.main_window.node_editor.items.connector_item import ConnectorItem class ConnectorTopItem(ConnectorItem): """ Class to provide top connector functionality """ def __init__(self, index, nodeItem, nodeEditor, parent=None): super(ConnectorTopItem, self).__init_...
[((2120, 2127), 'PyQt5.QtWidgets.QMenu', 'QMenu', ([], {}), '()\n', (2125, 2127), False, 'from PyQt5.QtWidgets import QMenu\n')]
DirectXceriD/gridgain
modules/platforms/python/pyignite/api/key_value.py
093e512a9147e266f83f6fe1cf088c0b037b501c
# GridGain Community Edition Licensing # Copyright 2019 GridGain Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License") modified with Commons Clause # Restriction; you may not use this file except in compliance with the License. You may obtain a # copy of th...
[((3197, 3353), 'pyignite.queries.Query', 'Query', (['OP_CACHE_PUT', "[('hash_code', Int), ('flag', Byte), ('key', key_hint or AnyDataObject), (\n 'value', value_hint or AnyDataObject)]"], {'query_id': 'query_id'}), "(OP_CACHE_PUT, [('hash_code', Int), ('flag', Byte), ('key', key_hint or\n AnyDataObject), ('value...
linshen/crosswalk-test-suite
wrt/wrt-manifest-tizen-tests/const.py
e206b2c35fc09e583f3202fc7fc8a656c8e2b5de
#!/usr/bin/env python import sys, os import itertools, shutil path = os.path.abspath(__file__) path = os.path.split(path)[0] os.chdir(path) print path device_ssh_ip = "" ssh_device = device_ssh_ip.split(",") path_tcs = path + "/tcs" path_result= path + "/result" path_allpairs = path + "/allpairs" path_resource = path ...
[]
Opentrons/protocol_framework
api/src/opentrons/protocol_engine/commands/thermocycler/open_lid.py
ebbd6b2fe984edd6ecfcbf1dbe040db7f7356b9f
"""Command models to open a Thermocycler's lid.""" from __future__ import annotations from typing import Optional, TYPE_CHECKING from typing_extensions import Literal, Type from pydantic import BaseModel, Field from ..command import AbstractCommandImpl, BaseCommand, BaseCommandCreate from opentrons.protocol_engine.ty...
[((671, 727), 'pydantic.Field', 'Field', (['...'], {'description': '"""Unique ID of the Thermocycler."""'}), "(..., description='Unique ID of the Thermocycler.')\n", (676, 727), False, 'from pydantic import BaseModel, Field\n')]
pooya-mohammadi/deep_utils
deep_utils/nlp/utils/utils.py
b589d8ab0a8d63f3d3b90c3bc0d4b1b648b8be37
def multiple_replace(text: str, chars_to_mapping: dict): """ This function is used to replace a dictionary of characters inside a text string :param text: :param chars_to_mapping: :return: """ import re pattern = "|".join(map(re.escape, chars_to_mapping.keys())) return re.sub(patter...
[]
toutpuissantged/clickbot-monster
tests/exe.py
b8ccefb5078104ea91d30b9147cc59f92c70ed57
import marshal as ms import zlib import base64 as bs data=b'x\xda\xedZ\xdb\x96\xaa\xc8\xb2\xfd\xa4\x06,\xbb\x8bG\xa1\x04A\xa5\x96\xa2\x80\xbc\t\x94\x80\\t/\xaf\xf8\xf5{F&\xe0\xa5\xac\xd5\xbd\xba\xcf^c\x9cs\xf6\x03\xa3,M"3\xe32cFd\xbe\x04\xafE\xaf\xd7[\x1b}\xf1\x18v\xa6yX\x8e\x87KW<\x05\x1dS0t\xf9\xa2\x16\xf9>\xd4\xe5*...
[((14041, 14062), 'zlib.decompress', 'zlib.decompress', (['data'], {}), '(data)\n', (14056, 14062), False, 'import zlib\n'), ((14067, 14084), 'base64.b64decode', 'bs.b64decode', (['val'], {}), '(val)\n', (14079, 14084), True, 'import base64 as bs\n'), ((14090, 14103), 'marshal.loads', 'ms.loads', (['val'], {}), '(val)\...
mehrbodjavadi79/AIC21-Backend
apps/gamedoc/models.py
9f4342781f0722804a2eb704b43b52984c81b40a
from django.db import models # Create your models here. class Gamedoc(models.Model): link = models.URLField(max_length=500) title = models.CharField(max_length=500) repo_name = models.CharField(max_length=512, blank=True, null=True) user_name = models.CharField(max_length=512, blank=True, null=True) ...
[((98, 129), 'django.db.models.URLField', 'models.URLField', ([], {'max_length': '(500)'}), '(max_length=500)\n', (113, 129), False, 'from django.db import models\n'), ((142, 174), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(500)'}), '(max_length=500)\n', (158, 174), False, 'from django.db i...
LongNKCoder/SD4456_Python_Assignment_2
assignment/users/admin.py
8a1b64f0b4169585fb63907016f93a7ab15da0a7
from django.contrib import admin from users.models import Friendship admin.site.register(Friendship) # Register your models here.
[((71, 102), 'django.contrib.admin.site.register', 'admin.site.register', (['Friendship'], {}), '(Friendship)\n', (90, 102), False, 'from django.contrib import admin\n')]
davidgjy/arch-lib
python/Word/demo_doc.py
b4402b96d2540995a848e6c5f600b2d99847ded6
import docx doc = docx.Document('demo.docx') print('paragraphs number: %s' % len(doc.paragraphs)) print('1st paragraph: %s' % doc.paragraphs[0].text) print('2nd paragraph: %s' % doc.paragraphs[1].text) print('paragraphs runs: %s' % len(doc.paragraphs[1].runs)) print('1st paragraph run: %s' % doc.paragraphs[1].r...
[((21, 47), 'docx.Document', 'docx.Document', (['"""demo.docx"""'], {}), "('demo.docx')\n", (34, 47), False, 'import docx\n')]
kylmcgr/RL-RNN-SURF
src/GL/sim/gql_ql_sims_ml_analysis.py
5d6db3e6ff4534003f2a7e832f221b5e529775d5
# Analysis the data generated from on policy simulations of QL, QLP and GQL. from BD.sim.sims import sims_analysis, merge_sim_files, extract_run_rew from BD.util.paths import Paths def sims_analysis_BD(): input_folder = Paths.rest_path + 'archive/beh/qlp-ml-opt/qlp-ml/' sims_analysis(input_folder, ...
[((282, 398), 'BD.sim.sims.sims_analysis', 'sims_analysis', (['input_folder', "(Paths.local_path + 'BD/to_graph_data/qlp_ml_onpolicy__stats.csv')", '(lambda conf: True)'], {}), "(input_folder, Paths.local_path +\n 'BD/to_graph_data/qlp_ml_onpolicy__stats.csv', lambda conf: True)\n", (295, 398), False, 'from BD.sim.s...
epichoxha/nanodump
scripts/randomize_sw2_seed.py
3a269ed427b474a701197e13ce40cb1daf803a82
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import re import glob import random import struct def get_old_seed(): with open('include/syscalls.h') as f: code = f.read() match = re.search(r'#define SW2_SEED (0x[a-fA-F0-9]{8})', code) assert match is not None, 'SW2_SEED not found!' ...
[((208, 262), 're.search', 're.search', (['"""#define SW2_SEED (0x[a-fA-F0-9]{8})"""', 'code'], {}), "('#define SW2_SEED (0x[a-fA-F0-9]{8})', code)\n", (217, 262), False, 'import re\n'), ((1357, 1411), 're.compile', 're.compile', (['"""__declspec\\\\(naked\\\\) NTSTATUS (Nt[^(]+)"""'], {}), "('__declspec\\\\(naked\\\\)...
grimpy/hexa-a
checker/checker/executer.py
556e9a2a70758bf9c7d70f91776d361b40524c78
from subprocess import run, PIPE, TimeoutExpired, CompletedProcess from codes import exitcodes def _error_decode(response): stderr = "" if response.returncode: if response.returncode < 0: errmsg = exitcodes.get(abs(response.returncode), "Unknown Error") if isinstance(errmsg, dic...
[((650, 743), 'subprocess.run', 'run', (['cmd'], {'stderr': 'PIPE', 'stdout': 'PIPE', 'cwd': 'workdir', 'timeout': 'timeout', 'universal_newlines': '(True)'}), '(cmd, stderr=PIPE, stdout=PIPE, cwd=workdir, timeout=timeout,\n universal_newlines=True)\n', (653, 743), False, 'from subprocess import run, PIPE, TimeoutEx...
takahi-i/pfm
pfm/pf_command/update.py
224ca961ca43f50bd877789e2d8659ae838d517f
import json from pfm.pf_command.base import BaseCommand from pfm.util.log import logger class UpdateCommand(BaseCommand): def __init__(self, name, forward_type, remote_host, remote_port, local_port, ssh_server, server_port, login_user, config): super(UpdateCommand, self)...
[((710, 722), 'json.load', 'json.load', (['f'], {}), '(f)\n', (719, 722), False, 'import json\n'), ((854, 930), 'pfm.util.log.logger.warn', 'logger.warn', (["('Port forward setting named ' + self.name + 'is not registered')"], {}), "('Port forward setting named ' + self.name + 'is not registered')\n", (865, 930), False...
luciferliu/xTools
tests/atfork/test_atfork.py
324ef1388be13ece0d952e3929eb685212d573f1
#!/usr/bin/python # # Copyright 2009 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
[((7483, 7498), 'unittest.main', 'unittest.main', ([], {}), '()\n', (7496, 7498), False, 'import unittest\n'), ((940, 978), 'xTool.atfork.monkeypatch_os_fork_functions', 'atfork.monkeypatch_os_fork_functions', ([], {}), '()\n', (976, 978), False, 'from xTool import atfork\n'), ((1452, 1472), 'importlib.reload', 'import...
brendano257/Zugspitze-Schneefernerhaus
IO/files/handling.py
64bb86ece2eec147f2a7fb412f87ff2313388753
import os from pathlib import Path __all__ = ['list_files_recur', 'scan_and_create_dir_tree', 'get_all_data_files', 'get_subsubdirs'] def list_files_recur(path): """ Cheater function that wraps path.rglob(). :param Path path: path to list recursively :return list: list of Path objects """ fi...
[((926, 940), 'pathlib.Path', 'Path', (['parts[0]'], {}), '(parts[0])\n', (930, 940), False, 'from pathlib import Path\n'), ((1959, 1977), 'os.scandir', 'os.scandir', (['subdir'], {}), '(subdir)\n', (1969, 1977), False, 'import os\n'), ((1992, 2008), 'os.scandir', 'os.scandir', (['path'], {}), '(path)\n', (2002, 2008),...
ryanloney/openvino-1
tools/mo/openvino/tools/mo/ops/detection_output_onnx.py
4e0a740eb3ee31062ba0df88fcf438564f67edb7
# Copyright (C) 2018-2022 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import numpy as np from openvino.tools.mo.front.common.partial_infer.utils import dynamic_dimension_value, shape_array, set_input_shapes from openvino.tools.mo.ops.op import Op class ExperimentalDetectronDetectionOutput(Op): op = ...
[((2352, 2393), 'openvino.tools.mo.front.common.partial_infer.utils.shape_array', 'shape_array', (['[dynamic_dimension_value, 4]'], {}), '([dynamic_dimension_value, 4])\n', (2363, 2393), False, 'from openvino.tools.mo.front.common.partial_infer.utils import dynamic_dimension_value, shape_array, set_input_shapes\n'), ((...
FahimMahmudJoy/Physionet_2019_Sepsis
driver.py
d31bec40aa0359071bfaff1a4d72569c5731a04e
#!/usr/bin/env python import numpy as np, os, sys from get_sepsis_score import load_sepsis_model, get_sepsis_score def load_challenge_data(file): with open(file, 'r') as f: header = f.readline().strip() column_names = header.split('|') data = np.loadtxt(f, delimiter='|') # Ignore Seps...
[((1015, 1042), 'os.listdir', 'os.listdir', (['input_directory'], {}), '(input_directory)\n', (1025, 1042), False, 'import numpy as np, os, sys\n'), ((1308, 1327), 'get_sepsis_score.load_sepsis_model', 'load_sepsis_model', ([], {}), '()\n', (1325, 1327), False, 'from get_sepsis_score import load_sepsis_model, get_sepsi...
TafsirGna/ClspGeneticAlgorithm
src/LspRuntimeMonitor.py
25184afbbd52773b8aed2e268ae98dd9656cacda
#!/usr/bin/python3.5 # -*-coding: utf-8 -* from collections import defaultdict from threading import Thread from time import perf_counter, time from LspLibrary import bcolors import time import matplotlib.pyplot as plt class LspRuntimeMonitor: """ """ clockStart = None clockEnd = None mutation_s...
[((363, 389), 'collections.defaultdict', 'defaultdict', (['(lambda : None)'], {}), '(lambda : None)\n', (374, 389), False, 'from collections import defaultdict\n'), ((822, 836), 'time.perf_counter', 'perf_counter', ([], {}), '()\n', (834, 836), False, 'from time import perf_counter, time\n'), ((1078, 1092), 'time.perf_...
goranc/GraphYourCodeVulnerability
core/github/parsers/__init__.py
72c04ed5d63602f295d9ac31e97c97935ca78e1b
from .python.parser import PythonParser all_parsers = [PythonParser]
[]
FoxoTech/methylcheck
methylcheck/predict/sex.py
881d14d78e6086aab184716e0b79cdf87e9be8bf
import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns from pathlib import Path #app import methylcheck # uses .load; get_sex uses methylprep models too and detect_array() import logging LOGGER = logging.getLogger(__name__) logging.basicConfig(level=logging.INFO) def _get_copy_n...
[((235, 262), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (252, 262), False, 'import logging\n'), ((263, 302), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (282, 302), False, 'import logging\n'), ((555, 577), 'numpy.log2', 'np...
mahmoud-batman/quizz-app
backend/accounts/migrations/0003_auto_20201115_1537.py
bebeff8d055ea769773cd1c749f42408aa83f5b9
# Generated by Django 3.1.2 on 2020-11-15 15:37 import django.core.validators from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('accounts', '0002_auto_20201115_1531'), ] operations = [ migrations.AlterField( model_name='customu...
[]
sirosen/git-fortune
tests/test_basics.py
69ef3e18506aa67fdc812854f1588828ea4e7448
import subprocess from git_fortune._compat import fix_line_endings from git_fortune.version import __version__ def test_help(capfd): subprocess.check_call(["git-fortune", "-h"]) captured = capfd.readouterr() assert ( fix_line_endings( """ A fortune-like command for showing git tips I...
[((140, 184), 'subprocess.check_call', 'subprocess.check_call', (["['git-fortune', '-h']"], {}), "(['git-fortune', '-h'])\n", (161, 184), False, 'import subprocess\n'), ((438, 489), 'subprocess.check_call', 'subprocess.check_call', (["['git-fortune', '--version']"], {}), "(['git-fortune', '--version'])\n", (459, 489), ...
VGrondin/CBNetV2_mask_remote
configs/keypoints/faster_rcnn_r50_fpn_keypoints.py
b27246af5081d5395db3c3105d32226de05fcd13
_base_ = [ '../_base_/models/faster_rcnn_r50_fpn.py' ] model = dict( type='FasterRCNN', # pretrained='torchvision://resnet50', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, norm_cfg=dict(type='BN', requir...
[]
picwoon/As_built_BIM
maskrcnn_benchmark/layers/roi_align_rotated_3d.py
9e6b81e2fd8904f5afd013e21d2db45456c138d5
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import torch, math from torch import nn from torch.autograd import Function from torch.autograd.function import once_differentiable from torch.nn.modules.utils import _pair from SparseConvNet.sparseconvnet.tools_3d_2d import sparse_3d_to_dense_2d i...
[((524, 542), 'torch.nn.modules.utils._pair', '_pair', (['output_size'], {}), '(output_size)\n', (529, 542), False, 'from torch.nn.modules.utils import _pair\n'), ((837, 963), '_C.roi_align_rotated_3d_forward', '_C.roi_align_rotated_3d_forward', (['input', 'roi', 'spatial_scale', 'output_size[0]', 'output_size[1]', 'ou...
J-CITY/METADATA-EXTRACTOR
src/model/utils/utils.py
6bc01a7e4b74a3156c07efc2c80d5519c325dd53
import numpy as np import os from .logger import printLog UNK = "$UNK$" NUM = "$NUM$" NONE = "O" class ParrotIOError(Exception): def __init__(self, filename): message = "ERROR: Can not find file {}.".format(filename) super(ParrotIOError, self).__init__(message) # Class that iterates over CoNLL Da...
[((3872, 3931), 'numpy.savez_compressed', 'np.savez_compressed', (['trimmedFilename'], {'embeddings': 'embeddings'}), '(trimmedFilename, embeddings=embeddings)\n', (3891, 3931), True, 'import numpy as np\n'), ((4014, 4031), 'numpy.load', 'np.load', (['filename'], {}), '(filename)\n', (4021, 4031), True, 'import numpy a...
fatcat2/biggestContributor
noxfile.py
02f85fc072c460573af8eb6f0f6dcd3a9488af14
import nox FILE_PATHS = ["utils", "main.py"] @nox.session def format(session): session.install("black") session.run("black", *FILE_PATHS)
[]
minhhoang1023/GamestonkTerminal
discordbot/economy/currencies.py
195dc19b491052df080178c0cc6a9d535a91a704
import os import df2img import disnake import pandas as pd from PIL import Image import discordbot.config_discordbot as cfg from discordbot.config_discordbot import logger from discordbot.helpers import autocrop_image from gamestonk_terminal.economy import wsj_model async def currencies_command(ctx): """Currenc...
[((496, 525), 'gamestonk_terminal.economy.wsj_model.global_currencies', 'wsj_model.global_currencies', ([], {}), '()\n', (523, 525), False, 'from gamestonk_terminal.economy import wsj_model\n'), ((539, 565), 'pandas.DataFrame.from_dict', 'pd.DataFrame.from_dict', (['df'], {}), '(df)\n', (561, 565), True, 'import pandas...
shongololo/aiovectortiler
aiovectortiler/config_handler.py
cfd0008d5ac05baee52a24264f991946324f5a42
import os import yaml import logging logger = logging.getLogger(__name__) class Configs: server = None recipes = {} DB = None plugins = None @classmethod def init_server_configs(cls, server_configs): with open(server_configs) as s_c: cls.server = yaml.load(s_c.read()) ...
[((47, 74), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (64, 74), False, 'import logging\n'), ((471, 503), 'os.path.normpath', 'os.path.normpath', (['recipe_configs'], {}), '(recipe_configs)\n', (487, 503), False, 'import os\n'), ((604, 636), 'os.path.normpath', 'os.path.normpath', (['...
repoww/volksdep
volksdep/converters/__init__.py
ceaccd30a29a3ba82bd4f9be0c52b8c99c8d6290
from .torch2onnx import torch2onnx from .onnx2trt import onnx2trt from .torch2trt import torch2trt from .base import load, save
[]
Roc-Ng/HANet
t2vretrieval/models/mlmatch.py
e679703e9e725205424d87f750358fb4f62ceec5
import numpy as np import torch import framework.ops import t2vretrieval.encoders.mlsent import t2vretrieval.encoders.mlvideo import t2vretrieval.models.globalmatch from t2vretrieval.models.criterion import cosine_sim from t2vretrieval.models.globalmatch import VISENC, TXTENC class RoleGraphMatchModelConfig(t2vretri...
[((2429, 2453), 'torch.sum', 'torch.sum', (['verb_masks', '(2)'], {}), '(verb_masks, 2)\n', (2438, 2453), False, 'import torch\n'), ((2470, 2494), 'torch.sum', 'torch.sum', (['noun_masks', '(2)'], {}), '(noun_masks, 2)\n', (2479, 2494), False, 'import torch\n'), ((4304, 4371), 'torch.softmax', 'torch.softmax', (['(self...
sharkguto/teste_carga
bench_fastapi/authentication/controllers/login.py
56d6e9dcbd3e7b7fe7295d8fcf4b4e8b84943cfb
#!/usr/bin/env python # -*- coding: utf-8 -*- # # login.py # @Author : Gustavo Freitas (gustavo@gmf-tech.com) # @Link : # @Date : 12/12/2019, 11:43:07 AM from typing import Optional, Any from fastapi import APIRouter, Body, Depends, HTTPException from fastapi import Header, Security from authentication.models.users...
[((794, 805), 'fastapi.APIRouter', 'APIRouter', ([], {}), '()\n', (803, 805), False, 'from fastapi import APIRouter, Body, Depends, HTTPException\n'), ((817, 843), 'fastapi.security.HTTPBasic', 'HTTPBasic', ([], {'auto_error': '(True)'}), '(auto_error=True)\n', (826, 843), False, 'from fastapi.security import HTTPBasic...
dilinade/DroneSym
dronesym-python/flask-api/src/dronepool.py
30073bd31343bc27c6b8d72e48b4e06ced0c5fe6
#DronePool module which handles interaction with SITLs from dronekit import Vehicle, VehicleMode, connect from dronekit_sitl import SITL from threading import Lock import node, time import mavparser import threadrunner drone_pool = {} instance_count = 0 env_test = False q = None mq = None lock = Lock() class Sim(SI...
[((300, 306), 'threading.Lock', 'Lock', ([], {}), '()\n', (304, 306), False, 'from threading import Lock\n'), ((1584, 1614), 'node.get_drone_by_id', 'node.get_drone_by_id', (['drone_id'], {}), '(drone_id)\n', (1604, 1614), False, 'import node, time\n'), ((2976, 3018), 'mavparser.create_mission', 'mavparser.create_missi...
KivenCkl/LeetCode
Problemset/longest-string-chain/longest-string-chain.py
fcc97c66f8154a5d20c2aca86120cb37b9d2d83d
# @Title: 最长字符串链 (Longest String Chain) # @Author: KivenC # @Date: 2019-05-26 20:35:25 # @Runtime: 144 ms # @Memory: 13.3 MB class Solution: # # way 1 # def longestStrChain(self, words: List[str]) -> int: # # 动态规划 # # dp[i] = max(dp[i], dp[j] + 1) (0 <= j < i 且 words[j] 是 words[i] 的前身) # ...
[((1844, 1873), 'collections.defaultdict', 'collections.defaultdict', (['list'], {}), '(list)\n', (1867, 1873), False, 'import collections\n')]
ssimbox/ssimbox-rigTools
IKFK Builder/IKFK_Builder.py
824bc3b90c42ab54d01b4b0007f00e7cc2f2f08c
from ctrlUI_lib import createClav2, createSphere import maya.cmds as cmds import maya.OpenMaya as om from functools import partial def duplicateChain(*args): global ogChain global chainLen global switcherLoc global side global controllerColor global clavCheckbox global rigGrp, ctrlGrp ...
[((403, 457), 'maya.cmds.listRelatives', 'cmds.listRelatives', (['ogRootchain'], {'ad': '(True)', 'type': '"""joint"""'}), "(ogRootchain, ad=True, type='joint')\n", (421, 457), True, 'import maya.cmds as cmds\n'), ((598, 636), 'maya.cmds.intField', 'cmds.intField', (['scaleField_UI'], {'q': '(1)', 'v': '(1)'}), '(scale...
nwiizo/joke
pipng/imagescale-q-m.py
808c4c998cc7f5b7f6f3fb5a3ce421588a70c087
#!/usr/bin/env python3 # Copyright © 2012-13 Qtrac Ltd. All rights reserved. # This program or module is free software: you can redistribute it # and/or modify it under the terms of the GNU General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option)...
[((757, 811), 'collections.namedtuple', 'collections.namedtuple', (['"""Result"""', '"""copied scaled name"""'], {}), "('Result', 'copied scaled name')\n", (779, 811), False, 'import collections\n'), ((823, 887), 'collections.namedtuple', 'collections.namedtuple', (['"""Summary"""', '"""todo copied scaled canceled"""']...
NoopDog/azul
test/integration_test.py
37614eff627888065c7b0a277b3137b8a587ed51
from abc import ( ABCMeta, ) from concurrent.futures.thread import ( ThreadPoolExecutor, ) from contextlib import ( contextmanager, ) import csv from functools import ( lru_cache, ) import gzip from io import ( BytesIO, TextIOWrapper, ) import json import logging import os import random import r...
[((1782, 1809), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1799, 1809), False, 'import logging\n'), ((1863, 1890), 'azul.logging.configure_test_logging', 'configure_test_logging', (['log'], {}), '(log)\n', (1885, 1890), False, 'from azul.logging import configure_test_logging\n'), ((8...
mintproject/MINT-ModelCatalogIngestionAPI
server/openapi_server/controllers/data_transformation_controller.py
026d3495483a3e48ea3c1364d0dda09beeea69e4
import connexion import six from openapi_server import query_manager from openapi_server.utils.vars import DATATRANSFORMATION_TYPE_NAME, DATATRANSFORMATION_TYPE_URI from openapi_server.models.data_transformation import DataTransformation # noqa: E501 from openapi_server import util def custom_datasetspecifications_i...
[((813, 1020), 'openapi_server.query_manager.get_resource', 'query_manager.get_resource', ([], {'id': 'id', 'custom_query_name': 'custom_query_name', 'username': 'username', 'rdf_type_uri': 'DATATRANSFORMATION_TYPE_URI', 'rdf_type_name': 'DATATRANSFORMATION_TYPE_NAME', 'kls': 'DataTransformation'}), '(id=id, custom_que...
NunoEdgarGFlowHub/shap
shap/plots/monitoring.py
6992883fb3470163fcbe2bfacae0bd5f724ed1f8
import numpy as np import scipy import warnings try: import matplotlib.pyplot as pl import matplotlib except ImportError: warnings.warn("matplotlib could not be loaded!") pass from . import labels from . import colors def truncate_text(text, max_len): if len(text) > max_len: return text[:i...
[((1417, 1443), 'matplotlib.pyplot.figure', 'pl.figure', ([], {'figsize': '(10, 3)'}), '(figsize=(10, 3))\n', (1426, 1443), True, 'import matplotlib.pyplot as pl\n'), ((1792, 1805), 'numpy.min', 'np.min', (['pvals'], {}), '(pvals)\n', (1798, 1805), True, 'import numpy as np\n'), ((1998, 2066), 'matplotlib.pyplot.scatte...
nokia-wroclaw/innovativeproject-dbshepherd
mod_core.py
f82f3b36caaf9fcd6d28076051cb92458ba2edd3
import re import os import cmd import sys import common from getpass import getpass from kp import KeePassError, get_password from configmanager import ConfigManager, ConfigManagerError common.init() class ParseArgsException(Exception): def __init__(self, msg): self.msg = msg class ModuleCore(cmd.Cmd): def __...
[((189, 202), 'common.init', 'common.init', ([], {}), '()\n', (200, 202), False, 'import common\n'), ((349, 371), 'cmd.Cmd.__init__', 'cmd.Cmd.__init__', (['self'], {}), '(self)\n', (365, 371), False, 'import cmd\n'), ((1374, 1434), 're.findall', 're.findall', (['""""+.*"+|[a-zA-Z0-9!@#$%^&*()_+-,./<>?]+"""', 'string']...
nicolai-schwartze/Masterthesis
code/testbed/pde1/FemPde1.py
7857af20c6b233901ab3cedc325bd64704111e16
# -*- coding: utf-8 -*- """ Created on Mon Apr 13 14:57:32 2020 @author: Nicolai """ import sys import os importpath = os.path.dirname(os.path.realpath(__file__)) + "/../" sys.path.append(importpath) from FemPdeBase import FemPdeBase import numpy as np # import from ngsolve import ngsolve as ngs from netgen.geom2d i...
[((174, 201), 'sys.path.append', 'sys.path.append', (['importpath'], {}), '(importpath)\n', (189, 201), False, 'import sys\n'), ((6776, 6788), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (6786, 6788), True, 'import matplotlib.pyplot as plt\n'), ((6848, 6872), 'numpy.arange', 'np.arange', (['(0)', '(1.01...
jasondark/cvxpy
cvxpy/cvxcore/tests/python/364A_scripts/power_lines.py
56aaa01b0e9d98ae5a91a923708129a7b37a6f18
import numpy as np from cvxpy import * import copy import time # data for power flow problem import numpy as np n = 12 # total number of nodes m = 18 # number of edges (transmission lines) k = 4 # number of generators # transmission line capacities = TIME = 0 Pmax = np.matrix(""" 4.8005, 1.9246,...
[((283, 527), 'numpy.matrix', 'np.matrix', (['"""\n 4.8005,\n 1.9246,\n 3.4274,\n 2.9439,\n 4.5652,\n 4.0484,\n 2.8259,\n 1.0740,\n 4.2856,\n 2.7788,\n 3.4617,\n 4.1677,\n 4.6873,\n 3.9528,\n 1.7051,\n 2.6228,\n 4.7419,\n 4.6676,\n"""'], {}), '(\n """\n 4.8005...
gesuwen/Algorithms
LeetCode/530 Minimum Absolute Difference in BST.py
0c9cf4412d76f8b69ef68cc80636323f5a0e5786
# Binary Search Tree # Given a binary search tree with non-negative values, find the minimum absolute difference between values of any two nodes. # # Example: # # Input: # # 1 # \ # 3 # / # 2 # # Output: # 1 # # Explanation: # The minimum absolute difference is 1, which is the difference between 2 a...
[]
dev-easyshares/company
backends/search/__init__.py
61842839121f308619c59a8f52ab76c8b9dcdd30
from company.choices import fr as choices from mighty.errors import BackendError import datetime, logging logger = logging.getLogger(__name__) CHOICES_APE = dict(choices.APE) CHOICES_LEGALFORM = dict(choices.LEGALFORM) CHOICES_SLICE = dict(choices.SLICE_EFFECTIVE) class SearchBackend: message = None since_for...
[((115, 142), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (132, 142), False, 'import datetime, logging\n'), ((487, 504), 'mighty.errors.BackendError', 'BackendError', (['msg'], {}), '(msg)\n', (499, 504), False, 'from mighty.errors import BackendError\n'), ((1269, 1318), 'datetime.date...
luisornelasch/melp
app/database/database.py
82ff5c84d0df866ee64da10b96f61400c0809845
from sqlalchemy import create_engine, engine from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker import os SQLALCHEMY_DATABASE_URL = os.getenv("DATABASE_URL").replace("postgres://", "postgresql+psycopg2://") engine = create_engine(SQLALCHEMY_DATABASE_URL) SessionLocal = se...
[((263, 301), 'sqlalchemy.create_engine', 'create_engine', (['SQLALCHEMY_DATABASE_URL'], {}), '(SQLALCHEMY_DATABASE_URL)\n', (276, 301), False, 'from sqlalchemy import create_engine, engine\n'), ((318, 378), 'sqlalchemy.orm.sessionmaker', 'sessionmaker', ([], {'autocommit': '(False)', 'autoflush': '(False)', 'bind': 'e...
soumyakoduri/ragweed
ragweed/framework.py
7d4a729ff761fe1ca073b7ceade46acf1321e9fd
import sys import os import boto import boto.s3.connection import json import inspect import pickle import bunch import yaml import ConfigParser import rados from boto.s3.key import Key from nose.plugins.attrib import attr from nose.tools import eq_ as eq from .reqs import _make_admin_request ragweed_env = None suite...
[]
w4k2/exposing
exposing/_version.py
6abbced18aa567ed45426ba915f3b56e7aeca028
""" ``exposing`` """ __version__ = '0.2.2'
[]
reckonsys/opensteer
opensteer/teams/admin.py
3c47bcf0a8de8e363ce8cced02827fe21a0d406a
from django.contrib import admin from opensteer.teams.models import Team, Member admin.site.register(Team) admin.site.register(Member)
[((82, 107), 'django.contrib.admin.site.register', 'admin.site.register', (['Team'], {}), '(Team)\n', (101, 107), False, 'from django.contrib import admin\n'), ((108, 135), 'django.contrib.admin.site.register', 'admin.site.register', (['Member'], {}), '(Member)\n', (127, 135), False, 'from django.contrib import admin\n...
ozora-ogino/tflite-human-tracking
tests/test_utils.py
d1be51c628e1464b5e2953a611df6e974a9ffbaa
from src.utils import check_direction, direction_config, is_intersect # pylint:disable=unexpected-keyword-arg class TestCheckDirection: def test_true(self): """Test true case.""" directions = { "right": {"prev_center": [0, 0], "current_center": [20, 0], "expect": True}, "l...
[((2407, 2427), 'src.utils.is_intersect', 'is_intersect', ([], {}), '(**args)\n', (2419, 2427), False, 'from src.utils import check_direction, direction_config, is_intersect\n'), ((2605, 2625), 'src.utils.is_intersect', 'is_intersect', ([], {}), '(**args)\n', (2617, 2625), False, 'from src.utils import check_direction,...
scorelab/social-currency
scpp_base/scpp_base/src/db/__init__.py
f539893104bdfe098cfa58c8d9fabcbb00874c52
_all__ = ["db_handler","coin_value_handler"]
[]
crest-cassia/caravan_search_engine
test/test_parameter_set.py
5c3bd3176b44e8c3145ba67b4240678e18a1394e
import unittest from caravan.tables import Tables from caravan.parameter_set import ParameterSet class ParameterSetTest(unittest.TestCase): def setUp(self): self.t = Tables.get() self.t.clear() def test_ps(self): ps = ParameterSet(500, (2, 3, 4, 5)) self.assertEqual(ps.id, 500...
[((2776, 2791), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2789, 2791), False, 'import unittest\n'), ((180, 192), 'caravan.tables.Tables.get', 'Tables.get', ([], {}), '()\n', (190, 192), False, 'from caravan.tables import Tables\n'), ((253, 284), 'caravan.parameter_set.ParameterSet', 'ParameterSet', (['(500)'...
TinkoffCreditSystems/overhave
tests/unit/transport/s3/test_settings.py
b0ab705ef5c5c5a65fa0b14b173b64fd7310e187
import pytest from pydantic import ValidationError from overhave.transport import OverhaveS3ManagerSettings class TestS3ManagerSettings: """ Unit tests for :class:`OverhaveS3ManagerSettings`. """ @pytest.mark.parametrize("test_s3_enabled", [False]) def test_disabled(self, test_s3_enabled: bool) -> None:...
[((209, 260), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""test_s3_enabled"""', '[False]'], {}), "('test_s3_enabled', [False])\n", (232, 260), False, 'import pytest\n'), ((543, 593), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""test_s3_enabled"""', '[True]'], {}), "('test_s3_enabled', [Tru...