repo_name
stringlengths
7
94
repo_path
stringlengths
4
237
repo_head_hexsha
stringlengths
40
40
content
stringlengths
10
680k
apis
stringlengths
2
680k
jun-yoon/onnxruntime
docs/python/conf.py
806e24d5c69693533ed4b6fa56b84095efa5df70
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. # -*- coding: utf-8 -*- # # Configuration file for the Sphinx documentation builder. import os import sys import shutil # Check these extensions were installed. import sphinx_gallery.gen_gallery # The package should be insta...
[((1554, 1595), 'sphinx_modern_theme.get_html_theme_path', 'sphinx_modern_theme.get_html_theme_path', ([], {}), '()\n', (1593, 1595), False, 'import sphinx_modern_theme\n'), ((2640, 2672), 'os.path.join', 'os.path.join', (['this', '"""model.onnx"""'], {}), "(this, 'model.onnx')\n", (2652, 2672), False, 'import os\n'), ...
ngngardner/toc_project
traffic_sim/__main__.py
15a111a2731b583f82e65c622d16d32af4fe3ae0
"""Traffic simulator code.""" import sys from os import path from traffic_sim.analysis import TrafficExperiment from traffic_sim.console import console if not __package__: _path = path.realpath(path.abspath(__file__)) sys.path.insert(0, path.dirname(path.dirname(_path))) def main(): """Run code from CL...
[((330, 356), 'traffic_sim.console.console.log', 'console.log', (['"""traffic sim"""'], {}), "('traffic sim')\n", (341, 356), False, 'from traffic_sim.console import console\n'), ((386, 472), 'traffic_sim.analysis.TrafficExperiment', 'TrafficExperiment', ([], {'experiments': '(100)', 'trials': 'num_trials', 'rows': '(1...
ooblog/TSF1KEV
TSFpy/debug/sample_fibonacci.py
f7d4b4ff88f52ba00b46eb53ed98f8ea62ec2f6d
#! /usr/bin/env python # -*- coding: UTF-8 -*- from __future__ import division,print_function,absolute_import,unicode_literals import sys import os os.chdir(sys.path[0]) sys.path.append('/mnt/sda2/github/TSF1KEV/TSFpy') from TSF_io import * #from TSF_Forth import * from TSF_shuffle import * from TSF_match import * fro...
[((149, 170), 'os.chdir', 'os.chdir', (['sys.path[0]'], {}), '(sys.path[0])\n', (157, 170), False, 'import os\n'), ((171, 220), 'sys.path.append', 'sys.path.append', (['"""/mnt/sda2/github/TSF1KEV/TSFpy"""'], {}), "('/mnt/sda2/github/TSF1KEV/TSFpy')\n", (186, 220), False, 'import sys\n')]
rguptan/Tomboy2Evernote
Tomboy2Evernote.py
2bee66537d080c13856811b806613ca6aaef8833
#!/usr/bin/python # -*- coding: UTF-8 -*- import re import sys, getopt import glob import os def process_files(inputdir, outputdir): os.chdir(inputdir) enex_notes = [] output_filename = 'Tomboy2Evernote.enex' i = 0 for file in glob.glob("*.note"): note_file_path = inputdir + '/' + file ...
[]
williamfzc/pyat
demo.py
4e9792d4bfdc119d910eb88cf8a13a0ab7848518
from pyatool import PYAToolkit # 个性化的函数需要toolkit形参,即使不需要使用 def test_b(toolkit): return 'i am test_b, running on {}'.format(toolkit.device_id) # 封装adb命令成为方法 PYAToolkit.bind_cmd(func_name='test_a', command='shell pm list package | grep google') # 或者绑定个性化的函数 PYAToolkit.bind_func(real_func=test_b) # 是否需要log PYAToo...
[((164, 255), 'pyatool.PYAToolkit.bind_cmd', 'PYAToolkit.bind_cmd', ([], {'func_name': '"""test_a"""', 'command': '"""shell pm list package | grep google"""'}), "(func_name='test_a', command=\n 'shell pm list package | grep google')\n", (183, 255), False, 'from pyatool import PYAToolkit\n'), ((264, 302), 'pyatool.PY...
nlab-mpg/nnlab
nnlab/nn/graph.py
56aabb53fa7b86601b35c7b8c9e890d50e19d9af
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, division from six.moves import xrange, zip import tensorflow as tf from .tensor import Tensor class Graph(object): """The class for defining computational graph.""" def __init__(self, loss=None, modules...
[]
katiekruzan/masters-thesis
local-rotations.py
c9b89a0995957b5b50442b86ae8a38388f1fb720
""" Here we're going to code for the local rotations. We're doing an object oriented approach Left and right are in reference to the origin """ __version__ = 1.0 __author__ = 'Katie Kruzan' import string # just to get the alphabet easily iterable import sys # This just helps us in our printing from typing import Di...
[]
EtienneDavid/FROST
PT-FROST/frost.py
1cea124d69f07e3ac7e3ad074059d29c0849254c
import random import argparse import numpy as np import pandas as pd import os import time import string import torch import torch.nn as nn import torch.nn.functional as F from torch.utils.data import DataLoader from tqdm import tqdm from model import WideResnet from cifar import get_train_loader, get_val_loader from ...
[((454, 511), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '""" FixMatch Training"""'}), "(description=' FixMatch Training')\n", (477, 511), False, 'import argparse\n'), ((3352, 3363), 'time.time', 'time.time', ([], {}), '()\n', (3361, 3363), False, 'import time\n'), ((3430, 3456), 'os.pat...
Frightera/LR-and-NN-for-Cancer-Data
Logistic Regression/main.py
54f8c9455af529c512efe012d8b3ed3f6b594a57
import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt data = pd.read_csv("data.csv") data.info() """ Data columns (total 33 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 id 569 no...
[((101, 124), 'pandas.read_csv', 'pd.read_csv', (['"""data.csv"""'], {}), "('data.csv')\n", (112, 124), True, 'import pandas as pd\n'), ((1836, 1902), 'sklearn.model_selection.train_test_split', 'train_test_split', (['x_normalized', 'y'], {'test_size': '(0.25)', 'random_state': '(42)'}), '(x_normalized, y, test_size=0....
LinHuiqing/nonparaSeq2seqVC_code
fine-tune/inference_embedding.py
d40a0cb9dc11c77b8af56b8510e4ab041f2f2b25
import os import numpy as np import torch import argparse from hparams import create_hparams from model import lcm from train import load_model from torch.utils.data import DataLoader from reader import TextMelIDLoader, TextMelIDCollate, id2sp from inference_utils import plot_data parser = argparse.ArgumentParser() p...
[((293, 318), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (316, 318), False, 'import argparse\n'), ((638, 666), 'hparams.create_hparams', 'create_hparams', (['args.hparams'], {}), '(args.hparams)\n', (652, 666), False, 'from hparams import create_hparams\n'), ((676, 695), 'train.load_model',...
DALME/dalme
dalme_app/migrations/0001_initial.py
46f9a0011fdb75c5098b552104fc73b1062e16e9
# Generated by Django 3.1.2 on 2020-11-29 13:25 import dalme_app.models._templates from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django_currentuser.middleware import uuid import wagtail.search.index class Migration(migrations.Migration): initia...
[((359, 416), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (390, 416), False, 'from django.db import migrations, models\n'), ((63061, 63146), 'django.db.migrations.AlterUniqueTogether', 'migrations.AlterUniqueTogether...
Hezepeng/Financial-Acquisition-And-Editing-System
django_app/DataEntrySystem/apps.py
0781101e596a31d90bcfa3d67622472c04c6149f
from django.apps import AppConfig class DataentrysystemConfig(AppConfig): name = 'DataEntrySystem'
[]
JeFaProductions/bombgame2
bombgame/recursive_bt_maze.py
fc2ca7c6606aecd2bec013ed307aa344a0adffc7
# recursive_bt_maze.py # # Author: Jens Gansloser # Created On: 16 Feb 2019 import os import random import numpy as np class RecursiveBTMaze: def __init__(self, width, height): if width % 2 == 0 or height % 2 == 0: raise ValueError("Width and height need to be odd.") self.width = wid...
[((730, 768), 'numpy.ones', 'np.ones', (['(height, width)'], {'dtype': 'np.int'}), '((height, width), dtype=np.int)\n', (737, 768), True, 'import numpy as np\n'), ((377, 393), 'numpy.array', 'np.array', (['[0, 2]'], {}), '([0, 2])\n', (385, 393), True, 'import numpy as np\n'), ((419, 435), 'numpy.array', 'np.array', ([...
Nibuja05/KVConverter
KV_Reader.py
74f810df4ac82358f405eac9c2f56dce13b69302
import re import math class KVPart(): """docstring for KVPart""" def __init__(self, name, tab_count = 0): #super(KVPart, self).__init__() self.name = name self.values = [] self.tab_count = tab_count self.parent = None self.master = False def add_simple_value(self, value): self.values.append(value) ...
[((2506, 2541), 'math.floor', 'math.floor', (['((40 - new_position) / 5)'], {}), '((40 - new_position) / 5)\n', (2516, 2541), False, 'import math\n'), ((3583, 3613), 're.search', 're.search', (['quote_pattern', 'text'], {}), '(quote_pattern, text)\n', (3592, 3613), False, 'import re\n'), ((3629, 3658), 're.search', 're...
PaulDoessel/appleseed
scripts/updatetestsuiterefimages.py
142908e05609cd802b3ab937ff27ef2b73dd3088
#!/usr/bin/python # # This source file is part of appleseed. # Visit http://appleseedhq.net/ for additional information and resources. # # This software is released under the MIT license. # # Copyright (c) 2014-2016 Francois Beaune, The appleseedhq Organization # # Permission is hereby granted, free of charge, to any ...
[((2227, 2262), 'os.path.join', 'os.path.join', (['parent_dir', '"""renders"""'], {}), "(parent_dir, 'renders')\n", (2239, 2262), False, 'import os\n'), ((2277, 2308), 'os.path.join', 'os.path.join', (['parent_dir', '"""ref"""'], {}), "(parent_dir, 'ref')\n", (2289, 2308), False, 'import os\n'), ((2355, 2378), 'os.list...
Breee/raidquaza
raidquaza/poll/polls.py
308d643e71eddf6f6dc432c01322a02d604ac70e
from typing import List, Any import time from discord import Embed, Reaction from utils import uniquify # EMOJIS regional_indicator_A to regional_indicator_T reaction_emojies = ['\U0001F1E6', '\U0001F1E7', '\U0001F1E8', '\U0001F1E9', '\U00...
[((1275, 1286), 'time.time', 'time.time', ([], {}), '()\n', (1284, 1286), False, 'import time\n'), ((1314, 1325), 'time.time', 'time.time', ([], {}), '()\n', (1323, 1325), False, 'import time\n'), ((1386, 1403), 'utils.uniquify', 'uniquify', (['options'], {}), '(options)\n', (1394, 1403), False, 'from utils import uniq...
pavstar619/HackerRank
Python/Regex and Parsing/Validating and Parsing Email Addresses.py
697ee46b6e621ad884a064047461d7707b1413cd
import email.utils as em import re class Main(): def __init__(self): self.n = int(input()) for i in range(self.n): self.s = em.parseaddr(input()) if re.match(r'^[a-zA-Z](\w|-|\.|_)+@[a-zA-Z]+\.[a-zA-Z]{0,3}$', self.s[1]): print(em.format...
[((216, 289), 're.match', 're.match', (['"""^[a-zA-Z](\\\\w|-|\\\\.|_)+@[a-zA-Z]+\\\\.[a-zA-Z]{0,3}$"""', 'self.s[1]'], {}), "('^[a-zA-Z](\\\\w|-|\\\\.|_)+@[a-zA-Z]+\\\\.[a-zA-Z]{0,3}$', self.s[1])\n", (224, 289), False, 'import re\n'), ((311, 332), 'email.utils.formataddr', 'em.formataddr', (['self.s'], {}), '(self.s)...
codingsoo/virtaul_girlfriend
chatbot/train.py
7343cb95cc8ab345b735fdb07cfac8176cc41f76
# -*- coding: utf-8 -*- import tensorflow as tf import random import math import os from config import FLAGS from model import Seq2Seq from dialog import Dialog def train(dialog, batch_size=100, epoch=100): model = Seq2Seq(dialog.vocab_size) with tf.Session() as sess: # TODO: 세션을 로드하고 로그를 위한 summar...
[]
rock-learning/approxik
evaluation/dmp_behavior.py
877d50d4d045457593a2fafefd267339a11de20f
# Author: Alexander Fabisch <Alexander.Fabisch@dfki.de> import numpy as np from bolero.representation import BlackBoxBehavior from bolero.representation import DMPBehavior as DMPBehaviorImpl class DMPBehavior(BlackBoxBehavior): """Dynamical Movement Primitive. Parameters ---------- execution_time : ...
[((929, 996), 'bolero.representation.DMPBehavior', 'DMPBehaviorImpl', (['execution_time', 'dt', 'n_features', 'configuration_file'], {}), '(execution_time, dt, n_features, configuration_file)\n', (944, 996), True, 'from bolero.representation import DMPBehavior as DMPBehaviorImpl\n'), ((1369, 1396), 'numpy.empty', 'np.e...
oxsoftdev/bitstampws-logger
logger.py
5597010cad53cd55e949235fbc191f8b1aad344d
import logging.config import tornado from bitstampws import Client as Websocket import lib.configs.logging from lib.subscribers import SimpleLoggerSubscriber logging.config.dictConfig(lib.configs.logging.d) if __name__ == '__main__': with Websocket() as client: with SimpleLoggerSubscriber(client): ...
[((248, 259), 'bitstampws.Client', 'Websocket', ([], {}), '()\n', (257, 259), True, 'from bitstampws import Client as Websocket\n'), ((284, 314), 'lib.subscribers.SimpleLoggerSubscriber', 'SimpleLoggerSubscriber', (['client'], {}), '(client)\n', (306, 314), False, 'from lib.subscribers import SimpleLoggerSubscriber\n')...
dougsc/gp
engine/tree.py
d144dd1f483150b26483077e6e5032f4f21a6d4e
import random from pprint import pformat from copy import deepcopy from utils.logger import GP_Logger from terminal_set import TerminalSet class Tree: @classmethod def log(cls): return GP_Logger.logger(cls.__name__) def __init__(self): self.terminal_set=None self.function_set=None self.function_...
[]
wilsonGmn/pyrin
src/pyrin/packaging/__init__.py
25dbe3ce17e80a43eee7cfc7140b4c268a6948e0
# -*- coding: utf-8 -*- """ packaging package. """ from pyrin.packaging.base import Package class PackagingPackage(Package): """ packaging package class. """ NAME = __name__ COMPONENT_NAME = 'packaging.component' CONFIG_STORE_NAMES = ['packaging']
[]
marble-git/python-laoqi
chap7/heapq_merge.py
74c4bb5459113e54ce64443e5da5a9c6a3052d6a
#coding:utf-8 ''' filename:heapq_merge.py chap:7 subject:4-2 conditions:heapq.merge,sorted_list:lst1,lst2 lst3=merged_list(lst1,lst2) is sorted solution:heapq.merge ''' import heapq lst1 = [1,3,5,7,9] lst2 = [2,4,6,8] if __name__ == '__main__': lst3 = heapq.merge(lst1,lst...
[((300, 323), 'heapq.merge', 'heapq.merge', (['lst1', 'lst2'], {}), '(lst1, lst2)\n', (311, 323), False, 'import heapq\n')]
kustodian/google-cloud-sdk
lib/googlecloudsdk/third_party/apis/serviceuser/v1/serviceuser_v1_client.py
b6bae4137d4b58030adb3dcb1271216dfb19f96d
"""Generated client library for serviceuser version v1.""" # NOTE: This file is autogenerated and should not be edited by hand. from apitools.base.py import base_api from googlecloudsdk.third_party.apis.serviceuser.v1 import serviceuser_v1_messages as messages class ServiceuserV1(base_api.BaseApiClient): """Generat...
[((2818, 3288), 'apitools.base.py.base_api.ApiMethodInfo', 'base_api.ApiMethodInfo', ([], {'http_method': 'u"""POST"""', 'method_id': 'u"""serviceuser.projects.services.disable"""', 'ordered_params': "[u'projectsId', u'servicesId']", 'path_params': "[u'projectsId', u'servicesId']", 'query_params': '[]', 'relative_path'...
lithathampan/wav2letter
bindings/python/examples/feature_example.py
8abf8431d99da147cc4aefc289ad33626e13de6f
#!/usr/bin/env python3 # adapted from wav2letter/src/feature/test/MfccTest.cpp import itertools as it import os import sys from wav2letter.feature import FeatureParams, Mfcc def load_data(filename): path = os.path.join(data_path, filename) path = os.path.abspath(path) with open(path) as f: retu...
[((215, 248), 'os.path.join', 'os.path.join', (['data_path', 'filename'], {}), '(data_path, filename)\n', (227, 248), False, 'import os\n'), ((260, 281), 'os.path.abspath', 'os.path.abspath', (['path'], {}), '(path)\n', (275, 281), False, 'import os\n'), ((855, 870), 'wav2letter.feature.FeatureParams', 'FeatureParams',...
shreyashack/PY_Message_Decryption
app.py
251a82ee26c529ff63668328230c9d494f4c9cfa
from tkinter import * import onetimepad class Message_Decrypt: def __init__(self,root): self.root=root self.root.title("Message Decryption") self.root.geometry("400x475") self.root.iconbitmap("logo368.ico") self.root.resizable(0,0) def on_enter1(e): but...
[((1056, 1087), 'onetimepad.decrypt', 'onetimepad.decrypt', (['b', '"""random"""'], {}), "(b, 'random')\n", (1074, 1087), False, 'import onetimepad\n')]
abcamiletto/urdf2optcontrol
examples/rrbot_p2p_low_energy.py
39b3f761a4685cc7d50b48793b6b2906c89b1694
#!/usr/bin/env python3 from urdf2optcontrol import optimizer from matplotlib import pyplot as plt import pathlib # URDF options urdf_path = pathlib.Path(__file__).parent.joinpath('urdf', 'rrbot.urdf').absolute() root = "link1" end = "link3" in_cond = [0] * 4 def my_cost_func(q, qd, qdd, ee_pos, u, t): return u....
[((875, 917), 'urdf2optcontrol.optimizer.load_robot', 'optimizer.load_robot', (['urdf_path', 'root', 'end'], {}), '(urdf_path, root, end)\n', (895, 917), False, 'from urdf2optcontrol import optimizer\n'), ((952, 1123), 'urdf2optcontrol.optimizer.load_problem', 'optimizer.load_problem', (['my_cost_func', 'steps', 'in_co...
fqc/SocketSample_Mina_Socket
SocketServer/apps/django-db-pool-master/dbpool/db/backends/postgresql_psycopg2/base.py
f5a7bb9bcd6052fe9e2a419c877073b32be4dc3d
""" Pooled PostgreSQL database backend for Django. Requires psycopg 2: http://initd.org/projects/psycopg2 """ from django import get_version as get_django_version from django.db.backends.postgresql_psycopg2.base import \ DatabaseWrapper as OriginalDatabaseWrapper from django.db.backends.signals import connection_c...
[]
abodacs/fastapi-ml-skeleton
backend/tests/test_api/test_api_auth.py
fa9a013d06e70cbaff9b9469db32246e41ce7e0f
# Skeleton from fastapi_skeleton.core import messages def test_auth_using_prediction_api_no_apikey_header(test_client) -> None: response = test_client.post("/api/model/predict") assert response.status_code == 400 assert response.json() == {"detail": messages.NO_API_KEY} def test_auth_using_prediction_ap...
[]
hashnfv/hashnfv-nfvbench
docker/cleanup_generators.py
8da439b932537748d379c7bd3bdf560ef739b203
# Copyright 2016 Cisco Systems, Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
[]
ophirSarusi/TF_Object_Detection
object_detection/box_coders/mean_stddev_box_coder.py
e08ccd18c6f14586e048048a445cf5a10dbc7c4d
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
[((2403, 2432), 'object_detection.core.box_list.BoxList', 'box_list.BoxList', (['box_corners'], {}), '(box_corners)\n', (2419, 2432), False, 'from object_detection.core import box_list\n')]
nsortur/equi_rl
storage/aug_buffer.py
83bd2ee9dfaab715e51b71ffff90ab990aaed5f8
from storage.buffer import QLearningBuffer from utils.torch_utils import ExpertTransition, augmentTransition from utils.parameters import buffer_aug_type class QLearningBufferAug(QLearningBuffer): def __init__(self, size, aug_n=9): super().__init__(size) self.aug_n = aug_n def add(self, transi...
[((437, 483), 'utils.torch_utils.augmentTransition', 'augmentTransition', (['transition', 'buffer_aug_type'], {}), '(transition, buffer_aug_type)\n', (454, 483), False, 'from utils.torch_utils import ExpertTransition, augmentTransition\n')]
Chainso/HLRL
hlrl/torch/agents/wrappers/agent.py
584f4ed2fa4d8b311a21dbd862ec9434833dd7cd
import torch from typing import Any, Dict, List, OrderedDict, Tuple from hlrl.core.agents import RLAgent from hlrl.core.common.wrappers import MethodWrapper class TorchRLAgent(MethodWrapper): """ A torch agent that wraps its experiences as torch tensors. """ def __init__(self, agent:...
[((3427, 3460), 'torch.cat', 'torch.cat', (['ready_experiences[key]'], {}), '(ready_experiences[key])\n', (3436, 3460), False, 'import torch\n'), ((899, 922), 'torch.FloatTensor', 'torch.FloatTensor', (['data'], {}), '(data)\n', (916, 922), False, 'import torch\n')]
NHOrus/PixivUtil2
PixivConstant.py
facd6b1a21e4adf5edf1de4d4809e94e834246b6
# -*- coding: utf-8 -*- PIXIVUTIL_VERSION = '20191220-beta1' PIXIVUTIL_LINK = 'https://github.com/Nandaka/PixivUtil2/releases' PIXIVUTIL_DONATE = 'https://bit.ly/PixivUtilDonation' # Log Settings PIXIVUTIL_LOG_FILE = 'pixivutil.log' PIXIVUTIL_LOG_SIZE = 10485760 PIXIVUTIL_LOG_COUNT = 10 PIXIVUTIL_LOG_FORMAT = "%(asct...
[]
Threemusketeerz/DSystems
dynamic_schemas/views.py
cd03ad2fa6b55872d57bfd01a4ac781aa5cbed8c
from django.http import Http404 from django.shortcuts import render, redirect, reverse from django.views.generic import ListView from django.contrib.auth.decorators import login_required from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.auth.models import User from rest_framework import st...
[((1493, 1602), 'django.shortcuts.render', 'render', (['request', 'f"""dynamic_schemas/create-form.html"""', "{'form': form, 'schema': schema, 'help_urls': urls}"], {}), "(request, f'dynamic_schemas/create-form.html', {'form': form,\n 'schema': schema, 'help_urls': urls})\n", (1499, 1602), False, 'from django.shortc...
minefarmer/deep-Dive-1
my_classes/.history/ModulesPackages_PackageNamespaces/example3a/main_20210725220637.py
b0675b853180c5b5781888266ea63a3793b8d855
import os.path import types import sys
[]
conscience99/lyriko
api/views.py
0ecc9e4d5ec8e3d746fcb286209a1e7993548a66
from django.shortcuts import render from rest_framework import response from rest_framework.serializers import Serializer from . import serializers from rest_framework.response import Response from rest_framework.views import APIView from django.views import View from rest_framework import status from . models import S...
[((1475, 1489), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (1487, 1489), False, 'from datetime import datetime\n'), ((1545, 1559), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (1557, 1559), False, 'from datetime import datetime\n'), ((4296, 4326), 'random.randint', 'random.randint', (['(19...
AbhilashDatta/InstagramBot
__dm__.py
21916fcfc621ae3185df8494b12aa35743c165f8
from selenium import webdriver from time import sleep from selenium.webdriver.common.keys import Keys from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.by import By from selenium.webdriver.support.wait import WebDriverWait def Dm(driver,user,message): ''' This functio...
[((678, 780), 'selenium.webdriver.support.expected_conditions.element_to_be_clickable', 'EC.element_to_be_clickable', (["(By.XPATH, '/html/body/div[5]/div/div/div[2]/div[1]/div/div[2]/input')"], {}), "((By.XPATH,\n '/html/body/div[5]/div/div/div[2]/div[1]/div/div[2]/input'))\n", (704, 780), True, 'from selenium.webd...
Yotamefr/BeitBiram
mashov.py
84bd6abddf6ac865b502e0692561ee48d510ef7c
import requests from datetime import datetime import json from extras import Day, Lesson class PasswordError(Exception): pass class LoginFailed(Exception): pass class MashovAPI: """ MashovAPI Originally made by Xiddoc. Project can be found here: https://github.com/Xiddoc/MashovAPI Modifica...
[((745, 763), 'requests.Session', 'requests.Session', ([], {}), '()\n', (761, 763), False, 'import requests\n'), ((2868, 2898), 'json.loads', 'json.loads', (['self.ret_data.text'], {}), '(self.ret_data.text)\n', (2878, 2898), False, 'import json\n'), ((10787, 10804), 'extras.Day', 'Day', (['day_num', 'day'], {}), '(day...
jschmidtnj/CS115
lab6.py
fa2374f1ae9c9b63e572850a97af6086112d7a36
''' Created on 10/11/2017 @author: jschmid3@stevens.edu Pledge: I pledge my honor that I have abided by the Stevens Honor System -Joshua Schmidt CS115 - Lab 6 ''' def isOdd(n): '''Returns whether or not the integer argument is odd.''' #question 1: base_2 of 42: 101010 if n == 0: return False ...
[]
imyz/25000
clover.py
909b6ceaf326138b0684e6600f347a38fe68f9f0
#!/usr/bin/env python from math import * import sys def rotate(x, y, degrees): c = cos(pi * degrees / 180.0) s = sin(pi * degrees / 180.0) return x * c + y * s, y * c - x * s def move(verb, **kwargs): keys = kwargs.keys() keys.sort() words = [verb.upper()] for key in keys: words.a...
[]
asiakaczmar/noise2self
scripts/mnist_inference.py
75daaf188c49bff0da22c235540da20f4eca9614
import torch from torchvision.datasets import MNIST from torchvision import transforms from torch.utils.data import DataLoader from scripts.utils import SyntheticNoiseDataset from models.babyunet import BabyUnet CHECKPOINTS_PATH = '../checkpoints/' mnist_test = MNIST('../inferred_data/MNIST', download=True, ...
[]
sdcubber/kaggle_carvana
src/processing/augmentation.py
44f6c7f1e80be2caa3c7ad4c7fb69067af45fe8f
# Script for data augmentation functions import numpy as np from collections import deque from PIL import Image import cv2 from data.config import * def imread_cv2(image_path): """ Read image_path with cv2 format (H, W, C) if image is '.gif' outputs is a numpy array of {0,1} """ image_format = ima...
[((538, 589), 'cv2.resize', 'cv2.resize', (['image', '(width, heigh)', 'cv2.INTER_LINEAR'], {}), '(image, (width, heigh), cv2.INTER_LINEAR)\n', (548, 589), False, 'import cv2\n'), ((379, 401), 'cv2.imread', 'cv2.imread', (['image_path'], {}), '(image_path)\n', (389, 401), False, 'import cv2\n'), ((1257, 1275), 'numpy.r...
tohugaby/pur_beurre_web
substitute_finder/templatetags/substitute_finder_extra.py
c3bdacee50907eea79821e7a8b3fe0f349719d88
""" substitute_finder app custom templatetags module """ from django import template register = template.Library() @register.filter def range_tag(value, min_value=0): """ tag that return a range """ if value: return range(min_value, value) return range(min_value)
[((97, 115), 'django.template.Library', 'template.Library', ([], {}), '()\n', (113, 115), False, 'from django import template\n')]
AlexandraAlter/django-terrafirma
terrafirma/core/views/env.py
afce5946f173aded2b4bfea78cf1b1034ec32272
from django.shortcuts import render, redirect, get_object_or_404 from django.urls import reverse_lazy from django import views from django.views import generic as g_views from django.views.generic import base as b_views, edit as e_views from .. import forms, models class NewEnvView(e_views.CreateView): model = m...
[((388, 408), 'django.urls.reverse_lazy', 'reverse_lazy', (['"""home"""'], {}), "('home')\n", (400, 408), False, 'from django.urls import reverse_lazy\n'), ((563, 629), 'django.shortcuts.get_object_or_404', 'get_object_or_404', (['models.Environment'], {'abbrev': "kwargs['env_abbrev']"}), "(models.Environment, abbrev=k...
JustinGOSSES/geoviz
geoviz/__init__.py
159b0665d9efcffe46061313c15ad09ced840d2d
from load_las_data import LoadLasData from altair_log_plot import AltAirLogPlot from load_shapefile_data import LoadShpData from alitair_well_location_map import WellLocationMap
[]
ahmad-PH/auto_lcc
core/data/utils.py
55a6ac0e92994f4eed9951a27b7aa0d834f9d804
import pickle import pandas as pd from typing import List, Tuple def load_libofc_df(data_path): def tuple_to_df(data: List[Tuple]) -> pd.DataFrame: return pd.DataFrame(data, columns=["class", "title", "synopsis", "id"]) with open(data_path, 'rb') as f: classes = pickle.load(f) train = ...
[((168, 232), 'pandas.DataFrame', 'pd.DataFrame', (['data'], {'columns': "['class', 'title', 'synopsis', 'id']"}), "(data, columns=['class', 'title', 'synopsis', 'id'])\n", (180, 232), True, 'import pandas as pd\n'), ((289, 303), 'pickle.load', 'pickle.load', (['f'], {}), '(f)\n', (300, 303), False, 'import pickle\n'),...
hhdMrLion/mxshop-api
apps/users/adminx.py
1472ad0d959439ea80c1f8d8bfd3629c15d3017d
import xadmin from users.models import VerifyCode from xadmin import views class BaseSetting(object): # 添加主题功能 enable_themes = True user_bootswatch = True class GlobalSettings(object): # 全局配置,后端管理标题和页脚 site_title = '天天生鲜后台管理' site_footer = 'https://www.qnmlgb.top/' # 菜单收缩 ...
[((442, 491), 'xadmin.site.register', 'xadmin.site.register', (['VerifyCode', 'VerifyCodeAdmin'], {}), '(VerifyCode, VerifyCodeAdmin)\n', (462, 491), False, 'import xadmin\n'), ((493, 547), 'xadmin.site.register', 'xadmin.site.register', (['views.BaseAdminView', 'BaseSetting'], {}), '(views.BaseAdminView, BaseSetting)\...
Yeok-c/Urban-Sound-Classification
Archive/train_cnn.py
98c46eb54266ef7b859d192e9bebe8a5d48e1708
### Load necessary libraries ### import numpy as np from sklearn.model_selection import KFold from sklearn.metrics import accuracy_score import tensorflow as tf from tensorflow import keras from sklearn.metrics import ConfusionMatrixDisplay model = get_network() model.summary() ### Train and evaluate via 10-Folds ...
[((365, 470), 'numpy.array', 'np.array', (["['fold1', 'fold2', 'fold3', 'fold4', 'fold5', 'fold6', 'fold7', 'fold8',\n 'fold9', 'fold10']"], {}), "(['fold1', 'fold2', 'fold3', 'fold4', 'fold5', 'fold6', 'fold7',\n 'fold8', 'fold9', 'fold10'])\n", (373, 470), True, 'import numpy as np\n'), ((539, 557), 'sklearn.mo...
wyaadarsh/LeetCode-Solutions
Python3/1436-Destination-City/soln.py
3719f5cb059eefd66b83eb8ae990652f4b7fd124
class Solution: def destCity(self, paths: List[List[str]]) -> str: bads = set() cities = set() for u, v in paths: cities.add(u) cities.add(v) bads.add(u) ans = cities - bads return list(ans)[0]
[]
zillow/metaflow
metaflow/plugins/kfp/tests/flows/resources_flow.py
a42dc9eab04695f2b0a429874e607ed67d5a2b45
import os import pprint import subprocess import time from typing import Dict, List from kubernetes.client import ( V1EnvVar, V1EnvVarSource, V1ObjectFieldSelector, V1ResourceFieldSelector, ) from metaflow import FlowSpec, step, environment, resources, current def get_env_vars(env_resources: Dict[st...
[((2696, 2750), 'metaflow.resources', 'resources', ([], {'local_storage': '"""242"""', 'cpu': '"""0.6"""', 'memory': '"""1G"""'}), "(local_storage='242', cpu='0.6', memory='1G')\n", (2705, 2750), False, 'from metaflow import FlowSpec, step, environment, resources, current\n'), ((2787, 2857), 'metaflow.environment', 'en...
redfrexx/osm_association_rules
src/nb_utils/general.py
33975ce25047f9ab3b21e890bc5ed9bab59a0a2f
#!/usr/bin/env python # -*- coding: utf-8 -*- """Functions used for data handling """ __author__ = "Christina Ludwig, GIScience Research Group, Heidelberg University" __email__ = "christina.ludwig@uni-heidelberg.de" import os import yaml from shapely.geometry import box import numpy as np import pandas as pd import g...
[((3258, 3292), 'pandas.concat', 'pd.concat', (['loaded_tags_dfs'], {'axis': '(0)'}), '(loaded_tags_dfs, axis=0)\n', (3267, 3292), True, 'import pandas as pd\n'), ((3358, 3395), 'pandas.concat', 'pd.concat', (['loaded_context_dfs'], {'axis': '(0)'}), '(loaded_context_dfs, axis=0)\n', (3367, 3395), True, 'import pandas ...
darren-wang/ksc
keystoneclient/auth/identity/v3/federated.py
fd096540e8e57b6bd7c923f4cb4ad6616d103cc8
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
[((733, 763), 'six.add_metaclass', 'six.add_metaclass', (['abc.ABCMeta'], {}), '(abc.ABCMeta)\n', (750, 763), False, 'import six\n'), ((1714, 1778), 'oslo_config.cfg.StrOpt', 'cfg.StrOpt', (['"""identity-provider"""'], {'help': '"""Identity Provider\'s name"""'}), '(\'identity-provider\', help="Identity Provider\'s nam...
lefevre-fraser/openmeta-mms
bin/Python27/Lib/site-packages/tables/utilsExtension.py
08f3115e76498df1f8d70641d71f5c52cab4ce5f
from warnings import warn from tables.utilsextension import * _warnmsg = ("utilsExtension is pending deprecation, import utilsextension instead. " "You may use the pt2to3 tool to update your source code.") warn(_warnmsg, DeprecationWarning, stacklevel=2)
[((224, 272), 'warnings.warn', 'warn', (['_warnmsg', 'DeprecationWarning'], {'stacklevel': '(2)'}), '(_warnmsg, DeprecationWarning, stacklevel=2)\n', (228, 272), False, 'from warnings import warn\n')]
iDevHank/i18n
config.py
ec731b5d6fab330a868ebb9f9e11ff1caef629ef
#!/usr/bin/env python3 # The format of your own localizable method. # This is an example of '"string".localized' SUFFIX = '.localized' KEY = r'"(?:\\.|[^"\\])*"' LOCALIZABLE_RE = r'%s%s' % (KEY, SUFFIX) # Specify the path of localizable files in project. LOCALIZABLE_FILE_PATH = '' LOCALIZABLE_FILE_NAMES = ['Localizab...
[]
Astewart1510/pvt-algoranddashboard
dashboard_analytics/tasks/transaction_processor.py
6fb6cf37b483339f24cc86f0a95fb2245be492ca
from dashboard_analytics.models import AccountType, InstrumentType, Account, Transaction def process_json_transactions(transactions): for txn in transactions: print(txn["pk"])
[]
hschwane/offline_production
MuonGun/resources/scripts/histreduce.py
e14a6493782f613b8bbe64217559765d5213dc1e
#!/usr/bin/env python """ Add all (potentially gigantic) histograms in a group of files. """ import dashi import tables import os, sys, operator, shutil from optparse import OptionParser parser = OptionParser(usage="%prog [OPTIONS] infiles outfile", description=__doc__) parser.add_option("--blocksize", dest="blocksi...
[((199, 273), 'optparse.OptionParser', 'OptionParser', ([], {'usage': '"""%prog [OPTIONS] infiles outfile"""', 'description': '__doc__'}), "(usage='%prog [OPTIONS] infiles outfile', description=__doc__)\n", (211, 273), False, 'from optparse import OptionParser\n'), ((517, 540), 'os.path.exists', 'os.path.exists', (['ou...
ignaciocabeza/procrastinate
procrastinate/exceptions.py
95ba8c7acdf39aa7a1216c19903802b4f65b65d1
import datetime class ProcrastinateException(Exception): """ Unexpected Procrastinate error. """ def __init__(self, message=None): if not message: message = self.__doc__ super().__init__(message) class TaskNotFound(ProcrastinateException): """ Task cannot be impo...
[]
vyshakTs/STORE_MANAGEMENT_SYSTEM
config/settings/local.py
b6b82a02c0b512083c35a8656e191436552569a9
from .base import * DEBUG = True EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql', 'NAME': 'SMS', 'USER': 'postgres', 'PASSWORD': 'password', 'HOST': 'localhost', 'PORT': '', }...
[]
haojunsng/foodpanda-dataeng
question3.py
b1b9a5c615113a1b8727c9c7dfe7ad3e50059428
from functions import get_df, write_df import geopy from geopy import distance """ The function question3 takes in the latitude and longitude of potential distress locations, and returns the nearest port with essential provisions such as water, fuel_oil and diesel. """ def question3(dataset_name, latitude, longitude)...
[((332, 340), 'functions.get_df', 'get_df', ([], {}), '()\n', (338, 340), False, 'from functions import get_df, write_df\n'), ((956, 1011), 'functions.write_df', 'write_df', (['answer3', 'dataset_name', '"""Table for Question 3"""'], {}), "(answer3, dataset_name, 'Table for Question 3')\n", (964, 1011), False, 'from fu...
valory-xyz/agents-aea
plugins/aea-cli-benchmark/aea_cli_benchmark/case_acn_communication/case.py
8f38efa96041b0156ed1ae328178e395dbabf2fc
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # # Copyright 2022 Valory AG # Copyright 2018-2021 Fetch.AI Limited # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance...
[((1710, 1721), 'time.time', 'time.time', ([], {}), '()\n', (1719, 1721), False, 'import time\n'), ((1925, 2062), 'packages.fetchai.protocols.default.message.DefaultMessage', 'DefaultMessage', ([], {'dialogue_reference': "('', '')", 'message_id': '(1)', 'target': '(0)', 'performative': 'DefaultMessage.Performative.BYTE...
q4a/bullet3
examples/pybullet/vr_kuka_setup.py
b077f74f5675fb9ca7bafd238f097f87bf6c0367
import pybullet as p #p.connect(p.UDP,"192.168.86.100") p.connect(p.SHARED_MEMORY) p.resetSimulation() objects = [p.loadURDF("plane.urdf", 0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,1.000000)] objects = [p.loadURDF("samurai.urdf", 0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,1.000000)] objects = [p...
[((56, 82), 'pybullet.connect', 'p.connect', (['p.SHARED_MEMORY'], {}), '(p.SHARED_MEMORY)\n', (65, 82), True, 'import pybullet as p\n'), ((83, 102), 'pybullet.resetSimulation', 'p.resetSimulation', ([], {}), '()\n', (100, 102), True, 'import pybullet as p\n'), ((681, 789), 'pybullet.createConstraint', 'p.createConstra...
SvoONs/genomics_algo
genomics_algo/utilities/string_cmp.py
3174c1e9e685db12c5849ce5c7e3411f1922a4be
def longest_common_prefix(s1: str, s2: str) -> str: """ Finds the longest common prefix (substring) given two strings s1: First string to compare s2: Second string to compare Returns: Longest common prefix between s1 and s2 >>> longest_common_prefix("ACTA", "GCCT") '' >>> long...
[]
whythawk/whyqd
whyqd/parsers/wrangling_parser.py
8ee41768d6788318458d41831200594b61777ccc
from __future__ import annotations from typing import Optional, Dict, List, Union, Type, TYPE_CHECKING from datetime import date, datetime import pandas as pd import numpy as np import re import locale try: locale.setlocale(locale.LC_ALL, "en_US.UTF-8") except locale.Error: # Readthedocs has a problem, but dif...
[((212, 258), 'locale.setlocale', 'locale.setlocale', (['locale.LC_ALL', '"""en_US.UTF-8"""'], {}), "(locale.LC_ALL, 'en_US.UTF-8')\n", (228, 258), False, 'import locale\n'), ((5556, 5573), 'typing.List', 'List', (['ColumnModel'], {}), '(ColumnModel)\n', (5560, 5573), False, 'from typing import Optional, Dict, List, Un...
FatChicken277/holbertonschool-higher_level_programming
0x02-python-import_modules/2-args.py
520d6310a5e2a874f8c5f5185d0fb769b6412e7c
#!/usr/bin/python3 def args(args): lenn = len(args) - 1 if lenn == 0: print("0 arguments.") elif lenn == 1: print("{0} argument:".format(lenn)) print("{0}: {1}".format(lenn, args[lenn])) elif lenn > 1: print("{0} arguments:".format(lenn)) for i in range(lenn): ...
[]
rychallener/TauREx3_public
taurex/data/profiles/__init__.py
eb0eeeeca8f47e5e7d64d8d70b43a3af370b7677
""" These modules contain sub-modules related to defining various profiles in a model """
[]
yuetsin/AoC
day-2/part_b.py
a7c5aea245ee6e77312352907fc4d1ac8eac2d3a
#!/usr/bin/env python3 import re def get_input() -> list: with open('./input', 'r') as f: return [v for v in [v.strip() for v in f.readlines()] if v] lines = get_input() count = 0 for line in lines: lower, upper, char, password = re.split(r'-|: | ', line) lower, upper = int(lower) - 1, int(upp...
[((252, 276), 're.split', 're.split', (['"""-|: | """', 'line'], {}), "('-|: | ', line)\n", (260, 276), False, 'import re\n')]
devanshslnk/HelpOff
src/tone.py
bbeddc8bbb9d26bbc85f572d4769fc9fc92d5c4a
from __future__ import print_function import json from os.path import join, dirname from watson_developer_cloud import ToneAnalyzerV3 from watson_developer_cloud.tone_analyzer_v3 import ToneInput from pprint import pprint # If service instance provides API key authentication # service = ToneAnalyzerV3( # ## url i...
[((537, 652), 'watson_developer_cloud.ToneAnalyzerV3', 'ToneAnalyzerV3', ([], {'username': '"""f0ec47cc-5191-4421-8fca-2395917e1640"""', 'password': '"""q7JOpjOabiY5"""', 'version': '"""2017-09-21"""'}), "(username='f0ec47cc-5191-4421-8fca-2395917e1640', password=\n 'q7JOpjOabiY5', version='2017-09-21')\n", (551, 65...
usmannasir/hcloud-python
hcloud/servers/domain.py
2a90551fb1c4d9d8a6aea5d8b6601a7c1360494d
# -*- coding: utf-8 -*- from hcloud.core.domain import BaseDomain from hcloud.helpers.descriptors import ISODateTime class Server(BaseDomain): """Server Domain :param id: int ID of the server :param name: str Name of the server (must be unique per project and a valid hostname as pe...
[((2985, 2998), 'hcloud.helpers.descriptors.ISODateTime', 'ISODateTime', ([], {}), '()\n', (2996, 2998), False, 'from hcloud.helpers.descriptors import ISODateTime\n')]
sbarguil/Testing-framework
AutomationFramework/tests/interfaces/test_if_subif.py
f3ef69f1c4f0aeafd02e222d846162c711783b15
import pytest from AutomationFramework.page_objects.interfaces.interfaces import Interfaces from AutomationFramework.tests.base_test import BaseTest class TestInterfacesSubInterfaces(BaseTest): test_case_file = 'if_subif.yml' @pytest.mark.parametrize('create_page_object_arg', [{'test_case_file': test_case_fi...
[((238, 408), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""create_page_object_arg"""', "[{'test_case_file': test_case_file, 'test_case_name':\n 'if_subif_description', 'page_object_class': Interfaces}]"], {}), "('create_page_object_arg', [{'test_case_file':\n test_case_file, 'test_case_name': 'if_s...
sanket4373/keystone
keystone/common/sql/migrate_repo/versions/001_add_initial_tables.py
7cf7e7497729803f0470167315af9349b88fe0ec
# Copyright 2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
[((760, 774), 'sqlalchemy.MetaData', 'sql.MetaData', ([], {}), '()\n', (772, 774), True, 'import sqlalchemy as sql\n'), ((5454, 5468), 'sqlalchemy.MetaData', 'sql.MetaData', ([], {}), '()\n', (5466, 5468), True, 'import sqlalchemy as sql\n'), ((5680, 5713), 'sqlalchemy.Table', 'sql.Table', (['t', 'meta'], {'autoload': ...
DanPopa46/neo3-boa
boa3_test/examples/ico.py
e4ef340744b5bd25ade26f847eac50789b97f3e9
from typing import Any, List, Union from boa3.builtin import NeoMetadata, metadata, public from boa3.builtin.contract import Nep17TransferEvent from boa3.builtin.interop.blockchain import get_contract from boa3.builtin.interop.contract import GAS, NEO, call_contract from boa3.builtin.interop.runtime import calling_scr...
[((1312, 1321), 'boa3.builtin.type.UInt160', 'UInt160', ([], {}), '()\n', (1319, 1321), False, 'from boa3.builtin.type import UInt160\n'), ((679, 692), 'boa3.builtin.NeoMetadata', 'NeoMetadata', ([], {}), '()\n', (690, 692), False, 'from boa3.builtin import NeoMetadata, metadata, public\n'), ((2364, 2390), 'boa3.builti...
Partaourides/SERN
emotion_recognition.py
e6cc0a9a0cc3ac4b9a87e3ccdf5781792f85d718
import os # Restrict the script to run on CPU os.environ ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID" os.environ["CUDA_VISIBLE_DEVICES"] = "" # Import Keras Tensoflow Backend # from keras import backend as K import tensorflow as tf # Configure it to use only specific CPU Cores config = tf.ConfigProto(intra_op_parallelism_thre...
[((280, 425), 'tensorflow.ConfigProto', 'tf.ConfigProto', ([], {'intra_op_parallelism_threads': '(4)', 'inter_op_parallelism_threads': '(4)', 'device_count': "{'CPU': 1, 'GPU': 0}", 'allow_soft_placement': '(True)'}), "(intra_op_parallelism_threads=4, inter_op_parallelism_threads\n =4, device_count={'CPU': 1, 'GPU':...
flaree/Toxic-Cogs
dashboard/rpc/alias.py
e33c3fe3a81c86ef3c89928b0a977fae13b916a9
import discord from redbot.core.bot import Red from redbot.core.commands import commands from redbot.core.utils.chat_formatting import humanize_list from .utils import permcheck, rpccheck class DashboardRPC_AliasCC: def __init__(self, cog: commands.Cog): self.bot: Red = cog.bot self.co...
[]
hafezgh/music_classification
train.py
68fa398b7d4455475d07ae17c3b6b94459a96ac7
import torch DEVICE = 'cuda' import math import torch.optim as optim from model import * import os import copy, gzip, pickle, time data_dir = './drive/MyDrive/music_classification/Data' classes = os.listdir(data_dir+'/images_original') def fit(model, train_loader, train_len, optimizer, criterion): model.train() ...
[((196, 237), 'os.listdir', 'os.listdir', (["(data_dir + '/images_original')"], {}), "(data_dir + '/images_original')\n", (206, 237), False, 'import os\n'), ((376, 409), 'math.ceil', 'math.ceil', (['(train_len / batch_size)'], {}), '(train_len / batch_size)\n', (385, 409), False, 'import math\n'), ((4727, 4738), 'time....
cstsunfu/dlkit
dlk/core/schedulers/__init__.py
69e0efd372fa5c0ae5313124d0ba1ef55b535196
# Copyright 2021 cstsunfu. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
[((801, 838), 'dlk.utils.register.Register', 'Register', (['"""Schedule config register."""'], {}), "('Schedule config register.')\n", (809, 838), False, 'from dlk.utils.register import Register\n'), ((860, 890), 'dlk.utils.register.Register', 'Register', (['"""Schedule register."""'], {}), "('Schedule register.')\n", ...
m4ta1l/doit
doc/samples/pos.py
d1a1b7b3abc7641d977d3b78b580d97aea4e27ea
def task_pos_args(): def show_params(param1, pos): print('param1 is: {0}'.format(param1)) for index, pos_arg in enumerate(pos): print('positional-{0}: {1}'.format(index, pos_arg)) return {'actions':[(show_params,)], 'params':[{'name':'param1', 'shor...
[]
vm6502q/ProjectQ
projectq/backends/_qracksim/_simulator_test.py
1eac4b1f529551dfc1668443eba0c68dee54120b
# Copyright 2017 ProjectQ-Framework (www.projectq.ch) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
[((2688, 2734), 'pytest.fixture', 'pytest.fixture', ([], {'params': "['mapper', 'no_mapper']"}), "(params=['mapper', 'no_mapper'])\n", (2702, 2734), False, 'import pytest\n'), ((18744, 18847), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""gate_classes"""', '[(Ry, UniformlyControlledRy), (Rz, UniformlyCont...
jshwi/jss
app/deps.py
b9f29d47c63cd57d0efc1abec37152e97a92049f
""" app.deps ======== Register dependencies that are not part of a ``Flask`` extension. """ from flask import Flask from redis import Redis from rq import Queue def init_app(app: Flask) -> None: """Register application helpers that are not ``Flask-`` extensions. As these are not ``Flask`` extensions they do...
[((645, 684), 'redis.Redis.from_url', 'Redis.from_url', (["app.config['REDIS_URL']"], {}), "(app.config['REDIS_URL'])\n", (659, 684), False, 'from redis import Redis\n'), ((722, 762), 'rq.Queue', 'Queue', (['"""jss-tasks"""'], {'connection': 'app.redis'}), "('jss-tasks', connection=app.redis)\n", (727, 762), False, 'fr...
sangdon/intern2020_cocal
uncertainty/util/__init__.py
2f434b76fbf3426c6685fb92c5bbc2d32fcba7ba
from util.args import * from util.logger import Logger
[]
plusterm/plusterm
com_reader.py
45e9382accdaae7d51c65cab77e571bc6d264936
# from wx.lib.pubsub import pub from pubsub import pub import serial import threading import queue import time class ComReaderThread(threading.Thread): ''' Creates a thread that continously reads from the serial connection Puts result as a tuple (timestamp, data) in a queue ''' def __init__(self...
[((347, 378), 'threading.Thread.__init__', 'threading.Thread.__init__', (['self'], {}), '(self)\n', (372, 378), False, 'import threading\n'), ((459, 476), 'threading.Event', 'threading.Event', ([], {}), '()\n', (474, 476), False, 'import threading\n'), ((1656, 1692), 'threading.Thread.join', 'threading.Thread.join', ([...
ganeshkumarsv/datadog-cloudfoundry-buildpack
docker/app/app.py
7c622dfc7990da83e5dfa4f474878a642fd40fd3
from flask import Flask from datadog import statsd import logging import os # This is a small example application # It uses tracing and dogstatsd on a sample flask application log = logging.getLogger("app") app = Flask(__name__) # The app has two routes, a basic endpoint and an exception endpoint @app.route("/") d...
[((185, 209), 'logging.getLogger', 'logging.getLogger', (['"""app"""'], {}), "('app')\n", (202, 209), False, 'import logging\n'), ((217, 232), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (222, 232), False, 'from flask import Flask\n'), ((336, 409), 'datadog.statsd.increment', 'statsd.increment', (['"""r...
shubhamsah/OpenEDU
Data Structure using Python/Linked_List/2linked_list1.py
a4c68d05f67e7ce6d2305f4ca1567b8f4e95b835
# Lets create a linked list that has the following elements ''' 1. FE 2. SE 3. TE 4. BE ''' # Creating a Node class to create individual Nodes class Node: def __init__(self,data): self.__data = data self.__next = None def get_data(self): return self.__data ...
[]
function2-llx/MONAI
monai/networks/blocks/selfattention.py
4cddaa830b61b88ec78e089bb5f21e05bb1a78f4
# Copyright (c) MONAI Consortium # 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, so...
[((666, 722), 'monai.utils.optional_import', 'optional_import', (['"""einops.layers.torch"""'], {'name': '"""Rearrange"""'}), "('einops.layers.torch', name='Rearrange')\n", (681, 722), False, 'from monai.utils import optional_import\n'), ((1560, 1595), 'torch.nn.Linear', 'nn.Linear', (['hidden_size', 'hidden_size'], {}...
mrakitin/opentrons
api/tests/opentrons/commands/test_protocol_commands.py
d9c7ed23d13cdb62bd1bc397dc2871d4bd5b77e9
import pytest from opentrons.commands import protocol_commands @pytest.mark.parametrize( argnames="seconds," "minutes," "expected_seconds," "expected_minutes," "expected_text", argvalues=[ [10, 0, 10, 0, "Delaying for 0 minutes and 10.0 seconds"], ...
[((66, 782), 'pytest.mark.parametrize', 'pytest.mark.parametrize', ([], {'argnames': '"""seconds,minutes,expected_seconds,expected_minutes,expected_text"""', 'argvalues': "[[10, 0, 10, 0, 'Delaying for 0 minutes and 10.0 seconds'], [10, 9, 10, 9,\n 'Delaying for 9 minutes and 10.0 seconds'], [100, 0, 40, 1,\n 'De...
ess-dmsc/just-bin-it
tests/test_histogram_source.py
8fcd03337a8a88087f25c510c589d482bdd9e4ad
from unittest.mock import patch import pytest from just_bin_it.endpoints.sources import HistogramSource from tests.doubles.consumer import StubConsumer TEST_MESSAGE = b"this is a byte message" INVALID_FB = b"this is an invalid fb message" class TestHistogramSource: @pytest.fixture(autouse=True) def prepare...
[((276, 304), 'pytest.fixture', 'pytest.fixture', ([], {'autouse': '(True)'}), '(autouse=True)\n', (290, 304), False, 'import pytest\n'), ((738, 825), 'unittest.mock.patch', 'patch', (['"""just_bin_it.endpoints.sources.deserialise_hs00"""'], {'return_value': 'TEST_MESSAGE'}), "('just_bin_it.endpoints.sources.deserialis...
novel/lc-tools
lctools/shortcuts.py
1b9032357e2e87aebd76d87664077caa5747c220
import getopt import sys from libcloud.compute.types import NodeState from lc import get_lc from printer import Printer def lister_main(what, resource=None, extension=False, supports_location=False, **kwargs): """Shortcut for main() routine for lister tools, e.g. lc-SOMETHING-list @param what: ...
[]
andr1976/thermo
tests/test_flash_vl.py
42d10b3702373aacc88167d4046ea9af92abd570
# -*- coding: utf-8 -*- '''Chemical Engineering Design Library (ChEDL). Utilities for process modeling. Copyright (C) 2020, Caleb Bell <Caleb.Andrew.Bell@gmail.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal...
[((19699, 19706), 'fluids.core.C2K', 'C2K', (['(15)'], {}), '(15)\n', (19702, 19706), False, 'from fluids.core import C2K\n'), ((20158, 20287), 'chemicals.combustion.fuel_air_spec_solver', 'fuel_air_spec_solver', ([], {'zs_air': 'zs_air', 'zs_fuel': 'zs_fuel', 'CASs': 'constants.CASs', 'atomss': 'constants.atomss', 'n_...
YunMeMeThaw/python_exercises
ex38.py
151d5d3695d578059611ac09c94b3677442197d7
ten_things = "Apples Oranges cows Telephone Light Sugar" print ("Wait there are not 10 things in that list. Let's fix") stuff = ten_things.split(' ') more_stuff = {"Day", "Night", "Song", "Firebee", "Corn", "Banana", "Girl", "Boy"} while len(stuff) !=10: next_one = more_stuff.pop() print("Adding: ", next_one) ...
[]
player1537-forks/spack
var/spack/repos/builtin/packages/diffmark/package.py
822b7632222ec5a91dc7b7cda5fc0e08715bd47c
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Diffmark(AutotoolsPackage): """Diffmark is a DSL for transforming one string to another.""...
[]
ZhangHCFJEA/bbp
bbp/comps/irikura_gen_srf.py
33bd999cf8d719c49f9a904872c62f02eb5850d1
#!/usr/bin/env python """ Copyright 2010-2019 University Of Southern California 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...
[((1889, 1913), 'install_cfg.InstallCfg.getInstance', 'InstallCfg.getInstance', ([], {}), '()\n', (1911, 1913), False, 'from install_cfg import InstallCfg\n'), ((2274, 2311), 'os.path.join', 'os.path.join', (['a_outdir', '"""param_files"""'], {}), "(a_outdir, 'param_files')\n", (2286, 2311), False, 'import os\n'), ((23...
EthanMarrs/digit2
core/tests/test_models.py
207569a3b7a61282a2d0bd5f354a837ad81ef55d
"""test_models.py: runs tests on the models for digit.""" import pytest from core.models import (Grade, Subject, Question, Comment, Option, Topic, Block, ...
[((638, 665), 'core.models.Grade', 'Grade', ([], {'name': '"""Grade Example"""'}), "(name='Grade Example')\n", (643, 665), False, 'from core.models import Grade, Subject, Question, Comment, Option, Topic, Block, Syllabus, StateException\n'), ((715, 757), 'core.models.Subject', 'Subject', ([], {'name': '"""addition"""',...
tbabej/betterbib
betterbib/__init__.py
80a3c9040232d9988f9a1e4c40724b40b9b9ed85
# -*- coding: utf-8 -*- # from __future__ import print_function from betterbib.__about__ import ( __version__, __author__, __author_email__, __website__, ) from betterbib.tools import ( create_dict, decode, pybtex_to_dict, pybtex_to_bibtex_string, write, update, Journal...
[((498, 530), 'pipdate.needs_checking', 'pipdate.needs_checking', (['__name__'], {}), '(__name__)\n', (520, 530), False, 'import pipdate\n'), ((546, 582), 'pipdate.check', 'pipdate.check', (['__name__', '__version__'], {}), '(__name__, __version__)\n', (559, 582), False, 'import pipdate\n')]
omololevy/my_portfolio
base/views.py
29f8892c3a6e40a9c05c85110301987005d2c5c1
from django.shortcuts import render, redirect from django.http import HttpResponse from django.contrib.auth.decorators import login_required from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.core.mail import EmailMessage from django.conf import settings from django.template.loader imp...
[((1835, 1867), 'django.contrib.auth.decorators.login_required', 'login_required', ([], {'login_url': '"""home"""'}), "(login_url='home')\n", (1849, 1867), False, 'from django.contrib.auth.decorators import login_required\n'), ((2151, 2183), 'django.contrib.auth.decorators.login_required', 'login_required', ([], {'logi...
hephaestus9/Radio
radioLib/pastebin/pastebin.py
c1560c25def211ab6354fb0aa5cc935e2851c8f0
#!/usr/bin/env python ############################################################################# # Pastebin.py - Python 3.2 Pastebin API. # Copyright (C) 2012 Ian Havelock # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as ...
[((12635, 12657), 'urllib.urlencode', 'urllib.urlencode', (['argv'], {}), '(argv)\n', (12651, 12657), False, 'import urllib\n'), ((14576, 14598), 'urllib.urlencode', 'urllib.urlencode', (['argv'], {}), '(argv)\n', (14592, 14598), False, 'import urllib\n'), ((16499, 16521), 'urllib.urlencode', 'urllib.urlencode', (['arg...
seron-ux/News-app
app/requests.py
d22b256b26fb9fa2bb77658952139b9ddebb8f8c
import urllib.request,json from .models import News import requests News = News # Getting api key api_key = None # Getting the news base url base_url = None base_url2 = None def configure_request(app): global api_key,base_url,base_url2 api_key = app.config['NEWS_API_KEY'] base_url = app.config['NEWS_API...
[((2283, 2308), 'json.loads', 'json.loads', (['get_news_data'], {}), '(get_news_data)\n', (2293, 2308), False, 'import urllib.request, json\n'), ((585, 611), 'requests.get', 'requests.get', (['get_news_url'], {}), '(get_news_url)\n', (597, 611), False, 'import requests\n'), ((1026, 1055), 'requests.get', 'requests.get'...
caoxudong/code_practice
leetcode/151_reverse _words_in_a_string.py
cb960cf69d67ae57b35f0691d35e15c11989e6d2
""" Given an input string, reverse the string word by word. For example, Given s = "the sky is blue", return "blue is sky the". For C programmers: Try to solve it in-place in O(1) space. Clarification: * What constitutes a word? A sequence of non-space characters constitutes a word. * Could the inp...
[]
LittleNed/toontown-stride
toontown/uberdog/DistributedInGameNewsMgr.py
1252a8f9a8816c1810106006d09c8bdfe6ad1e57
import socket, datetime, os from direct.distributed.DistributedObjectGlobal import DistributedObjectGlobal from direct.distributed.DistributedObject import DistributedObject from toontown.toonbase import ToontownGlobals from toontown.uberdog import InGameNewsResponses class DistributedInGameNewsMgr(DistributedObject):...
[((434, 470), 'direct.distributed.DistributedObject.DistributedObject.__init__', 'DistributedObject.__init__', (['self', 'cr'], {}), '(self, cr)\n', (460, 470), False, 'from direct.distributed.DistributedObject import DistributedObject\n'), ((539, 569), 'direct.distributed.DistributedObject.DistributedObject.delete', '...
azeemchaudhrry/30DaysofPython
Day10/loops.py
8aa80c81967d87e4bc70254a41517d0303ca0599
# Day 10 Loops from countries import * # While Loop # count = 0 # while count < 5: # if count == 3: # break # print(count) # count = count + 1 # numbers = [0,2,3,4,5,6,7,8,9,10] # for number in numbers: # print(number) # language = 'Python' # for letter in language: # print(letter) # tp...
[]
Dimas625/tessera
tessera-server/tessera/views_api.py
8e554f217220228fb8a0662fb5075cb839e9f1b1
# -*- mode:python -*- import flask import json import logging from datetime import datetime import inflection from functools import wraps from flask import request, url_for from werkzeug.exceptions import HTTPException from .client.api.model import * from . import database from . import helpers from .application imp...
[((369, 396), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (386, 396), False, 'import logging\n'), ((404, 436), 'flask.Blueprint', 'flask.Blueprint', (['"""api"""', '__name__'], {}), "('api', __name__)\n", (419, 436), False, 'import flask\n'), ((2299, 2334), 'flask.url_for', 'url_for', ...