hexsha stringlengths 40 40 | size int64 5 2.06M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 248 | max_stars_repo_name stringlengths 5 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 248 | max_issues_repo_name stringlengths 5 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 248 | max_forks_repo_name stringlengths 5 125 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 5 2.06M | avg_line_length float64 1 1.02M | max_line_length int64 3 1.03M | alphanum_fraction float64 0 1 | count_classes int64 0 1.6M | score_classes float64 0 1 | count_generators int64 0 651k | score_generators float64 0 1 | count_decorators int64 0 990k | score_decorators float64 0 1 | count_async_functions int64 0 235k | score_async_functions float64 0 1 | count_documentation int64 0 1.04M | score_documentation float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f6df8963235e108bc0bff3c2625f3b6d7e38a0ef | 6,634 | py | Python | autolens/lens/plotters/sensitivity_fit_plotters.py | AshKelly/PyAutoLens | 043795966338a655339e61782253ad67cc3c14e6 | [
"MIT"
] | null | null | null | autolens/lens/plotters/sensitivity_fit_plotters.py | AshKelly/PyAutoLens | 043795966338a655339e61782253ad67cc3c14e6 | [
"MIT"
] | null | null | null | autolens/lens/plotters/sensitivity_fit_plotters.py | AshKelly/PyAutoLens | 043795966338a655339e61782253ad67cc3c14e6 | [
"MIT"
] | null | null | null | from matplotlib import pyplot as plt
from autolens.data.array.plotters import plotter_util
from autolens.lens.plotters import lens_plotter_util
def plot_fit_subplot(
fit, should_plot_mask=True, extract_array_from_mask=False, zoom_around_mask=False, positions=None,
should_plot_image_plane_pix=True,
... | 55.747899 | 127 | 0.763793 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 430 | 0.064818 |
f6e15a7ff5904b518c1e697c2b7f7bd499819849 | 793 | py | Python | boards/tests/test_cell.py | gcmac16/deeptoe | d92ffef553a03640479fb0dcd5e6fa1f4e6d1cd1 | [
"MIT"
] | null | null | null | boards/tests/test_cell.py | gcmac16/deeptoe | d92ffef553a03640479fb0dcd5e6fa1f4e6d1cd1 | [
"MIT"
] | null | null | null | boards/tests/test_cell.py | gcmac16/deeptoe | d92ffef553a03640479fb0dcd5e6fa1f4e6d1cd1 | [
"MIT"
] | null | null | null | import pytest
from ..cell import Cell
from ..exceptions import CellOccupiedError
def test_is_empty():
c = Cell('00')
assert c.is_empty
c.move('X')
assert not c.is_empty
def test_str():
c = Cell('00')
assert str(c) == '-'
c.move('X')
assert str(c) == 'X'
def test_error_on_double_... | 14.418182 | 42 | 0.553594 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 70 | 0.088272 |
f6e32f3fa61806614f5f5e9170af8b91f5de2f34 | 3,065 | py | Python | app.py | mariosky/fulltext-search | 873fa9f6233ad60a5caf09558fed9cf8e3e13c6e | [
"MIT"
] | 1 | 2021-05-26T15:43:29.000Z | 2021-05-26T15:43:29.000Z | app.py | mariosky/fulltext-search | 873fa9f6233ad60a5caf09558fed9cf8e3e13c6e | [
"MIT"
] | null | null | null | app.py | mariosky/fulltext-search | 873fa9f6233ad60a5caf09558fed9cf8e3e13c6e | [
"MIT"
] | null | null | null | from flask import Flask, request
from flask_httpauth import HTTPBasicAuth
from flaskr.title_search import get_title_content
from werkzeug.security import generate_password_hash, check_password_hash
from redisearch import Client, Query, TextField, IndexDefinition
import redis
from redis import ResponseError
import json
... | 23.945313 | 108 | 0.630669 | 0 | 0 | 0 | 0 | 1,897 | 0.618923 | 0 | 0 | 562 | 0.183361 |
f6e3b5434694dec731a462ebd8a18fdc17ccf073 | 1,044 | py | Python | lcm/lcm_optimal_euclidean.py | mingrammer/funmath | c9b6105c0058519e8ed3c7ce155030b4ecdfd3db | [
"MIT"
] | 106 | 2017-07-15T18:48:56.000Z | 2021-03-10T07:45:06.000Z | lcm/lcm_optimal_euclidean.py | stzminjae/funmath | 3319b8ccfb67346a410bc2e40ca3398288c03244 | [
"MIT"
] | 7 | 2017-07-16T01:48:37.000Z | 2018-02-16T12:57:37.000Z | lcm/lcm_optimal_euclidean.py | stzminjae/funmath | 3319b8ccfb67346a410bc2e40ca3398288c03244 | [
"MIT"
] | 13 | 2017-07-15T19:47:00.000Z | 2020-10-19T08:17:34.000Z | def gcd_optimal_euclidean(a: int, b: int) -> int:
if b == 0:
return a
a, b = b, a % b
return gcd_optimal_euclidean(a, b)
def lcm_optimal_euclidean(a: int, b: int) -> int:
"""Return a LCM (Lowest Common Multiple) of given two integers using euclidean algorithm
This function uses euclidean ... | 29.828571 | 114 | 0.60728 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 773 | 0.740421 |
f6e3fa4794dda049119dfb9a8ab2d410227d18eb | 1,135 | py | Python | day-03/part-1/youyoun.py | TPXP/adventofcode-2019 | ee653d6bfb510d14f2c2b3efc730d328c16b3f71 | [
"MIT"
] | 8 | 2019-12-01T08:56:46.000Z | 2019-12-05T21:21:12.000Z | day-03/part-1/youyoun.py | TPXP/adventofcode-2019 | ee653d6bfb510d14f2c2b3efc730d328c16b3f71 | [
"MIT"
] | 10 | 2019-11-25T09:56:20.000Z | 2021-05-10T19:57:48.000Z | day-03/part-1/youyoun.py | TPXP/adventofcode-2019 | ee653d6bfb510d14f2c2b3efc730d328c16b3f71 | [
"MIT"
] | 5 | 2019-12-01T08:19:57.000Z | 2020-11-23T09:50:19.000Z | from tool.runners.python import SubmissionPy
def get_coords(steps):
x, y = 0, 0
coords = set()
for step in steps.split(","):
if step[0] == "R":
for i in range(x, x + int(step[1:])):
coords.add((i, y))
x = x + int(step[1:])
elif step[0] == "L":
... | 29.868421 | 66 | 0.462555 | 377 | 0.332159 | 0 | 0 | 0 | 0 | 0 | 0 | 94 | 0.082819 |
f6e3fc4beae8b1f7a433dcce7cb12b7d34338dc4 | 5,104 | py | Python | niftynet/contrib/regression_weighted_sampler/isample_regression.py | elias-1/NiftyNet | 05cd2ffbff5043d9a40b524a6d72f6bd5cd072d2 | [
"Apache-2.0"
] | 2 | 2019-03-25T18:50:47.000Z | 2019-10-10T01:45:02.000Z | niftynet/contrib/regression_weighted_sampler/isample_regression.py | elias-1/NiftyNet | 05cd2ffbff5043d9a40b524a6d72f6bd5cd072d2 | [
"Apache-2.0"
] | null | null | null | niftynet/contrib/regression_weighted_sampler/isample_regression.py | elias-1/NiftyNet | 05cd2ffbff5043d9a40b524a6d72f6bd5cd072d2 | [
"Apache-2.0"
] | 2 | 2018-05-13T14:54:48.000Z | 2018-05-26T16:08:09.000Z | import os
import tensorflow as tf
from niftynet.application.regression_application import \
RegressionApplication, SUPPORTED_INPUT
from niftynet.engine.sampler_uniform import UniformSampler
from niftynet.engine.sampler_weighted import WeightedSampler
from niftynet.engine.application_variables import NETWORK_OUTPU... | 43.623932 | 75 | 0.651646 | 4,518 | 0.885188 | 0 | 0 | 0 | 0 | 0 | 0 | 1,299 | 0.254506 |
f6e75ecad1ceab57bbff84d8d994897e463d2b9c | 99 | py | Python | tests/test_empty.py | ErikBjare/eeg-notebooks | 73fd7ae7a723aafb41c36036da332b6e7e2a2b7b | [
"BSD-3-Clause"
] | null | null | null | tests/test_empty.py | ErikBjare/eeg-notebooks | 73fd7ae7a723aafb41c36036da332b6e7e2a2b7b | [
"BSD-3-Clause"
] | null | null | null | tests/test_empty.py | ErikBjare/eeg-notebooks | 73fd7ae7a723aafb41c36036da332b6e7e2a2b7b | [
"BSD-3-Clause"
] | null | null | null | def test_empty():
# Empty test that only imports eegnb, to make `pytest` pass
import eegnb
| 24.75 | 63 | 0.69697 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 59 | 0.59596 |
f6e7e8e4509bf31d9f510447d795576bf80ae64d | 723 | py | Python | observation/status.py | nosrio/pytun | 56ab9e216ccff57d6280835e20ccce7e062d39b8 | [
"Apache-2.0"
] | 1 | 2020-05-08T20:11:25.000Z | 2020-05-08T20:11:25.000Z | observation/status.py | nosrio/pytun | 56ab9e216ccff57d6280835e20ccce7e062d39b8 | [
"Apache-2.0"
] | 3 | 2020-11-10T12:17:30.000Z | 2021-06-04T16:17:32.000Z | observation/status.py | nosrio/pytun | 56ab9e216ccff57d6280835e20ccce7e062d39b8 | [
"Apache-2.0"
] | 1 | 2021-11-16T16:11:01.000Z | 2021-11-16T16:11:01.000Z | import datetime
from threading import RLock
class Status:
def __init__(self):
self.rlock = RLock()
self.status_data = {}
self.created_at = datetime.datetime.now()
def start_tunnel(self, tunnel_name):
with self.rlock:
if tunnel_name in self.status_data:
... | 30.125 | 93 | 0.607192 | 676 | 0.934993 | 0 | 0 | 0 | 0 | 0 | 0 | 67 | 0.092669 |
f6e9ac097d290b36827d579227b511e7d239d092 | 2,037 | py | Python | mayan/apps/navigation/widgets.py | Dave360-crypto/mayan-edms | 9cd37537461347f79ff0429e4b8b16fd2446798d | [
"Apache-2.0"
] | 3 | 2020-02-03T11:58:51.000Z | 2020-10-20T03:52:21.000Z | mayan/apps/navigation/widgets.py | Dave360-crypto/mayan-edms | 9cd37537461347f79ff0429e4b8b16fd2446798d | [
"Apache-2.0"
] | null | null | null | mayan/apps/navigation/widgets.py | Dave360-crypto/mayan-edms | 9cd37537461347f79ff0429e4b8b16fd2446798d | [
"Apache-2.0"
] | 2 | 2020-10-24T11:10:06.000Z | 2021-03-03T20:05:38.000Z | from __future__ import absolute_import
import urlparse
from django.conf import settings
from django.core.exceptions import PermissionDenied
from django.core.urlresolvers import reverse
from django.template import RequestContext, Variable
from django.template.defaultfilters import capfirst
from django.utils.safestring... | 39.173077 | 326 | 0.704467 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 462 | 0.226804 |
f6e9d127c928e003e7e3f6cc2bec25c1baf82144 | 3,237 | py | Python | src/toja/views/contribute.py | scmmmh/the-old-joke-archive | cfc842de94d092aa43de794154bea7e5edd97b16 | [
"MIT"
] | null | null | null | src/toja/views/contribute.py | scmmmh/the-old-joke-archive | cfc842de94d092aa43de794154bea7e5edd97b16 | [
"MIT"
] | 12 | 2019-12-26T17:40:56.000Z | 2022-02-26T17:21:06.000Z | src/toja/views/contribute.py | scmmmh/the-old-joke-archive | cfc842de94d092aa43de794154bea7e5edd97b16 | [
"MIT"
] | null | null | null | from copy import deepcopy
from math import ceil
from pyramid.httpexceptions import HTTPForbidden
from pyramid.view import view_config
from sqlalchemy import and_
from ..models import Image
from ..session import require_logged_in
from ..config import ANNOTATIONS, JOKE_METADATA
from ..translation import _
@view_config... | 43.16 | 112 | 0.569045 | 0 | 0 | 0 | 0 | 2,922 | 0.902688 | 0 | 0 | 815 | 0.251776 |
f6e9f1782f7b241fd84b50ed1c1ec48c21643259 | 1,357 | py | Python | src/peering/azext_peering/_client_factory.py | michimune/azure-cli-extensions | 697e2c674e5c0825d44c72d714542fe01331e107 | [
"MIT"
] | 1 | 2022-03-22T15:02:32.000Z | 2022-03-22T15:02:32.000Z | src/peering/azext_peering/_client_factory.py | michimune/azure-cli-extensions | 697e2c674e5c0825d44c72d714542fe01331e107 | [
"MIT"
] | 1 | 2018-11-19T05:12:58.000Z | 2018-11-19T05:12:58.000Z | src/peering/azext_peering/_client_factory.py | michimune/azure-cli-extensions | 697e2c674e5c0825d44c72d714542fe01331e107 | [
"MIT"
] | 1 | 2021-06-03T19:31:10.000Z | 2021-06-03T19:31:10.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 28.87234 | 94 | 0.67944 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 341 | 0.25129 |
f6ea28bc3d46bfe5dfcf89ab752488b9203ba424 | 6,877 | py | Python | pyfiles.py | geoffmcnamara/pyfiles | d38f060ace02703b6fc0b55da12af0ef4ba4857d | [
"MIT"
] | null | null | null | pyfiles.py | geoffmcnamara/pyfiles | d38f060ace02703b6fc0b55da12af0ef4ba4857d | [
"MIT"
] | null | null | null | pyfiles.py | geoffmcnamara/pyfiles | d38f060ace02703b6fc0b55da12af0ef4ba4857d | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
# vim: set syntax=none nospell:
import subprocess
import os
import fnmatch
import datetime
from bottle import default_app, route, run, template, response, redirect, debug, error, static_file
from wraphtml import WrapHtml
# for WSGI use:
application = default_app()
# config option #
debug(Tru... | 29.26383 | 190 | 0.558383 | 0 | 0 | 0 | 0 | 3,595 | 0.522757 | 0 | 0 | 4,186 | 0.608696 |
f6eadc908b3d82e2b72632699e16d0a7a0e120a2 | 207 | py | Python | Companyname/appgestion/admin.py | friedrrich/DesarrolloWebTest | 43425c7c5c9edf06aabb3c6e499dd72df89ee369 | [
"Apache-2.0"
] | null | null | null | Companyname/appgestion/admin.py | friedrrich/DesarrolloWebTest | 43425c7c5c9edf06aabb3c6e499dd72df89ee369 | [
"Apache-2.0"
] | null | null | null | Companyname/appgestion/admin.py | friedrrich/DesarrolloWebTest | 43425c7c5c9edf06aabb3c6e499dd72df89ee369 | [
"Apache-2.0"
] | null | null | null | from django.contrib import admin
# Register your models here.
from appgestion.models import Cliente,Articulo,Pedido
admin.site.register(Articulo)
admin.site.register(Cliente)
admin.site.register(Pedido)
| 18.818182 | 53 | 0.816425 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 28 | 0.135266 |
f6ebae9a56dd62c3e6ba8e8582ec9e6144ac2278 | 263 | py | Python | try_and_except.py | akkuldn/My_repo_akkul | ae5741f0e5e9e0d98429b974c679c96496dfea54 | [
"MIT"
] | null | null | null | try_and_except.py | akkuldn/My_repo_akkul | ae5741f0e5e9e0d98429b974c679c96496dfea54 | [
"MIT"
] | null | null | null | try_and_except.py | akkuldn/My_repo_akkul | ae5741f0e5e9e0d98429b974c679c96496dfea54 | [
"MIT"
] | null | null | null | a = [1, 2, 'a']
try:
print ("Second element = %d" %a[1])
# Throws error since there are only 3 elements in array
print ("thirdFourth element = %s" %a[2])
print("fourth element=%d"%a[4])
except Exception as e:
print ("Exception ",e) | 29.222222 | 60 | 0.577947 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 137 | 0.520913 |
f6ebf18ea1522aa199fc9077b5805d1d4bb86bed | 1,381 | py | Python | expression_builder/tests/test_brackets.py | django-advance-utils/expression-builder | 08dab5780ae3a8be90c4daa6b9950ad1af4d87a4 | [
"MIT"
] | null | null | null | expression_builder/tests/test_brackets.py | django-advance-utils/expression-builder | 08dab5780ae3a8be90c4daa6b9950ad1af4d87a4 | [
"MIT"
] | null | null | null | expression_builder/tests/test_brackets.py | django-advance-utils/expression-builder | 08dab5780ae3a8be90c4daa6b9950ad1af4d87a4 | [
"MIT"
] | null | null | null | import unittest
from expression_builder.expression_builder import ExpressionBuilder
class BracketsTests(unittest.TestCase):
# noinspection PyPep8Naming
def setUp(self):
self.exp = ExpressionBuilder()
def test_one(self):
result = self.exp.run_statement("(2 + 4) * 2")
self.assertEq... | 30.688889 | 74 | 0.636495 | 1,294 | 0.937002 | 0 | 0 | 0 | 0 | 0 | 0 | 184 | 0.133237 |
f6ec0f45efebd772f014a2bd9b91bd010caa2083 | 201 | py | Python | conan/tools/google/__init__.py | Mu-L/conan | 7c24ec4bbd6e8c16cdcd879403aae742689bc36a | [
"MIT"
] | 1 | 2019-11-04T17:23:09.000Z | 2019-11-04T17:23:09.000Z | conan/tools/google/__init__.py | Mu-L/conan | 7c24ec4bbd6e8c16cdcd879403aae742689bc36a | [
"MIT"
] | 1 | 2020-11-05T16:16:49.000Z | 2020-11-05T16:16:49.000Z | conan/tools/google/__init__.py | Mattlk13/conan | 005fc53485557b0a570bb71670f2ca9c66082165 | [
"MIT"
] | null | null | null | from conan.tools.google.toolchain import BazelToolchain
from conan.tools.google.bazeldeps import BazelDeps
from conan.tools.google.bazel import Bazel
from conan.tools.google.layout import bazel_layout
| 40.2 | 55 | 0.860697 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f6ec649c38937c1fef3f220168731774d308f112 | 6,343 | py | Python | Matsuoka/tripple_pend_ex.py | JacobSal/Neuromechanical_Models | 548f395327276864f8d0ea2450d565e91155853a | [
"MIT"
] | null | null | null | Matsuoka/tripple_pend_ex.py | JacobSal/Neuromechanical_Models | 548f395327276864f8d0ea2450d565e91155853a | [
"MIT"
] | null | null | null | Matsuoka/tripple_pend_ex.py | JacobSal/Neuromechanical_Models | 548f395327276864f8d0ea2450d565e91155853a | [
"MIT"
] | 1 | 2021-03-02T17:46:15.000Z | 2021-03-02T17:46:15.000Z | # -*- coding: utf-8 -*-
"""
Created on Thu Mar 11 11:25:26 2021
@author: jsalm
"""
import matplotlib.pyplot as plt
import numpy as np
from sympy import symbols
from sympy.physics import mechanics
from sympy import Dummy, lambdify
from scipy.integrate import odeint
#animation functions
from matplotlib import animati... | 31.093137 | 95 | 0.578906 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,922 | 0.302916 |
f6ec8c44996e7a72f62986aaf887de9edefb0ec5 | 722 | py | Python | hackerrank/captains_room.py | nityansuman/coding-python | b1569de95d1881a82fb32f394f24617cfdcdf4b7 | [
"Apache-2.0"
] | null | null | null | hackerrank/captains_room.py | nityansuman/coding-python | b1569de95d1881a82fb32f394f24617cfdcdf4b7 | [
"Apache-2.0"
] | null | null | null | hackerrank/captains_room.py | nityansuman/coding-python | b1569de95d1881a82fb32f394f24617cfdcdf4b7 | [
"Apache-2.0"
] | 2 | 2021-06-25T16:49:36.000Z | 2022-02-13T03:27:45.000Z | def find_captains_room(rooms, size):
all_guests = list(map(int, rooms))
unique_guests = set(all_guests)
sum_all_guests = sum(all_guests)
# Get the sum of all the unique room numbers
sum_unique_guests = sum(unique_guests)
# Get the difference, in the sum: the captains room will cause this difference
te... | 26.740741 | 80 | 0.707756 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 259 | 0.358726 |
f6eed7b3aed16016ddfb10a8b779b91942c2f42b | 16,196 | pyw | Python | frmStatPic1.pyw | iefan/army_holiday | 0c79cf89c4dbb16bd87ca754265821f82b298f13 | [
"Apache-2.0"
] | null | null | null | frmStatPic1.pyw | iefan/army_holiday | 0c79cf89c4dbb16bd87ca754265821f82b298f13 | [
"Apache-2.0"
] | null | null | null | frmStatPic1.pyw | iefan/army_holiday | 0c79cf89c4dbb16bd87ca754265821f82b298f13 | [
"Apache-2.0"
] | null | null | null | #!/usr/local/bin/python
# -*- coding: utf-8 -*-
import wx
#import wx.lib.buttons as buttons
import PyDatabase
import images
import string
import MyValidator
from PhrResource import ALPHA_ONLY, DIGIT_ONLY, strVersion, g_UnitSnNum
import MyThread
import time
import datetime
import types
import os
import matplotlib.pypl... | 38.379147 | 151 | 0.556866 | 15,922 | 0.968374 | 0 | 0 | 0 | 0 | 0 | 0 | 1,614 | 0.098163 |
f6f03810010754a86c0317dca23f8a7eaa2dccb4 | 2,050 | py | Python | receptor/connection/sock.py | RedHatOfficial/receptor | 0eb9f0e3bd3b25bce948f7a2f43562f181a630a1 | [
"Apache-2.0"
] | 6 | 2020-07-12T05:56:21.000Z | 2022-03-09T11:43:53.000Z | receptor/connection/sock.py | RedHatOfficial/receptor | 0eb9f0e3bd3b25bce948f7a2f43562f181a630a1 | [
"Apache-2.0"
] | 7 | 2020-07-06T15:51:06.000Z | 2021-08-18T18:55:26.000Z | receptor/connection/sock.py | RedHatOfficial/receptor | 0eb9f0e3bd3b25bce948f7a2f43562f181a630a1 | [
"Apache-2.0"
] | 3 | 2020-06-25T21:03:42.000Z | 2021-08-09T01:27:48.000Z | import asyncio
import logging
from .base import Transport, log_ssl_detail
logger = logging.getLogger(__name__)
class RawSocket(Transport):
def __init__(self, reader, writer, chunk_size=2 ** 16):
self.reader = reader
self.writer = writer
self._closed = False
self.chunk_size = chun... | 26.973684 | 76 | 0.593171 | 1,094 | 0.533659 | 0 | 0 | 59 | 0.02878 | 1,112 | 0.542439 | 204 | 0.099512 |
f6f0e76eb0ed0258f23697f9b0e4b2681dfd51d6 | 297 | py | Python | easy/excel-sheet-column-title.py | trilliwon/LeetCode | d137df53fa2489821b3c17ac22f24d9a1ae86304 | [
"MIT"
] | null | null | null | easy/excel-sheet-column-title.py | trilliwon/LeetCode | d137df53fa2489821b3c17ac22f24d9a1ae86304 | [
"MIT"
] | null | null | null | easy/excel-sheet-column-title.py | trilliwon/LeetCode | d137df53fa2489821b3c17ac22f24d9a1ae86304 | [
"MIT"
] | null | null | null | class Solution:
def convertToTitle(self, n):
"""
:type n: int
:rtype: str
"""
ans = ''
while n != 0:
n -= 1
digit = n % 26
ans = chr(ord('A') + digit) + ans
n = n // 26
return ans
| 19.8 | 45 | 0.343434 | 296 | 0.996633 | 0 | 0 | 0 | 0 | 0 | 0 | 61 | 0.205387 |
f6f1242f3dff4a13c09f9cca00fa6595b77c32d7 | 434 | py | Python | echo.py | devopsprosiva/python | 07311d7597c0895554efe8013b57f218a0f11bb5 | [
"MIT"
] | null | null | null | echo.py | devopsprosiva/python | 07311d7597c0895554efe8013b57f218a0f11bb5 | [
"MIT"
] | null | null | null | echo.py | devopsprosiva/python | 07311d7597c0895554efe8013b57f218a0f11bb5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# https://python-essentials.readthedocs.io/en/latest/echo.html
while True:
user_input = input("Enter some text: ")
try:
is_user_input_of_type_int = int(user_input)
print("You entered an integer " + user_input)
continue
except ValueError:
if user_input == 'quit':
prin... | 22.842105 | 62 | 0.665899 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 193 | 0.4447 |
f6f15cefe9ad0d3236e47039b8b006b0931ac91a | 1,021 | py | Python | medium/560-subarray-sum-equals-k.py | wanglongjiang/leetcode | c61d2e719e81575cfb5bde9d64e15cee7cf01ef3 | [
"MIT"
] | 2 | 2021-03-14T11:38:26.000Z | 2021-03-14T11:38:30.000Z | medium/560-subarray-sum-equals-k.py | wanglongjiang/leetcode | c61d2e719e81575cfb5bde9d64e15cee7cf01ef3 | [
"MIT"
] | null | null | null | medium/560-subarray-sum-equals-k.py | wanglongjiang/leetcode | c61d2e719e81575cfb5bde9d64e15cee7cf01ef3 | [
"MIT"
] | 1 | 2022-01-17T19:33:23.000Z | 2022-01-17T19:33:23.000Z | '''
和为K的子数组
给定一个整数数组和一个整数 k,你需要找到该数组中和为 k 的连续的子数组的个数。
说明 :
数组的长度为 [1, 20,000]。
数组中元素的范围是 [-1000, 1000] ,且整数 k 的范围是 [-1e7, 1e7]。
'''
from typing import List
from collections import defaultdict
'''
思路:前缀和+哈希
依次从左到右计算前缀和,如果前缀和presum = k,则满足要求的子数组数量ans+1
如果以往的子数组前缀和等于presum-k,因为以往的子数组是从0..x,而当前前缀和是从0..i,i>x,必然有当前子数组前缀和减去... | 24.309524 | 84 | 0.63761 | 555 | 0.349276 | 0 | 0 | 0 | 0 | 0 | 0 | 1,074 | 0.675897 |
f6f2ad180c13071a9741435f918fec8c6729ea8e | 5,139 | py | Python | xclim/testing/tests/test_sdba/diagnostics.py | Ouranosinc/hailstorm | 494c850164a9f553eeeba66c6cc90fe398eb2094 | [
"Apache-2.0"
] | 1 | 2018-08-20T16:36:40.000Z | 2018-08-20T16:36:40.000Z | xclim/testing/tests/test_sdba/diagnostics.py | Ouranosinc/hailstorm | 494c850164a9f553eeeba66c6cc90fe398eb2094 | [
"Apache-2.0"
] | 3 | 2018-08-23T13:25:47.000Z | 2018-08-23T15:59:45.000Z | xclim/testing/tests/test_sdba/diagnostics.py | Ouranosinc/hailstorm | 494c850164a9f553eeeba66c6cc90fe398eb2094 | [
"Apache-2.0"
] | null | null | null | # noqa: D205,D400
"""
SDBA Diagnostic Testing Module
==============================
This module is meant to compare results with those expected from papers, or create figures illustrating the
behavior of sdba methods and utilities.
"""
from __future__ import annotations
import numpy as np
from scipy.stats import gaus... | 32.11875 | 111 | 0.628916 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,345 | 0.261724 |
f6f3823a31297d998087dce38ce8e2ef8a8e0fab | 648 | py | Python | tests/benchmarks/test_dbbench.py | leroyjvargis/workflows | 4d5c3a11c678c10cd0c8b7e043f66e4e62cc790b | [
"Apache-2.0"
] | 558 | 2020-04-27T12:05:39.000Z | 2022-03-28T15:20:22.000Z | tests/benchmarks/test_dbbench.py | leroyjvargis/workflows | 4d5c3a11c678c10cd0c8b7e043f66e4e62cc790b | [
"Apache-2.0"
] | 103 | 2020-04-27T21:44:55.000Z | 2022-03-29T21:36:10.000Z | tests/benchmarks/test_dbbench.py | leroyjvargis/workflows | 4d5c3a11c678c10cd0c8b7e043f66e4e62cc790b | [
"Apache-2.0"
] | 61 | 2020-04-22T11:02:14.000Z | 2022-03-14T19:32:17.000Z | # SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2021 Micron Technology, Inc. All rights reserved.
from pathlib import Path
from tools.dbbench import DBbenchTest
name = Path(__file__).stem
cli_params = "--num=900000000 --threads=32 --value_size=400"
cmdlist = [
f"--benchmarks=fillseq {cli_params} --histog... | 32.4 | 92 | 0.723765 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 424 | 0.654321 |
f6f4cecab3f86f240ef8bcd0d1c2f63037857663 | 910 | py | Python | API/main/migrations/0006_auto_20200414_0908.py | Ju99ernaut/grapeflowAPI | 0d6599775e5b666ad735160b65262624fea0bf99 | [
"MIT"
] | null | null | null | API/main/migrations/0006_auto_20200414_0908.py | Ju99ernaut/grapeflowAPI | 0d6599775e5b666ad735160b65262624fea0bf99 | [
"MIT"
] | null | null | null | API/main/migrations/0006_auto_20200414_0908.py | Ju99ernaut/grapeflowAPI | 0d6599775e5b666ad735160b65262624fea0bf99 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.3 on 2020-04-14 07:08
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('main', '0005_auto_20200413_2105'),
]
operations = [
migrations.AlterField(
model_name='block',
... | 30.333333 | 113 | 0.60989 | 784 | 0.861538 | 0 | 0 | 0 | 0 | 0 | 0 | 176 | 0.193407 |
f6f56cdb2070cf0bbc1d4d28c70e844d719585b1 | 4,973 | py | Python | models/general_modules.py | zlijingtao/DAC20_reconstruction | c928cda1c8e492c05110d6c219c1ed529924e127 | [
"Apache-2.0"
] | 2 | 2021-03-13T19:27:04.000Z | 2021-11-17T17:14:19.000Z | models/general_modules.py | zlijingtao/DAC20_reconstruction | c928cda1c8e492c05110d6c219c1ed529924e127 | [
"Apache-2.0"
] | null | null | null | models/general_modules.py | zlijingtao/DAC20_reconstruction | c928cda1c8e492c05110d6c219c1ed529924e127 | [
"Apache-2.0"
] | null | null | null | import torch
import pdb
import torch.nn as nn
import torch.nn.functional as F
import math
from torch.autograd import Variable
from torch.autograd import Function
import numpy as np
def get_centroid(input, grain_size, num_bits, M2D):
if len(input.size()) == 2:
print(input.size())
print(grain_size)
... | 42.87069 | 164 | 0.658958 | 2,740 | 0.550975 | 0 | 0 | 0 | 0 | 0 | 0 | 246 | 0.049467 |
f6f5d0ec88d14c10c0ac57ddb348fc636518d866 | 2,133 | py | Python | public_html/API/newuser.py | jlambert23/COP4331 | 49ae9563d596d16d0aaa2095da43047f353b052c | [
"MIT"
] | null | null | null | public_html/API/newuser.py | jlambert23/COP4331 | 49ae9563d596d16d0aaa2095da43047f353b052c | [
"MIT"
] | null | null | null | public_html/API/newuser.py | jlambert23/COP4331 | 49ae9563d596d16d0aaa2095da43047f353b052c | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# coding: utf-8
import util
print("Content-Type: application/json\n\n")
def newuser(jsonPayload):
import pymysql
try:
firstname = jsonPayload['firstname']
lastname = jsonPayload['lastname']
username = jsonPayload['username']
password = jsonPayload['p... | 33.328125 | 168 | 0.591655 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 764 | 0.358181 |
f6f61c548dca85e9fb4e47a43a333094a78bec72 | 1,816 | py | Python | kws_streaming/layers/preemphasis_test.py | egonrian/google-research | 8177adbe9ca0d7e5a9463b54581fe6dd27be0974 | [
"Apache-2.0"
] | 3 | 2021-01-18T04:46:49.000Z | 2021-03-05T09:21:40.000Z | kws_streaming/layers/preemphasis_test.py | JustinDurham/google-research | 9049acf9246c1b75170f0c6757e62a8f619a9db6 | [
"Apache-2.0"
] | 25 | 2020-07-25T08:53:09.000Z | 2022-03-12T00:43:02.000Z | kws_streaming/layers/preemphasis_test.py | JustinDurham/google-research | 9049acf9246c1b75170f0c6757e62a8f619a9db6 | [
"Apache-2.0"
] | 4 | 2021-02-08T10:25:45.000Z | 2021-04-17T14:46:26.000Z | # coding=utf-8
# Copyright 2020 The Google Research Authors.
#
# 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 applicab... | 31.859649 | 74 | 0.736233 | 882 | 0.485683 | 0 | 0 | 0 | 0 | 0 | 0 | 791 | 0.435573 |
f6f7ca029395167d19947b07a6906680c9c59669 | 1,430 | py | Python | pymobiledevice3/services/dtfetchsymbols.py | iOSForensics/pymobiledevice3 | 6b148f4e58cc51cb44c18935913a3e6cec5b60d5 | [
"MIT"
] | 1 | 2022-01-20T16:53:15.000Z | 2022-01-20T16:53:15.000Z | pymobiledevice3/services/dtfetchsymbols.py | iOSForensics/pymobiledevice3 | 6b148f4e58cc51cb44c18935913a3e6cec5b60d5 | [
"MIT"
] | null | null | null | pymobiledevice3/services/dtfetchsymbols.py | iOSForensics/pymobiledevice3 | 6b148f4e58cc51cb44c18935913a3e6cec5b60d5 | [
"MIT"
] | null | null | null | import logging
import struct
import typing
from pymobiledevice3.exceptions import PyMobileDevice3Exception
from pymobiledevice3.lockdown import LockdownClient
class DtFetchSymbols(object):
SERVICE_NAME = 'com.apple.dt.fetchsymbols'
MAX_CHUNK = 1024 * 1024 * 10 # 10MB
CMD_LIST_FILES_PLIST = struct.pack('... | 31.777778 | 74 | 0.665734 | 1,267 | 0.886014 | 0 | 0 | 0 | 0 | 0 | 0 | 117 | 0.081818 |
f6f7e4d65e58a6c7d423140cc20d3150a2eb357b | 4,460 | py | Python | contrib/samples/python/read_register.py | nanocortex/vscp | 0b1a51a35a886921179a8112c592547f84c9771a | [
"CC-BY-3.0"
] | null | null | null | contrib/samples/python/read_register.py | nanocortex/vscp | 0b1a51a35a886921179a8112c592547f84c9771a | [
"CC-BY-3.0"
] | null | null | null | contrib/samples/python/read_register.py | nanocortex/vscp | 0b1a51a35a886921179a8112c592547f84c9771a | [
"CC-BY-3.0"
] | null | null | null | #!/usr/bin/env python
"""
Read registers from a node connected to the vscp daemon.
This module can be used to test the speed of the register update.
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foun... | 27.875 | 94 | 0.613453 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,932 | 0.433184 |
f6fa50ab9078aecf83c16af63647f98d64bc3aa7 | 106 | py | Python | super_material/__init__.py | pleroux0/super_material | b64d74afdeab7639dd1b220f8b23ade22d87c481 | [
"BSD-2-Clause"
] | 3 | 2020-10-20T00:37:59.000Z | 2021-07-17T12:59:52.000Z | super_material/__init__.py | pleroux0/super_material | b64d74afdeab7639dd1b220f8b23ade22d87c481 | [
"BSD-2-Clause"
] | null | null | null | super_material/__init__.py | pleroux0/super_material | b64d74afdeab7639dd1b220f8b23ade22d87c481 | [
"BSD-2-Clause"
] | 2 | 2020-10-02T14:31:07.000Z | 2021-08-15T10:00:29.000Z | __version__ = "1.0.0a"
__author__ = "Paul le Roux"
from .conductivity import *
from .gap_energy import *
| 17.666667 | 27 | 0.726415 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 22 | 0.207547 |
f6fa9a5372f0502aa133f9af6ac549155abd19ad | 1,939 | py | Python | api/data_pipeline_api.py | sodalic/SpaceBlobCollector-backend | feeff8bf351c730b31cbfe7cddc26b7533a47b59 | [
"BSD-3-Clause"
] | null | null | null | api/data_pipeline_api.py | sodalic/SpaceBlobCollector-backend | feeff8bf351c730b31cbfe7cddc26b7533a47b59 | [
"BSD-3-Clause"
] | null | null | null | api/data_pipeline_api.py | sodalic/SpaceBlobCollector-backend | feeff8bf351c730b31cbfe7cddc26b7533a47b59 | [
"BSD-3-Clause"
] | null | null | null | import os
from flask import Blueprint, flash, redirect, abort
from database.study_models import Study
from libs.admin_authentication import authenticate_admin_study_access
from libs.sentry import make_error_sentry
from pipeline.boto_helpers import get_boto_client
from pipeline.configuration_getters import get... | 43.088889 | 96 | 0.738009 | 0 | 0 | 0 | 0 | 1,458 | 0.751934 | 0 | 0 | 662 | 0.341413 |
f6faf53f3fd09e7ab28a9081de0a8f0200d7ee62 | 22,106 | py | Python | Data/FrackFinder/PA/2005-2010/Transformations_and_QAQC/MoorFrog/bin/task2shp.py | SkyTruth/CrowdProjects | eede4c97ca5195d8ad39ce353c962f588e52c6ad | [
"BSD-3-Clause"
] | 2 | 2015-05-23T06:57:32.000Z | 2016-08-21T17:50:32.000Z | Data/FrackFinder/PA/2013/Transformations_and_QAQC/MoorFrog/bin/task2shp.py | SkyTruth/CrowdProjects | eede4c97ca5195d8ad39ce353c962f588e52c6ad | [
"BSD-3-Clause"
] | 25 | 2015-01-08T16:00:08.000Z | 2017-05-04T17:37:23.000Z | Data/FrackFinder/PA/2013/Transformations_and_QAQC/MoorFrog/bin/task2shp.py | SkyTruth/CrowdProjects | eede4c97ca5195d8ad39ce353c962f588e52c6ad | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# This document is part of CrowdProjects
# https://github.com/skytruth/CrowdProjects
# =========================================================================== #
#
# Copyright (c) 2014, SkyTruth
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without... | 32.79822 | 117 | 0.566453 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 11,146 | 0.504207 |
f6fb2d87aa49248212178e1f5ae0d3607c06265f | 561 | py | Python | tools/send_message_telegram.py | lucasayres/python-tools | 686b84986aae1b1714fa5645b1f2a3fd6ef8355d | [
"MIT"
] | 71 | 2018-06-28T17:38:15.000Z | 2022-02-08T17:42:42.000Z | tools/send_message_telegram.py | DalavanCloud/python-tools | 686b84986aae1b1714fa5645b1f2a3fd6ef8355d | [
"MIT"
] | null | null | null | tools/send_message_telegram.py | DalavanCloud/python-tools | 686b84986aae1b1714fa5645b1f2a3fd6ef8355d | [
"MIT"
] | 14 | 2018-07-08T03:29:29.000Z | 2022-03-22T21:04:39.000Z | # -*- coding: utf-8 -*-
import requests
def send_message_telegram(msg, chat_id, token):
"""Send a message to a telegram user. The token can be generated talking with @BotFather on telegram.
Args:
msg (str): Message.
chat_id (str): Number.
token (str): Authentication Key.
Returns:... | 28.05 | 120 | 0.641711 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 370 | 0.659537 |
f6fcf35ed47156314011ed648fe26e929556a6f5 | 354 | py | Python | python-tutorial/consumer/main.py | twissmueller/event-driven-architectures | d3b37c87dcee6db096eaecbe90feb90d5429ebfc | [
"MIT"
] | 16 | 2021-11-14T22:30:13.000Z | 2022-03-28T11:33:04.000Z | python-tutorial/consumer/main.py | twissmueller/event-driven-architectures | d3b37c87dcee6db096eaecbe90feb90d5429ebfc | [
"MIT"
] | null | null | null | python-tutorial/consumer/main.py | twissmueller/event-driven-architectures | d3b37c87dcee6db096eaecbe90feb90d5429ebfc | [
"MIT"
] | 7 | 2021-11-18T15:37:43.000Z | 2022-03-18T12:52:58.000Z | from kafka import KafkaConsumer
import json
from TimestampEvent import TimestampEvent
consumer = KafkaConsumer('timestamp', bootstrap_servers='localhost:9092', value_deserializer=lambda x: json.loads(x.decode('utf-8')))
for message in consumer:
timestampEvent = TimestampEvent(**(message.value))
print("Receiv... | 32.181818 | 133 | 0.782486 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 46 | 0.129944 |
f6ff6690850f8c8bea40662924c37c303210909d | 4,133 | py | Python | dnppy/raster/degree_days.py | NASA-DEVELOP/dnppy | 8f7ef6f0653f5a4ea730ee557c72a2c89c06ce0b | [
"NASA-1.3"
] | 65 | 2015-09-10T12:59:56.000Z | 2022-02-27T22:09:03.000Z | dnppy/raster/degree_days.py | snowzm/dnppy | 8f7ef6f0653f5a4ea730ee557c72a2c89c06ce0b | [
"NASA-1.3"
] | 40 | 2015-04-08T19:23:30.000Z | 2015-08-04T15:53:11.000Z | dnppy/raster/degree_days.py | snowzm/dnppy | 8f7ef6f0653f5a4ea730ee557c72a2c89c06ce0b | [
"NASA-1.3"
] | 45 | 2015-08-14T19:09:38.000Z | 2022-02-15T18:53:16.000Z |
__all__ = ["degree_days"]
from to_numpy import to_numpy
from from_numpy import from_numpy
import numpy
def degree_days(T_base, Max, Min, NoData_Value, outpath = False, roof = False, floor = False):
"""
Inputs rasters for maximum and minimum temperatures, calculates Growing Degree Days
this function is ... | 36.575221 | 102 | 0.625696 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,416 | 0.584563 |
f6ffa1917b189d918c11e4522a284e7cf9b7bbb8 | 564 | py | Python | dsvfile/Models/Planets/VeinData.py | phoenixx-666/dsvread | 8a073c12343b2f0d34f9b728282dfefe10999f24 | [
"MIT"
] | 2 | 2021-03-01T19:57:20.000Z | 2021-08-02T20:54:48.000Z | dsvfile/Models/Planets/VeinData.py | phoenixx-666/dsvread | 8a073c12343b2f0d34f9b728282dfefe10999f24 | [
"MIT"
] | null | null | null | dsvfile/Models/Planets/VeinData.py | phoenixx-666/dsvread | 8a073c12343b2f0d34f9b728282dfefe10999f24 | [
"MIT"
] | null | null | null | from ...Fields import UInt8Field, Int16Field
from ...Fields.Enums import EVeinType16
from . import Model, Int32Field, FloatField
class VeinData(Model):
version = UInt8Field()
id = Int32Field()
veinType = EVeinType16()
modelIndex = Int16Field()
groupIndex = Int16Field()
amount = Int32Field()
... | 25.636364 | 44 | 0.675532 | 432 | 0.765957 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f6ffc84dd73dd6770247f6b84eac07007bd98522 | 3,277 | py | Python | code/Model/baselines/sentence-level-models/models/lstm.py | INK-USC/DS-RelationExtraction | eebcfa7fd2eda5bba92f3ef8158797cdf91e6981 | [
"MIT"
] | 156 | 2018-10-09T09:01:42.000Z | 2019-12-25T09:07:47.000Z | code/Model/baselines/sentence-level-models/models/lstm.py | pengdada98/USC-DS-RelationExtraction | eebcfa7fd2eda5bba92f3ef8158797cdf91e6981 | [
"MIT"
] | 10 | 2018-10-12T11:54:58.000Z | 2019-10-11T03:29:20.000Z | code/Model/baselines/sentence-level-models/models/lstm.py | pengdada98/USC-DS-RelationExtraction | eebcfa7fd2eda5bba92f3ef8158797cdf91e6981 | [
"MIT"
] | 64 | 2016-11-04T16:03:03.000Z | 2018-07-20T18:03:00.000Z | __author__ = 'Maosen'
import torch
import torch.nn as nn
import torch.nn.functional as F
import utils
from utils import pos2id, ner2id
import sys
from tqdm import tqdm
class LSTM(nn.Module):
def __init__(self, args, rel2id, word_emb=None):
super(LSTM, self).__init__()
# arguments
hidden, vocab_size, emb_dim, po... | 33.10101 | 122 | 0.728715 | 3,102 | 0.946597 | 0 | 0 | 0 | 0 | 0 | 0 | 589 | 0.179738 |
1000dfbbd035c312db7ff448296e00fba1a7cd5e | 898 | py | Python | backend/ocr_core/config.py | WestonLu/chinese-ocr | d27bf720a47b9bf3aae6f306c94bad0a36056e56 | [
"MIT"
] | 1 | 2022-02-23T09:22:39.000Z | 2022-02-23T09:22:39.000Z | backend/ocr_core/config.py | luxu1220/chinese-ocr | d27bf720a47b9bf3aae6f306c94bad0a36056e56 | [
"MIT"
] | null | null | null | backend/ocr_core/config.py | luxu1220/chinese-ocr | d27bf720a47b9bf3aae6f306c94bad0a36056e56 | [
"MIT"
] | null | null | null | import os
filt_path = os.path.abspath(__file__)
father_path = os.path.abspath(os.path.dirname(filt_path) + os.path.sep + ".")
GPU_ID = "cpu"
dbnet_short_size = 960
det_model_type = "dbnet"
pse_scale = 1
model_path = os.path.join(father_path, "models/dbnet.onnx")
# crnn相关
nh = 256
crnn_vertical_model_path = os.path.... | 28.967742 | 80 | 0.671492 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 319 | 0.336498 |
1001fbdf815fe1e81a9f259621fa2deb092ac084 | 1,265 | py | Python | src/merge_csv/merge_files.py | JoaquimXG/csv-merge | 2d0430b6dfe5ecb69e9bc18ba58b45678515cc69 | [
"MIT"
] | null | null | null | src/merge_csv/merge_files.py | JoaquimXG/csv-merge | 2d0430b6dfe5ecb69e9bc18ba58b45678515cc69 | [
"MIT"
] | null | null | null | src/merge_csv/merge_files.py | JoaquimXG/csv-merge | 2d0430b6dfe5ecb69e9bc18ba58b45678515cc69 | [
"MIT"
] | null | null | null | import pandas as pd
import logging
from .validate_options import validate_options
from .merge_dataframes import merge_dataframes_multiple_columns, merge_dataframes_single_column
def merge_files(left_file: str, right_file: str, columns: list, keep: str = 'none', keep_missing: str = 'none') -> pd.DataFrame:
"""
... | 39.53125 | 153 | 0.705929 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 551 | 0.435573 |
1003af35da2655e5a0344e4ff2fe9e380b14c2cd | 993 | py | Python | app/migrations/0007_auto_20210701_0434.py | Divyanshukalola/Alchemeo | fd32b47450eb2fea9f1bdf4a2f253e5655aca1d4 | [
"MIT"
] | null | null | null | app/migrations/0007_auto_20210701_0434.py | Divyanshukalola/Alchemeo | fd32b47450eb2fea9f1bdf4a2f253e5655aca1d4 | [
"MIT"
] | null | null | null | app/migrations/0007_auto_20210701_0434.py | Divyanshukalola/Alchemeo | fd32b47450eb2fea9f1bdf4a2f253e5655aca1d4 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.10 on 2021-07-01 04:34
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0006_auto_20210701_0346'),
]
operations = [
migrations.AddField(
model_name='invoice',
name=... | 33.1 | 152 | 0.624371 | 883 | 0.889225 | 0 | 0 | 0 | 0 | 0 | 0 | 218 | 0.219537 |
1003e56d44ba3bab8c9e2c86a4f9e739125ecbf8 | 1,231 | py | Python | dataset/file_table.py | hb-stone/FC-SOD | 1e084dde0d5bde4e90f633390ee74cbffdd67e76 | [
"MIT"
] | 12 | 2020-09-27T04:46:25.000Z | 2021-06-14T00:47:56.000Z | dataset/file_table.py | hb-stone/FC-SOD | 1e084dde0d5bde4e90f633390ee74cbffdd67e76 | [
"MIT"
] | 2 | 2021-06-15T11:03:31.000Z | 2021-09-17T01:02:00.000Z | dataset/file_table.py | hb-stone/FC-SOD | 1e084dde0d5bde4e90f633390ee74cbffdd67e76 | [
"MIT"
] | 1 | 2021-06-14T00:48:01.000Z | 2021-06-14T00:48:01.000Z | import os
from typing import Dict
from os.path import join as pathjoin
__ALL__ = ['get_dataset_path_by_name']
def get_dataset_path_by_name(dataset_name:str) -> Dict[str, str]:
root_dir = os.path.dirname(__file__)
if dataset_name not in "DUT-OMRON DUTS PASCAL-S SOD".split(" "):
raise NameError(f"the da... | 34.194444 | 75 | 0.718115 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 180 | 0.146223 |
1004ca4b7ce19372568058fbfdce28896aab01a3 | 961 | py | Python | ICS 101/Xmisc/week5_ex/permutation_example.py | herambchaudhari4121/NYU_Shanghai_CS | 27c73242a77348af273683f2756e6960f60126fd | [
"MIT"
] | null | null | null | ICS 101/Xmisc/week5_ex/permutation_example.py | herambchaudhari4121/NYU_Shanghai_CS | 27c73242a77348af273683f2756e6960f60126fd | [
"MIT"
] | null | null | null | ICS 101/Xmisc/week5_ex/permutation_example.py | herambchaudhari4121/NYU_Shanghai_CS | 27c73242a77348af273683f2756e6960f60126fd | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Oct 9 16:46:40 2021
@author: bing
"""
import copy
## The code only works for lists without repeated elements
def permute(nums, node=[], permutations=[]):
if len(node)==len(nums):
permutations.append(node[:])
return
for n in ... | 20.891304 | 58 | 0.532778 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 446 | 0.4641 |
1005b0ab01949ad9cd001c97ae464c7d77e2b32d | 1,579 | py | Python | catkin/src/distributed_robot_system/src/nodes/webcam_main.py | samuelwestlake/Multi-Tier-Robot-System | 93664413e68ac2080958527149729bd6b63429b5 | [
"MIT"
] | null | null | null | catkin/src/distributed_robot_system/src/nodes/webcam_main.py | samuelwestlake/Multi-Tier-Robot-System | 93664413e68ac2080958527149729bd6b63429b5 | [
"MIT"
] | null | null | null | catkin/src/distributed_robot_system/src/nodes/webcam_main.py | samuelwestlake/Multi-Tier-Robot-System | 93664413e68ac2080958527149729bd6b63429b5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import cv2
import rospy
import numpy as np
from sensor_msgs.msg import CompressedImage
class CameraNode(object):
def __init__(self, camera=0, nb=0, buggy_nb=0, node_name="camera_node"):
self.vc = cv2.VideoCapture(camera) # Initialise instance of... | 45.114286 | 118 | 0.50855 | 1,402 | 0.887904 | 0 | 0 | 0 | 0 | 0 | 0 | 317 | 0.20076 |
1007a20dabb4322c12f531ddcead5c7ccd4b2801 | 680 | py | Python | src/image.py | adamsh25/RE | 99c631ba2049c0ba86357a3148a8442a5fd8ec0e | [
"MIT"
] | 105 | 2017-01-02T18:32:01.000Z | 2021-11-09T11:23:50.000Z | src/image.py | scvalencia/MNIST_ASCCI_challenge | 60f7880f2d5aebe2420b472a4af7c7f2e0ee9c45 | [
"MIT"
] | null | null | null | src/image.py | scvalencia/MNIST_ASCCI_challenge | 60f7880f2d5aebe2420b472a4af7c7f2e0ee9c45 | [
"MIT"
] | 24 | 2017-01-03T13:03:56.000Z | 2017-10-25T02:27:45.000Z | import cv2
import numpy
def write_MNIST_files():
file_object = open('../data/data.csv', 'r')
file_object.readline()
counters = {_ : 0 for _ in range(10)}
folders = {
0 : 'zero', 1 : 'one', 2 : 'two', 3 : 'three',
4 : 'four', 5 : 'five', 6 : 'six', 7 : 'seven',
8 : 'eight', 9 : 'nine'
}
for line in fil... | 24.285714 | 97 | 0.607353 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 114 | 0.167647 |
1007f65a17fe2339f5dd2b0454b47b5dab03d134 | 1,119 | py | Python | tests/test_blog.py | derrokip34/Blog | ec6d6acb0c69ea42a8ea99c6836d943ad7417984 | [
"MIT"
] | null | null | null | tests/test_blog.py | derrokip34/Blog | ec6d6acb0c69ea42a8ea99c6836d943ad7417984 | [
"MIT"
] | null | null | null | tests/test_blog.py | derrokip34/Blog | ec6d6acb0c69ea42a8ea99c6836d943ad7417984 | [
"MIT"
] | null | null | null | import unittest
from app.models import Blog,User
from flask_login import current_user
from app import db
class TestBlogs(unittest.TestCase):
def setUp(self):
self.user_Derrick = User(username="derrokip34",password="zlatan",email="derrokip@gmail.com")
self.new_blog = Blog(blog_title="Batman",blog_c... | 34.96875 | 122 | 0.702413 | 1,013 | 0.905273 | 0 | 0 | 0 | 0 | 0 | 0 | 102 | 0.091153 |
100958354158b69adde8e070d9d2162cbbf77d9f | 5,196 | py | Python | pyzscaler/zia/__init__.py | mitchos/pyZscaler | c4c83345bf26e2883b9555d20a90f9387a45e05e | [
"MIT"
] | 16 | 2021-07-09T00:20:31.000Z | 2022-02-17T19:29:26.000Z | pyzscaler/zia/__init__.py | mitchos/pyZscaler | c4c83345bf26e2883b9555d20a90f9387a45e05e | [
"MIT"
] | 62 | 2021-07-21T03:42:09.000Z | 2022-03-18T09:08:20.000Z | pyzscaler/zia/__init__.py | mitchos/pyZscaler | c4c83345bf26e2883b9555d20a90f9387a45e05e | [
"MIT"
] | 8 | 2021-09-11T08:14:53.000Z | 2022-03-25T20:14:41.000Z | import os
from restfly.session import APISession
from pyzscaler import __version__
from .admin_and_role_management import AdminAndRoleManagementAPI
from .audit_logs import AuditLogsAPI
from .config import ActivationAPI
from .dlp import DLPAPI
from .firewall import FirewallPolicyAPI
from .locations import LocationsAP... | 27.935484 | 117 | 0.645497 | 4,503 | 0.866628 | 0 | 0 | 2,815 | 0.541763 | 0 | 0 | 2,365 | 0.455158 |
100a065e4d36bdc98eb6cfcabc84b98767d44b90 | 2,769 | py | Python | pytorchDL/tasks/image_segmentation/evaluator.py | Milogav/PytorchDL | 39d8e40cf430113003b2e03f81951d43118dc09a | [
"MIT"
] | null | null | null | pytorchDL/tasks/image_segmentation/evaluator.py | Milogav/PytorchDL | 39d8e40cf430113003b2e03f81951d43118dc09a | [
"MIT"
] | null | null | null | pytorchDL/tasks/image_segmentation/evaluator.py | Milogav/PytorchDL | 39d8e40cf430113003b2e03f81951d43118dc09a | [
"MIT"
] | null | null | null | import os
import json
import torch
from tqdm import tqdm
from pytorchDL.tasks.image_segmentation.predictor import Predictor
from pytorchDL.tasks.image_segmentation.data import Dataset
from pytorchDL.metrics import ConfusionMatrix
class Evaluator(Predictor):
def __init__(self, test_data_dir, out_dir, ckpt_path,... | 39 | 105 | 0.625135 | 1,896 | 0.684724 | 0 | 0 | 0 | 0 | 0 | 0 | 352 | 0.127122 |
100a542603a26516265165b7195f68b21242cd95 | 2,457 | py | Python | script.module.urlresolver/lib/urlresolver/plugins/youtube.py | Reapercrew666/crypt | e1e0994f5323c6b454ac0f65fb2e579f7bea8e5a | [
"Beerware"
] | 1 | 2019-10-16T18:38:33.000Z | 2019-10-16T18:38:33.000Z | script.module.urlresolver/lib/urlresolver/plugins/youtube.py | Reapercrew666/crypt | e1e0994f5323c6b454ac0f65fb2e579f7bea8e5a | [
"Beerware"
] | null | null | null | script.module.urlresolver/lib/urlresolver/plugins/youtube.py | Reapercrew666/crypt | e1e0994f5323c6b454ac0f65fb2e579f7bea8e5a | [
"Beerware"
] | null | null | null | """
urlresolver XBMC Addon
Copyright (C) 2011 t0mm0
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
... | 36.671642 | 87 | 0.63777 | 1,505 | 0.612536 | 0 | 0 | 0 | 0 | 0 | 0 | 1,125 | 0.457875 |
100ad66b5c3e9588877b9fc6e88bd19765cc8458 | 240 | py | Python | tests/wintools/test_file.py | yukkun007/wintools | df6521e91a3dc2c34e5fc599abbc4ea81dedc313 | [
"MIT"
] | null | null | null | tests/wintools/test_file.py | yukkun007/wintools | df6521e91a3dc2c34e5fc599abbc4ea81dedc313 | [
"MIT"
] | 7 | 2021-09-27T20:48:49.000Z | 2021-10-07T15:10:01.000Z | tests/wintools/test_file.py | mozkzki/wintools | df6521e91a3dc2c34e5fc599abbc4ea81dedc313 | [
"MIT"
] | null | null | null | from wintools import print_files_info, print_info
FILES = ["./tests/resources/test.iso"]
class TestFile:
def test_print_files_info(self):
print_files_info(FILES)
def test_print_info(self):
print_info("./tests")
| 18.461538 | 49 | 0.704167 | 146 | 0.608333 | 0 | 0 | 0 | 0 | 0 | 0 | 37 | 0.154167 |
100c4edfc29e88d0889447b1b17515a7614789cf | 1,232 | py | Python | setup.py | Polamreddykrishnareddy/PatternPackage | 893ab468a637cd70a0dd8f6d60f7f5c75a3db58f | [
"MIT"
] | null | null | null | setup.py | Polamreddykrishnareddy/PatternPackage | 893ab468a637cd70a0dd8f6d60f7f5c75a3db58f | [
"MIT"
] | null | null | null | setup.py | Polamreddykrishnareddy/PatternPackage | 893ab468a637cd70a0dd8f6d60f7f5c75a3db58f | [
"MIT"
] | null | null | null | import setuptools
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setuptools.setup(
name="PatternPackage-Polamreddykrishnareddy",
version="0.0.1",
author="Polamreddykrishnareddy",
author_email="krishnareddy40900@gmail.com",
description="I Build the python Patt... | 45.62963 | 405 | 0.717532 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 783 | 0.635552 |
100d9789f6e6312613e49c7a269082eb46397dd5 | 3,832 | py | Python | chapter21casestudy2/GuessingApp/GuessingGame/wordgenerator.py | bpbpublications/Question-Bank-for-Exam-Success-Computer-Science-with-Python-Class-XII-CBSE-083- | c2ad485b5f9b7a304d4398539770c3a5916b2248 | [
"MIT"
] | null | null | null | chapter21casestudy2/GuessingApp/GuessingGame/wordgenerator.py | bpbpublications/Question-Bank-for-Exam-Success-Computer-Science-with-Python-Class-XII-CBSE-083- | c2ad485b5f9b7a304d4398539770c3a5916b2248 | [
"MIT"
] | null | null | null | chapter21casestudy2/GuessingApp/GuessingGame/wordgenerator.py | bpbpublications/Question-Bank-for-Exam-Success-Computer-Science-with-Python-Class-XII-CBSE-083- | c2ad485b5f9b7a304d4398539770c3a5916b2248 | [
"MIT"
] | 1 | 2020-12-17T22:49:47.000Z | 2020-12-17T22:49:47.000Z | words=['about','above','abuse','actor','acute','admit','adopt','adult','after','again','agent','agree','ahead','alarm','album','alert','alike','alive','allow','alone','along','alter','among','anger','Angle','angry','apart','apple','apply','arena','argue','arise','array','aside','asset','audio','audit','avoid','award','... | 547.428571 | 3,763 | 0.626305 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3,286 | 0.857516 |
100e1407ca4bf246b1686309281c924774e73b5d | 5,548 | py | Python | setup.py | johannesnicolaus/singlecell | 8b3f5719b236fb2b9783e4d2c3b419352bb3bf6f | [
"BSD-3-Clause"
] | null | null | null | setup.py | johannesnicolaus/singlecell | 8b3f5719b236fb2b9783e4d2c3b419352bb3bf6f | [
"BSD-3-Clause"
] | null | null | null | setup.py | johannesnicolaus/singlecell | 8b3f5719b236fb2b9783e4d2c3b419352bb3bf6f | [
"BSD-3-Clause"
] | null | null | null | # import sys
import os
import io
from setuptools import setup, find_packages, Command, Extension
from os import path
root = 'singlecell'
name = 'singlecell'
version = '0.1.0'
here = path.abspath(path.dirname(__file__))
description = ('SingleCell: A Python/Cython Package for Processing '
'Single-Cell ... | 27.879397 | 75 | 0.593367 | 503 | 0.090663 | 0 | 0 | 0 | 0 | 0 | 0 | 2,837 | 0.511355 |
100e34c61df61bc865eac40d88e70b3034c2db4a | 276 | py | Python | clean.py | rayjustinhuang/BitesofPy | 03b694c5259ff607621419d9677c5caff90a6057 | [
"MIT"
] | null | null | null | clean.py | rayjustinhuang/BitesofPy | 03b694c5259ff607621419d9677c5caff90a6057 | [
"MIT"
] | null | null | null | clean.py | rayjustinhuang/BitesofPy | 03b694c5259ff607621419d9677c5caff90a6057 | [
"MIT"
] | null | null | null | def remove_punctuation(input_string):
"""Return a str with punctuation chars stripped out"""
tran_table = str.maketrans('','', '!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~')
output_string = input_string.translate(tran_table)
return output_string
pass | 30.666667 | 75 | 0.594203 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 94 | 0.34058 |
100ecaddb56a4114729cfb6f919f5dd51de7ee8b | 1,322 | py | Python | set1/Aes_cipher.py | arunKumarNOP/Cryptopals-Solutions | 529474679972e17566a233de110f0b47078ef3b9 | [
"MIT"
] | null | null | null | set1/Aes_cipher.py | arunKumarNOP/Cryptopals-Solutions | 529474679972e17566a233de110f0b47078ef3b9 | [
"MIT"
] | null | null | null | set1/Aes_cipher.py | arunKumarNOP/Cryptopals-Solutions | 529474679972e17566a233de110f0b47078ef3b9 | [
"MIT"
] | null | null | null | from Crypto.Cipher import AES
from Xor import xorPlain
from set2.PkcsPadding import pkcs7_pad
def decrypt_ecb(ciphertxt, key):
encryptor = AES.new(key, AES.MODE_ECB)
return encryptor.decrypt(ciphertxt)
def encrypt_ecb(plaintxt, key):
encryptor = AES.new(key, AES.MODE_ECB)
if len(plaintxt)%len(key) !... | 27.541667 | 94 | 0.658094 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 155 | 0.117247 |
100f590f093322ddd66390421e6b96818ed6e651 | 1,234 | py | Python | encode/tests/test_models.py | Ircam-Web/django-encode | 2c1c9d843865ec99fb5b45631d6f08a9c7cb86ce | [
"MIT"
] | 11 | 2015-03-11T20:48:13.000Z | 2021-12-14T14:17:39.000Z | encode/tests/test_models.py | Ircam-Web/django-encode | 2c1c9d843865ec99fb5b45631d6f08a9c7cb86ce | [
"MIT"
] | 2 | 2015-11-24T22:10:06.000Z | 2017-05-26T09:27:02.000Z | encode/tests/test_models.py | Ircam-Web/django-encode | 2c1c9d843865ec99fb5b45631d6f08a9c7cb86ce | [
"MIT"
] | 2 | 2019-08-09T17:29:41.000Z | 2020-08-31T16:47:27.000Z | # Copyright Collab 2014-2016
# See LICENSE for details.
"""
Tests for the :py:mod:`encode.models` module.
"""
from __future__ import unicode_literals
from django.core.files.base import ContentFile
from encode.models import Audio, Video, EncodingProfile
from encode.tests.helpers import WEBM_DATA, FileTestCase
clas... | 27.422222 | 67 | 0.65316 | 917 | 0.743112 | 0 | 0 | 0 | 0 | 0 | 0 | 513 | 0.415721 |
100f59c47d54d766ba3ff5cc46102e95afc2ab33 | 431 | py | Python | bflib/spells/magicuser/darkvision.py | ChrisLR/BasicDungeonRL | b293d40bd9a0d3b7aec41b5e1d58441165997ff1 | [
"MIT"
] | 3 | 2017-10-28T11:28:38.000Z | 2018-09-12T09:47:00.000Z | bflib/spells/magicuser/darkvision.py | ChrisLR/BasicDungeonRL | b293d40bd9a0d3b7aec41b5e1d58441165997ff1 | [
"MIT"
] | null | null | null | bflib/spells/magicuser/darkvision.py | ChrisLR/BasicDungeonRL | b293d40bd9a0d3b7aec41b5e1d58441165997ff1 | [
"MIT"
] | null | null | null | from bflib import units
from bflib.characters import classes
from bflib.spells import listing
from bflib.spells.base import Spell
from bflib.spells.duration import SpellDuration
from bflib.spells.range import Touch
@listing.register_spell
class Darkvision(Spell):
name = "Darkvision"
class_level_map = {
... | 25.352941 | 62 | 0.763341 | 189 | 0.438515 | 0 | 0 | 213 | 0.4942 | 0 | 0 | 12 | 0.027842 |
100fd6b5ec1d603eb5c012f65ffed656ba164f09 | 5,589 | py | Python | apps/tokenlizer.py | qsyao/cudaBERT | c93cb5ff0ccd387294a7229a9bef969c1375d0d6 | [
"Apache-2.0"
] | 88 | 2019-07-19T10:55:16.000Z | 2021-12-25T09:42:59.000Z | apps/tokenlizer.py | qsyao/cudaBERT | c93cb5ff0ccd387294a7229a9bef969c1375d0d6 | [
"Apache-2.0"
] | 3 | 2019-08-01T12:47:43.000Z | 2021-12-07T03:16:50.000Z | apps/tokenlizer.py | qsyao/cudaBERT | c93cb5ff0ccd387294a7229a9bef969c1375d0d6 | [
"Apache-2.0"
] | 12 | 2019-07-19T17:41:29.000Z | 2021-11-10T02:59:53.000Z | from pytorch_pretrained_bert.tokenization import BertTokenizer
tokenlizer = None
'''
Convert a input line from input_file to a tuple:
[index, line_raw_data , inputs_id, segments_id, mask]
record id_line
process inputs_id, segments_id, mask
record line_data(raw string in line from input_fi... | 37.510067 | 84 | 0.632671 | 918 | 0.164251 | 0 | 0 | 0 | 0 | 0 | 0 | 2,708 | 0.484523 |
101197a60898fb4d5c822eb8c2635b94b789f285 | 3,653 | py | Python | spider/ipSpider.py | SonnySmart/M3u8Downloader | 663b61ece071e6734ab60f82bd17ac222d90218c | [
"MIT"
] | 10 | 2019-11-20T19:09:50.000Z | 2022-02-26T00:40:32.000Z | spider/ipSpider.py | SonnySmart/M3u8Downloader | 663b61ece071e6734ab60f82bd17ac222d90218c | [
"MIT"
] | 1 | 2021-06-01T23:51:29.000Z | 2021-06-01T23:51:29.000Z | spider/ipSpider.py | SonnySmart/M3u8Downloader | 663b61ece071e6734ab60f82bd17ac222d90218c | [
"MIT"
] | 2 | 2020-02-21T20:59:18.000Z | 2020-09-24T15:05:59.000Z | # -*- coding: UTF-8 -*-
import requests
import urllib3
import threading
import json
import os
from bs4 import BeautifulSoup
class IpSpider:
url = 'http://www.xicidaili.com/nn/'
page = 1
maxPage = 10
checkUrl = 'https://www.ip.cn/'
needIpNum = 10
ipNum = 0
filePath = 'db/'
fileName = 'i... | 32.616071 | 145 | 0.514098 | 3,610 | 0.966016 | 0 | 0 | 0 | 0 | 0 | 0 | 659 | 0.176345 |
1012f3c009ffa34c2c9b80bf26d6395fbc58797a | 617 | py | Python | qwe/planning/blockSim.py | IEEERobotics/high-level | a50f2170ca81a16bd50b50f970f9e3fe9c656bfa | [
"BSD-2-Clause"
] | 1 | 2017-08-07T06:03:53.000Z | 2017-08-07T06:03:53.000Z | qwe/planning/blockSim.py | IEEERobotics/high-level | a50f2170ca81a16bd50b50f970f9e3fe9c656bfa | [
"BSD-2-Clause"
] | null | null | null | qwe/planning/blockSim.py | IEEERobotics/high-level | a50f2170ca81a16bd50b50f970f9e3fe9c656bfa | [
"BSD-2-Clause"
] | null | null | null | import Block;
class BlockSim:
def process(self, loc, count):
listofBlocks = []
filename = "./planning/" + str(loc) + ".txt"
f = open(filename, 'r')
data = f.read()
#print line
lines = data.split('\n')
#print len(lines)
for i in range(len(lines)):
items = lines[i].split()
blk = Block.Block(... | 19.903226 | 58 | 0.63047 | 513 | 0.831442 | 0 | 0 | 0 | 0 | 0 | 0 | 192 | 0.311183 |
10130fa6cc6d73e32a8210599ebb4ce228836f7b | 960 | py | Python | test/chat/chatserver.py | rahulsukla/cltpWS | aa20f69e121ff0ab81cd0e9e2e7a421c62b759ca | [
"MIT"
] | 1 | 2015-04-15T03:54:18.000Z | 2015-04-15T03:54:18.000Z | test/chat/chatserver.py | rahulsukla/cltpWS | aa20f69e121ff0ab81cd0e9e2e7a421c62b759ca | [
"MIT"
] | null | null | null | test/chat/chatserver.py | rahulsukla/cltpWS | aa20f69e121ff0ab81cd0e9e2e7a421c62b759ca | [
"MIT"
] | null | null | null | from bottle import request, route, run, static_file
chats = []
@route('/ping')
def ping():
print chats
return "pong"
@route('/chat', method = 'POST')
def save_chat():
if request.forms.get('user') is not None:
chats.append({ 'user': request.forms.get('user'),
'at': long(requ... | 25.945946 | 83 | 0.577083 | 0 | 0 | 0 | 0 | 809 | 0.842708 | 0 | 0 | 160 | 0.166667 |
101377cd066f70a4f80a4aa9efddee6dc1171b27 | 1,349 | py | Python | exp1/src/task3.py | bhshp/optimization | 8f1a476c263f2b49c3b166f55e2fcc0913050552 | [
"MIT"
] | null | null | null | exp1/src/task3.py | bhshp/optimization | 8f1a476c263f2b49c3b166f55e2fcc0913050552 | [
"MIT"
] | null | null | null | exp1/src/task3.py | bhshp/optimization | 8f1a476c263f2b49c3b166f55e2fcc0913050552 | [
"MIT"
] | null | null | null | import cv2
import numpy as np
from task2 import fit, l1_grad_descent
origin_image = cv2.imread('./data/lena.jpg')
n, m, channel = origin_image.shape
sigma = 20
noise_image = np.uint8(np.clip(np.random.normal(0, sigma, origin_image.shape)
+ origin_image, 0, 255))
cv2.imwrite('./data/nois... | 29.977778 | 77 | 0.550037 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 63 | 0.046701 |
1013f4af0653cffeadf5679387a32197de8a9afa | 619 | py | Python | e30.py | Jeremiah-Bergkvist/ProjectEuler | 06ef7fd8641e47cb8b8738173d50c57c076af6dd | [
"MIT"
] | null | null | null | e30.py | Jeremiah-Bergkvist/ProjectEuler | 06ef7fd8641e47cb8b8738173d50c57c076af6dd | [
"MIT"
] | null | null | null | e30.py | Jeremiah-Bergkvist/ProjectEuler | 06ef7fd8641e47cb8b8738173d50c57c076af6dd | [
"MIT"
] | null | null | null |
def main():
# Maximum value needed to get calculate
# 9**5 == 59049
# 59049 * 5 == 295245
power = 5
start = 2
stop = power * 9**5
matches = []
for x in xrange(start, stop+1):
xstr = str(x)
xsum = 0
for y in xrange(len(xstr)):
xsum += int(... | 23.807692 | 44 | 0.453958 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 98 | 0.15832 |
10146477856bf3fb9a7d6889ff29df6b4dd4be0b | 2,513 | py | Python | datafiles/testscript.py | xiaoxinz-cisco/examples | ce1d1526346665bf797effb7b372a5030d2f9bfd | [
"Apache-2.0"
] | 81 | 2019-08-07T09:00:15.000Z | 2022-03-17T23:23:51.000Z | datafiles/testscript.py | xiaoxinz-cisco/examples | ce1d1526346665bf797effb7b372a5030d2f9bfd | [
"Apache-2.0"
] | 2 | 2019-07-30T03:09:50.000Z | 2021-09-28T13:08:00.000Z | datafiles/testscript.py | xiaoxinz-cisco/examples | ce1d1526346665bf797effb7b372a5030d2f9bfd | [
"Apache-2.0"
] | 41 | 2019-08-21T22:43:11.000Z | 2022-03-30T03:22:35.000Z | #!/usr/bin/env python
'''
This is a very short script intended to help the user undersand what datafiles
are, how to use them & how datafiles affect your script's normal execution.
First, run this script by itself:
bash$ python testscript.py
Now, add datafile:
bash$ python testscript.py -datafile data/simple_... | 29.564706 | 78 | 0.668922 | 1,757 | 0.699164 | 0 | 0 | 1,452 | 0.577795 | 0 | 0 | 1,138 | 0.452845 |
1014a44dfeab5dc5a1bcbe3f568a4c2b8e25397c | 950 | py | Python | tf2utils/enums.py | offish/tf2-rgb-values | 7a526e9918afef9f79b7be37e81cd374df66c57d | [
"MIT"
] | 1 | 2019-06-16T15:55:38.000Z | 2019-06-16T15:55:38.000Z | tf2utils/enums.py | offish/tf2utils | 7a526e9918afef9f79b7be37e81cd374df66c57d | [
"MIT"
] | null | null | null | tf2utils/enums.py | offish/tf2utils | 7a526e9918afef9f79b7be37e81cd374df66c57d | [
"MIT"
] | 2 | 2019-03-14T18:58:32.000Z | 2019-04-12T11:02:14.000Z | import enum
class ETradeOfferState(enum.IntEnum):
Invalid = 1
Active = 2
Accepted = 3
Countered = 4
Expired = 5
Canceled = 6
Declined = 7
InvalidItems = 8
NeedsConfirmation = 9
CanceledBySecondFactor = 10
Escrow = 11
class EItemQuality(enum.IntEnum):
Normal = 0
Ge... | 14.393939 | 37 | 0.509474 | 929 | 0.977895 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
10159dc12ce248c5ab20867cf825a1f1750f06f7 | 372 | py | Python | beginner_contest/109/C.py | FGtatsuro/myatcoder | 25a3123be6a6311e7d1c25394987de3e35575ff4 | [
"MIT"
] | null | null | null | beginner_contest/109/C.py | FGtatsuro/myatcoder | 25a3123be6a6311e7d1c25394987de3e35575ff4 | [
"MIT"
] | null | null | null | beginner_contest/109/C.py | FGtatsuro/myatcoder | 25a3123be6a6311e7d1c25394987de3e35575ff4 | [
"MIT"
] | null | null | null | import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
n, x = map(int, input().split())
point = list(map(int, input().split()))
diff = [0] * n
for i in range(n):
diff[i] = abs(point[i] - x)
def gcd(big, small):
if small == 0:
return big
else:
return gcd(small, big % small)
i... | 18.6 | 39 | 0.612903 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
101629a24b0565cb16ae5309c4126f52ea5e2bb8 | 1,369 | py | Python | returns/interfaces/lashable.py | ariebovenberg/returns | 1630e060a629082b2f9de62177d198a5b59e1929 | [
"BSD-2-Clause"
] | 3 | 2019-01-27T14:41:46.000Z | 2019-01-30T10:57:25.000Z | returns/interfaces/lashable.py | ariebovenberg/returns | 1630e060a629082b2f9de62177d198a5b59e1929 | [
"BSD-2-Clause"
] | 92 | 2022-01-03T01:14:21.000Z | 2022-03-30T00:32:09.000Z | returns/interfaces/lashable.py | ariebovenberg/returns | 1630e060a629082b2f9de62177d198a5b59e1929 | [
"BSD-2-Clause"
] | null | null | null | from abc import abstractmethod
from typing import Callable, Generic, NoReturn, TypeVar
from returns.primitives.hkt import KindN
_FirstType = TypeVar('_FirstType')
_SecondType = TypeVar('_SecondType')
_ThirdType = TypeVar('_ThirdType')
_UpdatedType = TypeVar('_UpdatedType')
_LashableType = TypeVar('_LashableType', bo... | 28.520833 | 71 | 0.707816 | 810 | 0.591673 | 0 | 0 | 395 | 0.288532 | 0 | 0 | 618 | 0.451424 |
10162d06e2219ad8662267101a5ad7808681589b | 6,875 | py | Python | combinatorial_optim/sa_test_total.py | goodxue/CenterNet | 50e1726664337fb988542e3c2247a4c57ef74334 | [
"MIT"
] | null | null | null | combinatorial_optim/sa_test_total.py | goodxue/CenterNet | 50e1726664337fb988542e3c2247a4c57ef74334 | [
"MIT"
] | null | null | null | combinatorial_optim/sa_test_total.py | goodxue/CenterNet | 50e1726664337fb988542e3c2247a4c57ef74334 | [
"MIT"
] | null | null | null | import os
import time
import glob
import numpy as np
import argparse
from detection_evaluation.nuscenes_eval_core import NuScenesEval
from detection_evaluation.label_parser import LabelParser
import co_utils as cu
def parse_args():
parser = argparse.ArgumentParser(description='arg parser')
# parser.add_argumen... | 39.739884 | 147 | 0.628509 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3,456 | 0.489588 |
10170ff28699d7143f1d158e1501a5a54fa2ae72 | 1,158 | py | Python | unalikability-python/unalikability.py | cuevasclemente/unlikable-polyglot | ce9efb86df0b667124da394cfcc11c18b81e4849 | [
"MIT"
] | 1 | 2021-05-18T17:33:10.000Z | 2021-05-18T17:33:10.000Z | unalikability-python/unalikability.py | cuevasclemente/unlikable-polyglot | ce9efb86df0b667124da394cfcc11c18b81e4849 | [
"MIT"
] | 1 | 2021-05-18T17:36:44.000Z | 2021-05-18T18:51:34.000Z | unalikability-python/unalikability.py | cuevasclemente/unlikable-polyglot | ce9efb86df0b667124da394cfcc11c18b81e4849 | [
"MIT"
] | null | null | null | import collections
import math
def unalikeability(measurements: [int]) -> float:
"""
Unalikeability returns the unalikability measure
for `measurements`, assuming that
`measurements` is an array describing a
collection of measurements of a categorical
variable (i.e: perhaps the results of runnin... | 27.571429 | 65 | 0.576857 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 699 | 0.603627 |
10179228ca75871b5e01551558e02842372500a8 | 8,769 | py | Python | pheweb/serve/components/autocomplete/sqlite_dao.py | FINNGEN/pheweb | 40fd83fce0b8e4f405d182dd63b9741c5ee5b280 | [
"MIT"
] | 4 | 2018-11-03T13:58:52.000Z | 2020-03-06T09:19:03.000Z | pheweb/serve/components/autocomplete/sqlite_dao.py | FINNGEN/pheweb | 40fd83fce0b8e4f405d182dd63b9741c5ee5b280 | [
"MIT"
] | 92 | 2018-05-17T18:07:01.000Z | 2022-03-29T00:37:30.000Z | pheweb/serve/components/autocomplete/sqlite_dao.py | FINNGEN/pheweb | 40fd83fce0b8e4f405d182dd63b9741c5ee5b280 | [
"MIT"
] | 4 | 2020-07-01T12:20:55.000Z | 2022-01-24T20:09:15.000Z |
from ....file_utils import get_filepath
from ...server_utils import parse_variant
from flask import url_for
from pathlib import Path
import urllib.parse
import itertools
import re
import copy
import sqlite3
from typing import List,Dict,Any,Optional,Iterator
# TODO: sort suggestions better.
# - It's good that hitting... | 48.988827 | 166 | 0.605884 | 7,174 | 0.818109 | 4,300 | 0.490364 | 258 | 0.029422 | 0 | 0 | 2,314 | 0.263884 |
101891f3b9ed444afe6d924d40f4687201082a15 | 1,314 | py | Python | AI(BE)/rest_api/application.py | dev-taewon-kim/ai_web_RISKOUT_BTS | 6b5650f8ecf068185ad87af62074627aca566018 | [
"MIT"
] | 1 | 2021-11-04T07:54:58.000Z | 2021-11-04T07:54:58.000Z | AI(BE)/rest_api/application.py | mslee300/ai_web_RISKOUT_BTS | e01b3d27f68a0187b619920bf5c1f2de0cbc0f7d | [
"MIT"
] | null | null | null | AI(BE)/rest_api/application.py | mslee300/ai_web_RISKOUT_BTS | e01b3d27f68a0187b619920bf5c1f2de0cbc0f7d | [
"MIT"
] | null | null | null | import logging
import uvicorn
from fastapi import FastAPI, HTTPException
from starlette.middleware.cors import CORSMiddleware
from rest_api.controller.errors.http_error import http_error_handler
from rest_api.config import ROOT_PATH
logging.basicConfig(format="%(asctime)s %(message)s", datefmt="%m/%d/%Y %I:%M:%S %p"... | 27.957447 | 94 | 0.705479 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 457 | 0.336029 |
101a132eac985f8e06fbc298f71166afb00448d1 | 4,603 | py | Python | rnn_text_classifier.py | kamei86i/rnn-classifier-tf | f56d7460dce8ee5ebd02b5ae773c1c5f899be125 | [
"Apache-2.0"
] | 1 | 2018-07-27T00:05:22.000Z | 2018-07-27T00:05:22.000Z | rnn_text_classifier.py | kamei86i/rnn-classifier-tf | f56d7460dce8ee5ebd02b5ae773c1c5f899be125 | [
"Apache-2.0"
] | null | null | null | rnn_text_classifier.py | kamei86i/rnn-classifier-tf | f56d7460dce8ee5ebd02b5ae773c1c5f899be125 | [
"Apache-2.0"
] | null | null | null | import tensorflow as tf
class RnnTextClassifier:
def __init__(self, batch_size, sentence_length, embedding, cell_layer_size, cell_layer_num, num_classes, lam=1,
lr=0.001):
self.batch_size = batch_size
self.sentence_length = sentence_length
self.embedding = embedding
... | 44.68932 | 120 | 0.615034 | 4,576 | 0.994134 | 0 | 0 | 0 | 0 | 0 | 0 | 329 | 0.071475 |
101a7d148874f545b161968d0a67f51310cf8392 | 4,705 | py | Python | scripts/run.py | peterkuma/shortwave-intermittency | 0ee86b3ad3117cbe22f342105a1b110905ed5183 | [
"MIT"
] | null | null | null | scripts/run.py | peterkuma/shortwave-intermittency | 0ee86b3ad3117cbe22f342105a1b110905ed5183 | [
"MIT"
] | null | null | null | scripts/run.py | peterkuma/shortwave-intermittency | 0ee86b3ad3117cbe22f342105a1b110905ed5183 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# run.py
#
# References:
#
# * Masek J. 2013. Single interval showtwave radiation scheme with
# parametrized optical saturation and spectral overlaps.
#
import sys
import os
from tempfile import NamedTemporaryFile
import subprocess
import numpy as np
from StringIO import StringIO
impo... | 21.004464 | 71 | 0.637832 | 187 | 0.039745 | 0 | 0 | 0 | 0 | 0 | 0 | 1,330 | 0.282678 |
101abe09fb563597dc036618480bdb3605bcf35d | 357 | py | Python | app/rooms/utils.py | frikke/code-examples-python | ecb3d9c386501a584cab1b0b5c83e5b71b4c9a2f | [
"MIT"
] | null | null | null | app/rooms/utils.py | frikke/code-examples-python | ecb3d9c386501a584cab1b0b5c83e5b71b4c9a2f | [
"MIT"
] | null | null | null | app/rooms/utils.py | frikke/code-examples-python | ecb3d9c386501a584cab1b0b5c83e5b71b4c9a2f | [
"MIT"
] | null | null | null | from docusign_rooms import ApiClient
def create_rooms_api_client(access_token):
"""Create API client and construct API headers"""
api_client = ApiClient(host="https://demo.rooms.docusign.com/restapi")
api_client.set_default_header(
header_name="Authorization",
header_value=f"Bearer {access... | 29.75 | 74 | 0.733894 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 129 | 0.361345 |
101b647d45f6d31dee7304560ed30905d346ce80 | 4,776 | py | Python | GenerIter/app/generator.py | GridPresence/GenerIter | f0b74cd6c1d1bb9a23fccb28fa8b972f9eeccaf8 | [
"MIT"
] | 7 | 2021-01-07T19:03:10.000Z | 2021-03-05T08:05:17.000Z | GenerIter/app/generator.py | GridPresence/GenerIter | f0b74cd6c1d1bb9a23fccb28fa8b972f9eeccaf8 | [
"MIT"
] | 2 | 2021-01-26T12:45:58.000Z | 2021-02-15T11:06:14.000Z | GenerIter/app/generator.py | GridPresence/GenerIter | f0b74cd6c1d1bb9a23fccb28fa8b972f9eeccaf8 | [
"MIT"
] | 1 | 2021-01-24T05:21:28.000Z | 2021-01-24T05:21:28.000Z | #!/usr/bin/env python3
"""
App to generate music.
Copyright 2020 Thomas Jackson Park & Jeremy Pavier
"""
import os
import argparse
import sys
from pathlib import Path
from GenerIter.app.clibase import CLIBase
from GenerIter.selector import Selector
from GenerIter.config import Config
from GenerIter.factory import Pr... | 36.738462 | 122 | 0.555067 | 4,306 | 0.901591 | 0 | 0 | 0 | 0 | 0 | 0 | 738 | 0.154523 |
63d7946b710bcf849366eee7c627cc4c3a914d5e | 6,566 | py | Python | app.py | Nikita-Sukhwal/AatmSuraksha | 291ac685b2dee7758f19e1f7e97ab37312979db9 | [
"MIT"
] | 4 | 2021-02-12T16:46:42.000Z | 2021-02-12T17:02:51.000Z | app.py | Nikita-Sukhwal/AatmSuraksha | 291ac685b2dee7758f19e1f7e97ab37312979db9 | [
"MIT"
] | null | null | null | app.py | Nikita-Sukhwal/AatmSuraksha | 291ac685b2dee7758f19e1f7e97ab37312979db9 | [
"MIT"
] | null | null | null | from flask import Flask, render_template, request, url_for, redirect, session
import pymongo
import mail
from location import lat, log #, location, city, state
import messagebird
import credentials
#set app as a Flask instance
app = Flask(__name__)
#encryption relies on secret keys so they could be run
app.secret_ke... | 36.276243 | 124 | 0.633567 | 0 | 0 | 0 | 0 | 5,814 | 0.885471 | 0 | 0 | 2,417 | 0.368108 |
63d7d272c033f8694a10b24b5f90bdd7dd750995 | 107 | py | Python | apps/porteiros/admin.py | franric/Controle-Visitante | 5ca0c423885167c9d096e6f7ee48d238e64566f3 | [
"MIT"
] | null | null | null | apps/porteiros/admin.py | franric/Controle-Visitante | 5ca0c423885167c9d096e6f7ee48d238e64566f3 | [
"MIT"
] | null | null | null | apps/porteiros/admin.py | franric/Controle-Visitante | 5ca0c423885167c9d096e6f7ee48d238e64566f3 | [
"MIT"
] | null | null | null | from django.contrib import admin
from apps.porteiros.models import Porteiro
admin.site.register(Porteiro)
| 21.4 | 42 | 0.841121 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
63da6938462c65e9252485f08e43d556eb29664b | 2,118 | py | Python | etox/apps/backend/mixins.py | a1xg/OpenTox | 52b807185a8113c83b7f5b9a2896974e9f02c8d0 | [
"Apache-2.0"
] | 1 | 2021-09-19T18:07:10.000Z | 2021-09-19T18:07:10.000Z | etox/apps/backend/mixins.py | a1xg/OpenTox | 52b807185a8113c83b7f5b9a2896974e9f02c8d0 | [
"Apache-2.0"
] | null | null | null | etox/apps/backend/mixins.py | a1xg/OpenTox | 52b807185a8113c83b7f5b9a2896974e9f02c8d0 | [
"Apache-2.0"
] | null | null | null | from .services.hazard_assessor import HazardMeter
from .services.ocr import ImageOCR
from .serializers import IngredientsSerializer, ProductSerializer, DetailsIngredientSerializer
from .services.text_blocks_screening import IngredientsBlockFinder
from .services.db_tools import DBQueries
from .services.ocr_settings impo... | 36.517241 | 108 | 0.616147 | 1,790 | 0.845137 | 0 | 0 | 0 | 0 | 0 | 0 | 254 | 0.119924 |
63dcb009c572a33dac19bddf3657a147f2fcccc3 | 1,181 | py | Python | python-django-piscine/day04/d04/urls.py | maxdesalle/libft | 8845656e1f5cc1fec052cf97fc8f5839b2b590a8 | [
"Unlicense"
] | 3 | 2021-01-06T13:50:12.000Z | 2022-02-28T09:16:15.000Z | python-django-piscine/day04/d04/urls.py | maxdesalle/libft | 8845656e1f5cc1fec052cf97fc8f5839b2b590a8 | [
"Unlicense"
] | null | null | null | python-django-piscine/day04/d04/urls.py | maxdesalle/libft | 8845656e1f5cc1fec052cf97fc8f5839b2b590a8 | [
"Unlicense"
] | 1 | 2020-11-23T12:58:18.000Z | 2020-11-23T12:58:18.000Z | """d04 URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based vie... | 39.366667 | 88 | 0.721423 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 800 | 0.677392 |
63dd7fae6c8c1a5d59b9d4ffad7b82f95f7d3cb7 | 3,122 | py | Python | spaghettifs/treetree.py | mgax/SpaghettiFS | 7782ed1a30910330f0380b70edf110262743374e | [
"MIT"
] | 3 | 2016-03-16T08:22:47.000Z | 2019-09-30T09:35:27.000Z | spaghettifs/treetree.py | mgax/SpaghettiFS | 7782ed1a30910330f0380b70edf110262743374e | [
"MIT"
] | null | null | null | spaghettifs/treetree.py | mgax/SpaghettiFS | 7782ed1a30910330f0380b70edf110262743374e | [
"MIT"
] | 4 | 2015-09-18T12:45:14.000Z | 2020-09-22T13:01:58.000Z | """
TreeTree is a wrapper over `easygit.EasyTree` that provides more efficient
storage of lists. Keys must be strings made up of digits, and they should
be as close as possible to the indices of a list.
"""
class TreeTree(object):
is_tree = True
def __init__(self, container, prefix='tt'):
self.contain... | 28.126126 | 76 | 0.528187 | 2,708 | 0.867393 | 0 | 0 | 0 | 0 | 0 | 0 | 272 | 0.087124 |
63def619e46b70dd31fc4852669b37e3e1d6df41 | 737 | py | Python | bot.py | rojserbest/contact-bot | 2763d115cec28ae1b27a6cd489ab79e885ec13ce | [
"MIT"
] | 3 | 2021-02-10T06:17:27.000Z | 2021-08-08T16:44:11.000Z | bot.py | rojserbest/contact-bot | 2763d115cec28ae1b27a6cd489ab79e885ec13ce | [
"MIT"
] | null | null | null | bot.py | rojserbest/contact-bot | 2763d115cec28ae1b27a6cd489ab79e885ec13ce | [
"MIT"
] | 2 | 2021-02-10T09:59:02.000Z | 2021-02-25T02:37:40.000Z | from telegram.ext import Updater, PicklePersistence
from config import BOT_TOKEN
updater = Updater(
BOT_TOKEN,
persistence=PicklePersistence(filename="data")
)
dp = updater.dispatcher
def main():
from handlers import all_handlers
for handler in all_handlers:
if len(handler) == 2:
... | 19.918919 | 51 | 0.514247 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 23 | 0.031208 |
63e06ea259c0e2b97e801a344e2061220ba0cacc | 951 | py | Python | D/D.py | staguchi0703/abc142 | d529a14a76586cb582cecec17ab6267736673937 | [
"MIT"
] | null | null | null | D/D.py | staguchi0703/abc142 | d529a14a76586cb582cecec17ab6267736673937 | [
"MIT"
] | null | null | null | D/D.py | staguchi0703/abc142 | d529a14a76586cb582cecec17ab6267736673937 | [
"MIT"
] | null | null | null | #
# VScodeで入力をテキストから読み込んで標準入力に渡す
import sys
import os
f=open(r'.\D\D_input.txt', 'r', encoding="utf-8")
# inputをフルパスで指定
# win10でファイルを作るとs-jisで保存されるため、読み込みをutf-8へエンコードする必要あり
# VScodeでinput file開くとutf8になってるんだけど中身は結局s-jisになっているらしい
sys.stdin=f
#
# 入力スニペット
# num = int(input())
# num_list = [int(item) for item in input().s... | 19.8125 | 54 | 0.604627 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 610 | 0.514768 |
63e0b323a1930c8792758cd6dfc42283e2496a50 | 1,769 | py | Python | sources/ebf-demo/scripts/cfilter.py | zwg0106/imx-yocto | e378ca25352a59d1ef84ee95f3386b7314f4565b | [
"MIT"
] | 1 | 2020-01-13T13:16:52.000Z | 2020-01-13T13:16:52.000Z | sources/ebf-demo/scripts/cfilter.py | zwg0106/imx-yocto | e378ca25352a59d1ef84ee95f3386b7314f4565b | [
"MIT"
] | 3 | 2019-11-20T02:53:01.000Z | 2019-12-26T03:00:15.000Z | sources/ebf-demo/scripts/cfilter.py | zwg0106/imx-yocto | e378ca25352a59d1ef84ee95f3386b7314f4565b | [
"MIT"
] | null | null | null | import time
import math
class ComplementaryFilter(object):
def __init__(self, gyroWeight=0.95):
self.gyroWeight = gyroWeight
self._reset()
def _reset(self):
self.last = 0
self.accelPos = [0, 0, 0]
self.gyroPos = [0, 0, 0]
self.filterPos = [0, 0, 0]
def inp... | 29.983051 | 123 | 0.57377 | 1,743 | 0.985302 | 0 | 0 | 0 | 0 | 0 | 0 | 354 | 0.200113 |
63e0ebde336a5f3eeb1ad190a79f282a9b028bed | 3,008 | py | Python | face_recognition/deep_learning/main_flow_processer.py | cclauss/TripletLossFace | 6da4ae571cf2fb912ab528afa3f0b9f1efe71767 | [
"MIT"
] | 88 | 2020-01-18T09:47:03.000Z | 2021-12-18T22:34:18.000Z | face_recognition/deep_learning/main_flow_processer.py | cclauss/TripletLossFace | 6da4ae571cf2fb912ab528afa3f0b9f1efe71767 | [
"MIT"
] | 4 | 2020-01-18T09:20:24.000Z | 2020-03-02T19:40:58.000Z | face_recognition/deep_learning/main_flow_processer.py | cclauss/TripletLossFace | 6da4ae571cf2fb912ab528afa3f0b9f1efe71767 | [
"MIT"
] | 40 | 2020-01-18T11:15:07.000Z | 2021-03-09T07:58:57.000Z | import sys
sys.path.append("../")
import json
import cv2, os
import numpy as np
import tensorflow as tf
from make_better_dataset_for_deepfake.main_data_creator import FaceExtractor
class Engine:
def load_image(self, path):
image = tf.io.read_file(path)
image = tf.image.decode_jpeg(image, channels=3)
image = ... | 27.345455 | 128 | 0.655918 | 2,362 | 0.785239 | 0 | 0 | 0 | 0 | 0 | 0 | 406 | 0.134973 |
63e142b8a3ac1fd9757268f4acda900e7ecba57e | 3,668 | py | Python | ops/models/schedule.py | dengshaochun/devOps | 58b5a37918ffca3340aa535af670b805c19a87ec | [
"MIT"
] | null | null | null | ops/models/schedule.py | dengshaochun/devOps | 58b5a37918ffca3340aa535af670b805c19a87ec | [
"MIT"
] | 3 | 2020-06-05T19:01:02.000Z | 2021-09-23T23:22:32.000Z | ops/models/schedule.py | dengshaochun/ansibleX | 58b5a37918ffca3340aa535af670b805c19a87ec | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2018/11/15 10:51
# @Author : Dengsc
# @Site :
# @File : schedule.py
# @Software: PyCharm
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django_celery_beat.models import (CrontabSchedule, IntervalSchedule)
fro... | 37.428571 | 73 | 0.658942 | 3,174 | 0.865322 | 0 | 0 | 0 | 0 | 0 | 0 | 714 | 0.194656 |
63e2bca2d8584267cec472d15b17a95fc15a081c | 18,110 | py | Python | LAB4/bin/task_5.py | Yalfoosh/DUBUCE | 3f53923c27b1bce0ac592b20c5bb98649cb7fb75 | [
"Apache-2.0"
] | null | null | null | LAB4/bin/task_5.py | Yalfoosh/DUBUCE | 3f53923c27b1bce0ac592b20c5bb98649cb7fb75 | [
"Apache-2.0"
] | null | null | null | LAB4/bin/task_5.py | Yalfoosh/DUBUCE | 3f53923c27b1bce0ac592b20c5bb98649cb7fb75 | [
"Apache-2.0"
] | 1 | 2020-04-23T02:06:47.000Z | 2020-04-23T02:06:47.000Z | # Copyright 2020 Miljenko Šuflaj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 34.693487 | 80 | 0.533186 | 17,225 | 0.951079 | 0 | 0 | 852 | 0.047043 | 0 | 0 | 6,854 | 0.378444 |
63e352cd8b57ca9e170046df83f9f887ff2cb243 | 2,024 | py | Python | Main.py | ahmetmutlugun/clone_bot | ced61f9af626345753f0a7decc512a9f1d8a224b | [
"Apache-2.0"
] | null | null | null | Main.py | ahmetmutlugun/clone_bot | ced61f9af626345753f0a7decc512a9f1d8a224b | [
"Apache-2.0"
] | null | null | null | Main.py | ahmetmutlugun/clone_bot | ced61f9af626345753f0a7decc512a9f1d8a224b | [
"Apache-2.0"
] | null | null | null | import discord
from discord.ext import commands
from discord.ext.commands import Bot
client: Bot = commands.Bot(command_prefix=['-'], case_insensitive=True, description="Train an AI to send messages.")
guilds = []
guild_ids = []
@client.event
async def on_ready():
await client.change_presence(activity=discord.Ga... | 27.351351 | 116 | 0.628953 | 0 | 0 | 0 | 0 | 1,152 | 0.56917 | 1,024 | 0.505929 | 438 | 0.216403 |
63e40a9d8fa982ae7027fd1e676365c6c684bb99 | 6,920 | py | Python | tester/src/sirv_gnrl_fifo.py | giraffe50/RISCV-M4F | 1b1ed756a8ea02c2d2a11d8472f8603847170ad8 | [
"Apache-2.0"
] | 3 | 2021-01-13T03:41:14.000Z | 2021-03-23T11:31:48.000Z | tester/src/sirv_gnrl_fifo.py | scutdig/LG-32HP | 1b1ed756a8ea02c2d2a11d8472f8603847170ad8 | [
"Apache-2.0"
] | 1 | 2021-03-01T09:32:59.000Z | 2021-03-01T09:32:59.000Z | tester/src/sirv_gnrl_fifo.py | scutdig/LG-32HP | 1b1ed756a8ea02c2d2a11d8472f8603847170ad8 | [
"Apache-2.0"
] | 4 | 2021-01-07T03:01:26.000Z | 2021-02-28T02:20:10.000Z | from pyhcl import *
from .sirv_gnrl_dffl import sirv_gnrl_dffl
from .sirv_gnrl_dfflr import sirv_gnrl_dfflr
from .sirv_gnrl_dfflrs import sirv_gnrl_dfflrs
def carray(el, len):
ary = []
for i in range(len):
ary.append(el)
return ary
def sirv_gnrl_fifo(CUT_READY: int = 0,
... | 34.949495 | 117 | 0.434104 | 6,212 | 0.897688 | 0 | 0 | 0 | 0 | 0 | 0 | 1,348 | 0.194798 |
63e478f68db4b89cfa3ff715867177085fa62d17 | 6,600 | py | Python | data.py | QTIM-Lab/rop | 1befc7c2910daa151105fdd2f5fac785d0515f48 | [
"MIT"
] | 1 | 2021-07-29T15:51:35.000Z | 2021-07-29T15:51:35.000Z | data.py | QTIM-Lab/rop | 1befc7c2910daa151105fdd2f5fac785d0515f48 | [
"MIT"
] | null | null | null | data.py | QTIM-Lab/rop | 1befc7c2910daa151105fdd2f5fac785d0515f48 | [
"MIT"
] | null | null | null | # ==================================================================== #
# #
# DATASET / DATALOADER #
# #
# ==========================... | 37.288136 | 84 | 0.455152 | 5,012 | 0.759394 | 0 | 0 | 0 | 0 | 0 | 0 | 899 | 0.136212 |
63e53355de71c24919fc88789b079d2b1ce0b723 | 5,100 | py | Python | flask/app/main/routes.py | stevenbennettonline/ratemymolecule | 4591b2346743b9053ee1392f027d0b20d0f1da99 | [
"MIT"
] | 3 | 2021-06-16T00:27:45.000Z | 2022-01-11T13:23:06.000Z | flask/app/main/routes.py | stevenbennettonline/rate-my-molecule | 4591b2346743b9053ee1392f027d0b20d0f1da99 | [
"MIT"
] | 2 | 2021-06-16T08:41:58.000Z | 2021-06-16T08:42:05.000Z | flask/app/main/routes.py | stevenkbennett/ratemymolecule | 4591b2346743b9053ee1392f027d0b20d0f1da99 | [
"MIT"
] | null | null | null | from collections import Counter
import numpy as np
from flask import (Blueprint, flash, jsonify, redirect, render_template,
request, url_for)
from flask_login import current_user, login_required
from app import db
from app.auth.email import send_password_reset_email
from app.auth.forms import Reset... | 33.333333 | 78 | 0.647647 | 0 | 0 | 0 | 0 | 4,238 | 0.83098 | 0 | 0 | 1,299 | 0.254706 |
63e59bcf514276993297b798e6a593c65dcfaa90 | 101 | py | Python | backendcode/backendcode/meetingbotapi/apps.py | khadarkhaja/vergadering | c0e32868f9f66721c4d1ce4785a2c81f214cff0d | [
"Apache-2.0"
] | null | null | null | backendcode/backendcode/meetingbotapi/apps.py | khadarkhaja/vergadering | c0e32868f9f66721c4d1ce4785a2c81f214cff0d | [
"Apache-2.0"
] | 3 | 2020-06-05T17:52:31.000Z | 2021-06-10T20:01:01.000Z | backendcode/backendcode/meetingbotapi/apps.py | KhadarKR/vergadering | c0e32868f9f66721c4d1ce4785a2c81f214cff0d | [
"Apache-2.0"
] | 2 | 2018-03-09T16:07:53.000Z | 2018-03-09T16:23:49.000Z | from django.apps import AppConfig
class MeetingbotapiConfig(AppConfig):
name = 'meetingbotapi'
| 16.833333 | 37 | 0.782178 | 64 | 0.633663 | 0 | 0 | 0 | 0 | 0 | 0 | 15 | 0.148515 |
63e70797bb6533aa7af56d1402997865c1e22f00 | 5,762 | py | Python | tests/conftest.py | brighthive/convert_descriptor_to_swagger | ac59504ddf70622fb76e68b23dfdf4555836d3bd | [
"MIT"
] | null | null | null | tests/conftest.py | brighthive/convert_descriptor_to_swagger | ac59504ddf70622fb76e68b23dfdf4555836d3bd | [
"MIT"
] | 3 | 2019-12-10T19:47:39.000Z | 2019-12-20T19:11:59.000Z | tests/conftest.py | brighthive/convert_descriptor_to_swagger | ac59504ddf70622fb76e68b23dfdf4555836d3bd | [
"MIT"
] | 1 | 2020-04-29T18:18:49.000Z | 2020-04-29T18:18:49.000Z | import pytest
@pytest.fixture
def people_descriptor():
people_descriptor = {
"api": {
"resource": "people",
"methods": [
{
"get": {"enabled": True, "secured": False, "grants": ["get:users"]},
"post": {"enabled": True, "secured... | 37.174194 | 109 | 0.264665 | 0 | 0 | 0 | 0 | 5,742 | 0.996529 | 0 | 0 | 1,620 | 0.281152 |
63eafa1370aec52376e0eb5249d8c5a03ab04f00 | 3,652 | py | Python | fkie_node_manager_daemon/src/fkie_node_manager_daemon/exceptions.py | stertingen/multimaster_fkie | 95c2f5fae71c8337cc18b02db4e529b6900a91b2 | [
"BSD-3-Clause"
] | 1 | 2021-12-17T17:16:52.000Z | 2021-12-17T17:16:52.000Z | fkie_node_manager_daemon/src/fkie_node_manager_daemon/exceptions.py | stertingen/multimaster_fkie | 95c2f5fae71c8337cc18b02db4e529b6900a91b2 | [
"BSD-3-Clause"
] | null | null | null | fkie_node_manager_daemon/src/fkie_node_manager_daemon/exceptions.py | stertingen/multimaster_fkie | 95c2f5fae71c8337cc18b02db4e529b6900a91b2 | [
"BSD-3-Clause"
] | null | null | null | # Software License Agreement (BSD License)
#
# Copyright (c) 2018, Fraunhofer FKIE/CMS, Alexander Tiderko
# 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 mu... | 28.755906 | 93 | 0.705915 | 1,898 | 0.519715 | 0 | 0 | 0 | 0 | 0 | 0 | 1,671 | 0.457558 |
63ebf4963d4204c8dbbe68d7553ace82df66b666 | 27 | py | Python | robot2019-ros/tes.py | junhuizhou/ROS_Learning | bb3a0c867ba2bd147bbd59176cf1224c09a63914 | [
"MIT"
] | null | null | null | robot2019-ros/tes.py | junhuizhou/ROS_Learning | bb3a0c867ba2bd147bbd59176cf1224c09a63914 | [
"MIT"
] | 1 | 2021-05-07T07:30:11.000Z | 2021-05-07T07:30:11.000Z | robot2019-ros/tes.py | junhuizhou/ROS_Learning | bb3a0c867ba2bd147bbd59176cf1224c09a63914 | [
"MIT"
] | null | null | null | iii
fff
ff
qqqq
'fenzhi'
| 3.375 | 8 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 | 0.296296 |
63ebfe56217de2a71b781d285b140d7ffc405647 | 117 | py | Python | run.py | manugraj/ganimede | 2a9288d01768e09ef8f94252165960c78ab88df1 | [
"MIT"
] | 3 | 2021-06-23T06:08:58.000Z | 2022-01-15T20:56:54.000Z | run.py | manugraj/ganimede | 2a9288d01768e09ef8f94252165960c78ab88df1 | [
"MIT"
] | 2 | 2021-06-13T07:05:34.000Z | 2021-06-23T05:39:10.000Z | run.py | manugraj/ganimede | 2a9288d01768e09ef8f94252165960c78ab88df1 | [
"MIT"
] | 1 | 2022-02-01T08:32:59.000Z | 2022-02-01T08:32:59.000Z | import uvicorn
import src.main
if __name__ == '__main__':
uvicorn.run(src.main.app, host='0.0.0.0', port=8000)
| 16.714286 | 56 | 0.683761 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 19 | 0.162393 |
63ed2f6a1482852038d2f9ae5235dd2c3939a81d | 2,556 | py | Python | library/tutorial/06_module.py | gottaegbert/penter | 8cbb6be3c4bf67c7c69fa70e597bfbc3be4f0a2d | [
"MIT"
] | 13 | 2020-01-04T07:37:38.000Z | 2021-08-31T05:19:58.000Z | library/tutorial/06_module.py | gottaegbert/penter | 8cbb6be3c4bf67c7c69fa70e597bfbc3be4f0a2d | [
"MIT"
] | 3 | 2020-06-05T22:42:53.000Z | 2020-08-24T07:18:54.000Z | library/tutorial/06_module.py | gottaegbert/penter | 8cbb6be3c4bf67c7c69fa70e597bfbc3be4f0a2d | [
"MIT"
] | 9 | 2020-10-19T04:53:06.000Z | 2021-08-31T05:20:01.000Z | import importlib
import time
import fibo
# import fibo as fib
"""
注解 出于效率的考虑,每个模块在每个解释器会话中只被导入一次。因此,如果你更改了你的模块,则必须重新启动解释器,
或者,如果它只是一个要交互式地测试的模块,请使用 importlib.reload(),例如 import importlib; importlib.reload(modulename)
"""
fibo.fib(1000)
fibo.fib2(100)
print(fibo.__name__)
time.sleep(20) ## 去修改fibo.py ,能看到修改后的结果
import... | 29.045455 | 212 | 0.811424 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4,743 | 0.96051 |
63ed58034bda81cab21aa5f59eaa6d0ba9a403da | 319 | py | Python | adminmgr/media/code/python/map2/BD_014_025_183_mapper.py | IamMayankThakur/test-bigdata | cef633eb394419b955bdce479699d0115d8f99c3 | [
"Apache-2.0"
] | 9 | 2019-11-08T02:05:27.000Z | 2021-12-13T12:06:35.000Z | adminmgr/media/code/python/map2/BD_014_025_183_mapper.py | IamMayankThakur/test-bigdata | cef633eb394419b955bdce479699d0115d8f99c3 | [
"Apache-2.0"
] | 6 | 2019-11-27T03:23:16.000Z | 2021-06-10T19:15:13.000Z | adminmgr/media/code/python/map2/BD_014_025_183_mapper.py | IamMayankThakur/test-bigdata | cef633eb394419b955bdce479699d0115d8f99c3 | [
"Apache-2.0"
] | 4 | 2019-11-26T17:04:27.000Z | 2021-12-13T11:57:03.000Z | #!/usr/bin/python3
import csv
import sys
batsman = ""
bowler = ""
runs = None
reader = []
myfile = sys.stdin
for line in myfile:
line = line.strip()
row = line.split(',')
if(row[0] == "ball"):
batsman = row[4]
bowler = row[6]
runs = int(row[7]) + int(row[8])
print("%s,%s,%d" % (batsman, bowler, runs))
| 15.190476 | 45 | 0.583072 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 41 | 0.128527 |
63efa7f3316645c1c7ea8bae8301f606880ac73c | 240 | py | Python | Chapter 4/subscriber.py | PacktPublishing/Mastering-IPython-4 | d752f7ba38e0c9399a83d57da406fe26152f272b | [
"MIT"
] | 22 | 2016-06-07T07:52:35.000Z | 2021-11-08T13:12:21.000Z | Chapter 4/subscriber.py | PacktPublishing/Mastering-IPython-4 | d752f7ba38e0c9399a83d57da406fe26152f272b | [
"MIT"
] | 2 | 2016-05-23T08:20:54.000Z | 2018-07-02T08:21:32.000Z | Chapter 4/subscriber.py | PacktPublishing/Mastering-IPython-4 | d752f7ba38e0c9399a83d57da406fe26152f272b | [
"MIT"
] | 27 | 2016-05-23T08:19:51.000Z | 2021-08-31T02:46:00.000Z | import zmq
context = zmq.Context()
socket = context.socket(zmq.SUB)
socket.connect("tcp://localhost:5555")
socket.setsockopt_string(zmq.SUBSCRIBE, “weather”)
while True:
wtr = socket.recv_string()
print(“the weather is: “ + wtr)
| 20 | 50 | 0.7125 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 22 | 0.08871 |
63f00ee89c5fd40dc28452a69994969bb19dc442 | 6,876 | py | Python | packages/vaex-core/vaex/file/cache.py | lrq3000/vaex | 00c83d1fe2b73330705ef63e649abc9dfc8f2478 | [
"MIT"
] | null | null | null | packages/vaex-core/vaex/file/cache.py | lrq3000/vaex | 00c83d1fe2b73330705ef63e649abc9dfc8f2478 | [
"MIT"
] | null | null | null | packages/vaex-core/vaex/file/cache.py | lrq3000/vaex | 00c83d1fe2b73330705ef63e649abc9dfc8f2478 | [
"MIT"
] | null | null | null | try:
from urllib.parse import urlparse
except ImportError:
from urlparse import urlparse
import logging
import os
import mmap
import numpy as np
import vaex.utils
import vaex.file
DEFAULT_BLOCK_SIZE = 1024*1024*1 # 1mb by default
logger = logging.getLogger("vaex.file.cache")
class MMappedFile:
"""Sma... | 35.443299 | 133 | 0.596131 | 6,351 | 0.923647 | 0 | 0 | 0 | 0 | 0 | 0 | 1,004 | 0.146015 |