repo_name
stringlengths
7
94
repo_path
stringlengths
4
237
repo_head_hexsha
stringlengths
40
40
content
stringlengths
10
680k
apis
stringlengths
2
680k
aliharby12/Simple-vezeeta-project
src/users/migrations/0014_auto_20200801_1008.py
feb6df8b354ac284edc645059bea17021169dcfa
# Generated by Django 2.2 on 2020-08-01 08:08 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('users', '0013_auto_20200731_1810'), ] operations = [ migrations.AlterField( model_name='profile',...
[((377, 827), 'django.db.models.CharField', 'models.CharField', ([], {'choices': "[('جراحه اطفال', 'جراحه اططفال'), ('تخسيس', 'تخسيس'), ('عظام', 'عظام'), (\n 'جراحه عامه', 'جراحه عامه'), ('اطفال', 'اطفال'), ('اورام', 'اورام'), (\n 'مخ واعصاب', 'مخ واعصاب'), ('انف واذن', 'انف واذن'), ('امراض دم',\n 'امراض دم'),...
tienthegainz/pipeline_executor_docker_call
caller_v3/app/api/v1/docker.py
b2b9478056e4b818f5963b0b266375fe6d39627a
from typing import Any, List, Callable from fastapi import APIRouter, HTTPException, status, BackgroundTasks from app import schemas from app.core import docker_client import json from copy import deepcopy router = APIRouter() @router.get("/images", response_model=schemas.DockerImageRespond) def get_docker_image(...
[((219, 230), 'fastapi.APIRouter', 'APIRouter', ([], {}), '()\n', (228, 230), False, 'from fastapi import APIRouter, HTTPException, status, BackgroundTasks\n'), ((348, 383), 'app.core.docker_client.images.list', 'docker_client.images.list', ([], {'all': '(True)'}), '(all=True)\n', (373, 383), False, 'from app.core impo...
kalyc/keras-apache-mxnet
keras/models.py
5497ebd50a45ccc446b8944ebbe11fb7721a5533
"""Model-related utilities. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from . import backend as K from .utils.generic_utils import has_arg from .utils.generic_utils import to_list from .engine.input_layer import Input from .engine.input_layer import...
[]
erinxocon/vscode-python
pythonFiles/tests/testing_tools/adapter/test_functional.py
e53f9061d16467a9ae2d8995a9a5f3cfa0f444e1
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. from __future__ import unicode_literals import json import os import os.path import subprocess import sys import unittest import pytest from ...__main__ import TESTING_TOOLS_ROOT CWD = os.getcwd() DATA_DIR = os.path.join...
[((285, 296), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (294, 296), False, 'import os\n'), ((366, 416), 'os.path.join', 'os.path.join', (['TESTING_TOOLS_ROOT', '"""run_adapter.py"""'], {}), "(TESTING_TOOLS_ROOT, 'run_adapter.py')\n", (378, 416), False, 'import os\n'), ((321, 346), 'os.path.dirname', 'os.path.dirname'...
axdahl/SC-MMGP
mmgp/kernels/wavelet_slice.py
c6cd9d9de66bb7074925a4b6485f10a74bdd9f68
''' Wavelet kernel slice allows kernel operation on feature subset active_dims is iterable of feature dimensions to extract input_dim must equal dimension defined by active_dims ''' import numpy as np import tensorflow as tf from .. import util from . import kernel from .kernel_extras import * class WaveletSlice(ke...
[((1704, 1738), 'tensorflow.einsum', 'tf.einsum', (['"""i,j->ij"""', 'kern1', 'kern2'], {}), "('i,j->ij', kern1, kern2)\n", (1713, 1738), True, 'import tensorflow as tf\n'), ((660, 698), 'tensorflow.Variable', 'tf.Variable', (['[shift]'], {'dtype': 'tf.float32'}), '([shift], dtype=tf.float32)\n', (671, 698), True, 'imp...
latenite4/python3
transform.py
30e367471ba48e5fc0fb07327b636fcb9959e3e0
#!/usr/bin/python3 #program to parse png images and change images # cmd: python3 transform.py # you must have local input/ and output/ directories # # name: R. Melton # date: 12/27/20 # cmdline: python transform.py cmd show image='city.png' --ulx=1 --uly=2 --brx=0 --bry=9 # python transform.py show city.png #...
[((682, 752), 'image.Image', 'Image', ([], {'x_pixels': 'x_pixels', 'y_pixels': 'y_pixels', 'num_channels': 'num_channels'}), '(x_pixels=x_pixels, y_pixels=y_pixels, num_channels=num_channels)\n', (687, 752), False, 'from image import Image\n'), ((1215, 1285), 'image.Image', 'Image', ([], {'x_pixels': 'x_pixels', 'y_pi...
Jeglet/pcbot
plugins/wyr.py
89178d4982151adb2fadfacdc3080e46cda9e891
""" Would you rather? This plugin includes would you rather functionality """ import asyncio import random import re import discord import bot import plugins from pcbot import Config client = plugins.client # type: bot.Client db = Config("would-you-rather", data=dict(timeout=10, responses=["**{name}** would **{cho...
[((389, 438), 're.compile', 're.compile', (['"""(.+)(?:\\\\s+or|\\\\s*,)\\\\s+([^?]+)\\\\?*"""'], {}), "('(.+)(?:\\\\s+or|\\\\s*,)\\\\s+([^?]+)\\\\?*')\n", (399, 438), False, 'import re\n'), ((506, 615), 'plugins.argument', 'plugins.argument', (['"""{open}option ...{close} or/, {open}other option ...{close}[?]"""'], {'...
bergzand/suit-manifest-generator
suit_tool/argparser.py
da82651a8b02fd4d7261e826cc70b5c862dd94ea
# -*- coding: utf-8 -*- # ---------------------------------------------------------------------------- # Copyright 2019-2020 ARM Limited or its affiliates # # SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the...
[((1319, 1347), 're.split', 're.split', (['"""="""', 'e'], {'maxsplit': '(1)'}), "('=', e, maxsplit=1)\n", (1327, 1347), False, 'import re\n'), ((2418, 2440), 'argparse.FileType', 'argparse.FileType', (['"""r"""'], {}), "('r')\n", (2435, 2440), False, 'import sys, argparse, os\n'), ((2658, 2681), 'argparse.FileType', '...
y2ghost/study
python/process/process_pool.py
c5278611b0a732fe19e3d805c0c079e530b1d3b2
import random import time from multiprocessing import Pool def worker(name: str) -> None: print(f'Started worker {name}') worker_time = random.choice(range(1, 5)) time.sleep(worker_time) print(f'{name} worker finished in {worker_time} seconds') if __name__ == '__main__': process_names = [f'compu...
[((177, 200), 'time.sleep', 'time.sleep', (['worker_time'], {}), '(worker_time)\n', (187, 200), False, 'import time\n'), ((360, 377), 'multiprocessing.Pool', 'Pool', ([], {'processes': '(5)'}), '(processes=5)\n', (364, 377), False, 'from multiprocessing import Pool\n')]
mazalgarab-git/OSICpypy
Project/Support-NotSourced/generic_pydicom_ns.py
003fb0b146c9ed711f05475e6cc7563bf549f230
# -*- coding: utf-8 -*- """ Created on Mon Sep 7 11:48:59 2020 @author: mazal """ """ ========================================= Support functions of pydicom (Not sourced) ========================================= Purpose: Create support functions for the pydicom project """ """ Test mode 1 | Basics...
[((1713, 1734), 'os.chdir', 'os.chdir', (['path_source'], {}), '(path_source)\n', (1721, 1734), False, 'import os\n'), ((1756, 1779), 'os.listdir', 'os.listdir', (['path_source'], {}), '(path_source)\n', (1766, 1779), False, 'import os\n'), ((2403, 2443), 'pandas.DataFrame', 'pd.DataFrame', ([], {'data': 'Population_Di...
ahmed-shariff/scraper
paperscraper/scrapers/keywords.py
52bed967db7e08e438daaa8dfa8d9338567ad7c2
import re regex = re.compile(r'[\n\r\t]') def acm_digital_library(soup): try: keywords = set() keywords_parent_ol = soup.find('ol', class_="rlist organizational-chart") keywords_divs = keywords_parent_ol.findChildren('div', recursive=True) for kw_parent in keywords_divs: ...
[((19, 44), 're.compile', 're.compile', (['"""[\\\\n\\\\r\\\\t]"""'], {}), "('[\\\\n\\\\r\\\\t]')\n", (29, 44), False, 'import re\n'), ((4014, 4047), 're.split', 're.split', (['""","""', 'keywords_font.text'], {}), "(',', keywords_font.text)\n", (4022, 4047), False, 'import re\n'), ((5715, 5754), 're.findall', 're.find...
ContactEngineering/TopoBank
topobank/publication/models.py
12710c24cc158801db20f030c3e0638060e24a0e
from django.db import models from django.urls import reverse from django.utils import timezone from django.utils.safestring import mark_safe from django.conf import settings MAX_LEN_AUTHORS_FIELD = 512 CITATION_FORMAT_FLAVORS = ['html', 'ris', 'bibtex', 'biblatex'] DEFAULT_KEYWORDS = ['surface', 'topography'] class...
[((704, 759), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(10)', 'unique': '(True)', 'null': '(True)'}), '(max_length=10, unique=True, null=True)\n', (720, 759), False, 'from django.db import models\n'), ((774, 871), 'django.db.models.OneToOneField', 'models.OneToOneField', (['"""manager.Surf...
rayhu-osu/vcube
vendor/migrations/0003_store_password.py
ff1af048adb8a9f1007368150a78b309b4d821af
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-07-24 19:36 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('vendor', '0002_store_image'), ] operations = [ migrations.AddField( ...
[((392, 434), 'django.db.models.CharField', 'models.CharField', ([], {'default': '(1)', 'max_length': '(30)'}), '(default=1, max_length=30)\n', (408, 434), False, 'from django.db import migrations, models\n')]
widnerlr/isat252
lec2.py
4196a8b1c6f4c75c3f5d8f64164014103b695077
""" Your module description """ """ this is my second py code for my second lecture """ #print ('hello world') # this is a single line commment # this is my second line comment #print(type("123.")) #print ("Hello World".upper()) #print("Hello World".lower()) #print("hello" + "world" + ".") #print(2**3) #my_st...
[]
Gyaha/AOC2020
day_22_b.py
fbabae9acd7d274b84bc0c64f2665dfba9f008ca
def play_recursively_combat(p1: list, p2: list) -> bool: rounds = set() winner = None while len(p1) > 0 and len(p2) > 0: r = tuple(p1 + [-1] + p2) if r in rounds: return True else: rounds.add(r) c1 = p1.pop(0) c2 = p2.pop(0) if c1 <= ...
[((1454, 1473), 'time.perf_counter', 'time.perf_counter', ([], {}), '()\n', (1471, 1473), False, 'import time\n'), ((1506, 1525), 'time.perf_counter', 'time.perf_counter', ([], {}), '()\n', (1523, 1525), False, 'import time\n')]
sundayz/idewave-core
Auth/Constants/LoginOpCode.py
5bdb88892173c9c3e8c85f431cf9b5dbd9f23941
from enum import Enum class LoginOpCode(Enum): ''' Opcodes during login process ''' LOGIN_CHALL = 0x00 LOGIN_PROOF = 0x01 RECON_CHALL = 0x02 # currently do not in use RECON_PROOF = 0x03 # currently do not in use REALMLIST = 0x10 class LoginResult(Enum): ''' Error codes ''' SUCC...
[]
pratannaimjoi/tokenIpad
LINETOKEN/__init__.py
f03969c05427bc1804d05c42823a28725c7e38a0
# -*- coding: utf-8 -*- from .LineApi import LINE from .lib.Gen.ttypes import *
[]
seton-develops/PDF-Camelot-Folder-Executable
main.py
168b5c24afe8884cf121a4207d7d3cb3ee7cc626
''' Created on Jun 17, 2021 @author: Sean ''' import PDF2CSV_GUI def main(): j = PDF2CSV_GUI.Convert_GUI() if __name__ == "__main__": main()
[((95, 120), 'PDF2CSV_GUI.Convert_GUI', 'PDF2CSV_GUI.Convert_GUI', ([], {}), '()\n', (118, 120), False, 'import PDF2CSV_GUI\n')]
Mildlyoffbeat/RedditBot-1
Part1/bot_read.py
f65c3c4d0f3d6d3a468069d4a009b44a20e33797
#!/usr/bin/python import praw reddit = praw.Reddit('mob-secondbot') subreddit = reddit.subreddit("learnpython") for submission in subreddit.hot(limit=5): print("Title: ", submission.title) print("Text: ", submission.selftext) print("Score: ", submission.score) print("---------------------------------...
[((40, 68), 'praw.Reddit', 'praw.Reddit', (['"""mob-secondbot"""'], {}), "('mob-secondbot')\n", (51, 68), False, 'import praw\n')]
Siketyan/Programming-I
17/kazuate_liar.cpp.py
0749c1ae045d53cd8a67f0de7ab13c26030ddd74
from subprocess import Popen, PIPE, call name = "kazuate_liar.o" src = """ #include <iostream> #include <random> using namespace std; int main() { random_device rd; mt19937 mt(rd()); uniform_int_distribution<int> randfive(0, 4); uniform_int_distribution<int> randint(1, 100); int count = 0; ...
[((938, 994), 'subprocess.Popen', 'Popen', (["['g++', '-o', name, '-x', 'c++', '-']"], {'stdin': 'PIPE'}), "(['g++', '-o', name, '-x', 'c++', '-'], stdin=PIPE)\n", (943, 994), False, 'from subprocess import Popen, PIPE, call\n'), ((1030, 1049), 'subprocess.call', 'call', (["['./' + name]"], {}), "(['./' + name])\n", (1...
silvercar/terrafort
src/terrafort/main.py
bdf9cb5d7f58d10a0c295c01b3a5620fdcc2876c
""" Terrafort Generate terraform templates for specific resources """ import click from .providers.aws import Aws @click.group() @click.option('--commands', is_flag=True, help="Output import commands instead of a terraform template") @click.version_option() @click.pass_context def cli(ct...
[((119, 132), 'click.group', 'click.group', ([], {}), '()\n', (130, 132), False, 'import click\n'), ((134, 242), 'click.option', 'click.option', (['"""--commands"""'], {'is_flag': '(True)', 'help': '"""Output import commands instead of a terraform template"""'}), "('--commands', is_flag=True, help=\n 'Output import ...
jnsougata/rich-embed
src/ping.py
95901e590f00c4e4eabeb99c8f06bb5f90718d80
import discord import app_util class Ping(app_util.Cog): def __init__(self, bot: app_util.Bot): self.bot = bot @app_util.Cog.command( command=app_util.SlashCommand( name='ping', description='shows avg ping of client' ), guild_id=877399405056102431 ) async ...
[((170, 244), 'app_util.SlashCommand', 'app_util.SlashCommand', ([], {'name': '"""ping"""', 'description': '"""shows avg ping of client"""'}), "(name='ping', description='shows avg ping of client')\n", (191, 244), False, 'import app_util\n'), ((400, 455), 'discord.Embed', 'discord.Embed', ([], {'title': 'f"""{self.bot....
AlbertVeli/AdventOfCode
2020/24/visualization.py
3d3473695318a0686fac720a1a21dd3629f09e33
#!/usr/bin/env python3 import sys import re import numpy as np from PIL import Image moves = { 'e': (2, 0), 'se': (1, 2), 'sw': (-1, 2), 'w': (-2, 0), 'nw': (-1, -2), 'ne': (1, -2) } # Save (x, y): True/False in tiles. True = black, False = white. tiles = {} for line in open(sys.argv[1]).read().splitlines(): po...
[((683, 722), 'numpy.zeros', 'np.zeros', (['(width * heigth)'], {'dtype': 'np.int8'}), '(width * heigth, dtype=np.int8)\n', (691, 722), True, 'import numpy as np\n'), ((1959, 1974), 'numpy.where', 'np.where', (['board'], {}), '(board)\n', (1967, 1974), True, 'import numpy as np\n'), ((324, 340), 'numpy.array', 'np.arra...
BearerPipelineTest/catapult
experimental/tracing/bin/diff_heap_profiler.py
3800a67cd916200046a50748893bbd0dcf3d7f4a
#!/usr/bin/env python # Copyright 2017 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. from __future__ import absolute_import from __future__ import print_function import argparse import gzip import json import os import s...
[((407, 441), 'os.path.join', 'os.path.join', (['_OUTPUT_DIR', '"""graph"""'], {}), "(_OUTPUT_DIR, 'graph')\n", (419, 441), False, 'import os\n'), ((5509, 5541), 'six.itervalues', 'six.itervalues', (["root['children']"], {}), "(root['children'])\n", (5523, 5541), False, 'import six\n'), ((5977, 6009), 'six.itervalues',...
kingjr/mne-bids
mne_bids/commands/mne_bids_raw_to_bids.py
3a4543076912cebbc89a5f0b9433cda1b9e288b8
"""Write raw files to BIDS format. example usage: $ mne_bids raw_to_bids --subject_id sub01 --task rest --raw data.edf --bids_root new_path """ # Authors: Teon Brooks <teon.brooks@gmail.com> # Stefan Appelhoff <stefan.appelhoff@mailbox.org> # # License: BSD (3-clause) import mne_bids from mne_bids import wr...
[((494, 611), 'mne.commands.utils.get_optparser', 'get_optparser', (['__file__'], {'usage': '"""usage: %prog options args"""', 'prog_prefix': '"""mne_bids"""', 'version': 'mne_bids.__version__'}), "(__file__, usage='usage: %prog options args', prog_prefix=\n 'mne_bids', version=mne_bids.__version__)\n", (507, 611), ...
NastiaK/NewRepository
lab1oop.py
d1907fc2e159dc1831071d7c79e20bbfb47fb822
class Calculations: def __init__(self, first, second): self.first = first self.second = second def add(self): print(self.first + self.second) def subtract(self): print(self.first - self.second) def multiply(self): print(self.first * self.second) ...
[]
Jeans212/codility-dev-training
Arrays/cyclic_rotation.py
9c5118c6433ea210d1485a6127712a92496e2bc2
# you can write to stdout for debugging purposes, e.g. # print("this is a debug message") ''' Rotate an array A to the right by a given number of steps K. Covert the array to a deque Apply the rotate() method the rotate the deque in positive K steps Convert the deque to array ''' from collec...
[((408, 416), 'collections.deque', 'deque', (['A'], {}), '(A)\n', (413, 416), False, 'from collections import deque\n')]
hatzel/markdown-spoilers
tests/test_apis.py
1964f298f0e8b99f1202d36ccc7d8cf7d613ad26
# -*- coding: utf-8 -*- """ Python Markdown A Python implementation of John Gruber's Markdown. Documentation: https://python-markdown.github.io/ GitHub: https://github.com/Python-Markdown/markdown/ PyPI: https://pypi.org/project/Markdown/ Started by Manfred Stienstra (http://www.dwerg.net/). Maintained for a few yea...
[((1490, 1509), 'markdown.Markdown', 'markdown.Markdown', ([], {}), '()\n', (1507, 1509), False, 'import markdown\n'), ((2224, 2267), 'markdown.Markdown', 'markdown.Markdown', ([], {'extensions': "['footnotes']"}), "(extensions=['footnotes'])\n", (2241, 2267), False, 'import markdown\n'), ((2386, 2449), 'markdown.Markd...
csxeba/nervous
nervous/utility/config.py
f7aeb9b2ff875835c346c607722fab517ef6df61
import os class StressedNetConfig: def __init__(self, synaptic_environmental_constraint=0.8, group_environmental_constraint=0.6, stress_factor=0.8, save_folder=os.path.expanduser("~/.nervous/models/")): self._synaptic_environmental_const...
[((235, 275), 'os.path.expanduser', 'os.path.expanduser', (['"""~/.nervous/models/"""'], {}), "('~/.nervous/models/')\n", (253, 275), False, 'import os\n'), ((1030, 1063), 'os.path.exists', 'os.path.exists', (['self._save_folder'], {}), '(self._save_folder)\n', (1044, 1063), False, 'import os\n'), ((1077, 1107), 'os.ma...
XinYao1994/mindspore
mindspore/nn/optim/ftrl.py
2c1a2bf752a1fde311caddba22633d2f4f63cb4e
# Copyright 2020 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
[((1043, 1075), 'mindspore.ops.composite.MultitypeFuncGraph', 'C.MultitypeFuncGraph', (['"""ftrl_opt"""'], {}), "('ftrl_opt')\n", (1063, 1075), True, 'from mindspore.ops import functional as F, composite as C, operations as P\n'), ((1655, 1733), 'mindspore._checkparam.Validator.check_value_type', 'validator.check_value...
skimhub/aws-utils
aws_utils/region_selector.py
5496a7594ab90b1e658e8f9f8137e8943a39be1e
import datetime import boto3 US_EAST_REGION = {'us-east-1'} US_EAST_AVAILABILITY_ZONES = {'us-east-1a', 'us-east-1b', 'us-east-1c', 'us-east-1e'} # note d is missing INSTANCE_VERSION = 'Linux/UNIX (Amazon VPC)' def fetch_spot_prices(region, start_time, end_time, instance_type, instance_version=INSTANCE_VERSION): ...
[((842, 881), 'boto3.client', 'boto3.client', (['"""ec2"""'], {'region_name': 'region'}), "('ec2', region_name=region)\n", (854, 881), False, 'import boto3\n'), ((3406, 3432), 'datetime.timedelta', 'datetime.timedelta', ([], {'days': '(1)'}), '(days=1)\n', (3424, 3432), False, 'import datetime\n'), ((4544, 4570), 'date...
jkae/knn-exercise
pynn/__init__.py
ae569e3f6a0e23669369d99e032270e72f8fbb66
from .nearest_neighbor_index import NearestNeighborIndex from .kd_tree import *
[]
threecifanggen/python-functional-programming
tests/test_try.py
bd17281e5f24db826266f509bc54b25362c0d2a1
''' Author: huangbaochen<huangbaochenwo@live.com> Date: 2021-12-11 20:04:19 LastEditTime: 2021-12-11 21:46:16 LastEditors: huangbaochen<huangbaochenwo@live.com> Description: 测试Try单子 No MERCY ''' import pytest from fppy.try_monad import Try, Success, Fail from fppy.option import Just, Nothing @pytest.mark.try_monad def...
[((350, 362), 'fppy.try_monad.Try.apply', 'Try.apply', (['(1)'], {}), '(1)\n', (359, 362), False, 'from fppy.try_monad import Try, Success, Fail\n'), ((366, 376), 'fppy.try_monad.Success', 'Success', (['(1)'], {}), '(1)\n', (373, 376), False, 'from fppy.try_monad import Try, Success, Fail\n'), ((388, 394), 'fppy.try_mo...
yammesicka/calendar
app/internal/daily_quotes.py
7c15a24883dbdffb563b6d3286c2d458e4a1c9c0
from datetime import date from typing import Dict, Optional from sqlalchemy.orm import Session from sqlalchemy.sql.expression import func from app.database.models import Quote TOTAL_DAYS = 366 def create_quote_object(quotes_fields: Dict[str, Optional[str]]) -> Quote: """This function create a quote object from...
[((421, 486), 'app.database.models.Quote', 'Quote', ([], {'text': "quotes_fields['text']", 'author': "quotes_fields['author']"}), "(text=quotes_fields['text'], author=quotes_fields['author'])\n", (426, 486), False, 'from app.database.models import Quote\n'), ((569, 581), 'datetime.date.today', 'date.today', ([], {}), '...
viing937/codeforces
src/789A.py
d694eb6967cd56af02963c3a662066048cb78d07
n, k = map(int, input().split()) w = list(map(int, input().split())) r = sum(map(lambda x: (x+k-1)//k, w)) print((r+1)//2)
[]
leyyin/godot
platform/server/detect.py
68325d7254db711beaedddad218e2cddb405c42c
import os import sys def is_active(): return True def get_name(): return "Server" def can_build(): if (os.name!="posix"): return False return True # enabled def get_opts(): return [ ('use_llvm','Use llvm compiler','no'), ('force_32_bits','Force 32 bits binary','no') ] def get_flags(): return [ (...
[((543, 562), 'sys.stdout.isatty', 'sys.stdout.isatty', ([], {}), '()\n', (560, 562), False, 'import sys\n')]
SnipsMine/ETS2-Speedrun-Tool
telemetry/Truck.py
5ac87e4bc88be67ff4954b2b98772ff14a65eb48
from telemetry.TruckConstants import ConstantValues from telemetry.TruckCurrent import CurrentValues from telemetry.TruckPositioning import Positioning class TruckValues: constant_values = None current_values = None positioning = None def __init__(self): self.current_values = CurrentValues()...
[((305, 320), 'telemetry.TruckCurrent.CurrentValues', 'CurrentValues', ([], {}), '()\n', (318, 320), False, 'from telemetry.TruckCurrent import CurrentValues\n'), ((352, 368), 'telemetry.TruckConstants.ConstantValues', 'ConstantValues', ([], {}), '()\n', (366, 368), False, 'from telemetry.TruckConstants import Constant...
petersontylerd/spark-courses
IntroToSpark/Assign4_Q1-6_action.py
e8dcb4968ea31a50206739e6af3006889f8c3c6c
import csv from pyspark.sql import SparkSession from pyspark.sql.types import IntegerType spark = SparkSession.builder.appName("Assignment4").getOrCreate() sc = spark.sparkContext # load data to dataframe path = 'fake_data.csv' df = spark.read.format('csv').option('header','true').load(path) # cast income as an int...
[((100, 143), 'pyspark.sql.SparkSession.builder.appName', 'SparkSession.builder.appName', (['"""Assignment4"""'], {}), "('Assignment4')\n", (128, 143), False, 'from pyspark.sql import SparkSession\n'), ((372, 385), 'pyspark.sql.types.IntegerType', 'IntegerType', ([], {}), '()\n', (383, 385), False, 'from pyspark.sql.ty...
zipmex/fire
src/firebot/tests/factories.py
a41bbdbc86085c055ae4706fadea4f142e881a85
import factory from django.contrib.auth import get_user_model class UserFactory(factory.DjangoModelFactory): class Meta: model = get_user_model() first_name = factory.Faker('name') last_name = factory.Faker('name') email = factory.Faker('email')
[((179, 200), 'factory.Faker', 'factory.Faker', (['"""name"""'], {}), "('name')\n", (192, 200), False, 'import factory\n'), ((217, 238), 'factory.Faker', 'factory.Faker', (['"""name"""'], {}), "('name')\n", (230, 238), False, 'import factory\n'), ((251, 273), 'factory.Faker', 'factory.Faker', (['"""email"""'], {}), "('...
Bestfast/reamberPy
reamber/o2jam/O2JHold.py
91b76ca6adf11fbe8b7cee7c186481776a4d7aaa
from dataclasses import dataclass, field from reamber.base.Hold import Hold, HoldTail from reamber.o2jam.O2JNoteMeta import O2JNoteMeta @dataclass class O2JHoldTail(HoldTail, O2JNoteMeta): pass @dataclass class O2JHold(Hold, O2JNoteMeta): """ Defines the O2Jam Bpm Object The O2Jam Bpm Object is stored...
[((374, 391), 'dataclasses.field', 'field', ([], {'init': '(False)'}), '(init=False)\n', (379, 391), False, 'from dataclasses import dataclass, field\n')]
Peacebot-Development/Peacebot-v2
peacebot/core/plugins/Miscellaneous/__init__.py
79ab87b12cd60b708631d96021ac3d3eaeee01c9
import lightbulb from apscheduler.schedulers.asyncio import AsyncIOScheduler from peacebot.core.utils.time import TimeConverter def fetch_scheduler(ctx: lightbulb.Context) -> AsyncIOScheduler: return ctx.bot.d.scheduler async def convert_time(ctx: lightbulb.Context, time: str) -> float: seconds = await Tim...
[((317, 364), 'peacebot.core.utils.time.TimeConverter.convert', 'TimeConverter.convert', (['TimeConverter', 'ctx', 'time'], {}), '(TimeConverter, ctx, time)\n', (338, 364), False, 'from peacebot.core.utils.time import TimeConverter\n')]
laichimirum/docker-appium-emulator
example/android/python/msite_simple_default_browser.py
3549c5f1fc09bbc650dd30351ad4f509a72a90fa
import unittest from appium import webdriver class MSiteDefaultBrowserAndroidUITests(unittest.TestCase): def setUp(self): # Default browser does not exist for android >= 6.0 desired_caps = { 'platformName': 'Android', 'deviceName': 'Android Emulator', 'appPac...
[((491, 553), 'appium.webdriver.Remote', 'webdriver.Remote', (['"""http://127.0.0.1:4723/wd/hub"""', 'desired_caps'], {}), "('http://127.0.0.1:4723/wd/hub', desired_caps)\n", (507, 553), False, 'from appium import webdriver\n'), ((724, 745), 'unittest.TestLoader', 'unittest.TestLoader', ([], {}), '()\n', (743, 745), Fa...
sola-st/Nalin
src/nn/dataset_utils/types_processing.py
3a6f95cec95d9152a65af970cfbb145179b0bd72
""" Created on 17-June-2020 @author Jibesh Patra The types extracted during runtime usually look something like --> <class 'numpy.ndarray'> or <class 'seaborn.palettes._ColorPalette'> change them to --> ndarray, ColorPalette """ import re remove_chars = re.compile(r'>|\'|<|(class )|_|(type)') def process_types(tp...
[((258, 297), 're.compile', 're.compile', (['""">|\\\\\'|<|(class )|_|(type)"""'], {}), '(">|\\\\\'|<|(class )|_|(type)")\n', (268, 297), False, 'import re\n')]
soootaleb/spare
src/canvas.py
b454b9a8861df55c29fe55b4b584248a2ffe79cb
from PyQt5.QtGui import * from PyQt5.QtCore import * from PyQt5.QtWidgets import * from matplotlib import pyplot as plt from matplotlib.figure import Figure from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas import matplotlib.ticker as ticker import numpy as np import random, matplotlib...
[((450, 490), 'matplotlib.figure.Figure', 'Figure', ([], {'figsize': '(width, height)', 'dpi': 'dpi'}), '(figsize=(width, height), dpi=dpi)\n', (456, 490), False, 'from matplotlib.figure import Figure\n'), ((542, 574), 'matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg.__init__', 'FigureCanvas.__init__', (['self', '...
GeorgBraun/cpg_scpi_python
src/cpg_scpi/test/__init__.py
ec74c15beaac0b002fb996a42f4e66ea369e1fc6
'''Functional tests for CPG''' from .. import CircuitPlayground from .. import __version__ as CircuitPlaygroundVersion import time def funcTest(timestamps: bool = False) -> None: cpg = CircuitPlayground() if timestamps: _printFuncTestHeadingWithDeliLine(f'cpg_scpi v{CircuitPlaygroundVersion}\nRUNNING...
[((989, 1002), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (999, 1002), False, 'import time\n')]
yejun1060/SbjctSclctn
main/models.py
eca6a9d09cf81fce262ea58ca90e69ee5735ab16
from django.db import models class Account(models.Model): clsNb = models.IntegerField() Name = models.CharField(max_length=10) pw = models.IntegerField() def __str__(self): return self.Name
[((72, 93), 'django.db.models.IntegerField', 'models.IntegerField', ([], {}), '()\n', (91, 93), False, 'from django.db import models\n'), ((105, 136), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(10)'}), '(max_length=10)\n', (121, 136), False, 'from django.db import models\n'), ((146, 167), '...
shrey-bansal/pytorch_geometric
test/utils/test_geodesic.py
17108a08066b0a73530544d01719b186f2625ef2
from math import sqrt import torch from torch_geometric.utils import geodesic_distance def test_geodesic_distance(): pos = torch.Tensor([[0, 0, 0], [2, 0, 0], [0, 2, 0], [2, 2, 0]]) face = torch.tensor([[0, 1, 3], [0, 2, 3]]).t() out = geodesic_distance(pos, face) expected = [ [0, 1, 1, sqrt...
[((130, 188), 'torch.Tensor', 'torch.Tensor', (['[[0, 0, 0], [2, 0, 0], [0, 2, 0], [2, 2, 0]]'], {}), '([[0, 0, 0], [2, 0, 0], [0, 2, 0], [2, 2, 0]])\n', (142, 188), False, 'import torch\n'), ((252, 280), 'torch_geometric.utils.geodesic_distance', 'geodesic_distance', (['pos', 'face'], {}), '(pos, face)\n', (269, 280),...
naomielst/mongo-python-driver
gridfs/grid_file.py
e3d1d6f5b48101654a05493fd6eec7fe3fa014bd
# Copyright 2009-present MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
[((1622, 1670), 'bson.son.SON', 'SON', (["[('files_id', ASCENDING), ('n', ASCENDING)]"], {}), "([('files_id', ASCENDING), ('n', ASCENDING)])\n", (1625, 1670), False, 'from bson.son import SON\n'), ((1682, 1739), 'bson.son.SON', 'SON', (["[('filename', ASCENDING), ('uploadDate', ASCENDING)]"], {}), "([('filename', ASCEN...
tcl326/forte
forte/processors/tests/stanfordnlp_processor_test.py
d0d7b8b97da5e1d507dfa7cd4ec51d96067770b8
"""This module tests Stanford NLP processors.""" import os import unittest from texar.torch import HParams from forte.pipeline import Pipeline from forte.data.readers import StringReader from forte.processors.stanfordnlp_processor import StandfordNLPProcessor from ft.onto.base_ontology import Token, Sentence class ...
[((938, 1025), 'unittest.skip', 'unittest.skip', (['"""We need to test this without needing to download models everytime"""'], {}), "(\n 'We need to test this without needing to download models everytime')\n", (951, 1025), False, 'import unittest\n'), ((414, 424), 'forte.pipeline.Pipeline', 'Pipeline', ([], {}), '()...
eventh/m3u8looper
src/serve_files.py
9c4ae166e9af4679cf64b19e3c3efc7bbdaed5a5
#! /usr/bin/env python3 # -*- coding: utf-8 -*- """ Serve current folder files in a HTTP webserver. """ import socketserver from threading import Thread from http.server import SimpleHTTPRequestHandler PORT = 8000 def start_http_server(port=PORT): httpd = socketserver.TCPServer(("", port), SimpleHTTPRequestHand...
[((264, 324), 'socketserver.TCPServer', 'socketserver.TCPServer', (["('', port)", 'SimpleHTTPRequestHandler'], {}), "(('', port), SimpleHTTPRequestHandler)\n", (286, 324), False, 'import socketserver\n'), ((342, 376), 'threading.Thread', 'Thread', ([], {'target': 'httpd.serve_forever'}), '(target=httpd.serve_forever)\n...
yxzoro/pypy
pypy/module/__builtin__/test/test_compile.py
6e47b3d3e5513d9639a21554963a6ace172ccfee
# coding: utf-8 class AppTestCompile: def test_simple(self): import sys co = compile('1+2', '?', 'eval') assert eval(co) == 3 co = compile(memoryview(b'1+2'), '?', 'eval') assert eval(co) == 3 exc = raises(ValueError, compile, chr(0), '?', 'eval') assert str(...
[((4989, 5004), 'ast.parse', 'ast.parse', (['code'], {}), '(code)\n', (4998, 5004), False, 'import ast\n'), ((5432, 5447), 'ast.parse', 'ast.parse', (['code'], {}), '(code)\n', (5441, 5447), False, 'import ast\n'), ((4463, 4481), 'ast.parse', 'ast.parse', (['codestr'], {}), '(codestr)\n', (4472, 4481), False, 'import a...
huangbrandon432/Investing-Trading-Tool
tickers_graphing_module.py
370015b906b7ee90c0fb48ca69865ac7428b3917
import yfinance as yf import matplotlib.pyplot as plt import plotly.express as px import plotly.graph_objects as go from plotly.subplots import make_subplots import pandas as pd from IPython.display import Markdown import numpy as np from datetime import date, timedelta def plot_and_get_info(ticker, start = None, en...
[((361, 378), 'yfinance.Ticker', 'yf.Ticker', (['ticker'], {}), '(ticker)\n', (370, 378), True, 'import yfinance as yf\n'), ((711, 810), 'plotly.subplots.make_subplots', 'make_subplots', ([], {'rows': '(2)', 'cols': '(1)', 'shared_xaxes': '(True)', 'vertical_spacing': '(0.03)', 'row_heights': '[0.8, 0.2]'}), '(rows=2, ...
amsks/generic_flexbe_states
flexbe_navigation_states/src/flexbe_navigation_states/navigation_sm.py
f7be84105d3370c943ed17fc19af672b330726de
#!/usr/bin/env python # -*- coding: utf-8 -*- ########################################################### # WARNING: Generated code! # # ************************** # # Manual changes may get lost if file is generated again. # # Only code inside the [MANUAL] ta...
[((1839, 1894), 'flexbe_core.OperatableStateMachine', 'OperatableStateMachine', ([], {'outcomes': "['finished', 'failed']"}), "(outcomes=['finished', 'failed'])\n", (1861, 1894), False, 'from flexbe_core import Behavior, Autonomy, OperatableStateMachine, ConcurrencyContainer, PriorityContainer, Logger\n'), ((2094, 2116...
dlehman83/text2cc
text2cc/xml_assessment.py
303798993590bceaeb5238a6cce82893c37cdfc7
# -*- coding: utf-8 -*- # # Copyright (c) 2021, Dana Lehman # Copyright (c) 2020, Geoffrey M. Poore # All rights reserved. # # Licensed under the BSD 3-Clause License: # http://opensource.org/licenses/BSD-3-Clause # from .quiz import Quiz, Question, GroupStart, GroupEnd, TextRegion BEFORE_ITEMS = '''\ <?xml version...
[]
bids-standard/bids-statsmodels-design-synthesizer
tests/test_aggregate_stats_design.py
d8a1dac3891760990082c2d3aa75a1edda44ffa0
#!/usr/bin/env python """Tests for `bids_statsmodels_design_synthesizer` package.""" import pytest import subprocess as sp from pathlib import Path SYNTHESIZER = "aggregate_stats_design.py" from bids_statsmodels_design_synthesizer import aggregate_stats_design as synth_mod # from bids_statsmodels_design_synthesizer...
[((1737, 1802), 'pytest.mark.xfail', 'pytest.mark.xfail', ([], {'reason': '"""Container not setup for boutiques yet"""'}), "(reason='Container not setup for boutiques yet')\n", (1754, 1802), False, 'import pytest\n'), ((896, 929), 'bids_statsmodels_design_synthesizer.aggregate_stats_design.main', 'synth_mod.main', (['E...
skynetera/skynet
skynet-agent/plugins/plugin_api.py
24a50f2a2eb95b777802934a2b66f162bf4b2d53
#!/usr/bin/env python # coding: utf-8 __author__ = 'whoami' """ @version: 1.0 @author: whoami @license: Apache Licence 2.0 @contact: skutil@gmail.com @site: http://www.itweet.cn @software: PyCharm Community Edition @file: plugin_api.py @time: 2015-11-28 下午1:52 """ from linux import cpu,disk,iostats,loadavg,memory,net...
[((364, 381), 'linux.loadavg.monitor', 'loadavg.monitor', ([], {}), '()\n', (379, 381), False, 'from linux import cpu, disk, iostats, loadavg, memory, netstats, swap\n'), ((416, 429), 'linux.cpu.monitor', 'cpu.monitor', ([], {}), '()\n', (427, 429), False, 'from linux import cpu, disk, iostats, loadavg, memory, netstat...
jwcarr/drift
code/figure_warp.py
a514c5970ba53025cc142257e953c1bda3cd049c
import numpy as np import eyekit import algorithms import core data = eyekit.io.load(core.FIXATIONS / 'sample.json') passages = eyekit.io.load(core.DATA / 'passages.json') original_sequence = data['trial_5']['fixations'] fixation_XY = np.array([fixation.xy for fixation in original_sequence], dtype=int) word_XY = np....
[((71, 117), 'eyekit.io.load', 'eyekit.io.load', (["(core.FIXATIONS / 'sample.json')"], {}), "(core.FIXATIONS / 'sample.json')\n", (85, 117), False, 'import eyekit\n'), ((129, 172), 'eyekit.io.load', 'eyekit.io.load', (["(core.DATA / 'passages.json')"], {}), "(core.DATA / 'passages.json')\n", (143, 172), False, 'import...
krux/python-storm
storm/Nimbus.py
1a9c06d3580a2b1bc2c27174d892a6dbcaa9e0bd
# # Autogenerated by Thrift Compiler (0.9.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py # from thrift.Thrift import TType, TMessageType, TException, TApplicationException from ttypes import * from thrift.Thrift import TProcessor from thrift.transport import TTransport ...
[((9800, 9905), 'thrift.Thrift.TApplicationException', 'TApplicationException', (['TApplicationException.MISSING_RESULT', '"""beginFileUpload failed: unknown result"""'], {}), "(TApplicationException.MISSING_RESULT,\n 'beginFileUpload failed: unknown result')\n", (9821, 9905), False, 'from thrift.Thrift import TType...
philipwfowler/genucator
gemucator/__init__.py
d43a79afe1aa81ca24d7ab4370ed230e08aa89bf
#! /usr/bin/env python from .core import gemucator
[]
daniel-waruo/e-commerse-api
client/checkout/schema/types.py
6b080039398fb4099a34335317d649dd67783f63
import graphene from graphene_django import DjangoObjectType from graphene_django.converter import convert_django_field from pyuploadcare.dj.models import ImageField
[]
PlantDr430/CSU_scripts
pangenome_fluidity.py
8ed9e1dc014b099ce68d77ce5c8747217c230e61
#!/usr/bin/python3 ''' This script follows formulas put forth in Kislyuk et al. (2011) to calculate genome fluidity of a pangenome dataset. Variance and standard error are estimated as total variance containing both the variance due to subsampling all possible combinations (without replacement) of N genomes from th...
[((1749, 1760), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (1758, 1760), False, 'import os, sys, re, argparse, random, itertools, scipy, warnings, subprocess\n'), ((1921, 2222), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'usage': '"""./%(prog)s [options] -i orthogroups -o output_folder"""', 'descripti...
CCSGroupInternational/osvolbackup
osvolbackup/backup.py
d0d93812a729acdb6c961c6bdd1cc2cb5c9c87f5
# # This module provides the Instance class that encapsulate some complex server instances related operations # from __future__ import print_function from json import loads from neutronclient.v2_0 import client as neutron_client from novaclient import client as nova_client from cinderclient import client as cinder_cli...
[((757, 770), 'osvolbackup.osauth.get_session', 'get_session', ([], {}), '()\n', (768, 770), False, 'from osvolbackup.osauth import get_session, VERSION\n'), ((794, 832), 'neutronclient.v2_0.client.Client', 'neutron_client.Client', ([], {'session': 'session'}), '(session=session)\n', (815, 832), True, 'from neutronclie...
JohannesBuchner/gammapy
gammapy/estimators/profile.py
48769519f04b7df7b3e4580ebb61396445790bc3
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Tools to create profiles (i.e. 1D "slices" from 2D images).""" import numpy as np import scipy.ndimage from astropy import units as u from astropy.convolution import Box1DKernel, Gaussian1DKernel from astropy.coordinates import Angle from astropy.table ...
[((5684, 5691), 'astropy.table.Table', 'Table', ([], {}), '()\n', (5689, 5691), False, 'from astropy.table import Table\n'), ((8050, 8068), 'astropy.units.Quantity', 'u.Quantity', (['radius'], {}), '(radius)\n', (8060, 8068), True, 'from astropy import units as u\n'), ((12194, 12221), 'matplotlib.pyplot.figure', 'plt.f...
KATO-Hiro/AtCoder
ABC/abc001-abc050/abc007/b.py
cbbdb18e95110b604728a54aed83a6ed6b993fde
# -*- coding: utf-8 -*- def main(): a = input() # See: # https://www.slideshare.net/chokudai/abc007 if a == 'a': print('-1') else: print('a') if __name__ == '__main__': main()
[]
crimergio/linux_test
env/lib/python3.8/site-packages/versatileimagefield/mixins.py
5e688a06884ab10b4eaaad10a5d0df417a1c9b31
"""versatileimagefield Field mixins.""" import os import re from .datastructures import FilterLibrary from .registry import autodiscover, versatileimagefield_registry from .settings import ( cache, VERSATILEIMAGEFIELD_CREATE_ON_DEMAND, VERSATILEIMAGEFIELD_SIZED_DIRNAME, VERSATILEIMAGEFIELD_FILTERED_DIR...
[((848, 886), 're.compile', 're.compile', (["(filter_regex_snippet + '$')"], {}), "(filter_regex_snippet + '$')\n", (858, 886), False, 'import re\n'), ((901, 938), 're.compile', 're.compile', (["(sizer_regex_snippet + '$')"], {}), "(sizer_regex_snippet + '$')\n", (911, 938), False, 'import re\n'), ((964, 1024), 're.com...
HanGuo97/federated
differential_privacy/run_federated.py
7e64bfe86bb606fad2ea7bc2a0f8ebdb565546f9
# Copyright 2020, Google LLC. # # 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...
[((941, 973), 'utils.utils_impl.record_hparam_flags', 'utils_impl.record_hparam_flags', ([], {}), '()\n', (971, 973), False, 'from utils import utils_impl\n'), ((1025, 1073), 'utils.optimizers.optimizer_utils.define_optimizer_flags', 'optimizer_utils.define_optimizer_flags', (['"""client"""'], {}), "('client')\n", (106...
anhvth/Pseudo_Lidar_V2
waymo_kitti_converter/tools/visual_point_cloud.py
d7a29ffc811e315df25bba2a43acf288d4ceb30e
import open3d as o3d import numpy as np pc_load_pathname = '/home/caizhongang/github/waymo_kitti_converter/007283-000.bin' pc = np.fromfile(pc_load_pathname, dtype=np.float32).reshape(-1, 3) pcd = o3d.geometry.PointCloud() pcd.points = o3d.utility.Vector3dVector(pc) axis = o3d.geometry.TriangleMesh.create_coordinat...
[((199, 224), 'open3d.geometry.PointCloud', 'o3d.geometry.PointCloud', ([], {}), '()\n', (222, 224), True, 'import open3d as o3d\n'), ((239, 269), 'open3d.utility.Vector3dVector', 'o3d.utility.Vector3dVector', (['pc'], {}), '(pc)\n', (265, 269), True, 'import open3d as o3d\n'), ((278, 353), 'open3d.geometry.TriangleMes...
scottwedge/OpenStack-Stein
designate-8.0.0/designate/tests/test_api/test_v2/test_limits.py
7077d1f602031dace92916f14e36b124f474de15
# Copyright 2013 Hewlett-Packard Development Company, L.P. # # Author: Kiall Mac Innes <kiall@managedit.ie> # # 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/lice...
[]
alexus37/AugmentedRealityChess
pythonAnimations/pyOpenGLChess/engineDirectory/oglc-env/lib/python2.7/site-packages/OpenGLContext/scenegraph/nodepath.py
7f600ad153270feff12aa7aa86d7ed0a49ebc71c
"""node-path implementation for OpenGLContext """ from vrml.vrml97 import nodepath, nodetypes from vrml.cache import CACHE from OpenGLContext import quaternion from OpenGL.GL import glMultMatrixf class _NodePath( object ): """OpenGLContext-specific node-path class At the moment this only adds a single method,...
[((1074, 1095), 'OpenGL.GL.glMultMatrixf', 'glMultMatrixf', (['matrix'], {}), '(matrix)\n', (1087, 1095), False, 'from OpenGL.GL import glMultMatrixf\n'), ((1435, 1458), 'OpenGLContext.quaternion.Quaternion', 'quaternion.Quaternion', ([], {}), '()\n', (1456, 1458), False, 'from OpenGLContext import quaternion\n'), ((15...
ApprenticeOne/python_learn
part01_basic/for_while_loop.py
2433726b3f164526e8a8fa18739854e052d76a2e
import random from math import sqrt sum = 0 for x in range(101): sum += x print(sum) ''' range(101) 0-100 一共101个数 range(1,101) 1-100 range(1,101,2) 1-100间的奇数 步长为2 range(100,0,-2) 100-0间的偶数 步长为-2 ''' sum = 0 for x in range(100, 0, -2): sum += x print(sum) # while # 0-100间的随机数 answer = random.randint(0, 1...
[((301, 323), 'random.randint', 'random.randint', (['(0)', '(100)'], {}), '(0, 100)\n', (315, 323), False, 'import random\n'), ((789, 798), 'math.sqrt', 'sqrt', (['num'], {}), '(num)\n', (793, 798), False, 'from math import sqrt\n')]
ElementGenomicsInc/toil
src/toil/batchSystems/htcondor.py
e29a07db194469afba3edf90ffeee8f981f7344b
# Copyright (C) 2018, HTCondor Team, Computer Sciences Department, # University of Wisconsin-Madison, WI. # # 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/license...
[((911, 938), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (928, 938), False, 'import logging\n'), ((3902, 3936), 'htcondor.Submit', 'htcondor.Submit', (['submit_parameters'], {}), '(submit_parameters)\n', (3917, 3936), False, 'import htcondor\n'), ((8621, 8657), 'os.getenv', 'os.getenv...
alanlv/PaddleSpeech
paddlespeech/t2s/modules/tacotron2/decoder.py
7413c9e48ac77fdece45e0b4ffe41f7746ef0583
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
[((2127, 2141), 'paddle.nn.LayerList', 'nn.LayerList', ([], {}), '()\n', (2139, 2141), False, 'from paddle import nn\n'), ((2163, 2188), 'six.moves.range', 'six.moves.range', (['n_layers'], {}), '(n_layers)\n', (2178, 2188), False, 'import six\n'), ((4194, 4208), 'paddle.nn.LayerList', 'nn.LayerList', ([], {}), '()\n',...
Mattlk13/pyBlazing
pyblazing/__init__.py
5c3042c510ab17e9f9d1647e1873d3d04313d900
from .api import run_query_get_token from .api import convert_to_dask from .api import run_query_get_results from .api import run_query_get_concat_results from .api import register_file_system from .api import deregister_file_system from .api import FileSystemType, DriverType, EncryptionType from .api import SchemaFro...
[]
apurwaj2/df-on-k8s
bootstrap/p1.5.0/src/common/const.py
1aecb0bc293d008c5a2384df32ad434bfcc51caa
class Constants(object): LOGGER_CONF = "common/mapr_conf/logger.yml" USERNAME = "mapr" GROUPNAME = "mapr" USERID = 5000 GROUPID = 5000 ADMIN_USERNAME = "custadmin" ADMIN_GROUPNAME = "custadmin" ADMIN_USERID = 7000 ADMIN_GROUPID = 7000 ADMIN_PASS = "mapr" MYSQL_USER = "admin"...
[]
jeonghyunkeem/PointGroup
dataset/scan2cad/s2c_collect_pgroup.py
fa90830259aeb37d2e0f203471552d2f43cbc60b
# Jeonghyun Kim, UVR KAIST @jeonghyunct.kaist.ac.kr import os, sys import json import h5py import numpy as np import quaternion import torch from torch.utils.data import Dataset BASE_DIR_1 = os.path.dirname(os.path.abspath(__file__)) # scan2cad BASE_DIR = os.path.dirname(BASE_DIR_1) # dataset ROOT_DIR = os.path.dirn...
[((258, 285), 'os.path.dirname', 'os.path.dirname', (['BASE_DIR_1'], {}), '(BASE_DIR_1)\n', (273, 285), False, 'import os, sys\n'), ((308, 333), 'os.path.dirname', 'os.path.dirname', (['BASE_DIR'], {}), '(BASE_DIR)\n', (323, 333), False, 'import os, sys\n'), ((361, 386), 'os.path.dirname', 'os.path.dirname', (['ROOT_DI...
ryokbys/nap
nappy/msd2diff.py
ddd0b5a5a956f7c335a22adb4f8e00f1d38a7804
#!/usr/bin/env python """ Compute diffusion coefficient from MSD data. Time interval, DT, is obtained from in.pmd in the same directory. Usage: msd2diff.py [options] MSD_FILE Options: -h, --help Show this message and exit. -o, --offset OFFSET Offset of given data. [default: 0] --plot Plot ...
[((2118, 2135), 'numpy.var', 'np.var', (['A[:, (0)]'], {}), '(A[:, (0)])\n', (2124, 2135), True, 'import numpy as np\n'), ((2149, 2185), 'numpy.linalg.lstsq', 'np.linalg.lstsq', (['A', 'msds'], {'rcond': 'None'}), '(A, msds, rcond=None)\n', (2164, 2185), True, 'import numpy as np\n'), ((2443, 2458), 'docopt.docopt', 'd...
jcsesznegi/advent-of-code-2017
5/part2.py
9710e184e092b82aa798076b9ce3915c6e42758d
import os f = open(os.path.join(os.path.dirname(__file__), '../input/5/part2.txt'), 'r') class InstructionSet: def __init__(self, instructions): self.instructions = instructions self.currentIndex = 0 self.numberSteps = 0 def _changeOffsetValue(self, index): if self.instructi...
[((33, 58), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (48, 58), False, 'import os\n')]
MhmdRyhn/behavior_test
features/steps/basic_account_add_bdd.py
868252e0b31596e0bff4a969745cf3b633c13695
import behave @behave.when('I add $1200 to my account') def add_usd_1200(context): context.account.add_cash(amount=1200) @behave.then('It becomes $3200 in my account') def check_for_increase_to_usd_1880(context): assert context.account.current_cash == 3200
[((17, 57), 'behave.when', 'behave.when', (['"""I add $1200 to my account"""'], {}), "('I add $1200 to my account')\n", (28, 57), False, 'import behave\n'), ((130, 175), 'behave.then', 'behave.then', (['"""It becomes $3200 in my account"""'], {}), "('It becomes $3200 in my account')\n", (141, 175), False, 'import behav...
naveengh6/blinkpy
tests/test_sync_module.py
e821687f2b7590b13532ac596c31e8eaa6c7b69a
"""Tests camera and system functions.""" import unittest from unittest import mock from blinkpy.blinkpy import Blink from blinkpy.helpers.util import BlinkURLHandler from blinkpy.sync_module import BlinkSyncModule, BlinkOwl from blinkpy.camera import BlinkCamera, BlinkCameraMini @mock.patch("blinkpy.auth.Auth.query"...
[((284, 321), 'unittest.mock.patch', 'mock.patch', (['"""blinkpy.auth.Auth.query"""'], {}), "('blinkpy.auth.Auth.query')\n", (294, 321), False, 'from unittest import mock\n'), ((499, 523), 'blinkpy.blinkpy.Blink', 'Blink', ([], {'motion_interval': '(0)'}), '(motion_interval=0)\n', (504, 523), False, 'from blinkpy.blink...
naylor-b/dymos
dymos/examples/min_time_climb/aero/aero.py
56ee72041056ae20c3332d060e291c4da93844b1
from __future__ import absolute_import import numpy as np from openmdao.api import Group from .dynamic_pressure_comp import DynamicPressureComp from .lift_drag_force_comp import LiftDragForceComp from .cd0_comp import CD0Comp from .kappa_comp import KappaComp from .cla_comp import CLaComp from .cl_comp import CLComp...
[]
jakeb1996/SBS
stats.py
3bcc0017d22674d4290be1b272aeac4836f0d5ec
import matplotlib.pyplot as plt import argparse, csv, numpy, time, os, re def main(resultsFile, toolName): filesToCalc = [] toolNames = [] if os.path.isfile(resultsFile): # the user must have defined an exact file to plot filesToCalc.append(resultsFile) toolNames.appen...
[]
andrey18106/vocabulary_bot
callback_handlers.py
68a5835fb69e255df1766c2ed5c5228daaa4f06f
# -*- coding: utf-8 -*- # ===== Default imports ===== import asyncio import logging # ===== External libs imports ===== from aiogram import Bot, Dispatcher, types from aiogram.dispatcher import FSMContext # ===== Local imports ===== from analytics import BotAnalytics from db_manager import DbManager from lang_man...
[((6698, 6730), 'states.Dictionary.DictionaryState.dictionary.set', 'DictionaryState.dictionary.set', ([], {}), '()\n', (6728, 6730), False, 'from states.Dictionary import DictionaryQuizState, DictionaryState, DictionaryEditWordState, DictionarySearchWordState\n'), ((15621, 15659), 'states.Dictionary.DictionaryQuizStat...
karolinanikolova/SoftUni-Software-Engineering
1-Python-Programming-Basics (Sep 2020)/Course-Exercises-and-Exams/06_Nested-Loops/02.Exercise-06-Special-Numbers.py
7891924956598b11a1e30e2c220457c85c40f064
# 6. Специални числа # Да се напише програма, която чете едно цяло число N, въведено от потребителя, и генерира всички възможни "специални" # числа от 1111 до 9999. За да бъде “специално” едно число, то трябва да отговаря на следното условие: # • N да се дели на всяка една от неговите цифри без остатък. # Пример: при N...
[]
sqbl/scikit-optimize
skopt/tests/test_transformers.py
c1866d5a9ad67efe93ac99736bfc2dc659b561d4
import pytest import numbers import numpy as np from numpy.testing import assert_raises from numpy.testing import assert_array_equal from numpy.testing import assert_equal from numpy.testing import assert_raises_regex from skopt.space import LogN, Normalize @pytest.mark.fast_test def test_logn2_integer(): transf...
[((328, 335), 'skopt.space.LogN', 'LogN', (['(2)'], {}), '(2)\n', (332, 335), False, 'from skopt.space import LogN, Normalize\n'), ((559, 566), 'skopt.space.LogN', 'LogN', (['(2)'], {}), '(2)\n', (563, 566), False, 'from skopt.space import LogN, Normalize\n'), ((793, 822), 'skopt.space.Normalize', 'Normalize', (['(1)',...
dspoka/mnm
tokenization_numerical.py
f212e8d5697a4556c6469d469a2930b203667828
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # # 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/LICEN...
[((907, 934), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (924, 934), False, 'import logging\n'), ((3496, 3521), 'collections.OrderedDict', 'collections.OrderedDict', ([], {}), '()\n', (3519, 3521), False, 'import collections\n'), ((22899, 22925), 'unicodedata.category', 'unicodedata.c...
wheelerMT/spin-1_BEC
dipole/splitting_dipole.py
e8ea34699b4001847c6b4c7451c11be241ce598f
import numpy as np import multiprocessing as mp import pyfftw from numpy import pi, exp, sqrt, sin, cos, conj, arctan, tanh, tan from numpy import heaviside as heav from include import helper import h5py # ---------Spatial and potential parameters-------------- Mx = My = 64 Nx = Ny = 128 # Number of grid pts dx = dy...
[((518, 535), 'numpy.meshgrid', 'np.meshgrid', (['x', 'y'], {}), '(x, y)\n', (529, 535), True, 'import numpy as np\n'), ((564, 616), 'h5py.File', 'h5py.File', (['"""../data/splitting_dipole_data.hdf5"""', '"""a"""'], {}), "('../data/splitting_dipole_data.hdf5', 'a')\n", (573, 616), False, 'import h5py\n'), ((815, 834),...
cam-laf/vectorcast-execution-plugin
src/main/resources/scripts/crumbDiag.py
fd54e8580886084d040d21fa809be8a609d44d8e
from __future__ import print_function import requests import sys import os verbose=True try: username=os.environ['USERNAME'] password=os.environ['PASSWORD'] except: print("Crumb Diaganostic requires USERNAME/PASSWORD to be set as environment variables") sys.exit(-1) jenkins_url=os.environ['JENKINS_URL'...
[((446, 490), 'requests.get', 'requests.get', (['url'], {'auth': '(username, password)'}), '(url, auth=(username, password))\n', (458, 490), False, 'import requests\n'), ((271, 283), 'sys.exit', 'sys.exit', (['(-1)'], {}), '(-1)\n', (279, 283), False, 'import sys\n'), ((1020, 1032), 'sys.exit', 'sys.exit', (['(-1)'], {...
vicenteneto/online-judge-solutions
URI/1-Beginner/1099.py
4176e2387658f083b980d7b49bc98300a4c28411
# -*- coding: utf-8 -*- for i in range(int(raw_input())): x, y = [int(x) for x in raw_input().split()] if x > y: x, y = y, x x += 1 if x % 2 == 0 else 2 print sum([j for j in range(x, y, 2)])
[]
MahirGulzar/fpointnet-tiny
mock_file.py
e79406f648573d50fa3988ca987db652ab1286b8
import tensorflow as tf FLIPPING_TENSOR = tf.constant([1.0, -1.0, 1.0]) @tf.function def sample_data(points, labels, num_point): if tf.random.uniform(shape=()) >= 0.5: return points * FLIPPING_TENSOR, labels return points, labels mock_data = tf.constant([ [1., 2., 3.], [4., 5., 6.], [7....
[((43, 72), 'tensorflow.constant', 'tf.constant', (['[1.0, -1.0, 1.0]'], {}), '([1.0, -1.0, 1.0])\n', (54, 72), True, 'import tensorflow as tf\n'), ((263, 327), 'tensorflow.constant', 'tf.constant', (['[[1.0, 2.0, 3.0], [4.0, 5.0, 6.0], [7.0, 8.0, 9.0]]'], {}), '([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0], [7.0, 8.0, 9.0]])\n',...
dataholiks/flask_heroku_scheduler
myapp.py
d2b4c2c8fdee066aea729c1566bfbaf52c068557
from flask import Flask app = Flask(__name__) @app.route('/') def index(): return 'This is the app index page.'
[((30, 45), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (35, 45), False, 'from flask import Flask\n')]
bostud/day_ok
day_ok/schedule/migrations/0027_auto_20210216_1337.py
2bcee68252b698f5818808d1766fb3ec3f07fce8
# Generated by Django 3.1.6 on 2021-02-16 11:37 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('schedule', '0026_event'), ] operations = [ migrations.AlterField( model_name='group', name='students', f...
[((325, 403), 'django.db.models.ManyToManyField', 'models.ManyToManyField', ([], {'blank': '(True)', 'to': '"""schedule.Student"""', 'verbose_name': '"""Учні"""'}), "(blank=True, to='schedule.Student', verbose_name='Учні')\n", (347, 403), False, 'from django.db import migrations, models\n'), ((528, 615), 'django.db.mod...
OliverChao/PyWhoAmI
Blog.py
8742e0a44c4e673d038779b01b14b0cfb7d5395f
import aiohttp import asyncio import time import time import argparse import glob import os import shutil import random import re import requests import sys from concurrent import futures import pdfkit import time from retrying import retry from pygments import highlight from pygments.lexers import...
[((1097, 1140), 'os.path.join', 'os.path.join', (['scripFilePath', '"""whoamiPDFdir"""'], {}), "(scripFilePath, 'whoamiPDFdir')\n", (1109, 1140), False, 'import os\n'), ((1151, 1194), 'os.path.join', 'os.path.join', (['scripFilePath', '"""whoamiCPPdir"""'], {}), "(scripFilePath, 'whoamiCPPdir')\n", (1163, 1194), False,...
dslowikowski/commcare-hq
corehq/apps/app_manager/tests/test_xml_parsing.py
ad8885cf8dab69dc85cb64f37aeaf06106124797
from django.test import SimpleTestCase as TestCase from corehq.apps.app_manager.models import _parse_xml import os class XMLParsingTest(TestCase): def testUnicodeError(self): """Tests a bug found in Unicode processing of a form""" file_path = os.path.join(os.path.dirname(__file__), "data", "un...
[((282, 307), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (297, 307), False, 'import os\n'), ((443, 463), 'corehq.apps.app_manager.models._parse_xml', '_parse_xml', (['xml_data'], {}), '(xml_data)\n', (453, 463), False, 'from corehq.apps.app_manager.models import _parse_xml\n')]
NeonOcean/Environment
S4/S4 Library/generated/protocolbuffers/Localization_pb2.py
ca658cf66e8fd6866c22a4a0136d415705b36d26
import protocolbuffers.Consts_pb2 as Consts_pb2 from google.protobuf import descriptor, message, reflection DESCRIPTOR = descriptor.FileDescriptor(name = 'Localization.proto', package = 'EA.Sims4.Network', serialized_pb = '\n\x12Localization.proto\x12\x10EA.Sims4.Network\x1a\x0cConsts.proto"\x85\n\n\x14Loc...
[((122, 3070), 'google.protobuf.descriptor.FileDescriptor', 'descriptor.FileDescriptor', ([], {'name': '"""Localization.proto"""', 'package': '"""EA.Sims4.Network"""', 'serialized_pb': '\'\\n\\x12Localization.proto\\x12\\x10EA.Sims4.Network\\x1a\\x0cConsts.proto"\\x85\\n\\n\\x14LocalizedStringToken\\x12G\\n\\x04type\\x...
fumiyanll23/algo-method
dynamic_programming/01/01-06.py
d86ea1d399cbc5a1db0ae49d0c82e41042f661ab
# input N, M = map(int, input().split()) Ds = [*map(int, input().split())] # compute dp = [False] * (N+1) for ni in range(N+1): if ni == 0: dp[ni] = True for D in Ds: if ni >= D: dp[ni] = dp[ni] or dp[ni-D] # output print("Yes" if dp[-1] else "No")
[]
ArshSood/sorting
swapsort.py
97e1188ad626420e8ffeab992f7e98a2a91ae4b1
# sorting n=int(input()) array=list(map(int,input().split())) i=0 count=[] counter=0 while i<len(array): min=i start=i+1 while(start<len(array)): if array[start]<array[min]: min=start start+=1 if i!=min: array[i],array[min]=array[min],array[i] count.append(i) ...
[]
mucciz/News
tests/news_test.py
2484d91edaef181d9a6d4b86d6bee822781f931d
import unittest from app.models import News # News = news.News class NewsTest(unittest.TestCase): ''' Test Class to test the behaviour of the Movie class ''' def setUp(self): ''' Set up method that will run before every Test ''' self.new_news = News('abc-news','ABC NEWS...
[((295, 492), 'app.models.News', 'News', (['"""abc-news"""', '"""ABC NEWS"""', '"""Your trusted source for breaking news, analysis, exclusive interviews, headlines, and videos at ABCNews.com."""', '"""http://www.abc.net.au/news"""', '"""business"""', '"""au"""'], {}), "('abc-news', 'ABC NEWS',\n 'Your trusted source...
MQasimSarfraz/cilium
test/get-gh-comment-info.py
89b622cf4e0a960e27e5b1bf9f139abee25dfea0
import argparse parser = argparse.ArgumentParser() parser.add_argument('ghcomment', type=str) # this is for test-me-please phrases parser.add_argument('--focus', type=str, default="") parser.add_argument('--version', type=str, default="") parser.add_argument('--retrieve', type=str, default="focus") args = parser.pars...
[]
madcat1991/clustered_cars
preprocessing/booking.py
a79b83d9d14360c6c51d4bf462217ef690e62c74
""" This script cleans and prepares the data set of bookings for the future usage """ import argparse import logging import sys import pandas as pd from preprocessing.common import canonize_datetime, raw_data_to_df, check_processed_columns, check_data OLD_BREAKPOINT_MATCHER = { 2001: [ (1, 1, "New Year"...
[((4830, 4888), 'logging.info', 'logging.info', (['u"""DF shape before fine tuning: %s"""', 'df.shape'], {}), "(u'DF shape before fine tuning: %s', df.shape)\n", (4842, 4888), False, 'import logging\n'), ((5097, 5151), 'logging.info', 'logging.info', (['u"""Filling NA with average: %s"""', 'averages'], {}), "(u'Filling...
PKU-GeekGame/gs-backend
src/api/wish.py
d13219609d4e52810540bda6a3bddac1bf5406ce
from sanic import Blueprint, Request, HTTPResponse, response from sanic.models.handler_types import RouteHandler from functools import wraps from inspect import isawaitable from typing import Callable, Dict, Any, Union, Awaitable, List, Optional ACCEPTED_WISH_VERS = ['wish.alpha.v1'] WishHandler = Callable[..., Union...
[((604, 613), 'functools.wraps', 'wraps', (['fn'], {}), '(fn)\n', (609, 613), False, 'from functools import wraps\n'), ((1107, 1147), 'sanic.response.json', 'response.json', (["{'error': None, **retval}"], {}), "({'error': None, **retval})\n", (1120, 1147), False, 'from sanic import Blueprint, Request, HTTPResponse, re...