repo_name
stringlengths
7
94
repo_path
stringlengths
4
237
repo_head_hexsha
stringlengths
40
40
content
stringlengths
10
680k
apis
stringlengths
2
680k
Majanao/pytorch-blender
tests/test_env.py
eb5effb033094d037e7bdc2238c00806be7012ae
import pytest from pathlib import Path from blendtorch import btt BLENDDIR = Path(__file__).parent/'blender' class MyEnv(btt.env.OpenAIRemoteEnv): def __init__(self, background=True, **kwargs): super().__init__(version='1.0.0') self.launch(scene=BLENDDIR/'env.blend', script=BLENDDIR / ...
[((78, 92), 'pathlib.Path', 'Path', (['__file__'], {}), '(__file__)\n', (82, 92), False, 'from pathlib import Path\n'), ((714, 732), 'pytest.approx', 'pytest.approx', (['(0.1)'], {}), '(0.1)\n', (727, 732), False, 'import pytest\n'), ((900, 918), 'pytest.approx', 'pytest.approx', (['(0.6)'], {}), '(0.6)\n', (913, 918),...
sitkatech/django-sitetree
sitetree/__init__.py
5d7e9d503f97ff021c5c04855e04e098b3d2488c
VERSION = (0, 9, 5)
[]
tahashmi/deepvariant
deepvariant/runtime_by_region_vis.py
441c1809d3290f4a20b29a0a0bbf8ecfb929a6e3
# Copyright 2020 Google LLC. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. # #...
[((2264, 2433), 'absl.flags.DEFINE_string', 'flags.DEFINE_string', (['"""input"""', 'None', '"""TSV file that was produced when running make_examples with --runtime_by_region. Can be sharded, e.g. /path/runtime@64.tsv."""'], {}), "('input', None,\n 'TSV file that was produced when running make_examples with --runtim...
wangyum/anaconda
pkgs/dynd-python-0.7.2-py27_0/lib/python2.7/site-packages/dynd/tests/test_nd_fields.py
6e5a0dbead3327661d73a61e85414cf92aa52be6
import sys import unittest from dynd import nd, ndt """ class TestFields(unittest.TestCase): def test_simple(self): a = nd.array([ (1, 2, 'a', 'b'), (3, 4, 'ab', 'cd'), (5, 6, 'def', 'ghi')], type='3 * {x: int32, y: int32, z: string, w: string...
[((4222, 4237), 'unittest.main', 'unittest.main', ([], {}), '()\n', (4235, 4237), False, 'import unittest\n')]
nicrie/xeofs
xeofs/pandas/_transformer.py
4c0ed49b45794ce0abb641c98b82638b2faa4828
from typing import Union, Iterable, List import numpy as np import pandas as pd from ..models._transformer import _ArrayTransformer, _MultiArrayTransformer class _DataFrameTransformer(_ArrayTransformer): '''`_ArrayTransformer` wrapper for `pandas.DataFrame`. ''' def __init__(self): super().__in...
[((1911, 1982), 'pandas.DataFrame', 'pd.DataFrame', (['df'], {'index': 'self.index_samples', 'columns': 'self.index_features'}), '(df, index=self.index_samples, columns=self.index_features)\n', (1923, 1982), True, 'import pandas as pd\n'), ((3153, 3204), 'numpy.cumsum', 'np.cumsum', (['[tf.n_valid_features for tf in se...
FossilizedContainers/fossilized-controller
tests/bogus_python_model.py
5aa14112b3728a619a37233906366c1cda2a0a77
import os import sys import lipd # import pythonAdapter, assumes in ../python-adapter/ tests_dir = os.path.dirname(os.path.realpath(__file__)) fc_dir = os.path.dirname(tests_dir) python_adapter_dir = os.path.join(fc_dir, "python-adapter") sys.path.append(python_adapter_dir) import adapter def fake_model(adapter): ...
[((153, 179), 'os.path.dirname', 'os.path.dirname', (['tests_dir'], {}), '(tests_dir)\n', (168, 179), False, 'import os\n'), ((201, 239), 'os.path.join', 'os.path.join', (['fc_dir', '"""python-adapter"""'], {}), "(fc_dir, 'python-adapter')\n", (213, 239), False, 'import os\n'), ((240, 275), 'sys.path.append', 'sys.path...
banne2266/UAV-autopilot-NCTU-2021
tello_control_ui.py
1a25d4add2de9659516d045054935e3b6e04d06d
from PIL import Image from PIL import ImageTk import tkinter as tki from tkinter import Toplevel, Scale import threading import datetime import cv2 import os import time import platform class TelloUI: """Wrapper class to enable the GUI.""" def __init__(self,tello,outputpath): """ Initial all t...
[((1269, 1277), 'tkinter.Tk', 'tki.Tk', ([], {}), '()\n', (1275, 1277), True, 'import tkinter as tki\n'), ((1358, 1424), 'tkinter.Button', 'tki.Button', (['self.root'], {'text': '"""Snapshot!"""', 'command': 'self.takeSnapshot'}), "(self.root, text='Snapshot!', command=self.takeSnapshot)\n", (1368, 1424), True, 'import...
robin-gdwl/examples_topop-desc
__temp/examples/rhino/mesh-stanford-dragon.py
3a10dfc891c3e6998029c7baf8a5a7a501870fe2
import compas import compas_rhino from compas.datastructures import Mesh mesh = Mesh.from_ply(compas.get('stanford_dragon.ply')) compas_rhino.mesh_draw(mesh)
[((131, 159), 'compas_rhino.mesh_draw', 'compas_rhino.mesh_draw', (['mesh'], {}), '(mesh)\n', (153, 159), False, 'import compas_rhino\n'), ((95, 128), 'compas.get', 'compas.get', (['"""stanford_dragon.ply"""'], {}), "('stanford_dragon.ply')\n", (105, 128), False, 'import compas\n')]
vbsteja/code
Python/ML_DL/DL/Neural-Networks-Demystified-master/partOne.py
0c8f4dc579f5de21b6c55fe6e65c3c8eb5473687
# Neural Networks Demystified # Part 1: Data + Architecture # # Supporting code for short YouTube series on artificial neural networks. # # Stephen Welch # @stephencwelch import numpy as np # X = (hours sleeping, hours studying), y = Score on test X = np.array(([3,5], [5,1], [10,2]), dtype=float) y = np.array(([75], ...
[((254, 302), 'numpy.array', 'np.array', (['([3, 5], [5, 1], [10, 2])'], {'dtype': 'float'}), '(([3, 5], [5, 1], [10, 2]), dtype=float)\n', (262, 302), True, 'import numpy as np\n'), ((304, 345), 'numpy.array', 'np.array', (['([75], [82], [93])'], {'dtype': 'float'}), '(([75], [82], [93]), dtype=float)\n', (312, 345), ...
benstear/manubot
manubot/process/util.py
df184a5c7e5eb98894a3edb43d9772d1ac3e01ab
import json import logging import os import pathlib import re import textwrap import warnings from typing import List, Optional import jinja2 import pandas import requests import requests_cache import yaml from manubot.util import read_serialized_data, read_serialized_dict from manubot.process.bibliography import loa...
[((1529, 1550), 'logging.info', 'logging.info', (['message'], {}), '(message)\n', (1541, 1550), False, 'import logging\n'), ((5171, 5226), 'pandas.DataFrame', 'pandas.DataFrame', (['rows'], {'columns': "['name', 'affiliation']"}), "(rows, columns=['name', 'affiliation'])\n", (5187, 5226), False, 'import pandas\n'), ((7...
wmwilcox/mix-mind
iba_scrape.py
02da016f314bb5f30f267f1f46c67c6d4a4c370c
#! /usr/bin/env python # scrape the IBA pages for cocktail lists import sys import xml.etree.ElementTree as ET from lxml import html import requests from pprint import pprint from collections import OrderedDict import json url = 'http://iba-world.com/new-era-drinks/' jsonfile = 'IBA_new_era_drinks.json' url = 'http...
[]
Royals-Aeo-Gamer/MyPyMods
Data Structures/Tree.py
be3a521e9f823ce0b704f925b19f6f34dcb5405d
class TreeNode: def __init__(self, name, data, parent=None): self.name = name self.parent = parent self.data = data self.childs = {} def add_child(self, name, data): self.childs.update({name:(type(self))(name, data, self)}) def rm_branch(self, name, ansistors_n: lis...
[]
ggiaquin16/GroupProject19
config.py
f491abc4e8f127552dc7384f3378e14029da8008
api_key = "9N7hvPP9yFrjBnELpBdthluBjiOWzJZw" mongo_url = 'mongodb://localhost:27017' mongo_db = 'CarPopularity' mongo_collections = ['CarSalesByYear', 'PopularCarsByRegion'] years_data = ['2019', '2018', '2017', '2016', '2015'] test_mode = True
[]
thu-ml/realsafe
pytorch_ares/pytorch_ares/attack_torch/mim.py
474d549aa402b4cdd5e3629d23d035c31b60a360
import imp import torch import torch.nn as nn import numpy as np import torch.nn.functional as F from pytorch_ares.attack_torch.utils import loss_adv class MIM(object): '''Projected Gradient Descent''' def __init__(self, net, epsilon, p, stepsize, steps, decay_factor, data_name,target, loss, device): ...
[((1334, 1409), 'pytorch_ares.attack_torch.utils.loss_adv', 'loss_adv', (['self.loss', 'netOut', 'label', 'target_labels', 'self.target', 'self.device'], {}), '(self.loss, netOut, label, target_labels, self.target, self.device)\n', (1342, 1409), False, 'from pytorch_ares.attack_torch.utils import loss_adv\n'), ((2571, ...
pwelzel/bornhack-website
src/utils/templatetags/menubutton.py
af794e6a2fba06e09626259c7768feb30ff394be
from django import template register = template.Library() @register.simple_tag(takes_context=True) def menubuttonclass(context, appname): if appname == context['request'].resolver_match.func.view_class.__module__.split(".")[0]: return "btn-primary" else: return "btn-default"
[((40, 58), 'django.template.Library', 'template.Library', ([], {}), '()\n', (56, 58), False, 'from django import template\n')]
Prones94/Make_Wiki
wiki/tests.py
f8816eb31bb370f48affff8568a6b0d0ffaf7cd4
from django.test import TestCase from django.contrib.auth.models import User from wiki.models import Page from django.utils.text import slugify # Create your tests here. class WikiPageTest(TestCase): def test_edit(self): user = User.objects.create_user(username='admin', password='djangopony') self...
[((242, 307), 'django.contrib.auth.models.User.objects.create_user', 'User.objects.create_user', ([], {'username': '"""admin"""', 'password': '"""djangopony"""'}), "(username='admin', password='djangopony')\n", (266, 307), False, 'from django.contrib.auth.models import User\n'), ((391, 461), 'wiki.models.Page.objects.c...
tkiapril/birdy
birdy/__init__.py
cf6a8f8d31c9363dbf7398ae3d78fe3069a5a936
__author__ = 'Mitja Pagon <mitja@inueni.com>' __version__ = '0.2'
[]
KuanKuanQAQ/ares
ares/defense/randomization.py
40dbefc18f6438e1812021fe6d6c3195f22ca295
''' The randomization defense method, which applies random . ''' import tensorflow as tf from ares.defense.input_transformation import input_transformation def randomize(xs, scale_min=0.875, pad_value=0.0): ''' Apply random rescaling and padding to xs. :param xs: A batch of inputs for some classifier. ...
[((569, 620), 'tensorflow.random.uniform', 'tf.random.uniform', (['()'], {'minval': 'scale_min', 'maxval': '(1.0)'}), '((), minval=scale_min, maxval=1.0)\n', (586, 620), True, 'import tensorflow as tf\n'), ((750, 887), 'tensorflow.image.resize', 'tf.image.resize', (['xs', '(height, width)'], {'method': 'tf.image.Resize...
hopeogbons/image-annotation
annotate/backend/admin.py
2d8b1799bc791428fd3ab29d8052195996923130
from django.contrib import admin from annotate.backend.models import Image, Annotation admin.site.register(Image) admin.site.register(Annotation)
[((88, 114), 'django.contrib.admin.site.register', 'admin.site.register', (['Image'], {}), '(Image)\n', (107, 114), False, 'from django.contrib import admin\n'), ((115, 146), 'django.contrib.admin.site.register', 'admin.site.register', (['Annotation'], {}), '(Annotation)\n', (134, 146), False, 'from django.contrib impo...
Competitive-Programmers-Community/LeetCode
34. Find First and Last Position of Element in Sorted Array/main.py
841fdee805b1a626e9f1cd0e12398d25054638af
class Solution: def searchRange(self, nums, target): """ :type nums: List[int] :type target: int :rtype: List[int] """ if not nums: return [-1, -1] low = 0 high = len(nums) - 1 f = 0 while low<=high: mid = (low+h...
[]
LMS57/domato
c/create.py
005739f55b49ead0ac47ea14b324decee05a7625
data = open('./original').readlines() alphabet = { "<":"lt", ">":"gt", "=":"=", "-":'-', "+":"+", "-":"-", "~":"~", "!":"ex", "%":"%", "^":"^", "&":"&", "*":"*", "(":"(", ")":"right_paran", "[":"[",...
[]
isabella232/scale-safe
AppServer/google/appengine/api/memcache/memcache_distributed.py
8b887726768106b6b67d7be6ea257bee5cd83f9a
#!/usr/bin/env python # # Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
[]
arpruss/inflatemesh
inflateutils/exportmesh.py
ab4abfc7794fd4cf96f41bb797e1b2a61f687a46
from struct import pack from .vector import * from .formatdecimal import decimal from numbers import Number import os import sys try: basestring except: basestring = str def isColorTriangleList(polys): return isinstance(polys[0][1][0][0], Number) def toPolyhedra(polys): if isColorTriangleList(po...
[((2559, 2601), 'sys.stderr.write', 'sys.stderr.write', (["('Saving %s\\n' % filename)"], {}), "('Saving %s\\n' % filename)\n", (2575, 2601), False, 'import sys\n'), ((2836, 2881), 'sys.stdout.write', 'sys.stdout.write', (["('\\n' + moduleName + '();\\n')"], {}), "('\\n' + moduleName + '();\\n')\n", (2852, 2881), False...
arywatt/FDS_2020_2021
Assignment1/Identification/match_module.py
392f360b219c6ef5e2c685da1f3c8aab7415ce32
import numpy as np from PIL import Image import matplotlib.pyplot as plt import histogram_module import dist_module def rgb2gray(rgb): r, g, b = rgb[:, :, 0], rgb[:, :, 1], rgb[:, :, 2] gray = 0.2989 * r + 0.5870 * g + 0.1140 * b return gray # model_images - list of file names of model images # query_...
[((866, 911), 'histogram_module.is_grayvalue_hist', 'histogram_module.is_grayvalue_hist', (['hist_type'], {}), '(hist_type)\n', (900, 911), False, 'import histogram_module\n'), ((1708, 1728), 'numpy.array', 'np.array', (['best_match'], {}), '(best_match)\n', (1716, 1728), True, 'import numpy as np\n'), ((2953, 2965), '...
rojalator/dycco
dycco/__main__.py
84ace8727aef84bb3d886cdaa3d3aef1089f1935
import argparse import logging import sys from .dycco import document def main(paths, output_dir, use_ascii:bool, escape_html:bool, single_file:bool): try: document(paths, output_dir, use_ascii, escape_html, single_file) except IOError as e: logging.error('Unable to open file: %s', e) ...
[((497, 594), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'prog': '"""dycco"""', 'description': '"""Literate-style documentation generator."""'}), "(prog='dycco', description=\n 'Literate-style documentation generator.')\n", (520, 594), False, 'import argparse\n'), ((269, 312), 'logging.error', 'logg...
rghwer/testdocs
jumpy/jumpy/ndarray.py
8fafa40407411ed7a3f8216e691e42e0c7d32083
################################################################################ # Copyright (c) 2015-2018 Skymind, Inc. # # This program and the accompanying materials are made available under the # terms of the Apache License, Version 2.0 which is available at # https://www.apache.org/licenses/LICENSE-2.0. # # Unless...
[((4456, 4486), 'ctypes.POINTER', 'ctypes.POINTER', (['mapping[dtype]'], {}), '(mapping[dtype])\n', (4470, 4486), False, 'import ctypes\n'), ((4501, 4530), 'ctypes.cast', 'ctypes.cast', (['address', 'Pointer'], {}), '(address, Pointer)\n', (4512, 4530), False, 'import ctypes\n'), ((2678, 2771), 'warnings.warn', 'warnin...
hanayik/StimSync
Python/usec_mode.py
f08ec01a36c47b00bfe4937b5a6eb2a60af0713d
import serial ser = serial.Serial('/dev/tty.usbmodem7071', 115200, timeout=10) ser.write("\xb1\xa3\xb5\xb5") #set usec mode 177,163,181,181 ser.flush() ser.flushInput() obs = ser.read(8) if len(obs) != 8: print('Error: no buttons presses detected') print 'Observed data (as hex): '+ obs.encode('hex') obsBin = [ord(...
[]
hahaxun/audio
torchaudio/datasets/libritts.py
87a1886ecfa83b398a2a9a09d9a94bd9dabc5cf5
import os from typing import Tuple import torchaudio from torch import Tensor from torch.utils.data import Dataset from torchaudio.datasets.utils import ( download_url, extract_archive, walk_files, ) URL = "train-clean-100" FOLDER_IN_ARCHIVE = "LibriTTS" _CHECKSUMS = { "http://www.openslr.org/60/dev-c...
[((1270, 1329), 'os.path.join', 'os.path.join', (['path', 'speaker_id', 'chapter_id', 'normalized_text'], {}), '(path, speaker_id, chapter_id, normalized_text)\n', (1282, 1329), False, 'import os\n'), ((1403, 1460), 'os.path.join', 'os.path.join', (['path', 'speaker_id', 'chapter_id', 'original_text'], {}), '(path, spe...
silence0201/Learn-Python
Others/Source/19/19.2/barh_test.py
662da7c0e74221cedb445ba17d5cb1cd3af41c86
# coding: utf-8 ######################################################################### # 网站: <a href="http://www.crazyit.org">疯狂Java联盟</a> # # author yeeku.H.lee kongyeeku@163.com # # # # version...
[((2049, 2078), 'matplotlib.pyplot.title', 'plt.title', (['"""Java与Android图书对比"""'], {}), "('Java与Android图书对比')\n", (2058, 2078), True, 'import matplotlib.pyplot as plt\n'), ((2094, 2110), 'matplotlib.pyplot.xlabel', 'plt.xlabel', (['"""销量"""'], {}), "('销量')\n", (2104, 2110), True, 'import matplotlib.pyplot as plt\n'),...
kendny/study_docker
03_docker_compose/03_c_simple_case_with_mongodb_orm/app/app.py
edb376fb69319a78e05f60faa5dcc88d527602c4
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Dec 18 20:13:57 2018 @author: allen """ import random, os, json, datetime, time from flask import Flask, Response from pymongo import MongoClient from bson import json_util app = Flask(__name__) MONGO_URI = "mongodb://mongodb:27017" # "mongodb:<con...
[((249, 264), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (254, 264), False, 'from flask import Flask, Response\n'), ((355, 377), 'pymongo.MongoClient', 'MongoClient', (['MONGO_URI'], {}), '(MONGO_URI)\n', (366, 377), False, 'from pymongo import MongoClient\n'), ((430, 443), 'time.sleep', 'time.sleep', ...
HPI-DeepLearning/wort2vek
goethe/eval/analogy_space.py
bc91c2752a8516665d270c7a7a793ec484c970c4
#! /usr/bin/Python from gensim.models.keyedvectors import KeyedVectors from scipy import spatial from numpy import linalg import argparse import sys vector_file = sys.argv[1] if len(sys.argv) != 6: print('arguments wrong!') print(len(sys.argv)) exit() else: words = [sys.argv[2], sys.argv[3], sys.arg...
[((366, 425), 'gensim.models.keyedvectors.KeyedVectors.load_word2vec_format', 'KeyedVectors.load_word2vec_format', (['vector_file'], {'binary': '(True)'}), '(vector_file, binary=True)\n', (399, 425), False, 'from gensim.models.keyedvectors import KeyedVectors\n'), ((709, 724), 'numpy.linalg.norm', 'linalg.norm', (['w1'...
vishalbelsare/LocalGraphClustering
localgraphclustering/algorithms/eig2_nL.py
a6325350997932d548a876deb259c2387fc2c809
import numpy as np import scipy as sp import scipy.sparse.linalg as splinalg def eig2_nL(g, tol_eigs = 1.0e-6, normalize:bool = True, dim:int=1): """ DESCRIPTION ----------- Computes the eigenvector that corresponds to the second smallest eigenvalue of the normalized Laplacian matrix ...
[((1613, 1667), 'scipy.sparse.linalg.eigsh', 'splinalg.eigsh', (['L'], {'which': '"""SM"""', 'k': '(1 + dim)', 'tol': 'tol_eigs'}), "(L, which='SM', k=1 + dim, tol=tol_eigs)\n", (1627, 1667), True, 'import scipy.sparse.linalg as splinalg\n'), ((1677, 1694), 'numpy.real', 'np.real', (['p[:, 1:]'], {}), '(p[:, 1:])\n', (...
isabella232/nanos-nonsecure-firmware
build/common/hex2carray.py
d1ce2e0e01a8ed6d8840a24308e16f6560a626aa
""" ******************************************************************************* * Ledger Blue * (c) 2016 Ledger * * 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....
[]
xames3/vdoxa
setup.py
8fa945449bb34447ded0c421214c0252ff523d4a
# Copyright 2020 XAMES3. 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 agree...
[((2309, 2324), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (2322, 2324), False, 'from setuptools import find_packages, setup\n')]
BaggerFast/Simple_votings
application/modules/login.py
843769fa6fd2c04feb542e6b301b7b4810260d4e
from django.contrib import messages from django.contrib.auth import login, authenticate from django.shortcuts import render, redirect from django.urls import reverse from django.views import View from application.forms import AuthenticateForm from application.views import get_navbar, Page class LoginView(View): ...
[((473, 492), 'application.views.get_navbar', 'get_navbar', (['request'], {}), '(request)\n', (483, 492), False, 'from application.views import get_navbar, Page\n'), ((524, 542), 'application.forms.AuthenticateForm', 'AuthenticateForm', ([], {}), '()\n', (540, 542), False, 'from application.forms import AuthenticateFor...
HelloChatterbox/little_questions
little_questions/utils/log.py
04bee86244b42fdaed9f8d010c2f83037ad753f6
# Copyright 2017 Mycroft AI 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 writin...
[((1186, 1217), 'logging.Formatter', 'logging.Formatter', (['fmt', 'datefmt'], {}), '(fmt, datefmt)\n', (1203, 1217), False, 'import logging\n'), ((1587, 1610), 'logging.getLogger', 'logging.getLogger', (['name'], {}), '(name)\n', (1604, 1610), False, 'import logging\n'), ((1669, 1702), 'logging.StreamHandler', 'loggin...
antopen/alipay-sdk-python-all
alipay/aop/api/response/AlipayOpenMiniVersionAuditApplyResponse.py
8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.response.AlipayResponse import AlipayResponse class AlipayOpenMiniVersionAuditApplyResponse(AlipayResponse): def __init__(self): super(AlipayOpenMiniVersionAuditApplyResponse, self).__init__() self._speed_up = None ...
[]
haruiz/PytorchCvStudio
cvstudio/view/widgets/loading_dialog/loading_dialog.py
ccf79dd0cc0d61f3fd01b1b5d96f7cda7b681eef
import os from PyQt5 import QtCore from PyQt5.QtCore import QRect, QPoint from PyQt5.QtGui import QMovie, QCloseEvent, QShowEvent from PyQt5.QtWidgets import QDialog, QLabel, QVBoxLayout, QApplication, QWidget class QLoadingDialog(QDialog): def __init__(self, parent=None): super(QLoadingDialog, self).__i...
[((536, 559), 'PyQt5.QtWidgets.QApplication.instance', 'QApplication.instance', ([], {}), '()\n', (557, 559), False, 'from PyQt5.QtWidgets import QDialog, QLabel, QVBoxLayout, QApplication, QWidget\n'), ((760, 776), 'PyQt5.QtGui.QMovie', 'QMovie', (['gif_file'], {}), '(gif_file)\n', (766, 776), False, 'from PyQt5.QtGui...
agustinhenze/mibs.snmplabs.com
pysnmp-with-texts/MWORKS-MIB.py
1fc5c07860542b89212f4c8ab807057d9a9206c7
# # PySNMP MIB module MWORKS-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/MWORKS-MIB # Produced by pysmi-0.3.4 at Wed May 1 14:16:04 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:...
[]
mpire-nxus/nxus_unity_sdk
Assets/Editor/PostprocessBuildPlayer_MpireNxusMeasurementPostBuildiOS.py
34a1ebfc588c47c1c71fae11f29e82c1172c6dc2
#!/usr/bin/env python import sys import re from subprocess import Popen, PIPE import argparse from pbxproj import XcodeProject, TreeType from pbxproj import FileOptions def main(): parser = argparse.ArgumentParser(description="MpireNxusMeasurement post build iOS script") parser.add_argument('ios_project_path...
[((197, 283), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""MpireNxusMeasurement post build iOS script"""'}), "(description=\n 'MpireNxusMeasurement post build iOS script')\n", (220, 283), False, 'import argparse\n'), ((1328, 1339), 'sys.exit', 'sys.exit', (['(0)'], {}), '(0)\n', (13...
klyusba/python-quiz
vars_in_python.py
9f469417458f8ba6b21f9507cc860ca4547ea67b
# == 1 == bar = [1, 2] def foo(bar): bar = sum(bar) return bar print(foo(bar)) # == 2 == bar = [1, 2] def foo(bar): bar[0] = 1 return sum(bar) print(foo(bar)) # == 3 == bar = [1, 2] def foo(): bar = sum(bar) return bar print(foo()) # == 4 == bar = [1, 2] def foo(bar): bar =...
[]
sm43/pipelines-as-code
hack/dev/gh-replay-events.py
bd21e48c96ab128d533701ecd1a2df7a0d136d65
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Author: Chmouel Boudjnah <chmouel@chmouel.com> # # 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...
[((1099, 1251), 'subprocess.run', 'subprocess.run', (['f"""kubectl get route -n {NAMESPACE} -l pipelines-as-code/route=controller -o json"""'], {'shell': '(True)', 'check': '(True)', 'capture_output': '(True)'}), "(\n f'kubectl get route -n {NAMESPACE} -l pipelines-as-code/route=controller -o json'\n , shell=True...
Pooroomoo/nintendeals
nintendeals/noa/api/__init__.py
993f4d159ff405ed82cd2bb023c7b75d921d0acb
from .algolia import search_by_nsuid from .algolia import search_by_platform from .algolia import search_by_query
[]
joshlyman/Josh-LeetCode
076_Minimum_Window_Substring.py
cc9e2cc406d2cbd5a90ee579efbcaeffb842c5ed
# Other solution # V2 def minWindow(s, t): need = collections.Counter(t) #hash table to store char frequency missing = len(t) #total number of chars we care start, end = 0, 0 i = 0 for j, char in enumerate(s, 1): #index j from 1 if need[char] > 0...
[]
Taywee/amberherbert.com
home/migrations/0002_auto_20171017_0412.py
6bf384d7cdf18dc613252fe4dde38545150eabbc
# -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2017-10-17 04:12 from __future__ import unicode_literals from django.db import migrations import wagtail.core.blocks import wagtail.core.fields class Migration(migrations.Migration): dependencies = [ ('home', '0001_initial'), ] operations ...
[]
chawins/entangle-rep
lib/adv_model.py
3e9e0d6e7536b0de0e35d7f8717f2ccc8e887759
import torch import torch.nn as nn import torch.nn.functional as F class PGDModel(nn.Module): """ code adapted from https://github.com/karandwivedi42/adversarial/blob/master/main.py """ def __init__(self, basic_net, config): super(PGDModel, self).__init__() self.basic_net = basic_...
[((1317, 1337), 'torch.clamp', 'torch.clamp', (['x', '(0)', '(1)'], {}), '(x, 0, 1)\n', (1328, 1337), False, 'import torch\n'), ((911, 930), 'torch.enable_grad', 'torch.enable_grad', ([], {}), '()\n', (928, 930), False, 'import torch\n'), ((998, 1047), 'torch.nn.functional.cross_entropy', 'F.cross_entropy', (['logits',...
singhaditya28/fs_image
fs_image/rpm/storage/tests/storage_base_test.py
3d122da48eab8b26e5add6754cc1f91296139c58
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import unittest from unittest.mock import patch, MagicMock from typing import List, Tuple from .. import Storage # M...
[((2393, 2404), 'unittest.mock.MagicMock', 'MagicMock', ([], {}), '()\n', (2402, 2404), False, 'from unittest.mock import patch, MagicMock\n'), ((2418, 2462), 'unittest.mock.patch.object', 'patch.object', (['storage', '"""remove"""', 'mock_remove'], {}), "(storage, 'remove', mock_remove)\n", (2430, 2462), False, 'from ...
sisisin/pulumi-gcp
sdk/python/pulumi_gcp/kms/get_kms_crypto_key_version.py
af6681d70ea457843409110c1324817fe55f68ad
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. import...
[((2465, 2496), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""cryptoKey"""'}), "(name='cryptoKey')\n", (2478, 2496), False, 'import pulumi\n'), ((3044, 3081), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""protectionLevel"""'}), "(name='protectionLevel')\n", (3057, 3081), False, 'import pulumi\n'), ((3448, 3...
nd-cse-30872-fa20/cse-30872-fa20-examples
lecture11/subsets.py
7a991a0499e03bf91ac8ba40c99245d5d926e20c
#!/usr/bin/env python3 import itertools # Constants NUMBERS = range(0, 10) # Main Execution def main(): count = 0 for length in range(0, len(NUMBERS) + 1): for subset in itertools.combinations(NUMBERS, length): if sum(subset) % 3 == 0: count += 1 print(count) if __...
[((191, 230), 'itertools.combinations', 'itertools.combinations', (['NUMBERS', 'length'], {}), '(NUMBERS, length)\n', (213, 230), False, 'import itertools\n')]
Hexotical/toil
src/toil/batchSystems/abstractBatchSystem.py
312b6e1f221ee7f7f187dd6dbfce1aecffd00e09
# Copyright (C) 2015-2021 Regents of the University of 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 app...
[((1380, 1407), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1397, 1407), False, 'import logging\n'), ((9091, 9112), 'typing.TypeVar', 'TypeVar', (['"""OptionType"""'], {}), "('OptionType')\n", (9098, 9112), False, 'from typing import Any, Callable, ContextManager, Dict, Iterator, List...
Heartfilia/lite_tools
demo/other_demo.py
b3432ba7cb60502ac64d45e23022e20555fb1588
# -*- coding: utf-8 -*- from lite_tools import get_md5, get_sha, get_sha3, get_b64e, get_b64d # about hashlib ==> get_md5, get_sha, get_sha3 || default mode=256 s = "test_information" # 这里只能丢字符串 print(get_md5(s)) # 5414ffd88fcb58417e64ecec51bb3a6b print(get_md5(s, upper=True)) # 5414FFD88FCB5841...
[((1394, 1405), 'lite_tools.get_b64e', 'get_b64e', (['s'], {}), '(s)\n', (1402, 1405), False, 'from lite_tools import get_md5, get_sha, get_sha3, get_b64e, get_b64d\n'), ((1493, 1517), 'lite_tools.get_b64e', 'get_b64e', (['s'], {'to_bin': '(True)'}), '(s, to_bin=True)\n', (1501, 1517), False, 'from lite_tools import ge...
terrywqf/PreREISE
prereise/gather/solardata/tests/__init__.py
f8052dd37091eaa15024725d5c92a3ef0ee311ee
__all__ = ["mock_pv_info", "test_pv_tracking"]
[]
farr/arfit
arfit/cp_utils.py
7ff6def331ef98f43f623da2d9867d1ac967448b
import carmcmc as cm from gatspy.periodic import LombScargleFast import matplotlib.pyplot as plt import numpy as np def csample_from_files(datafile, chainfile, p, q): data = np.loadtxt(datafile) times, tind = np.unique(data[:,0], return_index=True) data = data[tind, :] chain = np.loadtxt(chainfil...
[((179, 199), 'numpy.loadtxt', 'np.loadtxt', (['datafile'], {}), '(datafile)\n', (189, 199), True, 'import numpy as np\n'), ((219, 261), 'numpy.unique', 'np.unique', (['data[:, (0)]'], {'return_index': '(True)'}), '(data[:, (0)], return_index=True)\n', (228, 261), True, 'import numpy as np\n'), ((301, 322), 'numpy.load...
xolox/python-pdiffcopy
pdiffcopy/hashing.py
ed765af92c0c0823818d545e61384753912a5725
# Fast large file synchronization inspired by rsync. # # Author: Peter Odding <peter@peterodding.com> # Last Change: March 6, 2020 # URL: https://pdiffcopy.readthedocs.io """Parallel hashing of files using :mod:`multiprocessing` and :mod:`pdiffcopy.mp`.""" # Standard library modules. import functools import hashlib i...
[((1208, 1227), 'hashlib.new', 'hashlib.new', (['method'], {}), '(method)\n', (1219, 1227), False, 'import hashlib\n'), ((835, 926), 'functools.partial', 'functools.partial', (['hash_worker'], {'block_size': 'block_size', 'filename': 'filename', 'method': 'method'}), '(hash_worker, block_size=block_size, filename=filen...
robert-anderson/pyscf
pyscf/nao/test/test_0003_na2_nao.py
cdc56e168cb15f47e8cdc791a92d689fa9b655af
# Copyright 2014-2018 The PySCF Developers. 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 appl...
[((2154, 2169), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2167, 2169), False, 'import unittest\n'), ((1995, 2010), 'pyscf.nao.mf', 'mf', ([], {'label': 'label'}), '(label=label)\n', (1997, 2010), False, 'from pyscf.nao import mf\n'), ((1739, 1770), 'os.symlink', 'os.symlink', (['pppath', "(sp + '.psf')"], {}...
mozkzki/moz-library
tests/moz_library/rental_books_test.py
fb925414405a9fcba8bb7194cf983ba18c920e2f
import pytest from moz_library.rental_books import RentalBooks class TestRentalBooks: @pytest.fixture() def books1(self): return RentalBooks() def test_can_extend_period_1(self, books1): assert books1._can_extend_period("延長できません") is False def test_can_extend_period_2(self, books1): ...
[((93, 109), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (107, 109), False, 'import pytest\n'), ((147, 160), 'moz_library.rental_books.RentalBooks', 'RentalBooks', ([], {}), '()\n', (158, 160), False, 'from moz_library.rental_books import RentalBooks\n')]
aspose-slides/Aspose.Slides-for-Python-via-.NET
examples/src/Charts/MultiCategoryChart.py
c55ad5c71f942598f1e67e22a52cbcd1cb286467
import aspose.pydrawing as drawing import aspose.slides as slides def charts_multi_category_chart(): #ExStart:MultiCategoryChart # The path to the documents directory. outDir = "./examples/out/" with slides.Presentation() as pres: slide = pres.slides[0] ch = pres.slides[0].shapes.add...
[]
cybarox/netbox
netbox/extras/forms/filtersets.py
ea197eff5f4fe925bb354d1375912decd81752bd
from django import forms from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType from django.utils.translation import gettext as _ from dcim.models import DeviceRole, DeviceType, Platform, Region, Site, SiteGroup from extras.choices import * from extras.models import * fr...
[((1571, 1605), 'django.forms.IntegerField', 'forms.IntegerField', ([], {'required': '(False)'}), '(required=False)\n', (1589, 1605), False, 'from django import forms\n'), ((2437, 2471), 'django.forms.IntegerField', 'forms.IntegerField', ([], {'required': '(False)'}), '(required=False)\n', (2455, 2471), False, 'from dj...
docdiesel/smartmetertools
bin/write2cly.py
3b7449c7a9069696af078631aa5440f53d0f57bc
#!/usr/bin/python3 ## write2cly.py - reads json (generated by sml_reader.py) from stdin ## - writes values to Corlysis time series InfluxDB ## ## Writes data from smart meter to time series database (InfluxDB) ## at Corlysis.com [1]. You need to configure your database and token ## in the config secti...
[((1079, 1099), 'json.load', 'json.load', (['sys.stdin'], {}), '(sys.stdin)\n', (1088, 1099), False, 'import json, sys, requests\n'), ((1675, 1736), 'requests.post', 'requests.post', (['cly_base_url'], {'params': 'cly_parameters', 'data': 'line'}), '(cly_base_url, params=cly_parameters, data=line)\n', (1688, 1736), Fal...
Ashiq5/dnspython
dns/rdtypes/ANY/__init__.py
5449af5318d88bada34f661247f3bcb16f58f057
# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license # Copyright (C) 2003-2007, 2009-2011 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and ...
[]
KhubbatulinMark/DCase2020-Task-2-on-Wigner-Ville-transform
01_test.py
6653d7abbaafe09fb17768d9902bb77db24945d4
""" @file 01_test.py @brief Script for test @author Toshiki Nakamura, Yuki Nikaido, and Yohei Kawaguchi (Hitachi Ltd.) Copyright (C) 2020 Hitachi, Ltd. All right reserved. """ ######################################################################## # import default python-library ###############################...
[((1072, 1087), 'common.yaml_load', 'com.yaml_load', ([], {}), '()\n', (1085, 1087), True, 'import common as com\n'), ((6116, 6138), 'common.command_line_chk', 'com.command_line_chk', ([], {}), '()\n', (6136, 6138), True, 'import common as com\n'), ((6221, 6274), 'os.makedirs', 'os.makedirs', (["param['result_directory...
i1123581321/word_split
src/text_split/split.py
6401cdc37f58aa8718793dd7cb9bf4d3a4b690a4
import argparse import os parser = argparse.ArgumentParser(description="a simple parser") parser.add_argument("filename", type=str) parser.add_argument("lineno", nargs="+", type=int) parser.add_argument("--same_length", action=argparse.BooleanOptionalAction) def main(): args = parser.parse_args() filename =...
[((36, 90), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""a simple parser"""'}), "(description='a simple parser')\n", (59, 90), False, 'import argparse\n'), ((1064, 1090), 'os.path.splitext', 'os.path.splitext', (['filename'], {}), '(filename)\n', (1080, 1090), False, 'import os\n')]
Ali-Tahir/sentry
src/sentry/models/event.py
aa7b306c5ea671ac002a3524982563679557cb31
from __future__ import absolute_import import six import string import warnings import pytz from collections import OrderedDict from dateutil.parser import parse as parse_date from django.db import models from django.utils import timezone from django.utils.translation import ugettext_lazy as _ from hashlib import md5...
[((13843, 13853), 'django.utils.translation.ugettext_lazy', '_', (['"""error"""'], {}), "('error')\n", (13844, 13853), True, 'from django.utils.translation import ugettext_lazy as _\n'), ((15169, 15204), 'sentry.db.models.sane_repr', 'sane_repr', (['"""project_id"""', '"""group_id"""'], {}), "('project_id', 'group_id')...
shikashyam/BigDataSystemsCoursework
Assignment3/src/data/make_nowcast_dataset.py
d7f9cabbfb18b0e3303292b65af1ffd530e24ccc
""" Makes training and test dataset for nowcasting model using SEVIR """ # -*- coding: utf-8 -*- import argparse import logging import os import h5py os.environ["HDF5_USE_FILE_LOCKING"]='FALSE' import sys import numpy as np import tensorflow as tf from nowcast_generator import get_nowcast_test_generator # parser = ...
[((1076, 1103), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1093, 1103), False, 'import logging\n'), ((1293, 1350), 'nowcast_generator.get_nowcast_test_generator', 'get_nowcast_test_generator', (['sevir_catalog', 'sevir_location'], {}), '(sevir_catalog, sevir_location)\n', (1319, 1350...
rtasan/ApexCastImporter
blender-plugin/import_cast.py
17f833ab8ff9757e295ca8eadb0cb210bfdd6476
# The Original importer was created by Nick # Copyright (c) 2020 Nick import bpy import bmesh import os import array import math from mathutils import * from bpy_extras.image_utils import load_image from .cast import Cast, Model, Animation, Curve, NotificationTrack, Mesh, Skeleton, Bone, Material, File def utilityB...
[((350, 370), 'os.path.isabs', 'os.path.isabs', (['asset'], {}), '(asset)\n', (363, 370), False, 'import os\n'), ((405, 426), 'os.path.dirname', 'os.path.dirname', (['root'], {}), '(root)\n', (420, 426), False, 'import os\n'), ((438, 463), 'os.path.join', 'os.path.join', (['root', 'asset'], {}), '(root, asset)\n', (450...
dekuNukem/USB4VC
user_program/usb4vc_ui.py
66c4f0b4a4acd7cec6654ea0dd4da026edf5d24c
# https://luma-oled.readthedocs.io/en/latest/software.html import os import sys import time import threading import usb4vc_oled from luma.core.render import canvas import RPi.GPIO as GPIO import usb4vc_usb_scan import usb4vc_shared import usb4vc_show_ev import usb4vc_check_update import json import subprocess from sub...
[((667, 711), 'os.path.join', 'os.path.join', (['config_dir_path', '"""config.json"""'], {}), "(config_dir_path, 'config.json')\n", (679, 711), False, 'import os\n'), ((713, 742), 'usb4vc_shared.ensure_dir', 'ensure_dir', (['this_app_dir_path'], {}), '(this_app_dir_path)\n', (723, 742), False, 'from usb4vc_shared impor...
hpathipati/Quick-Tutor
study/migrations/0003_auto_20200224_2316.py
17476d79b87f51b12a6c8fc435d1a6506bff1e04
# Generated by Django 3.0.2 on 2020-02-24 23:16 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('study', '0002_student'), ] operations = [ migrations.AlterField( model_name='student', name='bio', field...
[((321, 365), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'max_length': '(200)'}), '(blank=True, max_length=200)\n', (337, 365), False, 'from django.db import migrations, models\n')]
gzecchi/oneview-python
tests/unit/resources/test_resource.py
949bc67ca3eaed324a6dc058620145d9e067e25b
# -*- coding: utf-8 -*- ### # (C) Copyright [2019] Hewlett Packard Enterprise Development LP # # 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 #...
[((3182, 3252), 'mock.patch.object', 'mock.patch.object', (['connection', '"""post_multipart_with_response_handling"""'], {}), "(connection, 'post_multipart_with_response_handling')\n", (3199, 3252), False, 'import mock\n'), ((3635, 3705), 'mock.patch.object', 'mock.patch.object', (['connection', '"""post_multipart_wit...
vanadium23/workalendar
workalendar/usa/colorado.py
4c67b5a7900fa56d7a93b767c6cbd8f1cc6b70a7
# -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function, unicode_literals) from .core import UnitedStates class Colorado(UnitedStates): """Colorado""" # Colorado has only federal state holidays. # NOTE: Cesar Chavez Day is an optional holiday
[]
thierrypin/gei-pool
dataloaders/augmentation.py
0a9e79b01148735f0e975c50d2476e41ba20af4f
#!/usr/bin/env python # -*- coding: utf-8 -*- import random import numpy as np # Generic data augmentation class Augmenter: """ Generic data augmentation class with chained operations """ def __init__(self, ops=[]): if not isinstance(ops, list): print("Error: ops must be a list of fu...
[((712, 727), 'random.random', 'random.random', ([], {}), '()\n', (725, 727), False, 'import random\n'), ((873, 888), 'random.random', 'random.random', ([], {}), '()\n', (886, 888), False, 'import random\n'), ((1058, 1073), 'random.random', 'random.random', ([], {}), '()\n', (1071, 1073), False, 'import random\n'), ((1...
CzechInvest/ciis
cigeo/admin.py
c6102598f564a717472e5e31e7eb894bba2c8104
from django.contrib import admin from django.contrib.gis import geos from leaflet.admin import LeafletGeoAdmin, LeafletGeoAdminMixin from .models import Lau1 from .models import Nuts3 from .models import Airport from .models import Road from .models import PublicTransportStop from .models import RailwayStation from dja...
[((6949, 6985), 'django.contrib.admin.site.register', 'admin.site.register', (['Lau1', 'LAU1Admin'], {}), '(Lau1, LAU1Admin)\n', (6968, 6985), False, 'from django.contrib import admin\n'), ((6986, 7024), 'django.contrib.admin.site.register', 'admin.site.register', (['Nuts3', 'NUTS3Admin'], {}), '(Nuts3, NUTS3Admin)\n',...
RafaelAPB/umbra
umbra/monitor/main.py
cf075bbe73e46540e9edee25f9ec3d0828620d5f
import logging import json import asyncio from google.protobuf import json_format from umbra.common.protobuf.umbra_grpc import MonitorBase from umbra.common.protobuf.umbra_pb2 import Instruction, Snapshot from umbra.monitor.tools import Tools logger = logging.getLogger(__name__) logging.getLogger("hpack").setLevel(...
[((256, 283), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (273, 283), False, 'import logging\n'), ((284, 310), 'logging.getLogger', 'logging.getLogger', (['"""hpack"""'], {}), "('hpack')\n", (301, 310), False, 'import logging\n'), ((418, 425), 'umbra.monitor.tools.Tools', 'Tools', ([],...
dwagon/pycs
pycs/spells/hunters_mark.py
4d02acbf380526d3bf0380f6bb8b757a827024b8
"""https://www.dndbeyond.com/spells/hunters-mark""" from unittest.mock import patch import dice from pycs.constant import ActionCategory from pycs.constant import SpellType from pycs.creature import Creature from pycs.effect import Effect from pycs.gear import Shortbow from pycs.spell import SpellAction from pycs.spel...
[((5288, 5298), 'pycs.gear.Shortbow', 'Shortbow', ([], {}), '()\n', (5296, 5298), False, 'from pycs.gear import Shortbow\n'), ((5375, 5408), 'unittest.mock.patch.object', 'patch.object', (['Creature', '"""rolld20"""'], {}), "(Creature, 'rolld20')\n", (5387, 5408), False, 'from unittest.mock import patch\n'), ((5470, 54...
armandok/pySLAM-D
utilities.py
ef7398806e021885b29702adf55acbedaf544ce6
import numpy as np def rot_to_angle(rot): return np.arccos(0.5*np.trace(rot)-0.5) def rot_to_heading(rot): # This function calculates the heading angle of the rot matrix w.r.t. the y-axis new_rot = rot[0:3:2, 0:3:2] # remove the mid row and column corresponding to the y-axis new_rot = new_rot/np.li...
[((349, 389), 'numpy.arctan2', 'np.arctan2', (['new_rot[1, 0]', 'new_rot[0, 0]'], {}), '(new_rot[1, 0], new_rot[0, 0])\n', (359, 389), True, 'import numpy as np\n'), ((315, 337), 'numpy.linalg.det', 'np.linalg.det', (['new_rot'], {}), '(new_rot)\n', (328, 337), True, 'import numpy as np\n'), ((69, 82), 'numpy.trace', '...
kyungjaelee/robosuite
robosuite/models/grippers/__init__.py
0d73fcca9ed8e638632f4bd7b0f1b8ebf4640fb1
from .gripper_model import GripperModel from .gripper_factory import gripper_factory from .gripper_tester import GripperTester from .panda_gripper import PandaGripper from .rethink_gripper import RethinkGripper from .robotiq_85_gripper import Robotiq85Gripper from .robotiq_three_finger_gripper import RobotiqThreeFinge...
[]
Idein/chainer-hand-pose
src/pose/visualizations/visualizations.py
45c7b629a74bf13da8cc9b47d0ded7099c139e9b
import logging logger = logging.getLogger(__name__) import random import chainercv import numpy as np from matplotlib import pyplot as plt from mpl_toolkits.mplot3d import Axes3D # NOQA from pose.hand_dataset.geometry_utils import normalize_joint_zyx from pose.hand_dataset.image_utils import normalize_depth # Dec...
[((25, 52), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (42, 52), False, 'import logging\n'), ((946, 963), 'numpy.asarray', 'np.asarray', (['point'], {}), '(point)\n', (956, 963), True, 'import numpy as np\n'), ((3562, 3588), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '...
ticapix/automated-tasks
publication-erdf/flask_service.py
a0c73ad2939c6f1a2d91aea6fd309b5005455191
#!/usr/bin/env python3 from flask import Flask app = Flask(__name__) @app.route('/process-email') def process_email(): return "Hello World!" if __name__ == "__main__": app.run()
[((54, 69), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (59, 69), False, 'from flask import Flask\n')]
mikiec84/speaking_detection
tools/nn/speaker.py
ed680138627c156e1f7b0af20d6517e2bea754cc
import os import skimage.io from torch.nn import Module import torch.nn from torchvision.models import resnet18 from nn.speaker_dataset import Dataset # @UnusedImport os.environ['TORCH_MODEL_ZOO'] = '../data/' VIDTIMIT_PATH = '../data/vidtimit/' skimage.io.use_plugin('pil') class Net(Module): def __init__(s...
[((371, 396), 'torchvision.models.resnet18', 'resnet18', ([], {'pretrained': '(True)'}), '(pretrained=True)\n', (379, 396), False, 'from torchvision.models import resnet18\n')]
mdreves/model-analysis
tensorflow_model_analysis/util_test.py
73760b27b763e322a92ea80ff0a768ad9ef74526
# Copyright 2018 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
[((1536, 1550), 'tensorflow.test.main', 'tf.test.main', ([], {}), '()\n', (1548, 1550), True, 'import tensorflow as tf\n')]
eivtho/PyLaia
laia/data/transforms/vision/random_beta_morphology.py
2a7a6e2eeb9b5af68c0faed0c564b02063e72be0
from typing import List, Tuple, Union import numpy as np import scipy.special from PIL import Image, ImageFilter class RandomBetaMorphology: def __init__( self, filter_size_min: int, filter_size_max: int, alpha: float, beta: float ) -> None: assert filter_size_min % 2 != 0, "Filter size must ...
[((2926, 2951), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (2949, 2951), False, 'import argparse\n'), ((1328, 1370), 'numpy.asarray', 'np.asarray', (['filter_probs'], {'dtype': 'np.float32'}), '(filter_probs, dtype=np.float32)\n', (1338, 1370), True, 'import numpy as np\n'), ((1536, 1592), ...
Addvilz/hemp
hemp/internal/utils.py
2cd1d437fc59a8f7b24f5d150c623bf75c3b6747
import sys from fabric.utils import error, puts from git import RemoteProgress def print_err(message, func=None, exception=None, stdout=None, stderr=None): error('[Hemp] ' + message, func, exception, stdout, stderr) def print_info(text, show_prefix=None, end="\n", flush=True): puts('[Hemp] ' + text, show_p...
[((163, 222), 'fabric.utils.error', 'error', (["('[Hemp] ' + message)", 'func', 'exception', 'stdout', 'stderr'], {}), "('[Hemp] ' + message, func, exception, stdout, stderr)\n", (168, 222), False, 'from fabric.utils import error, puts\n'), ((291, 338), 'fabric.utils.puts', 'puts', (["('[Hemp] ' + text)", 'show_prefix'...
dla1635/hyLink
backend/links/sentence.py
8f3d1b6b0cad57ce2f6861583eb2b523f9fceee7
# -*- coding: utf-8 -*- from collections import Counter from konlpy.tag import Okt class Sentence(object): okt = Okt() def __init__(self, text, index=0): self.index = index self.text = text.strip() self.tokens = self.okt.phrases(self.text) self.bow = Counter(self.tokens) ...
[((121, 126), 'konlpy.tag.Okt', 'Okt', ([], {}), '()\n', (124, 126), False, 'from konlpy.tag import Okt\n'), ((296, 316), 'collections.Counter', 'Counter', (['self.tokens'], {}), '(self.tokens)\n', (303, 316), False, 'from collections import Counter\n')]
IMULMUL/barf-project
tests/arch/x86/test_x86parser.py
9547ef843b8eb021c2c32c140e36173c0b4eafa3
# Copyright (c) 2014, Fundacion Dr. Manuel Sadosky # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright notice, this # list of condit...
[((4171, 4186), 'unittest.main', 'unittest.main', ([], {}), '()\n', (4184, 4186), False, 'import unittest\n'), ((1618, 1645), 'barf.arch.x86.parser.X86Parser', 'X86Parser', (['ARCH_X86_MODE_32'], {}), '(ARCH_X86_MODE_32)\n', (1627, 1645), False, 'from barf.arch.x86.parser import X86Parser\n'), ((3394, 3421), 'barf.arch...
Chyi341152/pyConPaper
Concurrency/codeSample/Part4_Thread_Synchronuzation_Primitives/sema_signal.py
851190d59f8dc85b4f2a0b47c6505edd0367a6fe
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # sema_signal.py # # An example of using a semaphore for signaling between threads import threading import time done = threading.Semaphore(0) # Resource control. item = None def producer(): global item print("I'm the producer and I produce data.") ...
[((168, 190), 'threading.Semaphore', 'threading.Semaphore', (['(0)'], {}), '(0)\n', (187, 190), False, 'import threading\n'), ((793, 826), 'threading.Thread', 'threading.Thread', ([], {'target': 'producer'}), '(target=producer)\n', (809, 826), False, 'import threading\n'), ((832, 865), 'threading.Thread', 'threading.Th...
KarrLab/wc_sim
temp_wc_analysis/analysis.py
5b0ee03c3d19193fa67a3797d4258b753e6bc576
'''Analysis utility functions. :Author: Jonathan Karr <karr@mssm.edu> :Date: 2016-03-26 :Copyright: 2016-2018, Karr Lab :License: MIT ''' # TODO(Arthur): IMPORTANT: refactor and replace from matplotlib import pyplot from matplotlib import ticker from wc_lang import Model, Submodel from scipy.constants import Avogadr...
[((375, 386), 'numpy.zeros', 'np.zeros', (['(0)'], {}), '(0)\n', (383, 386), True, 'import numpy as np\n'), ((424, 435), 'numpy.zeros', 'np.zeros', (['(0)'], {}), '(0)\n', (432, 435), True, 'import numpy as np\n'), ((460, 471), 'numpy.zeros', 'np.zeros', (['(0)'], {}), '(0)\n', (468, 471), True, 'import numpy as np\n')...
bstuddard/bonsai
setup.py
3610fc50a3b24818288d850048c2a23306215367
from setuptools import setup, find_packages with open("README.md", "r") as readme_file: readme = readme_file.read() requirements = [ 'xgboost>=0.90', 'catboost>=0.26', 'bayesian-optimization>=1.2.0', 'numpy>=1.19.5', 'pandas>=1.1.5', 'matplotlib>=3.2.2', 'seaborn>=0.11.1', 'plotly>...
[((627, 642), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (640, 642), False, 'from setuptools import setup, find_packages\n')]
clockhart/pathogen
_scripts/increment_version.py
1764d4a7d2dd7c1f5dcc08afc016ec4edf809c36
""" increment_version.py written in Python3 author: C. Lockhart <chris@lockhartlab.org> """ import yaml # Read in version with open('version.yml', 'r') as f: version = yaml.safe_load(f.read()) # Strip "dev" out of micro version['micro'] = int(str(version['micro']).replace('dev', '')) # Update patch version['mi...
[((495, 538), 'yaml.safe_dump', 'yaml.safe_dump', (['version', 'f'], {'sort_keys': '(False)'}), '(version, f, sort_keys=False)\n', (509, 538), False, 'import yaml\n')]
TheoMathurin/holoviews
holoviews/core/data/ibis.py
0defcef994d6dd6d2054f75a0e332d02d121f8b0
import sys import numpy try: from collections.abc import Iterable except ImportError: from collections import Iterable from .. import util from ..element import Element from ..ndmapping import NdMapping, item_check, sorted_context from .interface import Interface from . import pandas from .util import cached ...
[((3945, 3964), 'numpy.asarray', 'numpy.asarray', (['bins'], {}), '(bins)\n', (3958, 3964), False, 'import numpy\n'), ((4285, 4299), 'numpy.isnan', 'numpy.isnan', (['b'], {}), '(b)\n', (4296, 4299), False, 'import numpy\n'), ((6159, 6182), 'numpy.isscalar', 'numpy.isscalar', (['columns'], {}), '(columns)\n', (6173, 618...
S0Imyr/Projet-4
chess/models/tournament.py
1d93e125bc6e44bc560f3ffc9b11e14e35291c98
# -*- coding: utf-8 -*- """ Handles the tournament logic """ import datetime from chess.utils.utils import get_new_id from chess.models.actors import Player from chess.models.round import Round TOURNAMENT_ID_WIDTH = 8 NB_ROUND = 4 NB_PLAYERS = 8 NB_MATCH = 4 class Tournament: """ The class Tournament is t...
[((513, 575), 'chess.utils.utils.get_new_id', 'get_new_id', (['Tournament.last_tournament_id', 'TOURNAMENT_ID_WIDTH'], {}), '(Tournament.last_tournament_id, TOURNAMENT_ID_WIDTH)\n', (523, 575), False, 'from chess.utils.utils import get_new_id\n'), ((1608, 1666), 'chess.models.round.Round', 'Round', (['num_round', 'self...
astubenazy/vrops-metric-collection
set-config.py
c4e5b8d7058759aa5eded74cc619d1dedcbc821a
# !/usr/bin python """ # # set-config - a small python program to setup the configuration environment for data-collect.py # data-collect.py contain the python program to gather Metrics from vROps # Author Sajal Debnath <sdebnath@vmware.com> # """ # Importing the required modules import json import base64 import os,s...
[((804, 834), 'base64.b64encode', 'base64.b64encode', (['serverpasswd'], {}), '(serverpasswd)\n', (820, 834), False, 'import base64\n'), ((1792, 1895), 'json.dump', 'json.dump', (['final_data', 'outfile'], {'sort_keys': '(True)', 'indent': '(2)', 'separators': "(',', ':')", 'ensure_ascii': '(False)'}), "(final_data, ou...
inmanta/inmanta-core
tests/test_app.py
ae2153d57f124d00ad1b58e6d4bc6818364be4a8
""" Copyright 2018 Inmanta 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 ...
[((4671, 6183), 'pytest.mark.parametrize_any', 'pytest.mark.parametrize_any', (['"""log_level, timed, with_tty, regexes_required_lines, regexes_forbidden_lines"""', "[(3, False, False, ['[a-z.]*[ ]*INFO[\\\\s]+Starting server endpoint',\n '[a-z.]*[ ]*DEBUG[\\\\s]+Starting Server Rest Endpoint'], []), (2, False,\n ...
yosho-18/AtCoder
AtC_Beg_Con_021-030/ABC027/C.py
50f6d5c92a01792552c31ac912ce1cd557b06fb0
n = int(input()) row = 0 for i in range(100): if 2 ** i <= n <= 2 ** (i + 1) - 1: row = i break def seki(k, n): for _ in range(n): k = 4 * k + 2 return k k = 0 if row % 2 != 0: k = 2 cri = seki(k, row // 2) if n < cri: print("Aoki") else: print("Ta...
[]
Desi-Boyz/cod4x-server-B3-configs
extplugins/codvote.py
03a323d7ea293efe1831ed315001391b9aaf532a
# CoDVote plugin for BigBrotherBot(B3) (www.bigbrotherbot.net) # Copyright (C) 2015 ph03n1x # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your optio...
[((5453, 5506), 'threading.Timer', 'threading.Timer', (['(self._votetime - 5)', 'self.voteMessage'], {}), '(self._votetime - 5, self.voteMessage)\n', (5468, 5506), False, 'import b3, threading\n'), ((5657, 5691), 'threading.Timer', 'threading.Timer', (['(10)', 'self.denyVote'], {}), '(10, self.denyVote)\n', (5672, 5691...
bianan/cfl
utils.py
e09043d213c7330d5410e27ba90c943d4323dbe8
# Copyright 2018 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
[((2910, 2971), 'tensorflow.placeholder', 'tf.placeholder', (['v.dtype'], {'shape': 'var_in_shape', 'name': 'var_in_name'}), '(v.dtype, shape=var_in_shape, name=var_in_name)\n', (2924, 2971), True, 'import tensorflow as tf\n'), ((2990, 3015), 'tensorflow.reduce_mean', 'tf.reduce_mean', (['var_in', '(0)'], {}), '(var_in...
mueller/mysql-shell
unittest/scripts/py_devapi/scripts/mysqlx_collection_remove.py
29bafc5692bd536a12c4e41c54cb587375fe52cf
# Assumptions: validate_crud_functions available # Assumes __uripwd is defined as <user>:<pwd>@<host>:<plugin_port> from __future__ import print_function from mysqlsh import mysqlx mySession = mysqlx.get_session(__uripwd) ensure_schema_does_not_exist(mySession, 'js_shell_test') schema = mySession.create_schema('js_s...
[]
aditya270520/indian-flag
indian-flag.py
65851eefdd229cca150d2bbe8fa61c9e06e120e0
import turtle turtle.bgcolor('black') wn=turtle.Screen() tr=turtle.Turtle() move=1 tr.speed("fastest") for i in range (360): tr.write("ADITYA",'false','center',font=('Showcard gothic',50)) tr.penup() tr.goto(-200,100) tr.pendown() tr.color("orange") tr.right(move) tr.forward(100) tr...
[((14, 37), 'turtle.bgcolor', 'turtle.bgcolor', (['"""black"""'], {}), "('black')\n", (28, 37), False, 'import turtle\n'), ((41, 56), 'turtle.Screen', 'turtle.Screen', ([], {}), '()\n', (54, 56), False, 'import turtle\n'), ((60, 75), 'turtle.Turtle', 'turtle.Turtle', ([], {}), '()\n', (73, 75), False, 'import turtle\n'...
guiqiqi/leaf
leaf/rbac/model/__init__.py
79e34f4b8fba8c6fd208b5a3049103dca2064ab5
"""用户, 组, 及相关认证数据库模型""" from .group import Group from .user import User from .user import UserIndex from .auth import Authentication from .accesspoint import AccessPoint
[]
m-brito/Neps-Academy
programacao basica/7.py
0d962fb921d74c5f97f10fcdd8a0f464c0ccdb14
bino = int(input()) cino = int(input()) if (bino+cino)%2==0: print("Bino") else: print("Cino")
[]
CalmScout/LeetCode
update_readme.py
62720934b5906e6b255c7e91d3a6fa1d713e4391
""" Script updates `README.md` with respect to files at ./easy and ./medium folders. """ import os curr_dir = os.path.dirname(__file__) with open(os.path.join(curr_dir, "README.md"), 'w') as readme: readme.write("# LeetCode\nDeliberate practice in coding.\n") langs = [l for l in os.listdir(curr_dir) if os.path...
[((111, 136), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (126, 136), False, 'import os\n'), ((147, 182), 'os.path.join', 'os.path.join', (['curr_dir', '"""README.md"""'], {}), "(curr_dir, 'README.md')\n", (159, 182), False, 'import os\n'), ((289, 309), 'os.listdir', 'os.listdir', (['curr_...
Jay-Iam/retriever
scripts/biotimesql.py
26e321cdb86fcb4cb78184c4bf5c0c6902a97d2c
# -*- coding: utf-8 -*- #retriever import csv from pkg_resources import parse_version from retriever.lib.models import Table from retriever.lib.templates import Script try: from retriever.lib.defaults import VERSION try: from retriever.lib.tools import open_fr, open_fw, open_csvw except ImportEr...
[((520, 551), 'retriever.lib.templates.Script.__init__', 'Script.__init__', (['self'], {}), '(self, **kwargs)\n', (535, 551), False, 'from retriever.lib.templates import Script\n'), ((1688, 1724), 'retriever.lib.templates.Script.download', 'Script.download', (['self', 'engine', 'debug'], {}), '(self, engine, debug)\n',...