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
smapy/utils.py
pvk-developer/smapy
3
154718
# -*- coding: utf-8 -*- import configparser import copy import importlib import os import pkgutil from collections import defaultdict def find_subclasses(parent_class, recursive=False): """Find the subclasses of a given parent class.""" subclasses = parent_class.__subclasses__() if recursive: fo...
[ 1, 396, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 13, 5215, 2295, 16680, 13, 5215, 3509, 13, 5215, 1053, 1982, 13, 5215, 2897, 13, 5215, 282, 9415, 4422, 13, 3166, 16250, 1053, 2322, 8977, 13, 13, 13...
handlers/play.py
Gautampro1834/Telegram_Vc_Bot
0
192982
<reponame>Gautampro1834/Telegram_Vc_Bot from os import path from typing import Dict from pyrogram import Client from pyrogram.types import Message, Voice from typing import Callable, Coroutine, Dict, List, Tuple, Union from callsmusic import callsmusic, queues from helpers.admins import get_administrators from os impor...
[ 1, 529, 276, 1112, 420, 29958, 29954, 1300, 314, 771, 29896, 29947, 29941, 29946, 29914, 29911, 6146, 1393, 29918, 29963, 29883, 29918, 29933, 327, 13, 3166, 2897, 1053, 2224, 13, 3166, 19229, 1053, 360, 919, 13, 3166, 11451, 307, 1393, ...
codesignal/arcade/python/intro_51_delete_digit.py
tinesife94/random
0
104224
<reponame>tinesife94/random def solution(n): s = str(n) return max(int('{}{}'.format(s[:i], s[i+1:])) for i in range(len(s)))
[ 1, 529, 276, 1112, 420, 29958, 29873, 1475, 1607, 29929, 29946, 29914, 8172, 13, 1753, 1650, 29898, 29876, 1125, 13, 1678, 269, 353, 851, 29898, 29876, 29897, 13, 1678, 736, 4236, 29898, 524, 877, 29912, 1157, 29913, 4286, 4830, 29898, ...
elasticapm/contrib/starlette/__init__.py
lavr/apm-agent-python
0
195435
# BSD 3-Clause License # # Copyright (c) 2012, the Sentry Team, see AUTHORS for more details # Copyright (c) 2019, Elasticsearch BV # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Red...
[ 1, 396, 29871, 350, 7230, 29871, 29941, 29899, 20216, 1509, 19245, 13, 29937, 13, 29937, 29871, 14187, 1266, 313, 29883, 29897, 29871, 29906, 29900, 29896, 29906, 29892, 278, 317, 8269, 8583, 29892, 1074, 26524, 29950, 24125, 363, 901, 4902...
tests/integration/commands/test_transfer.py
real-digital/esque
29
113808
<gh_stars>10-100 import time from typing import Tuple import pytest from click.testing import CliRunner from confluent_kafka.avro import AvroConsumer, AvroProducer from confluent_kafka.cimpl import Consumer from confluent_kafka.cimpl import Producer as ConfluentProducer from confluent_kafka.cimpl import TopicPartition...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29900, 29899, 29896, 29900, 29900, 13, 5215, 931, 13, 3166, 19229, 1053, 12603, 552, 13, 13, 5215, 11451, 1688, 13, 3166, 2828, 29889, 13424, 1053, 315, 492, 16802, 13, 3166, 18669, 8122, 2...
World 03/Class 17/ex079.py
DanielRios549/PythonExcercises
6
127765
<reponame>DanielRios549/PythonExcercises ''' Get an undefined numbers of values and put them in a list. In the end, show all the unique values in ascendent order. ''' values = [] while True: number = int(input('Choose a number: ')) if number not in values: print(f'\033[32mAdd the number {numbe...
[ 1, 529, 276, 1112, 420, 29958, 29866, 29934, 2363, 29945, 29946, 29929, 29914, 11980, 1252, 2265, 3476, 267, 13, 12008, 13, 1678, 3617, 385, 7580, 3694, 310, 1819, 322, 1925, 963, 297, 263, 1051, 29889, 13, 1678, 512, 278, 1095, 29892, ...
sorting/bubbleSort.py
rp581998/data-structures
0
185692
<reponame>rp581998/data-structures<gh_stars>0 '''def bubbleSort(arr): n = len(arr) for i in range(n): for j in range(0,n-i-1): if arr[j] > arr[j+1]: temp = arr[j] arr[j] = arr[j+1] arr[j+1] = temp arr = [10,9,15,1,5,2,6,3] bubbleSort(arr) prin...
[ 1, 529, 276, 1112, 420, 29958, 19080, 29945, 29947, 29896, 29929, 29929, 29947, 29914, 1272, 29899, 4984, 1973, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 12008, 1753, 289, 23232, 13685, 29898, 2749, 1125, 13, 1678, 302, 353, 7431, ...
hard-gists/1191457/snippet.py
jjhenkel/dockerizeme
21
21081
#!/usr/bin/env python import urllib import sys import json from mwlib import parser from mwlib.refine import compat if __name__ == "__main__": params = urllib.urlencode({ "format": "json", "action": "query", "prop": "revisions", "rvprop": "content", "titles": "ISO_3166-1", "rvsection": "4", }) wc = urll...
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 13, 5215, 3142, 1982, 13, 5215, 10876, 13, 5215, 4390, 13, 3166, 286, 29893, 1982, 1053, 13812, 13, 3166, 286, 29893, 1982, 29889, 999, 457, 1053, 10007, 13, 13, 361, 4770, 978, 1649, 12...
exercises/fit_gaussian_estimators.py
talazulay27/IML.HUJI
0
170652
<gh_stars>0 import numpy from plotly.subplots import make_subplots from IMLearn.learners import UnivariateGaussian, MultivariateGaussian import numpy as np import plotly.graph_objects as go import plotly.io as pio pio.templates.default = "simple_white" def test_univariate_gaussian(): # Question 1 - Draw samples...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 12655, 13, 3166, 6492, 368, 29889, 1491, 26762, 1053, 1207, 29918, 1491, 26762, 13, 3166, 306, 1988, 799, 29876, 29889, 1945, 8397, 1053, 853, 27432, 403, 29954, 17019, 29892, 9683,...
tests/artificial/test_memory.py
anrddh/memsight
1
1614889
import angr import claripy import os import sys sys.path.append(os.path.join(os.path.dirname(__file__), '../..')) from memory import factory def check(state, obj, exp_values, conditions=()): r = state.se.eval_upto(obj, len(exp_values) + 1, extra_constraints=conditions) if len(r) != len(exp_values) or set(r)...
[ 1, 1053, 385, 629, 13, 5215, 7542, 666, 29891, 13, 5215, 2897, 13, 5215, 10876, 13, 13, 9675, 29889, 2084, 29889, 4397, 29898, 359, 29889, 2084, 29889, 7122, 29898, 359, 29889, 2084, 29889, 25721, 22168, 1445, 1649, 511, 525, 6995, 636,...
config/looper.py
panoramichq/data-collection-fb
0
129464
<gh_stars>0 # flake8: noqa: E722 RUN_SWEEP_TIMEOUT = 60 * 60 # seconds RUN_TASKS_TIMEOUT = 30 * 60 # 30 minutes. FB_THROTTLING_WINDOW = 20 * 60 # 20 minutes. OOZER_ENABLE_LEARNING = True OOZER_LEARNING_RATE = 0.05 OOZER_REVIEW_INTERVAL = 10 OOZER_START_RATE = 100.0 OOZER_MIN_RATE = 10.0 # Hour, DMA, AgeGender * ...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 29937, 17422, 446, 29947, 29901, 694, 25621, 29901, 382, 29955, 29906, 29906, 13, 13, 29934, 3904, 29918, 29903, 8851, 15488, 29918, 15307, 12015, 353, 29871, 29953, 29900, 334, 29871, 2995...
spira/gdsii/cell.py
cloudcalvin/spira
0
153881
<filename>spira/gdsii/cell.py import gdspy import numpy as np from copy import copy, deepcopy from spira import param from spira.core.lists import ElementList from spira.lne import * from spira.gdsii import * from spira.core.initializer import CellInitializer from spira.core.mixin.property import CellMixin from spir...
[ 1, 529, 9507, 29958, 1028, 3055, 29914, 29887, 29881, 1039, 29875, 29914, 3729, 29889, 2272, 13, 5215, 330, 29881, 1028, 29891, 13, 5215, 12655, 408, 7442, 13, 3166, 3509, 1053, 3509, 29892, 6483, 8552, 13, 13, 3166, 805, 3055, 1053, 18...
spockpy/config/app.py
gavindsouza/spockpy
58
1601267
# imports - compatibility imports from __future__ import absolute_import # imports - module imports from spockpy.config import Config from spockpy._util import _round_int def _get_video_panel_size(length): size = _round_int(length * 0.25) return (size, size) class AppConfig(Config): WINDOW_WIDTH = 1024 WIN...
[ 1, 396, 24802, 448, 24521, 24802, 13, 3166, 4770, 29888, 9130, 1649, 1053, 8380, 29918, 5215, 13, 13, 29937, 24802, 448, 3883, 24802, 13, 3166, 805, 1698, 2272, 29889, 2917, 1053, 12782, 13, 3166, 805, 1698, 2272, 3032, 4422, 29871, 105...
tests/test_cell.py
nat-chan/nokogiri
0
1606812
<gh_stars>0 #!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys from pathlib import Path sys.path.insert(0, str(Path(__file__).resolve().parent.parent)) import unittest from nokogiri.cell import cell class test_cell(unittest.TestCase): def test_スクリプトとしてとして実行したときはラムダ式を返す(self): self.assertEqual("<lamb...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 29941, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 5215, 10876, 13, 3166, 2224, 1982, 1053, ...
mamonsu/lib/zbx_template.py
dan-aksenov/mamonsu
0
30304
<gh_stars>0 # -*- coding: utf-8 -*- from mamonsu.lib.const import Template class ZbxTemplate(object): mainTemplate = u"""<?xml version="1.0" encoding="UTF-8"?> <zabbix_export> <version>2.0</version> <groups> <group> <name>Templates</name> </group> </groups> <templates> ...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 13, 3166, 286, 314, 787, 29884, 29889, 1982, 29889, 3075, 1053, 25663, 13, 13, 13, 1990, 796, 29890, ...
tests/hadoop-etl/test/compression_types.py
mace84/script-languages
6
103490
<filename>tests/hadoop-etl/test/compression_types.py #!/usr/bin/env python2.7 # encoding: utf8 import os import sys sys.path.append(os.path.realpath(__file__ + '/../../../lib')) sys.path.append(os.path.realpath(__file__ + '/../../lib')) import udf import utils import datagen import hadoopenv class TestDeflate(util...
[ 1, 529, 9507, 29958, 21150, 29914, 22075, 29899, 300, 29880, 29914, 1688, 29914, 510, 2590, 29918, 8768, 29889, 2272, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 29906, 29889, 29955, 13, 29937, 8025, 29901, 23616, 29947, 13, 13,...
open_sea_v1/endpoints/abc.py
MyNameIsBondJamesBond/opensea-python-wrapper
14
191919
<gh_stars>10-100 from abc import ABC, abstractmethod from typing import Generator, Type from open_sea_v1.endpoints.client import ClientParams from open_sea_v1.responses.abc import BaseResponse class BaseEndpoint(ABC): @property @abstractmethod def __post_init__(self): """Using post_init to run p...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29900, 29899, 29896, 29900, 29900, 13, 3166, 25638, 1053, 16417, 29892, 9846, 5696, 13, 3166, 19229, 1053, 3251, 1061, 29892, 5167, 13, 13, 3166, 1722, 29918, 344, 29874, 29918, 29894, 29896, ...
parsifal/apps/reviews/migrations/0020_searchresult.py
ShivamPytho/parsifal
342
29244
<reponame>ShivamPytho/parsifal<filename>parsifal/apps/reviews/migrations/0020_searchresult.py # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import parsifal.apps.reviews.models import django.db.models.deletion class Migration(migrations.Migration): depen...
[ 1, 529, 276, 1112, 420, 29958, 2713, 440, 314, 29925, 1541, 29877, 29914, 862, 29879, 361, 284, 29966, 9507, 29958, 862, 29879, 361, 284, 29914, 13371, 29914, 276, 7406, 29914, 26983, 800, 29914, 29900, 29900, 29906, 29900, 29918, 4478, 2...
emotion_classifier/data/data_utilities/pkl_emotion_fixer.py
IronEdward/chatbot
0
97028
<gh_stars>0 import pickle as pkl from Functions.functions import * data = pkl.load(open("Data(new)/data.pkl", "rb")) emotion_type = pkl.load(open("Data(new)/emotion_types.pkl", "rb")) new_data = [] for i in data: new_data.append([i[0], emotion_type.index(i[1])]) pkl.dump(new_data, open("Data(new)/final_data.pkl...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 5839, 280, 408, 282, 6321, 13, 3166, 6680, 29879, 29889, 12171, 1053, 334, 13, 13, 1272, 353, 282, 6321, 29889, 1359, 29898, 3150, 703, 1469, 29898, 1482, 6802, 1272, 29889, 29886...
models/LASSO.py
MattAHarrington/crypto-comovement
1
29226
#!/usr/bin/env python # Standard imports import pandas as pd import numpy as np # Pytorch import torch from torch import nn # Using sklearn's LASSO implementation from sklearn.linear_model import Lasso # Local Files from models.model_interface import CryptoModel class LASSO(CryptoModel): """Wrapper around the ...
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 13, 13, 29937, 10117, 24802, 13, 5215, 11701, 408, 10518, 13, 5215, 12655, 408, 7442, 13, 13, 29937, 349, 3637, 25350, 13, 5215, 4842, 305, 13, 3166, 4842, 305, 1053, 302, 29876, 13, 13,...
src/util.py
BobToninho/cybersecurity-project
0
142713
<filename>src/util.py # Taken from https://github.com/ojroques/garbled-circuit import json # HELPER FUNCTIONS def parse_json(json_path): with open(json_path) as json_file: return json.load(json_file)
[ 1, 529, 9507, 29958, 4351, 29914, 4422, 29889, 2272, 13, 29937, 323, 9424, 515, 2045, 597, 3292, 29889, 510, 29914, 3848, 307, 1912, 29914, 5397, 27225, 29899, 6034, 3121, 13, 5215, 4390, 13, 13, 13, 29937, 379, 6670, 13171, 383, 28700,...
app.py
iio1989/oshite
0
12954
<gh_stars>0 from flask import Flask, render_template, request, redirect, url_for, Markup import app_helper as apHelp app = Flask(__name__) @app.route('/') def root(): return render_template('home.html') # click convetBtn. get HttpParam. @app.route('/post', methods=['GET', 'POST']) def post(): if request.meth...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 3166, 29784, 1053, 2379, 1278, 29892, 4050, 29918, 6886, 29892, 2009, 29892, 6684, 29892, 3142, 29918, 1454, 29892, 4485, 786, 13, 5215, 623, 29918, 20907, 408, 3095, 29648, 13, 13, 932, ...
tests/test_cache.py
phaustin/jupyter-cache
0
128945
<gh_stars>0 import os from textwrap import dedent import nbformat as nbf import pytest from jupyter_cache.cache.main import JupyterCacheBase from jupyter_cache.base import NbValidityError NB_PATH = os.path.join(os.path.realpath(os.path.dirname(__file__)), "notebooks") def test_basic_workflow(tmp_path): cache ...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 2897, 13, 3166, 1426, 6312, 1053, 28262, 296, 13, 13, 5215, 302, 29890, 4830, 408, 302, 1635, 13, 5215, 11451, 1688, 13, 13, 3166, 432, 786, 25547, 29918, 8173, 29889, 8173, 298...
tests/main_test.py
emilianomoscato/stl
0
189336
import pytest as pytest from main import select_tasks from task_selector.taskexceptions import EmptyFileException, \ JSONMissingFieldsExepction def test_empty_json_list(): assert select_tasks("[]") == "[]" @pytest.mark.parametrize('json_str,exception', [ ("" , EmptyFileException), ("[{'name': 'A...
[ 1, 1053, 11451, 1688, 408, 11451, 1688, 13, 3166, 1667, 1053, 1831, 29918, 20673, 13, 3166, 3414, 29918, 14357, 29889, 29873, 294, 446, 29916, 1441, 29879, 1053, 2812, 2349, 2283, 2451, 29892, 320, 13, 1678, 4663, 18552, 292, 14256, 1252,...
15-3SUM/solution.py
alfmunny/leetcode
0
36238
<gh_stars>0 class Solution: def threeSum(self, nums: List[int]) -> List[List[int]]: if len(nums) < 3: return [] ans = [] nums.sort() for i in range(0, len(nums)-2): if nums[i] > 0: break if i > 0 and nums[i-1] == nums[i]: ...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 1990, 24380, 29901, 13, 1678, 822, 2211, 11139, 29898, 1311, 29892, 954, 29879, 29901, 2391, 29961, 524, 2314, 1599, 2391, 29961, 1293, 29961, 524, 5262, 29901, 13, 4706, 565, 7431, 29898...
web/python/flask_api_mysql_pagination/movies_api/app.py
CALlanoR/virtual_environments
0
188535
<filename>web/python/flask_api_mysql_pagination/movies_api/app.py from flask import Flask from flask_cors import CORS, cross_origin from flask_jwt_extended import ( JWTManager, jwt_required, create_access_token, get_jwt_identity ) app = Flask(__name__) CORS(app)
[ 1, 529, 9507, 29958, 2676, 29914, 4691, 29914, 1579, 1278, 29918, 2754, 29918, 7938, 29918, 13573, 3381, 29914, 13529, 583, 29918, 2754, 29914, 932, 29889, 2272, 13, 3166, 29784, 1053, 2379, 1278, 13, 3166, 29784, 29918, 29883, 943, 1053, ...
models/three_layers_nn.py
erwanlecarpentier/optimistic-regressor
0
24140
<gh_stars>0 """ N layers optimistic neural network """ import torch class ThreeLayersNN(torch.nn.Module): def __init__(self, in_dim, out_dim, h_dim, activation='relu'): """ :param in_dim: (int) input dimension :param out_dim: (int) output dimension """ super(ThreeLayersNN...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 15945, 29908, 13, 29940, 15359, 5994, 4695, 19677, 3564, 13, 15945, 29908, 13, 13, 5215, 4842, 305, 13, 13, 13, 1990, 12753, 29931, 388, 414, 10262, 29898, 7345, 305, 29889, 15755, 2988...
day13.py
jm-projects/AdventOfCode2021
0
166793
from numpy.core.numeric import count_nonzero import pandas as pd import numpy as np import re data = pd.read_csv("data/day13.csv", header = None, dtype=str, delimiter= '\n')[0] codes = [re.split("\s\S\S\s", word) for word in data.values][1:] # Challenge 1 word = np.array(data.values)[0] c_dic = {c[0]:c[1] for c in co...
[ 1, 515, 12655, 29889, 3221, 29889, 21574, 1053, 2302, 29918, 5464, 9171, 13, 5215, 11701, 408, 10518, 13, 5215, 12655, 408, 7442, 13, 5215, 337, 13, 13, 1272, 353, 10518, 29889, 949, 29918, 7638, 703, 1272, 29914, 3250, 29896, 29941, 29...
timbr/machine/base_machine.py
timbr-io/timbr-python
2
187294
<reponame>timbr-io/timbr-python<gh_stars>1-10 from __future__ import print_function from multiprocessing.pool import ThreadPool import dask as da # NOTE: sync mode wil likely be faster # from dask.async import get_sync as get from dask.threaded import get _pool = ThreadPool() da.set_options(pool=_pool) try: from...
[ 1, 529, 276, 1112, 420, 29958, 9346, 1182, 29899, 601, 29914, 9346, 1182, 29899, 4691, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 3166, 4770, 29888, 9130, 1649, 1053, 1596, 29918, 2220, 13, 13, 3166, 6674, 307,...
apps/organization/urls.py
stormsha/StormOnline
18
1922
# _*_ coding: utf-8 _*_ # --------------------------- __author__ = 'StormSha' __date__ = '2018/3/28 18:01' # --------------------------- # -------------------------django---------------------- from django.conf.urls import url from .views import OrgView, AddUserAskView, OrgHomeView, OrgCourseView, OrgDescView, OrgTeach...
[ 1, 396, 903, 29930, 29918, 14137, 29901, 23616, 29899, 29947, 903, 29930, 29918, 13, 29937, 448, 2683, 28400, 13, 1649, 8921, 1649, 353, 525, 855, 555, 29903, 2350, 29915, 13, 1649, 1256, 1649, 353, 525, 29906, 29900, 29896, 29947, 29914,...
gen_phone.py
jfsantos/ift6266h14
8
198605
import cPickle as pickle import numpy as np import theano _mean = 0.0035805809921434142 _std = 542.48824133746177 def gen_phone(mdl, phones, noise_level): terr_monitor = mdl.monitor.channels['test_objective'] terr = min(terr_monitor.val_record) X = theano.tensor.dmatrix('X') P = theano.tensor.dmatrix...
[ 1, 1053, 274, 29925, 860, 280, 408, 5839, 280, 13, 5215, 12655, 408, 7442, 13, 5215, 278, 1562, 13, 13, 29918, 12676, 353, 29871, 29900, 29889, 29900, 29900, 29941, 29945, 29947, 29900, 29945, 29947, 29900, 29929, 29929, 29906, 29896, 299...
aldryn_redirects/middleware.py
chaosk/aldryn-redirects
1
1617895
from __future__ import unicode_literals from django import http from django.conf import settings from django.contrib.sites.models import Site from django.db.models import Q from .models import Redirect, StaticRedirect class RedirectFallbackMiddleware(object): def process_request(self, request): static_r...
[ 1, 515, 4770, 29888, 9130, 1649, 1053, 29104, 29918, 20889, 1338, 13, 13, 3166, 9557, 1053, 1732, 13, 3166, 9557, 29889, 5527, 1053, 6055, 13, 3166, 9557, 29889, 21570, 29889, 16315, 29889, 9794, 1053, 10781, 13, 3166, 9557, 29889, 2585, ...
magmap/cv/colocalizer.py
kaparna126/magellanmapper
10
165376
<reponame>kaparna126/magellanmapper<gh_stars>1-10 # Object colocalization # Copyright The MagellanMapper Contributors """Colocalize objects in an image, typically in separate channels.""" from enum import Enum import multiprocessing as mp import pandas as pd import numpy as np from skimage import morphology from mag...
[ 1, 529, 276, 1112, 420, 29958, 21474, 11441, 29896, 29906, 29953, 29914, 11082, 18663, 655, 2496, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 29937, 4669, 784, 18642, 2133, 13, 29937, 14187, 1266, 450, 3561, 18663...
app.py
fdoliveira/infosystem-seed
1
161225
<filename>app.py import os import app if __name__ == '__main__': app_host = os.environ.get('HOST', '0.0.0.0') app_port = int(os.environ.get('PORT', 5000)) system = app.System() system.run(host=app_host, port=app_port)
[ 1, 529, 9507, 29958, 932, 29889, 2272, 13, 5215, 2897, 13, 5215, 623, 13, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 623, 29918, 3069, 353, 2897, 29889, 21813, 29889, 657, 877, 20832, 742, 525, 29900, ...
irspack/split/userwise.py
tnakae/irspack
0
131831
<reponame>tnakae/irspack from typing import Any, Dict, List, Optional, Tuple import numpy as np import pandas as pd from numpy.lib.arraysetops import unique from scipy import sparse as sps from irspack.definitions import InteractionMatrix, OptionalRandomState from irspack.split.time import split_last_n_interaction_df...
[ 1, 529, 276, 1112, 420, 29958, 6277, 557, 3660, 29914, 381, 1028, 547, 13, 3166, 19229, 1053, 3139, 29892, 360, 919, 29892, 2391, 29892, 28379, 29892, 12603, 552, 13, 13, 5215, 12655, 408, 7442, 13, 5215, 11701, 408, 10518, 13, 3166, ...
src/pyon/util/poller.py
scionrep/scioncc_new
2
94429
#!/usr/bin/env python ''' @author <NAME> <<EMAIL>> @date Thu Oct 25 15:41:44 EDT 2012 @file pyon/util/poller.py @brief Utility for polling ''' import gevent import functools def poll(poller, *args, **kwargs): ''' Polls a callback (poller) until success is met poller must be a valid callback and returns Tr...
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 13, 12008, 13, 29992, 8921, 529, 5813, 29958, 3532, 26862, 6227, 6778, 13, 29992, 1256, 498, 29884, 4756, 29871, 29906, 29945, 29871, 29896, 29945, 29901, 29946, 29896, 29901, 29946, 29946, 94...
marconi/tests/queues/storage/base.py
andrew-vant/marconi
0
1613600
<reponame>andrew-vant/marconi # Copyright (c) 2013 Red Hat, 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 appli...
[ 1, 529, 276, 1112, 420, 29958, 392, 3973, 29899, 29894, 424, 29914, 3034, 535, 29875, 13, 29937, 14187, 1266, 313, 29883, 29897, 29871, 29906, 29900, 29896, 29941, 4367, 25966, 29892, 9266, 29889, 13, 29937, 13, 29937, 10413, 21144, 1090, ...
examples/pervasive/modules/wip/ll_controls.py
EricLina/attn2d
490
87177
import sys import math import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from fairseq import utils def progressive_max(x): T = x.size(1) x = F.pad(x, (T-1, 0), 'constant', -1) x = F.max_pool1d(x.unsqueeze(1).float(), # shape into B, C, T T, # kernel...
[ 1, 1053, 10876, 13, 5215, 5844, 13, 5215, 12655, 408, 7442, 13, 5215, 4842, 305, 13, 5215, 4842, 305, 29889, 15755, 408, 302, 29876, 13, 5215, 4842, 305, 29889, 15755, 29889, 2220, 284, 408, 383, 13, 3166, 6534, 11762, 1053, 3667, 298...
gpvdm_data/shape/Gaus/example.py
roderickmackenzie/gpvdm
12
45840
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import sys from gpvdm_api import gpvdm_api def run(): a=gpvdm_api(verbose=True) a.set_save_dir(device_data) a.edit("light.inp","#light_model","qe") a.edit("jv0.inp","#Vstop","0.8") a.run()
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 29941, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 5215, 2897, 13, 5215, 10876, 13, 13, 3166, 330, 29886, 29894, 18933, 29918, 2754, 1053, 330, 29...
src/orion/algo/robo/__init__.py
lebrice/orion.algo.robo
0
15272
# -*- coding: utf-8 -*- """ Wrapper for RoBO """ __descr__ = "TODO" __license__ = "BSD 3-Clause" __author__ = u"Epistímio" __author_short__ = u"Epistímio" __author_email__ = "<EMAIL>" __copyright__ = u"2021, Epistímio" __url__ = "https://github.com/Epistimio/orion.algo.robo" from ._version import get_versions __vers...
[ 1, 396, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 15945, 29908, 13, 15646, 363, 1528, 8456, 13, 15945, 29908, 13, 13, 1649, 2783, 7283, 1649, 353, 376, 4986, 3970, 29908, 13, 1649, 506, 1947, 1649, 353...
rgd/geodata/migrations/0004_auto_20210302_2017.py
Erotemic/ResonantGeoData
0
98492
# Generated by Django 3.2a1 on 2021-03-02 20:17 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('geodata', '0003_auto_20210301_1639'), ] operations = [ migrations.RemoveField( model_name='imageentry', name='failure_reason...
[ 1, 396, 3251, 630, 491, 15337, 29871, 29941, 29889, 29906, 29874, 29896, 373, 29871, 29906, 29900, 29906, 29896, 29899, 29900, 29941, 29899, 29900, 29906, 29871, 29906, 29900, 29901, 29896, 29955, 13, 13, 3166, 9557, 29889, 2585, 1053, 9725, ...
examples/gto/13-symmetry.py
robert-anderson/pyscf
2
120520
<gh_stars>1-10 #!/usr/bin/env python # # Author: <NAME> <<EMAIL>> # from pyscf import gto ''' Specify symmetry. Mole.symmetry can be True/False to turn on/off the symmetry (default is off), or a string to specify the symmetry of molecule. If symmetry is bool type, the atom coordinates might be changed. The molecul...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 13, 29937, 13, 29937, 13361, 29901, 529, 5813, 29958, 3532, 26862, 6227, 6778, 13, 29937, 13, 13, 3166, 282, 952, ...
example_project/myshop/urls.py
bluedisk/django-iamport
6
122996
<reponame>bluedisk/django-iamport # -*- coding: utf-8 -*- from django.conf.urls import url from django.urls import path from . import views app_name = "myshop" urlpatterns = [ path('', views.home, name='home'), path('retry_order/<int:order_id>', views.retry_order, name='retry_order'), ]
[ 1, 529, 276, 1112, 420, 29958, 2204, 6742, 3873, 29914, 14095, 29899, 2829, 637, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 13, 3166, 9557, 29889, 5527, 29889, 26045, 1053, 3142, 13, 3166, 9557...
defs/__init__.py
scionrep/scioncc_new
2
120067
# Declare as Python package, such that setuptools can include the data files # (YML, SQL, etc) with the binary egg distribution.
[ 1, 396, 3826, 8663, 408, 5132, 3577, 29892, 1316, 393, 731, 21245, 8789, 508, 3160, 278, 848, 2066, 13, 29937, 313, 29979, 1988, 29892, 3758, 29892, 2992, 29897, 411, 278, 7581, 19710, 4978, 29889, 2 ]
maxsmi/utils.py
t-kimber/maxsmi
1
149721
""" utils.py Python utils functionalities. Handles the primary functions """ import argparse from maxsmi.augmentation_strategies import ( no_augmentation, augmentation_with_duplication, augmentation_without_duplication, augmentation_with_reduced_duplication, augmentation_maximum_estimation, ) d...
[ 1, 9995, 13, 13239, 29889, 2272, 13, 11980, 3667, 29879, 13303, 1907, 29889, 13, 13, 3481, 793, 278, 7601, 3168, 13, 15945, 29908, 13, 13, 5215, 1852, 5510, 13, 13, 3166, 4236, 29879, 2460, 29889, 2987, 358, 362, 29918, 710, 1845, 583...
tests/mac-logs/examples/tag/tag.py
andrewp-as-is/mac-logs.py
1
39579
<filename>tests/mac-logs/examples/tag/tag.py #!/usr/bin/env python import mac_logs mac_logs.tag()
[ 1, 529, 9507, 29958, 21150, 29914, 8628, 29899, 20756, 29914, 19057, 29914, 4039, 29914, 4039, 29889, 2272, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 13, 5215, 5825, 29918, 20756, 13, 13, 8628, 29918, 20756, 29889, 4039, 580, ...
Task1E.py
Yichen-Cai-yc539/Lab87-Flood-Warning-System
0
169581
<filename>Task1E.py from floodsystem.stationdata import build_station_list from floodsystem.geo import rivers_by_station_number def run(): stations = build_station_list() print(rivers_by_station_number(stations, 10)) run()
[ 1, 529, 9507, 29958, 5398, 29896, 29923, 29889, 2272, 13, 3166, 5685, 397, 5205, 29889, 19569, 1272, 1053, 2048, 29918, 19569, 29918, 1761, 13, 3166, 5685, 397, 5205, 29889, 24756, 1053, 27515, 29918, 1609, 29918, 19569, 29918, 4537, 13, ...
CtCI_custom_classes/linked_list.py
enyquist/Cracking_the_Coding_Interview
0
1613701
from random import randint from CtCI_custom_classes.node import Node class LinkedList: def __init__(self): self.head = None def insert(self, data): node = Node(data) node.set_next(self.head) self.head = node def size(self): current = self.head count = 0 ...
[ 1, 515, 4036, 1053, 20088, 524, 13, 13, 3166, 315, 29873, 8426, 29918, 6341, 29918, 13203, 29889, 3177, 1053, 9071, 13, 13, 13, 1990, 28547, 1293, 29901, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 1583, 29889, 2813, 353, ...
list_tuple/10.py
mdazharuddin1011999/IoT_Assignment_2
0
108477
<filename>list_tuple/10.py from math import pi, exp consts = (pi, exp) print("Area of circle is:", consts[0]*int(input("Enter radius of circle: "))**2)
[ 1, 529, 9507, 29958, 1761, 29918, 23583, 29914, 29896, 29900, 29889, 2272, 13, 3166, 5844, 1053, 2930, 29892, 1518, 13, 3075, 29879, 353, 313, 1631, 29892, 1518, 29897, 13, 2158, 703, 13799, 310, 8607, 338, 29901, 613, 1040, 29879, 29961,...
python_reddit_img_download/main.py
brandonyuh/python_reddit_img_download
1
120269
<filename>python_reddit_img_download/main.py<gh_stars>1-10 import sys import praw import re import pyperclip import requests #delete this line import reddit_variables # Replace with your own at https://www.reddit.com/prefs/apps client_id = reddit_variables.client_id client_secret = reddit_variables.client_secret user...
[ 1, 529, 9507, 29958, 4691, 29918, 1127, 27423, 29918, 2492, 29918, 10382, 29914, 3396, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 5215, 10876, 13, 5215, 20467, 13, 5215, 337, 13, 5215, 11451, 546, ...
api/core/threads_core.py
michael-pryor/GeoTweetSearch
1
86725
<reponame>michael-pryor/GeoTweetSearch<filename>api/core/threads_core.py import logging import os from threading import Thread import traceback import time from api.config import Configuration from api.core.utility import EventTimer logger = logging.getLogger(__name__) class BaseThread(Thread): def __init__(self,...
[ 1, 529, 276, 1112, 420, 29958, 29885, 436, 4271, 29899, 558, 29891, 272, 29914, 7999, 29877, 29911, 16668, 7974, 29966, 9507, 29958, 2754, 29914, 3221, 29914, 28993, 29918, 3221, 29889, 2272, 13, 5215, 12183, 13, 5215, 2897, 13, 3166, 324...
main/PublicEmotionDatasets/Adobe/process/train_glove.py
cvlab-stonybrook/Emotion-Prediction
10
31650
<filename>main/PublicEmotionDatasets/Adobe/process/train_glove.py """ Copyright (c) 2019 <NAME> Licensed under the MIT License Author: <NAME> Email: <EMAIL> Last modified: 18/12/2019 Usage: Run this script to train GloVe model on Adobe tags. """ import os import gluonnlp as nlp import numpy as np import matplotlib.py...
[ 1, 529, 9507, 29958, 3396, 29914, 19858, 6026, 8194, 16390, 294, 1691, 29914, 3253, 16945, 29914, 5014, 29914, 14968, 29918, 29887, 417, 345, 29889, 2272, 13, 15945, 29908, 13, 11882, 1266, 313, 29883, 29897, 29871, 29906, 29900, 29896, 299...
tests/contrib/test_discord.py
eblume/flask-dance
0
130882
<filename>tests/contrib/test_discord.py<gh_stars>0 from __future__ import unicode_literals import pytest import responses from urlobject import URLObject from flask import Flask from flask_dance.contrib.discord import make_discord_blueprint, discord from flask_dance.consumer import OAuth2ConsumerBlueprint from flask_d...
[ 1, 529, 9507, 29958, 21150, 29914, 21570, 29914, 1688, 29918, 2218, 16090, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 3166, 4770, 29888, 9130, 1649, 1053, 29104, 29918, 20889, 1338, 13, 13, 5215, 11451, 1688, 13, 5215, ...
examples/python/macOS/hack_or_die.py
kitazaki/NORA_Badge
0
20383
from __future__ import print_function import time import uuid import Adafruit_BluefruitLE CHARACTERISTIC_SERVICE_UUID = uuid.UUID('0000fee0-0000-1000-8000-00805f9b34fb') CHARACTERISTIC_DATA_UUID = uuid.UUID('0000fee1-0000-1000-8000-00805f9b34fb') provider = Adafruit_BluefruitLE.get_provider() def main(): provi...
[ 1, 515, 4770, 29888, 9130, 1649, 1053, 1596, 29918, 2220, 13, 13, 5215, 931, 13, 5215, 318, 5416, 13, 13, 5215, 23255, 29888, 9216, 29918, 21319, 29888, 9216, 1307, 13, 13, 11282, 17923, 1001, 9047, 2965, 29918, 6304, 19059, 29918, 2996...
isimip_qc/exceptions.py
rouxter/isimip-qc
4
124618
class FileWarning(Exception): def __init__(self, file, message, *args, **kwargs): file.warn(message, *args, **kwargs) super().__init__(message % args) class FileError(Exception): def __init__(self, file, message, *args, **kwargs): file.error(message, *args, **kwargs) super()....
[ 1, 770, 3497, 22709, 29898, 2451, 1125, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 934, 29892, 2643, 29892, 334, 5085, 29892, 3579, 19290, 1125, 13, 4706, 934, 29889, 25442, 29898, 4906, 29892, 334, 5085, 29892, 3579, 19290, 29897...
src/Step5-extract-votes-for-categories-having-them-all.py
YossiCohen/Cross-Domain-Transfer-Learning-RecSys
3
127866
import csv import time import os import pandas as pd DATA_ROOT = "C:\\RS\\Amazon\\All\\" MINIMUM_X_CATEGORIES_FILENAME = 'minimum_2_Categories.csv' # MINIMUM_X_CATEGORIES_FILENAME = 'minimum_2_196k.csv' SOURCE_RATING_FILES_TO_USE = ['ratings_Movies_and_TV.csv','ratings_CDs_and_Vinyl.csv'] TARGET_RATING_FILE = 'rating...
[ 1, 1053, 11799, 13, 5215, 931, 13, 5215, 2897, 13, 13, 5215, 11701, 408, 10518, 13, 13, 14573, 29918, 21289, 353, 376, 29907, 22298, 12445, 1966, 29909, 655, 6626, 1966, 3596, 1966, 29908, 13, 16173, 7833, 5005, 29918, 29990, 29918, 299...
src/pengbot/adapters/facebook/adapter.py
mariocesar/pengbot
1
27520
<reponame>mariocesar/pengbot<filename>src/pengbot/adapters/facebook/adapter.py import json from pengbot.utils import isbound from .api import Facebook from ..web import WebAdapter class Adapter(WebAdapter): _fbapi = None @property def fbapi(self): if not self._fbapi: self._fbapi = F...
[ 1, 529, 276, 1112, 420, 29958, 29885, 1306, 542, 26892, 29914, 29886, 996, 7451, 29966, 9507, 29958, 4351, 29914, 29886, 996, 7451, 29914, 328, 481, 2153, 29914, 15445, 29914, 21412, 29889, 2272, 13, 5215, 4390, 13, 13, 3166, 282, 996, ...
index.py
PrinceRaiN/Rain-player
0
171572
import sys import os from os.path import expanduser from PyQt5.QtWidgets import * from PyQt5.QtMultimedia import * from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.uic import loadUiType import time scriptDir = os.path.dirname(os.path.realpath(__file__)) SCREEN,_ = loadUiType(os.path.join(os...
[ 1, 6756, 13, 5215, 10876, 30004, 13, 5215, 2897, 30004, 13, 3166, 2897, 29889, 2084, 1053, 7985, 1792, 30004, 13, 3166, 10772, 17303, 29945, 29889, 17303, 8801, 29879, 1053, 334, 30004, 13, 3166, 10772, 17303, 29945, 29889, 17303, 11930, ...
editor/scheduler/__init__.py
iamsayem/smart-editor
0
30851
""" Created by Sayem on 14 March, 2021 All rights reserved. Copyright © 2020. """ from .celery import app as celery_app __author__ = "Sayem" __all__ = ["celery_app"]
[ 1, 9995, 13, 1678, 6760, 630, 491, 14891, 331, 373, 29871, 29896, 29946, 4779, 29892, 29871, 29906, 29900, 29906, 29896, 13, 1678, 2178, 10462, 21676, 29889, 14187, 1266, 29871, 30211, 29871, 29906, 29900, 29906, 29900, 29889, 13, 15945, 29...
main/migrations/0028_auto_20170103_1634.py
jsmnbom/htxaarhuslan
1
14708
<gh_stars>1-10 # -*- coding: utf-8 -*- # Generated by Django 1.10.2 on 2017-01-03 15:34 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('main', '0027_auto_20170103_1130'), ] ...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 29937, 3251, 630, 491, 15337, 29871, 29896, 29889, 29896, 29900, 29889, 29906, 373, ...
main/migration_types.py
sotheara-leang/xFlask
2
159130
from xflask.sqlalchemy import StringEnum, IntegerEnum from xflask.type import * from main.type.edu_level import *
[ 1, 515, 921, 1579, 1278, 29889, 2850, 284, 305, 6764, 1053, 1714, 16854, 29892, 8102, 16854, 13, 3166, 921, 1579, 1278, 29889, 1853, 1053, 334, 13, 3166, 1667, 29889, 1853, 29889, 6085, 29918, 5563, 1053, 334, 13, 2 ]
src/tests/models/test_model.py
ChristianHinge/geometric
3
150443
import pytest import torch from torch_geometric.data import Batch from src.models.model import GCN @pytest.fixture def model(): return GCN(2, 2) class TestGCN: def test_model_structure(self, model): assert model.conv_layers[0].in_channels == 2 assert model.conv_layers[0].out_channels == 64 ...
[ 1, 1053, 11451, 1688, 13, 5215, 4842, 305, 13, 3166, 4842, 305, 29918, 479, 14066, 29889, 1272, 1053, 350, 905, 13, 13, 3166, 4765, 29889, 9794, 29889, 4299, 1053, 402, 13778, 13, 13, 13, 29992, 2272, 1688, 29889, 7241, 15546, 13, 175...
rotkehlchen/tests/exchanges/test_independentreserve.py
rotkehlchenio/rotkehlchen
137
41963
<reponame>rotkehlchenio/rotkehlchen<gh_stars>100-1000 import warnings as test_warnings from unittest.mock import patch import pytest from rotkehlchen.accounting.structures.balance import Balance from rotkehlchen.constants.assets import A_AUD, A_ETC, A_ETH from rotkehlchen.errors.asset import UnknownAsset from rotkehl...
[ 1, 529, 276, 1112, 420, 29958, 5450, 446, 4415, 2724, 601, 29914, 5450, 446, 4415, 2724, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29900, 29900, 29899, 29896, 29900, 29900, 29900, 13, 5215, 18116, 408, 1243, 29918, 25442, 886, 13, 316...
explore.py
lribiere/explore-mit-bih-arrhythmia-db
3
2193
import plotly.graph_objects as go import streamlit as st import pandas as pd from utils import * import glob import wfdb import os ANNOTATIONS_COL_NAME = 'annotations' ''' # MIT-BIH Arrhythmia DB Exploration ''' record_ids = [os.path.basename(file)[:-4] for file in glob.glob('data/*.dat')] if len(record_ids) == 0: ...
[ 1, 1053, 6492, 368, 29889, 4262, 29918, 12650, 408, 748, 13, 5215, 4840, 19411, 408, 380, 13, 5215, 11701, 408, 10518, 13, 3166, 3667, 29879, 1053, 334, 13, 5215, 13149, 13, 5215, 281, 29888, 2585, 13, 5215, 2897, 13, 13, 2190, 12256,...
hcam_finder/ucam_finder.py
HiPERCAM/hcam_finder
0
172107
<gh_stars>0 # -*- coding: utf-8 -*- from __future__ import print_function, absolute_import, unicode_literals, division import itertools from ginga.canvas.types.all import Line, CompoundObject from ginga.util import wcs from hcam_widgets.tkutils import get_root from .finders import FovSetter class UCAMFovSetter(Fov...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 3166, 4770, 29888, 9130, 1649, 1053, 1596, 29918, 2220, 29892, 8380, 29918, 5215, 29892, 29104, 29918, 20...
webapi/webapi/resources/testurl.py
shovradas/proxy-fellow
1
78404
<reponame>shovradas/proxy-fellow import datetime import time from flask import url_for from flask_restful import Resource, abort from webargs.flaskparser import use_args from bson.objectid import ObjectId from core.proxy_checker import HttpProxyChecker from webapi import api, mongo from webapi.common import util from ...
[ 1, 529, 276, 1112, 420, 29958, 845, 586, 3665, 294, 29914, 14701, 29899, 29888, 4743, 13, 5215, 12865, 13, 5215, 931, 13, 13, 3166, 29784, 1053, 3142, 29918, 1454, 13, 3166, 29784, 29918, 5060, 1319, 1053, 18981, 29892, 27450, 13, 3166,...
libs/clustering/ensembles/utils.py
greenelab/phenoplier
3
6214
""" Contains functions to generate and combine a clustering ensemble. """ import numpy as np import pandas as pd from sklearn.metrics import pairwise_distances from sklearn.metrics import adjusted_rand_score as ari from sklearn.metrics import adjusted_mutual_info_score as ami from sklearn.metrics import normalized_mutu...
[ 1, 9995, 13, 21409, 3168, 304, 5706, 322, 14405, 263, 16993, 3241, 21285, 29889, 13, 15945, 29908, 13, 5215, 12655, 408, 7442, 13, 5215, 11701, 408, 10518, 13, 3166, 2071, 19668, 29889, 2527, 10817, 1053, 5101, 3538, 29918, 5721, 2925, ...
rest_slack/app_settings.py
jordaneremieff/django-rest-slack
1
41413
<reponame>jordaneremieff/django-rest-slack<gh_stars>1-10 import os from django.conf import settings SLACK_CLIENT_ID = getattr(settings, 'SLACK_CLIENT_ID', os.environ.get('SLACK_CLIENT_ID')) SLACK_CLIENT_SECRET = getattr(settings, 'SLACK_CLIENT_SECRET', os.environ.get('SLACK_CLIENT_SECRET')) SLACK_VERIFICATION_T...
[ 1, 529, 276, 1112, 420, 29958, 29926, 536, 273, 14992, 347, 600, 29914, 14095, 29899, 5060, 29899, 29879, 2364, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 5215, 2897, 13, 13, 3166, 9557, 29889, 5527, 1053, 6055...
Src/Python/Recently Used List/test_rul.py
foutoucour/TDD-Katas
4
100603
import unittest from rul import RecentlyUsedList class RecentlyUsedListTests(unittest.TestCase): def test_creating_a_new_list(self): rul = RecentlyUsedList() self.assertEqual(len(rul), 0) def test_inserting_an_item(self): rul = RecentlyUsedList() item = 'item' rul.inser...
[ 1, 1053, 443, 27958, 13, 3166, 364, 352, 1053, 3599, 2705, 29965, 8485, 1293, 13, 13, 1990, 3599, 2705, 29965, 8485, 1293, 24376, 29898, 348, 27958, 29889, 3057, 8259, 1125, 13, 1678, 822, 1243, 29918, 1037, 1218, 29918, 29874, 29918, 1...
tests/BasicLrTraining.py
felipessalvatore/logical-robustness
0
120083
<reponame>felipessalvatore/logical-robustness<filename>tests/BasicLrTraining.py import numpy as np import pandas as pd import os import sys import inspect import unittest from joblib import load currentdir = os.path.dirname( os.path.abspath( inspect.getfile( inspect.currentframe()))) parentdir...
[ 1, 529, 276, 1112, 420, 29958, 13287, 666, 404, 284, 29894, 6082, 29914, 1188, 936, 29899, 13716, 504, 2264, 29966, 9507, 29958, 21150, 29914, 16616, 29931, 29878, 5323, 2827, 29889, 2272, 13, 5215, 12655, 408, 7442, 13, 5215, 11701, 408,...
Game_AI_and_Reinforcement_Learning/ConnectX/v2/actor.py
BEPb/Python-100-days
16
46340
""" Python 3.9 программа самостоятельной игры агентов текущего и предыдущего покаления программа на Python по изучению обучения с подкреплением - Reinforcement Learning Название файла actor.py Version: 0.1 Author: <NAME> Date: 2021-12-23 """ import numpy as np import parl import os from alphazero_agent import create_a...
[ 1, 9995, 13, 11980, 29871, 29941, 29889, 29929, 20796, 1155, 8761, 6428, 28787, 10689, 3541, 1097, 29969, 3648, 516, 2399, 1382, 2402, 588, 606, 2102, 4184, 1520, 2402, 588, 25693, 6052, 13, 5945, 2194, 29959, 1155, 665, 5132, 733, 29307,...
src/common/timestamp.py
vkhaydarov/PlantEye
1
48421
<reponame>vkhaydarov/PlantEye from time import time def get_timestamp(): return int(round(time() * 1000))
[ 1, 529, 276, 1112, 420, 29958, 29894, 15339, 388, 16702, 586, 29914, 3247, 424, 29923, 4099, 13, 3166, 931, 1053, 931, 13, 13, 13, 1753, 679, 29918, 16394, 7295, 13, 1678, 736, 938, 29898, 14486, 29898, 2230, 580, 334, 29871, 29896, 2...
Models/LeNet-5/train.py
sujatasaini/Japanese-character-recognition-using-DropBlock
2
82995
<reponame>sujatasaini/Japanese-character-recognition-using-DropBlock<gh_stars>1-10 # Import the libraries from keras import backend as K from keras.datasets import mnist from keras.layers.convolutional import Conv2D, MaxPooling2D from keras.layers.core import Activation, Flatten, Dense from keras.models import Sequenti...
[ 1, 529, 276, 1112, 420, 29958, 2146, 29926, 271, 294, 475, 29875, 29914, 29967, 21419, 968, 29899, 18609, 29899, 29423, 654, 29899, 4746, 29899, 15063, 7445, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 29937, 1603...
scripts/main.py
xdze2/trilobot
0
68144
<gh_stars>0 import time import asyncio import rx from rx.scheduler.eventloop import AsyncIOScheduler import rx.operators as op import time import matplotlib.pyplot as plt import numpy as np import pigpio from pyrobot.drive import Mobility from pyrobot.hardware.sonar import UltraSoundSensor from pyrobot.gpio_mapping ...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 13, 5215, 931, 13, 5215, 408, 948, 3934, 13, 13, 5215, 364, 29916, 13, 3166, 364, 29916, 29889, 816, 14952, 29889, 3696, 7888, 1053, 20688, 25925, 305, 14952, 13, 5215, 364, 29916, 29...
DeepLearning/Utils/prepare_corpus.py
neuralconcept/DrWhoAI
3
110026
# coding=utf-8 """ Build vocab with a set max vocab size. Build token ids given the vocab. Do get_data.py first. """ # from __future__ import unicode_literals, print_function, division import os import subprocess import re from unidecode import unidecode from nltk import word_tokenize from DeepLearning.Utils import C...
[ 1, 396, 14137, 29922, 9420, 29899, 29947, 13, 15945, 29908, 13, 8893, 7931, 370, 411, 263, 731, 4236, 7931, 370, 2159, 29889, 13, 8893, 5993, 18999, 2183, 278, 7931, 370, 29889, 13, 6132, 679, 29918, 1272, 29889, 2272, 937, 29889, 13, ...
python_code/I_K_ATP_RMP_mg.py
mmaleck/chondrocyte
1
26259
import numpy as np from scipy.integrate.odepack import odeint import matplotlib.pyplot as plt import functions from chondrocyte import Voltage_clamp from params import params_dict import matplotlib as mpl """ The code is used to create Figure 4B for submitted paper "Probing the putative role of KATP channels and biol...
[ 1, 1053, 12655, 408, 7442, 13, 3166, 4560, 2272, 29889, 14146, 403, 29889, 356, 4058, 1053, 288, 311, 524, 13, 5215, 22889, 29889, 2272, 5317, 408, 14770, 13, 5215, 3168, 13, 3166, 521, 898, 307, 1270, 371, 1053, 3684, 29873, 482, 299...
src/icupy/number.py
miute/icupy
0
181091
<filename>src/icupy/number.py<gh_stars>0 """ Module for icu::number namespace """ from .icu.number import * # noqa
[ 1, 529, 9507, 29958, 4351, 29914, 293, 786, 29891, 29914, 4537, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 15945, 29908, 13, 7355, 363, 16077, 29884, 1057, 4537, 7397, 13, 15945, 29908, 13, 13, 3166, 869, 293, 29884, ...
code/src/scripts/pause.py
nuvla/job-engine
3
25578
#!/usr/bin/env python # -*- coding: utf-8 -*- import docker import socket docker_client = docker.from_env() myself = docker_client.containers.get(socket.gethostname()) myself.pause()
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 13, 5215, 10346, 13, 5215, 9909, 13, 13, 14695, 29918, 4645, 353, 10346, 29889, 3166, 29918, 6272, 580...
scvelo/tools/pymc/pymc3_model.py
AlexanderAivazidis/scvelo
0
90635
<reponame>AlexanderAivazidis/scvelo<filename>scvelo/tools/pymc/pymc3_model.py # -*- coding: utf-8 -*- r"""Base Pymc3 model class for all models in pymc3""" import matplotlib.pyplot as plt import numpy as np import pandas as pd import pymc3 as pm import theano from pymc3.variational.callbacks import CheckParametersConv...
[ 1, 529, 276, 1112, 420, 29958, 17406, 3825, 29909, 440, 834, 333, 275, 29914, 1557, 955, 29877, 29966, 9507, 29958, 1557, 955, 29877, 29914, 8504, 29914, 29886, 962, 29883, 29914, 29886, 962, 29883, 29941, 29918, 4299, 29889, 2272, 13, 29...
ml/sandbox/00-data.py
robk-dev/algo-trading
1
2172
from alpha_vantage.timeseries import TimeSeries from pprint import pprint import json import argparse def save_dataset(symbol='MSFT', time_window='daily_adj'): credentials = json.load(open('creds.json', 'r')) api_key = credentials['av_api_key'] print(symbol, time_window) ts = TimeSeries(key=api_key, o...
[ 1, 515, 15595, 29918, 29894, 8501, 29889, 3706, 6358, 1053, 5974, 19204, 13, 3166, 282, 2158, 1053, 282, 2158, 13, 5215, 4390, 13, 5215, 1852, 5510, 13, 13, 13, 1753, 4078, 29918, 24713, 29898, 18098, 2433, 4345, 7818, 742, 931, 29918, ...
demo_bgl/time_based_mining_invariants.py
elieser1101/loglizer
0
156893
#!/usr/bin/env python # -*- coding: UTF-8 -*- __author__ = '<NAME>' from utils import data_loader as data_loader from models import mining_invariants as mi para = { 'path':'../../Data/BGL_data/', # directory for input data 'log_file_name':'BGL_MERGED.log', # filename for log data file 'log_e...
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 13, 29937, 448, 29930, 29899, 14137, 29901, 18351, 29899, 29947, 448, 29930, 29899, 13, 1649, 8921, 1649, 353, 12801, 5813, 16299, 13, 13, 3166, 3667, 29879, 1053, 848, 29918, 12657, 408, 84...
project1/budget/admin.py
sujeethiremath/Project-1
0
1609350
from django.contrib import admin from budget.models import Budget,BudgetCategory # Register your models here. admin.site.register(Budget) admin.site.register(BudgetCategory)
[ 1, 515, 9557, 29889, 21570, 1053, 4113, 13, 3166, 23562, 29889, 9794, 1053, 7038, 657, 29892, 29933, 566, 657, 10900, 13, 13, 29937, 12577, 596, 4733, 1244, 29889, 13, 6406, 29889, 2746, 29889, 9573, 29898, 29933, 566, 657, 29897, 13, 6...
lang/python/pptv_strip.py
liuyang1/test
8
24786
import sys fn = sys.argv[1] fp = open(fn) fo = open(fn+".flv","wb") data = fp.read() offset = int(sys.argv[2]) if len(sys.argv)==3: fo.write(data[offset:]) else: l = int(sys.argsv[3]) fo.write(data[offset:offset+l]) fo.close() fp.close()
[ 1, 1053, 10876, 13, 9144, 353, 10876, 29889, 19218, 29961, 29896, 29962, 13, 18091, 353, 1722, 29898, 9144, 29897, 13, 1181, 353, 1722, 29898, 9144, 29974, 1642, 1579, 29894, 3284, 29893, 29890, 1159, 13, 1272, 353, 285, 29886, 29889, 949...
setup.py
sibyjackgrove/gym-SolarPVDER-environment
7
169503
from setuptools import setup setup(name='gym_PVDER', version='0.0.1', install_requires=['gym','scipy','numpy','matplotlib']#And any other dependencies required )
[ 1, 515, 731, 21245, 8789, 1053, 6230, 13, 13, 14669, 29898, 978, 2433, 29887, 962, 29918, 29925, 29963, 8032, 742, 13, 418, 1873, 2433, 29900, 29889, 29900, 29889, 29896, 742, 13, 418, 2601, 29918, 276, 339, 2658, 29922, 1839, 29887, 96...
projects/jist/jist/datasets/generate2Ddataset.py
Cryptum169/gpmp2
0
148086
<reponame>Cryptum169/gpmp2<filename>projects/jist/jist/datasets/generate2Ddataset.py import numpy as np from gtsam import * from gpmp2 import * import math from random import Random dataset_random = Random() class Obstacle: """docstring for Dataset""" def __init__(self): self.x = None self....
[ 1, 529, 276, 1112, 420, 29958, 29907, 4641, 398, 29896, 29953, 29929, 29914, 29887, 29886, 1526, 29906, 29966, 9507, 29958, 16418, 29914, 29926, 391, 29914, 29926, 391, 29914, 14538, 1691, 29914, 17158, 29906, 29928, 24713, 29889, 2272, 13, ...
EvalEmbeddings.py
satyarth934/SpaceForceDataSearch
1
178128
import scann from argparse import ArgumentParser from pl_bolts.models.self_supervised import SimCLR from pl_bolts.models.self_supervised.resnets import resnet18 from pl_bolts.models.self_supervised.simclr.transforms import SimCLREvalDataTransform, SimCLRTrainDataTransform from pathlib import Path import torch import os...
[ 1, 1053, 885, 812, 13, 3166, 1852, 5510, 1053, 23125, 11726, 13, 3166, 715, 29918, 2095, 1372, 29889, 9794, 29889, 1311, 29918, 9136, 11292, 1053, 3439, 6154, 29934, 13, 3166, 715, 29918, 2095, 1372, 29889, 9794, 29889, 1311, 29918, 9136,...
Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/lms/djangoapps/grades/course_grade.py
osoco/better-ways-of-thinking-about-software
3
28320
<reponame>osoco/better-ways-of-thinking-about-software """ CourseGrade Class """ from abc import abstractmethod from collections import OrderedDict, defaultdict from ccx_keys.locator import CCXLocator from django.conf import settings from lazy import lazy from openedx.core.lib.grade_utils import round_away_from_zer...
[ 1, 529, 276, 1112, 420, 29958, 359, 6235, 29914, 6878, 357, 29899, 1994, 29899, 974, 29899, 386, 18159, 29899, 12717, 29899, 20415, 13, 15945, 29908, 13, 29907, 10242, 29954, 15464, 4134, 13, 15945, 29908, 13, 13, 13, 3166, 25638, 1053, ...
Scripts/hilberttrans.py
TChauvire/EPR_ESR_Suite
2
88749
<reponame>TChauvire/EPR_ESR_Suite import numpy as np from scipy.signal import hilbert def hilberttrans(data, N=None): """ Hilbert transform. Reconstruct imaginary data via hilbert transform. This script is freely inspired by the easyspin suite from the Stefan Stoll lab (https://github.com/Stol...
[ 1, 529, 276, 1112, 420, 29958, 29911, 1451, 585, 29894, 533, 29914, 29923, 10593, 29918, 2890, 29934, 29918, 5091, 568, 13, 5215, 12655, 408, 7442, 13, 3166, 4560, 2272, 29889, 25436, 1053, 298, 309, 2151, 13, 13, 1753, 298, 309, 2151, ...
__main__.py
Arab-developers/PSHMode
27
1602691
<reponame>Arab-developers/PSHMode<gh_stars>10-100 import os import runpy runpy.run_path(os.path.join(os.path.abspath(__file__).rsplit("/", 1)[0], "bin/PSHMode"))
[ 1, 529, 276, 1112, 420, 29958, 29909, 4201, 29899, 17426, 29914, 7024, 29950, 6818, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29900, 29899, 29896, 29900, 29900, 13, 5215, 2897, 13, 5215, 1065, 2272, 13, 13, 3389, 2272, 29889, 3389, 29...
scripts/update_hashes.py
presalytics/amplitude
1
1606866
import yaml import sys import git # type: ignore import os import pathlib if __name__ == '__main__': repo = git.Repo(search_parent_directories=True) sha = repo.head.object.hexsha manifests_dir = pathlib.Path(__file__).parent.absolute().parent.absolute().joinpath('manifests') for manifest in os.listdir...
[ 1, 1053, 343, 8807, 13, 5215, 10876, 13, 5215, 6315, 29871, 396, 1134, 29901, 11455, 13, 5215, 2897, 13, 5215, 2224, 1982, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 13761, 353, 6315, 29889, 5612, 29877...
bot/handlers/bans.py
Mehavoid/telegram-feedback-bot
41
148008
from contextlib import suppress from aiogram import Dispatcher, types from aiogram.dispatcher.filters import IsReplyFilter, IDFilter from bot.blocklists import banned, shadowbanned from bot.handlers.adminmode import extract_id async def cmd_ban(message: types.Message): try: user_id = extract_id(message)...
[ 1, 515, 3030, 1982, 1053, 21301, 13, 13, 3166, 7468, 13342, 1053, 3295, 5041, 261, 29892, 4072, 13, 3166, 7468, 13342, 29889, 13369, 261, 29889, 26705, 1053, 1317, 5612, 368, 5072, 29892, 3553, 5072, 13, 13, 3166, 9225, 29889, 1271, 215...
app/views.py
TheWolfA2/cppstyle
0
173640
import os from flask import render_template, redirect, session, url_for, request, send_from_directory, jsonify from app import app from werkzeug import secure_filename from style_grader_main import style_grader_driver app.config['UPLOAD_FOLDER'] = 'uploads/' app.config['ALLOWED_EXTENSIONS'] = set(['cpp', 'h']) # @app...
[ 1, 1053, 2897, 13, 3166, 29784, 1053, 4050, 29918, 6886, 29892, 6684, 29892, 4867, 29892, 3142, 29918, 1454, 29892, 2009, 29892, 3638, 29918, 3166, 29918, 12322, 29892, 4390, 1598, 13, 3166, 623, 1053, 623, 13, 3166, 23085, 13289, 1053, 1...
main.py
IgorZyktin/Colortex
17
76010
<filename>main.py """ Colortex - simple textual painter Based on: https://gist.github.com/BigglesZX/4016539 https://gist.github.com/almost/d2832d0998ad9dfec2cacef934e7d247 """ import ct_images import ct_files def main(): """ Main flow """ print('--- Colortex image conversion...
[ 1, 529, 9507, 29958, 3396, 29889, 2272, 13, 15945, 29908, 13, 13, 1678, 9159, 4776, 448, 2560, 1426, 950, 23187, 13, 13, 1678, 16564, 373, 29901, 13, 4706, 2045, 597, 29887, 391, 29889, 3292, 29889, 510, 29914, 6970, 29887, 793, 29999, ...
icrawler/utils/session.py
awesome-archive/icrawler
0
86127
<filename>icrawler/utils/session.py import requests from six.moves.urllib.parse import urlsplit class Session(requests.Session): def __init__(self, proxy_pool): super(Session, self).__init__() self.proxy_pool = proxy_pool def _url_scheme(self, url): return urlsplit(url).scheme d...
[ 1, 529, 9507, 29958, 293, 1610, 1358, 29914, 13239, 29914, 7924, 29889, 2272, 13, 5215, 7274, 13, 3166, 4832, 29889, 13529, 267, 29889, 2271, 1982, 29889, 5510, 1053, 3142, 5451, 13, 13, 13, 1990, 16441, 29898, 24830, 29889, 7317, 1125, ...
passwordValidator.py
valentinsoare/currentlyLearningPythonProjectsBased
1
108516
#!/usr/bin/python3 import re def catch_input(): password = input(f'\n\033[1;31m *Enter Your Password for Validation:\033[0m ') return password def password_validator_rules(input_rule, given_password): rules = re.compile(input_rule) pattern = re.search(rules, given_password) return True if patt...
[ 1, 18787, 4855, 29914, 2109, 29914, 4691, 29941, 13, 13, 5215, 337, 13, 13, 13, 1753, 4380, 29918, 2080, 7295, 13, 1678, 4800, 353, 1881, 29898, 29888, 12764, 29876, 29905, 29900, 29941, 29941, 29961, 29896, 29936, 29941, 29896, 29885, 33...
mainapp/migrations/0001_initial.py
CheboiDerrick/hood-alert
0
170252
<gh_stars>0 # Generated by Django 3.2.9 on 2021-11-02 22:27 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 29937, 3251, 630, 491, 15337, 29871, 29941, 29889, 29906, 29889, 29929, 373, 29871, 29906, 29900, 29906, 29896, 29899, 29896, 29896, 29899, 29900, 29906, 29871, 29906, 29906, 29901, 29906, 29...
pendulum.py
x75/playground
0
1604798
<gh_stars>0 """Quick test of data asymmetry in a motor driven pendulum""" import numpy as np import matplotlib import matplotlib.gridspec as gridspec # matplotlib.use("Cairo") import matplotlib.pyplot as plt l = 2e-0 g = 9.81 m = 1.0 cf = -4.8 # cf = -1.45 fr = 1e-2 one_over_fr = 1 - fr scale = 1.0 # 0.1 # dt ...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 15945, 29908, 2182, 860, 1243, 310, 848, 16936, 2527, 719, 297, 263, 10992, 18225, 282, 355, 352, 398, 15945, 29908, 13, 13, 5215, 12655, 408, 7442, 13, 5215, 22889, 13, 13, 5215, 228...
golden_search.py
nandaVT/Optimization-Techniques-for-Engineering-design
0
189907
import sys try: import math import sympy as sym from sympy import sin,cos,tan,N except: print("Packages not installed. Please install 'sympy' package") sys.exit() print("Fibonacci search method") x = sym.Symbol('x') def substitute(k): return (f.subs(x,k)) while(True): s =...
[ 1, 1053, 10876, 30004, 13, 2202, 29901, 6756, 13, 1678, 1053, 5844, 30004, 13, 1678, 1053, 5016, 2272, 408, 5016, 30004, 13, 1678, 515, 5016, 2272, 1053, 4457, 29892, 3944, 29892, 13161, 29892, 29940, 30004, 13, 19499, 29901, 30004, 13, ...
kivy/input/providers/linuxwacom.py
VICTORVICKIE/kivy
13,889
66757
<filename>kivy/input/providers/linuxwacom.py ''' Native support of Wacom tablet from linuxwacom driver ===================================================== To configure LinuxWacom, add this to your configuration:: [input] pen = linuxwacom,/dev/input/event2,mode=pen finger = linuxwacom,/dev/input/event3,m...
[ 1, 529, 9507, 29958, 29895, 440, 29891, 29914, 2080, 29914, 771, 29454, 29914, 9389, 2766, 510, 29889, 2272, 13, 12008, 13, 11024, 2304, 310, 22552, 510, 1591, 29873, 515, 10542, 2766, 510, 7156, 13, 9166, 9166, 9166, 2751, 29922, 13, 1...
section-3-13-mini_project-solution.py
gopal-amlekar/Jumpstart-IOT-Exercise
1
75991
import RPi.GPIO as GPIO import smbus import time SHT21_ADD = 0x40 SHT21_STATUS_MASK = 0xFFFC SHT21_MEASURE_TEMP_CMD = 0xF3 SHT21_MEASURE_HUM_CMD = 0xF5 MAX_TEMPERATURE = 120 MAX_HUMIDITY = 100 temperatureBarGraph = [26,23,20,17,14,11,8,5] humidityBarGraph = [27,24,21,18,15,12,9,6] unusedLEDs = [16,13,10,7] temper...
[ 1, 1053, 390, 12197, 29889, 29954, 2227, 29949, 408, 402, 2227, 29949, 13, 5215, 1560, 8262, 13, 5215, 931, 13, 13, 29903, 3912, 29906, 29896, 29918, 17744, 353, 29871, 29900, 29916, 29946, 29900, 13, 29903, 3912, 29906, 29896, 29918, 270...