repo_name
stringlengths
7
94
repo_path
stringlengths
4
237
repo_head_hexsha
stringlengths
40
40
content
stringlengths
10
680k
apis
stringlengths
2
680k
anirudhbhashyam/911-Calls-Seattle-Predictions
src/train_nn.py
8c975ab6c6a85d514ad74388778e1b635ed3e63d
import os from typing import Union import tensorflow as tf import pandas as pd import numpy as np import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split, KFold import utility as ut from variables import * # Read the data. train_data = pd.read_csv(os.path.join(DATA_PATH, ".".join([DATA...
[((416, 435), 'numpy.ones', 'np.ones', (['Y.shape[0]'], {}), '(Y.shape[0])\n', (423, 435), True, 'import numpy as np\n'), ((825, 889), 'sklearn.model_selection.train_test_split', 'train_test_split', (['train_data', 'Y'], {'shuffle': '(True)', 'random_state': '(7919)'}), '(train_data, Y, shuffle=True, random_state=7919)...
Gustavo6046/polydung
pdserver/objects.py
e8626c67b0f59e00a2400b5a5c644e3f6b925e00
import base64 import random import string import netbyte import numpy as np try: import simplejson as json except ImportError: import json kinds = {} class PDObject(object): def __init__(self, game, kind, id, pos, properties): self.game = game self.kind = kind self.id = ...
[((437, 450), 'numpy.array', 'np.array', (['pos'], {}), '(pos)\n', (445, 450), True, 'import numpy as np\n'), ((865, 882), 'netbyte.Netbyte', 'netbyte.Netbyte', ([], {}), '()\n', (880, 882), False, 'import netbyte\n'), ((1442, 1456), 'json.loads', 'json.loads', (['js'], {}), '(js)\n', (1452, 1456), False, 'import json\...
EEdwardsA/DS-OOP-Review
football/football_test.py
2352866c5d0ea6a09802c29c17366450f35c75ae
import unittest from players import Player, Quarterback from possible_values import * from game import Game from random import randint, uniform, sample from season import * # TODO - some things you can add... class FootballGameTest(unittest.TestCase): '''test the class''' def test_field_goal_made(self): ...
[((1843, 1858), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1856, 1858), False, 'import unittest\n'), ((332, 355), 'random.sample', 'sample', (['team_names'], {'k': '(2)'}), '(team_names, k=2)\n', (338, 355), False, 'from random import randint, uniform, sample\n'), ((371, 388), 'game.Game', 'Game', ([], {'team...
shayanthrn/AGAIN-VC
preprocessor/base.py
41934f710d117d524b4a0bfdee7e9b845a56d422
import os import logging import numpy as np from tqdm import tqdm from functools import partial from multiprocessing.pool import ThreadPool import pyworld as pw from util.dsp import Dsp logger = logging.getLogger(__name__) def preprocess_one(input_items, module, output_path=''): input_path, basename = input_item...
[((197, 224), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (214, 224), False, 'import logging\n'), ((1582, 1604), 'util.dsp.Dsp', 'Dsp', (['config.feat[feat]'], {}), '(config.feat[feat])\n', (1585, 1604), False, 'from util.dsp import Dsp\n'), ((2074, 2105), 'os.path.join', 'os.path.join...
fjruizruano/SatIntExt
divsum_stats.py
90b39971ee6ea3d7cfa63fbb906df3df714a5012
#!/usr/bin/python import sys from subprocess import call print "divsum_count.py ListOfDivsumFiles\n" try: files = sys.argv[1] except: files = raw_input("Introduce RepeatMasker's list of Divsum files with library size (tab separated): ") files = open(files).readlines() to_join = [] header = "Coverage for ea...
[]
onyxfish/fever
agatecharts/charts/__init__.py
8aef0cd4adff7fdde1f5950ffb1d01db9137e3b7
#!/usr/bin/env python from agatecharts.charts.bars import Bars from agatecharts.charts.columns import Columns from agatecharts.charts.lines import Lines from agatecharts.charts.scatter import Scatter
[]
rossm6/accounts
users/views.py
74633ce4038806222048d85ef9dfe97a957a6a71
from django.contrib.auth import update_session_auth_hash from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.auth.models import User from django.contrib.auth.views import (LoginView, PasswordResetConfirmView, PasswordResetView) from django.http import Htt...
[((857, 892), 'django.urls.reverse_lazy', 'reverse_lazy', (['"""dashboard:dashboard"""'], {}), "('dashboard:dashboard')\n", (869, 892), False, 'from django.urls import reverse_lazy\n'), ((1134, 1163), 'django.urls.reverse_lazy', 'reverse_lazy', (['"""users:profile"""'], {}), "('users:profile')\n", (1146, 1163), False, ...
adidas/m3d-api
test/core/s3_table_test_base.py
755d676452e4b10075fa65f9acfdbf30a6ee828e
import os from test.core.emr_system_unit_test_base import EMRSystemUnitTestBase from test.core.tconx_helper import TconxHelper class S3TableTestBase(EMRSystemUnitTestBase): default_tconx = \ "test/resources/s3_table_test_base/tconx-bdp-emr_test-dev-bi_test101.json" multi_partition_tconx = \ ...
[((1988, 2181), 'test.core.tconx_helper.TconxHelper.setup_tconx_from_file', 'TconxHelper.setup_tconx_from_file', (["m3d_config_dict['tags']['config']", 'destination_system', 'destination_database', 'destination_environment', 'destination_table', 'S3TableTestBase.default_tconx'], {}), "(m3d_config_dict['tags']['config']...
BrianWaganerSTL/RocketDBaaS
metrics/serializers.py
d924589188411371842513060a5e08b1be3cdccf
from rest_framework import serializers from metrics.models import Metrics_Cpu, Metrics_PingServer, Metrics_MountPoint, \ Metrics_CpuLoad, Metrics_PingDb class Metrics_CpuSerializer(serializers.ModelSerializer): class Meta: model = Metrics_Cpu fields = '__all__' depth = 0 class Metrics...
[]
dmayle/rules_sqlc
sqlc/private/sqlc_toolchain.bzl
c465542827a086994e9427e2c792bbc4355c3e70
# Copyright 2020 Plezentek, Inc. All rights reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
[]
nolanzzz/mtmct
configs/tracker_configs/new_test_20e_cam_1_new_short.py
8bbbc7ff2fa53ab8af424feaac3cf7424b87fff0
root = { "general" : { "display_viewer" : False, #The visible GPUS will be restricted to the numbers listed here. The pytorch (cuda:0) numeration will start at 0 #This is a trick to get everything onto the wanted gpus because just setting cuda:4 in the function calls will #not work...
[]
cherub96/voc
tests/structures/test_generator.py
2692d56059e4d4a52768270feaf5179b23609b04
from ..utils import TranspileTestCase class GeneratorTests(TranspileTestCase): def test_simple_generator(self): self.assertCodeExecution(""" def multiplier(first, second): y = first * second yield y y *= second yield y ...
[]
hdoupe/OG-USA
ogusa/tax.py
f7e4d600b7a2993c7d1b53e23bfe29cfccaea770
''' ------------------------------------------------------------------------ Functions for taxes in the steady state and along the transition path. ------------------------------------------------------------------------ ''' # Packages import numpy as np from ogusa import utils ''' -----------------------------------...
[((1684, 1698), 'numpy.zeros', 'np.zeros', (['dim2'], {}), '(dim2)\n', (1692, 1698), True, 'import numpy as np\n'), ((17058, 17074), 'numpy.zeros_like', 'np.zeros_like', (['n'], {}), '(n)\n', (17071, 17074), True, 'import numpy as np\n'), ((4703, 4733), 'numpy.squeeze', 'np.squeeze', (['etr_params[..., 0]'], {}), '(etr...
baireutherjonas/muse-for-anything
muse_for_anything/api/v1_api/taxonomy_items.py
a625b4fc6468d74fa12886dc465d5694eed86e04
"""Module containing the taxonomy items API endpoints of the v1 API.""" from datetime import datetime from sqlalchemy.sql.schema import Sequence from muse_for_anything.db.models.taxonomies import ( Taxonomy, TaxonomyItem, TaxonomyItemRelation, TaxonomyItemVersion, ) from marshmallow.utils import INCL...
[((22415, 22530), 'muse_for_anything.db.models.taxonomies.TaxonomyItemRelation', 'TaxonomyItemRelation', ([], {'taxonomy_item_source': 'found_taxonomy_item', 'taxonomy_item_target': 'found_taxonomy_item_target'}), '(taxonomy_item_source=found_taxonomy_item,\n taxonomy_item_target=found_taxonomy_item_target)\n', (224...
shijiale0609/Python_Data_Analysis
PythonDAdata/3358OS_06_Code/code6/pd_plotting.py
c18b5ed006c171bbb6fcb6be5f51b2686edc8f7e
import matplotlib.pyplot as plt import numpy as np import pandas as pd df = pd.read_csv('transcount.csv') df = df.groupby('year').aggregate(np.mean) gpu = pd.read_csv('gpu_transcount.csv') gpu = gpu.groupby('year').aggregate(np.mean) df = pd.merge(df, gpu, how='outer', left_index=True, right_index=True) df = df.rep...
[((78, 107), 'pandas.read_csv', 'pd.read_csv', (['"""transcount.csv"""'], {}), "('transcount.csv')\n", (89, 107), True, 'import pandas as pd\n'), ((158, 191), 'pandas.read_csv', 'pd.read_csv', (['"""gpu_transcount.csv"""'], {}), "('gpu_transcount.csv')\n", (169, 191), True, 'import pandas as pd\n'), ((243, 308), 'panda...
JakubGutowski/PersonalBlog
source/blog/migrations/0004_postcomments.py
96122b36486f7e874c013e50d939732a43db309f
# Generated by Django 2.0.5 on 2018-07-02 19:46 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('blog', '0003_blogpost_author'), ] operations = [ migrations.CreateModel( name='Po...
[((379, 472), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (395, 472), False, 'from django.db import migrations, models\...
m-star18/atcoder
submissions/aising2019/a.py
08e475810516602fa088f87daf1eba590b4e07cc
import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines sys.setrecursionlimit(10 ** 7) n = int(readline()) h = int(readline()) w = int(readline()) print((n - h + 1) * (n - w + 1))
[((116, 146), 'sys.setrecursionlimit', 'sys.setrecursionlimit', (['(10 ** 7)'], {}), '(10 ** 7)\n', (137, 146), False, 'import sys\n')]
yoyoberenguer/MultiplayerGameEngine
CreateHalo.py
1d1a4c0ab40d636322c4e3299cbc84fb57965b31
import pygame from NetworkBroadcast import Broadcast, AnimatedSprite, DeleteSpriteCommand from Textures import HALO_SPRITE12, HALO_SPRITE14, HALO_SPRITE13 __author__ = "Yoann Berenguer" __credits__ = ["Yoann Berenguer"] __version__ = "1.0.0" __maintainer__ = "Yoann Berenguer" __email__ = "yoyoberenguer@hotma...
[((527, 579), 'pygame.sprite.Sprite.__init__', 'pygame.sprite.Sprite.__init__', (['self', 'self.containers'], {}), '(self, self.containers)\n', (556, 579), False, 'import pygame\n'), ((1385, 1546), 'NetworkBroadcast.AnimatedSprite', 'AnimatedSprite', ([], {'frame_': 'self.gl.FRAME', 'id_': 'self.id_', 'surface_': 'self...
ShizhuZhang/ontask_b
src/dataops/pandas_db.py
acbf05ff9b18dae0a41c67d1e41774e54a890c40
# -*- coding: utf-8 -*- from __future__ import unicode_literals, print_function import logging import os.path import subprocess from collections import OrderedDict from itertools import izip import numpy as np import pandas as pd from django.conf import settings from django.core.cache import cache from django.db impo...
[((777, 804), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (794, 804), False, 'import logging\n'), ((2261, 2321), 'sqlalchemy.create_engine', 'create_engine', (['database_url'], {'echo': '(False)', 'paramstyle': '"""format"""'}), "(database_url, echo=False, paramstyle='format')\n", (227...
rbsdev/config-client
config/cf.py
761f39cd8839daba10bf21b98ccdd44d33eaebe8
from typing import Any, Dict, KeysView import attr from config.auth import OAuth2 from config.cfenv import CFenv from config.spring import ConfigClient @attr.s(slots=True) class CF: cfenv = attr.ib( type=CFenv, factory=CFenv, validator=attr.validators.instance_of(CFenv), ) oauth2 = attr.ib(type=...
[((157, 175), 'attr.s', 'attr.s', ([], {'slots': '(True)'}), '(slots=True)\n', (163, 175), False, 'import attr\n'), ((307, 341), 'attr.ib', 'attr.ib', ([], {'type': 'OAuth2', 'default': 'None'}), '(type=OAuth2, default=None)\n', (314, 341), False, 'import attr\n'), ((355, 395), 'attr.ib', 'attr.ib', ([], {'type': 'Conf...
rancp/ducktape-docs
ducktape/template.py
e1a3b1b7e68beedf5f8d29a4e5f196912a20e264
# Copyright 2015 Confluent 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, s...
[((1167, 1185), 'jinja2.Template', 'Template', (['template'], {}), '(template)\n', (1175, 1185), False, 'from jinja2 import Template, FileSystemLoader, PackageLoader, ChoiceLoader, Environment\n'), ((3200, 3229), 'ducktape.utils.util.package_is_installed', 'package_is_installed', (['package'], {}), '(package)\n', (3220...
AkshayManchanda/Python_Training
day4/homework/q7.py
5a50472d118ac6d40145bf1dd60f26864bf9fb6c
i=input("Enter a string: ") list = i.split() list.sort() for i in list: print(i,end=' ')
[]
staticdev/github-portfolio
src/git_portfolio/use_cases/config_repos.py
850461eed8160e046ee16664ac3dbc19e3ec0965
"""Config repositories use case.""" from __future__ import annotations import git_portfolio.config_manager as cm import git_portfolio.domain.gh_connection_settings as cs import git_portfolio.responses as res class ConfigReposUseCase: """Gitp config repositories use case.""" def __init__(self, config_manager...
[((882, 947), 'git_portfolio.responses.ResponseSuccess', 'res.ResponseSuccess', (['"""gitp repositories successfully configured."""'], {}), "('gitp repositories successfully configured.')\n", (901, 947), True, 'import git_portfolio.responses as res\n')]
mateuszkowalke/sudoku_game
test/test_logic.py
800e33a6fe755b493d8e9c3c9a20204af5865148
import pytest from ..logic import Board, empty_board, example_board, solved_board class TestBoard: def test_create_board(self): board = Board(example_board) assert board.tiles == example_board def test_solve_board(self): board = Board(example_board) board.solve() asse...
[]
jf---/compas
src/compas_rhino/objects/_select.py
cd878ece933013b8ac34e9d42cf6d5c62a5396ee
from __future__ import print_function from __future__ import absolute_import from __future__ import division import ast import rhinoscriptsyntax as rs __all__ = [ 'mesh_select_vertex', 'mesh_select_vertices', 'mesh_select_face', 'mesh_select_faces', 'mesh_select_edge', 'mesh_select_edges', ...
[((695, 781), 'rhinoscriptsyntax.GetObject', 'rs.GetObject', (['message'], {'preselect': '(True)', 'filter': '(rs.filter.point | rs.filter.textdot)'}), '(message, preselect=True, filter=rs.filter.point | rs.filter.\n textdot)\n', (707, 781), True, 'import rhinoscriptsyntax as rs\n'), ((1327, 1414), 'rhinoscriptsynta...
MuchkoM/CalorieMatchBot
handlers/product_add.py
ca26a1f6195079e10dd798ca9e77968438f2aa01
from telegram import Update from telegram.ext import Updater, CallbackContext, ConversationHandler, CommandHandler, MessageHandler, Filters from db import DBConnector import re str_matcher = r"\"(?P<name>.+)\"\s*(?P<fat>\d+)\s*/\s*(?P<protein>\d+)\s*/\s*(?P<carbohydrates>\d+)\s*(?P<kcal>\d+)" ADD_1 = 0 def add_0(...
[((636, 678), 're.match', 're.match', (['str_matcher', 'update.message.text'], {}), '(str_matcher, update.message.text)\n', (644, 678), False, 'import re\n'), ((1087, 1123), 'telegram.ext.CommandHandler', 'CommandHandler', (['"""product_add"""', 'add_0'], {}), "('product_add', add_0)\n", (1101, 1123), False, 'from tele...
rajegannathan/grasp-lift-eeg-cat-dog-solution-updated
python-packages/nolearn-0.5/build/lib.linux-x86_64-2.7/nolearn/tests/test_dataset.py
ee45bee6f96cdb6d91184abc16f41bba1546c943
from mock import patch import numpy as np def test_dataset_simple(): from ..dataset import Dataset data = object() target = object() dataset = Dataset(data, target) assert dataset.data is data assert dataset.target is target @patch('nolearn.dataset.np.load') def test_dataset_with_filenames(...
[((255, 287), 'mock.patch', 'patch', (['"""nolearn.dataset.np.load"""'], {}), "('nolearn.dataset.np.load')\n", (260, 287), False, 'from mock import patch\n'), ((610, 624), 'numpy.arange', 'np.arange', (['(100)'], {}), '(100)\n', (619, 624), True, 'import numpy as np\n'), ((638, 667), 'numpy.array', 'np.array', (['([0] ...
EpicTofuu/Assignment
src/Cipher/MultiLevelCaesarDecrypt.py
293f99d20e8fa7d688c16a56c48a554bcd3c9e7d
import Cipher.tk from Cipher.tk import EncryptDecryptCoord, GetChiSquared, Mode def MultiDecrypt (message, alphabet, usables = 3, lan = "English", transformations = [], lowestchi = 9999, ogMessage = ""): msg = "" prev = (9999, (0, 0)) # (chi, key) for i in range (len(message)): ...
[((1013, 1074), 'Cipher.tk.EncryptDecryptCoord', 'EncryptDecryptCoord', (['message', 'prev[1]', 'alphabet', 'Mode.DECRYPT'], {}), '(message, prev[1], alphabet, Mode.DECRYPT)\n', (1032, 1074), False, 'from Cipher.tk import EncryptDecryptCoord, GetChiSquared, Mode\n'), ((378, 438), 'Cipher.tk.EncryptDecryptCoord', 'Encry...
bunop/cyvcf
scripts/vcf_filter.py
f58860dd06b215b9d9ae80e2b46337fb6ab59139
#!/usr/bin/env python import sys import argparse import pkg_resources import vcf from vcf.parser import _Filter parser = argparse.ArgumentParser(description='Filter a VCF file', formatter_class=argparse.RawDescriptionHelpFormatter, ) parser.add_argument('input', metavar='input', type=str, nargs=1, ...
[((123, 238), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Filter a VCF file"""', 'formatter_class': 'argparse.RawDescriptionHelpFormatter'}), "(description='Filter a VCF file', formatter_class=\n argparse.RawDescriptionHelpFormatter)\n", (146, 238), False, 'import argparse\n'), ((1...
Muxelmann/home-projects
src/flocker/blueprints/red/__init__.py
85bd06873174b9c5c6276160988c19b460370db8
import os from flask import Blueprint, render_template def create_bp(): bp_red = Blueprint('red', __name__, url_prefix='/red') @bp_red.route('/index/') @bp_red.route('/') def index(): return render_template('red/index.html') return bp_red
[((86, 131), 'flask.Blueprint', 'Blueprint', (['"""red"""', '__name__'], {'url_prefix': '"""/red"""'}), "('red', __name__, url_prefix='/red')\n", (95, 131), False, 'from flask import Blueprint, render_template\n'), ((217, 250), 'flask.render_template', 'render_template', (['"""red/index.html"""'], {}), "('red/index.htm...
whoiscc/alphacoders
alphacoders/__init__.py
685d1e7e02a7276ae0518114b0c6aab58914aab7
# from aiohttp.client_exceptions import ClientError from lxml import html from pathlib import Path from asyncio import create_task from functools import wraps def start_immediately(task): @wraps(task) def wrapper(*args, **kwargs): return create_task(task(*args, **kwargs)) return wrapper @start...
[((196, 207), 'functools.wraps', 'wraps', (['task'], {}), '(task)\n', (201, 207), False, 'from functools import wraps\n'), ((2268, 2291), 'lxml.html.fromstring', 'html.fromstring', (['detail'], {}), '(detail)\n', (2283, 2291), False, 'from lxml import html\n'), ((1762, 1785), 'lxml.html.fromstring', 'html.fromstring', ...
PeriscopeData/analytics-toolbox
Python/Calculating_Trimmed_Means/calculating_trimmed_means1.py
83effdee380c33e5eecea29528acf5375fd496fb
# SQL output is imported as a pandas dataframe variable called "df" # Source: https://stackoverflow.com/questions/19441730/trimmed-mean-with-percentage-limit-in-python import pandas as pd import matplotlib.pyplot as plt from scipy.stats import tmean, scoreatpercentile import numpy as np def trimmean(arr, percent): ...
[((337, 368), 'scipy.stats.scoreatpercentile', 'scoreatpercentile', (['arr', 'percent'], {}), '(arr, percent)\n', (354, 368), False, 'from scipy.stats import tmean, scoreatpercentile\n'), ((387, 424), 'scipy.stats.scoreatpercentile', 'scoreatpercentile', (['arr', '(100 - percent)'], {}), '(arr, 100 - percent)\n', (404,...
amichalski2/WBC-SHAP
scripts/data_extract.py
b69a4a8746aaf7a8dfacfdb4dbd85b4868d73ad0
import os import cv2 import random import numpy as np from tensorflow.keras.utils import to_categorical from scripts.consts import class_dict def get_data(path, split=0.2): X, y = [], [] for directory in os.listdir(path): dirpath = os.path.join(path, directory) print(directory, len(os.listd...
[((216, 232), 'os.listdir', 'os.listdir', (['path'], {}), '(path)\n', (226, 232), False, 'import os\n'), ((716, 736), 'random.shuffle', 'random.shuffle', (['data'], {}), '(data)\n', (730, 736), False, 'import random\n'), ((253, 282), 'os.path.join', 'os.path.join', (['path', 'directory'], {}), '(path, directory)\n', (2...
tzumainn/ironic
ironic/tests/unit/drivers/test_base.py
91680bd450a4b2259d153b6a995a9436a5f82694
# Copyright 2014 Cisco Systems, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
[((985, 1015), 'ironic.drivers.base.passthru', 'driver_base.passthru', (["['POST']"], {}), "(['POST'])\n", (1005, 1015), True, 'from ironic.drivers import base as driver_base\n'), ((1071, 1108), 'ironic.drivers.base.driver_passthru', 'driver_base.driver_passthru', (["['POST']"], {}), "(['POST'])\n", (1098, 1108), True,...
valerymelou/opentimesheet-server
opentimesheet/profiles/tests/test_models.py
0da97ebb3c3e59962132d1bc5e83e1d727f7331b
import pytest from opentimesheet.core.tests import TenantTestCase @pytest.mark.usefixtures("profile") class TestProfile(TenantTestCase): def test__str__(self): assert ( self.profile.first_name + " " + self.profile.last_name == self.profile.__str__() )
[((70, 104), 'pytest.mark.usefixtures', 'pytest.mark.usefixtures', (['"""profile"""'], {}), "('profile')\n", (93, 104), False, 'import pytest\n')]
chuckie82/ami
ami/flowchart/library/Display.py
7adb72c709afe4c1af53ef7f0d2b0e3639c63bf3
from ami.flowchart.library.DisplayWidgets import ScalarWidget, ScatterWidget, WaveformWidget, \ ImageWidget, ObjectWidget, LineWidget, TimeWidget, HistogramWidget, \ Histogram2DWidget from ami.flowchart.library.common import CtrlNode from amitypes import Array1d, Array2d from typing import Any import ami.graph_...
[]
ShujaKhalid/deep-rl
deep-rl/lib/python2.7/site-packages/OpenGL/GL/ARB/transform_feedback_instanced.py
99c6ba6c3095d1bfdab81bd01395ced96bddd611
'''OpenGL extension ARB.transform_feedback_instanced This module customises the behaviour of the OpenGL.raw.GL.ARB.transform_feedback_instanced to provide a more Python-friendly API Overview (from the spec) Multiple instances of geometry may be specified to the GL by calling functions such as DrawArraysInstance...
[((1359, 1401), 'OpenGL.extensions.hasGLExtension', 'extensions.hasGLExtension', (['_EXTENSION_NAME'], {}), '(_EXTENSION_NAME)\n', (1384, 1401), False, 'from OpenGL import extensions\n')]
xbabka01/retdec-regression-tests
features/cpp/simple/test.py
1ac40cca5165740364e6f7fb72b20820eac9bc7c
from regression_tests import * class TestBase(Test): def test_for_main(self): assert self.out_c.has_funcs('main') or self.out_c.has_funcs('entry_point') def test_check_main_is_not_ctor_or_dtor(self): for c in self.out_config.classes: assert "main" not in c.constructors ...
[]
windar427/find_alpha
src/experiment.py
dbca4e677c6cdc144f20f6259c07291b5d3e6eed
from .lib.DownloadData import DownloadData
[]
songchenwen/icloud-drive-docker
src/__init__.py
7188dfbcc34e29ddbeeb1324c62ea77bed8f0576
__author__ = 'Mandar Patil (mandarons@pm.me)' import warnings warnings.filterwarnings('ignore', category=DeprecationWarning)
[((64, 126), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {'category': 'DeprecationWarning'}), "('ignore', category=DeprecationWarning)\n", (87, 126), False, 'import warnings\n')]
rafael-torraca/delivery
test_basico.py
298db3c5d74938dc34687e7b65ee72a847e4deeb
def test_one_plus_one_is_two(): assert 1 + 1 == 2 #o assert espera que algo seja verdadeiro, se for falso o teste quebrou def test_negative_1_plus_1_is_3(): assert 1 + 1 == 3
[]
rohernandezz/coldtype
setup.py
724234fce454699a469d17b6c78ae50fa8138169
import setuptools long_description = """ # Coldtype ### Programmatic display typography More info available at: [coldtype.goodhertz.com](https://coldtype.goodhertz.com) """ setuptools.setup( name="coldtype", version="0.6.6", author="Rob Stenson / Goodhertz", author_email="rob@goodhertz.com", des...
[((177, 2174), 'setuptools.setup', 'setuptools.setup', ([], {'name': '"""coldtype"""', 'version': '"""0.6.6"""', 'author': '"""Rob Stenson / Goodhertz"""', 'author_email': '"""rob@goodhertz.com"""', 'description': '"""Functions for manual vectorized typesetting"""', 'long_description': 'long_description', 'long_descrip...
xdedss/SuccessiveConvexification
GFOLD_problem.py
8b330b64a31f546ce92c1e34036c212484cbae5e
# -*- coding: utf-8 -*- # GFOLD_static_p3p4 min_=min from cvxpy import * import cvxpy_codegen as cpg from time import time import numpy as np import sys import GFOLD_params ''' As defined in the paper... PROBLEM 3: Minimum Landing Error (tf roughly solved) MINIMIZE : norm of landing error vector SUBJ TO : ...
[((1050, 1076), 'GFOLD_params.SuperParams', 'GFOLD_params.SuperParams', ([], {}), '()\n', (1074, 1076), False, 'import GFOLD_params\n'), ((4489, 4523), 'cvxpy_codegen.codegen', 'cpg.codegen', (['problem', 'codegen_path'], {}), '(problem, codegen_path)\n', (4500, 4523), True, 'import cvxpy_codegen as cpg\n'), ((2230, 23...
SarienFates/MMRandomizer
Hints.py
7c677140d83e94167fecee35e8c25216a51bdd56
import io import hashlib import logging import os import struct import random from HintList import getHint, getHintGroup, Hint from Utils import local_path #builds out general hints based on location and whether an item is required or not def buildGossipHints(world, rom): stoneAddresses = [0x938e4c, 0...
[((780, 810), 'HintList.getHintGroup', 'getHintGroup', (['"""alwaysLocation"""'], {}), "('alwaysLocation')\n", (792, 810), False, 'from HintList import getHint, getHintGroup, Hint\n'), ((984, 1008), 'HintList.getHintGroup', 'getHintGroup', (['"""location"""'], {}), "('location')\n", (996, 1008), False, 'from HintList i...
Jhoselyn-Carballo/computacion_para_ingenieria
examen_2/p2/p2.py
4b5ed7d4aa0017fb4993ccfdcc9fcef0fb5b3898
# -*- coding: utf-8 -*- """ Created on Thu Feb 17 09:10:05 2022 @author: JHOSS """ from tkinter import * def contador(accion, contador): if accion == 'countUp': contador == contador + 1 elif accion == 'coundDown': contador == contador -1 elif accion == 'reset': contador == 0 return contador
[]
ndepal/bokeh
bokeh/models/tests/test_callbacks.py
1b514f28fe40eeb71954eac0c113b2debdb2eda9
from pytest import raises from bokeh.models import CustomJS, Slider def test_js_callback(): slider = Slider() cb = CustomJS(code="foo();", args=dict(x=slider)) assert 'foo()' in cb.code assert cb.args['x'] is slider cb = CustomJS(code="foo();", args=dict(x=3)) assert 'foo()' in cb.code a...
[((107, 115), 'bokeh.models.Slider', 'Slider', ([], {}), '()\n', (113, 115), False, 'from bokeh.models import CustomJS, Slider\n'), ((483, 491), 'bokeh.models.Slider', 'Slider', ([], {}), '()\n', (489, 491), False, 'from bokeh.models import CustomJS, Slider\n'), ((570, 595), 'bokeh.models.CustomJS.from_py_func', 'Custo...
martindurant/awkward-1.0
tests/test_0150-attributeerrors.py
a3221ee1bab6551dd01d5dd07a1d2dc24fd02c38
# BSD 3-Clause License; see https://github.com/jpivarski/awkward-1.0/blob/master/LICENSE from __future__ import absolute_import import sys import pytest import numpy import awkward1 class Dummy(awkward1.Record): @property def broken(self): raise AttributeError("I'm broken!") def test(): behavi...
[((371, 436), 'awkward1.Array', 'awkward1.Array', (["[{'x': 1}, {'x': 2}, {'x': 3}]"], {'behavior': 'behavior'}), "([{'x': 1}, {'x': 2}, {'x': 3}], behavior=behavior)\n", (385, 436), False, 'import awkward1\n'), ((500, 529), 'pytest.raises', 'pytest.raises', (['AttributeError'], {}), '(AttributeError)\n', (513, 529), F...
umd-lib/solr-irroc
scripts/preprocess.py
860be84ea1847cbb96c1a7a70b03f59dc6e0366b
#!/user/bin/env python3 # -*- coding: utf8 -*- #===================================================# # cleanup.py # # Joshua Westgard # # 2015-08-13 # # # #...
[]
appressoas/ievv_opensource
ievv_opensource/demo/batchframeworkdemo/apps.py
63e87827952ddc8f6f86145b79478ef21d6a0990
from django.apps import AppConfig from ievv_opensource import ievv_batchframework from ievv_opensource.ievv_batchframework import batchregistry class HelloWorldAction(ievv_batchframework.Action): def execute(self): self.logger.info('Hello world! %r', self.kwargs) class HelloWorldAsyncAction(ievv_batchf...
[((695, 840), 'ievv_opensource.ievv_batchframework.batchregistry.ActionGroup', 'batchregistry.ActionGroup', ([], {'name': '"""batchframeworkdemo_helloworld"""', 'mode': 'batchregistry.ActionGroup.MODE_SYNCHRONOUS', 'actions': '[HelloWorldAction]'}), "(name='batchframeworkdemo_helloworld', mode=\n batchregistry.Actio...
GODVIX/fastmoe
fmoe/gates/utils.py
7f6463f0367205a1e95139c6d7e930be6e7fa746
r""" Utilities that may be used in the gates """ import torch from fmoe.functions import count_by_gate import fmoe_cuda as fmoe_native def limit_by_capacity(topk_idx, num_expert, world_size, capacity): capacity = torch.ones(num_expert, dtype=torch.int32, device=topk_idx.device) * capacity pos, le...
[((329, 395), 'fmoe.functions.count_by_gate', 'count_by_gate', (['topk_idx', 'num_expert', 'world_size'], {'require_pos': '(False)'}), '(topk_idx, num_expert, world_size, require_pos=False)\n', (342, 395), False, 'from fmoe.functions import count_by_gate\n'), ((423, 491), 'fmoe_cuda.limit_by_capacity', 'fmoe_native.lim...
DeppMeng/DANNet
evaluate.py
831eb70d44a4a0b6f6f57ca2014521fc64d1906c
import os import torch import numpy as np from PIL import Image import torch.nn as nn from torch.utils import data from network import * from dataset.zurich_night_dataset import zurich_night_DataSet from configs.test_config import get_arguments palette = [128, 64, 128, 244, 35, 232, 70, 70, 70, 102, 102, 156, 190, ...
[((831, 851), 'torch.device', 'torch.device', (['"""cuda"""'], {}), "('cuda')\n", (843, 851), False, 'import torch\n'), ((865, 880), 'configs.test_config.get_arguments', 'get_arguments', ([], {}), '()\n', (878, 880), False, 'from configs.test_config import get_arguments\n'), ((1251, 1280), 'torch.load', 'torch.load', (...
zengboming/python
decorator.py
13018f476554adc3bff831af27c08f7c216d4b09
#decorator def now(): print "2015-11-18" f=now f() print now.__name__ print f.__name__ def log(func): def wrapper(*args,**kw): print 'begin call %s():' %func.__name__ func(*args,**kw) print 'end call %s():' %func.__name__ return wrapper @log def now1(): print now1.__name__ now1() now1=log(now1) now1() def...
[]
compgeomTU/frechetForCurves
test/pyfrechet_visualize.py
625bfe32a45d23b194226b4ac7713ded09bd2825
# Author: Will Rodman # wrodman@tulane.edu # # Command line to run program: # python3 pyfrechet_visualize.py import sys, os, unittest sys.path.insert(0, "../") from pyfrechet.distance import StrongDistance from pyfrechet.visualize import FreeSpaceDiagram, Trajectories TEST_DATA = "sp500" if TEST_DATA == "sp500": ...
[((135, 160), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""../"""'], {}), "(0, '../')\n", (150, 160), False, 'import sys, os, unittest\n'), ((2074, 2089), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2087, 2089), False, 'import sys, os, unittest\n'), ((1017, 1074), 'pyfrechet.distance.StrongDistance.setCu...
nww2007/py_ser_freeastro
py_ser_freeastro/core.py
5806cf83316f48a6db0abe4a88e4485fc04a1b4d
#!/usr/bin/env python3 # vim:fileencoding=UTF-8 # -*- coding: UTF-8 -*- """ Created on 15 juny 2019 y. @author: Vlsdimir Nekrasov nww2007@mail.ru """ import sys import struct import numpy as np from progress.bar import Bar import logging logging.basicConfig(format = u'%(filename)s:%(lineno)d: %(levelname)-8s [%(asc...
[((242, 388), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': 'u"""%(filename)s:%(lineno)d: %(levelname)-8s [%(asctime)s] %(message)s"""', 'level': 'logging.DEBUG', 'stream': 'sys.stdout'}), "(format=\n u'%(filename)s:%(lineno)d: %(levelname)-8s [%(asctime)s] %(message)s',\n level=logging.DEBUG, str...
humeniuka/sGDML_dataset_generation
sgdml_dataset_generation/readers/fchk.py
a99f792b6aac7ff869ebcd1bd7a7226ca81f43ee
#!/usr/bin/env python # -*- coding: utf-8 -*- __all__ = ["FormattedCheckpointFile"] # # Imports import numpy as np import scipy.linalg as sla from collections import OrderedDict import re import logging # # Local Imports from sgdml_dataset_generation import units from sgdml_dataset_generation.units import hbar # # L...
[((336, 363), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (353, 363), False, 'import logging\n'), ((364, 441), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""[%(module)-12s] %(message)s"""', 'level': 'logging.INFO'}), "(format='[%(module)-12s] %(message)s', level=log...
94JuHo/Algorithm_study
2020_01_01/max_values/max_values.py
e2c10ec680d966e5bcc4e7cb88d9514f9ccbbf15
values = [] for i in range(9): values.append(int(input(''))) max_value = 0 location = 0 for i in range(9): if values[i] > max_value: max_value = values[i] location = i+1 print(max_value) print(location)
[]
rhasspy/fuzzywuzzy
fuzzywuzzy/process.py
e5b486c756b392481ec8e1382eedce280e56fd69
#!/usr/bin/env python # encoding: utf-8 """ process.py Copyright (c) 2011 Adam Cohen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights t...
[((2119, 2139), 'utils.asciidammit', 'utils.asciidammit', (['x'], {}), '(x)\n', (2136, 2139), False, 'import utils\n')]
robfalck/AoC2017
day03/day03.py
fa19f3fb42d979b60888a1954bea571c9d4ee735
from __future__ import print_function, division, absolute_import import numpy as np INPUT = 265149 def part1(number): skip = 2 d = 1 row = None col = None for shell_idx in range(1, 10000): size = shell_idx * 2 + 1 a = d + skip b = a + skip c = b + skip d ...
[((1037, 1066), 'numpy.zeros', 'np.zeros', (['(11, 11)'], {'dtype': 'int'}), '((11, 11), dtype=int)\n', (1045, 1066), True, 'import numpy as np\n')]
codefair114/Inventory-App-Django
core/migrations/0004_auto_20210929_2354.py
f09f43ca282f82be981cac26a92d614fdf2ff5ef
# Generated by Django 3.2.7 on 2021-09-29 23:54 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('core', '0003_auto_20210929_2353'), ] operations = [ migrations.AlterField( model_name='order', ...
[((365, 465), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'null': '(True)', 'on_delete': 'django.db.models.deletion.CASCADE', 'to': '"""core.orderclient"""'}), "(null=True, on_delete=django.db.models.deletion.CASCADE,\n to='core.orderclient')\n", (382, 465), False, 'from django.db import migrations, mo...
bopopescu/nova-token
nova/api/openstack/compute/legacy_v2/contrib/console_auth_tokens.py
ec98f69dea7b3e2b9013b27fd55a2c1a1ac6bfb2
begin_unit comment|'# Copyright 2013 Cloudbase Solutions Srl' nl|'\n' comment|'# All Rights Reserved.' nl|'\n' comment|'#' nl|'\n' comment|'# Licensed under the Apache License, Version 2.0 (the "License"); you may' nl|'\n' comment|'# not use this file except in compliance with the License. You may obtain' nl|'\n'...
[]
jaluebbe/ahrs
ahrs/common/geometry.py
4b4a33b1006e0d455a71ac8379a2697202361758
# -*- coding: utf-8 -*- """ Geometrical functions --------------------- References ---------- .. [W1] Wikipedia: https://de.wikipedia.org/wiki/Ellipse#Ellipsengleichung_(Parameterform) .. [WAE] Wolfram Alpha: Ellipse. (http://mathworld.wolfram.com/Ellipse.html) """ import numpy as np from typing import Union def ci...
[((785, 830), 'numpy.linspace', 'np.linspace', (['(0.0)', '(2.0 * np.pi)', '(num_points + 1)'], {}), '(0.0, 2.0 * np.pi, num_points + 1)\n', (796, 830), True, 'import numpy as np\n'), ((1563, 1608), 'numpy.linspace', 'np.linspace', (['(0.0)', '(2.0 * np.pi)', '(num_points + 1)'], {}), '(0.0, 2.0 * np.pi, num_points + 1...
jamayfieldjr/iem
htdocs/plotting/auto/scripts100/p116.py
275b77a65f3b12e26e6cbdb230786b9c7d2b9c9a
"""Monthly HDD/CDD Totals.""" import datetime from pandas.io.sql import read_sql from pyiem.plot.use_agg import plt from pyiem.util import get_dbconn, get_autoplot_context from pyiem.exceptions import NoDataFound PDICT = {'cdd': 'Cooling Degree Days', 'hdd': 'Heating Degree Days'} def get_description(): ...
[((1275, 1293), 'pyiem.util.get_dbconn', 'get_dbconn', (['"""coop"""'], {}), "('coop')\n", (1285, 1293), False, 'from pyiem.util import get_dbconn, get_autoplot_context\n'), ((1403, 1960), 'pandas.io.sql.read_sql', 'read_sql', (['(\n """\n SELECT year, month, sum(precip) as sum_precip,\n avg(high) as a...
krfricke/ray_shuffling_data_loader
examples/horovod/ray_torch_shuffle.py
b238871d45218c655cd0fcd78b8bf2a3940087f9
import os import pickle import time import timeit import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import numpy as np import torch import tempfile import horovod.torch as hvd from horovod.ray import RayExecutor from ray_shuffling_data_loader.torch_dataset import (TorchShufflingDatase...
[((922, 982), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""PyTorch MNIST Example"""'}), "(description='PyTorch MNIST Example')\n", (945, 982), False, 'import argparse\n'), ((4215, 4225), 'horovod.torch.init', 'hvd.init', ([], {}), '()\n', (4223, 4225), True, 'import horovod.torch as hv...
PitonX60/django-firebird
tests/test_main/test_base/tests.py
407bd5916a8ae37184d06adb3b943d6bb4f7076f
# -*- coding: utf-8 -*- from datetime import datetime, timedelta from django.conf import settings from django.db import connection, DatabaseError from django.db.models import F, DateField, DateTimeField, IntegerField, TimeField, CASCADE from django.db.models.fields.related import ForeignKey from django.db.models.func...
[((7508, 7539), 'django.test.override_settings', 'override_settings', ([], {'USE_TZ': '(False)'}), '(USE_TZ=False)\n', (7525, 7539), False, 'from django.test import TestCase, TransactionTestCase, override_settings\n'), ((6230, 6264), 'django.db.models.fields.related.ForeignKey', 'ForeignKey', (['Foo'], {'on_delete': 'C...
justinbois/eqtk
tests/test_past_failures.py
7363b8c09e35088d2cb2cb5a62d315b52cce0d9b
import pytest import numpy as np import eqtk def test_promiscuous_binding_failure(): A = np.array( [ [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 0.0, ...
[((96, 687), 'numpy.array', 'np.array', (['[[1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 0.0,\n 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 0.0,\n 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0], [0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0,\n 0.0, 0.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0...
suresh198526/pulumi-azure
sdk/python/pulumi_azure/lb/outbound_rule.py
bf27206a38d7a5c58b3c2c57ec8769fe3d0fc5d7
# 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 from .. import _utilitie...
[((10406, 10450), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""allocatedOutboundPorts"""'}), "(name='allocatedOutboundPorts')\n", (10419, 10450), False, 'import pulumi\n'), ((10684, 10726), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""backendAddressPoolId"""'}), "(name='backendAddressPoolId')\n", (10697, ...
Juanlu001/orbit-predictor
orbit_predictor/predictors/base.py
ca67e2e859932938627ed24e5cbf58c887cd99c0
# MIT License # # Copyright (c) 2017 Satellogic SA # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge...
[((1935, 1962), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1952, 1962), False, 'import logging\n'), ((1978, 2001), 'datetime.timedelta', 'dt.timedelta', ([], {'seconds': '(1)'}), '(seconds=1)\n', (1990, 2001), True, 'import datetime as dt\n'), ((2061, 2153), 'collections.namedtuple',...
jbdel/vilmedic
vilmedic/scorers/NLG/__init__.py
17d462a540a2632811cc2a78edd2861800a33b07
from .rouge import ROUGEScorer from .bleu.bleu import BLEUScorer from .meteor.meteor import METEORScorer from .cider.cider import Cider from .ciderd.ciderd import CiderD
[]
Yshuo-Li/mmediting-test
tests/test_liif.py
ff8349a183b3d266495a53be0c8ad8e342e8b461
import numpy as np import torch import torch.nn as nn from mmcv.runner import obj_from_dict from mmcv.utils.config import Config from mmedit.models import build_model from mmedit.models.losses import L1Loss from mmedit.models.registry import COMPONENTS @COMPONENTS.register_module() class BP(nn.Module): """A simp...
[((257, 285), 'mmedit.models.registry.COMPONENTS.register_module', 'COMPONENTS.register_module', ([], {}), '()\n', (283, 285), False, 'from mmedit.models.registry import COMPONENTS\n'), ((1389, 1451), 'mmedit.models.build_model', 'build_model', (['model_cfg'], {'train_cfg': 'train_cfg', 'test_cfg': 'test_cfg'}), '(mode...
ccraddock/beiwe-backend-cc
database/signals.py
b37c2604800aafcf81c93bc14673ada6aed17a39
from django.utils import timezone from django.core.exceptions import ObjectDoesNotExist from django.db.models.signals import post_save, pre_save from django.dispatch import receiver from database.study_models import DeviceSettings, Study, Survey, SurveyArchive @receiver(post_save, sender=Study) def popula...
[((275, 308), 'django.dispatch.receiver', 'receiver', (['post_save'], {'sender': 'Study'}), '(post_save, sender=Study)\n', (283, 308), False, 'from django.dispatch import receiver\n'), ((859, 892), 'django.dispatch.receiver', 'receiver', (['pre_save'], {'sender': 'Survey'}), '(pre_save, sender=Survey)\n', (867, 892), F...
Blakstar26/npyscreen
docs/examples/notify/notify_skeleton.py
d47f9c78dc9fea6f66aaef60403e748bb89e52f7
import npyscreen class NotifyBaseExample(npyscreen.Form): def create(self): key_of_choice = 'p' what_to_display = 'Press {} for popup \n Press escape key to quit'.format(key_of_choice) self.how_exited_handers[npyscreen.wgwidget.EXITED_ESCAPE] = self.exit_application self.add(npysc...
[]
romanroson/pis_code
practicioner_bundle/ch15-neural_style/pyimagesearch/nn/conv/minigooglenet.py
1221c39c23bec62ba419f9a324f88b0d8e5e4b5b
# -*- coding: utf-8 -*- """Implementation of MiniGoogLeNet architecture. This implementation is based on the original implemetation of GoogLeNet. The authors of the net used BN before Activation layer. This should be switched. """ from keras.layers.normalization import BatchNormalization from keras.layers.convolutiona...
[((2664, 2714), 'keras.layers.concatenate', 'concatenate', (['[conv_1x1, conv_3x3]'], {'axis': 'chanel_dim'}), '([conv_1x1, conv_3x3], axis=chanel_dim)\n', (2675, 2714), False, 'from keras.layers import concatenate\n'), ((3439, 3485), 'keras.layers.concatenate', 'concatenate', (['[conv_3x3, pool]'], {'axis': 'chanel_di...
PaulDoessel/gaffer-play
python/GafferUI/ScriptEditor.py
8b72dabb388e12424c230acfb0bd209049b01bd6
########################################################################## # # Copyright (c) 2011-2012, John Haddon. All rights reserved. # Copyright (c) 2011-2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted prov...
[]
machinelearningdeveloper/aoc_2016
03/triangle.py
e2c2f7909b09c2ad27f87e05a80f2b2feee6a3a2
"""Test whether putative triangles, specified as triples of side lengths, in fact are possible.""" def load_triangles(filename): """Load triangles from filename.""" triangles = [] with open(filename) as f: for line in f: if line.strip(): triangles.append(tuple([int(side) ...
[]
aleksandromelo/Exercicios
ExerciciosdePython/ex049.py
782ff539efa1286180eaf8df8c25c4eca7a5e669
num = int(input('Digite um número para ver sua tabuada: ')) for i in range(1, 11): print('{} x {:2} = {}'.format(num, i, num * i))
[]
bkidwell/ebmeta-old
ebmeta/actions/version.py
2279ddd14235ea31b27f0eaa7e9bb26cb43d4133
"""Print ebmeta version number.""" import sys import ebmeta def run(): print "{} {}".format(ebmeta.PROGRAM_NAME, ebmeta.VERSION) sys.exit(0)
[]
amichard/tfrs
backend/api/tests/mixins/credit_trade_relationship.py
ed3973016cc5c2ae48999d550a23b41a5ddad807
# -*- coding: utf-8 -*- # pylint: disable=no-member,invalid-name,duplicate-code """ REST API Documentation for the NRS TFRS Credit Trading Application The Transportation Fuels Reporting System is being designed to streamline compliance reporting for transportation fuel suppliers in accordance with the ...
[((1998, 2176), 'collections.namedtuple', 'namedtuple', (['"""ChangeRecord"""', "['trade_id', 'requesting_username', 'relationship',\n 'expected_to_be_successful', 'data_before_request',\n 'data_after_request', 'response_code']"], {}), "('ChangeRecord', ['trade_id', 'requesting_username',\n 'relationship', 'ex...
panchohumeres/dynamo-covid
superset/superset_config.py
cf473be3eeca436efccd8891a61b721192cf6d34
import os SERVER_NAME = os.getenv('DOMAIN_SUPERSET') PUBLIC_ROLE_LIKE_GAMMA = True SESSION_COOKIE_SAMESITE = None # One of [None, 'Lax', 'Strict'] SESSION_COOKIE_HTTPONLY = False MAPBOX_API_KEY = os.getenv('MAPBOX_API_KEY', '') POSTGRES_DB=os.getenv('POSTGRES_DB') POSTGRES_PASSWORD=os.getenv('POSTGRES_PASSWORD') POSTG...
[((25, 53), 'os.getenv', 'os.getenv', (['"""DOMAIN_SUPERSET"""'], {}), "('DOMAIN_SUPERSET')\n", (34, 53), False, 'import os\n'), ((197, 228), 'os.getenv', 'os.getenv', (['"""MAPBOX_API_KEY"""', '""""""'], {}), "('MAPBOX_API_KEY', '')\n", (206, 228), False, 'import os\n'), ((241, 265), 'os.getenv', 'os.getenv', (['"""PO...
johnnyboiii3020/matchmaking-bot
mybot.py
c36df430fd8b3292f34fb2e156e65d9914e0e497
import discord import json import random import os from discord.ext import commands TOKEN = "" client = commands.Bot(command_prefix = '--') os.chdir(r'D:\Programming\Projects\Discord bot\jsonFiles') SoloCounter = 30 SolominCounter = 10 Queueiter = 1 T_Queueiter = 1 TeamCounter = 50 TeamminCounter = 20 ...
[((112, 145), 'discord.ext.commands.Bot', 'commands.Bot', ([], {'command_prefix': '"""--"""'}), "(command_prefix='--')\n", (124, 145), False, 'from discord.ext import commands\n'), ((151, 212), 'os.chdir', 'os.chdir', (['"""D:\\\\Programming\\\\Projects\\\\Discord bot\\\\jsonFiles"""'], {}), "('D:\\\\Programming\\\\Pro...
markemus/economy
conversation.py
d7b3be9b2095393d7ee5c8967b9fcee8998776bb
import database as d import numpy as np import random from transitions import Machine #Conversations are markov chains. Works as follows: a column vector for each CURRENT state j, a row vector for each TARGET state i. #Each entry i,j = the probability of moving to state i from state j. #target state D = end of convers...
[((2827, 2933), 'transitions.Machine', 'Machine', ([], {'model': 'self', 'states': 'Conversation.states', 'transitions': 'Conversation.transitions', 'initial': '"""exit"""'}), "(model=self, states=Conversation.states, transitions=Conversation.\n transitions, initial='exit')\n", (2834, 2933), False, 'from transitions...
saijananiganesan/SimPathFinder
src/createData.py
1634f2cb82c8056256d191be72589c4c531a3f67
from __init__ import ExtractUnlabeledData, SampleUnlabeledData, ExtractLabeledData E = ExtractLabeledData(data_dir='../labeldata/') E.get_pathways() E.get_pathway_names() E.get_classes_dict() E.create_df_all_labels()
[((88, 132), '__init__.ExtractLabeledData', 'ExtractLabeledData', ([], {'data_dir': '"""../labeldata/"""'}), "(data_dir='../labeldata/')\n", (106, 132), False, 'from __init__ import ExtractUnlabeledData, SampleUnlabeledData, ExtractLabeledData\n')]
farman99ahmed/diyblog
blog/views.py
2e4548037c95b5563d2fdba3d05b488330a5e2b4
from django.shortcuts import render, redirect from .forms import AuthorForm, BlogForm, NewUserForm from .models import Author, Blog from django.contrib.auth import login, authenticate, logout from django.contrib import messages from django.contrib.auth.forms import AuthenticationForm from django.contrib.auth.decorator...
[((457, 506), 'django.shortcuts.render', 'render', (['request', '"""blog/get_authors.html"""', 'context'], {}), "(request, 'blog/get_authors.html', context)\n", (463, 506), False, 'from django.shortcuts import render, redirect\n'), ((700, 748), 'django.shortcuts.render', 'render', (['request', '"""blog/get_author.html"...
SolomidHero/speech-regeneration-enhancer
tests/conftest.py
eb43907ff085d68a707ff7bc3af14e93ff66fd65
# here we make fixtures of toy data # real parameters are stored and accessed from config import pytest import librosa import os import numpy as np from hydra.experimental import compose, initialize @pytest.fixture(scope="session") def cfg(): with initialize(config_path="../", job_name="test_app"): config = ...
[((205, 236), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (219, 236), False, 'import pytest\n'), ((507, 538), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (521, 538), False, 'import pytest\n'), ((593, 624), 'pytest.fixture'...
CvanderStoep/VideosSampleCode
dataclassses_howto.py
38a8d2538a041d5664d0040807ffac463d0fb79c
import dataclasses import inspect from dataclasses import dataclass, field from pprint import pprint import attr class ManualComment: def __init__(self, id: int, text: str): self.id: int = id self.text: str = text def __repr__(self): return "{}(id={}, text={})".format(self.__class__....
[((1565, 1599), 'dataclasses.dataclass', 'dataclass', ([], {'frozen': '(True)', 'order': '(True)'}), '(frozen=True, order=True)\n', (1574, 1599), False, 'from dataclasses import dataclass, field\n'), ((1729, 1772), 'attr.s', 'attr.s', ([], {'frozen': '(True)', 'order': '(True)', 'slots': '(True)'}), '(frozen=True, orde...
yaosir0317/my_first
downloadMusic/main.py
387fe21aa529bca1d08ed45e13269aca23dce251
from enum import Enum import requests class MusicAPP(Enum): qq = "qq" wy = "netease" PRE_URL = "http://www.musictool.top/" headers = {"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36"} def get_music_list(name, app, pag...
[((409, 463), 'requests.post', 'requests.post', ([], {'url': 'PRE_URL', 'headers': 'headers', 'data': 'data'}), '(url=PRE_URL, headers=headers, data=data)\n', (422, 463), False, 'import requests\n')]
michelmarcondes/django-study-with-docker
app/api/serializers.py
248e41db3f16a5d26662c5e93ebf32716a20195e
from rest_framework import serializers from projects.models import Project, Tag, Review from users.models import Profile class ReviewSerializer(serializers.ModelSerializer): class Meta: model = Review fields = '__all__' class ProfileSerializer(serializers.ModelSerializer): class Meta: ...
[((628, 663), 'rest_framework.serializers.SerializerMethodField', 'serializers.SerializerMethodField', ([], {}), '()\n', (661, 663), False, 'from rest_framework import serializers\n')]
johan--/commcare-hq
corehq/apps/domain/views.py
86ee99c54f55ee94e4c8f2f6f30fc44e10e69ebd
import copy import datetime from decimal import Decimal import logging import uuid import json import cStringIO from couchdbkit import ResourceNotFound import dateutil from django.core.paginator import Paginator from django.views.generic import View from django.db.models import Sum from django.conf import settings fro...
[]
alexmascension/ANMI
src/anmi/T2/funcs_met_iters.py
9c51a497a5fa2650f1429f847c7f9df69271168b
from sympy import simplify, zeros from sympy import Matrix as mat import numpy as np from ..genericas import print_verbose, matriz_inversa def criterio_radio_espectral(H, verbose=True): eigs = [simplify(i) for i in list(H.eigenvals().keys())] print_verbose("||Criterio de radio espectral||", verbose) try...
[((5208, 5223), 'sympy.simplify', 'simplify', (['(M - A)'], {}), '(M - A)\n', (5216, 5223), False, 'from sympy import simplify, zeros\n'), ((201, 212), 'sympy.simplify', 'simplify', (['i'], {}), '(i)\n', (209, 212), False, 'from sympy import simplify, zeros\n'), ((948, 976), 'numpy.array', 'np.array', (['A_abs'], {'dty...
zhangxianbing/cookiecutter-pypackage
{{cookiecutter.project_hyphen}}/{{cookiecutter.project_slug}}/__init__.py
28f7f305d3baf96771881c3359227bed1bc7d182
"""{{ cookiecutter.project_name }} - {{ cookiecutter.project_short_description }}""" __version__ = "{{ cookiecutter.project_version }}" __author__ = """{{ cookiecutter.author_name }}""" __email__ = "{{ cookiecutter.author_email }}" prog_name = "{{ cookiecutter.project_hyphen }}"
[]
mguidon/osparc-dask-gateway
services/osparc-gateway-server/tests/integration/_dask_helpers.py
accd850c15cb3a36cf4421a1d070a4db29843013
from typing import NamedTuple from dask_gateway_server.app import DaskGateway class DaskGatewayServer(NamedTuple): address: str proxy_address: str password: str server: DaskGateway
[]
kazuyaujihara/rdkit
rdkit/ML/InfoTheory/BitRank.py
06027dcd05674787b61f27ba46ec0d42a6037540
# # Copyright (C) 2001,2002,2003 greg Landrum and Rational Discovery LLC # """ Functionality for ranking bits using info gains **Definitions used in this module** - *sequence*: an object capable of containing other objects which supports __getitem__() and __len__(). Examples of these include lists, tupl...
[((1514, 1575), 'numpy.zeros', 'numpy.zeros', (['(nPossibleBitVals, nPossibleActs)', 'numpy.integer'], {}), '((nPossibleBitVals, nPossibleActs), numpy.integer)\n', (1525, 1575), False, 'import numpy\n'), ((2354, 2385), 'numpy.zeros', 'numpy.zeros', (['nBits', 'numpy.float'], {}), '(nBits, numpy.float)\n', (2365, 2385),...
vinay-swamy/gMVP
trainer/dataset.py
62202baa0769dfe0e47c230e78dffa42fb1280f1
import tensorflow as tf import os import pickle import numpy as np from constant_params import input_feature_dim, window_size def build_dataset(input_tfrecord_files, batch_size): drop_remainder = False feature_description = { 'label': tf.io.FixedLenFeature([], tf.int64), 'ref_aa': tf.io.Fixe...
[((1795, 1840), 'tensorflow.data.TFRecordDataset', 'tf.data.TFRecordDataset', (['input_tfrecord_files'], {}), '(input_tfrecord_files)\n', (1818, 1840), True, 'import tensorflow as tf\n'), ((1856, 1873), 'tensorflow.data.Options', 'tf.data.Options', ([], {}), '()\n', (1871, 1873), True, 'import tensorflow as tf\n'), ((3...
dpressel/baseline
layers/eight_mile/pytorch/layers.py
2f46f3b043f2d20bc348495cc54c834f31f71098
import copy import math import logging from typing import Dict, List, Optional, Tuple, Union import os import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import torch.jit as jit import torch.autograd import contextlib import glob from eight_mile.utils import listify, Offsets, is_seque...
[((448, 480), 'logging.getLogger', 'logging.getLogger', (['"""mead.layers"""'], {}), "('mead.layers')\n", (465, 480), False, 'import logging\n'), ((2275, 2308), 'torch.max', 'torch.max', (['vec', 'dim'], {'keepdim': '(True)'}), '(vec, dim, keepdim=True)\n', (2284, 2308), False, 'import torch\n'), ((13080, 13089), 'torc...
flother/pdf-search
setup.py
fa4c519a673bf5a5d25e1ab44e971690ab3cf781
from setuptools import setup setup( name='espdf', version='0.1.0-dev', url='https://github.com/flother/pdf-search', py_modules=( 'espdf', ), install_requires=( 'certifi', 'elasticsearch-dsl', ), entry_points={ 'console_scripts': ( 'espdf=espd...
[((31, 260), 'setuptools.setup', 'setup', ([], {'name': '"""espdf"""', 'version': '"""0.1.0-dev"""', 'url': '"""https://github.com/flother/pdf-search"""', 'py_modules': "('espdf',)", 'install_requires': "('certifi', 'elasticsearch-dsl')", 'entry_points': "{'console_scripts': ('espdf=espdf:cli',)}"}), "(name='espdf', ve...
martexcoin/pywallet
pywallet/network.py
dca53f124452869890b0247c40afba821b650c6b
class BitcoinGoldMainNet(object): """Bitcoin Gold MainNet version bytes. """ NAME = "Bitcoin Gold Main Net" COIN = "BTG" SCRIPT_ADDRESS = 0x17 # int(0x17) = 23 PUBKEY_ADDRESS = 0x26 # int(0x26) = 38 # Used to create payment addresses SECRET_KEY = 0x80 # int(0x80) = 128 # Used for WIF fo...
[]
sintef-ocean/conan-clapack
conanfile.py
9c472130eaadee71253ced9b5fe25ee1b868bcb3
#!/usr/bin/env python # -*- coding: utf-8 -*- from conans import ConanFile, CMake, tools import shutil class ClapackConan(ConanFile): name = "clapack" version = "3.2.1" license = "BSD 3-Clause" # BSD-3-Clause-Clear url = "https://github.com/sintef-ocean/conan-clapack" author = "SINTEF Ocean" ...
[((1058, 1122), 'conans.tools.get', 'tools.get', (['link'], {'sha1': '"""5ea1bcc4314e392bca8b9e5f61d44355cf9f4cc1"""'}), "(link, sha1='5ea1bcc4314e392bca8b9e5f61d44355cf9f4cc1')\n", (1067, 1122), False, 'from conans import ConanFile, CMake, tools\n'), ((1132, 1222), 'conans.tools.patch', 'tools.patch', ([], {'patch_fil...
ComputerSystemsLaboratory/YaCoS
yacos/algorithm/metaheuristics.py
abd5d3c6e227e5c7a563493f7855ebf58ba3de05
""" Copyright 2021 Anderson Faustino da Silva. 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,...
[((6407, 6438), 'yacos.essential.IO.load_passes', 'IO.load_passes', (['passes_filename'], {}), '(passes_filename)\n', (6421, 6438), False, 'from yacos.essential import IO\n'), ((7615, 7638), 'pygmo.algorithm', 'pg.algorithm', (['algorithm'], {}), '(algorithm)\n', (7627, 7638), True, 'import pygmo as pg\n'), ((7811, 790...
solnishko-pvs/Modeling_BMSTU
lab_03/main.py
0ecb82aea23b6726912f72d3230097d7b679eaf9
import tkinter as tk from scipy.stats import chi2, chisquare COLOR = '#dddddd' COLUMNS_COLOR = '#ffffff' MAX_SIZE = 10 WIDGET_WIDTH = 25 class LinearCongruent: m = 2**32 a = 1664525 c = 1013904223 _cur = 1 def next(self): self._cur = (self.a * self._cur + self.c) % self.m return s...
[((8804, 8811), 'tkinter.Tk', 'tk.Tk', ([], {}), '()\n', (8809, 8811), True, 'import tkinter as tk\n'), ((1698, 1772), 'tkinter.LabelFrame', 'tk.LabelFrame', (['master'], {'bg': 'COLOR', 'text': '"""Ввод данных"""', 'width': '(480)', 'height': '(110)'}), "(master, bg=COLOR, text='Ввод данных', width=480, height=110)\n"...
tylermneher/python-api-challenge
VacationPy/api_keys.py
28c88b4fff13c8b752096b0776a3d4645ad5fddb
# OpenWeatherMap API Key weather_api_key = "MyOpenWeatherMapAPIKey" # Google API Key g_key = "MyGoogleKey"
[]
panickervinod/aries-cloudagent-python
aries_cloudagent/protocols/actionmenu/v1_0/messages/menu_request.py
bb4627fe62ee42ffeeb435cf3d8bfbd66c10d02f
"""Represents a request for an action menu.""" from .....messaging.agent_message import AgentMessage, AgentMessageSchema from ..message_types import MENU_REQUEST, PROTOCOL_PACKAGE HANDLER_CLASS = f"{PROTOCOL_PACKAGE}.handlers.menu_request_handler.MenuRequestHandler" class MenuRequest(AgentMessage): """Class re...
[]