repo_name stringlengths 7 94 | repo_path stringlengths 4 237 | repo_head_hexsha stringlengths 40 40 | content stringlengths 10 680k | apis stringlengths 2 840k |
|---|---|---|---|---|
jsayles/Porthole | porthole/management/commands/brocade.py | a4176aad632e319eba88dfbe40cb96a4c437725d | from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
from porthole import models, brocade
class Command(BaseCommand):
help = "Command the Brocade switch stacks"
args = ""
requires_system_checks = False
def add_arguments(self, parser):
parser.add_... | [((25, 17, 25, 49), 'porthole.models.SwitchStack.objects.all', 'models.SwitchStack.objects.all', ({}, {}), '()', False, 'from porthole import models, brocade\n'), ((26, 20, 26, 106), 'porthole.brocade.SwitchStack', 'brocade.SwitchStack', (), '', False, 'from porthole import models, brocade\n')] |
willjschmitt/joulia-webserver | joulia/unit_conversions_test.py | 712decb749c2d1bda71af49ecab245378bf30078 | """Tests joulia.unit_conversions.
"""
from django.test import TestCase
from joulia import unit_conversions
class GramsToPoundsTest(TestCase):
def test_grams_to_pounds(self):
self.assertEquals(unit_conversions.grams_to_pounds(1000.0), 2.20462)
class GramsToOuncesTest(TestCase):
def test_grams_to_ou... | [((11, 26, 11, 66), 'joulia.unit_conversions.grams_to_pounds', 'unit_conversions.grams_to_pounds', ({(11, 59, 11, 65): '(1000.0)'}, {}), '(1000.0)', False, 'from joulia import unit_conversions\n'), ((16, 26, 16, 66), 'joulia.unit_conversions.grams_to_ounces', 'unit_conversions.grams_to_ounces', ({(16, 59, 16, 65): '(10... |
zarif007/Blog-site | Django/blog/tests.py | e20e3f73fedbd7acb2f3d22398c36f3dcd4f88b4 | from django.contrib.auth.models import User
from django.test import TestCase
from blog.models import Category, Post
class Test_Create_Post(TestCase):
@classmethod
def setUpTestData(cls):
test_category = Category.objects.create(name='django')
testuser1 = User.objects.create_user(
... | [((11, 24, 11, 62), 'blog.models.Category.objects.create', 'Category.objects.create', (), '', False, 'from blog.models import Category, Post\n'), ((12, 20, 14, 9), 'django.contrib.auth.models.User.objects.create_user', 'User.objects.create_user', (), '', False, 'from django.contrib.auth.models import User\n'), ((15, 20... |
kreshuklab/hylfm-net | scripts/train_presets/beads.py | 9f1013640e40e998674b65176023367b1e978782 | from pathlib import Path
from hylfm.hylfm_types import (
CriterionChoice,
DatasetChoice,
LRSchedThresMode,
LRSchedulerChoice,
MetricChoice,
OptimizerChoice,
PeriodUnit,
)
from hylfm.model import HyLFM_Net
from hylfm.train import train
if __name__ == "__main__":
train(
dataset=... | [((17, 4, 107, 5), 'hylfm.train.train', 'train', (), '', False, 'from hylfm.train import train\n')] |
CsekM8/LVH-THESIS | TrainingPreprocess/filtered_to_dataset.py | b0dc60daaf0825ad43951e6895289da4e3ed911b | import os
import pickle
from PIL import Image
class PatientToImageFolder:
def __init__(self, sourceFolder):
self.sourceFolder = sourceFolder
# How many patient with contrast SA for each pathology (used for classification)
self.contrastSApathologyDict = {}
# How many patient with c... | [((35, 20, 35, 49), 'os.listdir', 'os.listdir', ({(35, 31, 35, 48): 'self.sourceFolder'}, {}), '(self.sourceFolder)', False, 'import os\n'), ((85, 18, 85, 43), 'PIL.Image.fromarray', 'Image.fromarray', ({(85, 34, 85, 42): 'image_2d'}, {}), '(image_2d)', False, 'from PIL import Image\n'), ((92, 29, 92, 65), 'os.path.joi... |
Iolaum/Phi1337 | scripts/pipeline/a06a_submission.py | c73b01cb85c0187ed5c23c672d4f3d05a6934a9f | import pandas as pd
import numpy as np
import pickle
from sklearn.cross_validation import train_test_split
from sklearn.linear_model import LinearRegression
from sklearn.metrics import mean_squared_error
from math import sqrt
from sklearn.svm import SVR
from sklearn.svm import LinearSVR
from sklearn.preprocessing imp... | [((32, 16, 32, 73), 'pandas.read_pickle', 'pd.read_pickle', ({(32, 31, 32, 72): '"""../../dataset/score_df_final_tst.pickle"""'}, {}), "('../../dataset/score_df_final_tst.pickle')", True, 'import pandas as pd\n'), ((38, 5, 38, 27), 'numpy.array', 'np.array', ({(38, 14, 38, 26): 'score_df_tst'}, {}), '(score_df_tst)', T... |
Carter-eng/SeniorDesign | Data Gathering/PythonPlottingScript.py | 5305531d251ea749f909cc09eb1ccfe21714cebd | import numpy as np
import serial
import time
import matplotlib.pyplot as plt
def getData():
ser = serial.Serial('/dev/ttyACM7', 9600)
sensorReadings = []
start = time.time()
current = time.time()
while current - start < 10:
data =ser.readline()
sensorReadings.append(floa... | [((7, 10, 7, 45), 'serial.Serial', 'serial.Serial', ({(7, 24, 7, 38): '"""/dev/ttyACM7"""', (7, 40, 7, 44): '9600'}, {}), "('/dev/ttyACM7', 9600)", False, 'import serial\n'), ((9, 12, 9, 23), 'time.time', 'time.time', ({}, {}), '()', False, 'import time\n'), ((10, 14, 10, 25), 'time.time', 'time.time', ({}, {}), '()', ... |
robinvoogt/text-sdk-python | Examples/Rich_Message_Example.py | 1acd624991f396cc673dad22cfa3272b4b3fb53b | from CMText.TextClient import TextClient
# Message to be send
message = 'Examples message to be send'
# Media to be send
media = {
"mediaName": "conversational-commerce",
"mediaUri": "https://www.cm.com/cdn/cm/cm.png",
"mimeType": "image/png"
}
# AllowedChannels in this ca... | [((20, 9, 20, 42), 'CMText.TextClient.TextClient', 'TextClient', (), '', False, 'from CMText.TextClient import TextClient\n')] |
Dmitry450/asynciogame | client/audio.py | 47a2a118155805db37f2c3bd916bd6c68c504cff | import pygame
from pygame.math import Vector2
class Sound:
def __init__(self, manager, snd, volume=1.0):
self.manager = manager
self.snd = pygame.mixer.Sound(snd)
self.snd.set_volume(1.0)
self.ttl = snd.get_length()
self.playing = True
... | [((9, 19, 9, 42), 'pygame.mixer.Sound', 'pygame.mixer.Sound', ({(9, 38, 9, 41): 'snd'}, {}), '(snd)', False, 'import pygame\n'), ((31, 23, 31, 40), 'pygame.math.Vector2', 'Vector2', ({(31, 31, 31, 39): 'position'}, {}), '(position)', False, 'from pygame.math import Vector2\n'), ((66, 32, 66, 56), 'pygame.mixer.Sound', ... |
MmeK/ganjoor-telegram-bot | bot/ganjoor/category_choose.py | 3992bdd860ea3626dccd79b0c1993a3662e92aa5 |
# Copyright 2021 Mohammad Kazemi <kazemi.me.222@gmail.com>.
# SPDX-License-Identifier: MIT
# Telegram API framework core imports
from collections import namedtuple
from functools import partial
from ganjoor.ganjoor import Ganjoor
from telegram.ext import Dispatcher, CallbackContext
from telegram import Update
# Helper... | [((17, 9, 17, 29), 'utils.logger.get_logger', 'get_logger', ({(17, 20, 17, 28): '__name__'}, {}), '(__name__)', False, 'from utils.logger import get_logger\n'), ((18, 15, 18, 59), 'collections.namedtuple', 'namedtuple', ({(18, 26, 18, 40): '"""CallbackData"""', (18, 42, 18, 58): '"""menu_name doto"""'}, {}), "('Callbac... |
walterfan/snippets | python/util/md_utils.py | 62f87720c411093fcff888f25b338afd1d99a6f9 | import os
import sys
import struct
import re
import logging
logging.basicConfig(stream=sys.stderr, level=logging.DEBUG)
logger = logging.getLogger(__name__)
def list_to_md(str_list):
output = ""
for str in str_list:
output = output + "* %s \n" % str
return output
def str_to_md_list(the_str, sep)... | [((7, 0, 7, 59), 'logging.basicConfig', 'logging.basicConfig', (), '', False, 'import logging\n'), ((8, 9, 8, 36), 'logging.getLogger', 'logging.getLogger', ({(8, 27, 8, 35): '__name__'}, {}), '(__name__)', False, 'import logging\n')] |
Josverl/micropython-stubber | board/main.py | 3dc57ea9e957bd9f36fce6abfe051a2fa7ace522 | import uos as os
import time
def countdown():
for i in range(5, 0, -1):
print("start stubbing in {}...".format(i))
time.sleep(1)
import createstubs
# import stub_lvgl
try:
# only run import if no stubs yet
os.listdir("stubs")
print("stub folder was found, stubbing is not aut... | [((16, 4, 16, 23), 'uos.listdir', 'os.listdir', ({(16, 15, 16, 22): '"""stubs"""'}, {}), "('stubs')", True, 'import uos as os\n'), ((8, 8, 8, 21), 'time.sleep', 'time.sleep', ({(8, 19, 8, 20): '(1)'}, {}), '(1)', False, 'import time\n')] |
zipated/src | third_party/blink/tools/blinkpy/web_tests/breakpad/dump_reader_multipart_unittest.py | 2b8388091c71e442910a21ada3d97ae8bc1845d3 | # Copyright (C) 2013 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | [((55, 15, 55, 21), 'blinkpy.common.host.Host', 'Host', ({}, {}), '()', False, 'from blinkpy.common.host import Host\n'), ((56, 22, 56, 63), 'blinkpy.web_tests.breakpad.dump_reader_multipart.DumpReaderMultipart', 'DumpReaderMultipart', (), '', False, 'from blinkpy.web_tests.breakpad.dump_reader_multipart import DumpRea... |
SilverWingedSeraph/sws-dotfiles | scripts/emoji-to-scl.py | 6bee2b2ece03439101848673d6bcd9196359f7c4 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
from subprocess import Popen, PIPE
emojis="""⛑🏻 Helmet With White Cross, Type-1-2
⛑🏼 Helmet With White Cross, Type-3
⛑🏽 Helmet With White Cross, Type-4
⛑🏾 Helmet With White Cross, Type-5
⛑🏿 Helmet With White Cross, Type-6
💏🏻 Kiss, Type-1-2
💏🏼 Kiss, Type-3
💏🏽 Kiss,... | [] |
HubTou/ngc | src/ngc/main.py | 9917adfbaff61e7b20b9f06a4be6b51237e4e768 | #!/usr/bin/env python
""" ngc - n-grams count
License: 3-clause BSD (see https://opensource.org/licenses/BSD-3-Clause)
Author: Hubert Tournier
"""
import getopt
import logging
import os
import re
import string
import sys
import unicode2ascii
# Version string used by the what(1) and ident(1) commands:
ID = "@(#) $Id:... | [((82, 4, 82, 71), 'logging.basicConfig', 'logging.basicConfig', (), '', False, 'import logging\n'), ((83, 4, 83, 33), 'logging.disable', 'logging.disable', ({(83, 20, 83, 32): 'logging.INFO'}, {}), '(logging.INFO)', False, 'import logging\n'), ((256, 4, 256, 56), 'logging.debug', 'logging.debug', ({(256, 18, 256, 55):... |
rainzhop/ConvNetQuake | openquake.hazardlib/openquake/hazardlib/tests/gsim/campbell_2003_test.py | a3e6de3f7992eac72f1b9883fec36b8c7fdefd48 | # -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2012-2016 GEM Foundation
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the Licen... | [] |
khrapovs/sktime | sktime/regression/interval_based/_tsf.py | 1589d007ef5dbcdc1f42f2c8278919ebed516358 | # -*- coding: utf-8 -*-
"""Time Series Forest Regressor (TSF)."""
__author__ = ["Tony Bagnall", "kkoziara", "luiszugasti", "kanand77", "Markus Löning"]
__all__ = ["TimeSeriesForestRegressor"]
import numpy as np
from joblib import Parallel, delayed
from sklearn.ensemble._forest import ForestRegressor
from sklearn.tree... | [((74, 22, 74, 45), 'sklearn.tree.DecisionTreeRegressor', 'DecisionTreeRegressor', ({}, {}), '()', False, 'from sklearn.tree import DecisionTreeRegressor\n'), ((120, 9, 120, 33), 'sktime.series_as_features.base.estimators.interval_based._tsf._transform', '_transform', ({(120, 20, 120, 21): 'X', (120, 23, 120, 32): 'int... |
sebastiankruk/vectorc2 | vectorc2/vectorc2/settings.py | 13232cd63ebed32346fb4a669511b102b8ed24c0 | """
Django settings for vectorc2 project.
Copyright 2019 Sebastian Ryszard Kruk <vectorc2@kruk.me>
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-... | [((80, 13, 80, 44), 'os.path.join', 'os.path.join', ({(80, 26, 80, 34): 'BASE_DIR', (80, 36, 80, 43): '"""media"""'}, {}), "(BASE_DIR, 'media')", False, 'import os\n'), ((77, 4, 77, 36), 'os.path.join', 'os.path.join', ({(77, 17, 77, 25): 'BASE_DIR', (77, 27, 77, 35): '"""static"""'}, {}), "(BASE_DIR, 'static')", False... |
mikewoodson/ssl-transfer | datahandlers/wgisd.py | 524e2d57e9ffdbf0497cd4a1404eb1f85dc9fca7 | from torchvision.datasets.folder import pil_loader, accimage_loader, default_loader
from torch import Tensor
from pathlib import Path
from enum import Enum
from collections import namedtuple
from torchvision import transforms as T
import os
import numpy as np
import pdb
import functools
import torch.utils.data as dat... | [((62, 20, 62, 30), 'pathlib.Path', 'Path', ({(62, 25, 62, 29): 'root'}, {}), '(root)', False, 'from pathlib import Path\n'), ((161, 18, 161, 34), 'torch.zeros', 'torch.zeros', ({(161, 30, 161, 33): '[3]'}, {}), '([3])', False, 'import torch\n'), ((175, 18, 175, 34), 'torch.zeros', 'torch.zeros', ({(175, 30, 175, 33): ... |
nikhilgk/SimpleCV | SimpleCV/MachineLearning/query_imgs/get_imgs_geo_gps_search.py | ee64451c16db1f40b4da221115273020a6a7b01a | #!/usr/bin/python
#
# So this script is in a bit of a hack state right now.
# This script reads
#
#
#
# Graciously copied and modified from:
# http://graphics.cs.cmu.edu/projects/im2gps/flickr_code.html
#Image querying script written by Tamara Berg,
#and extended heavily James Hays
#9/26/2007 added dynamic timesli... | [] |
quguiliang/Machine-Learning-with-Spark-Second-Edition | Chapter04/python/2.0.0/com/sparksamples/util.py | 0ba131e6c15a3de97609c6cb5d976806ccc14f09 | import os
import sys
from pyspark.sql.types import *
PATH = "/home/ubuntu/work/ml-resources/spark-ml/data"
SPARK_HOME = "/home/ubuntu/work/spark-2.0.0-bin-hadoop2.7/"
os.environ['SPARK_HOME'] = SPARK_HOME
sys.path.append(SPARK_HOME + "/python")
from pyspark import SparkContext
from pyspark import SparkConf
from pyspa... | [((8, 0, 8, 39), 'sys.path.append', 'sys.path.append', ({(8, 16, 8, 38): "(SPARK_HOME + '/python')"}, {}), "(SPARK_HOME + '/python')", False, 'import sys\n'), ((15, 5, 15, 28), 'pyspark.SparkContext', 'SparkContext', (), '', False, 'from pyspark import SparkContext\n'), ((16, 8, 16, 24), 'pyspark.sql.SparkSession', 'Sp... |
Safemasks/safemasks-app | safemasks/resources/rest/router.py | 44c1cf16f81b15b74fa5eb38d36eaa078180e975 | """
"""
from rest_framework import routers
from safemasks.resources.rest.serializers import SupplierViewSet, TrustedSupplierViewSet
# Routers provide an easy way of automatically determining the URL conf.
ROUTER = routers.DefaultRouter()
ROUTER.register(r"suppliers", SupplierViewSet, "suppliers")
ROUTER.register(r"s... | [((9, 9, 9, 32), 'rest_framework.routers.DefaultRouter', 'routers.DefaultRouter', ({}, {}), '()', False, 'from rest_framework import routers\n')] |
jamesjer/zope.testrunner | src/zope/testrunner/formatter.py | af8bfec49d90613633b76e914a6f54884463ba94 | ##############################################################################
#
# Copyright (c) 2004-2008 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THI... | [((233, 8, 233, 26), 'sys.stdout.flush', 'sys.stdout.flush', ({}, {}), '()', False, 'import sys\n'), ((249, 8, 249, 26), 'sys.stdout.flush', 'sys.stdout.flush', ({}, {}), '()', False, 'import sys\n'), ((301, 8, 301, 26), 'sys.stdout.flush', 'sys.stdout.flush', ({}, {}), '()', False, 'import sys\n'), ((328, 8, 328, 27),... |
csisarep/groundwater_dashboard | waterApp/migrations/0011_auto_20210911_1043.py | 4f93d7b7c9fd6b48ace54e7b62cae717decc98d2 | # Generated by Django 2.2 on 2021-09-11 04:58
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('waterApp', '0010_auto_20210911_1041'),
]
operations = [
migrations.AlterField(
model_name='gwmonitoring',
name='id',
... | [((16, 18, 16, 72), 'django.db.models.BigAutoField', 'models.BigAutoField', (), '', False, 'from django.db import migrations, models\n')] |
shubhamtalbar96/geomstats | geomstats/geometry/stratified/__init__.py | 9c17ccede7e3f0fddf31487c59227c677216a2b9 | """The Stratified Space Geometry Package."""
| [] |
xmdy/h9eNi8F5Ut | src/exporter/management/commands/test_export.py | 4128d7cbc6105ec0fe69157bd88ef8e30415d6ca | from django.core.management import BaseCommand
import logging
# These two lines enable debugging at httplib level (requests->urllib3->http.client)
# You will see the REQUEST, including HEADERS and DATA, and RESPONSE with HEADERS but without DATA.
# The only thing missing will be the response.body which is not logged.
... | [((15, 0, 15, 21), 'logging.basicConfig', 'logging.basicConfig', ({}, {}), '()', False, 'import logging\n'), ((17, 15, 17, 61), 'logging.getLogger', 'logging.getLogger', ({(17, 33, 17, 60): '"""requests.packages.urllib3"""'}, {}), "('requests.packages.urllib3')", False, 'import logging\n'), ((16, 0, 16, 19), 'logging.g... |
ianthomas23/dask | dask/tests/test_highgraph.py | 7968e85e2edab95565ebbab1f936c9c549e29126 | from functools import partial
import os
import pytest
import dask
import dask.array as da
from dask.utils_test import inc
from dask.highlevelgraph import HighLevelGraph, BasicLayer, Layer
from dask.blockwise import Blockwise
from dask.array.utils import assert_eq
def test_visualize(tmpdir):
pytest.importorskip(... | [((67, 1, 67, 54), 'pytest.mark.parametrize', 'pytest.mark.parametrize', ({(67, 25, 67, 38): '"""inject_dict"""', (67, 40, 67, 53): '[True, False]'}, {}), "('inject_dict', [True, False])", False, 'import pytest\n'), ((91, 1, 91, 61), 'pytest.mark.parametrize', 'pytest.mark.parametrize', ({(91, 25, 91, 45): '"""use_laye... |
webpwnized/cryptography | transference.py | 52660c14aa71afe087cf380bb1e9d067fa639bc6 | # Requires pip install bitarray
from bitarray import bitarray
import argparse, math
def derive_transfer_function(pTransferFunctionString: str) -> list:
lTransferFunction = list(map(int, pTransferFunctionString.split(',')))
lTransferFunctionValid = True
lLengthTransferFunction = len(lTransferFunction)
... | [((21, 16, 21, 52), 'math.log', 'math.log', ({(21, 25, 21, 48): 'lLengthTransferFunction', (21, 50, 21, 51): '2'}, {}), '(lLengthTransferFunction, 2)', False, 'import argparse, math\n'), ((108, 17, 108, 145), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (), '', False, 'import argparse, math\n'), ((22, 20, 22, ... |
mjcaley/spamc | tests/test_client.py | 67c4f2b13d569238ea24794eb5253a1416226a2a | import pytest
from aiospamc.client import Client
from aiospamc.exceptions import (
BadResponse,
UsageException,
DataErrorException,
NoInputException,
NoUserException,
NoHostException,
UnavailableException,
InternalSoftwareException,
OSErrorException,
OSFileException,
CantCre... | [((56, 15, 56, 47), 'aiospamc.responses.Response', 'Response', ({}, {}), '(**parse_spy.spy_return)', False, 'from aiospamc.responses import Response\n'), ((64, 9, 64, 38), 'pytest.raises', 'pytest.raises', ({(64, 23, 64, 37): 'UsageException'}, {}), '(UsageException)', False, 'import pytest\n'), ((73, 9, 73, 42), 'pyte... |
tacaswell/sunpy | sunpy/conftest.py | 1e06d75408d1a621749a5d4e743ae44a31886100 | import os
import tempfile
import importlib
import pytest
import astropy
import astropy.config.paths
# Force MPL to use non-gui backends for testing.
try:
import matplotlib
except ImportError:
pass
else:
matplotlib.use('Agg')
# Don't actually import pytest_remotedata because that can do things to the
# e... | [((20, 18, 20, 63), 'importlib.util.find_spec', 'importlib.util.find_spec', ({(20, 43, 20, 62): '"""pytest_remotedata"""'}, {}), "('pytest_remotedata')", False, 'import importlib\n'), ((27, 1, 27, 46), 'pytest.fixture', 'pytest.fixture', (), '', False, 'import pytest\n'), ((46, 1, 46, 17), 'pytest.fixture', 'pytest.fix... |
asmateus/PyQtCalendar | qtcalendar/models.py | b8e5e468082f08159744f692e8edaf2ad52fccbb | '''
Models for QtWidgets
'''
from collections import deque
from math import ceil
import datetime as dt
import calendar
class EventInCalendar__Model:
class Text:
@staticmethod
def getDefault():
return EventInCalendar__Model.Text()
def __init__(self, event=None, overflow=Fal... | [((174, 18, 174, 29), 'collections.deque', 'deque', ({(174, 24, 174, 28): 'days'}, {}), '(days)', False, 'from collections import deque\n'), ((220, 20, 220, 62), 'datetime.date', 'dt.date', ({(220, 28, 220, 42): 'self._month[0]', (220, 44, 220, 58): 'self._month[1]', (220, 60, 220, 61): '1'}, {}), '(self._month[0], sel... |
Forest216/BigDL | python/orca/src/bigdl/orca/data/tf/data.py | 840da9a2eaf395978dd83730b02aa5e5dfbd7989 | #
# Copyright 2016 The BigDL 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 agreed to in ... | [((119, 18, 119, 46), 'bigdl.friesian.feature.utils.featuretable_to_xshards', 'featuretable_to_xshards', ({(119, 42, 119, 45): 'tbl'}, {}), '(tbl)', False, 'from bigdl.friesian.feature.utils import featuretable_to_xshards\n'), ((62, 29, 62, 64), 'bigdl.dllib.utils.nest.flatten', 'nest.flatten', ({(62, 42, 62, 63): 'dat... |
StableCoder/vulkan-mini-libs-2 | tools/generate_serialization_header.py | e048f45149816e100d3f4f51306626ebf547b032 | #!/usr/bin/env python3
import sys
import getopt
import xml.etree.ElementTree as ET
def processVendors(outFile, vendors):
outFile.writelines(["\nconstexpr std::array<std::string_view, ", str(
len(vendors)), "> vendors = {{\n"])
for vendor in vendors:
outFile.writelines([' \"', vendor.tag, '\"... | [((102, 21, 102, 52), 'getopt.getopt', 'getopt.getopt', ({(102, 35, 102, 39): 'argv', (102, 41, 102, 47): '"""i:o:"""', (102, 49, 102, 51): '[]'}, {}), "(argv, 'i:o:', [])", False, 'import getopt\n'), ((114, 8, 114, 19), 'sys.exit', 'sys.exit', ({(114, 17, 114, 18): '(1)'}, {}), '(1)', False, 'import sys\n'), ((117, 8,... |
AmpelProject/Ampel-core | ampel/cli/AbsStockCommand.py | dcbfbe38ba400b7f8e44e641b90217ca1bed4f8f | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# File : Ampel-core/ampel/cli/AbsStockCommand.py
# License : BSD-3-Clause
# Author : vb <vbrinnel@physik.hu-berlin.de>
# Date : 25.03.2021
# Last Modified Date: 25.03.2021
# Last Modified By : vb <vbrinnel@physik.hu-berlin.de>... | [((123, 9, 123, 55), 'ampel.model.UnitModel.UnitModel', 'UnitModel', (), '', False, 'from ampel.model.UnitModel import UnitModel\n'), ((140, 9, 140, 33), 'ampel.model.time.TimeConstraintModel.TimeConstraintModel', 'TimeConstraintModel', ({}, {}), '(**d)', False, 'from ampel.model.time.TimeConstraintModel import TimeCon... |
KLumy/Basic-Algorithm | programmers/lv2/42888.py | e52e4200c1955a9062569814ff3418dd06666845 | from typing import List
def solution(records: List[str]):
logger = []
id_name = dict()
message = {"Enter": "님이 들어왔습니다.", "Leave": "님이 나갔습니다."}
for record in records:
op, id, *name = record.split()
if name:
id_name[id] = name[0]
if op in message:
logger.... | [] |
bobosoft/intrepyd | app/nets.py | 13f0912b31f86f9bcc50f52ef4ad870e33f0cf65 | """
Implementation of REST API for nets creation
"""
from flask import Blueprint, request
from .utils import typename_to_type
from .contexts import contexts
nr = Blueprint('nets', __name__)
def _create_bool_constant(func):
context = request.get_json()['context']
if context is None:
return {'result': '... | [((8, 5, 8, 32), 'flask.Blueprint', 'Blueprint', ({(8, 15, 8, 21): '"""nets"""', (8, 23, 8, 31): '__name__'}, {}), "('nets', __name__)", False, 'from flask import Blueprint, request\n'), ((48, 14, 48, 41), 'flask.request.args.get', 'request.args.get', ({(48, 31, 48, 40): '"""context"""'}, {}), "('context')", False, 'fr... |
Soroosh129/addons | tensorflow_addons/image/utils.py | d92ae02d04e9052f6ca5ea272873efd15eaa35ce | # Copyright 2019 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... | [((52, 12, 52, 27), 'tensorflow.shape', 'tf.shape', ({(52, 21, 52, 26): 'image'}, {}), '(image)', True, 'import tensorflow as tf\n'), ((53, 20, 53, 34), 'tensorflow.rank', 'tf.rank', ({(53, 28, 53, 33): 'image'}, {}), '(image)', True, 'import tensorflow as tf\n'), ((67, 11, 67, 39), 'tensorflow.reshape', 'tf.reshape', ... |
fossabot/MolVS | tests/test_charge.py | dc5afca7fcea93ebb0a342b766d70e88d2c0b841 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for charge.py"""
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
import logging
from rdkit import Chem
from molvs.standardize import Standardizer, standardize_smiles
from molvs.charge import Reionizer... | [((16, 0, 16, 40), 'logging.basicConfig', 'logging.basicConfig', (), '', False, 'import logging\n'), ((94, 10, 94, 70), 'rdkit.Chem.MolFromSmiles', 'Chem.MolFromSmiles', ({(94, 29, 94, 69): '"""C1=C(C=CC(=C1)[S]([O-])=O)[S](O)(=O)=O"""'}, {}), "('C1=C(C=CC(=C1)[S]([O-])=O)[S](O)(=O)=O')", False, 'from rdkit import Chem... |
jochanmin/Blog | backend/users/views.py | 465dcb951ebe2e2fabcd81d0c4e0221decc66ccc | from django.shortcuts import render
from django.core import serializers
from .models import User
from django.forms.models import model_to_dict
from rest_framework import status
from rest_framework.response import Response
from rest_framework.decorators import api_view, permission_classes
from rest_framework.permissions... | [((13, 1, 13, 19), 'rest_framework.decorators.api_view', 'api_view', ({(13, 10, 13, 18): "['POST']"}, {}), "(['POST'])", False, 'from rest_framework.decorators import api_view, permission_classes\n'), ((35, 1, 35, 18), 'rest_framework.decorators.api_view', 'api_view', ({(35, 10, 35, 17): "['GET']"}, {}), "(['GET'])", F... |
MrRollyPanda/astral | src/test/test_Location.py | 5a1b013c945fa902b475ff0fa6769f0d43fe2999 | # -*- coding: utf-8 -*-
from pytest import raises
from astral import Astral, AstralError, Location
import datetime
import pytz
def datetime_almost_equal(datetime1, datetime2, seconds=60):
dd = datetime1 - datetime2
sd = (dd.days * 24 * 60 * 60) + dd.seconds
return abs(sd) <= seconds
def test_Location_N... | [((16, 8, 16, 18), 'astral.Location', 'Location', ({}, {}), '()', False, 'from astral import Astral, AstralError, Location\n'), ((25, 8, 25, 18), 'astral.Location', 'Location', ({}, {}), '()', False, 'from astral import Astral, AstralError, Location\n'), ((32, 9, 32, 17), 'astral.Astral', 'Astral', ({}, {}), '()', Fals... |
minjunli/jsonc | __init__.py | a61b72e92729f9177d8d8685deae744244d6be16 | from .jsonc import load, loads, dump, dumps
| [] |
prahal/apitrace | specs/d3d9caps.py | e9426dd61586757d23d7dddc85b3076f477e7f07 | ##########################################################################
#
# Copyright 2008-2009 VMware, Inc.
# All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software withou... | [] |
NimBuzz01/Project-Miika_SDGP | miika_nlu/venv/Lib/site-packages/tqdm/_dist_ver.py | 08ad1aafafbe9f47c59bd1568b8ac367fefe5503 | __version__ = '4.64.0'
| [] |
katetolstaya/gym-flock | gym_flock/envs/old/mapping.py | 3236d1dafcb1b9be0cf78b471672e8becb2d37af | import gym
from gym import spaces, error, utils
from gym.utils import seeding
import numpy as np
import configparser
from os import path
import matplotlib.pyplot as plt
from matplotlib.pyplot import gca
font = {'family': 'sans-serif',
'weight': 'bold',
'size': 14}
class MappingEnv(gym.Env):
def ... | [((74, 12, 74, 71), 'numpy.linspace', 'np.linspace', ({(74, 24, 74, 42): '-1.0 * self.px_max', (74, 44, 74, 55): 'self.px_max', (74, 57, 74, 70): 'self.n_agents'}, {}), '(-1.0 * self.px_max, self.px_max, self.n_agents)', True, 'import numpy as np\n'), ((75, 12, 75, 71), 'numpy.linspace', 'np.linspace', ({(75, 24, 75, 4... |
PaulWang1905/tensorflow | tensorflow/python/kernel_tests/lu_op_test.py | ebf12d22b4801fb8dab5034cc94562bf7cc33fa0 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | [((212, 3, 212, 39), 'tensorflow.python.framework.test_util.run_v1_only', 'test_util.run_v1_only', ({(212, 25, 212, 38): '"""b/120545219"""'}, {}), "('b/120545219')", False, 'from tensorflow.python.framework import test_util\n'), ((283, 2, 283, 13), 'tensorflow.python.platform.test.main', 'test.main', ({}, {}), '()', F... |
zhouyangnk/Montreal-Forced-Aligner | aligner/features/processing.py | 4f8733409e79a50744616921a04fccf115e8af6f | import multiprocessing as mp
import subprocess
import shutil
import os
from ..helper import make_path_safe, thirdparty_binary, filter_scp
from ..exceptions import CorpusError
def mfcc_func(directory, job_name, mfcc_config_path): # pragma: no cover
log_directory = os.path.join(directory, 'log')
raw_mfcc_path... | [((11, 20, 11, 50), 'os.path.join', 'os.path.join', ({(11, 33, 11, 42): 'directory', (11, 44, 11, 49): '"""log"""'}, {}), "(directory, 'log')", False, 'import os\n'), ((71, 16, 71, 33), 'os.environ.copy', 'os.environ.copy', ({}, {}), '()', False, 'import os\n'), ((114, 16, 114, 33), 'os.environ.copy', 'os.environ.copy'... |
tysen2k/ffai | ffai/util/bothelper.py | 2fa1fd45a8877986fdb21e3fea5e01cbf819d3ec | """
A number of static methods for interpretting the state of the fantasy football pitch that aren't required directly by
the client
"""
from ffai.core import Game, Action, ActionType
from ffai.core.procedure import *
from ffai.util.pathfinding import *
from typing import Optional, List, Dict
class ActionSequence:
... | [] |
DmitriyGrigoriev/sb-fastapi | sb_backend/cli/cli.py | 1aef3db6ce26ea054e048e5927552d48c2eccbfb | # -*- coding: utf-8 -*-
"""sb-fastapi CLI root."""
import logging
import click
from sb_backend.cli.commands.serve import serve
@click.group()
@click.option(
"-v",
"--verbose",
help="Enable verbose logging.",
is_flag=True,
default=False,
)
def cli(**options):
"""sb-fastapi CLI root."""
if ... | [((9, 1, 9, 14), 'click.group', 'click.group', ({}, {}), '()', False, 'import click\n'), ((10, 1, 16, 1), 'click.option', 'click.option', (), '', False, 'import click\n'), ((24, 4, 28, 5), 'logging.basicConfig', 'logging.basicConfig', (), '', False, 'import logging\n')] |
DSandovalFlavio/Dashboards-Plotly-Dash | 1-Chapter/htmlcomponents.py | 58867c2e813bc9273838dec12e7bd15be25504fa | import dash
from dash import html
app = dash.Dash(__name__)
app.layout = html.Div(children=[html.H1('Data Science',
style = {'textAlign': 'center',
'color': '#0FD08D',
'font-size': '... | [((4, 6, 4, 25), 'dash.Dash', 'dash.Dash', ({(4, 16, 4, 24): '__name__'}, {}), '(__name__)', False, 'import dash\n'), ((6, 32, 9, 69), 'dash.html.H1', 'html.H1', (), '', False, 'from dash import html\n'), ((10, 32, 12, 69), 'dash.html.H2', 'html.H2', (), '', False, 'from dash import html\n'), ((13, 32, 13, 57), 'dash.h... |
iitd-plos/baadal2.0 | baadalinstallation/baadal/modules/vm_helper.py | 0496a8ddb5c0620f3448f018ba48b080b96cbe61 | # -*- coding: utf-8 -*-
###################################################################################
from gluon import current
from helper import get_constant, execute_remote_cmd, config, get_datetime, \
log_exception, is_pingable, get_context_path
from libvirt import * # @UnusedWildImport
from log_handler ... | [] |
bopopescu/webrtc-streaming-node | third_party/webrtc/src/chromium/src/build/android/devil/android/sdk/aapt.py | 727a441204344ff596401b0253caac372b714d91 | # Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""This module wraps the Android Asset Packaging Tool."""
import os
from devil.utils import cmd_helper
from pylib import constants
_AAPT_PATH = os.path.jo... | [((12, 13, 12, 62), 'os.path.join', 'os.path.join', ({(12, 26, 12, 53): 'constants.ANDROID_SDK_TOOLS', (12, 55, 12, 61): '"""aapt"""'}, {}), "(constants.ANDROID_SDK_TOOLS, 'aapt')", False, 'import os\n'), ((24, 19, 24, 56), 'devil.utils.cmd_helper.GetCmdStatusAndOutput', 'cmd_helper.GetCmdStatusAndOutput', ({(24, 52, 2... |
esayui/mworks | examples/Tests/Misc/Resources/PythonFile/basic.py | 0522e5afc1e30fdbf1e67cedd196ee50f7924499 | setvar('nsamples', getvar('a') + getvar('b'))
| [] |
arosen93/HT-ASE | quacc/recipes/psi4/core.py | a76542e7a2bc5bf6e7382d8f1387374eb2abc713 | """Core recipes for Psi4"""
from __future__ import annotations
from dataclasses import dataclass
from typing import Any, Dict
from ase.atoms import Atoms
from ase.calculators.psi4 import Psi4
from jobflow import Maker, job
from monty.dev import requires
try:
import psi4
except:
psi4 = None
from quacc.schemas... | [((44, 5, 44, 72), 'monty.dev.requires', 'requires', ({(44, 14, 44, 18): 'psi4', (44, 20, 44, 71): '"""Psi4 be installed. Try conda install -c psi4 psi4"""'}, {}), "(psi4, 'Psi4 be installed. Try conda install -c psi4 psi4')", False, 'from monty.dev import requires\n'), ((78, 16, 78, 62), 'quacc.util.basics.merge_dicts... |
Archedar/UAS | UAS/UAS 11 & 12/main.py | 3237d9304026340acc93c8f36b358578dc0ae66f | #Main Program
from Class import Barang
import Menu
histori = list()
listBarang = [
Barang('Rinso', 5000, 20),
Barang('Sabun', 3000, 20),
Barang('Pulpen', 2500, 20),
Barang('Tisu', 10000, 20),
Barang('Penggaris', 1000, 20)
]
while True:
print('''
Menu
1. Tampilkan Barang
2. Tambahkan Barang
3. Ta... | [((7, 0, 7, 25), 'Class.Barang', 'Barang', ({(7, 7, 7, 14): '"""Rinso"""', (7, 16, 7, 20): '(5000)', (7, 22, 7, 24): '(20)'}, {}), "('Rinso', 5000, 20)", False, 'from Class import Barang\n'), ((8, 0, 8, 25), 'Class.Barang', 'Barang', ({(8, 7, 8, 14): '"""Sabun"""', (8, 16, 8, 20): '(3000)', (8, 22, 8, 24): '(20)'}, {})... |
thunlp/JointNRE | original/baselines/train/JointE+ONE.py | 29e2070910d0940bf4d32a8b8c97800bceff98fb | #coding:utf-8
import numpy as np
import tensorflow as tf
import os
import time
import datetime
import ctypes
import threading
import json
ll1 = ctypes.cdll.LoadLibrary
lib_cnn = ll1("./init_cnn.so")
ll2 = ctypes.cdll.LoadLibrary
lib_kg = ll2("./init_know.so")
class Config(object):
def __init__(self):
self.in... | [] |
rachmadaniHaryono/i2vec_cli | i2vec_cli/__main__.py | 9e03ca1c930e5eab8e42ac882c66e18f7c7435ba | #!/usr/bin/env python3
"""get tag from http://demo.illustration2vec.net/."""
# note:
# - error 'ERROR: Request Entity Too Large' for file 1.1 mb
# <span style="color:red;">ERROR: Request Entity Too Large</span>
from collections import OrderedDict
from pathlib import Path
from pprint import pformat
import imghdr
import ... | [((182, 1, 182, 16), 'click.command', 'click.command', ({}, {}), '()', False, 'import click\n'), ((184, 1, 184, 66), 'click.option', 'click.option', (), '', False, 'import click\n'), ((185, 1, 185, 93), 'click.option', 'click.option', (), '', False, 'import click\n'), ((186, 1, 187, 98), 'click.option', 'click.option',... |
debrando/cherrypy | cherrypy/lib/cptools.py | a92c5cc5d888b0aad327bce34e94da4a1f961e43 | """Functions for builtin CherryPy tools."""
import logging
import re
from hashlib import md5
import six
from six.moves import urllib
import cherrypy
from cherrypy._cpcompat import text_or_bytes
from cherrypy.lib import httputil as _httputil
from cherrypy.lib import is_iterator
# Conditional HTT... | [((40, 26, 40, 65), 'cherrypy.lib.httputil.valid_status', '_httputil.valid_status', ({(40, 49, 40, 64): 'response.status'}, {}), '(response.status)', True, 'from cherrypy.lib import httputil as _httputil\n'), ((282, 10, 282, 44), 'cherrypy.HTTPError', 'cherrypy.HTTPError', ({(282, 29, 282, 34): 'error', (282, 36, 282, ... |
benstear/pyiomica | pyiomica/utilityFunctions.py | bc26032b610fc911cc03b54115d6abdf53a56fce | '''Utility functions'''
import multiprocessing
from .globalVariables import *
def readMathIOmicaData(fileName):
'''Read text files exported by MathIOmica and convert to Python data
Parameters:
fileName: str
Path of directories and name of the file containing data
... | [((66, 15, 66, 70), 'multiprocessing.Pool', 'multiprocessing.Pool', (), '', False, 'import multiprocessing\n')] |
deapplegate/wtgpipeline | CRNitschke/get_sextract_thresholds.py | 9693e8562022cc97bf5a96427e22965e1a5e8497 | #! /usr/bin/env python
#adam-does# runs SeeingClearly to get the seeing and rms of the image, then uses those to get sextractor thresholds for CR detection
#adam-use# use with CRNitschke pipeline
#adam-call_example# call it like ./get_sextract_thresholds.py /path/flname.fits output_file.txt
#IO stuff:
import sys ; sys... | [] |
flatironinstitute/labbox | python/labbox/api/_session.py | d8b331d55a5cca543567c3b2e92bcdc02b46e799 | import time
import multiprocessing
class Session:
def __init__(self, *, labbox_config, default_feed_name: str):
self._labbox_config = labbox_config
pipe_to_parent, pipe_to_child = multiprocessing.Pipe()
self._worker_process = multiprocessing.Process(target=_run_worker_session, args=(pipe_... | [((8, 40, 8, 62), 'multiprocessing.Pipe', 'multiprocessing.Pipe', ({}, {}), '()', False, 'import multiprocessing\n'), ((9, 32, 9, 140), 'multiprocessing.Process', 'multiprocessing.Process', (), '', False, 'import multiprocessing\n'), ((12, 45, 12, 56), 'time.time', 'time.time', ({}, {}), '()', False, 'import time\n'), ... |
GabrielDumbrava/aldryn-newsblog | aldryn_newsblog/tests/test_reversion.py | f3be5ff78e88fde532ce4c45e5eeb88d98fa6d93 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from unittest import skipIf
try:
from django.core.urlresolvers import reverse
except ModuleNotFoundError:
from django.urls import reverse
from django.db import transaction
from aldryn_reversion.core import create_revision as aldryn_create_revisio... | [((28, 1, 28, 61), 'unittest.skipIf', 'skipIf', ({(28, 8, 28, 28): '(not ENABLE_REVERSION)', (28, 30, 28, 60): '"""django-reversion not enabled"""'}, {}), "(not ENABLE_REVERSION, 'django-reversion not enabled')", False, 'from unittest import skipIf\n'), ((31, 13, 31, 33), 'django.db.transaction.atomic', 'transaction.at... |
VirtualEmbryo/lumen_network | network/network.py | 35b1dadccd087c9ef234f12c2735098b82890b34 | # Library for the dynamics of a lumen network
# The lumen are 2 dimensional and symmetric and connected with 1 dimensional tubes
#
# Created by A. Mielke, 2018
# Modified by M. Le Verge--Serandour on 8/04/2019
"""
network.py conf.init
Defines the class network and associated functions
Imports
... | [((220, 16, 220, 57), 'numpy.zeros', 'np.zeros', (), '', True, 'import numpy as np\n'), ((221, 23, 221, 64), 'numpy.zeros', 'np.zeros', (), '', True, 'import numpy as np\n'), ((222, 25, 222, 85), 'numpy.zeros', 'np.zeros', (), '', True, 'import numpy as np\n'), ((243, 27, 243, 73), 'numpy.linalg.solve', 'np.linalg.solv... |
always-newbie161/pyprobml | scripts/upsampling_demo.py | eb70c84f9618d68235ef9ba7da147c009b2e4a80 | # Illustrate upsampling in 2d
# Code from Jason Brownlee
# https://machinelearningmastery.com/generative_adversarial_networks/
import tensorflow as tf
from tensorflow import keras
from numpy import asarray
#from keras.models import Sequential
from tensorflow.keras.models import Sequential
#from keras.layers import... | [((17, 4, 18, 12), 'numpy.asarray', 'asarray', ({(17, 12, 18, 11): '[[1, 2], [3, 4]]'}, {}), '([[1, 2], [3, 4]])', False, 'from numpy import asarray\n'), ((20, 4, 22, 22), 'numpy.asarray', 'asarray', ({(20, 12, 22, 21): '[[1, 2, 3], [4, 5, 6], [7, 8, 9]]'}, {}), '([[1, 2, 3], [4, 5, 6], [7, 8, 9]])', False, 'from numpy... |
njchj/V2RayCloudSpider | V2RaycSpider1225/src/BusinessCentralLayer/scaffold.py | 16154cf48c74fa2c8cf2f6792d2db3632501f5d6 | __all__ = ['scaffold', 'command_set']
from gevent import monkey
monkey.patch_all()
import csv
import os
import sys
import time
import shutil
from typing import List
import gevent
from src.BusinessCentralLayer.setting import logger, DEFAULT_POWER, CHROMEDRIVER_PATH, \
REDIS_MASTER, SERVER_DIR_DATABASE_CACHE, SE... | [((5, 0, 5, 18), 'gevent.monkey.patch_all', 'monkey.patch_all', ({}, {}), '()', False, 'from gevent import monkey\n'), ((422, 5, 422, 19), 'src.BusinessCentralLayer.setting.logger.catch', 'logger.catch', ({}, {}), '()', False, 'from src.BusinessCentralLayer.setting import logger, DEFAULT_POWER, CHROMEDRIVER_PATH, REDIS... |
daniestevez/gr-csp | python/swap_header.py | 0a10e4d2e5cf4a51256e5dc72aa42f8d3d54c232 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2016 Daniel Estevez <daniel@destevez.net>.
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
... | [] |
gleenn/dfplayer | start.py | dd390a6f54b3bd8b2a3397fddd6caacfba01b29d | #!/usr/bin/python
#
# Start dfplayer.
import argparse
import os
import shutil
import subprocess
import sys
import time
_PROJ_DIR = os.path.dirname(__file__)
def main():
os.chdir(_PROJ_DIR)
os.environ['LD_LIBRARY_PATH'] = '/lib:/usr/lib:/usr/local/lib'
arg_parser = argparse.ArgumentParser(description='Star... | [] |
Finnder/Console-Based-Story-Game | Game_Mechanics.py | fe5341faf82783880872560d43d286e917f5e3d7 | def attack():
pass
def defend():
pass
def pass_turn():
pass
def use_ability_One(kit):
pass
def use_ability_Two(kit):
pass
def end_Of_Battle():
pass | [] |
Pougnator/Prometheus | AIY/voice/cloudspeech_demo.py | d7c59f3a97b4f60958f130741ccc16b81d65f505 | #!/usr/bin/env python3
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | [] |
lime-j/YTMT-Strategy-1 | options/base_option.py | aacc38c4e61b91e187cac81aa95500e0422d4d0f | import argparse
import models
model_names = sorted(name for name in models.__dict__
if name.islower() and not name.startswith("__")
and callable(models.__dict__[name]))
class BaseOptions():
def __init__(self):
self.parser = argparse.ArgumentParser(formatter_class... | [((11, 22, 11, 101), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (), '', False, 'import argparse\n')] |
JanhaviSoni/Book-Recommendation-Analysis | bookstore/__init__.py | d2697e1f2eb9b9b4e0bafc0dd43d486ceb3d1707 |
from flask import Flask, Response
from flask_basicauth import BasicAuth
from flask_cors import CORS, cross_origin
import os
#from flask_admin import Admin,AdminIndexView
#from flask_admin.contrib.sqla import ModelView
from flask_sqlalchemy import SQLAlchemy as _BaseSQLAlchemy
from flask_migrate import Migrate, Migr... | [((26, 6, 26, 21), 'flask.Flask', 'Flask', ({(26, 12, 26, 20): '__name__'}, {}), '(__name__)', False, 'from flask import Flask, Response\n'), ((33, 0, 33, 9), 'flask_cors.CORS', 'CORS', ({(33, 5, 33, 8): 'app'}, {}), '(app)', False, 'from flask_cors import CORS, cross_origin\n'), ((63, 10, 63, 48), 'flask_migrate.Migra... |
Bibiko/CoBL-public | cobl/lexicon/management/commands/stats236.py | 5092a0d01b7a13565c7da6bf2f6c52d648a2debe | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.core.management import BaseCommand
from cobl.lexicon.models import LanguageList, \
MeaningList, \
Meaning, \
Lexeme, \
... | [((28, 18, 28, 58), 'cobl.lexicon.models.LanguageList.objects.get', 'LanguageList.objects.get', (), '', False, 'from cobl.lexicon.models import LanguageList, MeaningList, Meaning, Lexeme, CognateClass, CognateJudgement, LanguageClade, Clade\n'), ((29, 18, 29, 57), 'cobl.lexicon.models.MeaningList.objects.get', 'Meaning... |
enabling-languages/dinka | collation/test2.py | 981ffd07e7468f692c4d17472083a3c5485987f8 | import pandas as pd
from icu import Collator, Locale, RuleBasedCollator
ddf = pd.read_csv("../word_frequency/unilex/din.txt", sep='\t', skiprows = range(2,5))
collator = Collator.createInstance(Locale('en_AU.UTF-8'))
# https://stackoverflow.com/questions/13838405/custom-sorting-in-pandas-dataframe/27009771#27009771
... | [((36, 18, 36, 52), 'icu.RuleBasedCollator', 'RuleBasedCollator', ({(36, 36, 36, 51): 'collation_rules'}, {}), '(collation_rules)', False, 'from icu import Collator, Locale, RuleBasedCollator\n'), ((6, 35, 6, 56), 'icu.Locale', 'Locale', ({(6, 42, 6, 55): '"""en_AU.UTF-8"""'}, {}), "('en_AU.UTF-8')", False, 'from icu i... |
jbronikowski/genielibs | pkgs/ops-pkg/src/genie/libs/ops/dot1x/ios/tests/test_dot1x.py | 200a34e5fe4838a27b5a80d5973651b2e34ccafb | # Python
import unittest
from copy import deepcopy
from unittest.mock import Mock
# ATS
from pyats.topology import Device
# Genie
from genie.libs.ops.dot1x.ios.dot1x import Dot1X
from genie.libs.ops.dot1x.ios.tests.dot1x_output import Dot1xOutput
# Parser
from genie.libs.parser.ios.show_dot1x import ShowDot1xAllDeta... | [((113, 4, 113, 19), 'unittest.main', 'unittest.main', ({}, {}), '()', False, 'import unittest\n'), ((23, 22, 23, 44), 'pyats.topology.Device', 'Device', (), '', False, 'from pyats.topology import Device\n'), ((34, 16, 34, 41), 'genie.libs.ops.dot1x.ios.dot1x.Dot1X', 'Dot1X', (), '', False, 'from genie.libs.ops.dot1x.i... |
lanl/nubhlight | script/analysis/check_transformation_matrices.py | 6c0f2abc05884538fe8e4e2e70a021b7c48a72c2 | # ======================================================================
# copyright 2020. Triad National Security, LLC. All rights
# reserved. This program was produced under U.S. Government contract
# 89233218CNA000001 for Los Alamos National Laboratory (LANL), which
# is operated by Triad National Security, LLC for ... | [((131, 10, 131, 25), 'numpy.zeros', 'np.zeros', ({(131, 19, 131, 24): '[4, 4]'}, {}), '([4, 4])', True, 'import numpy as np\n'), ((166, 17, 171, 3), 'numpy.array', 'np.array', ({(167, 6, 170, 32): '[[g_tt, g_tr, 0.0, g_tf], [g_tr, g_rr, 0.0, g_rf], [0.0, 0.0, g_thth, 0.0],\n [g_tf, g_rf, 0.0, g_ff]]'}, {}), '([[g_t... |
rexor12/holobot | holobot/discord/sdk/models/channel.py | 89b7b416403d13ccfeee117ef942426b08d3651d | from dataclasses import dataclass
@dataclass
class Channel:
id: str
| [] |
claireguichon/pynet | pynet/models/braingengan.py | 92706375e61fb5cb523548303b7d04769c9de134 | # -*- coding: utf-8 -*-
##########################################################################
# NSAp - Copyright (C) CEA, 2020
# Distributed under the terms of the CeCILL-B license, as published by
# the CEA-CNRS-INRIA. Refer to the LICENSE file or to
# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
#... | [((27, 9, 27, 35), 'logging.getLogger', 'logging.getLogger', ({(27, 27, 27, 34): '"""pynet"""'}, {}), "('pynet')", False, 'import logging\n'), ((348, 12, 348, 29), 'numpy.asarray', 'np.asarray', ({(348, 23, 348, 28): 'shape'}, {}), '(shape)', True, 'import numpy as np\n'), ((59, 21, 61, 22), 'torch.nn.Conv3d', 'nn.Conv... |
baranshad/models | research/object_detection/core/freezable_batch_norm_test.py | aaf008855e9764f32d974e86f8e1f9cfddfafd9a | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | [((184, 2, 184, 16), 'tensorflow.test.main', 'tf.test.main', ({}, {}), '()', True, 'import tensorflow as tf\n'), ((27, 12, 27, 40), 'tensorflow.keras.models.Sequential', 'tf.keras.models.Sequential', ({}, {}), '()', True, 'import tensorflow as tf\n'), ((28, 11, 30, 64), 'object_detection.core.freezable_batch_norm.Freez... |
translationalneurosurgery/tool-offspect | offspect/gui/VWidgets/message.py | 011dafb697e8542fc7c3cf8af8523af3ff704a14 | # from PyQt5.QtWidgets import QMessageBox
# def raise_error(message: str = "DEFAULT:Error Description:More Information"):
# box = QMessageBox()
# kind, msg, info = message.split(":")
# box.setIcon(QMessageBox.Critical)
# box.setWindowTitle(kind + " Error")
# box.setText(msg)
# box.setInformati... | [] |
crazywiden/Leetcode_daily_submit | Widen/LC759_Employee_Free_Time.py | 15637e260ab547022ac0c828dd196337bd8d50a3 | """
759. Employee Free Time
We are given a list schedule of employees, which represents the working time for each employee.
Each employee has a list of non-overlapping Intervals, and these intervals are in sorted order.
Return the list of finite intervals representing common, positive-length free time for all employe... | [((69, 8, 69, 34), 'heapq.heapify', 'heapq.heapify', ({(69, 22, 69, 33): 'job_start_q'}, {}), '(job_start_q)', False, 'import heapq\n'), ((72, 36, 72, 62), 'heapq.heappop', 'heapq.heappop', ({(72, 50, 72, 61): 'job_start_q'}, {}), '(job_start_q)', False, 'import heapq\n'), ((77, 16, 77, 97), 'heapq.heappush', 'heapq.he... |
thomaserlang/storitch | storitch/config.py | dbcf97af547d9cb1ae5c3994654e8db03e43a253 | import os, yaml
config = {
'debug': False,
'port': 5000,
'store_path': '/var/storitch',
'pool_size': 5,
'logging': {
'level': 'warning',
'path': None,
'max_size': 100 * 1000 * 1000,# ~ 95 mb
'num_backups': 10,
},
'image_exts': [
'.jpg', '.jpeg', '.png... | [((29, 15, 29, 54), 'os.environ.get', 'os.environ.get', ({(29, 30, 29, 47): '"""STORITCH_CONFIG"""', (29, 49, 29, 53): 'None'}, {}), "('STORITCH_CONFIG', None)", False, 'import os, yaml\n'), ((38, 11, 38, 31), 'os.path.isfile', 'os.path.isfile', ({(38, 26, 38, 30): 'path'}, {}), '(path)', False, 'import os, yaml\n'), (... |
PipelineAI/models | keras/lstm-securitai/model/pipeline_invoke_python.py | d8df07877aa8b10ce9b84983bb440af75e84dca7 | import io
import os
import numpy as np
import pandas
import json
import logging #<== Optional. Log to console, file, kafka
from pipeline_monitor import prometheus_monitor as monitor #<== Optional. Monitor runtime metrics
from pipeline_logger import log
import tenso... | [((17, 10, 17, 46), 'logging.getLogger', 'logging.getLogger', ({(17, 28, 17, 45): '"""pipeline-logger"""'}, {}), "('pipeline-logger')", False, 'import logging\n'), ((19, 25, 19, 48), 'logging.StreamHandler', 'logging.StreamHandler', ({}, {}), '()', False, 'import logging\n'), ((37, 12, 37, 49), 'keras.models.load_model... |
ATLASControlTower/aCT | src/act/common/aCTReport.py | fb841bddbe086db9f0d620167c4a11ae4634ef4f | import argparse
import importlib
import os
import re
import signal
import subprocess
import sys
import time
import logging
from act.common import aCTLogger
from act.common.aCTConfig import aCTConfigAPP
from act.arc import aCTDBArc
class aCTReport:
'''Print summary info on jobs in DB. Use --web to print html that ... | [((265, 13, 265, 77), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (), '', False, 'import argparse\n'), ((24, 20, 24, 52), 'act.common.aCTLogger.aCTLogger', 'aCTLogger.aCTLogger', ({(24, 40, 24, 51): '"""aCTReport"""'}, {}), "('aCTReport')", False, 'from act.common import aCTLogger\n'), ((27, 30, 27, 78), 'act... |
mtcolman/django-DefectDojo | unittests/test_apiv2_user.py | 76175aca446e077884bdb5e1d8e2a671a0840775 | from rest_framework.test import APITestCase, APIClient
from django.urls import reverse
from rest_framework.authtoken.models import Token
class UserTest(APITestCase):
"""
Test the User APIv2 endpoint.
"""
fixtures = ['dojo_testdata.json']
def setUp(self):
token = Token.objects.get(user__us... | [((13, 16, 13, 57), 'rest_framework.authtoken.models.Token.objects.get', 'Token.objects.get', (), '', False, 'from rest_framework.authtoken.models import Token\n'), ((14, 22, 14, 33), 'rest_framework.test.APIClient', 'APIClient', ({}, {}), '()', False, 'from rest_framework.test import APITestCase, APIClient\n'), ((18, ... |
ankit-kushwaha-51/RESTful_API | src/init.py | 4513e8a058cb0200b41d47830b93b8a23ea38d7b | from flask import Flask
from src.models import db
from . import config
def create_app():
flask_app = Flask(__name__)
flask_app.config['SQLALCHEMY_DATABASE_URI'] = config.DATABASE_CONNECTION_URI
flask_app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
flask_app.app_context().push()
db.init_app(f... | [((8, 16, 8, 31), 'flask.Flask', 'Flask', ({(8, 22, 8, 30): '__name__'}, {}), '(__name__)', False, 'from flask import Flask\n'), ((12, 4, 12, 26), 'src.models.db.init_app', 'db.init_app', ({(12, 16, 12, 25): 'flask_app'}, {}), '(flask_app)', False, 'from src.models import db\n'), ((13, 4, 13, 19), 'src.models.db.create... |
nicoddemus/dependencies | tests/helpers/examples/order/tasks.py | 74180e2c6098d8ad03bc53c5703bdf8dc61c3ed9 | from dependencies import Injector
from dependencies import this
from dependencies.contrib.celery import shared_task
from examples.order.commands import ProcessOrder
@shared_task
class ProcessOrderTask(Injector):
name = "process_order"
run = ProcessOrder
bind = True
retry = this.task.retry
| [] |
SocrammBR/Desafios-Python-CursoEmVideo | 001 - 050/ex032.py | bd2454a24134500343ece91b936c169d3a66f89e | ano = int(input('Digite o ano: '))
if (ano%4) == 0:
print ('Ele é bissexto')
else:
print ('Ele não é bissexto') | [] |
vikneswaran20/rn | rn/__init__.py | 33e0bfaf58bb8a5ec54c6d010035693b35e9909d | __version__ = '0.0.1'
__license__ = 'BSD'
| [] |
FlexMeasures/flexmeasures | flexmeasures/cli/data_edit.py | a4367976d37ac5721b8eb3ce8a2414595e52c678 | from datetime import timedelta
from typing import Union, List, Optional
import click
import pandas as pd
from flask import current_app as app
from flask.cli import with_appcontext
from flexmeasures import Sensor
from flexmeasures.data import db
from flexmeasures.data.schemas.generic_assets import GenericAssetIdField
... | [((18, 1, 18, 20), 'click.group', 'click.group', ({(18, 13, 18, 19): '"""edit"""'}, {}), "('edit')", False, 'import click\n'), ((41, 1, 46, 1), 'click.option', 'click.option', (), '', False, 'import click\n'), ((47, 1, 53, 1), 'click.option', 'click.option', (), '', False, 'import click\n'), ((54, 1, 60, 1), 'click.opt... |
ArseniumGX/bluemer-modulo2 | semana2/mail_settings.py | 24e5071b734de362dc47ef9d402c191699d15b43 | mail_settings = {
"MAIL_SERVER": 'smtp.gmail.com',
"MAIL_PORT": 465,
"MAIL_USE_TLS": False,
"MAIL_USE_SSL": True,
"MAIL_USERNAME": 'c003.teste.jp@gmail.com',
"MAIL_PASSWORD": 'C003.teste'
} | [] |
dingjingmaster/blog_spider | frame/base/parser.py | 7a0885bf886166eac0caca4471ee9f6424be2225 | #!/usr/bin/env python3.6
# -*- encoding=utf8 -*-
import pyquery
"""
需求字段:
標題、發表日期、分類、標籤、內容、圖片
需要的字段信息
1. 网站根URL
2. 解析器名字
3. 解析器类型
1. PARSER_PASSAGE_URL 文章URL
2. PARSER_PASSAGE_TITLE 文章标题
3. PARSER_PASSAGE_DATE ... | [((54, 15, 54, 35), 'pyquery.PyQuery', 'pyquery.PyQuery', ({(54, 31, 54, 34): 'doc'}, {}), '(doc)', False, 'import pyquery\n')] |
Commodore-Bench/u5remastered | tools/mkblocks.py | 02c7ed86055e368b97d3c3c5ca26622782bd564d | #!/usr/bin/env python3
# ----------------------------------------------------------------------------
# Copyright 2019 Drunella
#
# 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:/... | [((110, 8, 110, 33), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ({}, {}), '()', False, 'import argparse\n'), ((122, 4, 122, 42), 'os.makedirs', 'os.makedirs', (), '', False, 'import os\n'), ((124, 4, 124, 48), 'os.makedirs', 'os.makedirs', (), '', False, 'import os\n'), ((130, 7, 130, 35), 'os.path.exists', ... |
boxingbeetle/apetest | src/apetest/decode.py | c6dd7aaca014c64eec4bde7e755c4a3dec72404a | # SPDX-License-Identifier: BSD-3-Clause
"""
Text decode functions.
These functions can be used to get Unicode strings from a series of bytes.
"""
from codecs import (
BOM_UTF8,
BOM_UTF16_BE,
BOM_UTF16_LE,
BOM_UTF32_BE,
BOM_UTF32_LE,
CodecInfo,
lookup as lookup_codec,
)
from collections im... | [((78, 35, 78, 48), 'collections.OrderedDict', 'OrderedDict', ({}, {}), '()', False, 'from collections import OrderedDict\n'), ((81, 20, 81, 42), 'codecs.lookup', 'lookup_codec', ({(81, 33, 81, 41): 'encoding'}, {}), '(encoding)', True, 'from codecs import BOM_UTF8, BOM_UTF16_BE, BOM_UTF16_LE, BOM_UTF32_BE, BOM_UTF32_L... |
jiangycTarheel/Compositional-Auxseq | utils.py | e4645a92c21c893cd320eb186c19d392bc147b43 | import os
import json
import gzip
from copy import deepcopy, copy
import numpy as np
import csv
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import Dataset, DataLoader, RandomSampler
from transformers.tokenization_utils import trim_batch
class LabelSmoothingLoss(nn.Module)... | [((22, 18, 22, 64), 'torch.full', 'torch.full', ({(22, 29, 22, 46): '(tgt_vocab_size,)', (22, 48, 22, 63): 'smoothing_value'}, {}), '((tgt_vocab_size,), smoothing_value)', False, 'import torch\n'), ((27, 23, 27, 59), 'torch.nn.KLDivLoss', 'torch.nn.KLDivLoss', (), '', False, 'import torch\n'), ((40, 20, 40, 46), 'torch... |
intellineers/django-bridger | bridger/serializers/fields/related.py | ed097984a99df7da40a4d01bd00c56e3c6083056 | from typing import Dict
from rest_framework import serializers
from rest_framework.fields import empty
from rest_framework.relations import ManyRelatedField
from rest_framework.request import Request
from .mixins import BridgerSerializerFieldMixin
from .types import BridgerType, ReturnContentType
class BridgerManyR... | [] |
wenyuanyu/GraphScope | python/graphscope/experimental/nx/tests/algorithms/forward/operators/test_product.py | a40ccaf70557e608d8b091eb25ab04477f99ce21 | import networkx.algorithms.operators.tests.test_product
import pytest
from graphscope.experimental.nx.utils.compat import import_as_graphscope_nx
import_as_graphscope_nx(networkx.algorithms.operators.tests.test_product,
decorators=pytest.mark.usefixtures("graphscope_session"))
def test_tenso... | [((21, 1, 21, 50), 'pytest.mark.skip', 'pytest.mark.skip', (), '', False, 'import pytest\n'), ((40, 1, 40, 50), 'pytest.mark.skip', 'pytest.mark.skip', (), '', False, 'import pytest\n'), ((7, 35, 7, 80), 'pytest.mark.usefixtures', 'pytest.mark.usefixtures', ({(7, 59, 7, 79): '"""graphscope_session"""'}, {}), "('graphsc... |
schleising/banter-bot | Footy/UnsupportedBantzStrings.py | 3e51453ae993d2c26dc51464a3cef3875a6be3c9 | # {team} -> Name of team
# {name} -> Name of person who supports team
teamMatchStarted: list[str] = [
"{team} are shit",
"{team} cunts",
"Dirty {team}",
"Dirty {team}, dirty {name}",
]
drawing: list[str] = [
"{team} level, this is a shit match",
"Boring old {team}",
"Happy with how it's go... | [] |
codr7/alisp | bench/fibrec.py | 05ac47ab2c28683373af4ec80e5a94937390fa6c | from bench import bench
print(bench(100, '''
def fib(n):
return n if n < 2 else fib(n-1) + fib(n-2)
''', '''
fib(20)
'''))
| [((3, 6, 8, 4), 'bench.bench', 'bench', ({(3, 12, 3, 15): '(100)', (3, 17, 6, 3): '"""\ndef fib(n):\n return n if n < 2 else fib(n-1) + fib(n-2)\n"""', (6, 5, 8, 3): '"""\n fib(20)\n"""'}, {}), '(100, """\ndef fib(n):\n return n if n < 2 else fib(n-1) + fib(n-2)\n""",\n \'\\n fib(20)\\n\')', False, 'from bench i... |
NLPIR-team/nlpir-python | nlpir/native/classifier.py | 029f81e69ee561725fa017dce09cfd55acb34d20 | # coding=utf-8
from nlpir.native.nlpir_base import NLPIRBase
from ctypes import c_bool, c_char_p, c_int, POINTER, Structure, c_float
class StDoc(Structure):
__fields__ = [
("sTitle", c_char_p),
("sContent", c_char_p),
("sAuthor", c_char_p),
("sBoard", c_char_p),
("sDatatype... | [((59, 50, 59, 64), 'ctypes.POINTER', 'POINTER', ({(59, 58, 59, 63): 'StDoc'}, {}), '(StDoc)', False, 'from ctypes import c_bool, c_char_p, c_int, POINTER, Structure, c_float\n')] |
nickgaya/bravado-core | tests/param/get_param_type_spec_test.py | 16e752963bfceb4adfa43724085bc4127eefcd59 | # -*- coding: utf-8 -*-
import pytest
from mock import Mock
from bravado_core.exception import SwaggerMappingError
from bravado_core.operation import Operation
from bravado_core.param import get_param_type_spec
from bravado_core.param import Param
from bravado_core.spec import Spec
@pytest.fixture
def body_param_spe... | [((57, 19, 57, 45), 'bravado_core.spec.Spec', 'Spec', ({(57, 24, 57, 44): 'minimal_swagger_dict'}, {}), '(minimal_swagger_dict)', False, 'from bravado_core.spec import Spec\n'), ((26, 38, 26, 58), 'mock.Mock', 'Mock', (), '', False, 'from mock import Mock\n'), ((27, 40, 27, 66), 'bravado_core.param.get_param_type_spec'... |
truls/faas-profiler | functions/markdown-to-html/markdown2html.py | d54ca0d9926f38c693f616ba4d08414aea823f51 | # Copyright (c) 2019 Princeton University
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from markdown import markdown
import base64
import json
import base64
def main(params):
try:
md = json.loads(base64.decodebytes(params["__... | [((20, 11, 20, 28), 'markdown.markdown', 'markdown', ({(20, 20, 20, 27): 'md_text'}, {}), '(md_text)', False, 'from markdown import markdown\n'), ((14, 18, 14, 40), 'base64.decodebytes', 'base64.decodebytes', ({(14, 37, 14, 39): 'md'}, {}), '(md)', False, 'import base64\n')] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.