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
Advance-Statistical-Learning/GradientDescent.py
mborkhat/mtech-data-science
2
56393
from sklearn.preprocessing import scale import numpy as np class GradientDescent: learning_rate = 0.01 max_iter = 2000 scale = False new_theta = [] def __init__(self, learning_rate=0.01, max_iter=2000, scale=False): self.learning_rate = learning_rate self.max_ite...
[ 1, 515, 2071, 19668, 29889, 1457, 19170, 1053, 6287, 30004, 13, 5215, 12655, 408, 7442, 30004, 13, 1990, 19295, 993, 4002, 1760, 29901, 30004, 13, 1678, 6756, 13, 1678, 6509, 29918, 10492, 353, 29871, 29900, 29889, 29900, 29896, 30004, 13...
netbox/tenancy/migrations/0002_tenant_ordering.py
cybarox/netbox
4,994
120343
<reponame>cybarox/netbox from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('tenancy', '0001_squashed_0012'), ] operations = [ migrations.AlterModelOptions( name='tenant', options={'ordering': ['name']}, ), ]
[ 1, 529, 276, 1112, 420, 29958, 1270, 1646, 2251, 29914, 1212, 1884, 13, 3166, 9557, 29889, 2585, 1053, 9725, 800, 13, 13, 13, 1990, 341, 16783, 29898, 26983, 800, 29889, 29924, 16783, 1125, 13, 13, 1678, 9962, 353, 518, 13, 4706, 6702...
Exercício feitos pela primeira vez/ex025.py
Claayton/pythonExerciciosLinux
1
159102
#Exercício025 name = str(input('Qual seu nome completo?: ')).strip().upper() print('Seu nome tem a palavra SILVA?: {}'.format('SILVA'in name)) print('xD')
[ 1, 396, 1252, 6269, 24394, 29900, 29906, 29945, 13, 978, 353, 851, 29898, 2080, 877, 24399, 5078, 9235, 1614, 517, 25825, 525, 8106, 17010, 2141, 21064, 580, 13, 2158, 877, 2008, 29884, 9235, 1350, 263, 5112, 485, 336, 317, 6227, 20449,...
scripts/ucnf-kiknos/pyaws/create_cluster.py
mihmatache/nsm-nse
0
62569
import argparse import json import subprocess import sys from eks import AwsCluster from shell import run_out, run_in from utils import reduce_subnets, get_current_region DEFAULT_CIDR_BLOCK = "192.168.0.0/16" def create_cluster(data): run_in("eksctl", "create", "cluster", "-f", "-", **data) def generate_clust...
[ 1, 1053, 1852, 5510, 13, 5215, 4390, 13, 5215, 1014, 5014, 13, 5215, 10876, 13, 13, 3166, 321, 2039, 1053, 319, 5652, 6821, 5402, 13, 3166, 6473, 1053, 1065, 29918, 449, 29892, 1065, 29918, 262, 13, 3166, 3667, 29879, 1053, 10032, 299...
data_structure/const_tree.py
alipay/StructuredLM_RTDT
42
10206
<reponame>alipay/StructuredLM_RTDT # coding=utf-8 # Copyright (c) 2021 <NAME> import sys LABEL_SEP = '@' INDENT_STRING1 = '│   ' INDENT_STRING2 = '├──' EMPTY_TOKEN = '___EMPTY___' def print_tree(const_tree, indent=0, out=sys.stdout): for i in range(indent - 1): out.write(INDENT_STRING1) if indent >...
[ 1, 529, 276, 1112, 420, 29958, 284, 666, 388, 29914, 19560, 2955, 26369, 29918, 13079, 12972, 13, 29937, 14137, 29922, 9420, 29899, 29947, 13, 29937, 14187, 1266, 313, 29883, 29897, 29871, 29906, 29900, 29906, 29896, 529, 5813, 29958, 13, ...
regression-tests/sparktkregtests/testcases/frames/column_method_rename_test.py
lewisc/spark-tk
34
109338
<reponame>lewisc/spark-tk # vim: set encoding=utf-8 # Copyright (c) 2016 Intel Corporation  # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # #       http://www.apache.org/licenses/LICEN...
[ 1, 529, 276, 1112, 420, 29958, 280, 29893, 10669, 29914, 12597, 29899, 11178, 13, 29937, 325, 326, 29901, 731, 8025, 29922, 9420, 29899, 29947, 13, 13, 29937, 29871, 14187, 1266, 30081, 29898, 29883, 29897, 30081, 29906, 29900, 29896, 29953...
modelutils/caffe/extract_prototxt_from_caffemodel.py
shonohs/modelutils
1
172173
<filename>modelutils/caffe/extract_prototxt_from_caffemodel.py<gh_stars>1-10 """Extract prototxt file from caffemodel file. """ import argparse import pathlib from caffe.proto import caffe_pb2 def extract_prototxt_from_caffemodel(caffemodel_filepath, output_prototxt_filepath): model = caffe_pb2.NetParameter() ...
[ 1, 529, 9507, 29958, 4299, 13239, 29914, 1113, 17615, 29914, 21111, 29918, 771, 4260, 486, 29918, 3166, 29918, 1113, 600, 331, 27224, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 15945, 29908, 5647, 14...
packages/dm_base/blueprints/base/routes.py
jdelrue/digital_me
0
79760
<filename>packages/dm_base/blueprints/base/routes.py from flask import render_template, redirect, request, url_for from jumpscale import j from blueprints.base import blueprint # from blueprints import login_manager login_manager = j.servers.web.latest.loader.login_manager # from blueprints import db # from blueprint...
[ 1, 529, 9507, 29958, 8318, 29914, 18933, 29918, 3188, 29914, 9539, 2158, 29879, 29914, 3188, 29914, 27894, 29889, 2272, 13, 3166, 29784, 1053, 4050, 29918, 6886, 29892, 6684, 29892, 2009, 29892, 3142, 29918, 1454, 13, 3166, 432, 17204, 2988...
setup.py
Knio/treecat
6
190165
from setuptools import setup import imp _version = imp.load_source("treecat._version", "treecat/_version.py") setup( name='treecat', version=_version.__version__, author='<NAME>', author_email='<EMAIL>', license='MIT', url='https://github.com/Knio/treecat', description='Displays a tree vi...
[ 1, 515, 731, 21245, 8789, 1053, 6230, 13, 13, 5215, 2411, 13, 29918, 3259, 353, 2411, 29889, 1359, 29918, 4993, 703, 2484, 687, 271, 3032, 3259, 613, 376, 2484, 687, 271, 19891, 3259, 29889, 2272, 1159, 13, 13, 14669, 29898, 13, 1678,...
setup.py
SignalOceanSdk/SignalSDK
10
55697
from setuptools import setup, find_packages from os import path import re def read_file(file_name: str) -> str: here = path.abspath(path.dirname(__file__)) with open(path.join(here, file_name), encoding="utf-8") as f: return f.read() long_description = read_file("README.md") version = re.sub("\s+", ...
[ 1, 515, 731, 21245, 8789, 1053, 6230, 29892, 1284, 29918, 8318, 13, 3166, 2897, 1053, 2224, 13, 5215, 337, 13, 13, 13, 1753, 1303, 29918, 1445, 29898, 1445, 29918, 978, 29901, 851, 29897, 1599, 851, 29901, 13, 1678, 1244, 353, 2224, 2...
src/rakali/cli/find_chessboards_stereo_live.py
sthysel/rakali
6
76264
""" Find chessboards in both frames of a stereo feed """ import logging from pathlib import Path import click import cv2 as cv import numpy as np from rakali import VideoPlayer from rakali.annotate import add_frame_labels from rakali.camera.chessboard import ChessboardFinder from rakali.stereo.reader import StereoCam...
[ 1, 9995, 13, 12542, 521, 404, 24691, 297, 1716, 16608, 310, 263, 269, 12358, 29877, 8343, 13, 15945, 29908, 13, 13, 5215, 12183, 13, 3166, 2224, 1982, 1053, 10802, 13, 13, 5215, 2828, 13, 5215, 13850, 29906, 408, 13850, 13, 5215, 1265...
libtgvoip.gyp
seven1240/libtgvoip
3
142797
<filename>libtgvoip.gyp # GYP project file for TDesktop { 'targets': [ { 'target_name': 'libtgvoip', 'type': 'static_library', 'dependencies': [], 'defines': [ 'WEBRTC_APM_DEBUG_DUMP=0', 'TGVOIP_USE_DESKTOP_DSP', 'WEBRTC_NS_FLOAT', ], ...
[ 1, 529, 9507, 29958, 1982, 29873, 29887, 1365, 666, 29889, 29887, 1478, 13, 29937, 402, 29979, 29925, 2060, 934, 363, 323, 17600, 13, 13, 29912, 13, 1678, 525, 5182, 29879, 2396, 518, 13, 418, 426, 13, 4706, 525, 5182, 29918, 978, 239...
src/lib/sd2/host_health.py
zachkont/sd2
0
76892
#!/usr/bin/env python ############################################################################# # Copyright (c) 2017 SiteWare Corp. All right reserved ############################################################################# """A small cache that keeps track of unhealthy hosts and backs off from using them""" ...
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 13, 13383, 13383, 13383, 13383, 7346, 4136, 29937, 13, 29937, 14187, 1266, 313, 29883, 29897, 29871, 29906, 29900, 29896, 29955, 10781, 29956, 598, 2994, 29886, 29889, 2178, 1492, 21676, 13, 1...
src/config/urls.py
snicoper/snicoper.com
2
162738
from django.conf import settings from django.conf.urls import include, url from django.contrib import admin from django.contrib.sitemaps.views import sitemap from django.views.static import serve from blog.sitemaps import BlogSitemap from blog.views import ArticleListView sitemaps = { 'blog': BlogSitemap } # i18...
[ 1, 515, 9557, 29889, 5527, 1053, 6055, 13, 3166, 9557, 29889, 5527, 29889, 26045, 1053, 3160, 29892, 3142, 13, 3166, 9557, 29889, 21570, 1053, 4113, 13, 3166, 9557, 29889, 21570, 29889, 29879, 667, 2547, 29889, 7406, 1053, 269, 667, 481, ...
meraki/modules/clients.py
fgbs/meraki-dashboard-api
2
95088
<gh_stars>1-10 #!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function from .base import Base from meraki.exceptions import NetworkIdMissing, ClientIdMissing, MacAddressMissing, DevicePolicyMissing class Clients(Base): def __init__(self, api_key=None, parent=None): super(Clie...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 13, 3166, 4770, 29888, 9130,...
generators/python/scripts/brain/calibrate_imu.py
EndlessLoops/blockly
1
193189
<reponame>EndlessLoops/blockly import rosnode import subprocess import time ros_nodes = rosnode.get_node_names() if not '/imu_talker' in ros_nodes: command='/home/erle/spider_ws/install_isolated/share/ros_erle_imu/imu_talker' process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE) time.slee...
[ 1, 529, 276, 1112, 420, 29958, 5044, 2222, 3410, 3554, 29914, 1271, 368, 13, 5215, 14652, 3177, 13, 5215, 1014, 5014, 13, 5215, 931, 13, 13, 1883, 29918, 18010, 353, 14652, 3177, 29889, 657, 29918, 3177, 29918, 7039, 580, 13, 361, 451...
03_fetching_data.py
FAIRdom/api-workshop
2
81267
# -*- coding: utf-8 -*- """03 Fetching data.ipynb Automatically generated by Colaboratory. Original file is located at https://colab.research.google.com/drive/1IYGWv5misDPAulnG_jfYOCtx5hxKl3Fr # Accessing and downloading Data * Finding the route to get hold of the data * Converting spreadsheets to CSV """...
[ 1, 396, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 15945, 29908, 29900, 29941, 383, 3486, 292, 848, 29889, 666, 948, 29890, 13, 13, 28451, 19574, 5759, 491, 1530, 3717, 7606, 29889, 13, 13, 26036, 934, ...
positivity/mbot_with_replacement_test.py
kilianFatras/unbisad_minibatch_sinkhorn_GAN
6
98190
<reponame>kilianFatras/unbisad_minibatch_sinkhorn_GAN #Test file for sampling with replacement import numpy as np import ot from utils import all_arr_w_replacement from mbot_proba import get_div2 import matplotlib.pyplot as plt ################################### # MAIN ################################### #%% paramet...
[ 1, 529, 276, 1112, 420, 29958, 16757, 713, 29943, 271, 3417, 29914, 348, 18809, 328, 29918, 1195, 747, 905, 29918, 29879, 682, 25031, 29918, 29954, 2190, 13, 29937, 3057, 934, 363, 23460, 411, 16920, 13, 13, 5215, 12655, 408, 7442, 13, ...
pos_multie_print/config/docs.py
ashish-greycube/pos_multie_print
0
22482
""" Configuration for docs """ # source_link = "https://github.com/[org_name]/pos_multie_print" # docs_base_url = "https://[org_name].github.io/pos_multie_print" # headline = "App that does everything" # sub_heading = "Yes, you got that right the first time, everything" def get_context(context): context.brand_html =...
[ 1, 9995, 13, 8614, 363, 10561, 13, 15945, 29908, 13, 13, 29937, 2752, 29918, 2324, 353, 376, 991, 597, 3292, 29889, 510, 29914, 29961, 990, 29918, 978, 16261, 1066, 29918, 4713, 347, 29918, 2158, 29908, 13, 29937, 10561, 29918, 3188, 29...
climbproject/climbapp/admin.py
javawolfpack/ClimbProject
0
6025
from django.contrib import admin #from .models import * from . import models # Register your models here. admin.site.register(models.ClimbModel)
[ 1, 515, 9557, 29889, 21570, 1053, 4113, 13, 13, 29937, 3166, 869, 9794, 1053, 334, 13, 3166, 869, 1053, 4733, 13, 13, 29937, 12577, 596, 4733, 1244, 29889, 13, 6406, 29889, 2746, 29889, 9573, 29898, 9794, 29889, 29907, 2576, 29890, 3195...
LTN111/cycle.py
benjaveri/rpi
0
166420
#!/usr/bin/env python import RPi.GPIO as GPIO import time # pinoutBCM scheme - http://pinout.xyz/ D = [4,17,18,27,22,23,24,25] E = 11 RW = 8 RS = 7 def wr(rs,rw,data): GPIO.output(RS,True if rs else False) GPIO.output(RW,True if rw else False) time.sleep(0.001) GPIO.output(E,True) for i in range(8): GP...
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 13, 5215, 390, 12197, 29889, 29954, 2227, 29949, 408, 402, 2227, 29949, 13, 5215, 931, 13, 13, 29937, 12534, 449, 5371, 29924, 11380, 448, 1732, 597, 12687, 449, 29889, 20230, 29914, 13, 1...
merger/jsparser3.py
Mingun/k3a-utils
0
137828
#!/usr/bin/python2.5 # ***** BEGIN LICENSE BLOCK ***** # Version: MPL 1.1/GPL 2.0/LGPL 2.1 # # The contents of this file are subject to the Mozilla Public License Version # 1.1 (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # http://w...
[ 1, 18787, 4855, 29914, 2109, 29914, 4691, 29906, 29889, 29945, 30004, 13, 30004, 13, 29937, 334, 2328, 22815, 365, 2965, 1430, 1660, 350, 21339, 334, 2328, 30004, 13, 29937, 10079, 29901, 341, 7390, 29871, 29896, 29889, 29896, 29914, 29954,...
msticpy/common/secret_settings.py
GiuseppeLaurenza/msticpy
0
153745
<gh_stars>0 # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 29937, 448, 2683, 2683, 2683, 2683, 1378, 13, 29937, 14187, 1266, 313, 29883, 29897, 7783, 15025, 29889, 2178, 10462, 21676, 29889, 13, 29937, 10413, 21144, 1090, 278, 341, 1806, 19245, 2...
predict_new.py
JiaqiWangplus77/pytorch_tiramisu
0
79248
<reponame>JiaqiWangplus77/pytorch_tiramisu #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Sep 9 15:59:06 2019 @author: <EMAIL> """ from pathlib import Path import numpy as np import matplotlib.pyplot as plt import time import datetime import torch import torch.nn as nn import torch.optim as opti...
[ 1, 529, 276, 1112, 420, 29958, 29967, 423, 26461, 29956, 574, 11242, 29955, 29955, 29914, 2272, 7345, 305, 29918, 29873, 381, 314, 28311, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 29941, 13, 29937, 448, 29930, 29899, 14137, ...
app/core/security.py
attachemd/backend_v03
0
180319
<filename>app/core/security.py from datetime import timedelta, datetime from typing import Optional, Union, Any from passlib.context import CryptContext from jose import jwt from app.core.config import settings pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto") def get_password_hash(password: str) -...
[ 1, 529, 9507, 29958, 932, 29914, 3221, 29914, 8926, 29889, 2272, 13, 3166, 12865, 1053, 5335, 287, 2554, 29892, 12865, 13, 3166, 19229, 1053, 28379, 29892, 7761, 29892, 3139, 13, 13, 3166, 1209, 1982, 29889, 4703, 1053, 315, 4641, 2677, ...
proper_forms/fields/email.py
jpsca/pforms
2
39416
from .text import Text from ..ftypes import type_email __all__ = ("Email", ) class Email(Text): """Validates and normalize an email address using the JoshData/python-email-validator library. Even if the format is valid, it cannot guarantee that the email is real, so the purpose of this function is ...
[ 1, 515, 869, 726, 1053, 3992, 13, 3166, 6317, 615, 7384, 1053, 1134, 29918, 5269, 13, 13, 13, 1649, 497, 1649, 353, 4852, 9823, 613, 1723, 13, 13, 13, 1990, 22608, 29898, 1626, 1125, 13, 1678, 9995, 7211, 1078, 322, 4226, 675, 385, ...
uncluster/potential/potential_config.py
adrn/uncluster
0
186980
# vvv --- THIS IS AUTO-GENERATED CODE - see scripts/setup-potential.py --- vvv import astropy.units as u m_h = 5.4596489e+11 * u.Msun r_s = 15.7799796 * u.kpc m_n = 1.7005340e+09 * u.Msun c_n = 65.6443448 * u.pc # ^^^ --- THIS IS AUTO-GENERATED CODE - see scripts/setup-potential.py --- ^^^
[ 1, 396, 325, 29894, 29894, 11474, 3446, 3235, 8519, 26524, 29949, 29899, 24647, 1001, 3040, 29928, 4810, 2287, 448, 1074, 12078, 29914, 14669, 29899, 17765, 2556, 29889, 2272, 11474, 325, 29894, 29894, 13, 5215, 8717, 14441, 29889, 348, 116...
scripts/utils/__init__.py
JimCircadian/inconsistentrecords
0
88871
import configparser import logging import os from github import Github def github_conn(filename="$HOME/.github_api"): config = configparser.ConfigParser() config.read(os.path.expandvars(filename)) token = config['api']['token'] return Github(token)
[ 1, 1053, 2295, 16680, 13, 5215, 12183, 13, 5215, 2897, 13, 13, 3166, 18546, 1053, 402, 2985, 13, 13, 13, 1753, 18546, 29918, 13082, 29898, 9507, 18965, 17353, 6294, 3292, 29918, 2754, 29908, 1125, 13, 1678, 2295, 353, 2295, 16680, 29889...
exploit/socialbrute/__mainig__.py
5l1v3r1/saydog-framework
2
127078
<filename>exploit/socialbrute/__mainig__.py # coding=utf-8 # !/usr/bin/python from __future__ import print_function from instabrute import * import argparse import logging import random import socket import sys import threading r="\x1b[91m" w="\x1b[00m" c ="\x1b[36;1m" y="\x1b[33m" try: import urllib.request as ...
[ 1, 529, 9507, 29958, 4548, 417, 277, 29914, 24911, 1182, 1082, 29914, 1649, 3396, 335, 26914, 2272, 13, 29937, 14137, 29922, 9420, 29899, 29947, 13, 29937, 1738, 29914, 4855, 29914, 2109, 29914, 4691, 13, 13, 3166, 4770, 29888, 9130, 1649...
textformer/utils/__init__.py
gugarosa/textformer
3
1602150
"""Utilities package for all common textformer modules. """
[ 1, 9995, 7270, 1907, 3577, 363, 599, 3619, 1426, 24784, 10585, 29889, 13, 15945, 29908, 13, 2 ]
simulation/src/claptrap_simu/__init__.py
Siviuze/CL4P-TP
0
59459
__import__('eigenpy').switchToNumpyArray()
[ 1, 4770, 5215, 1649, 877, 29872, 2101, 2272, 2824, 15123, 1762, 8009, 2272, 2588, 580, 29871, 13, 2 ]
gaphor/storage/tests/test_verify.py
seryafarma/gaphor
0
69348
<reponame>seryafarma/gaphor from gaphor import UML from gaphor.core.eventmanager import EventManager from gaphor.core.modeling import ElementFactory from gaphor.storage.verify import orphan_references def test_verifier(): factory = ElementFactory(EventManager()) c = factory.create(UML.Class) p = factory.c...
[ 1, 529, 276, 1112, 420, 29958, 643, 29891, 2142, 22824, 29914, 29887, 481, 2015, 13, 3166, 17261, 2015, 1053, 501, 1988, 13, 3166, 17261, 2015, 29889, 3221, 29889, 3696, 12847, 1053, 6864, 3260, 13, 3166, 17261, 2015, 29889, 3221, 29889, ...
api/migrations/0076_auto_20200728_1500.py
IFRCGo/ifrcgo-api
11
39003
# Generated by Django 2.2.13 on 2020-07-28 15:00 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('api', '0075_profile_last_frontend_login'), ] operations = [ migrations.RemoveField( model_name='fieldreport', name='cases',...
[ 1, 396, 3251, 630, 491, 15337, 29871, 29906, 29889, 29906, 29889, 29896, 29941, 373, 29871, 29906, 29900, 29906, 29900, 29899, 29900, 29955, 29899, 29906, 29947, 29871, 29896, 29945, 29901, 29900, 29900, 13, 13, 3166, 9557, 29889, 2585, 1053,...
geoviews/data/geopandas.py
jonmmease/geoviews
0
80082
<reponame>jonmmease/geoviews<filename>geoviews/data/geopandas.py from __future__ import absolute_import import sys import warnings from collections import defaultdict import numpy as np from holoviews.core.util import isscalar, unique_iterator, unique_array, pd from holoviews.core.data import Dataset, Interface, Mu...
[ 1, 529, 276, 1112, 420, 29958, 13022, 29885, 1004, 559, 29914, 479, 586, 646, 29879, 29966, 9507, 29958, 479, 586, 646, 29879, 29914, 1272, 29914, 479, 459, 7086, 29889, 2272, 13, 3166, 4770, 29888, 9130, 1649, 1053, 8380, 29918, 5215, ...
experiments.py
hmjansen/overflow-algorithm
0
127004
"""Code used to create the examples in the overflow paper. This module contains the code used to create the examples in the paper at https://arxiv.org/pdf/2001.09611v1, referred to as the overflow paper. Execute this module as a script to reproduce the examples. The code has been tested using Python 3.5.2, NumPy ...
[ 1, 9995, 3399, 1304, 304, 1653, 278, 6455, 297, 278, 11969, 5650, 22993, 13, 30004, 13, 4013, 3883, 3743, 278, 775, 1304, 304, 1653, 278, 6455, 297, 278, 5650, 472, 30004, 13, 991, 597, 279, 26560, 29889, 990, 29914, 5140, 29914, 2990...
test.py
wangjm12138/Yolov3_wang
0
1901
import random class Yolov3(object): def __init__(self): self.num=0 self.input_size=[8,16,32] def __iter__(self): return self def __next__(self): a = random.choice(self.input_size) self.num=self.num+1 if self.num<3: return a else: raise StopIteration yolo=Yolov3() for data in yolo: print(data)
[ 1, 1053, 4036, 13, 1990, 612, 324, 586, 29941, 29898, 3318, 1125, 13, 13, 12, 1753, 4770, 2344, 12035, 1311, 1125, 13, 12, 12, 1311, 29889, 1949, 29922, 29900, 13, 12, 12, 1311, 29889, 2080, 29918, 2311, 11759, 29947, 29892, 29896, 29...
env.clearblockd/lib/python2.7/site-packages/geventhttpclient/response.py
Organizational-Proof-Of-Work/clearinghoused_build
0
77826
<gh_stars>0 import errno from geventhttpclient._parser import HTTPResponseParser, HTTPParseError #@UnresolvedImport from geventhttpclient.header import Headers import gevent.socket HEADER_STATE_INIT = 0 HEADER_STATE_FIELD = 1 HEADER_STATE_VALUE = 2 HEADER_STATE_DONE = 3 class HTTPConnectionClosed(HTTPParseError): ...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 4589, 1217, 13, 3166, 1737, 794, 1124, 4645, 3032, 16680, 1053, 7331, 5103, 11726, 29892, 7331, 12914, 2392, 396, 29992, 2525, 9778, 1490, 17518, 13, 3166, 1737, 794, 1124, 4645, ...
recipesAPI/recipes/migrations/0011_auto_20220116_2017.py
rainsha/polsl_mgr_obierki
0
188010
<filename>recipesAPI/recipes/migrations/0011_auto_20220116_2017.py # Generated by Django 3.0.14 on 2022-01-16 19:17 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('recipes', '0010_delete_message'), ] operations = [ migrations.AlterField...
[ 1, 529, 9507, 29958, 4361, 5547, 8787, 29914, 4361, 5547, 29914, 26983, 800, 29914, 29900, 29900, 29896, 29896, 29918, 6921, 29918, 29906, 29900, 29906, 29906, 29900, 29896, 29896, 29953, 29918, 29906, 29900, 29896, 29955, 29889, 2272, 13, 29...
apetools/commons/expressions.py
rsnakamura/oldape
0
67347
# python standard library import string NAMED = r"(?P<{name}>{pattern})" GROUP = r"({group})" CLASS = "[{0}]" OR = "|" NOT = "^" SPACE = r'\s' NOT_SPACE = r'\S' DIGIT = r"\d" ANYTHING = '.' WORD_ENDING = r'\b' LINE_ENDING = r"$" LINE_START = "^" M_TO_N_TIMES = "{{{m},{n}}}" ONE_TO_3 = M_TO_N_TIMES.format(m=1, n=...
[ 1, 29871, 13, 29937, 3017, 3918, 3489, 13, 5215, 1347, 13, 13, 13, 5813, 29928, 353, 364, 29908, 10780, 29925, 29966, 29912, 978, 17428, 29912, 11037, 1800, 29908, 13, 26284, 353, 364, 29908, 3319, 2972, 1800, 29908, 13, 13875, 1799, 35...
iis-3rdparty-madis/src/main/resources/eu/dnetlib/iis/3rdparty/scripts/madis/functions/vtable/queryplan.py
mpol/iis
20
52686
""" .. function:: queryplan(query) -> Query plan Returns the query plan of the input query. Examples:: >>> sql("queryplan select 5") operation | paramone | paramtwo | databasename | triggerorview ------------------------------------------------------------------ SQLITE_SELECT | None | None ...
[ 1, 9995, 13, 636, 740, 1057, 2346, 9018, 29898, 1972, 29897, 1599, 13641, 3814, 13, 13, 11609, 29879, 278, 2346, 3814, 310, 278, 1881, 2346, 29889, 13, 13, 1252, 9422, 1057, 13, 13, 1678, 8653, 4576, 703, 1972, 9018, 1831, 29871, 2994...
problems/min-stack.py
sailikhithk/tech-interview-prep
0
135881
#https://leetcode.com/problems/min-stack/ class MinStack(object): def __init__(self): self.stack = [] def push(self, x): self.stack.append((x, min(x, self.getMin()))) def pop(self): if len(self.stack)==0: return None return self.stack.pop()[0] ...
[ 1, 396, 991, 597, 280, 300, 401, 29889, 510, 29914, 17199, 29879, 29914, 1195, 29899, 1429, 29914, 13, 1990, 3080, 7264, 29898, 3318, 1125, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 1583, 29889, 1429, 353, 5159, 13, ...
tcex/tcex_redis.py
jcampbell2017tc/tcex
0
75735
# -*- coding: utf-8 -*- """TcEx Framework Redis Module""" from builtins import str import redis class TcExRedis(object): """Create/Read Data in/from Redis""" def __init__(self, host, port, rhash): """Initialize the Class properties. Args: host (string): The Redis host. ...
[ 1, 396, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 15945, 29908, 29911, 29883, 1252, 16657, 4367, 275, 15591, 15945, 29908, 13, 3166, 4240, 1144, 1053, 851, 13, 13, 5215, 29825, 13, 13, 13, 1990, 323, 2...
src/mlregression/mlreg.py
muhlbach/ml-regression
1
48971
<gh_stars>1-10 #------------------------------------------------------------------------------ # Libraries #------------------------------------------------------------------------------ # Standard import numpy as np # User from .base.base_mlreg import BaseMLRegressor #------------------------------------------------...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 29937, 2683, 2683, 2683, 2683, 9072, 489, 13, 29937, 365, 4626, 4314, 13, 29937, 2683, 2683, 2683, 2683, 9072, 489, 13, 29937, 10117, 13, 5215, 12655, 408, 7442, 13...
python/rss18_dtrp.py
petvana/gdip
9
168222
#!/usr/bin/env python3 import sys, os, re, math, copy import numpy as np import matplotlib.pyplot as plt from matplotlib.patches import Circle, PathPatch # import the Python wrapper from dubinswrapper import DubinsWrapper as dubins ################################################ # Scenarios ########################...
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 29941, 13, 13, 5215, 10876, 29892, 2897, 29892, 337, 29892, 5844, 29892, 3509, 13, 5215, 12655, 408, 7442, 13, 5215, 22889, 29889, 2272, 5317, 408, 14770, 13, 3166, 22889, 29889, 5041, 267, ...
app/controllers/user_controller.py
ryannewman2828/Hack-the-North-2018-Backend-Challenge
0
62517
<filename>app/controllers/user_controller.py from app.models.users import User from app.models.skills import Skill from flask import request from flask_restful import Resource from app.models.database import db_session string_args = ["name", "picture", "company", "email", "phone", "country"] float_args = ["latitude", ...
[ 1, 529, 9507, 29958, 932, 29914, 1285, 11897, 29914, 1792, 29918, 8299, 29889, 2272, 13, 3166, 623, 29889, 9794, 29889, 7193, 1053, 4911, 13, 3166, 623, 29889, 9794, 29889, 808, 6090, 1053, 4971, 453, 13, 3166, 29784, 1053, 2009, 13, 31...
Topic_2_statements/simpleSubtraction.py
Izardo/myWork
0
153840
# This program subtracts one number from another # Author: <NAME> first = int(input("Enter the first number:")) # requests input of integer from user second = int(input("Enter the second number:")) # requests input of integer from user # prints sum below print(first - second)
[ 1, 396, 910, 1824, 23197, 29879, 697, 1353, 515, 1790, 13, 29937, 13361, 29901, 529, 5813, 29958, 13, 13, 4102, 353, 938, 29898, 2080, 703, 10399, 278, 937, 1353, 29901, 5783, 259, 396, 7274, 1881, 310, 6043, 515, 1404, 13, 7496, 353,...
frm_dataset_creator2.py
uclacores/dual_path_network
4
168739
#from frm_generate_data_np import * import numpy as np from numpy import pi,sqrt model_folder="models/freq_2019_07_02_2/" from frm_modulations import mod_list,cont_phase_mod_list,linear_mod_const # import tensorflow as tf import datetime import pickle import sys import copy from frm_dataset_creator import * from num...
[ 1, 396, 3166, 1424, 29885, 29918, 17158, 29918, 1272, 29918, 9302, 1053, 334, 13, 5215, 12655, 408, 7442, 13, 3166, 12655, 1053, 2930, 29892, 3676, 13, 13, 4299, 29918, 12083, 543, 9794, 29914, 29888, 7971, 29918, 29906, 29900, 29896, 299...
paho/mqtt/subscribe.py
RandomGamer342/TTM4115-plantsensor
8
6172
<gh_stars>1-10 # Copyright (c) 2016 <NAME> <<EMAIL>> # # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # and Eclipse Distribution License v1.0 which accompany this distribution. # # The Eclipse Public License is available at # ...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 29937, 14187, 1266, 313, 29883, 29897, 29871, 29906, 29900, 29896, 29953, 529, 5813, 29958, 3532, 26862, 6227, 6778, 13, 29937, 13, 29937, 2178, 10462, 21676, 29889, 91...
registry/sql/models/module.py
rmb938/tf-registry
3
103248
import uuid from sqlalchemy import Column, String, func, Index, ForeignKey from sqlalchemy_utils import ArrowType, UUIDType from registry.sql.database import Base class Module(Base): __tablename__ = 'modules' id = Column(UUIDType, primary_key=True, default=uuid.uuid4) organization_id = Column(UUIDType,...
[ 1, 1053, 318, 5416, 13, 13, 3166, 4576, 284, 305, 6764, 1053, 12481, 29892, 1714, 29892, 3653, 29892, 11374, 29892, 19358, 2558, 13, 3166, 4576, 284, 305, 6764, 29918, 13239, 1053, 826, 798, 1542, 29892, 501, 11150, 1542, 13, 13, 3166, ...
tests/integration/records/datetime_cases.py
cwegrzyn/records-mover
36
155485
SAMPLE_YEAR = 1983 SAMPLE_YEAR_SHORT = 83 SAMPLE_MONTH = 1 SAMPLE_DAY = 2 SAMPLE_HOUR = 15 SAMPLE_UTC_HOUR = 20 SAMPLE_HOUR_12H = 3 SAMPLE_MINUTE = 4 SAMPLE_SECOND = 5 SAMPLE_PERIOD = 'PM' SAMPLE_OFFSET = '-00' SAMPLE_LONG_TZ = 'UTC' def create_sample(template: str) -> str: return ( template .repl...
[ 1, 16698, 3580, 1307, 29918, 29979, 26441, 353, 29871, 29896, 29929, 29947, 29941, 13, 8132, 3580, 1307, 29918, 29979, 26441, 29918, 7068, 8476, 353, 29871, 29947, 29941, 13, 8132, 3580, 1307, 29918, 22877, 4690, 353, 29871, 29896, 13, 8132...
function/function_sg_event.py
lihtiandxc/notification4sgchanges
0
69617
from datetime import datetime import boto3 import json import os sns_client = boto3.client('sns') ###-------Global Var can be defined in Lambda global var and import with os.environ() method #str_asg_name = 'limliht-asg,limliht2-asg' #simulate global var in lambda #global_asg_name = str_asg_name.split(',') #accountp...
[ 1, 515, 12865, 1053, 12865, 13, 5215, 289, 3747, 29941, 13, 5215, 4390, 13, 5215, 2897, 13, 13, 29879, 1983, 29918, 4645, 353, 289, 3747, 29941, 29889, 4645, 877, 29879, 1983, 1495, 13, 13, 2277, 29937, 26589, 12756, 11681, 508, 367, ...
tests/test_datatypes.py
MZH-bust/genutil
0
81444
import pytest from genutil import datatypes class TestIsListOfStrings: @pytest.mark.parametrize( "test_parameter,expected", [ pytest.param(["this", "is", "a", "list", "of", "strings"], True, id="Param1 - List of Strings"), pytest.param("no list, but string", False, id="Para...
[ 1, 1053, 11451, 1688, 13, 3166, 2531, 4422, 1053, 1418, 271, 7384, 13, 13, 13, 1990, 4321, 3624, 1293, 2776, 26545, 29901, 13, 1678, 732, 2272, 1688, 29889, 3502, 29889, 3207, 300, 374, 911, 29898, 13, 4706, 376, 1688, 29918, 15501, 2...
dice.py
kamalkum9r/python
1
1616221
# importing required library # no need to worry about installing it its preinstalled with your python language import random # here i am defining a function to roll a dice so that you can import it in other projects also # huh, thanks me later for that ?? dice = random.randint(1,6) def roll_a_die(): r...
[ 1, 396, 28348, 3734, 3489, 30004, 13, 29937, 694, 817, 304, 15982, 1048, 15476, 372, 967, 758, 25537, 411, 596, 3017, 4086, 6756, 13, 30004, 13, 5215, 4036, 30004, 13, 30004, 13, 29937, 1244, 474, 626, 16184, 263, 740, 304, 9679, 263,...
modeladminutils/models.py
kinaklub/next.filmfest.by
7
173682
from django.db import models from modeladminutils.queryset import SearchableQuerySet __all__ = ['SearchableManager'] class BaseSearchableManager(models.Manager): def get_queryset(self): return SearchableQuerySet(self.model) SearchableManager = BaseSearchableManager.from_queryset(SearchableQuerySet)
[ 1, 515, 9557, 29889, 2585, 1053, 4733, 13, 13, 3166, 1904, 6406, 13239, 29889, 1972, 842, 1053, 11856, 519, 3010, 2697, 13, 13, 13, 1649, 497, 1649, 353, 6024, 7974, 519, 3260, 2033, 13, 13, 13, 1990, 7399, 7974, 519, 3260, 29898, 9...
sort/sort.py
storyoftime66/AlgorithmSheet
0
74811
#!/usr/bin/env python3 # -*- coding: utf-8 -*- def insert_sort(inputlist): """ 直接插入排序,升序 :param inputlist: a list of number :return: the ascending list """ length = len(inputlist) for x in range(1, length): key = inputlist[x] # 要插入的数 i = x - 1 while i >= 0: ...
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 29941, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 13, 13, 1753, 4635, 29918, 6605, 29898, 2080, 1761, 1125, 13, 1678, 9995, 13, 268, 31157, 31092...
app_common/traitsui/tests/test_unit_scalar_editor.py
KBIbiopharma/app_common
2
195734
from unittest import TestCase, skipIf import os from traits.api import HasTraits, Instance from traitsui.api import Item, View try: from scimath.units.api import UnitScalar from scimath.units.dimensionless import dimensionless from app_common.traitsui.unit_scalar_editor import \ UnitScalarEditor, st...
[ 1, 515, 443, 27958, 1053, 4321, 8259, 29892, 14383, 3644, 13, 5215, 2897, 13, 3166, 1020, 1169, 29889, 2754, 1053, 11699, 5323, 1169, 29892, 2799, 749, 13, 3166, 1020, 1169, 1481, 29889, 2754, 1053, 10976, 29892, 4533, 13, 2202, 29901, ...
concon.py
nejucomo/concon
0
31891
<reponame>nejucomo/concon<filename>concon.py<gh_stars>0 """ concon (CONstrained CONtainers) provides usefully constrained container subtypes as well as utilities for defining new constrained subtypes and append-only dict modification. There are two flavors of constraints: frozen and appendonly. The former prevents an...
[ 1, 529, 276, 1112, 420, 29958, 484, 4900, 23700, 29914, 535, 535, 29966, 9507, 29958, 535, 535, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 15945, 29908, 13, 535, 535, 313, 6007, 4151, 1312, 8707, 2408, 414, 29897, 81...
src/verify.py
RaISy-Net/Intelligent_picking
1
48510
<gh_stars>1-10 import glob import os import matplotlib.pyplot as plt from src.utils.dataset_processing import grasp, image from src.utils.data.grasp_data import GraspDatasetBase def save_img(rgb_img,gtbbs,name): fig = plt.figure(figsize=(10, 10)) plt.ion() plt.clf() ax = plt.subplot(111) ax.imshow(rgb_img) g=g...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 5215, 13149, 13, 5215, 2897, 13, 5215, 22889, 29889, 2272, 5317, 408, 14770, 13, 13, 3166, 4765, 29889, 13239, 29889, 24713, 29918, 19170, 1053, 25274, 29892, 1967, 1...
filter/mot.py
oza6ut0ne/CVStreamer
0
21748
<filename>filter/mot.py import time import cv2 import numpy as np class Filter(object): '''detects motions with cv2.BackgroundSubtractorMOG2''' def __init__(self, params): self.params = params try: varThreshold = float(params[0]) if varThreshold <= 0: v...
[ 1, 529, 9507, 29958, 4572, 29914, 14817, 29889, 2272, 13, 5215, 931, 13, 13, 5215, 13850, 29906, 13, 5215, 12655, 408, 7442, 13, 13, 1990, 19916, 29898, 3318, 1125, 13, 1678, 14550, 4801, 522, 29879, 3184, 1080, 411, 13850, 29906, 29889...
enumb/__init__.py
tombulled/enumb
0
97833
from .bases import * from .enums import * from .generators import * from .meta import * from .models import * from .types import *
[ 1, 515, 869, 29890, 2129, 418, 1053, 334, 13, 3166, 869, 264, 6762, 418, 1053, 334, 13, 3166, 869, 4738, 4097, 1053, 334, 13, 3166, 869, 7299, 539, 1053, 334, 13, 3166, 869, 9794, 268, 1053, 334, 13, 3166, 869, 8768, 418, 1053, 33...
IVTa/2014/BRONNIKOV_I_S/task_6_50.py
YukkaSarasti/pythonintask
0
1608079
<gh_stars>0 # Задача 6. Вариант 50 # Создайте игру, в которой компьютер загадывает нназвание одной из пятнадцати республик, # входящих в состав СССР, а игрок должен его угадать. # <NAME>. # 25.05.2016 import random USSR = ["РСФСР", "Украинская ССР", "Белорусская ССР" "Узбекская ССР" "Казахская ССР" "Грузинска...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 29937, 3982, 840, 1282, 29871, 29953, 29889, 6581, 641, 745, 29932, 29871, 29945, 29900, 30004, 13, 29937, 5579, 8728, 29977, 730, 10689, 1086, 29892, 490, 20935, 16042, 9860, 5460, 1077, ...
app/grammar.py
bda-19fs/bda-chatbot
1
191596
<reponame>bda-19fs/bda-chatbot #!/usr/bin/env python3 import click import time as watch from bda_core.use_cases.log.log_info import log_info from bda_core.use_cases.nlp.correct_grammar import correct_grammar_stream @click.command() @click.option( '-g', '--grammar', type=click.STRING, default='res/custom_ch_gramma...
[ 1, 529, 276, 1112, 420, 29958, 29890, 1388, 29899, 29896, 29929, 5847, 29914, 29890, 1388, 29899, 13496, 7451, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 29941, 13, 5215, 2828, 13, 5215, 931, 408, 6505, 13, 3166, 289, 1388, ...
src/robotide/lib/robot/writer/rowsplitter.py
veryl-technologies/t24-tests-ide
8
145319
<gh_stars>1-10 # Copyright 2008-2012 Nokia Siemens Networks Oyj # # 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...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 29937, 29871, 14187, 1266, 29871, 29906, 29900, 29900, 29947, 29899, 29906, 29900, 29896, 29906, 405, 554, 423, 317, 3768, 575, 8527, 29879, 438, 17472, 13, 29937, 13, ...
parlaskupine/models.py
VesterDe/parlalize
1
185906
# -*- coding: utf-8 -*- from django.db import models from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ from parlaposlanci.models import * from parlaseje.models import * from jsonfield import JSONField from behaviors.models import Timestampable # conve...
[ 1, 396, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 3166, 9557, 29889, 2585, 1053, 4733, 13, 3166, 9557, 29889, 13239, 29889, 22331, 1053, 3017, 29918, 29906, 29918, 2523, 356, 29918, 23712, 13, 3166, 9557, ...
tests/test_config_parser.py
KevinMFong/pyhocon
424
3457
# -*- encoding: utf-8 -*- import json import os import shutil import tempfile from collections import OrderedDict from datetime import timedelta from pyparsing import ParseBaseException, ParseException, ParseSyntaxException import mock import pytest from pyhocon import (ConfigFactory, ConfigParser, ConfigSubstitution...
[ 1, 396, 448, 29930, 29899, 8025, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 13, 5215, 4390, 13, 5215, 2897, 13, 5215, 528, 4422, 13, 5215, 5694, 1445, 13, 3166, 16250, 1053, 8170, 287, 21533, 13, 3166, 12865, 1053, 5335, 287, ...
pushhubsearch/views.py
ucla/PushHubSearch
0
125395
<reponame>ucla/PushHubSearch """ Copyright (c) 2013, Regents of the University of California All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copy...
[ 1, 529, 276, 1112, 420, 29958, 1682, 433, 29914, 27031, 16046, 7974, 13, 15945, 29908, 13, 11882, 1266, 313, 29883, 29897, 29871, 29906, 29900, 29896, 29941, 29892, 2169, 1237, 310, 278, 3014, 310, 8046, 13, 3596, 10462, 21676, 29889, 13,...
setup.py
gokhanbaydar/py-money-legos
3
56904
import setuptools import os def get_files_in_dir(dirName): listOfFile = os.listdir(dirName) completeFileList = list() for file in listOfFile: completePath = os.path.join(dirName, file) if os.path.isdir(completePath): completeFileList = completeFileList + get_files_in_dir(comple...
[ 1, 1053, 731, 21245, 8789, 13, 5215, 2897, 13, 13, 13, 1753, 679, 29918, 5325, 29918, 262, 29918, 3972, 29898, 3972, 1170, 1125, 13, 1678, 1051, 2776, 2283, 353, 2897, 29889, 1761, 3972, 29898, 3972, 1170, 29897, 13, 1678, 4866, 2283, ...
methods/autoplot.py
cndaqiang/raman_spectrum_analysis
8
192585
from ramanspectrum import * import sys """ Run python 'autoplot.py labels.txt'. Creates simple plots of the spectra. """ label = sys.argv[1] with open('labels.txt', 'r') as file: labels = file.readlines() for i in range(len(labels)): labels[i] = labels[i].rstrip() for label in labels: label = label.split(r'\n')[0...
[ 1, 515, 13472, 550, 1103, 5848, 1053, 334, 13, 5215, 10876, 13, 13, 15945, 29908, 13, 6558, 3017, 525, 1300, 459, 8276, 29889, 2272, 11073, 29889, 3945, 4286, 6760, 1078, 2560, 24580, 310, 278, 6683, 336, 29889, 13, 15945, 29908, 13, ...
2019/python/day10.py
dsvensson/advent-of-code
0
163698
<filename>2019/python/day10.py from collections import defaultdict t = """ .#..# ..... ##### ....# ...## """.strip() t = open("../data/day10.input").read() t = t.split("\n") astroids = [] for y, row in enumerate(t): for x, col in enumerate(row): if col == "#": astroids.append((y,x)) def line...
[ 1, 529, 9507, 29958, 29906, 29900, 29896, 29929, 29914, 4691, 29914, 3250, 29896, 29900, 29889, 2272, 13, 3166, 16250, 1053, 2322, 8977, 13, 29873, 353, 9995, 13, 29889, 29937, 636, 29937, 13, 18598, 13, 4136, 29937, 13, 3045, 29937, 13, ...
pat/pat.py
javascripto/syxactions
0
176962
<reponame>javascripto/syxactions from discord.ext import commands from discord.ext.commands import errors, converter from .utils.dataIO import fileIO import random import discord class Pat: def __init__(self, bot): self.bot = bot @commands.command(pass_context=True) async def pat(self, context, me...
[ 1, 529, 276, 1112, 420, 29958, 7729, 29877, 29914, 29879, 29891, 29916, 7387, 13, 3166, 2313, 536, 29889, 1062, 1053, 8260, 13, 3166, 2313, 536, 29889, 1062, 29889, 26381, 1053, 4436, 29892, 29105, 13, 3166, 869, 13239, 29889, 1272, 5971,...
corehq/motech/tests/test_repeater_helpers.py
andyasne/commcare-hq
471
70296
<gh_stars>100-1000 from django.test.testcases import TestCase from mock import patch from corehq.form_processor.models import CommCareCaseSQL from datetime import datetime from corehq.form_processor.interfaces.dbaccessors import CaseAccessors from corehq.motech.repeater_helpers import get_relevant_case_updates_from_for...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29900, 29900, 29899, 29896, 29900, 29900, 29900, 13, 3166, 9557, 29889, 1688, 29889, 1688, 11436, 1053, 4321, 8259, 13, 3166, 11187, 1053, 13261, 13, 3166, 7136, 29882, 29939, 29889, 689, 29918...
app/morocco/authentication.py
troydai/Morocco
0
27022
import flask_login from .application import app from .models import DbUser login_manager = flask_login.LoginManager() # pylint: disable=invalid-name login_manager.init_app(app) login_manager.user_loader(lambda user_id: DbUser.query.filter_by(id=user_id).first()) login_required = flask_login.login_required @login_ma...
[ 1, 1053, 29784, 29918, 7507, 13, 3166, 869, 6214, 1053, 623, 13, 3166, 869, 9794, 1053, 24331, 2659, 13, 13, 7507, 29918, 12847, 353, 29784, 29918, 7507, 29889, 11049, 3260, 580, 29871, 396, 282, 2904, 524, 29901, 11262, 29922, 20965, 2...
benchmark/citation/trainable/cold_start_recall100/negative_sampling.py
snubeaver/pytorch_geo
2
69846
import random import torch import numpy as np from torch_geometric.utils import degree, to_undirected def negative_sampling(edge_index, num_nodes=None, num_neg_samples=None, force_undirected=False): num_neg_samples = num_neg_samples or edge_index.size(1) # Handle '|V|^2 - |E| < |E|' ...
[ 1, 1053, 4036, 13, 13, 5215, 4842, 305, 13, 5215, 12655, 408, 7442, 13, 3166, 4842, 305, 29918, 479, 14066, 29889, 13239, 1053, 7426, 29892, 304, 29918, 870, 1088, 287, 13, 13, 13, 13, 1753, 8178, 29918, 13445, 10335, 29898, 12864, 29...
openstack/regression/lib/cinder.py
rpratap-bot/ceph-qe-scripts
0
105320
import os import cinderclient.exceptions as c_exceptions from cinderclient.v2 import client as c_client import log class CinderReturnStack(object): def __init__(self): pass class CinderAuth(object): def __init__(self): self.os_username = os.environ['OS_USERNAME'] self.os_api_key = o...
[ 1, 1053, 2897, 13, 5215, 274, 4995, 4645, 29889, 11739, 29879, 408, 274, 29918, 11739, 29879, 13, 3166, 274, 4995, 4645, 29889, 29894, 29906, 1053, 3132, 408, 274, 29918, 4645, 13, 5215, 1480, 13, 13, 13, 1990, 315, 4995, 11609, 7264, ...
TEP/lista1/E.py
GuilhermeBraz/unb-workflow
0
150937
# Diamond Miner is a game that is similar to Gold Miner, but there are nnn miners instead of 111 in this game. # The mining area can be described as a plane. The nnn miners can be regarded as nnn points on the y-axis. There are nnn diamond mines in the mining area. We can regard them as nnn points on the x-axis. For so...
[ 1, 396, 22904, 898, 3080, 261, 338, 263, 3748, 393, 338, 2788, 304, 6650, 3080, 261, 29892, 541, 727, 526, 302, 15755, 1375, 414, 2012, 310, 29871, 29896, 29896, 29896, 297, 445, 3748, 29889, 13, 29937, 450, 1375, 292, 4038, 508, 367,...
cryptography_playground.py
GabrielAlves/CryptographyPlayground
0
53656
<reponame>GabrielAlves/CryptographyPlayground<gh_stars>0 import tkinter as tk from tkinter import ttk from tkinter import scrolledtext from tkinter import messagebox as msg from tkinter import Menu from i18n.i18n_cryptography_playground import I18NCryptographyPlayground from i18n.i18n_message_box import I18NMessageBox...
[ 1, 529, 276, 1112, 420, 29958, 29954, 370, 12836, 2499, 1960, 29914, 29907, 4641, 5275, 13454, 2057, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 18883, 1639, 408, 18883, 13, 3166, 18883, 1639, 1053, 260, 11178, 13, 3166, 18883...
resp/vdw_surface.py
alenaizan/resp
10
142533
from __future__ import division, absolute_import, print_function import numpy as np """ A sript to generate van der Waals surface of molecules. """ # Van der Waals radii (in angstrom) are taken from GAMESS. vdw_r = {'H': 1.20, 'HE': 1.20, 'LI': 1.37, 'BE': 1.45, 'B': 1.45, 'C': 1.50, 'N': 1.50, 'O...
[ 1, 515, 4770, 29888, 9130, 1649, 1053, 8542, 29892, 8380, 29918, 5215, 29892, 1596, 29918, 2220, 13, 13, 5215, 12655, 408, 7442, 13, 13, 13, 15945, 29908, 13, 29909, 269, 374, 415, 304, 5706, 1109, 589, 22552, 1338, 7101, 310, 13206, ...
exercicios-python/ex035.py
anavesilva/python-introduction
0
199992
# Analisando Triângulo v1.0 #a soma de dois lados é sempre menor que o terceiro lado. print('-=-' * 10) print('Analisador de triangulos') print('-=-' * 10) r1 = float(input('Primeiro segmento: ')) r2 = float(input('Segundo segmento: ')) r3 = float(input('Terceiro segmento: ')) soma12 = r1 + r2 soma13 = r1 + r3 soma23 =...
[ 1, 396, 530, 5711, 1743, 8602, 30057, 865, 7207, 325, 29896, 29889, 29900, 13, 29937, 29874, 1047, 29874, 316, 19760, 301, 2255, 904, 14472, 26764, 712, 288, 1935, 346, 3350, 19931, 29889, 13, 2158, 877, 29899, 10457, 29915, 334, 29871, ...
create_input_files.py
FangxiangFeng/a-PyTorch-Tutorial-to-Image-Captioning
0
165254
from utils import create_input_files if __name__ == '__main__': # Create input files (along with word map) create_input_files(dataset='aicc', karpathy_json_path='/workspace/data/aicc_caption/dataset_aicc.json', image_folder='/workspace/data/aicc_caption/images', ...
[ 1, 515, 3667, 29879, 1053, 1653, 29918, 2080, 29918, 5325, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 396, 6204, 1881, 2066, 313, 284, 549, 411, 1734, 2910, 29897, 13, 1678, 1653, 29918, 2080, 29918, 53...
summers_api/settings.py
summerthe/summers_api
0
1613741
<gh_stars>0 """ Django settings for summers_api project. Generated by 'django-admin startproject' using Django 4.0.3. For more information on this file, see https://docs.djangoproject.com/en/4.0/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/4.0/ref/settings/ """ ...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 15945, 29908, 13, 29928, 5364, 6055, 363, 2533, 13269, 29918, 2754, 2060, 29889, 13, 24565, 491, 525, 14095, 29899, 6406, 1369, 4836, 29915, 773, 15337, 29871, 29946, 29889, 29900, 29889, ...
willie/modules/isup.py
qsantos/willie
0
83128
<gh_stars>0 # coding=utf8 """ isup.py - Simple website status check with isup.me Author: <NAME> http://embolalia.net About: http://willie.dftba.net This allows users to check if a website is up through isup.me. """ from __future__ import unicode_literals from willie import web from willie.module import commands @co...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 29937, 14137, 29922, 9420, 29947, 13, 15945, 29908, 13, 275, 786, 29889, 2272, 448, 12545, 4700, 4660, 1423, 411, 338, 786, 29889, 1004, 13, 13720, 29901, 529, 5813, 29958, 1732, 597, 1...
autoqm/pusher.py
KEHANG/autoQM
0
103899
# connect to registration table # search targets to push # 1. get all the jobs with "job_success" # 2. check if job files are indeed there # 3. get level of theory from job files # 4. check if results table has this job with # same level of theory # launch cantherm job, # push results to results table # main da...
[ 1, 29871, 13, 29937, 4511, 304, 22583, 1591, 13, 13, 29937, 2740, 22525, 304, 5503, 13, 29937, 29871, 29896, 29889, 679, 599, 278, 17643, 411, 376, 9057, 29918, 8698, 29908, 29871, 13, 29937, 29871, 29906, 29889, 1423, 565, 4982, 2066, ...
djconnectwise/migrations/0114_auto_20200219_1515.py
kti-sam/django-connectwise
10
75979
<reponame>kti-sam/django-connectwise # Generated by Django 2.1.14 on 2020-02-19 15:15 from django.db import migrations, models import django.db.models.deletion import django_extensions.db.fields class Migration(migrations.Migration): dependencies = [ ('djconnectwise', '0113_auto_20200204_1054'), ] ...
[ 1, 529, 276, 1112, 420, 29958, 1193, 29875, 29899, 13445, 29914, 14095, 29899, 6915, 3538, 13, 29937, 3251, 630, 491, 15337, 29871, 29906, 29889, 29896, 29889, 29896, 29946, 373, 29871, 29906, 29900, 29906, 29900, 29899, 29900, 29906, 29899, ...
benchmark/test_tpch.py
serverless-analytics/dask-distributed-vanilla
0
11864
import time import sys import dask from dask.distributed import ( wait, futures_of, Client, ) from tpch import loaddata, queries #from benchmarks import utils # Paths or URLs to the TPC-H tables. #table_paths = { # 'CUSTOMER': 'hdfs://bu-23-115:9000/tpch/customer.tbl', # 'LINEITEM': 'hdfs://bu-...
[ 1, 1053, 931, 13, 5215, 10876, 13, 5215, 270, 1278, 13, 13, 3166, 270, 1278, 29889, 5721, 7541, 1053, 313, 13, 1678, 4480, 29892, 13, 1678, 3105, 1973, 29918, 974, 29892, 13, 1678, 12477, 29892, 13, 29897, 13, 13, 3166, 260, 29886, ...
cirtorch/enhance/color/gray.py
Tarekbouamer/Image-Retrieval-for-Image-Based-Localization
3
185087
import torch import torch.nn as nn from .rgb import bgr_to_rgb def rgb_to_grayscale(image: torch.Tensor) -> torch.Tensor: """ Convert a RGB image to grayscale version of image. The image data is assumed to be in the range of (0, 1). """ if not isinstance(image, torch.Tensor): rais...
[ 1, 1053, 4842, 305, 13, 5215, 4842, 305, 29889, 15755, 408, 302, 29876, 13, 13, 3166, 869, 23973, 1053, 289, 629, 29918, 517, 29918, 23973, 13, 13, 13, 1753, 15552, 29890, 29918, 517, 29918, 21012, 7052, 29898, 3027, 29901, 4842, 305, ...
main.py
timonent/hedging
0
175079
<filename>main.py import concurrent.futures import itertools as it import threading import click from hedger import Hedger from options_data import OptionsData #------------------------------------------------------------------------- @click.command(no_args_is_help=True) @click.option("--portfolio-size", "-p", multip...
[ 1, 529, 9507, 29958, 3396, 29889, 2272, 13, 5215, 21984, 29889, 29888, 329, 1973, 13, 5215, 4256, 8504, 408, 372, 13, 5215, 3244, 292, 13, 5215, 2828, 13, 3166, 298, 287, 914, 1053, 28561, 914, 13, 3166, 3987, 29918, 1272, 1053, 25186...
vector_partition.py
ilyakava/pyfst
3
62038
<reponame>ilyakava/pyfst<filename>vector_partition.py<gh_stars>1-10 """Test spatial depence of feature extraction methods Extracts quadrants of input images such that a certain percentage of training examples are present in those quadrants. The hope is to select training sets where training pixels and test pixels are ...
[ 1, 529, 276, 1112, 420, 29958, 2354, 557, 879, 29914, 2272, 29888, 303, 29966, 9507, 29958, 8111, 29918, 16707, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 15945, 29908, 3057, 18652, 1401, 663, 310, ...
tests/manifest/test_receiver.py
ebi-ait/ingest-exporter
0
62252
<gh_stars>0 import datetime import json from unittest import TestCase from mock import MagicMock from manifest.receiver import ManifestReceiver class TestReceiver(TestCase): def setUp(self): self.publish_config = { 'exchange': 'exchange', 'routing_key': 'routing_key', ...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 12865, 13, 5215, 4390, 13, 13, 3166, 443, 27958, 1053, 4321, 8259, 13, 3166, 11187, 1053, 26494, 18680, 13, 3166, 10419, 29889, 13556, 2147, 1053, 2315, 7004, 22068, 13, 13, 13, ...
tests/test_airflownetworkdistributioncomponentcoil.py
marcelosalles/pyidf
19
99621
<gh_stars>10-100 import os import tempfile import unittest import logging from pyidf import ValidationLevel import pyidf from pyidf.idf import IDF from pyidf.natural_ventilation_and_duct_leakage import AirflowNetworkDistributionComponentCoil log = logging.getLogger(__name__) class TestAirflowNetworkDistributionCompon...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29900, 29899, 29896, 29900, 29900, 13, 5215, 2897, 13, 5215, 5694, 1445, 13, 5215, 443, 27958, 13, 5215, 12183, 13, 3166, 11451, 333, 29888, 1053, 15758, 362, 10108, 13, 5215, 11451, 333, 2...
pycqed/measurement/sweep_points.py
nnlacroix/PycQED_py3
0
199200
<gh_stars>0 import logging log = logging.getLogger(__name__) from collections import OrderedDict from copy import deepcopy import numpy as np from numpy import array # Needed for eval. Do not remove. class SweepPoints(list): """ This class is used to create sweep points for any measurement. The SweepPoint...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 12183, 13, 1188, 353, 12183, 29889, 657, 16363, 22168, 978, 1649, 29897, 13, 3166, 16250, 1053, 8170, 287, 21533, 13, 3166, 3509, 1053, 6483, 8552, 13, 5215, 12655, 408, 7442, 13,...
bloodbank_rl/tianshou_utils/policies.py
joefarrington/bloodbank_rl
0
48860
<filename>bloodbank_rl/tianshou_utils/policies.py from tianshou.policy import A2CPolicy, PPOPolicy from typing import Any, Dict, List, Optional, Type from tianshou.data import Batch # Normal key structure for output doesn't work with MLFlow logging nicely # loss used as a key and also parent class A2CPolicyforMLFlow...
[ 1, 529, 9507, 29958, 14073, 397, 9157, 29918, 2096, 29914, 2034, 550, 10774, 29918, 13239, 29914, 3733, 293, 583, 29889, 2272, 13, 3166, 260, 5834, 10774, 29889, 22197, 1053, 319, 29906, 6271, 324, 4245, 29892, 349, 29925, 4590, 324, 4245...
terracommon/project/settings/dev.py
Terralego/terra-back
4
47220
# -*- coding: utf-8 -*- import logging import os from django.utils import six from .base import * # noqa SECRET_KEY = 'dev-<KEY>' ALLOWED_HOSTS = [] DEBUG = True EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' INTERNAL_IPS = ('127.0.0.1',) # Used by app debug_toolbar # Add the Python core Null...
[ 1, 396, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 5215, 12183, 13, 5215, 2897, 13, 13, 3166, 9557, 29889, 13239, 1053, 4832, 13, 13, 3166, 869, 3188, 1053, 334, 29871, 396, 694, 25621, 13, 13, 1660, ...
tests/integration/suites/sensitive/update.py
bularcasergiu/Anjay
0
27860
# -*- coding: utf-8 -*- # # Copyright 2017-2020 AVSystem <<EMAIL>> # # 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 ap...
[ 1, 396, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 29937, 13, 29937, 14187, 1266, 29871, 29906, 29900, 29896, 29955, 29899, 29906, 29900, 29906, 29900, 16884, 3924, 3532, 26862, 6227, 6778, 13, 29937, 13, 2...
code/BacDup/scripts/gff_parser.py
JFsanchezherrero/TFM_UOC_AMoya
2
12321
<reponame>JFsanchezherrero/TFM_UOC_AMoya #!/usr/bin/env python3 ############################################################## ## <NAME> & <NAME> ## ## Copyright (C) 2020-2021 ## ############################################################## ''' Created on 2...
[ 1, 529, 276, 1112, 420, 29958, 29967, 29943, 29879, 20372, 29920, 2276, 8567, 29914, 8969, 29924, 29918, 29965, 20166, 29918, 5194, 29877, 3761, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 29941, 13, 13383, 13383, 13383, 7346, 4...
pythonG/objects.py
ezan2000/Cssi_2018
0
9461
ezan = { 'name': 'ezan', 'age': 18, 'hair': 'brown', 'cool': True , } print(ezan) class Person(object): #use class to make object def __init__( self, name, age ,hair, color, hungry) : #initialize #first object inside of a class is self self.name = 'ezan' self.age = 18 ...
[ 1, 20803, 273, 353, 426, 13, 1678, 525, 978, 2396, 525, 6096, 273, 742, 13, 1678, 525, 482, 2396, 29871, 29896, 29947, 29892, 13, 13, 1678, 525, 29882, 1466, 2396, 525, 29890, 4708, 742, 13, 1678, 525, 1111, 324, 2396, 5852, 1919, 1...
machine-learning-ex1/ex1/gradientDescent.py
xu1718191411/coursera-ml-py
0
87486
<gh_stars>0 import numpy as np from computeCost import * def gradient_descent(X, y, theta, alpha, num_iters): # Initialize some useful values m = y.size J_history = np.zeros(num_iters) for i in range(0, num_iters): # ===================== Your Code Here ===================== # Instruc...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 12655, 408, 7442, 13, 3166, 10272, 25733, 1053, 334, 13, 13, 13, 1753, 16030, 29918, 2783, 1760, 29898, 29990, 29892, 343, 29892, 278, 941, 29892, 15595, 29892, 954, 29918, 277, 4...
exercises/chapter02/exc_02_02.py
deep-diver/fastai-course
0
155441
from fastai.vision.all import * url = "https://github.com/deep-diver/fastai-course/raw/master/data/oxford-iiit-pet-tiny.tar.gz" image_list = get_image_files(untar_data(url)/"images").sorted() filename1 = image_list[0].name filename2 = image_list[3].name print(f"{filename1}, {filename2}") def label_func(f): retur...
[ 1, 515, 5172, 1794, 29889, 4924, 29889, 497, 1053, 334, 13, 13, 2271, 353, 376, 991, 597, 3292, 29889, 510, 29914, 24535, 29899, 29881, 2147, 29914, 11255, 1794, 29899, 15775, 29914, 1610, 29914, 6207, 29914, 1272, 29914, 2251, 4006, 2989...
zipper_config.py
tormak/zipper-swapper
0
124911
import json import errno config = { 'first_file_filesize' : '1024', 'second_file_filesize' : '128' } def write_config(): with open('config.json', 'w') as config_file: json.dump(config, config_file) def read_config(): try: config_file = open('config.json', 'r') config = json...
[ 1, 1053, 4390, 13, 5215, 4589, 1217, 13, 13, 2917, 353, 426, 13, 1678, 525, 4102, 29918, 1445, 29918, 5325, 675, 29915, 259, 584, 525, 29896, 29900, 29906, 29946, 742, 13, 1678, 525, 7496, 29918, 1445, 29918, 5325, 675, 29915, 29871, ...
dapricot/auth/migrations/0002_auto_20190602_1858.py
softapr/django_apricot
0
55235
# Generated by Django 2.2.1 on 2019-06-02 18:58 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('daauth', '0001_initial'), ] operations = [ migrations.AlterModelOptions( name='permissionsmixin', options={}, ...
[ 1, 396, 3251, 630, 491, 15337, 29871, 29906, 29889, 29906, 29889, 29896, 373, 29871, 29906, 29900, 29896, 29929, 29899, 29900, 29953, 29899, 29900, 29906, 29871, 29896, 29947, 29901, 29945, 29947, 13, 13, 3166, 9557, 29889, 2585, 1053, 9725, ...
combine2d/sandbox/quick_n_dirty_eval/extract_all_final_surface_differences_and_perturbations.py
phigre/cobi
4
132153
<gh_stars>1-10 import numpy as np import matplotlib.pyplot as plt import glob import os from combine2d.core.data_logging import load_pickle from combine2d.core.visualization import MidpointNormalize, plot_glacier_contours from combine2d.sandbox.quick_n_dirty_eval import experiment_naming_engine from oggm import cfg cf...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 5215, 12655, 408, 7442, 13, 5215, 22889, 29889, 2272, 5317, 408, 14770, 13, 5215, 13149, 13, 5215, 2897, 13, 3166, 14405, 29906, 29881, 29889, 3221, 29889, 1272, 2991...