repo_name
stringlengths
7
94
repo_path
stringlengths
4
237
repo_head_hexsha
stringlengths
40
40
content
stringlengths
10
680k
apis
stringlengths
2
680k
sweetsbeats/starter-snake-python
brute/brute_build.py
e7cb56a3a623a324f4b5ef956020990e8c61f871
from cffi import FFI ffibuilder = FFI() ffibuilder.cdef(""" int test(int t); """) ffibuilder.set_source("_pi_cffi", """ #include "brute.h" """, sources=['brute.c']) if __name__ == "__main__": ffibuilder.compile(verbose = Tru...
[((35, 40), 'cffi.FFI', 'FFI', ([], {}), '()\n', (38, 40), False, 'from cffi import FFI\n')]
JNotelddim/python-snake
src/board.py
da95339d3a982040a84422e5f7b95453095a4450
"""Board Module""" import copy from typing import Tuple, List from src.coordinate import Coordinate from src.snake import Snake class Board: """Track the cooardinates for all snakes and food in the game.""" def __init__(self, data): self._data = data self._snakes = None self._foods = No...
[((1708, 1727), 'copy.deepcopy', 'copy.deepcopy', (['self'], {}), '(self)\n', (1721, 1727), False, 'import copy\n'), ((493, 510), 'src.snake.Snake', 'Snake', (['snake_data'], {}), '(snake_data)\n', (498, 510), False, 'from src.snake import Snake\n'), ((789, 810), 'src.coordinate.Coordinate', 'Coordinate', (['food_data'...
CLARIN-PL/personalized-nlp
personalized_nlp/datasets/wiki/base.py
340294300f93d12cabc59b055ff2548df8f4081a
import os import zipfile from typing import List import pandas as pd import urllib from personalized_nlp.settings import STORAGE_DIR from personalized_nlp.utils.data_splitting import split_texts from personalized_nlp.datasets.datamodule_base import BaseDataModule class WikiDataModule(BaseDataModule): def __init...
[((834, 890), 'os.makedirs', 'os.makedirs', (["(self.data_dir / 'embeddings')"], {'exist_ok': '(True)'}), "(self.data_dir / 'embeddings', exist_ok=True)\n", (845, 890), False, 'import os\n'), ((1418, 1513), 'pandas.read_csv', 'pd.read_csv', (["(self.data_dir / (self.annotation_column + '_annotated_comments.tsv'))"], {'...
dlanghorne0428/StudioMusicPlayer
App/migrations/0010_remove_user_percentage_preferences_user_preferences.py
54dabab896b96d90b68d6435edfd52fe6a866bc2
# Generated by Django 4.0 on 2022-03-03 02:15 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('App', '0009_alter_song_holiday_alter_songfileinput_holiday'), ] operations = [ migrations.RemoveField( model_name='user', ...
[((257, 329), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""user"""', 'name': '"""percentage_preferences"""'}), "(model_name='user', name='percentage_preferences')\n", (279, 329), False, 'from django.db import migrations, models\n'), ((476, 503), 'django.db.models.JSONField', 'mo...
Rudeus3Greyrat/admin-management
venv/Lib/site-packages/captcha/conf/settings.py
7e81d2b1908afa3ea57a82c542c9aebb1d0ffd23
import os import warnings from django.conf import settings CAPTCHA_FONT_PATH = getattr(settings, 'CAPTCHA_FONT_PATH', os.path.normpath(os.path.join(os.path.dirname(__file__), '..', 'fonts/Vera.ttf'))) CAPTCHA_FONT_SIZE = getattr(settings, 'CAPTCHA_FONT_SIZE', 22) CAPTCHA_LETTER_ROTATION = getattr(settings, 'CAPTCHA_L...
[((2103, 2141), 'warnings.warn', 'warnings.warn', (['msg', 'DeprecationWarning'], {}), '(msg, DeprecationWarning)\n', (2116, 2141), False, 'import warnings\n'), ((2368, 2406), 'warnings.warn', 'warnings.warn', (['msg', 'DeprecationWarning'], {}), '(msg, DeprecationWarning)\n', (2381, 2406), False, 'import warnings\n'),...
joevandyk/pilbox
pilbox/test/app_test.py
b84732a78e5bdb2d24bf7ef4177d45806ac03ea6
from __future__ import absolute_import, division, print_function, \ with_statement import logging import os.path import time import tornado.escape import tornado.gen import tornado.ioloop from tornado.test.util import unittest from tornado.testing import AsyncHTTPTestCase, gen_test import tornado.web from pilbox...
[((799, 839), 'logging.getLogger', 'logging.getLogger', (['"""tornado.application"""'], {}), "('tornado.application')\n", (816, 839), False, 'import logging\n'), ((7495, 7549), 'tornado.test.util.unittest.skipIf', 'unittest.skipIf', (['(cv is None)', '"""OpenCV is not installed"""'], {}), "(cv is None, 'OpenCV is not i...
Neelraj21/phython
hackathon/darkmattertemperaturedistribution/example.py
68a2cedccae694eb84880f3aa55cc01d458e055e
#!/usr/bin/env python from scipy import * from pylab import * #from pylab import imshow #! #! Some graphical explorations of the Julia sets with python and pyreport #!######################################################################### #$ #$ We start by defining a function J: #$ \[ J_c : z \rightarrow z^2 + c \] #...
[]
codepointtku/respa
resources/migrations/0126_add_field_disallow_overlapping_reservations_per_user.py
bb9cd8459d5562569f976dbc609ec41ceecc8023
# Generated by Django 2.2.21 on 2021-06-23 12:43 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('resources', '0125_add_timmi_payload_model'), ] operations = [ migrations.AddField( model_name=...
[((409, 521), 'django.db.models.BooleanField', 'models.BooleanField', ([], {'default': '(False)', 'verbose_name': '"""Disallow overlapping reservations in this unit per user."""'}), "(default=False, verbose_name=\n 'Disallow overlapping reservations in this unit per user.')\n", (428, 521), False, 'from django.db imp...
marv1913/lora_multihop
src/lora_multihop/module_config.py
ef07493c2f763d07161fa25d4b884ef79b94afa4
import logging from lora_multihop import serial_connection, variables def config_module(configuration=variables.MODULE_CONFIG): if serial_connection.execute_command(configuration, [variables.STATUS_OK]): serial_connection.execute_command('AT+SEND=1', [variables.STATUS_OK]) serial_connection.execu...
[((138, 209), 'lora_multihop.serial_connection.execute_command', 'serial_connection.execute_command', (['configuration', '[variables.STATUS_OK]'], {}), '(configuration, [variables.STATUS_OK])\n', (171, 209), False, 'from lora_multihop import serial_connection, variables\n'), ((445, 491), 'logging.warning', 'logging.war...
ferdianap/Eris_test
eris/script/ferdian.py
c2a00d65f816ad6d48a65c14b4bea4f3d081b86b
#!/usr/bin/env python # Copyright (c) 2013-2014, Rethink Robotics # 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, # ...
[((3288, 3317), 'baxter_interface.Limb', 'baxter_interface.Limb', (['"""left"""'], {}), "('left')\n", (3309, 3317), False, 'import baxter_interface\n'), ((3330, 3360), 'baxter_interface.Limb', 'baxter_interface.Limb', (['"""right"""'], {}), "('right')\n", (3351, 3360), False, 'import baxter_interface\n'), ((3377, 3424)...
zhangjun0x01/Alink
core/src/main/python/akdl/entry/base_entry.py
c1cd3380bed29a4be4eb058a7462213869c02387
import abc from typing import Dict, Callable import tensorflow as tf from flink_ml_framework.context import Context from flink_ml_framework.java_file import * from ..runner import tf_helper, io_helper from ..runner.output_writer import DirectOutputWriter try: from flink_ml_tensorflow.tensorflow_context import TF...
[((1728, 1746), 'flink_ml_tensorflow2.tensorflow_context.TFContext', 'TFContext', (['context'], {}), '(context)\n', (1737, 1746), False, 'from flink_ml_tensorflow2.tensorflow_context import TFContext\n'), ((1311, 1347), 'importlib.import_module', 'importlib.import_module', (['module_name'], {}), '(module_name)\n', (133...
jbcurtin/cassandra-orm
corm-tests/test_corm_api.py
2c5540de36166c81832c1ccd0ee40c52e598e05c
import pytest ENCODING = 'utf-8' @pytest.fixture(scope='function', autouse=True) def setup_case(request): def destroy_case(): from corm import annihilate_keyspace_tables, SESSIONS annihilate_keyspace_tables('mykeyspace') for keyspace_name, session in SESSIONS.copy().items(): if...
[((36, 82), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""function"""', 'autouse': '(True)'}), "(scope='function', autouse=True)\n", (50, 82), False, 'import pytest\n'), ((735, 760), 'corm.register_table', 'register_table', (['TestModel'], {}), '(TestModel)\n', (749, 760), False, 'from corm import register_tab...
UCSB-dataScience-ProjectGroup/movie_rating_prediction
src/utilities/getInfo.py
c0c29c0463dccc6ad286bd59e77993fdf0d05fb2
import json import os from utilities.SaveLoadJson import SaveLoadJson as SLJ from utilities.LineCount import LineCount as LC import subprocess from geolite2 import geolite2 class getData: #Get Data Functions ------------------------------------------------------ @staticmethod def getDATA(): resu...
[((789, 807), 'json.dumps', 'json.dumps', (['result'], {}), '(result)\n', (799, 807), False, 'import json\n'), ((865, 890), 'utilities.SaveLoadJson.SaveLoadJson.load', 'SLJ.load', (['"""dataStore.txt"""'], {}), "('dataStore.txt')\n", (873, 890), True, 'from utilities.SaveLoadJson import SaveLoadJson as SLJ\n'), ((1124,...
KalifiaBillal/NeMo
nemo/collections/nlp/losses/__init__.py
4fc670ad0c886be2623247921d4311ba30f486f8
from nemo.collections.nlp.losses.sgd_loss import SGDDialogueStateLoss
[]
MrAGi/netrunner-cambridge
netrunner/test_settings.py
bae0603486c2aa5a980e8e19207452fb01ec2193
# -*- coding: utf-8 -*- from .settings import * DEBUG = True TEMPLATE_DEBUG = DEBUG DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': os.environ['LOCAL_DB_NAME'], 'USER': os.environ['LOCAL_DB_USER'], 'PASSWORD': os.environ['LOCAL_DB_PASSWORD']...
[]
thalles-dreissig20/Quebra_Cabeca
Python_Exercicios/calcula_terreno.py
eeb9458dbabac72d9867e5ec5d7f1aa9b5993d79
def area(larg, comp): a = larg * comp print(f'A dimensão é {a}') print('Controle de terrenos') print('-' * 20) l = float(input('qual a largura do terreno: ')) c = float(input('qual o comprimento do terreno: ')) area(l , c)
[]
romulogoleniesky/Python_C_E_V
Desafios/desafio_041.py
2dcf5fb3505a20443788a284c52114c6434118ce
import datetime ano = (datetime.datetime.now()).year nasc = int(input("Digite o seu ano de nascimento: ")) categoria = 0 if (ano - nasc) <= 9: categoria = str("MIRIM") elif 9 < (ano - nasc) <= 14: categoria = str("INFANTIL") elif 14 < (ano - nasc) <= 19 : categoria = str("JUNIOR") elif 19 < (ano - nasc) <= ...
[((23, 46), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (44, 46), False, 'import datetime\n')]
RecoHut-Stanzas/S168471
eval/metrics.py
7e0ac621c36f839e1df6876ec517d0ad00672790
import torch def ndcg_binary_at_k_batch_torch(X_pred, heldout_batch, k=100, device='cpu'): """ Normalized Discounted Cumulative Gain@k for for predictions [B, I] and ground-truth [B, I], with binary relevance. ASSUMPTIONS: all the 0's in heldout_batch indicate 0 relevance. """ batch_users = X_pre...
[((363, 404), 'torch.topk', 'torch.topk', (['X_pred', 'k'], {'dim': '(1)', 'sorted': '(True)'}), '(X_pred, k, dim=1, sorted=True)\n', (373, 404), False, 'import torch\n'), ((1044, 1086), 'torch.topk', 'torch.topk', (['X_pred', 'k'], {'dim': '(1)', 'sorted': '(False)'}), '(X_pred, k, dim=1, sorted=False)\n', (1054, 1086...
justinshenk/simba
simba/run_dash_tkinter.py
a58ccd0ceeda201c1452d186033ce6b25fbab564
# All credit to https://stackoverflow.com/questions/46571448/tkinter-and-a-html-file - thanks DELICA - https://stackoverflow.com/users/7027346/delica from cefpython3 import cefpython as cef import ctypes try: import tkinter as tk from tkinter import messagebox except ImportError: import Tkinter as tk impo...
[((418, 435), 'cefpython3.cefpython.WindowUtils', 'cef.WindowUtils', ([], {}), '()\n', (433, 435), True, 'from cefpython3 import cefpython as cef\n'), ((589, 622), 'logging.getLogger', '_logging.getLogger', (['"""tkinter_.py"""'], {}), "('tkinter_.py')\n", (607, 622), True, 'import logging as _logging\n'), ((4152, 4176...
sfpd/rlreloaded
domain_data/mujoco_worlds/make_xml.py
650c64ec22ad45996c8c577d85b1a4f20aa1c692
import re def do_substitution(in_lines): lines_iter = iter(in_lines) defn_lines = [] while True: try: line = lines_iter.next() except StopIteration: raise RuntimeError("didn't find line starting with ---") if line.startswith('---'): break e...
[((417, 445), 're.compile', 're.compile', (['"""\\\\$\\\\((.+?)\\\\)"""'], {}), "('\\\\$\\\\((.+?)\\\\)')\n", (427, 445), False, 'import re\n'), ((747, 768), 'os.path.dirname', 'osp.dirname', (['__file__'], {}), '(__file__)\n', (758, 768), True, 'import os.path as osp\n')]
cahyareza/django_admin_cookbook
myproject/apps/events/migrations/0002_alter_eventhero_options.py
6c82dbd3aebe455b68feb020d5cad7978b8191b7
# Generated by Django 3.2.12 on 2022-03-28 11:57 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('events', '0001_initial'), ] operations = [ migrations.AlterModelOptions( name='eventhero', options={'verbose_name_plural': ...
[((216, 316), 'django.db.migrations.AlterModelOptions', 'migrations.AlterModelOptions', ([], {'name': '"""eventhero"""', 'options': "{'verbose_name_plural': 'Event heroes'}"}), "(name='eventhero', options={\n 'verbose_name_plural': 'Event heroes'})\n", (244, 316), False, 'from django.db import migrations\n')]
bmintz/python-snippets
hilton_sign_in.py
982861c173bf4bcd5d908514a9e8b1914a580a5d
#!/usr/bin/env python3 # encoding: utf-8 import sys import urllib.parse import selenium.webdriver def exit(): driver.quit() sys.exit(0) driver = selenium.webdriver.Firefox() # for some reason, detectportal.firefox.com and connectivitycheck.gstatic.com are not blocked # therefore, they cannot be used to detect con...
[((129, 140), 'sys.exit', 'sys.exit', (['(0)'], {}), '(0)\n', (137, 140), False, 'import sys\n')]
rhyswhitley/savanna_iav
src/figures/trends/leaf_response.py
4eadf29a4e9c05d0b14d3b9c973eb8db3ea7edba
#!/usr/bin/env python import os from collections import OrderedDict import cPickle as pickle import numpy as np import pandas as pd import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec from matplotlib.cm import get_cmap from matplotlib import style from scipy import stats from scipy import integrate ...
[((377, 412), 'matplotlib.gridspec.GridSpec', 'gridspec.GridSpec', (['(4)', '(1)'], {'hspace': '(0.1)'}), '(4, 1, hspace=0.1)\n', (394, 412), True, 'import matplotlib.gridspec as gridspec\n'), ((424, 449), 'matplotlib.pyplot.subplot', 'plt.subplot', (['plot_grid[0]'], {}), '(plot_grid[0])\n', (435, 449), True, 'import ...
vprnet/school-closings
app/index.py
04c63170ea36cabe0a3486f0e58830952e1fd0a8
#!/usr/local/bin/python2.7 from flask import Flask import sys from flask_frozen import Freezer from upload_s3 import set_metadata from config import AWS_DIRECTORY app = Flask(__name__) app.config.from_object('config') from views import * # Serving from s3 leads to some complications in how static files are served i...
[((171, 186), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (176, 186), False, 'from flask import Flask\n'), ((942, 954), 'flask_frozen.Freezer', 'Freezer', (['app'], {}), '(app)\n', (949, 954), False, 'from flask_frozen import Freezer\n'), ((988, 1002), 'upload_s3.set_metadata', 'set_metadata', ([], {}),...
modwizcode/m1n1
proxyclient/linux.py
96d133e854dfe878ea39f9c994545a2026a446a8
#!/usr/bin/python from setup import * payload = open(sys.argv[1], "rb").read() dtb = open(sys.argv[2], "rb").read() if len(sys.argv) > 3: initramfs = open(sys.argv[3], "rb").read() initramfs_size = len(initramfs) else: initramfs = None initramfs_size = 0 compressed_size = len(payload) compressed_addr...
[]
shizhongpwn/ancypwn
src/server.py
716146e4986c514754492c8503ab196eecb9466d
import json import os import multiprocessing import struct import importlib from socketserver import TCPServer, StreamRequestHandler def plugin_module_import(name): try: return importlib.import_module(name) except ModuleNotFoundError as e: prompt = 'plugin {} not found, please install it first...
[((191, 220), 'importlib.import_module', 'importlib.import_module', (['name'], {}), '(name)\n', (214, 220), False, 'import importlib\n'), ((650, 674), 'json.loads', 'json.loads', (['json_content'], {}), '(json_content)\n', (660, 674), False, 'import json\n'), ((1229, 1276), 'socketserver.TCPServer', 'TCPServer', (["(''...
c-hofer/pytorch_utils
pytorch_utils/collection_utils.py
55278272690937ff1180c8d549bc866a63a5ac51
def keychain_value_iter(d, key_chain=None, allowed_values=None): key_chain = [] if key_chain is None else list(key_chain).copy() if not isinstance(d, dict): if allowed_values is not None: assert isinstance(d, allowed_values), 'Value needs to be of type {}!'.format( allowed_v...
[]
zace3d/video_analysis
speech_to_text/views.py
9001486ae64160ca497f6b9a99df5d9a5c5422cc
from django.shortcuts import render from django.contrib.auth.decorators import login_required from django.http import JsonResponse from django.views.decorators.csrf import csrf_exempt from . import helpers # Create your views here. @csrf_exempt def convert_video(request, version): # Get video video = reques...
[((532, 565), 'django.http.JsonResponse', 'JsonResponse', (['context'], {'safe': '(False)'}), '(context, safe=False)\n', (544, 565), False, 'from django.http import JsonResponse\n')]
boladmin/security_monkey
security_monkey/watchers/vpc/vpn.py
c28592ffd518fa399527d26262683fc860c30eef
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # ...
[((1699, 1733), 'cloudaux.aws.ec2.describe_vpn_connections', 'describe_vpn_connections', ([], {}), '(**kwargs)\n', (1723, 1733), False, 'from cloudaux.aws.ec2 import describe_vpn_connections\n')]
coush001/Imperial-MSc-Group-Project-2
particle.py
9309217895802d11c6fe9d2dca9b21f98fbc1c61
from itertools import count import numpy as np class Particle(object): """Object containing all the properties for a single particle""" _ids = count(0) def __init__(self, main_data=None, x=np.zeros(2)): self.id = next(self._ids) self.main_data = main_data self.x = np.array(x) ...
[((154, 162), 'itertools.count', 'count', (['(0)'], {}), '(0)\n', (159, 162), False, 'from itertools import count\n'), ((205, 216), 'numpy.zeros', 'np.zeros', (['(2)'], {}), '(2)\n', (213, 216), True, 'import numpy as np\n'), ((305, 316), 'numpy.array', 'np.array', (['x'], {}), '(x)\n', (313, 316), True, 'import numpy ...
hussein18149/PITCHBOARD
app/main/form.py
9aa515f8dd18464830bdf80488a317e8e791bd1b
from flask_wtf import FlaskForm from wtforms import StringField,TextAreaField,SubmitField from wtforms.validators import Required class UpdateProfile(FlaskForm): about = TextAreaField('Tell us about you.',validators = [Required()]) submit = SubmitField('Submit') class PitchForm(FlaskForm): pitch = TextAre...
[((250, 271), 'wtforms.SubmitField', 'SubmitField', (['"""Submit"""'], {}), "('Submit')\n", (261, 271), False, 'from wtforms import StringField, TextAreaField, SubmitField\n'), ((313, 343), 'wtforms.TextAreaField', 'TextAreaField', (['"""Write a pitch"""'], {}), "('Write a pitch')\n", (326, 343), False, 'from wtforms i...
soar-telescope/dragons-soar
soar_instruments/sami/adclass.py
a1c600074f532c1af6bd59bc2cc662a1aecd39c4
import re import astrodata from astrodata import (astro_data_tag, TagSet, astro_data_descriptor, returns_list) from astrodata.fits import FitsLoader, FitsProvider from ..soar import AstroDataSOAR class AstroDataSAMI(AstroDataSOAR): __keyword_dict = dict(data_section='DATASEC', gain='GAIN'...
[((812, 845), 'astrodata.TagSet', 'astrodata.TagSet', (["['SAMI', 'SAM']"], {}), "(['SAMI', 'SAM'])\n", (828, 845), False, 'import astrodata\n'), ((1172, 1214), 'astrodata.TagSet', 'astrodata.TagSet', (["['FLAT', 'CAL', 'IMAGE']"], {}), "(['FLAT', 'CAL', 'IMAGE'])\n", (1188, 1214), False, 'import astrodata\n'), ((1341,...
t10471/python
practice/src/design_pattern/TemplateMethod.py
75056454bfb49197eb44f6b4d6a1b0a0b4b408ec
# -*- coding: utf-8 -*- #単なる継承 class Base(object): def __init__(self): pass def meth(self, int): return self._meth(int) def _meth(self, int): return int class Pow(Base): def _meth(self, int): return pow(int,int)
[]
yoon28/realsr-noise-injection
yoon/stage1_kernel.py
402679490bf0972d09aaaadee3b5b9850c2a36e4
import os, sys import numpy as np import cv2 import random import torch from configs import Config from kernelGAN import KernelGAN from data import DataGenerator from learner import Learner import tqdm DATA_LOC = "/mnt/data/NTIRE2020/realSR/track2" # "/mnt/data/NTIRE2020/realSR/track1" DATA_X = "DPEDiphone-tr-x" # ...
[((476, 498), 'os.path.dirname', 'os.path.dirname', (['afile'], {}), '(afile)\n', (491, 498), False, 'import os, sys\n'), ((514, 537), 'os.path.basename', 'os.path.basename', (['afile'], {}), '(afile)\n', (530, 537), False, 'import os, sys\n'), ((873, 888), 'kernelGAN.KernelGAN', 'KernelGAN', (['conf'], {}), '(conf)\n'...
RDFLib/PyRDFa
test/rdfa/test_non_xhtml.py
efc24d4940910ca1e65900c25b62047301bbdcc7
from unittest import TestCase from pyRdfa import pyRdfa class NonXhtmlTest(TestCase): """ RDFa that is in not well-formed XHTML is passed through html5lib. These tests make sure that this RDFa can be processed both from a file, and from a URL. """ target1 = '<og:isbn>9780596516499</og:isbn>'...
[((459, 467), 'pyRdfa.pyRdfa', 'pyRdfa', ([], {}), '()\n', (465, 467), False, 'from pyRdfa import pyRdfa\n'), ((623, 631), 'pyRdfa.pyRdfa', 'pyRdfa', ([], {}), '()\n', (629, 631), False, 'from pyRdfa import pyRdfa\n')]
jr3cermak/robs-kitchensink
python/pyoai/setup.py
74b7eb1b1acd8b700d61c5a9ba0c69be3cc6763a
from setuptools import setup, find_packages from os.path import join, dirname setup( name='pyoai', version='2.4.6.b', author='Infrae', author_email='rob.cermak@gmail.com', url='https://github.com/jr3cermak/robs-kitchensink/tree/master/python/pyoai', classifiers=["Development Status :: 4 - Beta"...
[((989, 1009), 'setuptools.find_packages', 'find_packages', (['"""src"""'], {}), "('src')\n", (1002, 1009), False, 'from setuptools import setup, find_packages\n'), ((932, 949), 'os.path.dirname', 'dirname', (['__file__'], {}), '(__file__)\n', (939, 949), False, 'from os.path import join, dirname\n'), ((856, 873), 'os....
Roozbeh-Bazargani/CPSC-533R-project
utils/functions.py
453f093b23d2363f09c61079d1d4fbd878abf3be
import torch from torch import nn import math #0 left hip #1 left knee #2 left foot #3 right hip #4 right knee #5 right foot #6 middle hip #7 neck #8 nose #9 head #10 left shoulder #11 left elbow #12 left wrist #13 right shoulder #14 right elbow #15 right wrist def random_rotation(J3d): J = J3d # need copy???? ba...
[((1199, 1215), 'torch.cos', 'torch.cos', (['theta'], {}), '(theta)\n', (1208, 1215), False, 'import torch\n'), ((1231, 1247), 'torch.sin', 'torch.sin', (['theta'], {}), '(theta)\n', (1240, 1247), False, 'import torch\n'), ((1263, 1285), 'torch.ones', 'torch.ones', (['batch_size'], {}), '(batch_size)\n', (1273, 1285), ...
ayresmajor/Curso-python
Desafio Python/Aula 22 des109.py
006229cec38ea365bf43b19e3ce93fbd32e1dca6
from des109 import moeda preco = float(input('Digite o preço pretendido: €')) print(f'''A metade do preço é {(moeda.metade(preco))} O dobro do preço é {(moeda.dobra(preco))} Aumentando o preço 10% temos {(moeda.aumentar(preco, 10))} Diminuindo o preço 13% temos {(moeda.aumentar(preco, 13))}''')
[((113, 132), 'des109.moeda.metade', 'moeda.metade', (['preco'], {}), '(preco)\n', (125, 132), False, 'from des109 import moeda\n'), ((163, 181), 'des109.moeda.dobra', 'moeda.dobra', (['preco'], {}), '(preco)\n', (174, 181), False, 'from des109 import moeda\n'), ((214, 239), 'des109.moeda.aumentar', 'moeda.aumentar', (...
PacktPublishing/Odoo-Development-Cookbook
Chapter13_code/ch13_r05_using_the_rpc_api/xmlrpc.py
5553110c0bc352c4541f11904e236cad3c443b8b
#!/usr/bin/env python2 import xmlrpclib db = 'odoo9' user = 'admin' password = 'admin' uid = xmlrpclib.ServerProxy('http://localhost:8069/xmlrpc/2/common')\ .authenticate(db, user, password, {}) odoo = xmlrpclib.ServerProxy('http://localhost:8069/xmlrpc/2/object') installed_modules = odoo.execute_kw( db, uid, ...
[]
emorynlp/character-identification-old
python/zzz/v1-all_feat_cnn/components/features.py
f6519166dd30bd8140f05aa3e43225ab27c2ea6d
from abc import * import numpy as np ########################################################### class AbstractFeatureExtractor(object): @abstractmethod def extract(self, object): return ########################################################### class EntityFeatureExtractor(AbstractFeatureExtractor...
[((7826, 7853), 'numpy.zeros', 'np.zeros', (['self.word2vec_dim'], {}), '(self.word2vec_dim)\n', (7834, 7853), True, 'import numpy as np\n'), ((8096, 8123), 'numpy.zeros', 'np.zeros', (['self.word2vec_dim'], {}), '(self.word2vec_dim)\n', (8104, 8123), True, 'import numpy as np\n'), ((8881, 8911), 'numpy.zeros', 'np.zer...
waikato-ufdl/ufdl-backend
ufdl-core-app/src/ufdl/core_app/models/mixins/_UserRestrictedQuerySet.py
776fc906c61eba6c2f2e6324758e7b8a323e30d7
from django.db import models class UserRestrictedQuerySet(models.QuerySet): """ Query-set base class for models which apply per-instance permissions based on the user accessing them. """ def for_user(self, user): """ Filters the query-set to those instances that the given u...
[]
sebtelko/pulumi-azure-native
sdk/python/pulumi_azure_native/eventgrid/partner_registration.py
711ec021b5c73da05611c56c8a35adb0ce3244e4
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** 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 _utilities from...
[((6655, 6694), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""resourceGroupName"""'}), "(name='resourceGroupName')\n", (6668, 6694), False, 'import pulumi\n'), ((7070, 7122), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""authorizedAzureSubscriptionIds"""'}), "(name='authorizedAzureSubscriptionIds')\n", (708...
TomKingsfordUoA/ResidualMaskingNetwork
_ar/masking_provement.py
6ce5ddf70f8ac8f1e6da2746b0bbeb9e457ceb7d
import os import glob import cv2 import numpy as np import torch from torchvision.transforms import transforms from natsort import natsorted from models import resmasking_dropout1 from utils.datasets.fer2013dataset import EMOTION_DICT from barez import show transform = transforms.Compose( [ transforms.ToPI...
[((774, 799), 'models.resmasking_dropout1', 'resmasking_dropout1', (['(3)', '(7)'], {}), '(3, 7)\n', (793, 799), False, 'from models import resmasking_dropout1\n'), ((894, 971), 'torch.load', 'torch.load', (['"""./saved/checkpoints/Z_resmasking_dropout1_rot30_2019Nov30_13.32"""'], {}), "('./saved/checkpoints/Z_resmaski...
Kauan677/Projetos-Python
Python/Gerenciador de pagamentos.py
62f6b476e6d250d9ff31c95808b31ebd3ab4fdbb
import time import colorama def gerenciador_de_pagamento(): preço = float(str(input('Preço das compras: R$'))) print('''Escolha de pagamento: [ 1 ]A vista dinheiro/cheque: 10% de desconto. [ 2 ]A vista no cartão: 5% de desconto. [ 3 ]Em até duas 2x no cartão: preço formal. [ 4 ]3x ou mais no car...
[((422, 435), 'time.sleep', 'time.sleep', (['(2)'], {}), '(2)\n', (432, 435), False, 'import time\n')]
seoss/scs_core
src/scs_core/osio/data/abstract_topic.py
0d4323c5697a39eb44a887f179ba5dca3716c1d2
""" Created on 2 Apr 2017 @author: Bruno Beloff (bruno.beloff@southcoastscience.com) """ from collections import OrderedDict from scs_core.data.json import JSONable # -------------------------------------------------------------------------------------------------------------------- class AbstractTopic(JSONable):...
[((1051, 1064), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (1062, 1064), False, 'from collections import OrderedDict\n')]
pulumi-bot/pulumi-azure-native
sdk/python/pulumi_azure_native/notificationhubs/latest/get_namespace.py
f7b9490b5211544318e455e5cceafe47b628e12c
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** 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 from ... import _utilities, _tables from...
[((436, 620), 'warnings.warn', 'warnings.warn', (['"""The \'latest\' version is deprecated. Please migrate to the function in the top-level module: \'azure-native:notificationhubs:getNamespace\'."""', 'DeprecationWarning'], {}), '(\n "The \'latest\' version is deprecated. Please migrate to the function in the top-le...
naren-m/chue
chue/utils.py
6f77ad990c911353524c5c99bcf6e30155edaf97
import json from pygments import highlight from pygments.lexers import JsonLexer from pygments.formatters import TerminalFormatter def print_json_obj(json_object): json_str = json.dumps(json_object, indent=4, sort_keys=True) print(highlight(json_str, JsonLexer(), TerminalFormatter())) def print_json_str(jso...
[((181, 230), 'json.dumps', 'json.dumps', (['json_object'], {'indent': '(4)', 'sort_keys': '(True)'}), '(json_object, indent=4, sort_keys=True)\n', (191, 230), False, 'import json\n'), ((261, 272), 'pygments.lexers.JsonLexer', 'JsonLexer', ([], {}), '()\n', (270, 272), False, 'from pygments.lexers import JsonLexer\n'),...
919bot/Tessa
selfdrive/car/chrysler/radar_interface.py
9b48ff9020e8fb6992fc78271f2720fd19e01093
#!/usr/bin/env python3 import os from opendbc.can.parser import CANParser from cereal import car from selfdrive.car.interfaces import RadarInterfaceBase RADAR_MSGS_C = list(range(0x2c2, 0x2d4+2, 2)) # c_ messages 706,...,724 RADAR_MSGS_D = list(range(0x2a2, 0x2b4+2, 2)) # d_ messages LAST_MSG = max(RADAR_MSGS_C + RA...
[((2329, 2356), 'cereal.car.RadarData.new_message', 'car.RadarData.new_message', ([], {}), '()\n', (2354, 2356), False, 'from cereal import car\n'), ((1589, 1612), 'os.path.splitext', 'os.path.splitext', (['dbc_f'], {}), '(dbc_f)\n', (1605, 1612), False, 'import os\n'), ((2670, 2708), 'cereal.car.RadarData.RadarPoint.n...
mattiasljungstrom/fips
mod/tools/ccmake.py
8775e299f710ae5b977d49dc0672b607f2a10378
""" wrapper for ccmake command line tool """ import subprocess name = 'ccmake' platforms = ['linux', 'osx'] optional = True not_found = "required for 'fips config' functionality" #------------------------------------------------------------------------------- def check_exists(fips_dir) : """test if ccmake is in t...
[((834, 888), 'subprocess.call', 'subprocess.call', (['"""ccmake ."""'], {'cwd': 'build_dir', 'shell': '(True)'}), "('ccmake .', cwd=build_dir, shell=True)\n", (849, 888), False, 'import subprocess\n'), ((408, 456), 'subprocess.check_output', 'subprocess.check_output', (["['ccmake', '--version']"], {}), "(['ccmake', '-...
mbartoli/image-quality-assessment
image_quality/handlers/data_generator.py
b957c781ac8a11f8668f58345524f33503338b3b
import os import numpy as np import tensorflow as tf from image_quality.utils import utils class TrainDataGenerator(tf.keras.utils.Sequence): '''inherits from Keras Sequence base object, allows to use multiprocessing in .fit_generator''' def __init__(self, samples, img_dir, batch_size, n_classes, basenet_preproc...
[((1440, 1471), 'numpy.random.shuffle', 'np.random.shuffle', (['self.indexes'], {}), '(self.indexes)\n', (1457, 1471), True, 'import numpy as np\n'), ((1878, 1924), 'image_quality.utils.utils.load_image', 'utils.load_image', (['img_file', 'self.img_load_dims'], {}), '(img_file, self.img_load_dims)\n', (1894, 1924), Fal...
sirken/coding-practice
codewars/4 kyu/strip-comments.py
9c5e23b2c24f525a89a5e1d15ce3aec3ad1a01ab
from Test import Test, Test as test ''' Complete the solution so that it strips all text that follows any of a set of comment markers passed in. Any whitespace at the end of the line should also be stripped out. Example: Given an input string of: apples, pears # and bananas grapes bananas !apples The output expecte...
[]
myQLM/myqlm-interop
qat/interop/qiskit/quantum_channels.py
9d77cb7c719f82be05d9f88493522940b8142124
# -*- coding: utf-8 -*- """ Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Versi...
[((1512, 1556), 'qat.comm.datamodel.ttypes.Matrix', 'Matrix', (['array.shape[0]', 'array.shape[1]', 'data'], {}), '(array.shape[0], array.shape[1], data)\n', (1518, 1556), False, 'from qat.comm.datamodel.ttypes import Matrix, ComplexNumber\n'), ((2444, 2558), 'qat.comm.quops.ttypes.QuantumChannel', 'QuantumChannel', ([...
mshader/mne-nirs
mne_nirs/simulation/_simulation.py
d59a5436d162108226f31b33b194dfecada40d72
# Authors: Robert Luke <mail@robertluke.net> # # License: BSD (3-clause) import numpy as np from mne import Annotations, create_info from mne.io import RawArray def simulate_nirs_raw(sfreq=3., amplitude=1., sig_dur=300., stim_dur=5., isi_min=15., isi_max=45.): """ ...
[((1454, 1531), 'pandas.DataFrame', 'DataFrame', (["{'trial_type': conditions, 'onset': onsets, 'duration': durations}"], {}), "({'trial_type': conditions, 'onset': onsets, 'duration': durations})\n", (1463, 1531), False, 'from pandas import DataFrame\n'), ((1590, 1687), 'nilearn.stats.first_level_model.make_first_leve...
athanikos/cryptodataaccess
build/lib/dataaccess/TransactionRepository.py
6189a44c65a9b03c02822a534e865740ab488809
from cryptomodel.cryptostore import user_notification, user_channel, user_transaction, operation_type from mongoengine import Q from cryptodataaccess import helpers from cryptodataaccess.helpers import if_none_raise, if_none_raise_with_id class TransactionRepository: def __init__(self, config, log_error): ...
[((439, 507), 'cryptodataaccess.helpers.server_time_out_wrapper', 'helpers.server_time_out_wrapper', (['self', 'self.do_fetch_transaction', 'id'], {}), '(self, self.do_fetch_transaction, id)\n', (470, 507), False, 'from cryptodataaccess import helpers\n'), ((567, 641), 'cryptodataaccess.helpers.server_time_out_wrapper'...
FSU-ACM/Contest-Server
app/util/auth2.py
00a71cdcee1a7e4d4e4d8e33b5d6decf27f02313
""" util.auth2: Authentication tools This module is based off of util.auth, except with the action paradigm removed. """ from flask import session from app.models import Account from app.util import course as course_util # Session keys SESSION_EMAIL = 'email' def create_account(email: str, password: str, f...
[((795, 893), 'app.models.Account', 'Account', ([], {'email': 'email', 'first_name': 'first_name', 'last_name': 'last_name', 'fsuid': 'fsuid', 'is_admin': '(False)'}), '(email=email, first_name=first_name, last_name=last_name, fsuid=\n fsuid, is_admin=False)\n', (802, 893), False, 'from app.models import Account\n')...
motiurce/FeView
FeView/pstaticwidget.py
8897b37062be88dd5ead2c8524f6b3b73451e25d
from PyQt5.QtWidgets import * from matplotlib.backends.backend_qt5agg import FigureCanvas from matplotlib.figure import Figure from matplotlib.backends.backend_qt5agg import NavigationToolbar2QT as NavigationToolbar class PstaticWidget(QWidget): def __init__(self, parent=None): QWidget.__init__(self...
[((360, 368), 'matplotlib.figure.Figure', 'Figure', ([], {}), '()\n', (366, 368), False, 'from matplotlib.figure import Figure\n'), ((451, 481), 'matplotlib.backends.backend_qt5agg.FigureCanvas', 'FigureCanvas', (['self.fig_pstatic'], {}), '(self.fig_pstatic)\n', (463, 481), False, 'from matplotlib.backends.backend_qt5...
julesy89/pyallocation
pyallocation/solvers/exhaustive.py
af80a8e2367a006121dd0702b55efa7b954bb039
import numpy as np from pymoo.core.algorithm import Algorithm from pymoo.core.population import Population from pymoo.util.termination.no_termination import NoTermination from pyallocation.allocation import FastAllocation from pyallocation.problem import AllocationProblem def exhaustively(problem): alloc = FastA...
[((315, 351), 'pyallocation.allocation.FastAllocation', 'FastAllocation', (['problem'], {'debug': '(False)'}), '(problem, debug=False)\n', (329, 351), False, 'from pyallocation.allocation import FastAllocation\n'), ((1184, 1199), 'pymoo.util.termination.no_termination.NoTermination', 'NoTermination', ([], {}), '()\n', ...
yasminbraga/ufopa-reports
config.py
6d8b213eb0dfce6775d0bb0fd277e8dc09da041c
import os class Config: CSRF_ENABLED = True SECRET_KEY = 'your-very-very-secret-key' SQLALCHEMY_DATABASE_URI = 'postgresql:///flask_template_dev' SQLALCHEMY_TRACK_MODIFICATIONS = False SQLALCHEMY_ECHO = True class Development(Config): ENV = 'development' DEBUG = True TESTING = False ...
[((419, 610), 'os.getenv', 'os.getenv', (['"""DATABASE_URL"""', '"""postgres://firhokdcdnfygz:93231d3f2ae1156cabfc40f7e4ba08587a77f68a5e2072fbcbbdb30150ba4bcb@ec2-107-22-253-158.compute-1.amazonaws.com:5432/df9c5vvl0s21da"""'], {}), "('DATABASE_URL',\n 'postgres://firhokdcdnfygz:93231d3f2ae1156cabfc40f7e4ba08587a77f...
noironetworks/heat
heat/api/openstack/v1/views/stacks_view.py
7cdadf1155f4d94cf8f967635b98e4012a7acfb7
# # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # ...
[((2471, 2527), 'heat.api.openstack.v1.views.views_common.get_collection_links', 'views_common.get_collection_links', (['req', 'formatted_stacks'], {}), '(req, formatted_stacks)\n', (2504, 2527), False, 'from heat.api.openstack.v1.views import views_common\n'), ((1373, 1399), 'heat.api.openstack.v1.util.make_link', 'ut...
Kzra/pykrev
pykrev/formula/find_intersections.py
1a328fccded962f309e951c8509b87a82c3d3ae6
import itertools import numpy as np import pandas as pd def find_intersections(formula_lists,group_labels,exclusive = True): """ Docstring for function pyKrev.find_intersections ==================== This function compares n lists of molecular formula and outputs a dictionary containing the intersections...
[((1483, 1515), 'pandas.DataFrame', 'pd.DataFrame', ([], {'data': 'formula_lists'}), '(data=formula_lists)\n', (1495, 1515), True, 'import pandas as pd\n'), ((1176, 1215), 'itertools.combinations', 'itertools.combinations', (['group_labels', 'i'], {}), '(group_labels, i)\n', (1198, 1215), False, 'import itertools\n')]
j4ck64/PlaylistDirectories
Create Playlist.py
4a7caf0923620a84aea9bb91e643011e7ee118db
import os import glob import shutil from tinytag import TinyTag """ root = 'C:/' copy_to = '/copy to/folder' tag = TinyTag.get('C:/Users/jchap/OneDrive/Pictures/(VERYRAREBOYZ) (feat. $ki Mask The Slump God and Drugz).mp3') print(tag.artist) print('song duration: '+str(tag.duration)) """ f = [] f=glob.gl...
[((313, 355), 'glob.glob', 'glob.glob', (['"""C:/Users/jchap/OneDrive/*.mp3"""'], {}), "('C:/Users/jchap/OneDrive/*.mp3')\n", (322, 355), False, 'import glob\n'), ((544, 558), 'os.walk', 'os.walk', (['"""C:/"""'], {}), "('C:/')\n", (551, 558), False, 'import os\n'), ((807, 837), 'tinytag.TinyTag.get', 'TinyTag.get', ([...
Alexis-Kepano/python_challenge
PyBank/main.py
2d86e0d891c549d5fba99bd48d612be80746e34b
#import modules import os import csv #input csvpath = os.path.join('Resources', 'budget_data.csv') #output outfile = os.path.join('Analysis', 'pybankstatements.txt') #declare variables months = []; total_m = 1; net_total = 0; total_change = 0; monthly_changes = []; greatest_inc = ['', 0]; greatest_dec = ['', 0] #open...
[((54, 98), 'os.path.join', 'os.path.join', (['"""Resources"""', '"""budget_data.csv"""'], {}), "('Resources', 'budget_data.csv')\n", (66, 98), False, 'import os\n'), ((117, 165), 'os.path.join', 'os.path.join', (['"""Analysis"""', '"""pybankstatements.txt"""'], {}), "('Analysis', 'pybankstatements.txt')\n", (129, 165)...
aasw0ng/thornode-telegram-bot
bot/constants/messages.py
5f73b882381548f45fc9e690c6e4845def9600b7
from enum import Enum from constants.globals import HEALTH_EMOJIS NETWORK_ERROR = '😱 There was an error while getting data 😱\nAn API endpoint is down!' HEALTH_LEGEND = f'\n*Node health*:\n{HEALTH_EMOJIS[True]} - *healthy*\n{HEALTH_EMOJIS[False]} - *unhealthy*\n' \ f'{HEALTH_EMOJIS[None]} - *unknown*...
[]
RanHerOver/cometaai
src/interactive_conditional_samples.py
02d459da5bbc58536112cfe6343f5ceef4ff2356
import random import fire import json import os import numpy as np import tensorflow as tf import pytumblr import mysql.connector import datetime from random import seed import model, sample, encoder def interact_model( model_name='1558M', seed=None, nsamples=1, batch_size=1, length=None, tempe...
[((420, 461), 'pytumblr.TumblrRestClient', 'pytumblr.TumblrRestClient', (['""""""', '""""""', '""""""', '""""""'], {}), "('', '', '', '')\n", (445, 461), False, 'import pytumblr\n'), ((1628, 1671), 'encoder.get_encoder', 'encoder.get_encoder', (['model_name', 'models_dir'], {}), '(model_name, models_dir)\n', (1647, 167...
kokosing/hue
desktop/core/ext-py/pyasn1-0.1.8/pyasn1/compat/iterfunc.py
2307f5379a35aae9be871e836432e6f45138b3d9
from sys import version_info if version_info[0] <= 2 and version_info[1] <= 4: def all(iterable): for element in iterable: if not element: return False return True else: all = all
[]
UniversitaDellaCalabria/uniCMS
src/cms/carousels/serializers.py
b0af4e1a767867f0a9b3c135a5c84587e713cb71
from rest_framework import serializers from cms.api.serializers import UniCMSContentTypeClass, UniCMSCreateUpdateSerializer from cms.medias.serializers import MediaSerializer from . models import Carousel, CarouselItem, CarouselItemLink, CarouselItemLinkLocalization, CarouselItemLocalization class CarouselForeignK...
[((2384, 2415), 'cms.medias.serializers.MediaSerializer', 'MediaSerializer', (['instance.image'], {}), '(instance.image)\n', (2399, 2415), False, 'from cms.medias.serializers import MediaSerializer\n')]
mzegla/open_model_zoo
demos/colorization_demo/python/colorization_demo.py
092576b4c598c1e301ebc38ad74b323972e54f3e
#!/usr/bin/env python3 """ Copyright (c) 2018-2021 Intel Corporation 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 applic...
[((1125, 1220), 'logging.basicConfig', 'log.basicConfig', ([], {'format': '"""[ %(levelname)s ] %(message)s"""', 'level': 'log.DEBUG', 'stream': 'sys.stdout'}), "(format='[ %(levelname)s ] %(message)s', level=log.DEBUG,\n stream=sys.stdout)\n", (1140, 1220), True, 'import logging as log\n'), ((1249, 1279), 'argparse...
chbndrhnns/ahoi-client
swagger_client/models/transfer.py
8bd25f541c05af17c82904fa250272514b7971f2
# coding: utf-8 """ [AHOI cookbook](/ahoi/docs/cookbook/index.html) [Data Privacy](/sandboxmanager/#/privacy) [Terms of Service](/sandboxmanager/#/terms) [Imprint](https://sparkassen-hub.com/impressum/) &copy; 2016&dash;2017 Starfinanz - Ein Unternehmen der Finanz Informatik # noqa: E501 OpenAPI sp...
[((6926, 6959), 'six.iteritems', 'six.iteritems', (['self.swagger_types'], {}), '(self.swagger_types)\n', (6939, 6959), False, 'import six\n')]
vdonnefort/lisa
external/trappy/tests/test_caching.py
38e5f246e6c94201a60a8698e7f29277f11c425e
# Copyright 2015-2017 ARM Limited, Google and contributors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
[((2584, 2599), 'trappy.FTrace', 'trappy.FTrace', ([], {}), '()\n', (2597, 2599), False, 'import trappy\n'), ((2754, 2794), 'trappy.FTrace', 'trappy.FTrace', (['uncached_trace.trace_path'], {}), '(uncached_trace.trace_path)\n', (2767, 2794), False, 'import trappy\n'), ((4683, 4749), 'os.path.join', 'os.path.join', (['u...
MF-HORIZON/mf-horizon-python-client
src/mf_horizon_client/client/pipelines/blueprints.py
67a4a094767cb8e5f01956f20f5ca7726781614a
from enum import Enum class BlueprintType(Enum): """ A blueprint is a pipeline template in horizon, and must be specified when creating a new pipeline Nonlinear =============================================================================================================== A nonlinear pipeline co...
[]
An-Alone-Cow/pyChess
pyChess/olaf/views.py
2729a3a89e4d7d79659488ecb1b0bff9cac281a3
from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User from django.shortcuts import render from django.urls import reverse from django.http import HttpResponseRedirect, HttpResponse from django.utils import timezone from olaf.models import * from olaf.forms import * from...
[((3350, 3391), 'django.shortcuts.render', 'render', (['request', 'fail_template', 'fail_args'], {}), '(request, fail_template, fail_args)\n', (3356, 3391), False, 'from django.shortcuts import render\n'), ((5689, 5719), 'olaf.utility.usertools.logout_user', 'usertools.logout_user', (['request'], {}), '(request)\n', (5...
fgitmichael/SelfSupevisedSkillDiscovery
ce_vae_test/main_cetrainer.py
60eee11cfd67046190dd2784bf40e97bdbed9d40
from __future__ import print_function import argparse import torch import torch.utils.data import matplotlib.pyplot as plt from torch import nn, optim from torch.nn import functional as F from torchvision import datasets, transforms from torchvision.utils import save_image from torch.utils.tensorboard import SummaryWri...
[((518, 574), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""VAE MNIST Example"""'}), "(description='VAE MNIST Example')\n", (541, 574), False, 'import argparse\n'), ((1335, 1363), 'torch.manual_seed', 'torch.manual_seed', (['args.seed'], {}), '(args.seed)\n', (1352, 1363), False, 'impor...
sergeyberezansky/appr
appr/commands/logout.py
03168addf05c3efd779dad5168fb0a80d0512100
from __future__ import absolute_import, division, print_function from appr.auth import ApprAuth from appr.commands.command_base import CommandBase, PackageSplit class LogoutCmd(CommandBase): name = 'logout' help_message = "logout" def __init__(self, options): super(LogoutCmd, self).__init__(opti...
[((1183, 1193), 'appr.auth.ApprAuth', 'ApprAuth', ([], {}), '()\n', (1191, 1193), False, 'from appr.auth import ApprAuth\n')]
webnowone/albumMusical
musica/apps.py
b9532ff0ef47b610f0f2b565f0dd77e54d638772
from django.apps import AppConfig class MusicaConfig(AppConfig): name = 'musica'
[]
tuxiqae/pytzwhere
tzwhere/tzwhere.py
32d2bef9ff2d784741471fddb35fbb6732f556d5
#!/usr/bin/env python '''tzwhere.py - time zone computation from latitude/longitude. Ordinarily this is loaded as a module and instances of the tzwhere class are instantiated and queried directly ''' import collections try: import ujson as json # loads 2 seconds faster than normal json except: try: i...
[((838, 861), 'os.path.split', 'os.path.split', (['__file__'], {}), '(__file__)\n', (851, 861), False, 'import os\n'), ((873, 898), 'os.path.dirname', 'os.path.dirname', (['this_dir'], {}), '(this_dir)\n', (888, 898), False, 'import os\n'), ((1095, 1120), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__fi...
jre21/mindmeld
tests/home_assistant/custom_features.py
6a88e4b0dfc7971f6bf9ae406b89dbc76f68af81
from mindmeld.models.helpers import register_query_feature @register_query_feature(feature_name='average-token-length') def extract_average_token_length(**args): """ Example query feature that gets the average length of normalized tokens in the query„ Returns: (function) A feature extraction func...
[((62, 121), 'mindmeld.models.helpers.register_query_feature', 'register_query_feature', ([], {'feature_name': '"""average-token-length"""'}), "(feature_name='average-token-length')\n", (84, 121), False, 'from mindmeld.models.helpers import register_query_feature\n')]
woody2371/fishbowl-api
source/statuscodes.py
f34ff9267436b1278985870fbf19863febdb391b
#!/usr/bin/python # -*- coding: utf-8 -*- def getstatus(code): if code == "1000": value = "Success!" elif code == "1001": value = "Unknown Message Received" elif code == "1002": value = "Connection to Fishbowl Server was lost" elif code == "1003": value = "Some Requests ...
[]
jacob327/docker-flask-nginx-uwsgi-mysql
app/src/server/hoge/hoge_api.py
4b0731f746d6fda7bfecd082ddef53a9c5ec8f75
#!/usr/bin/python # -*- coding: utf-8 -*- # [Import start] from flask import Blueprint, jsonify # [Import end] app = Blueprint( 'hoge', __name__, url_prefix='/hoge' ) @app.route('/test') def hoge(): return "\nhogehoge"
[((119, 166), 'flask.Blueprint', 'Blueprint', (['"""hoge"""', '__name__'], {'url_prefix': '"""/hoge"""'}), "('hoge', __name__, url_prefix='/hoge')\n", (128, 166), False, 'from flask import Blueprint, jsonify\n')]
chipbuster/Energy-Languages-Setup
preinstall_setup/makedeb-11.0.1-1-stable/src/makedeb/utils/missing_apt_dependencies.py
5b6192e1cc73f701a2310ac72520ed540d86c1ae
#!/usr/bin/env python3 import apt_pkg import sys from apt_pkg import CURSTATE_INSTALLED, version_compare from operator import lt, le, eq, ge, gt # Function mappings for relationship operators. relation_operators = {"<<": lt, "<=": le, "=": eq, ">=": ge, ">>": gt} # Set up APT cache. apt_pkg.init() cache = apt_pkg.Ca...
[((287, 301), 'apt_pkg.init', 'apt_pkg.init', ([], {}), '()\n', (299, 301), False, 'import apt_pkg\n'), ((310, 329), 'apt_pkg.Cache', 'apt_pkg.Cache', (['None'], {}), '(None)\n', (323, 329), False, 'import apt_pkg\n'), ((2105, 2147), 'apt_pkg.version_compare', 'version_compare', (['installed_version', 'pkgver'], {}), '...
zferic/harmonization-website
cohorts_proj/datasets/migrations/0009_auto_20200824_0617.py
f6a081481df3a3a62cb075fbb63ad0470b0d4e06
# Generated by Django 3.0.7 on 2020-08-24 06:17 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('datasets', '0008_auto_20200821_1427'), ] operations = [ migrations.AddField( model_name='rawdar', name='AsB', ...
[((332, 372), 'django.db.models.FloatField', 'models.FloatField', ([], {'blank': '(True)', 'null': '(True)'}), '(blank=True, null=True)\n', (349, 372), False, 'from django.db import migrations, models\n'), ((493, 632), 'django.db.models.CharField', 'models.CharField', ([], {'choices': "[('1', 'below detection level'), ...
skvel/pynet_testx
test_hello.py
46566e059e076cb763f8a10ed7f6ff9eac5b63b1
print "Hello World!" print "Trying my hand at Git!" print "Something else" for i in range(10): print i
[]
TheDim0n/ProjectManager
tasks/views.py
50d36e7e3fc71655aa5a82bb19eacc07172ba5e4
from django.contrib.auth.mixins import LoginRequiredMixin from django.views.generic.edit import CreateView, UpdateView, DeleteView from django.views.generic import DetailView, ListView from projects.models import Project from status.models import Status from .models import Task from .forms import TaskForm, FilterForm ...
[((411, 450), 'projects.models.Project.objects.filter', 'Project.objects.filter', ([], {'created_by': 'user'}), '(created_by=user)\n', (433, 450), False, 'from projects.models import Project\n'), ((590, 610), 'status.models.Status.objects.all', 'Status.objects.all', ([], {}), '()\n', (608, 610), False, 'from status.mod...
minnieteng/smoke_project
smoke/noaa/get_smokeplume_counts.py
cc3c8f16f7759fe29e46d3cec32a3ed6ca86bd5f
import os import math import time import geohash import geojson from geojson import MultiLineString from shapely import geometry import shapefile import numpy import datetime as dt import pandas as pd import logging logger = logging.getLogger(__name__) source_shape_file_path = "C:/temp/2018/" threshold = 60*60 cols = ...
[((226, 253), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (243, 253), False, 'import logging\n'), ((454, 485), 'os.walk', 'os.walk', (['source_shape_file_path'], {}), '(source_shape_file_path)\n', (461, 485), False, 'import os\n'), ((2012, 2045), 'pandas.DataFrame', 'pd.DataFrame', (['...
KRHS-GameProgramming-2015/Manpac
notes/OOBall/OOBall/main-demo.py
959bf7f5195a4edb528fbbf25b8896fcb28d5327
import pygame_sdl2 pygame_sdl2.import_as_pygame() import pygame import os import random import math from Ball import Ball def save_state(balls): """ Saves the game state. """ stateString = "" with open("state.txt", "w") as f: for ball in balls: stateString += "{} {} {} {} {}".f...
[((19, 49), 'pygame_sdl2.import_as_pygame', 'pygame_sdl2.import_as_pygame', ([], {}), '()\n', (47, 49), False, 'import pygame_sdl2\n'), ((999, 1026), 'os.path.exists', 'os.path.exists', (['"""state.txt"""'], {}), "('state.txt')\n", (1013, 1026), False, 'import os\n'), ((1076, 1089), 'pygame.init', 'pygame.init', ([], {...
vdbergh/pentanomial
sprt.py
d046e74acde3f961c7afd22fc4f82fa5aeb4c0fd
from __future__ import division import math, copy import argparse from brownian import Brownian import scipy import LLRcalc class sprt: def __init__(self, alpha=0.05, beta=0.05, elo0=0, elo1=5, elo_model="logistic"): assert elo_model in ("logistic", "normalized") self.elo_model = elo_model ...
[((4157, 4182), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (4180, 4182), False, 'import argparse\n'), ((330, 358), 'math.log', 'math.log', (['(beta / (1 - alpha))'], {}), '(beta / (1 - alpha))\n', (338, 358), False, 'import math, copy\n'), ((376, 404), 'math.log', 'math.log', (['((1 - beta)...
t3zeng/mynewt-nimble
tools/hci_throughput/hci.py
e910132947d6b3cd61ef4732867382634178aa08
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
[((3240, 3260), 'random.randint', 'random.randint', (['(0)', '(1)'], {}), '(0, 1)\n', (3254, 3260), False, 'import random\n'), ((11438, 11628), 'struct.pack', 'struct.pack', (['"""<HHBBBBB"""', 'advertising_interval_min', 'advertising_interval_max', 'advertising_type', 'own_address_type', 'peer_address_type', 'advertis...
populationgenomics/analysis-runner
examples/dataproc/query.py
f42bedb1dc430a813350fb4b5514bcc7b845f0fc
"""Simple Hail query example.""" import click import hail as hl from bokeh.io.export import get_screenshot_as_png from analysis_runner import output_path GNOMAD_HGDP_1KG_MT = ( 'gs://gcp-public-data--gnomad/release/3.1/mt/genomes/' 'gnomad.genomes.v3.1.hgdp_1kg_subset_dense.mt' ) @click.command() @click.op...
[((295, 310), 'click.command', 'click.command', ([], {}), '()\n', (308, 310), False, 'import click\n'), ((312, 397), 'click.option', 'click.option', (['"""--rerun"""'], {'help': '"""Whether to overwrite cached files"""', 'default': '(False)'}), "('--rerun', help='Whether to overwrite cached files', default=False\n )...
darkarnium/ptpip
ptpip/ptpip.py
c54eed4d7509ecfc6973a00496a9e80fb7473fa2
import uuid import time import socket import struct class PtpIpConnection(object): """docstring for PtpIP""" def __init__(self): super(PtpIpConnection, self).__init__() self.session = None self.session_events = None self.session_id = None self.cmd_queue = [] se...
[((6058, 6082), 'struct.unpack', 'struct.unpack', (['"""I"""', 'data'], {}), "('I', data)\n", (6071, 6082), False, 'import struct\n'), ((7677, 7696), 'struct.pack', 'struct.pack', (['"""I"""', '(1)'], {}), "('I', 1)\n", (7688, 7696), False, 'import struct\n'), ((7723, 7745), 'struct.pack', 'struct.pack', (['""">I"""', ...
jaideep-seth/PyOpenWorm
examples/morpho.py
c36baeda9590334ba810296934973da34f0eab78
""" How to load morphologies of certain cells from the database. """ #this is an expected failure right now, as morphology is not implemented from __future__ import absolute_import from __future__ import print_function import PyOpenWorm as P from PyOpenWorm.context import Context from PyOpenWorm.worm import Worm from ...
[((368, 393), 'PyOpenWorm.connect', 'P.connect', (['"""default.conf"""'], {}), "('default.conf')\n", (377, 393), True, 'import PyOpenWorm as P\n'), ((712, 722), 'six.StringIO', 'StringIO', ([], {}), '()\n', (720, 722), False, 'from six import StringIO\n'), ((413, 470), 'PyOpenWorm.context.Context', 'Context', ([], {'id...
kkrampa/commcare-hq
corehq/apps/app_manager/tests/test_form_workflow.py
d64d7cad98b240325ad669ccc7effb07721b4d44
from __future__ import absolute_import from __future__ import unicode_literals from django.test import SimpleTestCase from corehq.apps.app_manager.const import ( AUTO_SELECT_RAW, AUTO_SELECT_CASE, WORKFLOW_FORM, WORKFLOW_MODULE, WORKFLOW_PREVIOUS, WORKFLOW_ROOT, WORKFLOW_PARENT_MODULE, ) fr...
[((887, 920), 'corehq.apps.app_manager.tests.app_factory.AppFactory', 'AppFactory', ([], {'build_version': '"""2.9.0"""'}), "(build_version='2.9.0')\n", (897, 920), False, 'from corehq.apps.app_manager.tests.app_factory import AppFactory\n'), ((1383, 1416), 'corehq.apps.app_manager.tests.app_factory.AppFactory', 'AppFa...
sboshin/tensorflow
tensorflow/python/compiler/tensorrt/model_tests/model_handler.py
77689016fb4c1373abeca36360f7b2dd9434c547
# Copyright 2020 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
[((3602, 3623), 'functools.lru_cache', 'functools.lru_cache', ([], {}), '()\n', (3621, 3623), False, 'import functools\n'), ((4355, 4376), 'functools.lru_cache', 'functools.lru_cache', ([], {}), '()\n', (4374, 4376), False, 'import functools\n'), ((4806, 4892), 'collections.namedtuple', 'collections.namedtuple', (['"""...
arpitran/HackerRank_solutions
Python/Python Evaluation/solution.py
a3a77c858edd3955ea38530916db9051b1aa93f9
eval(input("Enter a expression "))
[]
syamkakarla98/Kernel-PCA-Using-Different-Kernels-With-Classification
kpca_iris.py
03302843bff9b0d87e2983bed1f37bc329e716c1
import numpy as np import matplotlib.pyplot as plt import pandas as pd # load dataset into Pandas DataFrame df = pd.read_csv("D:\Python_programs\ML\Iris Data\KPCA\iris.csv") #df.to_csv('iris.csv') from sklearn.preprocessing import StandardScaler features = ['sepal length', 'sepal width', 'petal length', 'petal width...
[((114, 179), 'pandas.read_csv', 'pd.read_csv', (['"""D:\\\\Python_programs\\\\ML\\\\Iris Data\\\\KPCA\\\\iris.csv"""'], {}), "('D:\\\\Python_programs\\\\ML\\\\Iris Data\\\\KPCA\\\\iris.csv')\n", (125, 179), True, 'import pandas as pd\n'), ((659, 706), 'sklearn.decomposition.KernelPCA', 'KernelPCA', ([], {'n_components...
felaray/Recognizers-Text
Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/dateperiod_extractor_config.py
f514fd61c8d472ed92565261162712409f655312
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. from typing import List, Pattern from recognizers_text.utilities import RegExpUtility from recognizers_number.number import BaseNumberParser from recognizers_number.number.italian.extractors import ItalianIntegerExtractor,...
[((5851, 5915), 'recognizers_text.utilities.RegExpUtility.get_safe_reg_exp', 'RegExpUtility.get_safe_reg_exp', (['ItalianDateTime.AllHalfYearRegex'], {}), '(ItalianDateTime.AllHalfYearRegex)\n', (5881, 5915), False, 'from recognizers_text.utilities import RegExpUtility\n'), ((5956, 6023), 'recognizers_text.utilities.Re...
danteay/pydbrepo
pydbrepo/drivers/sqlite.py
665ad5fe64a00697128f9943e0fc831ae485f136
"""SQLite Driver implementation.""" # pylint: disable=R0201 import os import sqlite3 from typing import Any, AnyStr, List, NoReturn, Optional, Tuple from pydbrepo.drivers.driver import Driver class SQLite(Driver): """SQLite Driver connection class. Environment variables: DATABASE_URL: Database fil...
[((1515, 1535), 'sqlite3.connect', 'sqlite3.connect', (['url'], {}), '(url)\n', (1530, 1535), False, 'import sqlite3\n'), ((1246, 1277), 'os.getenv', 'os.getenv', (['"""DATABASE_URL"""', 'None'], {}), "('DATABASE_URL', None)\n", (1255, 1277), False, 'import os\n'), ((1309, 1334), 'os.getenv', 'os.getenv', (['"""DATABAS...
EmilPi/PuzzleLib
Modules/BatchNormND.py
31aa0fab3b5e9472b9b9871ca52e4d94ea683fa9
import numpy as np from PuzzleLib import Config from PuzzleLib.Backend import gpuarray, Blas from PuzzleLib.Backend.Dnn import batchNormNd, batchNormNdBackward from PuzzleLib.Variable import Variable from PuzzleLib.Modules.Module import ModuleError, Module class BatchNormND(Module): def __init__(self, nd, maps, e...
[((1067, 1102), 'numpy.ones', 'np.ones', (['shape'], {'dtype': 'self.calctype'}), '(shape, dtype=self.calctype)\n', (1074, 1102), True, 'import numpy as np\n'), ((1936, 2037), 'PuzzleLib.Backend.Dnn.batchNormNdBackward', 'batchNormNdBackward', (['self.inData', 'grad', 'self.scale', 'self.savemean', 'self.saveinvvar', '...
jnthn/intellij-community
python/testData/editing/enterInIncompleteTupleLiteral.after.py
8fa7c8a3ace62400c838e0d5926a7be106aa8557
xs = ('foo', 'bar', 'baz'<caret>
[]
waltzofpearls/reckon
model/server/server.py
533e47fd05f685024083ce7a823e9c26c35dd824
from concurrent import futures from forecaster.prophet import Forecaster as ProphetForecaster from multiprocessing import Event, Process, cpu_count from pythonjsonlogger import jsonlogger import contextlib import grpc import logging import model.api.forecast_pb2_grpc as grpc_lib import os import signal import socket im...
[((5703, 5722), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (5720, 5722), False, 'import logging\n'), ((5741, 5774), 'logging.StreamHandler', 'logging.StreamHandler', (['sys.stdout'], {}), '(sys.stdout)\n', (5762, 5774), False, 'import logging\n'), ((5791, 5869), 'pythonjsonlogger.jsonlogger.JsonFormatt...
jhgoebbert/jupyter-libertem-proxy
test/test_setupcall.py
2f966744c08c14c534030c2623fe4a3a8590dabe
def test_setupcall(): """ Test the call of the setup function """ import jupyter_libertem_proxy as jx print("\nRunning test_setupcall...") print(jx.setup_libertem())
[((170, 189), 'jupyter_libertem_proxy.setup_libertem', 'jx.setup_libertem', ([], {}), '()\n', (187, 189), True, 'import jupyter_libertem_proxy as jx\n')]
LaudateCorpus1/launchpad
launchpad/launch/worker_manager.py
6068bbaff9da6d9d520c01314ef920d0d4978afc
# Copyright 2020 DeepMind Technologies Limited. 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 ...
[((1066, 1126), 'collections.namedtuple', 'collections.namedtuple', (['"""ThreadWorker"""', "['thread', 'future']"], {}), "('ThreadWorker', ['thread', 'future'])\n", (1088, 1126), False, 'import collections\n'), ((1147, 1164), 'threading.local', 'threading.local', ([], {}), '()\n', (1162, 1164), False, 'import threadin...