max_stars_repo_path
stringlengths
4
237
max_stars_repo_name
stringlengths
6
117
max_stars_count
int64
0
95.2k
id
stringlengths
1
7
content
stringlengths
12
593k
input_ids
listlengths
7
549k
Formatting_Strings/What_day_is_today?.py
RKiddle/python_reg_expressions
0
164755
<reponame>RKiddle/python_reg_expressions<filename>Formatting_Strings/What_day_is_today?.py # Import datetime from datetime import datetime # Assign date to get_date get_date = datetime.now() # Add named placeholders with format specifiers message = "Good morning. Today is {today:%B %d, %Y}. It's {today:%H:%M} ... ti...
[ 1, 529, 276, 1112, 420, 29958, 29934, 29968, 2632, 29914, 4691, 29918, 1727, 29918, 17073, 1080, 29966, 9507, 29958, 2500, 23980, 29918, 26545, 29914, 5618, 29918, 3250, 29918, 275, 29918, 27765, 9808, 2272, 13, 29937, 16032, 12865, 29871, ...
ripiu/djangocms_aoxomoxoa/admin/options/grid_panel.py
ripiu/djangocms_aoxomoxoa
0
44283
<filename>ripiu/djangocms_aoxomoxoa/admin/options/grid_panel.py from django.contrib import admin from django.utils.translation import ugettext_lazy as _ class GridPanelUniteOptionsAdmin(admin.ModelAdmin): ''' Grid theme ''' fieldsets = ( (_('Strip panel options'), { 'classes': ('co...
[ 1, 529, 9507, 29958, 374, 1631, 29884, 29914, 19776, 574, 542, 1516, 29918, 29874, 2251, 290, 2251, 19807, 29914, 6406, 29914, 6768, 29914, 7720, 29918, 15119, 29889, 2272, 13, 3166, 9557, 29889, 21570, 1053, 4113, 13, 3166, 9557, 29889, ...
p_030_039/problem31.py
ericgreveson/projecteuler
0
3235
<gh_stars>0 class CoinArray(list): """ Coin list that is hashable for storage in sets The 8 entries are [1p count, 2p count, 5p count, ... , 200p count] """ def __hash__(self): """ Hash this as a string """ return hash(" ".join([str(i) for i in self])) def main(): ...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 1990, 3189, 262, 2588, 29898, 1761, 1125, 13, 1678, 9995, 13, 1678, 3189, 262, 1051, 393, 338, 6608, 519, 363, 8635, 297, 6166, 13, 1678, 450, 29871, 29947, 9976, 526, 518, 29896, 298...
scanpy/tools/paga.py
LuckyMD/scanpy
0
31033
from collections import namedtuple import numpy as np import scipy as sp from scipy.sparse.csgraph import minimum_spanning_tree from .. import logging as logg from ..neighbors import Neighbors from .. import utils from .. import settings def paga( adata, groups='louvain', use_rna_velocity=Fals...
[ 1, 515, 16250, 1053, 4257, 23583, 13, 5215, 12655, 408, 7442, 13, 5215, 4560, 2272, 408, 805, 13, 3166, 4560, 2272, 29889, 29879, 5510, 29889, 2395, 4262, 1053, 9212, 29918, 1028, 9450, 29918, 8336, 13, 3166, 6317, 1053, 12183, 408, 148...
wholesomebot/__main__.py
bnb32/wholesome_bot
0
1612892
from wholesomebot.connection import WebSocketClient, IrcSocketClient from wholesomebot.misc import get_logger import asyncio logger = get_logger() ircClient = IrcSocketClient() webClient = WebSocketClient() try: loop = asyncio.new_event_loop() loop = asyncio.get_event_loop() loop.create_t...
[ 1, 515, 377, 6544, 608, 7451, 29889, 9965, 1053, 2563, 11373, 4032, 29892, 306, 2214, 11373, 4032, 13, 3166, 377, 6544, 608, 7451, 29889, 29885, 10669, 1053, 679, 29918, 21707, 13, 13, 5215, 408, 948, 3934, 13, 13, 21707, 353, 679, 29...
test/sample.py
HyechurnJang/umbi
0
94302
# -*- coding: utf-8 -*- ''' Created on 2017. 10. 12. @author: HyechurnJang ''' import json from umbi import UmbiAPI def v(data): print json.dumps(data, indent=2) api = UmbiAPI('85aaa4d3-333e-4212-a7bd-b64300321193') # print 'Domains' # v(api.Domains.Categorization('hecloud.org', 'google.com')) #...
[ 1, 396, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 30004, 13, 12008, 30004, 13, 20399, 373, 29871, 29906, 29900, 29896, 29955, 29889, 29871, 29896, 29900, 29889, 29871, 29896, 29906, 22993, 13, 29992, 8921, 29901...
third_party/blink/tools/blinkpy/w3c/wpt_uploader.py
chromium/chromium
14,668
175393
# Copyright 2021 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Uploads Wpt test results from Chromium to wpt.fyi.""" import argparse import gzip import json import logging import os import requests import tempfile fr...
[ 1, 396, 14187, 1266, 29871, 29906, 29900, 29906, 29896, 450, 678, 456, 1974, 13189, 943, 29889, 2178, 10462, 21676, 29889, 13, 29937, 4803, 310, 445, 2752, 775, 338, 4095, 287, 491, 263, 350, 7230, 29899, 3293, 19405, 393, 508, 367, 13,...
authors/apps/articles/tests/test_tags.py
Tittoh/blog-API
1
73587
import json from django.urls import reverse from rest_framework.test import APITestCase from rest_framework import status from authors.apps.authentication.models import User from authors.apps.authentication.tests.utils import TEST_USER from django.core import mail from authors.apps.authentication.views import VerifyAcc...
[ 1, 1053, 4390, 13, 3166, 9557, 29889, 26045, 1053, 11837, 13, 3166, 1791, 29918, 4468, 29889, 1688, 1053, 12279, 1806, 342, 8259, 13, 3166, 1791, 29918, 4468, 1053, 4660, 13, 3166, 15717, 29889, 13371, 29889, 23055, 29889, 9794, 1053, 491...
gpytorch/lazy/non_lazy_tensor.py
Sciguymjm/gpytorch
0
192371
#!/usr/bin/env python3 import torch from .. import settings from ..lazy import LazyTensor class NonLazyTensor(LazyTensor): def __init__(self, tsr): """ Not a lazy tensor Args: - tsr (Tensor: matrix) a Tensor """ if not torch.is_tensor(tsr): raise Runti...
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 29941, 13, 13, 5215, 4842, 305, 13, 3166, 6317, 1053, 6055, 13, 3166, 6317, 433, 1537, 1053, 19575, 29891, 29911, 6073, 13, 13, 13, 1990, 10050, 29931, 24683, 29911, 6073, 29898, 29931, 24...
openbatlib/model.py
fastrockstar/openBatLib
4
173858
import numpy as np import numba as nb from dataclasses import dataclass from numba import types from numba.typed import Dict from numba import njit import pandas as pd import time import datetime import csv from openpyxl import load_workbook from pyModbusTCP.client import ModbusClient from pyModbusTCP impor...
[ 1, 1053, 12655, 408, 7442, 30004, 13, 5215, 954, 2291, 408, 302, 29890, 30004, 13, 3166, 848, 13203, 1053, 848, 1990, 30004, 13, 3166, 954, 2291, 1053, 4072, 30004, 13, 3166, 954, 2291, 29889, 1017, 9795, 1053, 360, 919, 30004, 13, 31...
tests/test_operations.py
HumanCellAtlas/data-store
46
154788
#!/usr/bin/env python # coding: utf-8 import io import os import sys import uuid import json import argparse import unittest import string import random import copy import datetime import tempfile from collections import namedtuple from unittest import mock from boto3.s3.transfer import TransferConfig from botocore.ex...
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 13, 29937, 14137, 29901, 23616, 29899, 29947, 13, 13, 5215, 12013, 13, 5215, 2897, 13, 5215, 10876, 13, 5215, 318, 5416, 13, 5215, 4390, 13, 5215, 1852, 5510, 13, 5215, 443, 27958, 13, 5...
tests/test_handlers_item_builder.py
MacHu-GWU/afwf_aws_tools-project
6
59329
<reponame>MacHu-GWU/afwf_aws_tools-project<filename>tests/test_handlers_item_builder.py # -*- coding: utf-8 -*- import pytest from workflow.workflow3 import Workflow3 from aws_tools.handlers.item_builder import item_builders class TestItemBuilders: wf = Workflow3() def setup_method(self): self.wf = ...
[ 1, 529, 276, 1112, 420, 29958, 15735, 29950, 29884, 29899, 29954, 29956, 29965, 29914, 2142, 29893, 29888, 29918, 10467, 29918, 8504, 29899, 4836, 29966, 9507, 29958, 21150, 29914, 1688, 29918, 3179, 9306, 29918, 667, 29918, 16409, 29889, 227...
kirppuauth/urls.py
Glowieh/kirppu
0
156190
<filename>kirppuauth/urls.py from django.conf.urls import patterns, include, url urlpatterns = patterns('kirppuauth.views', url(r'^addclerk$', 'register_clerk', name='kirppu_register_clerk'), )
[ 1, 529, 9507, 29958, 14166, 407, 29884, 5150, 29914, 26045, 29889, 2272, 13, 3166, 9557, 29889, 5527, 29889, 26045, 1053, 15038, 29892, 3160, 29892, 3142, 13, 13, 2271, 11037, 29879, 353, 15038, 877, 14166, 407, 29884, 5150, 29889, 7406, ...
praw_memories/prawdebug.py
elnuno/praw_memories
1
50951
"""Debugging facilities for PRAW-based projects.""" import datetime import json import logging import time import praw import prawcore
[ 1, 9995, 11862, 3460, 23330, 363, 349, 4717, 29956, 29899, 6707, 9279, 1213, 15945, 13, 13, 5215, 12865, 13, 5215, 4390, 13, 5215, 12183, 13, 5215, 931, 13, 13, 5215, 20467, 13, 5215, 20467, 3221, 13, 2 ]
Intro_to_Recommendation_Systems/api.py
NunoEdgarGFlowHub/sciblog_support
668
174503
import cherrypy from paste.translogger import TransLogger from flask import Flask, request, abort, jsonify, make_response import json import os from utils import decode_string from DeepRecommender.reco_encoder.data import input_layer_api, input_layer from DeepRecommender.reco_encoder.model import model import torch fro...
[ 1, 1053, 14954, 719, 2272, 13, 3166, 11417, 29889, 3286, 21707, 1053, 4103, 16363, 13, 3166, 29784, 1053, 2379, 1278, 29892, 2009, 29892, 27450, 29892, 4390, 1598, 29892, 1207, 29918, 5327, 13, 5215, 4390, 13, 5215, 2897, 13, 3166, 3667, ...
downstream/tinypersons/tests/test_onnx/__init__.py
bwconrad/solo-learn
326
174461
<filename>downstream/tinypersons/tests/test_onnx/__init__.py from .utils import ort_validate __all__ = ['ort_validate']
[ 1, 529, 9507, 29958, 3204, 5461, 29914, 29873, 262, 1478, 414, 787, 29914, 21150, 29914, 1688, 29918, 3409, 29916, 29914, 1649, 2344, 26914, 2272, 13, 3166, 869, 13239, 1053, 20289, 29918, 15480, 13, 13, 1649, 497, 1649, 353, 6024, 441, ...
access_restricted/tests/test_fields_get.py
trojikman/access-addons
0
91915
from odoo.tests.common import TransactionCase, tagged from odoo.addons.base.models.res_users import name_selection_groups @tagged("at_install", "post_install") class TestFieldsGet(TransactionCase): def test_base(self): demo_user = self.env.ref("base.user_demo") group_erp_manager = self.env.ref("b...
[ 1, 515, 288, 1867, 29877, 29889, 21150, 29889, 9435, 1053, 4103, 2467, 8259, 29892, 4055, 3192, 13, 13, 3166, 288, 1867, 29877, 29889, 1202, 787, 29889, 3188, 29889, 9794, 29889, 690, 29918, 7193, 1053, 1024, 29918, 21731, 29918, 13155, 1...
tests/tools/test_rm.py
Vikash-Kothary/aem-cmd-python
2
147959
# coding: utf-8 from mock import patch from httmock import urlmatch, HTTMock from nose.tools import eq_ from acmd import tool_repo, Server from test_utils.compat import StringIO @urlmatch(netloc='localhost:4502', method='DELETE') def service_rm(url, request): return { 'content': '', 'status_code'...
[ 1, 396, 14137, 29901, 23616, 29899, 29947, 13, 3166, 11187, 1053, 13261, 13, 3166, 1143, 17640, 1053, 3142, 4352, 29892, 3154, 29911, 18680, 13, 3166, 26414, 29889, 8504, 1053, 11594, 29918, 13, 13, 3166, 1274, 3487, 1053, 5780, 29918, 20...
data_visualizer.py
austinmdillow/natural-selection-simulator
0
94648
from environment import Environment from species import Species import matplotlib.pyplot as plt import matplotlib matplotlib.use('TkAgg') # <-- THIS MAKES IT FAST! class DataVisualizer(): def __init__(self, env): self.environments = [env] plt.ion() plt.show() print("Init of Data Visualizer complete") ...
[ 1, 515, 5177, 1053, 16738, 13, 3166, 6606, 1053, 21807, 13, 5215, 22889, 29889, 2272, 5317, 408, 14770, 13, 5215, 22889, 13, 2922, 17357, 29889, 1509, 877, 29911, 29895, 29909, 1505, 1495, 396, 529, 489, 3446, 3235, 14861, 29968, 2890, ...
lk_lambdex/traceback_.py
likianta/lk-lambdex
0
67171
from textwrap import dedent from textwrap import indent def format_exception( direct_caller_frame, lambdex_definition_place, traceback_obj, source_code_block, ) -> str: # caller: see `.main.lambdex.<vars:code>.<code_template>.<except_clause>`. def _show_place(filename, lin...
[ 1, 515, 1426, 6312, 1053, 28262, 296, 13, 3166, 1426, 6312, 1053, 29536, 13, 13, 13, 1753, 3402, 29918, 11739, 29898, 13, 4706, 1513, 29918, 4804, 261, 29918, 2557, 29892, 13, 4706, 301, 1117, 1390, 29918, 16553, 29918, 6689, 29892, 13,...
potok/tabular/utils.py
ksetherg/Chereda
1
90531
<filename>potok/tabular/utils.py import scipy.stats as sst import numpy as np import pandas as pd from potok.tabular import TabularData class SyntheticData: def __init__(self, problem='regression', pdf_train=sst.norm(loc=-1, scale=2), pdf_test=sst.norm(loc=1, sc...
[ 1, 529, 9507, 29958, 17765, 554, 29914, 9456, 29914, 13239, 29889, 2272, 13, 5215, 4560, 2272, 29889, 16202, 408, 269, 303, 13, 5215, 12655, 408, 7442, 13, 5215, 11701, 408, 10518, 13, 13, 3166, 3104, 554, 29889, 9456, 1053, 11090, 1070...
idfield/fields.py
lis-space/django-idfield
0
55106
<gh_stars>0 from django.db import models import random class IDField(models.Field): def __init__(self, alphabet=None, readable=False, *args, **kwargs): self.max_length = kwargs.get('max_length', 10) self.readable = readable self.alphabet = alphabet if not self.alphabet: ...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 3166, 9557, 29889, 2585, 1053, 4733, 13, 5215, 4036, 13, 13, 13, 1990, 3553, 3073, 29898, 9794, 29889, 3073, 1125, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 22968, 29922, 8516,...
docs/streammarker_connected_sensor/streammarker_connected_sensor_reader.py
urlgrey/streammarker-collector
0
96035
#!/usr/bin/python import os import httplib import serial import re import json ser = serial.Serial('/dev/ttyAMA0', 9600) headers = {"Content-type": "application/json", "Accept": "application/json"} if 'STREAMMARKER_API_KEY' in os.environ: headers["X-API-KEY"] = os.environ['STREAMMARKER_API_KEY'] r_unwa...
[ 1, 18787, 4855, 29914, 2109, 29914, 4691, 13, 13, 5215, 2897, 13, 5215, 1732, 1982, 13, 5215, 7797, 13, 5215, 337, 13, 5215, 4390, 13, 13, 643, 353, 7797, 29889, 9125, 11219, 3359, 29914, 4349, 29909, 1529, 29900, 742, 29871, 29929, 2...
examples/04_sweep_wind_directions.py
ElieKadoche/floris
0
12814
# Copyright 2022 NREL # 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 # distri...
[ 1, 396, 14187, 1266, 29871, 29906, 29900, 29906, 29906, 405, 1525, 29931, 13, 13, 29937, 10413, 21144, 1090, 278, 13380, 19245, 29892, 10079, 29871, 29906, 29889, 29900, 313, 1552, 376, 29931, 293, 1947, 1496, 366, 1122, 451, 13, 29937, 6...
learnMongo/mongoInsert.py
huobingli/pyAlgorithm
0
24764
import pymongo from bson.objectid import ObjectId # mongo 增加 def main(): client = pymongo.MongoClient(host='172.16.17.32', port=27017) db = client.test collection = db.students # 插入一条数据 student = { 'id': '20170101', 'name': 'Kevin', 'age': 20, 'gender': 'male' ...
[ 1, 1053, 282, 962, 7443, 13, 13, 3166, 289, 1100, 29889, 3318, 333, 1053, 4669, 1204, 13, 13, 29937, 19476, 29871, 232, 165, 161, 30666, 13, 13, 1753, 1667, 7295, 13, 1678, 3132, 353, 282, 962, 7443, 29889, 29924, 7443, 4032, 29898, ...
cpgan_data.py
basilevh/object-discovery-cp-gan
14
18657
# <NAME>, March 2020 # Common code for PyTorch implementation of Copy-Pasting GAN import copy import itertools import matplotlib.pyplot as plt import numpy as np import os, platform, time import torch import torch.nn as nn import torch.nn.functional as F import torchvision import torchvision.transforms as transforms f...
[ 1, 396, 529, 5813, 10202, 4779, 29871, 29906, 29900, 29906, 29900, 13, 29937, 13103, 775, 363, 10772, 29911, 25350, 5314, 310, 14187, 29899, 29925, 579, 292, 402, 2190, 13, 13, 5215, 3509, 13, 5215, 4256, 8504, 13, 5215, 22889, 29889, 2...
dpx2ffv1/test.py
DerouineauNicolas/dpx_to_ffv1
0
1605438
<reponame>DerouineauNicolas/dpx_to_ffv1<filename>dpx2ffv1/test.py<gh_stars>0 from unittest import TestCase from dpx2ffv1.dpx2ffv1 import dpx2ffv1 class TestJoke(TestCase): def test_main_function(self): out = dpx2ffv1('./test/', 'out.mkv', 24) assert(out == 0) if __name__ == '__main__': unittes...
[ 1, 529, 276, 1112, 420, 29958, 15383, 283, 457, 585, 29940, 5283, 294, 29914, 29881, 1756, 29918, 517, 29918, 600, 29894, 29896, 29966, 9507, 29958, 29881, 1756, 29906, 600, 29894, 29896, 29914, 1688, 29889, 2272, 29966, 12443, 29918, 303, ...
RSA_keys.py
davarbri/jpegForensics
0
59093
<filename>RSA_keys.py # !/usr/bin/python3 # RSA_keys.py # <NAME> # January 2022 # usage: python RSA_keys.py <bitslenght> # -------------------------------------------- # The script generates a public and private # RSA key pair of the desired length. # Only 1024, 2048 and 4096 bits are possible # ------------...
[ 1, 529, 9507, 29958, 29934, 8132, 29918, 8149, 29889, 2272, 13, 29937, 1738, 29914, 4855, 29914, 2109, 29914, 4691, 29941, 30004, 13, 29937, 390, 8132, 29918, 8149, 29889, 2272, 30004, 13, 29937, 529, 5813, 3238, 13, 29937, 5490, 29871, 2...
test/test_vlan_group.py
nrfta/python-netbox-client
0
16388
<filename>test/test_vlan_group.py # coding: utf-8 """ NetBox API API to access NetBox # noqa: E501 OpenAPI spec version: 2.8 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import unittest import netbox_client from netbox_client.mo...
[ 1, 529, 9507, 29958, 1688, 29914, 1688, 29918, 29894, 6468, 29918, 2972, 29889, 2272, 13, 29937, 14137, 29901, 23616, 29899, 29947, 13, 13, 15945, 29908, 13, 1678, 12670, 3313, 3450, 13, 13, 1678, 3450, 304, 2130, 12670, 3313, 29871, 396,...
Linked List/ListNode.py
paulpatault/Algorithmic
0
154208
<gh_stars>0 class ListNode(object): def __init__(self, x): self.val = x self.next = None def __repr__(self): node = self output = "" while node != None: output += str(node.val) output += " " node = node.next return output
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 1990, 2391, 4247, 29898, 3318, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 921, 1125, 13, 4706, 1583, 29889, 791, 353, 921, 13, 4706, 1583, 29889, 4622, 353, 6213, 13, 13, 16...
project/repository/user.py
tobiasaditya/fastapi-blog
0
21890
from typing import List from fastapi import APIRouter from fastapi.params import Depends from fastapi import HTTPException, status from sqlalchemy.orm.session import Session from project import schema, models, database, hashing router = APIRouter( prefix="/user", tags=['Users'] ) @router.post('/new') def crea...
[ 1, 515, 19229, 1053, 2391, 13, 3166, 5172, 2754, 1053, 3450, 23971, 13, 3166, 5172, 2754, 29889, 7529, 1053, 10034, 1975, 13, 3166, 5172, 2754, 1053, 7331, 2451, 29892, 4660, 13, 3166, 4576, 284, 305, 6764, 29889, 555, 29889, 7924, 1053...
test_mersenne.py
Crulzor/algorithms-python-intro-ex
0
26134
<reponame>Crulzor/algorithms-python-intro-ex<filename>test_mersenne.py from mersenne import generatePotentialMP, isPrime def test_generatePotentialMP(): assert(generatePotentialMP(2) == 3) assert(generatePotentialMP(1) ==1) def test_isPrime(): assert(isPrime(7)) assert(isPrime(2)) assert(isPrime(3...
[ 1, 529, 276, 1112, 420, 29958, 20647, 352, 29015, 29914, 9564, 12404, 29899, 4691, 29899, 23333, 29899, 735, 29966, 9507, 29958, 1688, 29918, 13269, 4584, 29889, 2272, 13, 3166, 286, 414, 4584, 1053, 5706, 29925, 327, 2556, 3580, 29892, 3...
tests/test_files/kwonly_arg_annotated.py
misteraverin/flake8-annotations-coverage
29
159131
<reponame>misteraverin/flake8-annotations-coverage def foo(): pass def bar(*args, kwonly_arg: str = None): pass
[ 1, 529, 276, 1112, 420, 29958, 29885, 1531, 12483, 262, 29914, 29888, 433, 446, 29947, 29899, 6735, 800, 29899, 11911, 482, 13, 1753, 7953, 7295, 13, 1678, 1209, 13, 13, 13, 1753, 2594, 10456, 5085, 29892, 9049, 6194, 29918, 1191, 29901...
setup.py
NoamNol/gematriapy
1
96771
<reponame>NoamNol/gematriapy import setuptools import gematriapy with open("README.md", "r", encoding="utf-8") as fh: long_description = fh.read() setuptools.setup( name="gematriapy", version=gematriapy.__version__, author="<NAME>", author_email="<EMAIL>", description=gematriapy.__doc__, l...
[ 1, 529, 276, 1112, 420, 29958, 3782, 314, 29940, 324, 29914, 29887, 4579, 374, 27580, 13, 5215, 731, 21245, 8789, 13, 5215, 330, 4579, 374, 27580, 13, 13, 2541, 1722, 703, 16310, 2303, 29889, 3487, 613, 376, 29878, 613, 8025, 543, 942...
upcfcardsearch/c106.py
ProfessorSean/Kasutamaiza
0
192069
<filename>upcfcardsearch/c106.py import discord from discord.ext import commands from discord.utils import get class c106(commands.Cog, name="c106"): def __init__(self, bot: commands.Bot): self.bot = bot @commands.command(name='Golden_Statue_in_the_Sky', aliases=['c106']) async def example_embed(s...
[ 1, 529, 9507, 29958, 786, 6854, 7543, 4478, 29914, 29883, 29896, 29900, 29953, 29889, 2272, 13, 5215, 2313, 536, 13, 3166, 2313, 536, 29889, 1062, 1053, 8260, 13, 3166, 2313, 536, 29889, 13239, 1053, 679, 13, 13, 1990, 274, 29896, 29900...
backoffice/views.py
chervaliery/tv_show_fetcher
0
1600272
from django.http import HttpResponse from models import * from utils import fetch_show, get_show # Create your views here. def home(request): return HttpResponse("Bonjour monde!")
[ 1, 515, 9557, 29889, 1124, 1053, 9056, 5103, 13, 13, 3166, 4733, 1053, 334, 13, 3166, 3667, 29879, 1053, 6699, 29918, 4294, 29892, 679, 29918, 4294, 13, 13, 29937, 6204, 596, 8386, 1244, 29889, 13, 13, 13, 1753, 3271, 29898, 3827, 112...
tnia/viewing/napari_helper.py
True-North-Intelligent-Algorithms/tnia-python
3
104456
import napari def show_image(im, title, viewer=None, label=False): """ convenience helper function to show image in Napari Args: im (numpy array): image to show title (string): title of image viewer (napari instance, optional): pre-existing Napari label (bool, optional): True ...
[ 1, 1053, 9709, 1306, 13, 13, 1753, 1510, 29918, 3027, 29898, 326, 29892, 3611, 29892, 6316, 556, 29922, 8516, 29892, 3858, 29922, 8824, 1125, 13, 1678, 9995, 29703, 16876, 740, 304, 1510, 1967, 297, 8344, 1306, 13, 13, 1678, 826, 3174, ...
time_calculator.py
yashvarshney003/Time-Calculator-Freecodecamp
0
192439
<filename>time_calculator.py def add_time(start, duration, day=None): time, period = start.split() initial_period = period hr_start, min_start = time.split(':') hr_duration, min_duration = duration.split(':') min_new = int(min_start) + int(min_duration) hr_new = int(hr_start) + int(hr_duration) perio...
[ 1, 529, 9507, 29958, 2230, 29918, 15807, 1061, 29889, 2272, 13, 1753, 788, 29918, 2230, 29898, 2962, 29892, 14385, 29892, 2462, 29922, 8516, 1125, 13, 29871, 931, 29892, 3785, 353, 1369, 29889, 5451, 580, 13, 29871, 2847, 29918, 19145, 35...
boto-python-workshop/01_list_objects.py
shy950521/ecs-samples
28
186798
<reponame>shy950521/ecs-samples<gh_stars>10-100 ''' Same stuff as 00_getting_started. If you've pasted all this into your python interpreter already, you can skip past this. ''' from boto.s3.connection import S3Connection, OrdinaryCallingFormat from boto.s3.key import Key from boto.s3.prefix import Prefix host = "obj...
[ 1, 529, 276, 1112, 420, 29958, 845, 29891, 29929, 29945, 29900, 29945, 29906, 29896, 29914, 687, 29879, 29899, 27736, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29900, 29899, 29896, 29900, 29900, 13, 12008, 13, 29903, 420, 6433, 408, 298...
auxiliary/auxiliary.py
amageh/respy-tut
0
76491
<reponame>amageh/respy-tut """This file contains auxiliary function that we use throughout the respy tutorial.""" import matplotlib.pyplot as plt import pandas as pd def plot_fishing_grounds(df): """Plot choice shares for observables example.""" fig, ax = plt.subplots(1, 2, figsize=(10, 4)) for i, observ...
[ 1, 529, 276, 1112, 420, 29958, 314, 482, 29882, 29914, 690, 2272, 29899, 29873, 329, 13, 15945, 29908, 4013, 934, 3743, 29587, 653, 740, 393, 591, 671, 10106, 278, 620, 2272, 9673, 1213, 15945, 13, 5215, 22889, 29889, 2272, 5317, 408, ...
monitor/rotation.py
UWCubeSat/bairing
0
116388
import serial import struct import time import numpy as np from ahrs.filters import Madgwick from cube import CubeRenderer sync = b'\xEF\xBE\xAD\xDE' def reset(ser): ser.write(sync) ser.write(b'\x01\x00') ser.write(b'\x00') def begin(ser): ser.write(sync) ser.write(b'\x03\x00') ser.write(b'\x10') ser.w...
[ 1, 1053, 7797, 13, 5215, 2281, 13, 5215, 931, 13, 5215, 12655, 408, 7442, 13, 3166, 263, 1092, 29879, 29889, 26705, 1053, 4104, 29887, 6669, 13, 3166, 28704, 1053, 315, 4003, 21323, 13, 13, 16593, 353, 289, 12764, 29916, 29638, 29905, ...
src/train.py
saikrishnaklu/Kaggle_Categorical_Feature_Encoding-Challenge_II
1
103442
from __future__ import print_function import os from sklearn import preprocessing from sklearn import ensemble from sklearn.metrics import accuracy_score,roc_auc_score import pandas as pd import joblib import numpy as np #import dispatcher folds={ 0:[1,2,3,4], 1:[0,2,3,4], 2:[1,0,3,4], 3:[1,2,0,4], ...
[ 1, 515, 4770, 29888, 9130, 1649, 1053, 1596, 29918, 2220, 13, 5215, 2897, 13, 3166, 2071, 19668, 1053, 758, 19170, 13, 3166, 2071, 19668, 1053, 21285, 13, 3166, 2071, 19668, 29889, 2527, 10817, 1053, 13600, 29918, 13628, 29892, 10198, 299...
notebooks/__code/_utilities/array.py
mabrahamdevops/python_notebooks
0
128582
<reponame>mabrahamdevops/python_notebooks import numpy as np def exclude_y_value_when_error_is_nan(axis, error_axis): axis_cleaned = [] error_axis_cleaned = [] for _x, _error in zip(axis, error_axis): if (_x == "None") or (_error == "None") or (_x is None) or (_error is None): axis_cl...
[ 1, 529, 276, 1112, 420, 29958, 29885, 370, 22084, 3359, 3554, 29914, 4691, 29918, 1333, 19273, 29879, 13, 5215, 12655, 408, 7442, 13, 13, 13, 1753, 19060, 29918, 29891, 29918, 1767, 29918, 8256, 29918, 2704, 29918, 275, 29918, 13707, 2989...
chapter_3/ex_3-10.py
akshaymoharir/PythonCrashCourse
0
62899
<reponame>akshaymoharir/PythonCrashCourse<filename>chapter_3/ex_3-10.py ## Python Crash Course # Exercise 3.10: Every Function: # Think of something you could store in a list. # For example, you could make a list of mountains, rivers, countries, cities, languages, or any- thing else y...
[ 1, 529, 276, 1112, 420, 29958, 557, 845, 388, 29885, 1148, 279, 381, 29914, 11980, 20647, 1161, 29907, 10242, 29966, 9507, 29958, 27349, 29918, 29941, 29914, 735, 29918, 29941, 29899, 29896, 29900, 29889, 2272, 13, 13, 2277, 5132, 6781, 1...
fred_crawler.py
Tyromancer/economics.py
0
46646
# Usage: # Find and download fred series data # then find the specific data on yyyy-mm-dd import requests # used for downloading text files from FRED import os # used for removing temporary text files # Usage : download series data in the form of text file and extract data on given date # param: # se...
[ 1, 396, 10783, 482, 29901, 13, 29937, 10987, 322, 5142, 285, 1127, 3652, 848, 13, 29937, 769, 1284, 278, 2702, 848, 373, 343, 8071, 29891, 29899, 4317, 29899, 1289, 13, 13, 5215, 7274, 29871, 396, 1304, 363, 28536, 1426, 2066, 515, 38...
pyscf/nao/test/test_0003_na2_nao.py
robert-anderson/pyscf
3
6101
<filename>pyscf/nao/test/test_0003_na2_nao.py # Copyright 2014-2018 The PySCF Developers. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/li...
[ 1, 529, 9507, 29958, 29886, 952, 6854, 29914, 1056, 29877, 29914, 1688, 29914, 1688, 29918, 29900, 29900, 29900, 29941, 29918, 1056, 29906, 29918, 1056, 29877, 29889, 2272, 13, 29937, 14187, 1266, 29871, 29906, 29900, 29896, 29946, 29899, 299...
scripts/add_probs.py
sharmaeklavya2/ekuOJ
10
109871
""" This module has functions which syncs problems data in database with data in OJ_data """ import os FILE_PATH = os.path.abspath(__file__) BASE_DIR = os.path.dirname(os.path.dirname(FILE_PATH)) import sys if BASE_DIR not in sys.path: sys.path.append(BASE_DIR) import json def add_prob(prob_path, contest=None): pc...
[ 1, 9995, 13, 4013, 3883, 756, 3168, 607, 5222, 2395, 4828, 848, 297, 2566, 411, 848, 297, 438, 29967, 29918, 1272, 13, 15945, 29908, 13, 13, 5215, 2897, 13, 7724, 29918, 10145, 353, 2897, 29889, 2084, 29889, 370, 1028, 493, 22168, 144...
hydrobox/geostat/variogram.py
VForWaTer/hydrobox
4
183855
<filename>hydrobox/geostat/variogram.py import numpy as np import skgstat as skg import gstools as gs from hydrobox.geostat import typing from hydrobox.plotting import plot_function_loader def variogram( coordinates: np.ndarray, values: np.ndarray, estimator: typing.Estimator = 'matheron', model: typ...
[ 1, 529, 9507, 29958, 29882, 11279, 1884, 29914, 479, 520, 271, 29914, 5927, 13342, 29889, 2272, 13, 5215, 12655, 408, 7442, 13, 5215, 2071, 29887, 6112, 408, 2071, 29887, 13, 5215, 330, 303, 8789, 408, 330, 29879, 13, 13, 3166, 17546, ...
seeds/plugins/action/StopOnConvergence.py
briandconnelly/seeds
11
146974
<reponame>briandconnelly/seeds # -*- coding: utf-8 -*- """ Stop the experiment when the number of existing Cell types in the population drops below a threshold. This allows experiments to end earlier than the configured number if epochs have passed or experiments to not specify the total number of epochs to observe. ...
[ 1, 529, 276, 1112, 420, 29958, 29890, 374, 392, 535, 9139, 368, 29914, 344, 5779, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 15945, 29908, 22303, 278, 7639, 746, 278, 1353, 310, 5923, 19413, ...
examples/chanlun/feature/03/ex_setup_commands.py
garywangiam02/vnpy
0
67069
# coding=utf-8 from pytdx.parser.base import BaseParser from pytdx.helper import get_datetime, get_volume, get_price from collections import OrderedDict import struct class ExSetupCmd1(BaseParser): def setup(self): # self.send_pkg = bytearray.fromhex("01 01 48 65 00 01 52 00 52 00 54 24 1f 32 c6 e5" ...
[ 1, 396, 14137, 29922, 9420, 29899, 29947, 13, 13, 3166, 11451, 1594, 29916, 29889, 16680, 29889, 3188, 1053, 7399, 11726, 13, 3166, 11451, 1594, 29916, 29889, 20907, 1053, 679, 29918, 12673, 29892, 679, 29918, 24623, 29892, 679, 29918, 9175...
asyncupbankapi/models/__init__.py
unchartedshark/async-up-bank-api
1
95562
<gh_stars>1-10 """Typed python client for interacting with Up's banking API.""" from asyncupbankapi.models.accounts import Account, Accounts from asyncupbankapi.models.categories import Category, Categories from asyncupbankapi.models.tags import Tags from asyncupbankapi.models.transactions import Transaction, Trans...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 15945, 29908, 24933, 287, 3017, 3132, 363, 16254, 292, 411, 5020, 29915, 29879, 9124, 292, 3450, 1213, 15945, 30004, 13, 3166, 7465, 786, 9157, 2754, 29889, 9794, 298...
hikari/api/special_endpoints.py
patchwork-systems/hikari
0
195915
<reponame>patchwork-systems/hikari # -*- coding: utf-8 -*- # cython: language_level=3 # Copyright (c) 2020 Nekokatt # Copyright (c) 2021-present davfsa # # 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 th...
[ 1, 529, 276, 1112, 420, 29958, 5041, 1287, 29899, 5205, 29879, 29914, 29882, 638, 1306, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 29937, 274, 1656, 29901, 4086, 29918, 5563, 29922, 29941, 13, ...
demo/mislabelled_data_demo.py
bottydim/dginn
0
1615850
<reponame>bottydim/dginn<gh_stars>0 if __name__ == '__main__': import tensorflow as tf tf.compat.v1.enable_eager_execution() from aggregator_utils import get_count_aggregators, uncertainty_pred, compute_dg from core import * from dataset_utils import filter_dataset from mnist_loader import load_mnist, get_mnist...
[ 1, 529, 276, 1112, 420, 29958, 7451, 1017, 6229, 29914, 20726, 2559, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 1053, 26110, 408, 15886, 13, 1678, 15886, 29889, 1...
tools/pycocoEval.py
Manthata/hrnet
80
171187
import matplotlib.pyplot as plt from pycocotools.coco import COCO from pycocotools.cocoeval import COCOeval import numpy as np import skimage.io as io import ipdb;pdb=ipdb.set_trace from collections import OrderedDict # markdown format output def _print_name_value(name_value, full_arch_name): names = name_value.ke...
[ 1, 1053, 22889, 29889, 2272, 5317, 408, 14770, 13, 3166, 282, 11078, 542, 327, 8789, 29889, 29883, 6235, 1053, 4810, 3217, 13, 3166, 282, 11078, 542, 327, 8789, 29889, 29883, 6235, 14513, 1053, 4810, 3217, 14513, 13, 5215, 12655, 408, 7...
image_classification/token_labeling/tlt/models/lvvit.py
AK391/UniFormer
367
89498
<reponame>AK391/UniFormer<filename>image_classification/token_labeling/tlt/models/lvvit.py import torch import torch.nn as nn from timm.models.helpers import load_pretrained from timm.models.registry import register_model from timm.models.layers import trunc_normal_ from timm.models.resnet import resnet26d, resnet50d,...
[ 1, 529, 276, 1112, 420, 29958, 22311, 29941, 29929, 29896, 29914, 8110, 2500, 261, 29966, 9507, 29958, 3027, 29918, 1990, 2450, 29914, 6979, 29918, 1643, 292, 29914, 29873, 1896, 29914, 9794, 29914, 28463, 29894, 277, 29889, 2272, 13, 5215,...
gputools/denoise/denoise_filter2.py
VolkerH/gputools
0
119149
<reponame>VolkerH/gputools<gh_stars>0 """ A collection of some denoising algorithms in 2d MW, 2014 """ from __future__ import print_function, unicode_literals, absolute_import, division import numpy as np import subprocess import logging logger = logging.getLogger(__name__) def bilateral(data, fSize, sigma, sigma_x...
[ 1, 529, 276, 1112, 420, 29958, 13072, 3946, 29950, 29914, 29887, 649, 8789, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 15945, 29908, 13, 29909, 4333, 310, 777, 972, 29877, 5921, 14009, 297, 29871, 29906, 29881, 13, 13, 25365, 29892...
tests/strategies/base.py
lycantropos/clipping
4
47439
from fractions import Fraction from functools import partial from hypothesis import strategies MAX_NUMBER = 10 ** 10 MIN_NUMBER = -MAX_NUMBER coordinates_strategies_factories = { float: partial(strategies.floats, allow_nan=False, allow_infinity=False), Fraction: partial(s...
[ 1, 515, 5227, 1953, 1053, 7347, 428, 13, 3166, 2090, 312, 8789, 1053, 7687, 13, 13, 3166, 20051, 1053, 16650, 583, 13, 13, 12648, 29918, 23207, 353, 29871, 29896, 29900, 3579, 29871, 29896, 29900, 13, 16173, 29918, 23207, 353, 448, 1264...
speech_to_text_azure.py
jaykasundra2/Speech_To_Text
0
180496
# Convert the differnt audio formats into .wav format import subprocess, os os.chdir(r'D:\STT\src') # audio file formats are converted using ffmpeg tool # set the path where the executable (.exe) file is located # download ffmpeg build from https://ffmpeg.zeranoe.com/builds/ and place it in your project folder # ffm...
[ 1, 396, 14806, 278, 1163, 593, 10348, 21971, 964, 869, 29893, 485, 3402, 29871, 13, 5215, 1014, 5014, 29892, 2897, 13, 359, 29889, 305, 3972, 29898, 29878, 29915, 29928, 3583, 1254, 29911, 29905, 4351, 1495, 29871, 13, 13, 29937, 10348, ...
shop/admin.py
Zadigo/mycommerce
0
162772
from django.contrib import admin from jsonschema import ValidationError from shop.models import (Image, Like, Product, Video, Wishlist) import random from shop.utils import create_product_slug @admin.register(Product) class ProductAdmin(admin.ModelAdmin): list_display = ['name', 'color',...
[ 1, 515, 9557, 29889, 21570, 1053, 4113, 13, 3166, 6965, 787, 305, 2603, 1053, 15758, 362, 2392, 13, 13, 3166, 18296, 29889, 9794, 1053, 313, 2940, 29892, 8502, 29892, 10969, 29892, 13987, 29892, 13, 462, 308, 399, 728, 1761, 29897, 13, ...
src/custom_layers.py
iamsoroush/TensorflowCPM
0
148692
import tensorflow.keras as tfk class InstanceNorm(tfk.layers.Layer): """Instance normalization layer. Normalizes the activations of the previous layer at each step, i.e. applies a transformation that maintains the mean activation of each feature map for each instance in batch close to 0 and the stand...
[ 1, 1053, 26110, 29889, 3946, 294, 408, 15886, 29895, 13, 13, 13, 1990, 2799, 749, 29940, 555, 29898, 13264, 29895, 29889, 29277, 29889, 14420, 1125, 13, 1678, 9995, 4998, 4226, 2133, 7546, 29889, 13, 13, 1678, 21981, 7093, 278, 5039, 80...
contextual-multimodal-fusion/create_data.py
ggzhang0071/multimodal-deep-learning
0
146637
<reponame>ggzhang0071/multimodal-deep-learning<gh_stars>0 ## Credits: https://github.com/SenticNet/contextual-utterance-level-multimodal-sentiment-analysis ## ## Authors: <NAME>, <NAME> ## ## Modified for Python 3.5 ## import numpy as np, pandas as pd from collections import defaultdict import pickle from sklearn impo...
[ 1, 529, 276, 1112, 420, 29958, 1505, 29920, 11895, 29900, 29900, 29955, 29896, 29914, 4713, 326, 397, 284, 29899, 24535, 29899, 21891, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 2277, 24596, 1169, 29901, 2045, 597, 3292, 29889, 510, ...
ifaces/management/__init__.py
RossBrunton/RThing
0
164825
<filename>ifaces/management/__init__.py """Management modules for ifaces"""
[ 1, 529, 9507, 29958, 361, 3302, 29914, 21895, 29914, 1649, 2344, 26914, 2272, 13, 15945, 29908, 27107, 10585, 363, 565, 3302, 15945, 29908, 13, 2 ]
tests/test_calc.py
aldencolerain/rxtouchtoggle
0
107868
# test add function def test_example(): assert True
[ 1, 396, 1243, 788, 740, 13, 1753, 1243, 29918, 4773, 7295, 13, 1678, 4974, 5852, 13, 2 ]
tests/test_unit/test_md2po2md/test_md2po2md_cli.py
mondeja/md2po
0
84747
<filename>tests/test_unit/test_md2po2md/test_md2po2md_cli.py """Tests for ``md2po2md`` CLI""" import os import pytest from mdpo.md2po2md.__main__ import run @pytest.mark.parametrize('output_arg', ('-o', '--output')) @pytest.mark.parametrize('langs_arg', ('-l', '--lang')) @pytest.mark.parametrize('all_langs_in_same...
[ 1, 529, 9507, 29958, 21150, 29914, 1688, 29918, 5441, 29914, 1688, 29918, 3487, 29906, 1129, 29906, 3487, 29914, 1688, 29918, 3487, 29906, 1129, 29906, 3487, 29918, 11303, 29889, 2272, 13, 15945, 29908, 24376, 363, 4954, 3487, 29906, 1129, ...
pyslowloris/__main__.py
goasdsdkai/daas
75
129362
""" MIT License Copyright (c) 2017 <NAME> 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, publish, distri...
[ 1, 9995, 13, 26349, 19245, 13, 13, 11882, 1266, 313, 29883, 29897, 29871, 29906, 29900, 29896, 29955, 529, 5813, 29958, 13, 13, 27293, 338, 1244, 1609, 16896, 29892, 3889, 310, 8323, 29892, 304, 738, 2022, 4017, 292, 263, 3509, 13, 974,...
project/handler/type/request.py
SnackChain/SnackPi
0
72748
<reponame>SnackChain/SnackPi<filename>project/handler/type/request.py import requests from handler.type.handler import AbstractInstructionHandler from handler.operation.client import OperationClient class RequestInstruction(): def __init__(self, url, method, headers = None, parameters = None, request_source = None, r...
[ 1, 529, 276, 1112, 420, 29958, 29903, 29876, 547, 14688, 29914, 29903, 29876, 547, 12197, 29966, 9507, 29958, 4836, 29914, 13789, 29914, 1853, 29914, 3827, 29889, 2272, 13, 5215, 7274, 13, 3166, 7834, 29889, 1853, 29889, 13789, 1053, 25513,...
asynchronous_qiwi/models/QIWIWallet/master_m/list_qvc.py
LexLuthorReal/asynchronous_qiwi
3
20624
<reponame>LexLuthorReal/asynchronous_qiwi<filename>asynchronous_qiwi/models/QIWIWallet/master_m/list_qvc.py from loguru import logger import datetime from pydantic.fields import ModelField from typing import Optional, List, Union, Any from ....utils.tools.str_datetime import convert from pydantic import BaseModel, Fiel...
[ 1, 529, 276, 1112, 420, 29958, 29931, 735, 29931, 329, 2015, 21713, 29914, 294, 15374, 29918, 26461, 4353, 29966, 9507, 29958, 294, 15374, 29918, 26461, 4353, 29914, 9794, 29914, 29984, 29902, 22119, 29956, 284, 1026, 29914, 6207, 29918, 29...
kg.py
Jie-Yuan/BaiduAI-sdk
0
182771
<filename>kg.py<gh_stars>0 import json import urllib import requests import json import urllib import requests class BaiDuNLP(object): def __init__(self, api_key='<KEY>', secret_key='<KEY>'): self.access_token = None self._get_access_token(api_key, secret_key) def predict(self, text, api_...
[ 1, 529, 9507, 29958, 9415, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 4390, 13, 5215, 3142, 1982, 13, 13, 5215, 7274, 13, 13, 13, 5215, 4390, 13, 5215, 3142, 1982, 13, 13, 5215, 7274, 13, 13, 13, 1990, 350,...
flir_lepton_auxiliary/scripts/produce_dataset.py
angetria/flir_lepton_rpi2
15
85046
#!usr/bin/python import sys # The area of interest(pixels) to find the mean temperature x1 = 52 x2 = 54 y1 = 18 y2 = 20 # The area of neutral pixels to find the mean temperature x3 = 66 x4 = 68 y3 = 6 y4 = 8 # Make the dataset from raw pixel flir-lepton images. try: dataset = open("dataset.iemb","w") except IOE...
[ 1, 396, 29991, 4855, 29914, 2109, 29914, 4691, 13, 13, 5215, 10876, 13, 13, 29937, 450, 4038, 310, 4066, 29898, 29886, 861, 1379, 29897, 304, 1284, 278, 2099, 10430, 13, 29916, 29896, 353, 29871, 29945, 29906, 13, 29916, 29906, 353, 298...
aasaan/utils/datedeux.py
deepakkt/aasaan
0
117147
'''Copyright 2017, Deepak Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions i...
[ 1, 14550, 11882, 1266, 29871, 29906, 29900, 29896, 29955, 29892, 21784, 557, 13, 13, 9039, 391, 3224, 322, 671, 297, 2752, 322, 7581, 7190, 29892, 411, 470, 1728, 21733, 29892, 526, 21905, 4944, 393, 278, 1494, 5855, 526, 1539, 29901, 1...
hexrd/ui/color_map_editor.py
HEXRD/hexrdgui
13
199875
import copy from matplotlib import cm import matplotlib.colors import numpy as np import hexrd.ui.constants from hexrd.ui.brightness_contrast_editor import BrightnessContrastEditor from hexrd.ui.hexrd_config import HexrdConfig from hexrd.ui.ui_loader import UiLoader from hexrd.ui.utils import block_signals class C...
[ 1, 1053, 3509, 13, 13, 3166, 22889, 1053, 7477, 13, 5215, 22889, 29889, 27703, 13, 13, 5215, 12655, 408, 7442, 13, 13, 5215, 15090, 5499, 29889, 1481, 29889, 3075, 1934, 13, 3166, 15090, 5499, 29889, 1481, 29889, 1182, 523, 2264, 29918,...
Domotique/Temperature Fablab/temperature.py
LaFabrickMassy/Projet-Fablab
0
53332
import board import adafruit_ahtx0 from datetime import datetime html_dir = "/var/www/html/temp" data_fname = "temperature.csv" html_fname = "index.html" sensor = adafruit_ahtx0.AHTx0(board.I2C()) temp = sensor.temperature hum = sensor.relative_humidity now = datetime.now() # open data file history = [] with open...
[ 1, 1053, 7613, 13, 5215, 594, 2142, 9216, 29918, 29874, 400, 29916, 29900, 13, 3166, 12865, 1053, 12865, 13, 13, 1420, 29918, 3972, 353, 5591, 1707, 29914, 1636, 29914, 1420, 29914, 7382, 29908, 13, 1272, 29918, 29888, 978, 353, 376, 12...
pandas/main.py
monishshah18/python-cp-cheatsheet
140
14032
<gh_stars>100-1000 """ Summarize a column total cases column and total deaths column Country by country data in columns, sum up and match global totals """ import csv import pandas pandas.set_option("display.max_rows", None, "display.max_columns", None) col_list = ["Total Cases", "Country/ Other", "Total Deaths", "#...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29900, 29900, 29899, 29896, 29900, 29900, 29900, 13, 15945, 29908, 13, 11139, 3034, 675, 263, 1897, 3001, 4251, 1897, 322, 3001, 4892, 29879, 1897, 29871, 13, 20779, 491, 4234, 848, 297, 4341...
apps/restaccount/resources.py
solatis/microservices
38
24420
import json import falcon import time import uuid import requests from apps.database import init_db, db_session from apps.models import Account from apps.restaccount.logging import logging logger = logging.getLogger(__name__) from decouple import config ES_HOST = config('EVENTSTORE_HOST', default='eventstore') ES_PO...
[ 1, 1053, 4390, 13, 5215, 11092, 535, 13, 5215, 931, 13, 5215, 318, 5416, 13, 5215, 7274, 13, 3166, 11446, 29889, 9803, 1053, 2069, 29918, 2585, 29892, 4833, 29918, 7924, 13, 3166, 11446, 29889, 9794, 1053, 16535, 13, 13, 3166, 11446, ...
secondtest/2012/2gauss-seidel.py
JoaoCostaIFG/MNUM
1
1613988
<reponame>JoaoCostaIFG/MNUM #!/usr/bin/env python3 # CHECKED # The answers on the pdf were wrong, except for the first value of x1 # (I believe mine are right because I get the same results when using old, correct. code) # a) n = 4 # matrix order A = [[4.9, -1, -1, 1], [-1, 4.8, 1, -1], [-1, 2, 4.8, -1], [2, -1, -1,...
[ 1, 529, 276, 1112, 420, 29958, 10844, 6241, 29907, 16233, 6545, 29954, 29914, 29924, 13967, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 29941, 13, 13, 29937, 23557, 3352, 13, 29937, 450, 6089, 373, 278, 13552, 892, 2743, 29892...
compile.py
Eleyvie/wreck
1
134519
<reponame>Eleyvie/wreck<filename>compile.py WRECK_VERSION = '1.0.1' # DONE: # new command line parameter: `test`. WRECK will compile the module but won't save anything on disk. Essentially a syntax check. # PLANNED: # local variable lifetime check (paranoia mode) # trace local declaration in all conditional br...
[ 1, 529, 276, 1112, 420, 29958, 29923, 2330, 25965, 29914, 29893, 18217, 29966, 9507, 29958, 12198, 29889, 2272, 13, 29956, 1525, 7077, 29918, 16358, 353, 525, 29896, 29889, 29900, 29889, 29896, 29915, 30004, 13, 30004, 13, 29937, 360, 12413...
mmtbx/bulk_solvent/f_model_all_scales.py
dperl-sol/cctbx_project
155
22809
<reponame>dperl-sol/cctbx_project from __future__ import absolute_import, division, print_function from cctbx.array_family import flex from cctbx import adptbx from mmtbx import bulk_solvent from cctbx.array_family import flex from cctbx import adptbx import mmtbx from libtbx import group_args import mmtbx.arrays impor...
[ 1, 529, 276, 1112, 420, 29958, 29881, 22032, 29899, 2929, 29914, 29883, 312, 29890, 29916, 29918, 4836, 13, 3166, 4770, 29888, 9130, 1649, 1053, 8380, 29918, 5215, 29892, 8542, 29892, 1596, 29918, 2220, 13, 3166, 274, 312, 29890, 29916, 2...
codeswiftr/app_stats/apps.py
bogdan-veliscu/dev-portfolio-website
0
111728
from django.apps import AppConfig class AppStatsConfig(AppConfig): name = 'app_stats'
[ 1, 515, 9557, 29889, 13371, 1053, 2401, 3991, 13, 13, 13, 1990, 2401, 25060, 3991, 29898, 2052, 3991, 1125, 13, 1678, 1024, 353, 525, 932, 29918, 16202, 29915, 13, 2 ]
fbExceptionMeansSocketShutdown.py
SkyLined/mTCPIPConnection
1
1609623
import socket; def fbExceptionMeansSocketShutdown(oException): return ( (oException.__class__ == socket.error and oException.errno in [ 0x274A # WSAESHUTDOWN ]) );
[ 1, 1053, 9909, 29936, 13, 13, 1753, 285, 29890, 2451, 6816, 550, 11373, 2713, 329, 3204, 29898, 29877, 2451, 1125, 13, 29871, 736, 313, 13, 1678, 313, 29877, 2451, 17255, 1990, 1649, 1275, 9909, 29889, 2704, 322, 288, 2451, 29889, 3127,...
apps/cc_cms/admin.py
FreeOurKnowledge/old_platform
11
164027
<filename>apps/cc_cms/admin.py from django_summernote.admin import SummernoteModelAdmin from .models import Page, ColumnsSection, Content, DynamicText class PageAdmin(SummernoteModelAdmin): summernote_fields = '__all__' def register_cms(admin_site): admin_site.register(Page, PageAdmin) admin_site.regist...
[ 1, 529, 9507, 29958, 13371, 29914, 617, 29918, 29883, 1516, 29914, 6406, 29889, 2272, 13, 3166, 9557, 29918, 2083, 29885, 824, 866, 29889, 6406, 1053, 6991, 29885, 824, 866, 3195, 12754, 13, 3166, 869, 9794, 1053, 9305, 29892, 12481, 2987...
pylib/gna/bundles/parameters_yaml_v01.py
gnafit/gna
5
117794
<gh_stars>1-10 """Parameters_yaml v01 bundle Based on: parameters_v03 Implements a set of parameters. New features include: - [v01] read data from yaml file """ from load import ROOT as R from gna.bundle.bundle import * import numpy as np from gna import constructors as C import yaml class parameters_yaml_v01(T...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 13, 15945, 29908, 11507, 29918, 25162, 325, 29900, 29896, 11846, 13, 29933, 1463, 373, 29901, 4128, 29918, 29894, 29900, 29941, 13, 13, 1888, 9711, 263, 731, 310, 412...
LeetCode/HashTable/204. Count Primes.py
thehanemperor/LeetCode
0
169713
# EASY # find all multiples less than n # ex Input 6 # arr = [1:True, 2:True ,3:True ,4:True ,5:True ] # start from 2, mark 2*2, 2*3, 2*4 ... False # Time O(N^2) Space O(N) class Solution: def countPrimes(self, n: int) -> int: arr = [1 for _ in range(n)] count = 0 ...
[ 1, 396, 382, 3289, 29979, 29871, 13, 29937, 1284, 599, 2473, 2701, 3109, 1135, 302, 29871, 13, 29937, 268, 429, 29871, 10567, 29871, 29953, 13, 29937, 632, 3948, 353, 518, 29896, 29901, 5574, 29892, 29871, 29906, 29901, 5574, 1919, 29941,...
simulation/model/blocks/order.py
fladdimir/csa-simulation-based-sc-forecast
2
40082
import logging from casymda.blocks.entity import Entity from simpy.core import Environment class Order(Entity): def __init__(self, env: Environment, name: str): super().__init__(env, name) self._time_of_acceptance = -1 self._initial_eta = -1 self._eta = -1 self._ready_at ...
[ 1, 1053, 12183, 13, 13, 3166, 3209, 962, 1388, 29889, 1271, 29879, 29889, 10041, 1053, 14945, 13, 3166, 1027, 2272, 29889, 3221, 1053, 16738, 13, 13, 13, 1990, 8170, 29898, 6691, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 8829...
main_a2c.py
WeiChengTseng/DL_final_project
7
143661
<reponame>WeiChengTseng/DL_final_project<filename>main_a2c.py import argparse import torch import torch.optim as optim import os # from baselines.common.vec_env.subproc_vec_env import SubprocVecEnv # from baselines.common.vec_env.vec_frame_stack import VecFrameStack from a2c.models import AtariCNN, A2C, A2CLarge # fr...
[ 1, 529, 276, 1112, 420, 29958, 4806, 29875, 1451, 996, 29911, 29879, 996, 29914, 19558, 29918, 8394, 29918, 4836, 29966, 9507, 29958, 3396, 29918, 29874, 29906, 29883, 29889, 2272, 13, 5215, 1852, 5510, 13, 5215, 4842, 305, 13, 5215, 4842...
code/micropython/robotling_lib/driver/lsm303.py
teuler/robotling2
6
1616475
# ---------------------------------------------------------------------------- # lsm303.py # Class for LSM303 accelerometer/magnetometer driver # # The MIT License (MIT) # Copyright (c) 2018-19 <NAME> # 2018-09-13, v1 # 2018-10-26, bug fix sequence of magnetometer values from I2C call is x,z,y # # Based on the CircuitP...
[ 1, 396, 448, 2683, 2683, 2683, 2683, 1378, 5634, 13, 29937, 301, 3844, 29941, 29900, 29941, 29889, 2272, 13, 29937, 4134, 363, 365, 17061, 29941, 29900, 29941, 15592, 8328, 29914, 11082, 1212, 8328, 7156, 13, 29937, 13, 29937, 450, 341, ...
pythonProject/q46.py
Babur171/python
0
154520
string = "blackEyes" s = {string: (string[::2], string[1::2])} print(s)
[ 1, 1347, 353, 376, 8517, 29923, 3582, 29908, 13, 29879, 353, 426, 1807, 29901, 313, 1807, 29961, 1057, 29906, 1402, 1347, 29961, 29896, 1057, 29906, 2314, 29913, 13, 2158, 29898, 29879, 29897, 13, 2 ]
attention_to_gif/visualizer.py
valayDave/attention_to_gif
0
124692
<filename>attention_to_gif/visualizer.py # importing matplot lib import matplotlib.pyplot as plt import numpy as np import torch # importig movie py libraries from moviepy.editor import VideoClip from moviepy.video.io.bindings import mplfig_to_npimage class AttentionVisualizer: """ Creates a GIF of the t...
[ 1, 529, 9507, 29958, 1131, 2509, 29918, 517, 29918, 18660, 29914, 20119, 3950, 29889, 2272, 13, 29937, 28348, 1775, 5317, 4303, 29871, 13, 5215, 22889, 29889, 2272, 5317, 408, 14770, 29871, 13, 5215, 12655, 408, 7442, 29871, 13, 5215, 484...
python-is-easy/assignments/snowman/main.py
eDyablo/pirple
0
10767
<filename>python-is-easy/assignments/snowman/main.py<gh_stars>0 ''' Homework assignment for the 'Python is easy' course by Pirple. Written be <NAME>. Snowman(Hangman) game. ''' from os import ( name as os_name, system as system_call, ) from os.path import ( abspath, dirname, join as join_path, )...
[ 1, 529, 9507, 29958, 4691, 29899, 275, 29899, 29872, 8995, 29914, 16645, 1860, 29914, 29879, 3707, 1171, 29914, 3396, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 12008, 13, 11184, 1287, 12827, 363, 278, 525, 11980, 338, ...
PythonExercicios/Mundo 2/8_estrutura_de_repeticao_for/ex051.py
GuilhermoCampos/Curso-Python3-curso-em-video
0
159848
print('{}\n {:^25}\n {}\n'.format('='*25, '10 TERMOS DE UMA PA', '='*25), end=' ') primeiro = int(input('Primeiro Termo: ')) razao = int(input(' Razão: ')) acumulador = 0 for c in range(0, 10): print(primeiro + acumulador, '=> ', end='') acumulador += razao print('ACABOU')
[ 1, 1596, 877, 29912, 1012, 29876, 12365, 29985, 29906, 29945, 1012, 29876, 426, 1012, 29876, 4286, 4830, 877, 2433, 29930, 29906, 29945, 29892, 525, 29896, 29900, 323, 1001, 29924, 3267, 5012, 501, 1529, 17687, 742, 525, 2433, 29930, 29906,...
tests/unit/test_albums.py
movermeyer/openphoto-python
3
173059
from __future__ import unicode_literals import mock try: import unittest2 as unittest # Python2.6 except ImportError: import unittest import trovebox class TestAlbums(unittest.TestCase): test_host = "test.example.com" test_photos_dict = [{"id": "1a", "tags": ["tag1", "tag2"]}, ...
[ 1, 515, 4770, 29888, 9130, 1649, 1053, 29104, 29918, 20889, 1338, 13, 5215, 11187, 13, 2202, 29901, 13, 1678, 1053, 443, 27958, 29906, 408, 443, 27958, 396, 5132, 29906, 29889, 29953, 13, 19499, 16032, 2392, 29901, 13, 1678, 1053, 443, ...
constants/nodetype.py
vladzaharia/meshnet
1
36020
# Node types TYPE_NODE = b'\x10' TYPE_NODE_NR = b'\x11' # Gateway types TYPE_GATEWAY = b'\x20' TYPE_GATEWAY_TIME = b'\x21' # Special types TYPE_PROVISIONING = b'\xFF'
[ 1, 396, 9071, 4072, 13, 11116, 29918, 6632, 2287, 353, 289, 12764, 29916, 29896, 29900, 29915, 13, 11116, 29918, 6632, 2287, 29918, 16514, 353, 289, 12764, 29916, 29896, 29896, 29915, 13, 13, 29937, 22510, 1582, 4072, 13, 11116, 29918, 29...
setup.py
adobe/havoc
3
183924
#!/usr/bin/env python from setuptools import setup, find_packages setup(name='havoc', version='0.1.0', description='HAvOC (HAproxy clOud Configuration)', author='TubeMogul Inc.', install_requires=[ 'python-daemon', 'jinja2', 'click', 'boto...
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 13, 3166, 731, 21245, 8789, 1053, 6230, 29892, 1284, 29918, 8318, 13, 13, 14669, 29898, 978, 2433, 8708, 542, 742, 13, 4706, 1873, 2433, 29900, 29889, 29896, 29889, 29900, 742, 13, 4706, 6...
Codeforces/452/B.py
zzh8829/CompetitiveProgramming
1
92176
<filename>Codeforces/452/B.py from math import * def d(p1x,p1y,p2x,p2y,p3x,p3y,p4x,p4y): if len(set([(p1x,p1y),(p2x,p2y),(p3x,p3y),(p4x,p4y)])) != 4: return (0,0) dis = sqrt((p2x-p1x)*(p2x-p1x) + (p2y-p1y)*(p2y-p1y)) + \ sqrt((p3x-p2x)*(p3x-p2x) + (p3y-p2y)*(p3y-p2y)) + \ sqrt((p4x-p3x)*(p4x-p3x) + (p4y...
[ 1, 529, 9507, 29958, 3399, 1454, 778, 29914, 29946, 29945, 29906, 29914, 29933, 29889, 2272, 13, 3166, 5844, 1053, 334, 30004, 13, 30004, 13, 1753, 270, 29898, 29886, 29896, 29916, 29892, 29886, 29896, 29891, 29892, 29886, 29906, 29916, 298...
tica_models.py
DEIB-GECO/TICA_v2
0
1603681
<filename>tica_models.py # This is an auto-generated Django model module. # You'll have to do the following manually to clean this up: # * Rearrange models' order # * Make sure each model has one field with primary_key=True # * Make sure each ForeignKey has `on_delete` set to the desired behavior. # * Remove `m...
[ 1, 529, 9507, 29958, 29873, 983, 29918, 9794, 29889, 2272, 13, 29937, 910, 338, 385, 4469, 29899, 13525, 15337, 1904, 3883, 29889, 13, 29937, 887, 29915, 645, 505, 304, 437, 278, 1494, 7522, 304, 5941, 445, 701, 29901, 13, 29937, 259, ...
Users/models.py
titusnjuguna/FreeDom
1
4604
from django.db import models from django.contrib.auth.models import User from PIL import Image class Profile(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE) image = models.ImageField(default='default.jpg', upload_to='profile_pic/') ...
[ 1, 515, 9557, 29889, 2585, 1053, 4733, 13, 3166, 9557, 29889, 21570, 29889, 5150, 29889, 9794, 1053, 4911, 13, 3166, 349, 6227, 1053, 7084, 13, 13, 1990, 20802, 29898, 9794, 29889, 3195, 1125, 13, 1678, 1404, 353, 4733, 29889, 27755, 25...
bcipy/acquisition/protocols/lsl/lsl_device.py
theGreenJedi/BciPy
0
74765
<reponame>theGreenJedi/BciPy # pylint: disable=fixme """Defines the driver for the Device for communicating with LabStreamingLayer (LSL).""" import logging import pylsl from bcipy.acquisition.protocols.device import Device log = logging.getLogger(__name__) LSL_TIMESTAMP = 'LSL_timestamp' class Marker(): """Dat...
[ 1, 529, 276, 1112, 420, 29958, 1552, 24599, 29967, 15844, 29914, 29933, 455, 19737, 13, 29937, 282, 2904, 524, 29901, 11262, 29922, 5878, 1004, 13, 15945, 29908, 3206, 1475, 278, 7156, 363, 278, 21830, 363, 7212, 1218, 411, 13, 28632, 3...
applications/reports/process/data_service.py
ebs-integrator/bic-reporting-api
1
153362
import os import pathlib from lxml import etree from abc import ABC from datetime import datetime from xml.etree import ElementTree from applications.reports.process.flow_data_service import FlowDataService class DataService(FlowDataService, ABC): # Credentials username = '' password =...
[ 1, 1053, 2897, 30004, 13, 5215, 2224, 1982, 30004, 13, 30004, 13, 3166, 301, 3134, 1053, 634, 929, 30004, 13, 30004, 13, 3166, 25638, 1053, 16417, 30004, 13, 3166, 12865, 1053, 12865, 30004, 13, 30004, 13, 3166, 4903, 29889, 300, 929, ...
kmd_labs/oracles/listassetchains.py
smk762/kmd_pulp
2
182161
<filename>kmd_labs/oracles/listassetchains.py #!/usr/bin/env python2 import os import json #script_dir = os.getcwd() HOME = os.environ['HOME'] with open(HOME + '/StakedNotary/assetchains.json') as file: assetchains = json.load(file) for chain in assetchains: print(chain['ac_name'])
[ 1, 529, 9507, 29958, 29895, 3487, 29918, 29880, 6897, 29914, 272, 23435, 29914, 1761, 465, 3486, 2708, 29889, 2272, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 29906, 13, 5215, 2897, 13, 5215, 4390, 13, 13, 29937, 2154, 29918,...
migrations/versions/ddf3cbc60873_.py
MaxHorwood/crude_backend_skeleton
0
63802
"""empty message Revision ID: ddf3cbc60873 Revises: x Create Date: 2020-08-22 17:27:08.449495 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = "<KEY>" down_revision = None branch_labels = None depends_on = None def upgrade(): # ### commands auto generated ...
[ 1, 9995, 6310, 2643, 13, 13, 1123, 4924, 3553, 29901, 270, 2176, 29941, 10702, 29883, 29953, 29900, 29947, 29955, 29941, 13, 1123, 1730, 267, 29901, 921, 13, 4391, 4712, 29901, 29871, 29906, 29900, 29906, 29900, 29899, 29900, 29947, 29899, ...
fbchat/utils.py
Dainius14/fb-chat-bot-old
2
19916
<reponame>Dainius14/fb-chat-bot-old<filename>fbchat/utils.py import re import json from time import time from random import random USER_AGENTS = [ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36", "Mozilla/5.0 (Macintosh; Intel Mac OS X 1...
[ 1, 529, 276, 1112, 420, 29958, 29928, 475, 2482, 29896, 29946, 29914, 14943, 29899, 13496, 29899, 7451, 29899, 1025, 29966, 9507, 29958, 14943, 13496, 29914, 13239, 29889, 2272, 13, 5215, 337, 13, 5215, 4390, 13, 3166, 931, 1053, 931, 13,...