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
07_Greedy/distribute_candy.py
Sheetal0601/InterviewBit
61
54117
# Distribute Candy # https://www.interviewbit.com/problems/distribute-candy/ # # There are N children standing in a line. Each child is assigned a rating value. # # You are giving candies to these children subjected to the following requirements: # Each child must have at least one candy. # Children with a higher rati...
[ 1, 396, 6652, 2666, 315, 13910, 13, 29937, 2045, 597, 1636, 29889, 1639, 1493, 2966, 29889, 510, 29914, 17199, 29879, 29914, 5721, 2666, 29899, 29883, 13910, 29914, 13, 29937, 13, 29937, 1670, 526, 405, 4344, 13407, 297, 263, 1196, 29889,...
foundation/backend/controller/__init__.py
tbone255/foundation
0
121741
<reponame>tbone255/foundation<gh_stars>0 from .base import * from .mixins import *
[ 1, 529, 276, 1112, 420, 29958, 29873, 15933, 29906, 29945, 29945, 29914, 11940, 362, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 3166, 869, 3188, 1053, 334, 13, 3166, 869, 28084, 1144, 1053, 334, 13, 2 ]
solutions/previous_solution_python/leetcode_1041.py
YuhanShi53/Leetcode_solutions
0
46203
""" Leetcode 1041 - Robot Bounded in Circle https://leetcode.com/problems/robot-bounded-in-circle/ """ class Solution1: """ 1. MINE Straight-Forward """ def is_robot_bounded(self, instructions: str) -> bool: nums = {'G': 0, 'R': 1, 'L': -1} direction = [1, -1] position = [0, 0] ...
[ 1, 9995, 951, 300, 401, 29871, 29896, 29900, 29946, 29896, 448, 6417, 327, 350, 7261, 297, 27927, 13, 13, 991, 597, 280, 300, 401, 29889, 510, 29914, 17199, 29879, 29914, 307, 7451, 29899, 29306, 29899, 262, 29899, 16622, 29914, 13, 13,...
behave/reporter/summary.py
fluendo/behave
0
18121
# -*- coding: UTF-8 -*- """ Provides a summary after each test run. """ from __future__ import absolute_import, division, print_function import sys from time import time as time_now from behave.model import Rule, ScenarioOutline # MAYBE: Scenario from behave.model_core import Status from behave.reporter.base import R...
[ 1, 396, 448, 29930, 29899, 14137, 29901, 18351, 29899, 29947, 448, 29930, 29899, 13, 15945, 29908, 13, 1184, 29894, 2247, 263, 15837, 1156, 1269, 1243, 1065, 29889, 13, 15945, 29908, 13, 13, 3166, 4770, 29888, 9130, 1649, 1053, 8380, 2991...
utils/crop_image.py
Mhaiyang/iccv
2
47300
""" @Time : 203/21/19 17:11 @Author : TaylorMei @Email : <EMAIL> @Project : iccv @File : crop_image.py @Function: """ import os import numpy as np import skimage.io input_path = '/media/iccd/TAYLORMEI/depth/image' output_path = '/media/iccd/TAYLORMEI/depth/crop' if not os.path.exists(output_path): ...
[ 1, 9995, 13, 732, 2481, 1678, 584, 29871, 29906, 29900, 29941, 29914, 29906, 29896, 29914, 29896, 29929, 29871, 29896, 29955, 29901, 29896, 29896, 13, 732, 13720, 29871, 584, 12537, 6816, 29875, 13, 732, 9823, 259, 584, 529, 26862, 6227, ...
entities/api_renderers.py
acdh-oeaw/daacda-go-digital
0
1615613
import json from rest_framework import renderers class GeoJsonRenderer(renderers.BaseRenderer): media_type = 'text/json' format = 'geojson' def render(self, data, media_type=None, renderer_context=None): geojson_start = """{"type": "FeatureCollection","features": """ geolist = [] ...
[ 1, 1053, 4390, 13, 3166, 1791, 29918, 4468, 1053, 4050, 414, 13, 13, 13, 1990, 1879, 29877, 8148, 21323, 29898, 9482, 414, 29889, 5160, 21323, 1125, 13, 1678, 5745, 29918, 1853, 353, 525, 726, 29914, 3126, 29915, 13, 1678, 3402, 353, ...
networkforgat.py
LouGalata/MAGAT
3
71691
import torch import torch.nn as nn import torch.nn.functional as f import numpy as np from layers import GraphAttentionLayer def hidden_init(layer): fan_in = layer.weight.data.size()[0] lim = 1. / np.sqrt(fan_in) return (-lim, lim) class GAT(nn.Module): def __init__(self, nfeat, nhid, nclass, dropou...
[ 1, 1053, 4842, 305, 13, 5215, 4842, 305, 29889, 15755, 408, 302, 29876, 13, 5215, 4842, 305, 29889, 15755, 29889, 2220, 284, 408, 285, 13, 5215, 12655, 408, 7442, 13, 3166, 15359, 1053, 12367, 4165, 2509, 14420, 13, 13, 13, 1753, 7934...
lib/event.py
PaulMndn/Fenrir-Discord-Bot
1
190444
<reponame>PaulMndn/Fenrir-Discord-Bot import discord import datetime as dt class Event: def __init__(self, title: str, date_time: dt.datetime, event_channel_id: int, msg_id: int = None): self.title = title self.date_time = date_time self.event_channel_id = event_channel_id self.msg...
[ 1, 529, 276, 1112, 420, 29958, 18275, 29924, 299, 29876, 29914, 29943, 264, 12416, 29899, 4205, 16090, 29899, 29933, 327, 13, 5215, 2313, 536, 13, 5215, 12865, 408, 11636, 13, 13, 13, 1990, 6864, 29901, 13, 1678, 822, 4770, 2344, 12035,...
exercises_and_metrics_types/MetricSingleInputWidget.py
noooway/exj
1
59756
from kivy.app import App from kivy.uix.boxlayout import BoxLayout from kivy.uix.gridlayout import GridLayout from kivy.uix.button import Button from kivy.uix.label import Label from kivy.uix.textinput import TextInput from MetricSingle import * class MetricSingleInputWidget( GridLayout ): def __init__( self, metr...
[ 1, 515, 413, 440, 29891, 29889, 932, 1053, 2401, 13, 3166, 413, 440, 29891, 29889, 29884, 861, 29889, 1884, 2680, 1053, 11773, 3453, 13, 3166, 413, 440, 29891, 29889, 29884, 861, 29889, 7720, 2680, 1053, 11657, 3453, 13, 3166, 413, 440,...
bounce2.py
Yokohama-Miyazawa/bounce_games
4
27099
from tkinter import * import random import time class Widget(object): # 画面上で動く物の基本となるクラス def __init__(self, window, size, color, pos, speed=[0, 0]): self.window = window self.size = size self.color = color self.pos = pos self.speed = speed def acty(self): # インスタンスを動...
[ 1, 515, 18883, 1639, 1053, 334, 13, 5215, 4036, 13, 5215, 931, 13, 13, 13, 1990, 27080, 29898, 3318, 1125, 29871, 396, 29871, 31046, 30806, 30429, 30499, 31124, 30568, 30834, 30199, 31359, 30346, 30364, 30371, 30332, 30305, 30281, 30255, ...
microproxy/test/interceptor/test_msg_publisher.py
mike820324/microProxy
20
50068
<reponame>mike820324/microProxy<gh_stars>10-100 import json import unittest import mock from microproxy.context import ViewerContext from microproxy.interceptor.msg_publisher import MsgPublisher from microproxy.version import VERSION class TestMsgPublisher(unittest.TestCase): def setUp(self): self.zmq_so...
[ 1, 529, 276, 1112, 420, 29958, 2460, 446, 29947, 29906, 29900, 29941, 29906, 29946, 29914, 29885, 2357, 14048, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29900, 29899, 29896, 29900, 29900, 13, 5215, 4390, 13, 5215, 443, 27958, 13, 5215, ...
contests/2020_spring/1.py
clarkchen/leetcode_python
0
113948
<filename>contests/2020_spring/1.py<gh_stars>0 from typing import List class Solution: def minCount(self, coins: List[int]) -> int: res = [] for x in coins: res.append(x//2+x%2) return sum(res) if __name__ == '__main__': s = Solution() ans = s.minCount([4,2,1]) pri...
[ 1, 529, 9507, 29958, 1285, 9197, 29914, 29906, 29900, 29906, 29900, 29918, 4278, 29914, 29896, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 3166, 19229, 1053, 2391, 13, 13, 13, 1990, 24380, 29901, 13, 1678, 822, 1375, 39...
src/icemac/addressbook/tests/test_entities.py
icemac/icemac.addressbook
1
101286
from icemac.addressbook.address import phone_number_entity from icemac.addressbook.address import postal_address_entity from icemac.addressbook.addressbook import address_book_entity from icemac.addressbook.entities import Entities, PersistentEntities, Field from icemac.addressbook.entities import Entity, get_bound_sch...
[ 1, 515, 16077, 331, 562, 29889, 7328, 2909, 29889, 7328, 1053, 9008, 29918, 4537, 29918, 10041, 13, 3166, 16077, 331, 562, 29889, 7328, 2909, 29889, 7328, 1053, 29767, 29918, 7328, 29918, 10041, 13, 3166, 16077, 331, 562, 29889, 7328, 290...
resources/org/caf/normalize-build-matrix.py
actor-framework/continuous-integration
0
97696
#!/usr/bin/env python import sys, json from functools import reduce inputFile = sys.argv[1] outputFile = sys.argv[2] with open(inputFile, 'r') as f: data = f.read() config = json.loads(data) def copy_without(xs, key): ys = xs.copy() ys.pop(key) return ys def merge_filtered(result, xs, pred): f...
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 13, 13, 5215, 10876, 29892, 4390, 13, 13, 3166, 2090, 312, 8789, 1053, 10032, 13, 13, 2080, 2283, 353, 10876, 29889, 19218, 29961, 29896, 29962, 13, 4905, 2283, 353, 10876, 29889, 19218, 2...
nine/c5.py
xiaolinzi-xl/python_imooc
0
40575
from c6 import People # Student类继承People class Student(People): def __init__(self,school,name,age): self.school = school # People.__init__(self,name,age) super(Student,self).__init__(name,age) Student.sum += 1 def do_homework(self): print('do homework') student1 = ...
[ 1, 515, 274, 29953, 1053, 11647, 13, 13, 29937, 15740, 30832, 234, 190, 170, 233, 140, 194, 15666, 1991, 13, 1990, 15740, 29898, 15666, 1991, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 27041, 29892, 978, 29892, 482, 1125, 13, ...
AUTOENCODERS/DataPreparing/CICIDSPreprocessor.py
pawelptak/AI-Anomaly-Detection
1
20201
from sklearn.preprocessing import StandardScaler, LabelEncoder, MinMaxScaler, OneHotEncoder import numpy as np import pandas as pd import tqdm """ Class for Preprocessing CICIDS2017 Data represented as rows """ class CICIDSPreprocessor: def __init__(self): self.to_delete_columns = ['Flow ID', ' Timestamp...
[ 1, 515, 2071, 19668, 29889, 1457, 19170, 1053, 10117, 29636, 261, 29892, 15796, 8566, 6119, 29892, 3080, 7976, 29636, 261, 29892, 3118, 28917, 8566, 6119, 13, 5215, 12655, 408, 7442, 13, 5215, 11701, 408, 10518, 13, 5215, 260, 29939, 1893...
Lib/filibuster/titlecase.py
LettError/filibuster
10
130633
<reponame>LettError/filibuster<filename>Lib/filibuster/titlecase.py # -*- coding: UTF-8 -*- """ titlecase.py v0.2 Original Perl version by: <NAME> http://daringfireball.net/ 10 May 2008 Python version by <NAME> http://muffinresearch.co.uk License: http://www.opensource.org/licenses/mit-license.php """ import unittest...
[ 1, 529, 276, 1112, 420, 29958, 29931, 1803, 2392, 29914, 1777, 747, 5402, 29966, 9507, 29958, 14868, 29914, 1777, 747, 5402, 29914, 3257, 4878, 29889, 2272, 13, 29937, 448, 29930, 29899, 14137, 29901, 18351, 29899, 29947, 448, 29930, 29899,...
tests/db_test.py
hall-lab/lah
0
92369
import filecmp, os, tempfile, unittest from lah.db import LahDb class LahDbTest(unittest.TestCase): def setUp(self): self.data_d = os.path.join(os.path.dirname(__file__), "data", "dataset") self.dbfile = os.path.join(self.data_d, "test.db") self.temp_d = tempfile.TemporaryDirectory() ...
[ 1, 1053, 934, 21058, 29892, 2897, 29892, 5694, 1445, 29892, 443, 27958, 13, 13, 3166, 425, 29882, 29889, 2585, 1053, 365, 801, 10234, 13, 13, 1990, 365, 801, 10234, 3057, 29898, 348, 27958, 29889, 3057, 8259, 1125, 13, 1678, 822, 731, ...
src/domain/node.py
kovanostra/graph-to-graph
1
101197
<reponame>kovanostra/graph-to-graph import numpy as np from src.domain.graph import Graph class Node: def __init__(self, graph: Graph, node_id: int): self.node_id = node_id self.features = self._get_node_features(graph) self.neighbors = self._get_neighbors(graph) self.neighbors_co...
[ 1, 529, 276, 1112, 420, 29958, 9756, 273, 520, 336, 29914, 4262, 29899, 517, 29899, 4262, 13, 5215, 12655, 408, 7442, 13, 13, 3166, 4765, 29889, 7247, 29889, 4262, 1053, 12367, 13, 13, 13, 1990, 9071, 29901, 13, 1678, 822, 4770, 2344,...
securify/analyses/patterns/source/rtlo_pattern.py
AlexandreH/securify2
258
190816
import bisect import re from typing import List, Dict from securify.analyses.patterns.abstract_pattern import AbstractPattern, PatternMatch, Level, Severity, PatternMatchError, \ MatchComment, MatchSourceLocation class RightToLeftOverridePattern(AbstractPattern): regex_pattern = re.compile("\u202e".encode('u...
[ 1, 1053, 2652, 522, 13, 5215, 337, 13, 3166, 19229, 1053, 2391, 29892, 360, 919, 13, 13, 3166, 409, 2764, 1598, 29889, 7054, 952, 267, 29889, 11037, 29879, 29889, 16595, 29918, 11037, 1053, 25513, 17144, 29892, 25860, 9652, 29892, 21597, ...
bdsim/blocks/__init__.py
petercorke/bdsim
64
44469
from .functions import * from .sources import * from .sinks import * from .transfers import * from .discrete import * from .linalg import * from .displays import * from .connections import * url = "https://petercorke.github.io/bdsim/" + __package__
[ 1, 515, 869, 12171, 1053, 334, 13, 3166, 869, 29879, 2863, 1053, 334, 13, 3166, 869, 29879, 19363, 1053, 334, 13, 3166, 869, 3286, 25534, 1053, 334, 13, 3166, 869, 2218, 9084, 1053, 334, 13, 3166, 869, 29880, 979, 29887, 1053, 334, ...
PaddleCV/image_classification/infer.py
nepeplwu/models
1
194064
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import numpy as np import time import sys import paddle import paddle.fluid as fluid import reader import argparse import functools import models import utils from utils.utility import add_arguments,pr...
[ 1, 515, 4770, 29888, 9130, 1649, 1053, 8380, 29918, 5215, 13, 3166, 4770, 29888, 9130, 1649, 1053, 8542, 13, 3166, 4770, 29888, 9130, 1649, 1053, 1596, 29918, 2220, 13, 5215, 2897, 13, 5215, 12655, 408, 7442, 13, 5215, 931, 13, 5215, ...
test/msan/lit.cfg.py
QuarkTheAwesome/compiler-rt-be-aeabi
118
9489
# -*- Python -*- import os # Setup config name. config.name = 'MemorySanitizer' + getattr(config, 'name_suffix', 'default') # Setup source root. config.test_source_root = os.path.dirname(__file__) # Setup default compiler flags used with -fsanitize=memory option. clang_msan_cflags = (["-fsanitize=memory", ...
[ 1, 396, 448, 29930, 29899, 5132, 448, 29930, 29899, 13, 13, 5215, 2897, 13, 13, 29937, 3789, 786, 2295, 1024, 29889, 13, 2917, 29889, 978, 353, 525, 16015, 22509, 277, 3950, 29915, 718, 679, 5552, 29898, 2917, 29892, 525, 978, 29918, ...
mac.py
cosven/feeluown-mac-hotkey-plugin
2
169466
<filename>mac.py # -*- coding=utf8 -*- import asyncio import logging import os import socket import threading logger = logging.getLogger(__name__) def send_cmd(cmd): sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.connect(('0.0.0.0', 23333)) sock.recv(1024) sock.sendall(bytes(cmd, 'utf...
[ 1, 529, 9507, 29958, 8628, 29889, 2272, 13, 29937, 448, 29930, 29899, 14137, 29922, 9420, 29947, 448, 29930, 29899, 13, 13, 5215, 408, 948, 3934, 13, 5215, 12183, 13, 5215, 2897, 13, 5215, 9909, 13, 5215, 3244, 292, 13, 13, 21707, 353...
buildscripts/linter/filediff.py
benety/mongo
0
77608
"""Modules for find which files should be linted.""" import os import sys from typing import Tuple, List, Dict, Callable from git import Repo import structlog # Get relative imports to work when the package is not installed on the PYTHONPATH. if __name__ == "__main__" and __package__ is None: sys.path.append(os.p...
[ 1, 9995, 2111, 2540, 363, 1284, 607, 2066, 881, 367, 301, 524, 287, 1213, 15945, 13, 5215, 2897, 13, 5215, 10876, 13, 3166, 19229, 1053, 12603, 552, 29892, 2391, 29892, 360, 919, 29892, 8251, 519, 13, 13, 3166, 6315, 1053, 830, 1129, ...
gdata.py
Arslan223/QuestBot
0
165953
import json def load(): with open("data.json", "r") as f: return json.load(f) def update(obj): with open("data.json", "w") as f: json.dump(obj, f, ensure_ascii=False) def loadCorpus(): with open("corpus.json", "r", encoding="utf-8") as f: return json.load(f) def updateCorpus(obj): with open("corpus.json",...
[ 1, 1053, 4390, 13, 13, 1753, 2254, 7295, 13, 12, 2541, 1722, 703, 1272, 29889, 3126, 613, 376, 29878, 1159, 408, 285, 29901, 13, 12, 12, 2457, 4390, 29889, 1359, 29898, 29888, 29897, 13, 13, 1753, 2767, 29898, 5415, 1125, 13, 12, 25...
Orest Lab 2/2d.py
PetroSidliar/Lab-2
0
51457
grade = eval ( input ( ' Enter your credit: ' )) if grade<=23: print ( ' Freshman ' ) elif grade>=24 and grade<=53: print ( ' Sophomore ' ) elif grade>=54 and grade<=83: print ( ' Juniors ' ) elif grade>=84: print ( ' Seniors ' )
[ 1, 19468, 353, 19745, 313, 1881, 313, 525, 9041, 596, 16200, 29901, 525, 29871, 876, 13, 361, 19468, 14065, 29906, 29941, 29901, 268, 13, 259, 1596, 313, 525, 383, 3781, 1171, 525, 1723, 13, 23681, 19468, 18572, 29906, 29946, 322, 19468...
pol/res.py
MoguCloud/server
0
91567
from typing import Any, Dict, Type, Optional import orjson from starlette.responses import JSONResponse class ORJSONResponse(JSONResponse): media_type = "application/json" def render(self, content: Any) -> bytes: return orjson.dumps(content) class HTTPException(Exception): def __init__( ...
[ 1, 515, 19229, 1053, 3139, 29892, 360, 919, 29892, 5167, 29892, 28379, 13, 13, 5215, 470, 3126, 13, 3166, 5810, 20200, 29889, 26679, 267, 1053, 4663, 5103, 13, 13, 13, 1990, 6323, 7249, 5103, 29898, 7249, 5103, 1125, 13, 1678, 5745, 2...
nsde/nsde.py
daniel-de-vries/differential-evolution
4
60113
#!/usr/bin/env python # -*- coding: utf-8 -*- """Definition of the NSDE algorithm""" import numpy as np try: from openmdao.utils.concurrent import concurrent_eval except ModuleNotFoundError: import warnings warnings.warn("OpenMDAO is not installed. Concurrent evaluation is not available.") from . import ...
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 15945, 29908, 14683, 310, 278, 3865, 2287, 5687, 15945, 29908, 13, 5215, 12655, 408, 7442, 13, 13, 220...
jobs/migrations/0002_auto_20201219_0911.py
Platz-Work/platzi-work-backend
0
43278
<filename>jobs/migrations/0002_auto_20201219_0911.py # Generated by Django 3.1.4 on 2020-12-19 14:11 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('jobs', '0001_initial'), ] operations = [ migrations.Al...
[ 1, 529, 9507, 29958, 9057, 29879, 29914, 26983, 800, 29914, 29900, 29900, 29900, 29906, 29918, 6921, 29918, 29906, 29900, 29906, 29900, 29896, 29906, 29896, 29929, 29918, 29900, 29929, 29896, 29896, 29889, 2272, 13, 29937, 3251, 630, 491, 153...
teraserver/python/modules/FlaskModule/API/user/UserLogin.py
introlab/opentera
10
30410
<filename>teraserver/python/modules/FlaskModule/API/user/UserLogin.py from flask import session, request from flask_restx import Resource, reqparse from flask_babel import gettext from modules.LoginModule.LoginModule import user_http_auth from modules.FlaskModule.FlaskModule import user_api_ns as api from opentera.redi...
[ 1, 529, 9507, 29958, 357, 29440, 369, 29914, 4691, 29914, 7576, 29914, 8754, 1278, 7355, 29914, 8787, 29914, 1792, 29914, 2659, 11049, 29889, 2272, 13, 3166, 29784, 1053, 4867, 29892, 2009, 13, 3166, 29784, 29918, 5060, 29916, 1053, 18981, ...
users.py
ArVID220u/SnallisBot
0
139966
# import twythonaccess to be able to make twitter requests from . import twythonaccess # import apikeys from . import apikeys # import twythonstreamer for the SwedishMiner down below from twython import TwythonStreamer # import threading from threading import Thread # import time import time # this class provides Swed...
[ 1, 396, 1053, 3252, 1656, 5943, 304, 367, 2221, 304, 1207, 23394, 7274, 13, 3166, 869, 1053, 3252, 1656, 5943, 13, 29937, 1053, 7882, 8149, 13, 3166, 869, 1053, 7882, 8149, 13, 29937, 1053, 3252, 1656, 5461, 261, 363, 278, 21892, 2992...
venv/Lib/site-packages/comet_ml/loggers/shap_logger.py
jinga-lala/stupidNMT
0
107579
<filename>venv/Lib/site-packages/comet_ml/loggers/shap_logger.py # -*- coding: utf-8 -*- # ******************************************************* # ____ _ _ # / ___|___ _ __ ___ ___| |_ _ __ ___ | | # | | / _ \| '_ ` _ \ / _ \ __| | '_ ` _ \| | # | |__| (_) | | | | | | __/ ...
[ 1, 529, 9507, 29958, 854, 29894, 29914, 14868, 29914, 2746, 29899, 8318, 29914, 510, 300, 29918, 828, 29914, 1188, 5743, 29914, 845, 481, 29918, 21707, 29889, 2272, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930...
tests/integration/integration_fixture_builders.py
dendisuhubdy/trinity
3
163879
<reponame>dendisuhubdy/trinity from eth_keys import keys from eth_utils import decode_hex from tests.core.integration_test_helpers import FUNDED_ACCT, load_mining_chain from .churn_state.builder import ( delete_churn, deploy_storage_churn_contract, update_churn, ) RECEIVER = keys.PrivateKey( decode_h...
[ 1, 529, 276, 1112, 420, 29958, 29881, 355, 275, 16099, 431, 4518, 29914, 509, 13593, 13, 3166, 11314, 29918, 8149, 1053, 6611, 13, 3166, 11314, 29918, 13239, 1053, 21822, 29918, 20970, 13, 13, 3166, 6987, 29889, 3221, 29889, 27925, 29918,...
backend/db/entities/mixin/pengaturan.py
R-N/sistem_gaji_vue_thrift
0
39729
from sqlalchemy import Column, Integer, Numeric from sqlalchemy.ext.declarative import declared_attr from .pengaturan_base import MxPengaturanBase class MxPengaturan(MxPengaturanBase): # TODO: Set precision & scale for Numerics @declared_attr def bpjs_ketenagakerjaan_perusahaan(cls): return Column...
[ 1, 515, 4576, 284, 305, 6764, 1053, 12481, 29892, 8102, 29892, 405, 25099, 13, 3166, 4576, 284, 305, 6764, 29889, 1062, 29889, 311, 16544, 1230, 1053, 8052, 29918, 5552, 13, 3166, 869, 29886, 996, 1337, 273, 29918, 3188, 1053, 341, 2991...
algorithm/codility.com/20160330/longest_0_binary_gap.py
leonard-sxy/algorithm-practice
1
40346
def solution(N): str = '{0:b}'.format(N) counter = prev_counter = 0 for c in str: if c is '0': counter += 1 else: if prev_counter == 0 or counter > prev_counter: prev_counter = counter counter = 0 return prev_counter if prev_counter > counter else counter
[ 1, 822, 1650, 29898, 29940, 1125, 13, 29871, 851, 353, 22372, 29900, 29901, 29890, 29913, 4286, 4830, 29898, 29940, 29897, 13, 259, 13, 29871, 6795, 353, 12379, 29918, 11808, 353, 29871, 29900, 13, 29871, 363, 274, 297, 851, 29901, 13, ...
tools/migrate_chart/migrate_chart.py
kschu91/harbor
12,706
63034
#!/usr/local/bin/python3 import subprocess import signal import sys from pathlib import Path import click import requests MIGRATE_CHART_SCRIPT = '/migrate_chart.sh' HELM_CMD = '/linux-amd64/helm' CA_UPDATE_CMD = 'update-ca-certificates' CHART_URL_PATTERN = "https://{host}/api/v2.0/projects/{project}/repositories/{na...
[ 1, 18787, 4855, 29914, 2997, 29914, 2109, 29914, 4691, 29941, 13, 13, 5215, 1014, 5014, 13, 5215, 7182, 13, 5215, 10876, 13, 3166, 2224, 1982, 1053, 10802, 13, 13, 5215, 2828, 13, 5215, 7274, 13, 13, 29924, 6259, 29934, 3040, 29918, 3...
src/survivor_scraping/reddit/reddit_transform.py
SeanAmmirati/survivor_processing
0
160683
<gh_stars>0 from ..helpers.db_funcs import create_season_times, create_episode_times from ..helpers.transform_helpers import add_to_df, coerce_col, sync_with_remote import pandas as pd from collections import OrderedDict def process_utc(df, *args, **kwargs): return pd.DataFrame(pd.to_datetime(df['created_utc'], ...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 3166, 6317, 3952, 6774, 29889, 2585, 29918, 7692, 2395, 1053, 1653, 29918, 25682, 29918, 3706, 29892, 1653, 29918, 1022, 275, 356, 29918, 3706, 13, 3166, 6317, 3952, 6774, 29889, 9067, 29...
memorytestgame/example.config.py
bradcornford/Memory-Test-Game
0
102151
game = { 'leds': ( # GPIO05 - Pin 29 5, # GPIO12 - Pin 32 12, # GPIO17 - Pin 11 17, # GPIO22 - Pin 15 22, # GPIO25 - Pin 22 25 ), 'switches': ( # GPIO06 - Pin 31 6, # GPIO13 - Pin 33 13, #...
[ 1, 3748, 353, 426, 13, 1678, 525, 839, 29879, 2396, 313, 13, 4706, 396, 402, 2227, 29949, 29900, 29945, 448, 17434, 29871, 29906, 29929, 13, 308, 29945, 29892, 13, 4706, 396, 402, 2227, 29949, 29896, 29906, 448, 17434, 29871, 29941, 299...
custom/icds_reports/dashboard_utils.py
tstalka/commcare-hq
0
12765
<filename>custom/icds_reports/dashboard_utils.py<gh_stars>0 from corehq.apps.locations.util import location_hierarchy_config from custom.icds_reports.utils import icds_pre_release_features def get_dashboard_template_context(domain, couch_user): context = {} context['location_hierarchy'] = location_hierarchy_c...
[ 1, 529, 9507, 29958, 6341, 29914, 293, 6289, 29918, 276, 4011, 29914, 14592, 3377, 29918, 13239, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 3166, 7136, 29882, 29939, 29889, 13371, 29889, 2029, 800, 29889, 4422, 1053, 442...
slbo/policies/__init__.py
LinZichuan/AdMRL
27
119978
import abc from typing import Union import lunzi.nn as nn class BasePolicy(abc.ABC): @abc.abstractmethod def get_actions(self, states): pass BaseNNPolicy = Union[BasePolicy, nn.Module] # should be Intersection, see PEP544
[ 1, 1053, 25638, 13, 3166, 19229, 1053, 7761, 13, 5215, 25081, 2526, 29889, 15755, 408, 302, 29876, 13, 13, 13, 1990, 7399, 15644, 29898, 10736, 29889, 19658, 1125, 13, 1678, 732, 10736, 29889, 16595, 5696, 13, 1678, 822, 679, 29918, 738...
codestepbystep/convert_to_alt_caps.py
aleeper/python_sandbox
0
79272
def convert_to_alt_caps(message): lower = message.lower() upper = message.upper() data = [] space_offset = 0 for i in range(len(lower)): if not lower[i].isalpha(): space_offset += 1 if (i + space_offset) % 2 == 0: data.append(lower[i]) else: ...
[ 1, 29871, 13, 13, 1753, 3588, 29918, 517, 29918, 1997, 29918, 29883, 2547, 29898, 4906, 1125, 13, 1678, 5224, 353, 2643, 29889, 13609, 580, 13, 1678, 7568, 353, 2643, 29889, 21064, 580, 13, 1678, 848, 353, 5159, 13, 1678, 2913, 29918, ...
toy_gradlogp/utils.py
Ending2015a/toy_gradlogp
13
141644
# --- built in --- import os # --- 3rd party --- import numpy as np import torch from torch import nn # --- my module --- __all__ = [ 'langevin_dynamics', 'anneal_langevin_dynamics', 'sample_score_field', 'sample_energy_field' ] # --- dynamics --- def langevin_dynamics( score_fn, x, eps...
[ 1, 396, 11474, 4240, 297, 11474, 13, 5215, 2897, 13, 13, 29937, 11474, 29871, 29941, 5499, 6263, 11474, 13, 5215, 12655, 408, 7442, 13, 5215, 4842, 305, 13, 3166, 4842, 305, 1053, 302, 29876, 13, 13, 29937, 11474, 590, 3883, 11474, 13...
standards/tests/test_jurisdiction.py
GROCCAD/groccad
1
170802
<reponame>GROCCAD/groccad import django import pytest from standards.models import Jurisdiction, UserProfile @pytest.mark.django_db def test_juri(): juri = Jurisdiction( name="Ghana", display_name="Ghana NaCCA", country='GH' ) juri.save() assert juri.id # print(juri.__dict...
[ 1, 529, 276, 1112, 420, 29958, 29954, 1672, 4174, 3035, 29914, 17170, 617, 328, 13, 5215, 9557, 13, 5215, 11451, 1688, 13, 13, 3166, 20801, 29889, 9794, 1053, 16081, 275, 29467, 29892, 4911, 13909, 13, 13, 13, 29992, 2272, 1688, 29889, ...
rlpyt/ul/algos/ul_for_rl/stc.py
Slienteagle-wyb/rlpyt
0
126359
import torch from collections import namedtuple import copy from rlpyt.utils.tensor import valid_mean from rlpyt.ul.algos.ul_for_rl.base import BaseUlAlgorithm from rlpyt.utils.quick_args import save__init__args from rlpyt.utils.logging import logger from rlpyt.ul.replays.offline_ul_replay import OfflineUlReplayBuffer ...
[ 1, 1053, 4842, 305, 13, 3166, 16250, 1053, 4257, 23583, 13, 5215, 3509, 13, 3166, 364, 29880, 2272, 29873, 29889, 13239, 29889, 20158, 1053, 2854, 29918, 12676, 13, 3166, 364, 29880, 2272, 29873, 29889, 352, 29889, 9564, 359, 29889, 352, ...
train-xception.py
jGsch/kaggle-dfdc
124
38679
<filename>train-xception.py<gh_stars>100-1000 import os import csv import shutil import random from PIL import Image import numpy as np import torch from torch import nn, optim from torch.utils.data import Dataset, DataLoader import xception_conf as config from model_def import xception from augmentation...
[ 1, 529, 9507, 29958, 14968, 29899, 29916, 1441, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29900, 29900, 29899, 29896, 29900, 29900, 29900, 13, 5215, 2897, 30004, 13, 5215, 11799, 30004, 13, 5215, 528, 4422, 30004, 13, 5215,...
tests/test_jq_fetcher.py
zillionare/z-quotes
0
141264
#!/usr/bin/env python # -*- coding: utf-8 -*- import logging import os import unittest from unittest import mock import numpy as np import datetime import arrow import jqadaptor from jqadaptor.fetcher import FetcherQuotaError, AccountExpiredError logger = logging.getLogger(__file__) logging.basicConfig(level=logging...
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 5215, 12183, 13, 5215, 2897, 13, 5215, 443, 27958, 13, 3166, 443, 27958, 1053, 11187, 13, 5215, 12655,...
tests/cases/run/match2.py
3e45/minpiler
0
120979
<reponame>3e45/minpiler from minpiler.std import M, emulator match None: case 0: M.print(0) case None: M.print("None") case 1: M.print(10) case 2: M.print(20) # > None emulator.kill()
[ 1, 529, 276, 1112, 420, 29958, 29941, 29872, 29946, 29945, 29914, 1195, 29886, 3955, 13, 3166, 1375, 29886, 3955, 29889, 4172, 1053, 341, 29892, 26364, 13, 13, 4352, 6213, 29901, 13, 1678, 1206, 29871, 29900, 29901, 13, 4706, 341, 29889, ...
scripts/python/merge_read_counts.py
BradhamLab/scPipe
0
1609458
<reponame>BradhamLab/scPipe """ Merge sample count files into a count matrix with genes as rows and samples as columns. Author: <NAME> Date: August 16, 2018 """ import os import pandas as pd import numpy as np def simple_merge(count_dir): data_frames = [] for x in os.listdir(count_dir): sample = o...
[ 1, 529, 276, 1112, 420, 29958, 29933, 3665, 3391, 28632, 29914, 1557, 12197, 412, 13, 15945, 29908, 13, 15836, 479, 4559, 2302, 2066, 964, 263, 2302, 4636, 411, 2531, 267, 408, 4206, 322, 11916, 408, 13, 13099, 29889, 13, 13, 13720, 2...
genestack_client/scripts/genestack_user_setup.py
genestack/python-client
2
45187
<reponame>genestack/python-client #!python # -*- coding: utf-8 -*- from __future__ import print_function from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals from future import standard_library standard_library.install_aliases() from builtins import input from...
[ 1, 529, 276, 1112, 420, 29958, 1885, 342, 547, 29914, 4691, 29899, 4645, 13, 29937, 29991, 4691, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 13, 3166, 4770, 29888, 9130, 1649, 1053, 1596, 29918,...
froide_crowdfunding/migrations/0005_crowdfunding_public_interest.py
okfde/froide-crowdfunding
1
183047
# Generated by Django 2.1.8 on 2019-04-15 09:32 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('froide_crowdfunding', '0004_contribution_public'), ] operations = [ migrations.AddField( model_name='crowdfunding', ...
[ 1, 396, 3251, 630, 491, 15337, 29871, 29906, 29889, 29896, 29889, 29947, 373, 29871, 29906, 29900, 29896, 29929, 29899, 29900, 29946, 29899, 29896, 29945, 29871, 29900, 29929, 29901, 29941, 29906, 13, 13, 3166, 9557, 29889, 2585, 1053, 9725, ...
.github/Translator-Bot-V2/main.py
DarkSkull777/Translator-Bot-V2
1
1608706
# Made with python3 # (C) @FayasNoushad # Copyright permission under MIT License # All rights reserved by FayasNoushad # License -> https://github.com/FayasNoushad/Translator-Bot-V2/blob/main/LICENSE import os from pyrogram import Client, filters from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton fr...
[ 1, 396, 18266, 411, 3017, 29941, 13, 29937, 313, 29907, 29897, 732, 29943, 388, 294, 29940, 681, 21312, 13, 29937, 14187, 1266, 10751, 1090, 341, 1806, 19245, 13, 29937, 2178, 10462, 21676, 491, 383, 388, 294, 29940, 681, 21312, 13, 299...
tests/BaseCase.py
YaroslavChyhryn/SchoolAPI
0
28706
<gh_stars>0 import unittest from school_api.app import create_app from school_api.db import create_tables, drop_tables from school_api.data_generator import test_db class BaseCase(unittest.TestCase): @classmethod def setUpClass(cls): cls.app = create_app('test') def setUp(self): drop_tabl...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 443, 27958, 13, 3166, 3762, 29918, 2754, 29889, 932, 1053, 1653, 29918, 932, 13, 3166, 3762, 29918, 2754, 29889, 2585, 1053, 1653, 29918, 24051, 29892, 5768, 29918, 24051, 13, 3166,...
mkdocs/relative_path_ext.py
davidhrbac/mkdocs
57
89925
""" # Relative Path Markdown Extension During the MkDocs build we rewrite URLs that link to local Markdown or media files. Using the following pages configuration we can look at how the output is changed. pages: - ['index.md'] - ['tutorial/install.md'] - ['tutorial/intro.md'] ## Markdown URLs When l...
[ 1, 9995, 13, 29937, 6376, 1230, 10802, 4485, 3204, 7338, 2673, 13, 13, 29928, 3864, 278, 341, 29895, 29928, 12332, 2048, 591, 10683, 24295, 393, 1544, 304, 1887, 13, 9802, 3204, 470, 5745, 2066, 29889, 5293, 278, 1494, 6515, 5285, 13, ...
services/worker/main.py
mrgrassho/geo-diff-2
0
25404
<reponame>mrgrassho/geo-diff-2 #!/usr/bin/env python3 # -*- coding: utf-8 -*- from geodiff_worker import GeoDiffWorker from os import environ from os.path import join, dirname from dotenv import load_dotenv dotenv_path = join(dirname(__file__), '.env') load_dotenv(dotenv_path) def main(): """Main entry point to ...
[ 1, 529, 276, 1112, 420, 29958, 29885, 29878, 629, 465, 1251, 29914, 24756, 29899, 12765, 29899, 29906, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 29941, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 2993...
usuarios/views.py
alvarocneto/alura_django
1
8818
<filename>usuarios/views.py from django.shortcuts import redirect from django.shortcuts import render from django.contrib.auth.models import User from django.views.generic.base import View from perfis.models import Perfil from usuarios.forms import RegistrarUsuarioForm class RegistrarUsuarioView(View): template_...
[ 1, 529, 9507, 29958, 375, 29884, 8596, 29914, 7406, 29889, 2272, 13, 3166, 9557, 29889, 12759, 7582, 29879, 1053, 6684, 13, 3166, 9557, 29889, 12759, 7582, 29879, 1053, 4050, 13, 3166, 9557, 29889, 21570, 29889, 5150, 29889, 9794, 1053, 4...
python/tests/test_stats.py
winni2k/tskit
0
130817
<filename>python/tests/test_stats.py # MIT License # # Copyright (c) 2018-2019 Tskit Developers # Copyright (C) 2016 University of Oxford # # 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 wit...
[ 1, 529, 9507, 29958, 4691, 29914, 21150, 29914, 1688, 29918, 16202, 29889, 2272, 13, 29937, 341, 1806, 19245, 13, 29937, 13, 29937, 14187, 1266, 313, 29883, 29897, 29871, 29906, 29900, 29896, 29947, 29899, 29906, 29900, 29896, 29929, 323, 8...
typogrify/templatetags/typogrify_tags.py
tylerbutler/typogrify
0
2494
from typogrify.filters import amp, caps, initial_quotes, smartypants, titlecase, typogrify, widont, TypogrifyError from functools import wraps from django.conf import settings from django import template from django.utils.safestring import mark_safe from django.utils.encoding import force_unicode register = template....
[ 1, 515, 2393, 468, 29878, 1598, 29889, 26705, 1053, 21332, 29892, 26091, 29892, 2847, 29918, 339, 4769, 29892, 15040, 1478, 1934, 29892, 3611, 4878, 29892, 2393, 468, 29878, 1598, 29892, 9449, 609, 29892, 14213, 468, 29878, 1598, 2392, 13, ...
Data/GalZoo2_TFrecords.py
AshleySpindler/AstroSense
0
137071
<filename>Data/GalZoo2_TFrecords.py import numpy as np import tensorflow as tf from astropy.io import fits import matplotlib.image as mpimg from skimage.transform import rescale from skimage.color import rgb2gray from numpy.random import choice from skimage.exposure import rescale_intensity import sys from multiprocess...
[ 1, 529, 9507, 29958, 1469, 29914, 29954, 284, 29999, 3634, 29906, 29918, 8969, 3757, 4339, 29889, 2272, 13, 5215, 12655, 408, 7442, 13, 5215, 26110, 408, 15886, 13, 3166, 8717, 14441, 29889, 601, 1053, 23994, 13, 5215, 22889, 29889, 3027,...
Interview-Preparation/Facebook/BinarySearch-find-smallest-divisor-given-a-threshold.py
shoaibur/SWE
1
91002
class Solution: def smallestDivisor(self, nums: List[int], threshold: int) -> int: def condition(divisor) -> bool: return sum((num - 1) // divisor + 1 for num in nums) <= threshold lo, hi = 1, max(nums) while lo < hi: mid = lo + (hi - lo) // 2 if...
[ 1, 770, 24380, 29901, 13, 1678, 822, 19087, 12596, 275, 272, 29898, 1311, 29892, 954, 29879, 29901, 2391, 29961, 524, 1402, 16897, 29901, 938, 29897, 1599, 938, 29901, 13, 308, 13, 4706, 822, 4195, 29898, 4563, 275, 272, 29897, 1599, 61...
pipeline/reach-es-extractor/refparse/utils/__init__.py
wellcometrust/reach
11
36198
<filename>pipeline/reach-es-extractor/refparse/utils/__init__.py from .parse import structure_reference from .fuzzy_match import FuzzyMatcher from .file_manager import FileManager from .serialiser import serialise_matched_reference, serialise_reference from .exact_match import ExactMatcher __all__ = [ structure_re...
[ 1, 529, 9507, 29958, 13096, 5570, 29914, 276, 496, 29899, 267, 29899, 21111, 272, 29914, 999, 5510, 29914, 13239, 29914, 1649, 2344, 26914, 2272, 13, 3166, 869, 5510, 1053, 3829, 29918, 5679, 13, 3166, 869, 29888, 3365, 1537, 29918, 4352,...
tests/src/Diksha_Reports/usage_by_textbook/download_all_collection_records.py
JalajaTR/cQube
0
267
<gh_stars>0 import os import time from selenium.webdriver.support.select import Select from Data.parameters import Data from get_dir import pwd from reuse_func import GetData class All_records_download(): def __init__(self,driver): self.driver = driver self.filename ='' def test_download_cs...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 2897, 13, 5215, 931, 13, 13, 3166, 18866, 29889, 29813, 29889, 5924, 29889, 2622, 1053, 7605, 13, 13, 3166, 3630, 29889, 16744, 1053, 3630, 13, 3166, 679, 29918, 3972, 1053, 282, ...
pyrsa/io/meadows.py
PeerHerholz/pyrsa
4
28506
"""Covers import of data downloaded from the `Meadows online behavior platform <https://meadows-research.com/>`_. For information on available file types see the meadows `documentation on downloads <https://meadows-research.com/documentation\ /researcher/downloads/>`_. """ from os.path import basename import numpy fr...
[ 1, 9995, 7967, 874, 1053, 310, 848, 16532, 515, 278, 13, 29952, 29924, 1479, 1242, 7395, 6030, 7481, 529, 991, 597, 1004, 23626, 29899, 690, 2842, 29889, 510, 3779, 29952, 5396, 13, 13, 13, 2831, 2472, 373, 3625, 934, 4072, 1074, 278,...
src/skiptracer/plugins/who_call_id/__init__.py
EdwardDantes/skiptracer
912
50278
"""Whocallid.com search module""" from __future__ import print_function from __future__ import absolute_import from ..base import PageGrabber from ...colors.default_colors import DefaultBodyColors as bc import re import logging try: import __builtin__ as bi except BaseException: import builtins as bi class Wh...
[ 1, 9995, 8809, 542, 497, 333, 29889, 510, 2740, 3883, 15945, 29908, 13, 3166, 4770, 29888, 9130, 1649, 1053, 1596, 29918, 2220, 13, 3166, 4770, 29888, 9130, 1649, 1053, 8380, 29918, 5215, 13, 3166, 6317, 3188, 1053, 9305, 29954, 4201, 4...
ooobuild/lo/sheet/dde_item_info.py
Amourspirit/ooo_uno_tmpl
0
1613870
<gh_stars>0 # coding: utf-8 # # Copyright 2022 :Barry-Thomas-Paul: Moss # # 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...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 29937, 14137, 29901, 23616, 29899, 29947, 13, 29937, 13, 29937, 14187, 1266, 29871, 29906, 29900, 29906, 29906, 584, 4297, 719, 29899, 1349, 18902, 29899, 18275, 29901, 341, 2209, 13, 29937...
minato_namikaze/bot_files/lib/functions/user.py
ooliver1/yondaime-hokage
1
109646
from typing import Optional, Union import discord async def get_dm(user: Optional[Union[int, discord.Member]], ctx=None): if isinstance(user, int): user = ctx.bot.get_user(user) return user.dm_channel if user.dm_channel else await user.create_dm() def get_user(user: Union[int, discord.Member], ctx=...
[ 1, 515, 19229, 1053, 28379, 29892, 7761, 13, 13, 5215, 2313, 536, 13, 13, 13, 12674, 822, 679, 29918, 18933, 29898, 1792, 29901, 28379, 29961, 19986, 29961, 524, 29892, 2313, 536, 29889, 13404, 20526, 12893, 29922, 8516, 1125, 13, 1678, ...
shinrl/__init__.py
qqhann/ShinRL
0
1608296
from gym.envs.registration import register # Common mathmetical (jitted) functions & classes. from ._calc.backup_dp import ( calc_optimal_q, calc_q, calc_return, calc_visit, double_backup_dp, expected_backup_dp, munchausen_backup_dp, optimal_backup_dp, soft_expected_backup_dp, ) fro...
[ 1, 515, 330, 962, 29889, 264, 4270, 29889, 1727, 8306, 1053, 6036, 13, 13, 29937, 13103, 5844, 2527, 936, 313, 29926, 4430, 29897, 3168, 669, 4413, 29889, 13, 3166, 869, 29918, 28667, 29889, 1627, 786, 29918, 6099, 1053, 313, 13, 1678, ...
fhirclient/models/goal.py
carolinarsm/client-py
418
1616039
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Goal) on 2019-05-07. # 2019, SMART Health IT. from . import domainresource class Goal(domainresource.DomainResource): """ Describes the intended objective(s) for a patient, group or o...
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 29937, 13, 29937, 29871, 3251, 630, 515, 383, 29950, 8193, 29871, 29946, 29889, 29900, 29889, 29900, 298...
pyplots/numpy_intro_3.py
junghun73/Learning
419
1615113
import numpy as np import matplotlib.pyplot as plt img = plt.imread('../data/elephant.png') print img.shape, img.dtype # (200, 300, 3) dtype('float32') plt.imshow(img) plt.savefig('plot.png') plt.show() plt.imsave('red_elephant', img[:,:,0], cmap=plt.cm.gray) # This saved only one channel (of RGB) plt.imshow(plt....
[ 1, 1053, 12655, 408, 7442, 13, 5215, 22889, 29889, 2272, 5317, 408, 14770, 13, 13, 2492, 353, 14770, 29889, 326, 949, 877, 6995, 1272, 29914, 6146, 561, 424, 29889, 2732, 1495, 13, 2158, 10153, 29889, 12181, 29892, 10153, 29889, 29881, ...
trading_alert/crypto/tasks.py
Mohammadrezafah/trading-alert
1
124587
import logging import cryptocompare from django.conf import settings from django.contrib.auth import get_user_model from django.core.exceptions import ImproperlyConfigured from django.core.mail import EmailMessage from config import celery_app from trading_alert.crypto.models import CriptoAlert User = get_user_model...
[ 1, 1053, 12183, 13, 13, 5215, 274, 17929, 18307, 13, 3166, 9557, 29889, 5527, 1053, 6055, 13, 3166, 9557, 29889, 21570, 29889, 5150, 1053, 679, 29918, 1792, 29918, 4299, 13, 3166, 9557, 29889, 3221, 29889, 11739, 29879, 1053, 1954, 771, ...
quantitative_finance/L3/python/hjm_test.py
Aperture-Electronic/Vitis_Libraries
1
82479
#!/usr/bin/env python3 # Ensure environmental variable i.e. paths are set to used the modules from xf_fintech_python import DeviceManager, HJM import numpy as np import argparse def zcbAnalytical(rawData, maturity, tau = 0.5): # Take last row fc = np.copy(rawData[rawData.shape[0] - 1]) fc *= 0....
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 29941, 30004, 13, 30004, 13, 29937, 22521, 545, 29380, 2286, 474, 29889, 29872, 29889, 10898, 526, 731, 304, 1304, 278, 10585, 30004, 13, 3166, 921, 29888, 29918, 4951, 11345, 29918, 4691, 1...
ramda/memoize_with_test.py
jakobkolb/ramda.py
56
22619
<gh_stars>10-100 from ramda.memoize_with import memoize_with from ramda.product import product from ramda.private.asserts import assert_equal as e count = 0 def memoize_with_test(): @memoize_with(lambda x: -x) def factorial(n): global count count += 1 return product(range(1, n + 1)) ...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29900, 29899, 29896, 29900, 29900, 13, 3166, 13472, 1388, 29889, 6954, 29877, 675, 29918, 2541, 1053, 2626, 29877, 675, 29918, 2541, 13, 3166, 13472, 1388, 29889, 4704, 1053, 3234, 13, 3166, ...
instagram/views.py
Julia-Agasaro/Insta-clone
0
107940
from django.http import Http404 from django.http import HttpResponseRedirect from django.shortcuts import render,redirect from django.contrib.auth.decorators import login_required from django.contrib import messages from django.contrib.auth.models import User from .models import Image, Profile,Comment,Likes,Follow from...
[ 1, 515, 9557, 29889, 1124, 1053, 9056, 29946, 29900, 29946, 13, 3166, 9557, 29889, 1124, 1053, 9056, 5103, 24735, 13, 3166, 9557, 29889, 12759, 7582, 29879, 1053, 4050, 29892, 17886, 13, 3166, 9557, 29889, 21570, 29889, 5150, 29889, 19557, ...
graphene/graphene_core/relation_extraction/model/extraction.py
kkatsamaktsis/PyGraphene
0
131259
<gh_stars>0 class Extraction: pass
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 1990, 7338, 13857, 29901, 13, 1678, 1209, 13, 2 ]
tests/unit/test_nest.py
hkak03key/python-lib-sample
0
112029
<gh_stars>0 import sys def test_good_bye_nest(capfd): import lib_sample.nest as nest nest.good_bye() out, err = capfd.readouterr() assert out == "good_bye, this is nest/nest.py.\n" assert err is "" def test_good_bye_lib_sample(capfd): import lib_sample lib_sample.good_bye() out, er...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 10876, 13, 13, 13, 13, 1753, 1243, 29918, 16773, 29918, 26966, 29918, 17510, 29898, 5030, 11512, 1125, 13, 1678, 1053, 4303, 29918, 11249, 29889, 17510, 408, 17763, 13, 1678, 17763,...
pythonql/Executor.py
hi117/pythonql
0
43097
<reponame>hi117/pythonql from pythonql.algebra.operator import plan_from_list from pythonql.algebra.operators import * from pythonql.PQTuple import PQTuple from pythonql.helpers import flatten from pythonql.Rewriter import rewrite from pythonql.debug import Debug import json import types def make_pql_tuple(vals,lcs): ...
[ 1, 529, 276, 1112, 420, 29958, 2918, 29896, 29896, 29955, 29914, 4691, 1519, 13, 3166, 3017, 1519, 29889, 15742, 29889, 6891, 1053, 3814, 29918, 3166, 29918, 1761, 13, 3166, 3017, 1519, 29889, 15742, 29889, 3372, 4097, 1053, 334, 13, 3166...
cputils/dependencyManager.py
computePods/pythonUtils
0
112814
<gh_stars>0 import yaml from cputils.settlingTimerMixin import mixinSettlingTimer class DependencyManager : """ The ComputePods Dependency Manager component """ def __init__(self, natsClient) : self.nc = natsClient mixinSettlingTimer(self) async def listenForDependencyMessages(self) : async d...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 343, 8807, 13, 13, 3166, 274, 649, 2719, 29889, 9915, 1847, 14745, 29924, 861, 262, 1053, 6837, 262, 29903, 1803, 1847, 14745, 13, 13, 1990, 10034, 5197, 3260, 584, 13, 29871, 9...
venv/Lib/site-packages/coincurve/utils.py
CompeteLeak/crankycoin
0
84293
<filename>venv/Lib/site-packages/coincurve/utils.py<gh_stars>0 from base64 import b64decode, b64encode from binascii import hexlify, unhexlify from hashlib import sha256 as _sha256 from os import urandom from coincurve.context import GLOBAL_CONTEXT from ._libsecp256k1 import ffi, lib GROUP_ORDER = (b'\xff\xff\xff\xff...
[ 1, 529, 9507, 29958, 854, 29894, 29914, 14868, 29914, 2746, 29899, 8318, 29914, 1111, 262, 2764, 345, 29914, 13239, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 3166, 2967, 29953, 29946, 1053, 289, 29953, 29946, 13808, 298...
invenio-rdm/setup/provstore-push.py
ludwig-burtscher/invenio-with-provenance
0
155442
<gh_stars>0 #!/usr/bin/env python3 # Provstore credentials over ENV variables: # Provstore username: PROVSTORE_USERNAME # Provstore apikey: PROVSTORE_APIKEY # exit codes: # 0: All good - provstore document created successfully # 1: No provstore credentials # 2: Provstore document upload failed # 3: Invalid command li...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 29941, 13, 13, 29937, 9133, 8899, 16140, 975, 12524, 29963, 3651, 29901, 13, 29937, 9133, 8899, 8952, 29901, 13756, 29963, 1254, 29949, ...
main.py
mywrong/walabot_heatmap_camera
1
1609055
<reponame>mywrong/walabot_heatmap_camera from walabot import Walabot import time import json import collections from multiprocessing import Process,Value import cv2 class Getmap: def __init__(self): self.w=Walabot() self.w.ARENA=[(100, 500, 10), (-45, 45, 3), (-45, 45, 3)] self.RF...
[ 1, 529, 276, 1112, 420, 29958, 1357, 15866, 549, 29914, 14625, 370, 327, 29918, 354, 271, 1958, 29918, 26065, 13, 3166, 17042, 370, 327, 1053, 5260, 370, 327, 6756, 13, 5215, 931, 30004, 13, 5215, 4390, 30004, 13, 5215, 16250, 30004, ...
bokeh/plot_object.py
csaid/bokeh
1
79321
from __future__ import absolute_import, print_function import os.path from uuid import uuid4 from functools import wraps import warnings import logging logger = logging.getLogger(__file__) from six import add_metaclass, iteritems from six.moves.urllib.parse import urlsplit from .embed import autoload_static, autolo...
[ 1, 515, 4770, 29888, 9130, 1649, 1053, 8380, 29918, 5215, 29892, 1596, 29918, 2220, 13, 13, 5215, 2897, 29889, 2084, 13, 3166, 318, 5416, 1053, 318, 5416, 29946, 13, 3166, 2090, 312, 8789, 1053, 11463, 567, 13, 13, 5215, 18116, 13, 52...
data_preprocess/drone_images/rgb_downsampling.py
Shanci-Li/TOPO-DataGen
5
175935
<reponame>Shanci-Li/TOPO-DataGen<gh_stars>1-10 import os import glob import numpy as np from skimage import io, transform import argparse import multiprocessing as mp def _func_downsampling(in_img, out_img, ttl_iter, mp_progress, mp_lock): img = io.imread(in_img) out = transform.resize(img, [480, 720], preser...
[ 1, 529, 276, 1112, 420, 29958, 2713, 8463, 29899, 23410, 29914, 29911, 4590, 29949, 29899, 1469, 15462, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 5215, 2897, 13, 5215, 13149, 13, 5215, 12655, 408, 7442, 13, 31...
src/Honeybee_EnergyPlus NoMass Opaque Material.py
rdzeldenrust/Honeybee
1
1612284
<reponame>rdzeldenrust/Honeybee<filename>src/Honeybee_EnergyPlus NoMass Opaque Material.py # By <NAME> # <EMAIL> # Honeybee started by <NAME> is licensed # under a Creative Commons Attribution-ShareAlike 3.0 Unported License. """ Use this component to create a custom opaque material that has no mass, which can be plug...
[ 1, 529, 276, 1112, 420, 29958, 5499, 10533, 1145, 23575, 29914, 29950, 4992, 915, 29872, 29966, 9507, 29958, 4351, 29914, 29950, 4992, 915, 29872, 29918, 29923, 1089, 1927, 29575, 1939, 29924, 465, 438, 3274, 802, 17582, 29889, 2272, 13, ...
igraph-test/local_graph.py
firetto/JanusGraphTest
0
180205
<gh_stars>0 """ local_graph.py Contains the LocalGraph class, which contains an igraph.Graph instance and some methods to access and modify it. Used for subgraphs in a GraphInterface. <NAME>, 2021 """ from log_to_file import log_to_file from datetime import datetime import igraph class LocalGraph(): """ A...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 15945, 29908, 13, 2997, 29918, 4262, 29889, 2272, 13, 13, 21409, 278, 9959, 9527, 770, 29892, 607, 3743, 385, 8919, 1140, 29889, 9527, 2777, 322, 777, 3519, 304, 2130, 322, 6623, 372, ...
AtCoder/ABC/000-159/ABC147_D.py
sireline/PyCode
0
101577
<reponame>sireline/PyCode N = int(input()) A = [int(n) for n in input().split()] Aset = set(A) m = (10**9+7) o = {} ans = [] for a in A: o.setdefault(a, 0) o[a] += 1 for i in range(len(Aset)-1): for j in range(i+1, len(Aset)): ans.append((A[i]^A[j])*o[A[i]]*o[A[j]]) print(sum(ans)/m)
[ 1, 529, 276, 1112, 420, 29958, 29879, 533, 1220, 29914, 19737, 3399, 13, 29940, 353, 938, 29898, 2080, 3101, 13, 29909, 353, 518, 524, 29898, 29876, 29897, 363, 302, 297, 1881, 2141, 5451, 580, 29962, 13, 29909, 842, 353, 731, 29898, ...
transformers/median/median.py
affresco/demo_features
0
95531
<filename>transformers/median/median.py import numpy as np import logging # Scientific import pandas as pd # Base class for all features from transformers.abstract.mixin import AbstractFeature # ################################################################## # AVERAGE TRUE RANGE # ###############################...
[ 1, 529, 9507, 29958, 9067, 414, 29914, 2168, 713, 29914, 2168, 713, 29889, 2272, 13, 5215, 12655, 408, 7442, 13, 5215, 12183, 13, 13, 29937, 23753, 928, 13, 5215, 11701, 408, 10518, 13, 13, 29937, 7399, 770, 363, 599, 5680, 13, 3166, ...
controler/userManage.py
sanxiadaba/pythonBlog
2
155352
""" File description. Background management page for regular users and editors to view their articles, comments, favorites and other functions encoding: utf-8 @author: <NAME> @contact: <EMAIL> @software: Pycharm @time: 2022/1/12 @gituhb: sanxiadaba/pythonBlog """ import base64 import os import time import traceback f...
[ 1, 9995, 13, 2283, 6139, 29889, 13, 13, 10581, 10643, 1813, 363, 4943, 4160, 322, 3863, 943, 304, 1776, 1009, 7456, 29892, 6589, 29892, 7853, 3246, 322, 916, 3168, 13, 13, 22331, 29901, 23616, 29899, 29947, 13, 29992, 8921, 29901, 529, ...
Day_19/etch_A_scketch.py
ecanro/100DaysOfCode_Python
0
56405
<reponame>ecanro/100DaysOfCode_Python from turtle import Turtle, Screen tim = Turtle() #->separete instance of tommy and any other turtle screen = Screen() tim.shape("turtle")#->states of tim tim.color("red") # tommy = Turtle()#->separate instance of tim and any other turtle # tommy.color("blue")#->states of tommy #...
[ 1, 529, 276, 1112, 420, 29958, 687, 273, 307, 29914, 29896, 29900, 29900, 25991, 2776, 3399, 29918, 11980, 13, 3166, 260, 4227, 280, 1053, 323, 4227, 280, 29892, 22666, 13, 13, 9346, 353, 323, 4227, 280, 580, 396, 976, 19570, 598, 371...
rolldecayestimators/tests/test_polynom_estimator.py
martinlarsalbert/rolldecay-estimators
1
27717
<reponame>martinlarsalbert/rolldecay-estimators<filename>rolldecayestimators/tests/test_polynom_estimator.py<gh_stars>1-10 import pytest import pandas as pd import os.path from sklearn.datasets import make_regression from sklearn.pipeline import Pipeline from sklearn.feature_selection import SelectKBest from sklearn.li...
[ 1, 529, 276, 1112, 420, 29958, 28402, 262, 29880, 1503, 284, 2151, 29914, 1245, 7099, 388, 29899, 342, 326, 4097, 29966, 9507, 29958, 1245, 7099, 388, 342, 326, 4097, 29914, 21150, 29914, 1688, 29918, 3733, 948, 290, 29918, 342, 326, 10...
cnswd/scripts/wy_fhpg.py
NeoBert/liudengfeng-cnswd
7
150496
import re import time from multiprocessing import Pool import pandas as pd from cnswd.mongodb import get_db from cnswd.websource.wy import fetch_fhpg from ..setting.constants import MARKET_START, MAX_WORKER from ..utils import make_logger from .base import get_stock_status logger = make_logger('网易分红配股') NAMES = ['分...
[ 1, 1053, 337, 13, 5215, 931, 13, 3166, 6674, 307, 985, 292, 1053, 28625, 13, 13, 5215, 11701, 408, 10518, 13, 13, 3166, 274, 1983, 9970, 29889, 23264, 1053, 679, 29918, 2585, 13, 3166, 274, 1983, 9970, 29889, 2676, 4993, 29889, 12822,...
redata/settings.py
mociarain/redata
0
133395
import os GF_SECURITY_ADMIN_USER = os.environ["GF_SECURITY_ADMIN_USER"] GF_SECURITY_ADMIN_PASSWORD = os.environ["GF_SECURITY_ADMIN_PASSWORD"] METRICS_DB_URL = os.environ["REDATA_METRICS_DB_URL"] REDATA_METRICS_DATABASE_HOST = os.environ["REDATA_METRICS_DATABASE_HOST"] REDATA_METRICS_DATABASE_USER = os.environ["REDAT...
[ 1, 1053, 2897, 13, 13, 29954, 29943, 29918, 1660, 22484, 11937, 29918, 3035, 16173, 29918, 11889, 353, 2897, 29889, 21813, 3366, 29954, 29943, 29918, 1660, 22484, 11937, 29918, 3035, 16173, 29918, 11889, 3108, 13, 29954, 29943, 29918, 1660, ...
server/app/tests/test_views.py
atom-space/atomspace.od.ua
3
145326
<filename>server/app/tests/test_views.py from django.test import TestCase, Client from django.urls import reverse from app.models import Resident, Mentor, Order, News, Merch import json class TestViews(TestCase): def setUp(self): self.client = Client() self.mentors_url = reverse('mentors') self.residents_url =...
[ 1, 529, 9507, 29958, 2974, 29914, 932, 29914, 21150, 29914, 1688, 29918, 7406, 29889, 2272, 13, 3166, 9557, 29889, 1688, 1053, 4321, 8259, 29892, 12477, 13, 3166, 9557, 29889, 26045, 1053, 11837, 13, 3166, 623, 29889, 9794, 1053, 2538, 16...
pancake_problem.py
thyrdmc/Pancake-Problem-with-Artificial-Intelligence
0
150816
<gh_stars>0 # coding=utf-8 from __future__ import print_function from simpleai.search import SearchProblem, breadth_first, depth_first, limited_depth_first, iterative_limited_depth_first, uniform_cost, greedy, astar from simpleai.search.viewers import WebViewer, ConsoleViewer, BaseViewer import random import time GOA...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 29937, 14137, 29922, 9420, 29899, 29947, 13, 3166, 4770, 29888, 9130, 1649, 1053, 1596, 29918, 2220, 13, 3166, 2560, 1794, 29889, 4478, 1053, 11856, 26604, 29892, 18423, 386, 29918, 4102, ...
assign_2.3.py
tramontana-software/Python_Coding_Carlos
0
93316
# My Script: hrs=input('Enter Hours: ') hrs=float(hrs) rph=input('Enter your rate per hour: ') rph=float(rph) pay=hrs*rph print('Pay:', pay)
[ 1, 396, 1619, 14415, 29901, 30004, 13, 30004, 13, 1092, 29879, 29922, 2080, 877, 10399, 379, 2470, 29901, 525, 8443, 13, 1092, 29879, 29922, 7411, 29898, 1092, 29879, 8443, 13, 29878, 561, 29922, 2080, 877, 10399, 596, 6554, 639, 7234, ...
learn-kana/__main__.py
Ewpratten/learn-kana
0
150617
from luts import kana_to_romaji, romaji_to_kana, simple_kana_to_romaji import random import os import time ## Term info ## term = os.popen('stty size', 'r').read().split() term_height, term_width = int(term[0]), int(term[1]) - 5 # term_width = 30 # i have issues gap = 3 count = 50 max_count = 50 kana_set = simple_k...
[ 1, 515, 301, 8842, 1053, 413, 1648, 29918, 517, 29918, 456, 1175, 29875, 29892, 6017, 1175, 29875, 29918, 517, 29918, 29895, 1648, 29892, 2560, 29918, 29895, 1648, 29918, 517, 29918, 456, 1175, 29875, 13, 5215, 4036, 13, 5215, 2897, 13, ...
helloworld.py
justintdavis99/hello_UTC
0
138042
print{"Hello World! Written by Justin"} print{"This is my first python code"} x=int(input('Enter an integer: ')) if x%2 ==0; print('') print('Even') else: print('') print('Odd') print('Done with conditional')
[ 1, 1596, 6377, 10994, 2787, 29991, 29871, 16849, 841, 491, 26408, 9092, 13, 2158, 6377, 4013, 338, 590, 937, 3017, 775, 9092, 13, 13, 29916, 29922, 524, 29898, 2080, 877, 10399, 385, 6043, 29901, 525, 876, 13, 361, 921, 29995, 29906, ...
transition_amr_parser/action_pointer/amr_parser.py
IBM/transition-amr-parser
76
118568
# Standalone AMR parser import os import json import torch from transition_amr_parser.model import AMRModel import transition_amr_parser.utils as utils from fairseq.models.roberta import RobertaModel from transition_amr_parser.roberta_utils import extract_features_aligned_to_words class AMRParser(): def __init_...
[ 1, 396, 6679, 18785, 13862, 29934, 13812, 13, 13, 5215, 2897, 13, 5215, 4390, 13, 5215, 4842, 305, 13, 3166, 9558, 29918, 314, 29878, 29918, 16680, 29889, 4299, 1053, 13862, 29934, 3195, 13, 5215, 9558, 29918, 314, 29878, 29918, 16680, ...
tests/test_draw.py
mrtrkmn/yellowbrick
3,662
196841
<gh_stars>1000+ # tests.test_draw # Tests for the high-level drawing utility functions # # Author: <NAME> <<EMAIL>> # Created: Sun Aug 19 11:21:04 2018 -0400 # # ID: test_draw.py [dd915ad] <EMAIL> $ """ Tests for the high-level drawing utility functions """ ###########################################################...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29900, 29900, 29900, 29974, 13, 29937, 6987, 29889, 1688, 29918, 4012, 13, 29937, 4321, 29879, 363, 278, 1880, 29899, 5563, 11580, 19725, 3168, 13, 29937, 13, 29937, 13361, 29901, 29871, 529, ...
code/test_trend.py
baolintian/Timeseries_feature_test
0
62872
import pytest from feature_judge import * from util import * def test_monotone_increase(): timeseries_name = "root.CNNP.QF.1#.QF1RCP604MP" config_path = "../config/" + timeseries_name image_path = "../images/" + timeseries_name timeseries_path = "../data/" + timeseries_name + ".csv" trend_config, t...
[ 1, 1053, 11451, 1688, 13, 3166, 4682, 29918, 17675, 479, 1053, 334, 13, 3166, 3667, 1053, 334, 13, 13, 1753, 1243, 29918, 3712, 327, 650, 29918, 262, 1037, 559, 7295, 13, 1678, 3064, 6358, 29918, 978, 353, 376, 4632, 29889, 29907, 102...
ros2_batch_job/vendor/osrf_pycommon/tests/unit/test_process_utils/impl_aep_trollius.py
taewoong0627/ci
31
187293
from osrf_pycommon.process_utils import asyncio from osrf_pycommon.process_utils.async_execute_process import async_execute_process from osrf_pycommon.process_utils import get_loop # allow module to be importable for --cover-inclusive try: from osrf_pycommon.process_utils.async_execute_process_trollius import From...
[ 1, 515, 2897, 9600, 29918, 2272, 9435, 29889, 5014, 29918, 13239, 1053, 408, 948, 3934, 13, 3166, 2897, 9600, 29918, 2272, 9435, 29889, 5014, 29918, 13239, 29889, 12674, 29918, 7978, 29918, 5014, 1053, 7465, 29918, 7978, 29918, 5014, 13, ...