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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
230f2dcf82a79b046dcfaf9af3162a775c4bd915 | 1,198 | py | Python | test/minpwm.py | delijati/ultrabot | 37956187b3ed9a28ef655ab2ed064d11e5f29473 | [
"MIT"
] | 1 | 2016-12-06T01:25:03.000Z | 2016-12-06T01:25:03.000Z | test/minpwm.py | delijati/ultrabot | 37956187b3ed9a28ef655ab2ed064d11e5f29473 | [
"MIT"
] | null | null | null | test/minpwm.py | delijati/ultrabot | 37956187b3ed9a28ef655ab2ed064d11e5f29473 | [
"MIT"
] | null | null | null | import enc
import config
import motor
import threading
import time
enc_t = None
pwm_range = (50, 90)
class EncoderThread(enc.EncoderReader, threading.Thread):
def __init__(self):
enc.EncoderReader.__init__(self)
threading.Thread.__init__(self)
def main():
global enc_t
enc_t = EncoderTh... | 22.603774 | 62 | 0.537563 | 162 | 0.135225 | 0 | 0 | 0 | 0 | 0 | 0 | 124 | 0.103506 |
230f8a70cf89cd6ca954075bdfb7904ee2fe3de0 | 1,364 | py | Python | backend/apps/permissions/constants.py | hovedstyret/indok-web | 598e9ca0b5f3a5e776a85dec0a8694b9bcd5a159 | [
"MIT"
] | 3 | 2021-11-18T09:29:14.000Z | 2022-01-13T20:12:11.000Z | backend/apps/permissions/constants.py | rubberdok/indok-web | 598e9ca0b5f3a5e776a85dec0a8694b9bcd5a159 | [
"MIT"
] | 277 | 2022-01-17T18:16:44.000Z | 2022-03-31T19:44:04.000Z | backend/apps/permissions/constants.py | hovedstyret/indok-web | 598e9ca0b5f3a5e776a85dec0a8694b9bcd5a159 | [
"MIT"
] | null | null | null | from typing import Final, Literal
DefaultPermissionsType = Final[list[tuple[str, str]]]
# Default ResponsibleGroup types
PRIMARY_TYPE: Literal["PRIMARY"] = "PRIMARY"
HR_TYPE: Literal["HR"] = "HR"
ORGANIZATION: Final = "Organization member"
INDOK: Final = "Indøk"
REGISTERED_USER: Final = "Registered user"
PRIMARY_GRO... | 28.416667 | 63 | 0.692082 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 558 | 0.408791 |
230ffd138e6c0b442e53f396664bbe99fe6ff440 | 1,037 | py | Python | magda/utils/logger/printers/message.py | p-mielniczuk/magda | 6359fa5721b4e27bd98f2c6af0e858b476645618 | [
"Apache-2.0"
] | 8 | 2021-02-25T14:00:25.000Z | 2022-03-10T00:32:43.000Z | magda/utils/logger/printers/message.py | p-mielniczuk/magda | 6359fa5721b4e27bd98f2c6af0e858b476645618 | [
"Apache-2.0"
] | 22 | 2021-03-24T11:56:47.000Z | 2021-11-02T15:09:50.000Z | magda/utils/logger/printers/message.py | p-mielniczuk/magda | 6359fa5721b4e27bd98f2c6af0e858b476645618 | [
"Apache-2.0"
] | 6 | 2021-04-06T07:26:47.000Z | 2021-12-07T18:55:52.000Z | from __future__ import annotations
from typing import Optional
from colorama import Fore, Style
from magda.utils.logger.parts import LoggerParts
from magda.utils.logger.printers.base import BasePrinter
from magda.utils.logger.printers.shared import with_log_level_colors
class MessagePrinter(BasePrinter):
EVENT_S... | 30.5 | 75 | 0.657666 | 762 | 0.734812 | 0 | 0 | 0 | 0 | 0 | 0 | 62 | 0.059788 |
2311235022e84d72f4d0c26645f17bee8edd6070 | 1,615 | py | Python | statzcw/stats.py | xt0fer/Py21-BasicStats | 5e747765e58092d014fb36e66e2c4d623b1dbcba | [
"MIT"
] | null | null | null | statzcw/stats.py | xt0fer/Py21-BasicStats | 5e747765e58092d014fb36e66e2c4d623b1dbcba | [
"MIT"
] | null | null | null | statzcw/stats.py | xt0fer/Py21-BasicStats | 5e747765e58092d014fb36e66e2c4d623b1dbcba | [
"MIT"
] | 1 | 2021-07-11T14:50:21.000Z | 2021-07-11T14:50:21.000Z |
from typing import List
def zcount(list: List[float]) -> float:
return len(list)
# print("stats test")
# print("zcount should be 5 ==", zcount([1.0,2.0,3.0,4.0,5.0]))
def zmean(list: List[float]) -> float:
return sum(list) / zcount(list)
def zmode(list: List[float]) -> float:
return max(set(list), key... | 23.071429 | 63 | 0.577709 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 257 | 0.159133 |
2311a4831bf76119b74ab330fe6d74d995c77324 | 106 | py | Python | app/Mixtape.py | mlaude1/masonite_mixtapes | 37cc33bc04af6d626e5b65da9221ac848e996cf0 | [
"MIT"
] | null | null | null | app/Mixtape.py | mlaude1/masonite_mixtapes | 37cc33bc04af6d626e5b65da9221ac848e996cf0 | [
"MIT"
] | null | null | null | app/Mixtape.py | mlaude1/masonite_mixtapes | 37cc33bc04af6d626e5b65da9221ac848e996cf0 | [
"MIT"
] | null | null | null | """Mixtape Model."""
from masoniteorm.models import Model
class Mixtape(Model):
__table__="mixtape" | 15.142857 | 36 | 0.726415 | 45 | 0.424528 | 0 | 0 | 0 | 0 | 0 | 0 | 29 | 0.273585 |
23165b9f50977d462d02641d8468df5aa19bed3f | 10,872 | py | Python | priceprop/propagator.py | felixpatzelt/priceprop | 038832b5e89b8559c6162e39f1b446f4446fe7f2 | [
"MIT"
] | 17 | 2018-01-17T13:19:42.000Z | 2022-01-25T14:02:10.000Z | priceprop/propagator.py | felixpatzelt/priceprop | 038832b5e89b8559c6162e39f1b446f4446fe7f2 | [
"MIT"
] | null | null | null | priceprop/propagator.py | felixpatzelt/priceprop | 038832b5e89b8559c6162e39f1b446f4446fe7f2 | [
"MIT"
] | 7 | 2018-07-14T06:17:05.000Z | 2021-05-16T13:59:47.000Z | import numpy as np
from scipy.linalg import solve_toeplitz, solve
from scipy.signal import fftconvolve
from scipy.interpolate import Rbf
from scorr import xcorr, xcorr_grouped_df, xcorrshift, fftcrop, corr_mat
# Helpers
# =====================================================================
def integrate(x... | 30.2 | 79 | 0.545438 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6,632 | 0.610007 |
231680e3bbb8bd90319b6c531c7b915437fa932f | 661 | py | Python | src/code-challenges/codewars/7KYU/longest/test_longest.py | maltewirz/code-challenges | 97777b10963f19bc587ddd984f0526b221c081f8 | [
"MIT"
] | 1 | 2020-08-30T07:52:20.000Z | 2020-08-30T07:52:20.000Z | src/code-challenges/codewars/7KYU/longest/test_longest.py | maltewirz/code-challenges | 97777b10963f19bc587ddd984f0526b221c081f8 | [
"MIT"
] | 6 | 2020-08-12T07:05:04.000Z | 2021-08-23T06:10:10.000Z | src/code-challenges/codewars/7KYU/longest/test_longest.py | maltewirz/code-challenges | 97777b10963f19bc587ddd984f0526b221c081f8 | [
"MIT"
] | null | null | null | from longest import longest
import unittest
class Test(unittest.TestCase):
def test_1(self):
result = longest("aretheyhere", "yestheyarehere")
self.assertEqual(result, "aehrsty")
def test_2(self):
result = longest("loopingisfunbutdangerous", "lessdangerousthancoding")
self.ass... | 26.44 | 79 | 0.673222 | 565 | 0.854766 | 0 | 0 | 0 | 0 | 0 | 0 | 198 | 0.299546 |
2316d7baa946659edc0058ea0663bc1e4f77f7ab | 14 | py | Python | getv/__init__.py | FUNNYDMAN/getv | b0c495c9c9b9dea8bff86916aee85ecac4f505ab | [
"MIT"
] | 1 | 2018-08-07T18:50:43.000Z | 2018-08-07T18:50:43.000Z | getv/__init__.py | FUNNYDMAN/getv | b0c495c9c9b9dea8bff86916aee85ecac4f505ab | [
"MIT"
] | null | null | null | getv/__init__.py | FUNNYDMAN/getv | b0c495c9c9b9dea8bff86916aee85ecac4f505ab | [
"MIT"
] | null | null | null | name = "getv"
| 7 | 13 | 0.571429 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 | 0.428571 |
2317503e6a916f16a70dd2104fe9aa18b505c980 | 3,035 | py | Python | 2020/day16/day16.py | Zojka/advent | 0f967bf308ae0502db3656d2e9e8a0d310b00594 | [
"Apache-2.0"
] | 1 | 2020-12-16T20:34:30.000Z | 2020-12-16T20:34:30.000Z | 2020/day16/day16.py | Zojka/adventofcode | 0f967bf308ae0502db3656d2e9e8a0d310b00594 | [
"Apache-2.0"
] | null | null | null | 2020/day16/day16.py | Zojka/adventofcode | 0f967bf308ae0502db3656d2e9e8a0d310b00594 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@author: zparteka
"""
def read(infile):
with open(infile, 'r') as f:
line = f.readline()
rules = {}
while line != "\n":
rule = line.strip().split(':')
key = rule[0]
r1 = rule[1].split()[0].split("-")
... | 27.342342 | 119 | 0.497858 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 121 | 0.039868 |
231a46a705da24db623316f5754d9f510e7b8d96 | 1,527 | py | Python | api/views/user.py | jcasmer/grow_control_backend- | 6a18a137e0a16138607413925727d7e5f8486777 | [
"BSD-3-Clause"
] | 1 | 2019-05-11T14:45:47.000Z | 2019-05-11T14:45:47.000Z | api/views/user.py | jcasmer/grow_control_backend- | 6a18a137e0a16138607413925727d7e5f8486777 | [
"BSD-3-Clause"
] | 6 | 2021-03-18T20:45:02.000Z | 2021-09-22T17:41:38.000Z | api/views/user.py | jcasmer/grow_control_backend- | 6a18a137e0a16138607413925727d7e5f8486777 | [
"BSD-3-Clause"
] | null | null | null | '''
'''
from django.contrib.auth.models import User, Group
from rest_framework import status, viewsets
from rest_framework.exceptions import ValidationError
from rest_framework import mixins
from rest_framework.filters import OrderingFilter
from django_filters.rest_framework import DjangoFilterBackend
fr... | 31.8125 | 102 | 0.728225 | 1,038 | 0.679764 | 0 | 0 | 0 | 0 | 0 | 0 | 281 | 0.184021 |
231aa17295db10591d7e97d44c06178132b509d0 | 2,481 | py | Python | core/characters.py | gnbuck/rpg_game | a0e7a0d2002230d5628f7a811e831a36b0904d2c | [
"Apache-2.0"
] | null | null | null | core/characters.py | gnbuck/rpg_game | a0e7a0d2002230d5628f7a811e831a36b0904d2c | [
"Apache-2.0"
] | null | null | null | core/characters.py | gnbuck/rpg_game | a0e7a0d2002230d5628f7a811e831a36b0904d2c | [
"Apache-2.0"
] | null | null | null | from random import randint
from core.players import Players
class Human(Players):
def __init__(self, name, classe):
super().__init__(name, classe)
self.hp = 100
self.strengh = 15
self.defense = 15
self.speed = 50
def __str__(self, super_desc=None, super_stats=None):
... | 29.188235 | 128 | 0.583636 | 2,412 | 0.972189 | 0 | 0 | 0 | 0 | 0 | 0 | 514 | 0.207175 |
231b5c3a6ff047a112893a6a6f2da0e0da9bf4d4 | 1,893 | py | Python | raytracerchallenge_python/material.py | toku345/RayTracerChallenge_Python | 40ced097f92cc61b116d24c6d6c4f27d6b13029d | [
"MIT"
] | 1 | 2020-05-13T20:54:01.000Z | 2020-05-13T20:54:01.000Z | raytracerchallenge_python/material.py | toku345/RayTracerChallenge_Python | 40ced097f92cc61b116d24c6d6c4f27d6b13029d | [
"MIT"
] | null | null | null | raytracerchallenge_python/material.py | toku345/RayTracerChallenge_Python | 40ced097f92cc61b116d24c6d6c4f27d6b13029d | [
"MIT"
] | null | null | null | from raytracerchallenge_python.tuple import Color
from math import pow
class Material:
def __init__(self):
self.color = Color(1, 1, 1)
self.ambient = 0.1
self.diffuse = 0.9
self.specular = 0.9
self.shininess = 200.0
self.pattern = None
self.reflective = 0.0
... | 33.210526 | 77 | 0.56524 | 1,819 | 0.960909 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
231c19be88b4ad2d044eaa6cc1261367a03e271b | 673 | py | Python | dawgmon/local.py | anvilventures/dawgmon | 59c28f430d896aa5e7afd9c2f40584113e8d52dc | [
"BSD-3-Clause"
] | 54 | 2017-09-18T21:24:25.000Z | 2021-03-11T00:11:43.000Z | dawgmon/local.py | anvilventures/dawgmon | 59c28f430d896aa5e7afd9c2f40584113e8d52dc | [
"BSD-3-Clause"
] | null | null | null | dawgmon/local.py | anvilventures/dawgmon | 59c28f430d896aa5e7afd9c2f40584113e8d52dc | [
"BSD-3-Clause"
] | 8 | 2017-09-19T09:48:45.000Z | 2020-03-22T01:18:44.000Z | import subprocess, shlex
from dawgmon import commands
def local_run(dirname, commandlist):
for cmdname in commandlist:
cmd = commands.COMMAND_CACHE[cmdname]
# shell escape such that we can pass command properly onwards
# to the Popen call
cmd_to_execute = shlex.split(cmd.command)
p = subprocess.Popen(cmd_... | 32.047619 | 86 | 0.738484 | 0 | 0 | 617 | 0.91679 | 0 | 0 | 0 | 0 | 201 | 0.298663 |
231e10107f5e6e0ebcb3429683ae08fd50e51f90 | 162 | py | Python | collections/employee.py | learning-foundation/python-oo-ds | 58c212da4562f65f99c8df24bff7667744ea552b | [
"MIT"
] | null | null | null | collections/employee.py | learning-foundation/python-oo-ds | 58c212da4562f65f99c8df24bff7667744ea552b | [
"MIT"
] | null | null | null | collections/employee.py | learning-foundation/python-oo-ds | 58c212da4562f65f99c8df24bff7667744ea552b | [
"MIT"
] | null | null | null | class Employee():
def __init__(self, name, doc_number, salary):
self._name = name
self._doc_number = doc_number
self._salary = salary | 27 | 49 | 0.635802 | 162 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
231f0d4149a6494f0d37247083fc3c9b9526fe29 | 504 | py | Python | graphchart.py | hengloem/py-data-visualization | 181ff5db7ace8111508efc7d5c351839935d652e | [
"MIT"
] | null | null | null | graphchart.py | hengloem/py-data-visualization | 181ff5db7ace8111508efc7d5c351839935d652e | [
"MIT"
] | null | null | null | graphchart.py | hengloem/py-data-visualization | 181ff5db7ace8111508efc7d5c351839935d652e | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
years = [1950, 1955, 1960, 1965, 1970, 1975, 1980, 1985, 1990, 1995, 2000, 2005, 2010, 2015]
pops = [2.5, 2.7, 3, 3.3, 3.6, 4.0, 4.4, 4.8, 5.3, 5.7, 6.1, 6.5, 6.9, 7.3]
deaths = [1.2, 1.7, 1.8, 2.2, 2.5, 2.7, 2.9, 3, 3.1, 3.3, 3.5, 3.8, 4, 4.3]
plt.plot(years, pops, color=(255/255, 1... | 26.526316 | 92 | 0.605159 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 70 | 0.138889 |
231f6aa566919c06850651c755c3b8c14c876a0c | 38,747 | py | Python | py_knots/clasper.py | Chinmaya-Kausik/py_knots | 3c9930ea0e95f6c62da9e13eb5ffcfc0e0737f9f | [
"MIT"
] | null | null | null | py_knots/clasper.py | Chinmaya-Kausik/py_knots | 3c9930ea0e95f6c62da9e13eb5ffcfc0e0737f9f | [
"MIT"
] | null | null | null | py_knots/clasper.py | Chinmaya-Kausik/py_knots | 3c9930ea0e95f6c62da9e13eb5ffcfc0e0737f9f | [
"MIT"
] | null | null | null | import tkinter as tk
from tkinter import ttk
from matplotlib.pyplot import close
from matplotlib.figure import Figure
from matplotlib.backends.backend_tkagg import (FigureCanvasTkAgg,
NavigationToolbar2Tk)
from matplotlib.mathtext import math_to_image
from io import BytesIO
from PIL import ImageTk, Image
from sympy im... | 36.901905 | 83 | 0.596666 | 33,946 | 0.876094 | 0 | 0 | 0 | 0 | 0 | 0 | 7,630 | 0.196918 |
231f9bd0145ee2eafeef11269aea705cc5fa7a87 | 6,136 | py | Python | source/FnAssetAPI/Host.py | IngenuityEngine/ftrack-connect-foundry | a0d5ba788e3dc5c1536ebe9740bcf4393e3f5e1d | [
"MIT"
] | 1 | 2019-10-22T06:33:08.000Z | 2019-10-22T06:33:08.000Z | source/FnAssetAPI/Host.py | IngenuityEngine/ftrack-connect-foundry | a0d5ba788e3dc5c1536ebe9740bcf4393e3f5e1d | [
"MIT"
] | null | null | null | source/FnAssetAPI/Host.py | IngenuityEngine/ftrack-connect-foundry | a0d5ba788e3dc5c1536ebe9740bcf4393e3f5e1d | [
"MIT"
] | null | null | null | from .audit import auditApiCall
from .exceptions import InvalidCommand
__all__ = ['Host']
class Host(object):
"""
The Host provides an abstraction of the caller of API functions. Largely to
provide information about the Document state to the Manager, without
requiring specific knowledge of which host it is... | 25.355372 | 82 | 0.699641 | 6,035 | 0.98354 | 0 | 0 | 4,333 | 0.70616 | 0 | 0 | 5,011 | 0.816656 |
23203ffa2e49d090e30c618e5403e0af89df7c09 | 17,259 | py | Python | state_graph.py | Lukx19/KR-QR | be90434de57759e077bce208398ee12e8f1ec85a | [
"MIT"
] | null | null | null | state_graph.py | Lukx19/KR-QR | be90434de57759e077bce208398ee12e8f1ec85a | [
"MIT"
] | null | null | null | state_graph.py | Lukx19/KR-QR | be90434de57759e077bce208398ee12e8f1ec85a | [
"MIT"
] | null | null | null | import copy
import queue
import pydot
class NZP:
def __init__(self):
self.names = ['-', '0', '+']
self.vals = [-1, 0, 1]
self.stationary = [False, True, False]
class ZP:
def __init__(self):
self.names = ['0', '+']
self.vals = [0, 1]
self.stationary = [True, Fa... | 39.767281 | 143 | 0.576453 | 2,296 | 0.133032 | 0 | 0 | 0 | 0 | 0 | 0 | 5,479 | 0.317458 |
2321173b6cb9584852d15f26101b77960f964729 | 144 | py | Python | fhwebscrapers/__init__.py | dantas5/FinanceHub | 9691c9e10654c0608d1ca8c8798a5a26c227af87 | [
"MIT"
] | null | null | null | fhwebscrapers/__init__.py | dantas5/FinanceHub | 9691c9e10654c0608d1ca8c8798a5a26c227af87 | [
"MIT"
] | null | null | null | fhwebscrapers/__init__.py | dantas5/FinanceHub | 9691c9e10654c0608d1ca8c8798a5a26c227af87 | [
"MIT"
] | null | null | null | from fhwebscrapers.B3derivatives.curvasb3 import ScraperB3
from fhwebscrapers.CETIP.getcetipdata import CETIP
__all__ = ['ScraperB3', 'CETIP']
| 28.8 | 58 | 0.826389 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 18 | 0.125 |
23240f288abf89b78f596d8ce66de1c2719d6da7 | 43 | py | Python | app/data/__init__.py | codenio/cvcam | 4bfb16ae20375abee9dfdf0383c0df0bb5b31db7 | [
"MIT"
] | 2 | 2021-02-12T10:10:41.000Z | 2022-02-01T12:29:34.000Z | app/data/__init__.py | codenio/cvcam | 4bfb16ae20375abee9dfdf0383c0df0bb5b31db7 | [
"MIT"
] | null | null | null | app/data/__init__.py | codenio/cvcam | 4bfb16ae20375abee9dfdf0383c0df0bb5b31db7 | [
"MIT"
] | 1 | 2020-08-08T17:19:05.000Z | 2020-08-08T17:19:05.000Z | from .lite_data_store import LiteDataStore
| 21.5 | 42 | 0.883721 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2324184f8448361dc8a0618b5d05232be22a8ed2 | 6,040 | py | Python | service/logging.py | IIEG/employment-forecast-jalisco | 83de3bef5ad91706822ffa1e1d5b8b1c29e2f6c0 | [
"Apache-2.0"
] | null | null | null | service/logging.py | IIEG/employment-forecast-jalisco | 83de3bef5ad91706822ffa1e1d5b8b1c29e2f6c0 | [
"Apache-2.0"
] | 1 | 2021-06-01T22:29:58.000Z | 2021-06-01T22:29:58.000Z | service/logging.py | IIEG/employment-forecast-jalisco | 83de3bef5ad91706822ffa1e1d5b8b1c29e2f6c0 | [
"Apache-2.0"
] | null | null | null | from conf import settings
import pandas as pd
import numpy as np
import datetime
import os
def stringify_results(res, reg_conf, regression_key):
res_string = """
-------------------------------
{datetime}
SELECTED MODEL: {model}
Link Function (y-transform): {link}
Other Transformations (x-t... | 41.088435 | 108 | 0.654636 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,351 | 0.223675 |
23271db66f8bb4de60b78338e614df097d3bd2ec | 665 | py | Python | systemtools/test/clearterminaltest.py | hayj/SystemTools | 89c32c2cac843dfa2719f0ce37a0a52cda0b0c0b | [
"MIT"
] | 11 | 2018-08-10T00:55:20.000Z | 2022-02-11T13:34:06.000Z | systemtools/test/clearterminaltest.py | hayj/SystemTools | 89c32c2cac843dfa2719f0ce37a0a52cda0b0c0b | [
"MIT"
] | 5 | 2018-05-01T14:30:37.000Z | 2021-11-18T11:48:28.000Z | systemtools/test/clearterminaltest.py | hayj/SystemTools | 89c32c2cac843dfa2719f0ce37a0a52cda0b0c0b | [
"MIT"
] | 7 | 2019-08-16T13:32:19.000Z | 2022-01-27T10:51:19.000Z |
# print("aaaaaaaaaa bbbbbbbbbb")
# # print(chr(27) + "[2J")
import os
import sys
from enum import Enum
import signal
print(getOutputType())
exit()
# import os
# os.system('cls' if os.name == 'nt' else 'clear')
size = os.get_terminal_size()
print(size[0])
if signal.getsignal(signal.SIGHUP) == signal.SIG_DFL... | 14.777778 | 71 | 0.645113 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 255 | 0.383459 |
23273537cf14476c6fb5136eab49c7351f22035d | 7,674 | py | Python | polytrack/deep_learning.py | malikaratnayake/Polytrack2.0 | 4ce45f26823c6ac63469112954fa23ed5ffd04bc | [
"MIT"
] | 1 | 2022-03-24T07:06:37.000Z | 2022-03-24T07:06:37.000Z | polytrack/deep_learning.py | malikaratnayake/Polytrack2.0 | 4ce45f26823c6ac63469112954fa23ed5ffd04bc | [
"MIT"
] | null | null | null | polytrack/deep_learning.py | malikaratnayake/Polytrack2.0 | 4ce45f26823c6ac63469112954fa23ed5ffd04bc | [
"MIT"
] | null | null | null | import os
import time
import cv2
import random
import colorsys
import numpy as np
import tensorflow as tf
import pytesseract
import core.utils as utils
from core.config import cfg
import re
from PIL import Image
from polytrack.general import cal_dist
import itertools as it
import math
# import tensorflow as tf
physica... | 33.365217 | 130 | 0.690253 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,119 | 0.145817 |
2327a93cda5f2e2914fc9a547155549bead73408 | 765 | py | Python | pypi_uploader/setup.py | p-geon/DockerBonsai | 1b1deafe228438e5ce3b4a41026aef4748f98573 | [
"MIT"
] | 1 | 2021-11-28T13:27:41.000Z | 2021-11-28T13:27:41.000Z | docker-pypi_uploader/setup.py | p-geon/DockerBonsai | 1b1deafe228438e5ce3b4a41026aef4748f98573 | [
"MIT"
] | 8 | 2021-02-19T12:54:22.000Z | 2021-02-25T02:32:23.000Z | pypi_uploader/setup.py | p-geon/DockerBonsai | 1b1deafe228438e5ce3b4a41026aef4748f98573 | [
"MIT"
] | null | null | null | from setuptools import setup
from codecs import open
from os import path
NAME_REPO="imagechain"
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name=NAME_REPO,
packages=[NAME_REPO],
version='0.1',
lice... | 25.5 | 63 | 0.673203 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 239 | 0.312418 |
232912e4c2ce40a26c2b13a2ea3b4a25afdd40e1 | 3,077 | py | Python | bookstoreapp/forms.py | Timoh97/SMART-READERS | 99ff765d156b3a40698a6d0c9137f8afa03544ac | [
"MIT"
] | null | null | null | bookstoreapp/forms.py | Timoh97/SMART-READERS | 99ff765d156b3a40698a6d0c9137f8afa03544ac | [
"MIT"
] | null | null | null | bookstoreapp/forms.py | Timoh97/SMART-READERS | 99ff765d156b3a40698a6d0c9137f8afa03544ac | [
"MIT"
] | 1 | 2022-01-14T10:26:35.000Z | 2022-01-14T10:26:35.000Z | from django import forms
from .models import *
from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.db import transaction
from bookstoreapp.models import *
#ordersystem
from django import forms
# from django.contrib.auth.models import User
from django.contrib.auth import get_user... | 39.961039 | 165 | 0.675333 | 410 | 0.133247 | 0 | 0 | 0 | 0 | 0 | 0 | 2,369 | 0.769906 |
23294fabdcf63ba5d2ca1685c4bb3c0849350f0e | 207 | py | Python | game_test.py | jakub530/PyGame-Neural-Net | 6f592ee97d97470cddc6599203c9a5d9759905c4 | [
"MIT"
] | null | null | null | game_test.py | jakub530/PyGame-Neural-Net | 6f592ee97d97470cddc6599203c9a5d9759905c4 | [
"MIT"
] | null | null | null | game_test.py | jakub530/PyGame-Neural-Net | 6f592ee97d97470cddc6599203c9a5d9759905c4 | [
"MIT"
] | null | null | null | import sys, pygame,math
import numpy as np
from pygame import gfxdraw
import pygame_lib, nn_lib
import pygame.freetype
from pygame_lib import color
import random
import copy
import auto_maze
import node_vis | 20.7 | 28 | 0.845411 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
232aa5dcc39387e06484add60fa99039e0f84ed2 | 563 | py | Python | uaa_bot/config.py | cloud-gov/uaa-bot | d2191621d364ce0fe4804283243a5195cfe84c7a | [
"CC0-1.0"
] | 1 | 2021-03-27T21:34:28.000Z | 2021-03-27T21:34:28.000Z | uaa_bot/config.py | cloud-gov/uaa-bot | d2191621d364ce0fe4804283243a5195cfe84c7a | [
"CC0-1.0"
] | 4 | 2021-02-11T18:02:16.000Z | 2022-02-23T18:55:11.000Z | uaa_bot/config.py | cloud-gov/uaa-bot | d2191621d364ce0fe4804283243a5195cfe84c7a | [
"CC0-1.0"
] | null | null | null | import os
def parse_config_env(default_dict):
config_dict = {}
for key, value in default_dict.items():
config_dict[key] = os.environ.get(key, value)
return config_dict
SMTP_KEYS = {
"SMTP_HOST": "localhost",
"SMTP_PORT": 25,
"SMTP_FROM": "[email protected]",
"SMTP_USER": Non... | 18.766667 | 53 | 0.651865 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 174 | 0.309059 |
232aa8e2e7ba295ede12f5cba7bf5a933e010de8 | 31,253 | py | Python | pytest_docker_registry_fixtures/fixtures.py | crashvb/pytest-docker-registry-fixtures | aab57393f8478982751da140e259eb4bf81869a7 | [
"Apache-2.0"
] | null | null | null | pytest_docker_registry_fixtures/fixtures.py | crashvb/pytest-docker-registry-fixtures | aab57393f8478982751da140e259eb4bf81869a7 | [
"Apache-2.0"
] | 1 | 2021-02-17T04:23:09.000Z | 2021-02-17T04:29:22.000Z | pytest_docker_registry_fixtures/fixtures.py | crashvb/pytest-docker-registry-fixtures | aab57393f8478982751da140e259eb4bf81869a7 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# pylint: disable=redefined-outer-name,too-many-arguments,too-many-locals
"""The actual fixtures, you found them ;)."""
import logging
import itertools
from base64 import b64encode
from distutils.util import strtobool
from functools import partial
from pathlib import Path
from ssl import creat... | 35.964327 | 118 | 0.696381 | 764 | 0.024446 | 21,836 | 0.698685 | 12,915 | 0.41324 | 0 | 0 | 7,103 | 0.227274 |
232ab34c654fc84b1b9af2251151c7a436bd3f09 | 1,346 | py | Python | TcpServer.py | WinHtut/BootCampPython-1 | c784a23d73304f328b8d6a1e29a1c43e6b6c44c7 | [
"MIT"
] | null | null | null | TcpServer.py | WinHtut/BootCampPython-1 | c784a23d73304f328b8d6a1e29a1c43e6b6c44c7 | [
"MIT"
] | null | null | null | TcpServer.py | WinHtut/BootCampPython-1 | c784a23d73304f328b8d6a1e29a1c43e6b6c44c7 | [
"MIT"
] | 1 | 2021-12-04T16:08:17.000Z | 2021-12-04T16:08:17.000Z | import socket
import threading
import FetchData
class TCPserver():
def __init__(self):
self.server_ip="localhost"
self.server_port=9998
def main(self):
server = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
server.bind((self.server_ip,self.server_port))
s... | 32.829268 | 90 | 0.616642 | 1,194 | 0.887073 | 0 | 0 | 0 | 0 | 0 | 0 | 181 | 0.134473 |
232aee5e5c70b6ac013e320c3a04f48e6af0f6b1 | 11,122 | py | Python | Jump_Trend_labeling/Trend/jump.py | anakinanakin/neural-network-on-finance-data | 1842606294ca3d5dafa7387d6db95a1c21d323eb | [
"MIT"
] | 1 | 2021-05-11T09:11:53.000Z | 2021-05-11T09:11:53.000Z | Jump_Trend_labeling/Trend/jump.py | anakinanakin/neural-network-on-finance-data | 1842606294ca3d5dafa7387d6db95a1c21d323eb | [
"MIT"
] | null | null | null | Jump_Trend_labeling/Trend/jump.py | anakinanakin/neural-network-on-finance-data | 1842606294ca3d5dafa7387d6db95a1c21d323eb | [
"MIT"
] | 1 | 2020-07-28T03:59:31.000Z | 2020-07-28T03:59:31.000Z | #source code: https://github.com/alvarobartt/trendet
import psycopg2, psycopg2.extras
import os
import glob
import csv
import time
import datetime
import string
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from matplotlib import patches
from matplotlib.pyplot import fi... | 31.68661 | 130 | 0.573368 | 0 | 0 | 133 | 0.011958 | 0 | 0 | 0 | 0 | 3,773 | 0.339238 |
232b1b1f6f79d295bdbc4ebfd2816a9b3a19da6b | 257 | py | Python | demo/examples/sum._keras-text-summarization/src/summarizer/src/algo/abstract_summarizer_algo.py | YourNorth/rezak-summarizator | 3ab2f4bf1044ea9654b4084a39030987e4b8bfe8 | [
"MIT"
] | 3 | 2020-03-28T16:48:10.000Z | 2020-12-01T17:18:55.000Z | demo/examples/sum._keras-text-summarization/src/summarizer/src/algo/abstract_summarizer_algo.py | YourNorth/rezak-summarizator | 3ab2f4bf1044ea9654b4084a39030987e4b8bfe8 | [
"MIT"
] | 31 | 2020-03-20T17:53:08.000Z | 2021-03-10T11:48:11.000Z | demo/examples/sum._keras-text-summarization/src/summarizer/src/algo/abstract_summarizer_algo.py | YourNorth/rezak-summarizator | 3ab2f4bf1044ea9654b4084a39030987e4b8bfe8 | [
"MIT"
] | 1 | 2020-03-20T05:01:16.000Z | 2020-03-20T05:01:16.000Z | class AbstractSummarizerAlgo(object):
"""
AbstractSummarizerAlgo defines the run method that every text summarization must implement.
"""
def run(self, text, percentage):
raise NotImplementedError('Subclasses must override run()!')
| 32.125 | 95 | 0.723735 | 256 | 0.996109 | 0 | 0 | 0 | 0 | 0 | 0 | 140 | 0.544747 |
232d44b9e301f131b81fce59b6e44322f7b61b53 | 978 | py | Python | dmatrix.py | sanchitcop19/redHackProject | 16f8d2e2a675dc5bd370e28ab5880a6b1f113a2d | [
"Apache-2.0"
] | null | null | null | dmatrix.py | sanchitcop19/redHackProject | 16f8d2e2a675dc5bd370e28ab5880a6b1f113a2d | [
"Apache-2.0"
] | 1 | 2021-06-02T00:26:30.000Z | 2021-06-02T00:26:30.000Z | dmatrix.py | sanchitcop19/redHackProject | 16f8d2e2a675dc5bd370e28ab5880a6b1f113a2d | [
"Apache-2.0"
] | 1 | 2019-09-22T08:46:11.000Z | 2019-09-22T08:46:11.000Z | import requests
import json
content = None
with open("scored_output.json") as file:
content = json.load(file)
matrix = [[0 for i in range(len(content))] for j in range(len(content))]
mapping = {}
for i, origin in enumerate(content):
mapping[i] = origin
for j, destination in enumerate(content):
pr... | 30.5625 | 211 | 0.603272 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 243 | 0.248466 |
232d65d107c7ac95d64e3240caf376ce0bbcff3f | 2,416 | py | Python | src/SetExpan/util.py | jmshen1994/SetExpan | d725bb9896c45478217294d188fafaea56660858 | [
"Apache-2.0"
] | 36 | 2017-11-08T01:54:43.000Z | 2021-08-04T08:26:54.000Z | src/SetExpan/util.py | mickeystroller/SetExpan | d725bb9896c45478217294d188fafaea56660858 | [
"Apache-2.0"
] | 4 | 2017-10-30T19:47:14.000Z | 2018-11-22T02:51:55.000Z | src/SetExpan/util.py | mickeystroller/SetExpan | d725bb9896c45478217294d188fafaea56660858 | [
"Apache-2.0"
] | 10 | 2017-11-10T03:50:54.000Z | 2020-12-16T19:52:29.000Z | '''
__author__: Ellen Wu (modified by Jiaming Shen)
__description__: A bunch of utility functions
__latest_update__: 08/31/2017
'''
from collections import defaultdict
import set_expan
import eid_pair_TFIDF_selection
import extract_seed_edges
import extract_entity_pair_skipgrams
def loadEidToEntityMap(filename):
eid... | 30.974359 | 68 | 0.68005 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 495 | 0.204884 |
232e28fbfd431f5f262b4d4fadc8f82e257b7c68 | 534 | py | Python | solutions/container-generator.py | hydrargyrum/python-exercises | f99889d18179dce45956ce68382e37a987c8f460 | [
"Unlicense"
] | null | null | null | solutions/container-generator.py | hydrargyrum/python-exercises | f99889d18179dce45956ce68382e37a987c8f460 | [
"Unlicense"
] | null | null | null | solutions/container-generator.py | hydrargyrum/python-exercises | f99889d18179dce45956ce68382e37a987c8f460 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env pytest-3
import pytest
# Exercice: iter
def multiples_of(n):
i = 0
while True:
yield i
i += n
# test
def test_iter():
gen = multiples_of(3)
for n, mult in enumerate(gen):
assert n * 3 == mult
if n >= 100:
break
for n, mult in enumerat... | 16.181818 | 36 | 0.488764 | 0 | 0 | 77 | 0.144195 | 0 | 0 | 0 | 0 | 45 | 0.08427 |
23300efdd697b2575e312f7edd92461f467cdc9c | 161 | py | Python | src/onegov/gis/forms/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/gis/forms/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/gis/forms/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.gis.forms.fields import CoordinatesField
from onegov.gis.forms.widgets import CoordinatesWidget
__all__ = ['CoordinatesField', 'CoordinatesWidget']
| 32.2 | 54 | 0.832298 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 37 | 0.229814 |
2330a75a4af76c6269b983247c9bbf1f53e9a024 | 8,468 | py | Python | pds_github_util/plan/plan.py | NASA-PDS/pds-github-util | 155f60532a02bcbc7a9664b8a170a2e7ab0463d1 | [
"Apache-2.0"
] | null | null | null | pds_github_util/plan/plan.py | NASA-PDS/pds-github-util | 155f60532a02bcbc7a9664b8a170a2e7ab0463d1 | [
"Apache-2.0"
] | 42 | 2020-09-17T17:30:40.000Z | 2022-03-31T21:09:19.000Z | pds_github_util/plan/plan.py | NASA-PDS/pds-github-util | 155f60532a02bcbc7a9664b8a170a2e7ab0463d1 | [
"Apache-2.0"
] | 3 | 2020-08-12T23:02:40.000Z | 2021-09-30T11:57:59.000Z | """Release Planning."""
import argparse
import github3
import logging
import os
import sys
import traceback
from pds_github_util.issues.utils import get_labels, is_theme
from pds_github_util.zenhub.zenhub import Zenhub
from pds_github_util.utils import GithubConnection, addStandardArguments
from pkg_resources import... | 36.978166 | 164 | 0.535782 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,872 | 0.339159 |
23341f5ed2859fb2d6684316810220212f51ba71 | 612 | py | Python | users/models.py | nimbustan/Otozi | 69d2ff734da05ffdf87936b44a86f4ca00f1ca7a | [
"MIT"
] | null | null | null | users/models.py | nimbustan/Otozi | 69d2ff734da05ffdf87936b44a86f4ca00f1ca7a | [
"MIT"
] | null | null | null | users/models.py | nimbustan/Otozi | 69d2ff734da05ffdf87936b44a86f4ca00f1ca7a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.auth.models import AbstractUser
from django.db import models
# Create your models here.
class User(AbstractUser):
"""
Bu model kullanıcılar için kullanılacaktır.
"""
adres = models.CharField(max_length=255, null=True... | 32.210526 | 110 | 0.727124 | 442 | 0.71637 | 0 | 0 | 0 | 0 | 0 | 0 | 172 | 0.278768 |
233559cbbce20a6e666ce90f9a2459c195da1807 | 19,404 | py | Python | Veerappan_bnfo601_exam2/Veerappan_BLAST_prot.py | aravindvrm/bnfo | a6d33b197626fdb753e256b7c38bd923c9c6ae99 | [
"MIT"
] | null | null | null | Veerappan_bnfo601_exam2/Veerappan_BLAST_prot.py | aravindvrm/bnfo | a6d33b197626fdb753e256b7c38bd923c9c6ae99 | [
"MIT"
] | null | null | null | Veerappan_bnfo601_exam2/Veerappan_BLAST_prot.py | aravindvrm/bnfo | a6d33b197626fdb753e256b7c38bd923c9c6ae99 | [
"MIT"
] | null | null | null | """
Aravind Veerappan
BNFO 601 - Exam 2
Question 2. Protein BLAST
"""
import math
from PAM import PAM
class BLAST(object):
FORWARD = 1 # These are class variables shared by all instances of the BLAST class
BACKWARD = -1
ROW = (0, 1)
COLUMN = (1, 0)
def __init__(self, query=None,... | 48.148883 | 121 | 0.619408 | 19,037 | 0.981086 | 0 | 0 | 0 | 0 | 0 | 0 | 9,482 | 0.488662 |
2337364c0621a583c614f2512a6c4987548f574f | 437 | py | Python | leetcode/python/happy_number.py | haonancool/OnlineJudge | 43e9e7fb30ed1ed80c08ef54d32aaa6ae5652064 | [
"Apache-2.0"
] | null | null | null | leetcode/python/happy_number.py | haonancool/OnlineJudge | 43e9e7fb30ed1ed80c08ef54d32aaa6ae5652064 | [
"Apache-2.0"
] | null | null | null | leetcode/python/happy_number.py | haonancool/OnlineJudge | 43e9e7fb30ed1ed80c08ef54d32aaa6ae5652064 | [
"Apache-2.0"
] | null | null | null | class Solution(object):
def isHappy(self, n):
"""
:type n: int
:rtype: bool
"""
table = set()
while n != 1:
if n in table:
return False
else:
table.add(n)
sum = 0
while n > 0:
... | 23 | 34 | 0.340961 | 437 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 57 | 0.130435 |
233829e027347a91a2e7a94f36a3b2dffcb111ee | 68 | py | Python | Mundo01/Python/aula06b.py | molonti/CursoemVideo---Python | 4f6a7af648f7f619d11e95fa3dc7a33b28fcfa11 | [
"MIT"
] | null | null | null | Mundo01/Python/aula06b.py | molonti/CursoemVideo---Python | 4f6a7af648f7f619d11e95fa3dc7a33b28fcfa11 | [
"MIT"
] | null | null | null | Mundo01/Python/aula06b.py | molonti/CursoemVideo---Python | 4f6a7af648f7f619d11e95fa3dc7a33b28fcfa11 | [
"MIT"
] | null | null | null | n = input('Digite um algo: ')
print(n.isalpha())
print(n.isupper())
| 17 | 29 | 0.647059 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 18 | 0.264706 |
2338e51f497f2917867ef18cfad79cfe5635f3ea | 717 | py | Python | setup.py | DigiKlausur/ilias2nbgrader | ef6b14969ce73f8203aa125175915f76f07c8e43 | [
"MIT"
] | 4 | 2020-01-17T08:39:00.000Z | 2021-12-13T13:54:14.000Z | setup.py | DigiKlausur/ilias2nbgrader | ef6b14969ce73f8203aa125175915f76f07c8e43 | [
"MIT"
] | 12 | 2020-01-24T14:52:35.000Z | 2020-05-26T15:34:20.000Z | setup.py | DigiKlausur/ilias2nbgrader | ef6b14969ce73f8203aa125175915f76f07c8e43 | [
"MIT"
] | 1 | 2020-03-23T17:16:06.000Z | 2020-03-23T17:16:06.000Z | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
with open('README.md') as f:
readme = f.read()
setup(
name='ilias2nbgrader',
version='0.4.3',
license='MIT',
url='https://github.com/DigiKlausur/ilias2nbgrader',
description='Exchange submissions and feedbacks between ILIAS an... | 26.555556 | 80 | 0.668061 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 275 | 0.383543 |
23395cc50637ff5b0993e2601b07c4a0ab09d8ac | 2,343 | py | Python | citrees/utils.py | m0hashi/citrees | e7d4866109ce357d5d67cffa450604567f7b469e | [
"MIT"
] | null | null | null | citrees/utils.py | m0hashi/citrees | e7d4866109ce357d5d67cffa450604567f7b469e | [
"MIT"
] | null | null | null | citrees/utils.py | m0hashi/citrees | e7d4866109ce357d5d67cffa450604567f7b469e | [
"MIT"
] | null | null | null | from __future__ import absolute_import, print_function
from numba import jit
import numpy as np
# from externals.six.moves import range
def bayes_boot_probs(n):
"""Bayesian bootstrap sampling for case weights
Parameters
----------
n : int
Number of Bayesian bootstrap samples
Re... | 24.154639 | 74 | 0.599659 | 0 | 0 | 0 | 0 | 382 | 0.163039 | 0 | 0 | 1,299 | 0.554417 |
233b1c9f4e244ac8cb55094347c4c0772dd724da | 4,820 | py | Python | blog/views.py | arascch/Django_blog | 091a5a4974534fbe37560bd8e451716a3b1bdcbf | [
"Apache-2.0"
] | 1 | 2019-03-04T15:02:03.000Z | 2019-03-04T15:02:03.000Z | blog/views.py | arascch/Django_blog | 091a5a4974534fbe37560bd8e451716a3b1bdcbf | [
"Apache-2.0"
] | null | null | null | blog/views.py | arascch/Django_blog | 091a5a4974534fbe37560bd8e451716a3b1bdcbf | [
"Apache-2.0"
] | null | null | null | from django.shortcuts import render, get_object_or_404
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.views.generic import ListView
from .models import Post , Comment
from .forms import EmailPostForm , CommentForm , SearchForm
from django.core.mail import send_mail
from taggit.mod... | 40.504202 | 122 | 0.567427 | 161 | 0.033402 | 0 | 0 | 0 | 0 | 0 | 0 | 795 | 0.164938 |
233d6f3fd59520be733341519e2ee7dc3d18d10a | 2,424 | py | Python | StudentAssociation/tasks.py | codertimeless/StudentAssociation | 3f6caf2b362623d4f8cf82bab9529951a375fe6a | [
"Apache-2.0"
] | null | null | null | StudentAssociation/tasks.py | codertimeless/StudentAssociation | 3f6caf2b362623d4f8cf82bab9529951a375fe6a | [
"Apache-2.0"
] | 15 | 2020-03-09T11:56:13.000Z | 2022-02-10T15:03:01.000Z | StudentAssociation/tasks.py | codertimeless/StudentAssociation | 3f6caf2b362623d4f8cf82bab9529951a375fe6a | [
"Apache-2.0"
] | null | null | null | from django.utils import timezone
from django.db.models import Q
from celery.decorators import task, periodic_task
from celery.utils.log import get_task_logger
from celery.task.schedules import crontab
from accounts.models.user_profile import ClubUserProfile
from management.models.activity_apply import ActivityApplica... | 39.737705 | 108 | 0.667904 | 0 | 0 | 0 | 0 | 2,161 | 0.812406 | 0 | 0 | 435 | 0.163534 |
233dd3a1892a3e39ce7f0e1314827e36c01fc57e | 433 | py | Python | streaming/take_picture.py | jsse-2017-ph23/rpi-streaming | a701e6bc818b24b880a409db65b43a43e78259f8 | [
"MIT"
] | 1 | 2017-08-25T08:31:01.000Z | 2017-08-25T08:31:01.000Z | streaming/take_picture.py | jsse-2017-ph23/rpi-streaming | a701e6bc818b24b880a409db65b43a43e78259f8 | [
"MIT"
] | null | null | null | streaming/take_picture.py | jsse-2017-ph23/rpi-streaming | a701e6bc818b24b880a409db65b43a43e78259f8 | [
"MIT"
] | null | null | null | import threading
from datetime import datetime
from io import BytesIO
capture_lock = threading.Lock()
def take_picture(camera):
# Create an in-memory stream
stream = BytesIO()
camera.rotation = 180
camera.annotate_text = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
with capture_lock:
cam... | 22.789474 | 71 | 0.678984 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 53 | 0.122402 |
233e938c1235975c31635e57391932a8a3358fab | 692 | py | Python | tests/tf_tests/functional/test_tf_inference.py | Deeplite/deeplite-profiler | 2b21c0dc5948606c47377f786b605baf4fa31bee | [
"Apache-2.0"
] | 17 | 2021-04-13T06:09:52.000Z | 2021-11-24T06:39:41.000Z | tests/tf_tests/functional/test_tf_inference.py | Deeplite/deeplite-profiler | 2b21c0dc5948606c47377f786b605baf4fa31bee | [
"Apache-2.0"
] | 14 | 2021-04-14T13:46:42.000Z | 2021-12-20T21:10:25.000Z | tests/tf_tests/functional/test_tf_inference.py | Deeplite/deeplite-profiler | 2b21c0dc5948606c47377f786b605baf4fa31bee | [
"Apache-2.0"
] | 7 | 2021-04-09T16:47:56.000Z | 2022-03-05T11:04:30.000Z | import pytest
from tests.tf_tests.functional import BaseFunctionalTest, TENSORFLOW_SUPPORTED, TENSORFLOW_AVAILABLE, MODEL, DATA
class TestTFInference(BaseFunctionalTest):
def test_get_acc(self):
from deeplite.tf_profiler.tf_inference import get_accuracy
assert get_accuracy(MODEL, DATA['test']) < 10... | 36.421053 | 113 | 0.728324 | 560 | 0.809249 | 0 | 0 | 0 | 0 | 0 | 0 | 24 | 0.034682 |
233ed42bf0115e5edc1f5fad0d0fd1255e0ee7ed | 24,372 | py | Python | model.py | jgasthaus/gpu_python | ae044d616e22cfa10479bd5717148e91cdca5bb5 | [
"BSD-2-Clause"
] | 1 | 2016-01-27T21:52:54.000Z | 2016-01-27T21:52:54.000Z | model.py | jgasthaus/gpu_python | ae044d616e22cfa10479bd5717148e91cdca5bb5 | [
"BSD-2-Clause"
] | null | null | null | model.py | jgasthaus/gpu_python | ae044d616e22cfa10479bd5717148e91cdca5bb5 | [
"BSD-2-Clause"
] | null | null | null | # Copyright (c) 2008-2011, Jan Gasthaus
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions... | 38.260597 | 81 | 0.575127 | 22,898 | 0.939521 | 0 | 0 | 0 | 0 | 0 | 0 | 6,169 | 0.253118 |
233ff6c005185d4e5c1c1893c6042a130f890b7d | 343 | py | Python | nadlogar/documents/migrations/0007_remove_documentsort_html_fragment.py | ul-fmf/nadlogar | 4b3eb4dd0be7dba20a075b2e4bd425ffc64756e3 | [
"MIT"
] | 9 | 2019-12-19T12:11:58.000Z | 2022-02-01T15:00:16.000Z | nadlogar/documents/migrations/0007_remove_documentsort_html_fragment.py | ul-fmf/nadlogar | 4b3eb4dd0be7dba20a075b2e4bd425ffc64756e3 | [
"MIT"
] | 58 | 2019-12-18T15:07:17.000Z | 2022-01-04T12:21:44.000Z | nadlogar/documents/migrations/0007_remove_documentsort_html_fragment.py | ul-fmf/nadlogar | 4b3eb4dd0be7dba20a075b2e4bd425ffc64756e3 | [
"MIT"
] | 7 | 2019-12-18T13:29:37.000Z | 2021-07-17T13:01:30.000Z | # Generated by Django 3.2.6 on 2021-09-24 07:53
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("documents", "0006_auto_20210924_0613"),
]
operations = [
migrations.RemoveField(
model_name="documentsort",
name="html_fragm... | 19.055556 | 49 | 0.609329 | 258 | 0.752187 | 0 | 0 | 0 | 0 | 0 | 0 | 112 | 0.326531 |
2340ff27f70c0f25fa92baa0c7cf6b801391d2c6 | 8,061 | py | Python | src/bin/shipyard_airflow/shipyard_airflow/plugins/deployment_status_operator.py | rb560u/airship-shipyard | 01b6960c1f80b44d1db31c081139649c40b82308 | [
"Apache-2.0"
] | 12 | 2018-05-18T18:59:23.000Z | 2019-05-10T12:31:44.000Z | src/bin/shipyard_airflow/shipyard_airflow/plugins/deployment_status_operator.py | rb560u/airship-shipyard | 01b6960c1f80b44d1db31c081139649c40b82308 | [
"Apache-2.0"
] | 4 | 2021-07-28T14:36:57.000Z | 2022-03-22T16:39:23.000Z | src/bin/shipyard_airflow/shipyard_airflow/plugins/deployment_status_operator.py | rb560u/airship-shipyard | 01b6960c1f80b44d1db31c081139649c40b82308 | [
"Apache-2.0"
] | 9 | 2018-05-18T16:42:41.000Z | 2019-04-18T20:12:14.000Z | # Copyright 2019 AT&T Intellectual Property. All other rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | 36.977064 | 79 | 0.677832 | 6,326 | 0.784766 | 0 | 0 | 1,453 | 0.180251 | 0 | 0 | 3,114 | 0.386304 |
2343415fb0bf26dd085e1bfe9473a5a15110089a | 2,162 | py | Python | utils/split_evids_by_cluster.py | davmre/sigvisa | 91a1f163b8f3a258dfb78d88a07f2a11da41bd04 | [
"BSD-3-Clause"
] | null | null | null | utils/split_evids_by_cluster.py | davmre/sigvisa | 91a1f163b8f3a258dfb78d88a07f2a11da41bd04 | [
"BSD-3-Clause"
] | null | null | null | utils/split_evids_by_cluster.py | davmre/sigvisa | 91a1f163b8f3a258dfb78d88a07f2a11da41bd04 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
from optparse import OptionParser
from sigvisa.treegp.gp import GP, GPCov
from sigvisa import Sigvisa
from sigvisa.source.event import get_event
from sigvisa.treegp.cover_tree import VectorTree
import pyublas
def main():
parser = OptionParser()
s = Sigvisa()
cursor = s.dbconn.... | 38.607143 | 147 | 0.676226 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 390 | 0.180389 |
234480e438bd2c85ca7ae34d5da8cd88c72c878b | 1,048 | py | Python | fias/fiAS_track.py | cristina-mt/fias | ce264754997e14a403a9a1d3c5c6c0af646d4463 | [
"BSD-3-Clause"
] | null | null | null | fias/fiAS_track.py | cristina-mt/fias | ce264754997e14a403a9a1d3c5c6c0af646d4463 | [
"BSD-3-Clause"
] | null | null | null | fias/fiAS_track.py | cristina-mt/fias | ce264754997e14a403a9a1d3c5c6c0af646d4463 | [
"BSD-3-Clause"
] | null | null | null | # =================================================
# GUI program to analyse STEM images of filamentous structures: TRACKING
# -----------------------------------------------------------------------------
# Version 1.0
# Created: November 7th, 2017
# Last modification: January 8th, 2019
# author: @Cristina_MT
# ... | 27.578947 | 80 | 0.592557 | 182 | 0.173664 | 0 | 0 | 0 | 0 | 0 | 0 | 449 | 0.428435 |
23464d407345ae66d94f69478f5a3d5337be637f | 946 | py | Python | golf-sim/golf-sim.py | cbarrese/katas | 655b07562c06bb8b532ca141705ff127fb7e9e12 | [
"MIT"
] | null | null | null | golf-sim/golf-sim.py | cbarrese/katas | 655b07562c06bb8b532ca141705ff127fb7e9e12 | [
"MIT"
] | null | null | null | golf-sim/golf-sim.py | cbarrese/katas | 655b07562c06bb8b532ca141705ff127fb7e9e12 | [
"MIT"
] | null | null | null | import random
p = [4, 3, 4, 4, 5, 3, 5, 4, 4, 5, 4, 4, 3, 4, 5, 4, 3, 4]
b = ['b', 0, 'B']
f = [{i: [0, 0] for i in range(4)} for z in range(3)]
w = None
for r in range(3):
c = True
a = [0, 1, 2, 3]
m = None
while c:
t = [map(lambda x: random.randint(x-1, x+1), p) for i in range(4)]
s = ... | 30.516129 | 99 | 0.428118 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 43 | 0.045455 |
2346b7d4b689aedf70be90e22366c7d461f0ff5d | 1,479 | py | Python | mupub/tests/test_utils.py | MutopiaProject/mupub | 8c59ae15ea13af14139570fcccfef850e1363548 | [
"MIT"
] | null | null | null | mupub/tests/test_utils.py | MutopiaProject/mupub | 8c59ae15ea13af14139570fcccfef850e1363548 | [
"MIT"
] | 1 | 2017-02-22T17:33:23.000Z | 2017-02-23T10:02:48.000Z | mupub/tests/test_utils.py | MutopiaProject/mupub | 8c59ae15ea13af14139570fcccfef850e1363548 | [
"MIT"
] | null | null | null | """Util module tests
"""
import os.path
from unittest import TestCase
import mupub
from clint.textui.validators import ValidationError
from .tutils import PREFIX
_SIMPLE_PATH = os.path.join(PREFIX, 'SorF', 'O77', 'sorf-o77-01',)
_LYS_PATH = os.path.join(PREFIX, 'PaganiniN', 'O1', 'Caprice_1',)
class UtilsTest(TestCa... | 30.183673 | 67 | 0.593644 | 1,180 | 0.797836 | 0 | 0 | 0 | 0 | 0 | 0 | 246 | 0.166329 |
23479c6aeea396d6cdcce0a007d798ea7a728144 | 2,736 | py | Python | routemaster/cli.py | thread/routemaster | 1fd997a3bcee5e6760e9f7a60cb54323c3dfdc41 | [
"MIT"
] | 13 | 2018-01-16T14:26:27.000Z | 2022-03-19T12:43:17.000Z | routemaster/cli.py | thread/routemaster | 1fd997a3bcee5e6760e9f7a60cb54323c3dfdc41 | [
"MIT"
] | 86 | 2018-01-03T17:00:56.000Z | 2021-12-06T12:58:06.000Z | routemaster/cli.py | thread/routemaster | 1fd997a3bcee5e6760e9f7a60cb54323c3dfdc41 | [
"MIT"
] | 3 | 2018-02-21T23:13:45.000Z | 2022-03-19T12:43:23.000Z | """CLI handling for `routemaster`."""
import logging
import yaml
import click
import layer_loader
from routemaster.app import App
from routemaster.cron import CronThread
from routemaster.config import ConfigError, load_config
from routemaster.server import server
from routemaster.middleware import wrap_application
fr... | 23.186441 | 76 | 0.665205 | 0 | 0 | 0 | 0 | 2,004 | 0.732456 | 0 | 0 | 643 | 0.235015 |
2347b9234fc5c7c0d69316595f595a34f0ab7e85 | 2,988 | py | Python | app/test/test_s3.py | troydieter/aws-auto-cleanup | 523bae5cc57b81d3a2f0d43c87b9f1ef5390e3a4 | [
"MIT"
] | 322 | 2019-04-15T01:59:57.000Z | 2022-03-09T00:06:55.000Z | app/test/test_s3.py | troydieter/aws-auto-cleanup | 523bae5cc57b81d3a2f0d43c87b9f1ef5390e3a4 | [
"MIT"
] | 70 | 2019-04-15T01:27:21.000Z | 2022-03-02T00:39:29.000Z | app/test/test_s3.py | troydieter/aws-auto-cleanup | 523bae5cc57b81d3a2f0d43c87b9f1ef5390e3a4 | [
"MIT"
] | 49 | 2019-04-15T06:36:42.000Z | 2022-01-17T11:37:32.000Z | import datetime
import logging
import moto
import pytest
from .. import s3_cleanup
class TestBucketsMoreThanTTL:
@pytest.fixture
def test_class(self):
with moto.mock_s3():
whitelist = {}
settings = {
"general": {"dry_run": False},
"services": {... | 28.730769 | 78 | 0.558568 | 2,894 | 0.968541 | 1,321 | 0.442102 | 1,381 | 0.462182 | 0 | 0 | 609 | 0.203815 |
2348e1dd77f2ba0e869197de55900d212aa3c556 | 965 | py | Python | grid_sticky_example_3.py | crazcalm/learn_tkinter_canvas | b798a6f2217a478e9222bb6eaa2afec3d28a2758 | [
"MIT"
] | null | null | null | grid_sticky_example_3.py | crazcalm/learn_tkinter_canvas | b798a6f2217a478e9222bb6eaa2afec3d28a2758 | [
"MIT"
] | 2 | 2020-02-14T02:14:26.000Z | 2020-02-14T02:15:58.000Z | grid_sticky_example_3.py | crazcalm/learn_tkinter_canvas | b798a6f2217a478e9222bb6eaa2afec3d28a2758 | [
"MIT"
] | 1 | 2021-11-24T13:00:34.000Z | 2021-11-24T13:00:34.000Z | """
When a widget is positioned with sticky,
the size of the widget itself is just big
enough to contain any text and other
contents inside of it. It won’t fill the
entire grid cell. In order to fill the
grid, you can specify "ns" to force the
widget to fill the cell in the vertical
direction, or "ew" to fill the cell ... | 30.15625 | 51 | 0.71399 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 538 | 0.55636 |
234e687b4c2d9a30aa4b74e5c45d432bddf763ca | 27,529 | py | Python | server/graphManager.py | zhanghuijun-hello/Detangler | 255c8f82fbdaa36365db1bb86fd1bf42483f9d29 | [
"MIT",
"X11",
"Unlicense"
] | 5 | 2015-07-29T22:19:09.000Z | 2021-09-26T09:57:59.000Z | server/graphManager.py | zhanghuijun-hello/Detangler | 255c8f82fbdaa36365db1bb86fd1bf42483f9d29 | [
"MIT",
"X11",
"Unlicense"
] | null | null | null | server/graphManager.py | zhanghuijun-hello/Detangler | 255c8f82fbdaa36365db1bb86fd1bf42483f9d29 | [
"MIT",
"X11",
"Unlicense"
] | 5 | 2015-12-02T14:59:38.000Z | 2020-02-15T17:57:07.000Z | #!/usr/bin/env python
'''
**************************************************************************
* This class performs most of the graph manipulations.
* @authors Benjamin Renoust, Guy Melancon
* @created May 2012
**************************************************************************
'''
import json
impo... | 44.689935 | 209 | 0.518471 | 26,908 | 0.977442 | 0 | 0 | 0 | 0 | 0 | 0 | 8,498 | 0.308693 |
234e920fdc139ffec693a188e6071590ea84ef74 | 20,151 | py | Python | praatio/pitch_and_intensity.py | timmahrt/praatIO | 000d0477fffb033b63d54311fac5c913157a59a6 | [
"MIT"
] | 208 | 2016-04-20T12:42:05.000Z | 2022-03-25T13:44:03.000Z | praatio/pitch_and_intensity.py | timmahrt/praatIO | 000d0477fffb033b63d54311fac5c913157a59a6 | [
"MIT"
] | 37 | 2017-10-31T15:22:59.000Z | 2022-01-02T02:55:46.000Z | praatio/pitch_and_intensity.py | timmahrt/praatIO | 000d0477fffb033b63d54311fac5c913157a59a6 | [
"MIT"
] | 33 | 2016-05-09T07:34:22.000Z | 2022-03-30T09:00:58.000Z | # coding: utf-8
"""
Functions for working with pitch data
This file depends on the praat script get_pitch_and_intensity.praat
(which depends on praat) to extract pitch and intensity values from
audio data. Once the data is extracted, there are functions for
data normalization and calculating various measures from the... | 31.193498 | 97 | 0.626966 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5,846 | 0.29011 |
234efbd93d84cd1c579cc2b9b03be2e426d9604e | 1,488 | py | Python | keras_classifier.py | 03pie/SMPCUP2017 | 956f97fce8620b3b0c35e6b3757347ede30c64ba | [
"MIT"
] | 25 | 2017-11-08T08:56:45.000Z | 2021-11-24T20:24:37.000Z | keras_classifier.py | 03pie/SMPCUP2017 | 956f97fce8620b3b0c35e6b3757347ede30c64ba | [
"MIT"
] | null | null | null | keras_classifier.py | 03pie/SMPCUP2017 | 956f97fce8620b3b0c35e6b3757347ede30c64ba | [
"MIT"
] | 13 | 2017-12-11T05:47:52.000Z | 2021-03-04T13:53:41.000Z | import pandas as pd
from keras.models import Sequential
from keras.layers import Dense, Dropout
from keras.wrappers.scikit_learn import KerasClassifier
from keras.utils import np_utils
# return the best three results
def top_n(matrix_prob, label_map):
ans = []
for line in matrix_prob:
rank = [label_map[item[0]] fo... | 40.216216 | 126 | 0.755376 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 340 | 0.228495 |
234f3d49dc75338604b163336e34c3247e009fb7 | 2,012 | py | Python | greening/get_tiles_from_google_maps.py | uchr/Hackathon-Urbaton | 83362fec9777054050c858eda87905c8b512372a | [
"MIT"
] | null | null | null | greening/get_tiles_from_google_maps.py | uchr/Hackathon-Urbaton | 83362fec9777054050c858eda87905c8b512372a | [
"MIT"
] | null | null | null | greening/get_tiles_from_google_maps.py | uchr/Hackathon-Urbaton | 83362fec9777054050c858eda87905c8b512372a | [
"MIT"
] | null | null | null | import numpy as np
import cv2
import os
import time
import requests
import shutil
def get_route_tile(x, y, out_file):
#http://mt1.google.com/vt/lyrs=y&x=5975&y=2598&z=13
url = 'http://mt1.google.com/vt/lyrs=y&x={}&y={}&z=13'.format(x, y)
response = requests.get(url, stream=True)
with open(out_file, 'wb') ... | 30.029851 | 89 | 0.614811 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 350 | 0.173956 |
23549dd532a597635dde1ce83730aec62792e9bd | 200 | py | Python | waymo_open_dataset/latency/examples/tensorflow/multiframe/wod_latency_submission/__init__.py | mirtaheri/waymo-open-dataset | 16c6a1a98fa8bb005fdfe798d27e6f3edf98c356 | [
"Apache-2.0"
] | 1,814 | 2019-08-20T18:30:38.000Z | 2022-03-31T04:14:51.000Z | waymo_open_dataset/latency/examples/tensorflow/multiframe/wod_latency_submission/__init__.py | mirtaheri/waymo-open-dataset | 16c6a1a98fa8bb005fdfe798d27e6f3edf98c356 | [
"Apache-2.0"
] | 418 | 2019-08-20T22:38:02.000Z | 2022-03-31T07:51:15.000Z | waymo_open_dataset/latency/examples/tensorflow/multiframe/wod_latency_submission/__init__.py | mirtaheri/waymo-open-dataset | 16c6a1a98fa8bb005fdfe798d27e6f3edf98c356 | [
"Apache-2.0"
] | 420 | 2019-08-21T10:59:06.000Z | 2022-03-31T08:31:44.000Z | """Example __init__.py to wrap the wod_latency_submission module imports."""
from . import model
initialize_model = model.initialize_model
run_model = model.run_model
DATA_FIELDS = model.DATA_FIELDS
| 28.571429 | 76 | 0.815 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 76 | 0.38 |
23549ec1228d9e42823643453e7b9895b370ca45 | 1,933 | py | Python | reVX/utilities/cluster_methods.py | NREL/reVX | 4d62eb2c003c3b53b959f7a58bdc342d18098884 | [
"BSD-3-Clause"
] | 7 | 2020-04-06T00:29:55.000Z | 2022-01-23T20:00:14.000Z | reVX/utilities/cluster_methods.py | NREL/reVX | 4d62eb2c003c3b53b959f7a58bdc342d18098884 | [
"BSD-3-Clause"
] | 67 | 2020-02-28T20:15:35.000Z | 2022-03-31T21:34:52.000Z | reVX/utilities/cluster_methods.py | NREL/reVX | 4d62eb2c003c3b53b959f7a58bdc342d18098884 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Clustering Methods
"""
import numpy as np
from sklearn.cluster import KMeans
from sklearn.preprocessing import normalize
class ClusteringMethods:
""" Base class of clustering methods """
@staticmethod
def _normalize_values(arr, norm=None, axis=None):
"""
Normal... | 27.225352 | 77 | 0.562338 | 1,781 | 0.921366 | 0 | 0 | 1,700 | 0.879462 | 0 | 0 | 743 | 0.384377 |
2354fdf8dad70153d9baf4c5be2ae3e5d8f5ea68 | 47 | py | Python | lotoes/secciones/sorteosLnac/__init__.py | vidddd/lotoes | caf5fe71006e00e590549f921052f110c4bbb75f | [
"MIT"
] | null | null | null | lotoes/secciones/sorteosLnac/__init__.py | vidddd/lotoes | caf5fe71006e00e590549f921052f110c4bbb75f | [
"MIT"
] | null | null | null | lotoes/secciones/sorteosLnac/__init__.py | vidddd/lotoes | caf5fe71006e00e590549f921052f110c4bbb75f | [
"MIT"
] | null | null | null | from .controller_sorteosLnac import sorteosLnac | 47 | 47 | 0.914894 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
23563f75e2c3a54101ad242b1632d00ca9727d80 | 87 | py | Python | trainloops/__init__.py | Gerryflap/master_thesis | 5dc16e21b23837fee8a4532679bb5cb961af0b7c | [
"MIT"
] | null | null | null | trainloops/__init__.py | Gerryflap/master_thesis | 5dc16e21b23837fee8a4532679bb5cb961af0b7c | [
"MIT"
] | null | null | null | trainloops/__init__.py | Gerryflap/master_thesis | 5dc16e21b23837fee8a4532679bb5cb961af0b7c | [
"MIT"
] | null | null | null | """
This folder contains training loops and accompanying loggers and listeners
"""
| 21.75 | 78 | 0.747126 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 86 | 0.988506 |
23568ef84806142d79d34cfa3458b41993b9107e | 3,902 | py | Python | python/researchDev/boot.py | jzadeh/aktaion | 485488908e88212e615cd8bde04c6b1b63403cd0 | [
"Apache-2.0"
] | 112 | 2017-07-26T00:30:29.000Z | 2021-11-09T14:02:12.000Z | python/researchDev/boot.py | jzadeh/aktaion | 485488908e88212e615cd8bde04c6b1b63403cd0 | [
"Apache-2.0"
] | null | null | null | python/researchDev/boot.py | jzadeh/aktaion | 485488908e88212e615cd8bde04c6b1b63403cd0 | [
"Apache-2.0"
] | 38 | 2017-07-28T03:09:01.000Z | 2021-05-07T03:21:32.000Z | import os
def boot():
print
print (' _____ _____ _____ _____ _____ _______ _____ ')
print (' /\ \ /\ \ /\ \ /\ \ /... | 121.9375 | 182 | 0.098155 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3,658 | 0.937468 |
23585aa3fd91ad92d3f8755c7797b9e71281a6bc | 918 | py | Python | Unit3/Lesson7.py | szhua/PythonLearn | 12eaf7cc74a0310bb23e21773f3c83deb91d0362 | [
"Apache-2.0"
] | null | null | null | Unit3/Lesson7.py | szhua/PythonLearn | 12eaf7cc74a0310bb23e21773f3c83deb91d0362 | [
"Apache-2.0"
] | null | null | null | Unit3/Lesson7.py | szhua/PythonLearn | 12eaf7cc74a0310bb23e21773f3c83deb91d0362 | [
"Apache-2.0"
] | null | null | null |
#Python的内建模块itertools提供了非常有用的用于操作迭代对象的函数。
import itertools
#从10开始数自然数
naturals =itertools.count(10)
from collections import Iterator
#判断naturals的类型
print(isinstance(naturals,Iterator))
for x in naturals:
if x>70:
break
print(x)
#cycle()会把传入的一个序列无限重复下去:
cycles =itertools.cycle("szhualeilei")
pr... | 14.123077 | 58 | 0.704793 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 499 | 0.440035 |
23593360ab941b0e68d201d7be4b82afc1cc2f9c | 8,536 | py | Python | flaskr/databaseCURD.py | Ln-Yangzl/yukiyu-webpage | f9aaf71dca18067ecbe43faccb74a7f8d4cf56b7 | [
"Apache-2.0"
] | null | null | null | flaskr/databaseCURD.py | Ln-Yangzl/yukiyu-webpage | f9aaf71dca18067ecbe43faccb74a7f8d4cf56b7 | [
"Apache-2.0"
] | null | null | null | flaskr/databaseCURD.py | Ln-Yangzl/yukiyu-webpage | f9aaf71dca18067ecbe43faccb74a7f8d4cf56b7 | [
"Apache-2.0"
] | 2 | 2021-03-23T12:22:04.000Z | 2021-05-24T13:56:26.000Z | # 该模块提供了一个数据库的通用CURD接口
# 通过该接口能够快速进行数据库的增删查改功能
# 该模块还提供了获取数据库所有表表名,各表表头的接口
import traceback
import pymysql
from userManage import commmitChangeToUserlist, privilegeOfUser, ifManage
global db
# TODO: improve the robustness
def checkValibleTableName(targetTable, user):
if user != None and targetTable == 'user_lis... | 28.740741 | 115 | 0.600633 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,641 | 0.296209 |
235b2d901b1bea2fa217606a67dfa81205191041 | 23 | py | Python | sensu_plugins_aws_subnet/__init__.py | supernova106/sensu_plugins_aws_subnet | 07edd3b414def15809c331b7269ecdafd3faf762 | [
"MIT"
] | 12 | 2021-08-15T04:38:25.000Z | 2021-08-16T18:17:25.000Z | sensu_plugins_aws_subnet/__init__.py | supernova106/sensu_plugins_aws_subnet | 07edd3b414def15809c331b7269ecdafd3faf762 | [
"MIT"
] | 1 | 2020-12-05T18:35:55.000Z | 2020-12-05T18:35:55.000Z | sensu_plugins_aws_subnet/__init__.py | supernova106/sensu_plugins_aws_subnet | 07edd3b414def15809c331b7269ecdafd3faf762 | [
"MIT"
] | 2 | 2021-08-15T09:29:43.000Z | 2021-11-17T05:41:41.000Z | from __main__ import *
| 11.5 | 22 | 0.782609 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
235cde5e9828e617c08855acd10392c015a0948e | 121 | py | Python | scripts/02750.py | JihoChoi/BOJ | 08974a9db8ebaa299ace242e951cac53ab55fc4d | [
"MIT"
] | null | null | null | scripts/02750.py | JihoChoi/BOJ | 08974a9db8ebaa299ace242e951cac53ab55fc4d | [
"MIT"
] | null | null | null | scripts/02750.py | JihoChoi/BOJ | 08974a9db8ebaa299ace242e951cac53ab55fc4d | [
"MIT"
] | null | null | null | N = int(input())
nums = []
for _ in range(N):
nums.append(int(input()))
nums.sort()
for num in nums:
print(num) | 13.444444 | 29 | 0.586777 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
235d6ef789a7fcfed4e828ec3bd555a9f55c0dc4 | 1,207 | py | Python | notebooks/beaconrunner2050/ASAPValidator.py | casparschwa/beaconrunner | d5430e08b120462beea19f65a4cf335ec9eb9134 | [
"MIT"
] | 11 | 2020-07-06T12:36:17.000Z | 2021-04-22T11:00:18.000Z | notebooks/beaconrunner2050/ASAPValidator.py | casparschwa/beaconrunner | d5430e08b120462beea19f65a4cf335ec9eb9134 | [
"MIT"
] | 3 | 2021-09-22T16:04:35.000Z | 2021-09-22T16:05:25.000Z | notebooks/beaconrunner2050/ASAPValidator.py | casparschwa/beaconrunner | d5430e08b120462beea19f65a4cf335ec9eb9134 | [
"MIT"
] | 12 | 2021-05-24T15:21:04.000Z | 2022-03-28T17:50:37.000Z | from typing import Optional
import specs
import validatorlib as vlib
class ASAPValidator(vlib.BRValidator):
# Always $lash and prosper!
validator_behaviour = "asap"
def attest(self, known_items) -> Optional[specs.Attestation]:
# Not the moment to attest
if self.data.current_atte... | 32.621622 | 89 | 0.62966 | 1,136 | 0.941176 | 0 | 0 | 0 | 0 | 0 | 0 | 219 | 0.181442 |
236087aea9a609e4effde96065112e3417f806cd | 3,864 | py | Python | src/imreg_dft/show.py | GCBallesteros/imreg_dft | 3eb7137403dd0689711ff1dae78200b0fbdcedfb | [
"BSD-3-Clause"
] | 167 | 2015-02-28T19:14:52.000Z | 2022-03-30T03:42:33.000Z | src/imreg_dft/show.py | GCBallesteros/imreg_dft | 3eb7137403dd0689711ff1dae78200b0fbdcedfb | [
"BSD-3-Clause"
] | 40 | 2015-01-18T23:58:41.000Z | 2021-08-02T13:36:48.000Z | src/imreg_dft/show.py | GCBallesteros/imreg_dft | 3eb7137403dd0689711ff1dae78200b0fbdcedfb | [
"BSD-3-Clause"
] | 51 | 2015-02-27T21:19:55.000Z | 2022-03-24T12:28:45.000Z | # -*- coding: utf-8 -*-
# show.py
# Copyright (c) 2016-?, Matěj Týč
# 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 copyright
# notice... | 35.449541 | 77 | 0.694358 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,169 | 0.5609 |
23624728d154d6219d7807790fecc8aef8e482f2 | 9,897 | py | Python | src/regenerate_distributions.py | Rumperuu/Threat-Intelligence-Service | c72e312c9b2ad7acc0f3b564f735944b437c298b | [
"CNRI-Python"
] | null | null | null | src/regenerate_distributions.py | Rumperuu/Threat-Intelligence-Service | c72e312c9b2ad7acc0f3b564f735944b437c298b | [
"CNRI-Python"
] | null | null | null | src/regenerate_distributions.py | Rumperuu/Threat-Intelligence-Service | c72e312c9b2ad7acc0f3b564f735944b437c298b | [
"CNRI-Python"
] | null | null | null | """
Distributions (Re)generation Script
This script generates likelihood and cost distributions based on threat
intelligence data stored in a connected Neo4j graph database. It attempts to
do so for every possible permutation of (size, industry) values.
These are then consumed by `montecarlo.py`, ... | 29.720721 | 118 | 0.651106 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4,664 | 0.470446 |
23658b032c06956a00496d7055711bc9d8118a63 | 26 | py | Python | hello_world.py | fordjango/new_profiles_rest_api | b4086ad4211e5e278b2a8bcf3624f48925ea6040 | [
"MIT"
] | null | null | null | hello_world.py | fordjango/new_profiles_rest_api | b4086ad4211e5e278b2a8bcf3624f48925ea6040 | [
"MIT"
] | null | null | null | hello_world.py | fordjango/new_profiles_rest_api | b4086ad4211e5e278b2a8bcf3624f48925ea6040 | [
"MIT"
] | null | null | null | print("hello from santa")
| 13 | 25 | 0.730769 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 18 | 0.692308 |
236634d05aadb9d36762574305057814f7a3b99e | 3,939 | py | Python | tests/unit/transport/pecan/models/response/test_health.py | jqxin2006/poppy | 10636e6255c7370172422afece4a5c3d95c1e937 | [
"Apache-2.0"
] | null | null | null | tests/unit/transport/pecan/models/response/test_health.py | jqxin2006/poppy | 10636e6255c7370172422afece4a5c3d95c1e937 | [
"Apache-2.0"
] | null | null | null | tests/unit/transport/pecan/models/response/test_health.py | jqxin2006/poppy | 10636e6255c7370172422afece4a5c3d95c1e937 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2014 Rackspace, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | 35.809091 | 75 | 0.68393 | 3,206 | 0.813912 | 0 | 0 | 2,033 | 0.516121 | 0 | 0 | 1,062 | 0.269612 |
23677a38847faaff345e3e57ebe5e7c34aeac4a3 | 1,476 | py | Python | weeabot/info.py | Anonymousey/bongbot | 3498d379ef28206f3325691e340347baa14c2c97 | [
"MIT"
] | null | null | null | weeabot/info.py | Anonymousey/bongbot | 3498d379ef28206f3325691e340347baa14c2c97 | [
"MIT"
] | null | null | null | weeabot/info.py | Anonymousey/bongbot | 3498d379ef28206f3325691e340347baa14c2c97 | [
"MIT"
] | null | null | null | # vim: set ts=2 expandtab:
# -*- coding: utf-8 -*-
"""
Module: info.py
Desc: print current stream info
Author: on_three
Email: [email protected]
DATE: Sat, Oct 4th 2014
This could become very elaborate, showing stream status (up/down)
and number of viewers, etc, but at present i'm just going to
display... | 22.707692 | 79 | 0.674119 | 815 | 0.552168 | 0 | 0 | 0 | 0 | 0 | 0 | 825 | 0.558943 |
236931ea9461223fe34c99e295340ff93405cc67 | 229 | py | Python | Src/Squar-root/squar-root.py | MadushikaPerera/Python | b7919b252c02b5e1017273a65dd022ac9d13f3e4 | [
"MIT"
] | null | null | null | Src/Squar-root/squar-root.py | MadushikaPerera/Python | b7919b252c02b5e1017273a65dd022ac9d13f3e4 | [
"MIT"
] | null | null | null | Src/Squar-root/squar-root.py | MadushikaPerera/Python | b7919b252c02b5e1017273a65dd022ac9d13f3e4 | [
"MIT"
] | null | null | null | #1
number = int(input("Enter a number to find the square root : "))
#2
if number < 0 :
print("Please enter a valid number.")
else :
#3
sq_root = number ** 0.5
#4
print("Square root of {} is {} ".format(number,sq_root))
| 20.818182 | 64 | 0.624454 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 107 | 0.467249 |
2369a4c986708b3067b08b2725a7bdc63e4b378b | 12,141 | py | Python | Tools/resultsdbpy/resultsdbpy/model/mock_model_factory.py | jacadcaps/webkitty | 9aebd2081349f9a7b5d168673c6f676a1450a66d | [
"BSD-2-Clause"
] | 6 | 2021-07-05T16:09:39.000Z | 2022-03-06T22:44:42.000Z | Tools/resultsdbpy/resultsdbpy/model/mock_model_factory.py | jacadcaps/webkitty | 9aebd2081349f9a7b5d168673c6f676a1450a66d | [
"BSD-2-Clause"
] | 7 | 2022-03-15T13:25:39.000Z | 2022-03-15T13:25:44.000Z | Tools/resultsdbpy/resultsdbpy/model/mock_model_factory.py | jacadcaps/webkitty | 9aebd2081349f9a7b5d168673c6f676a1450a66d | [
"BSD-2-Clause"
] | null | null | null | # Copyright (C) 2019 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | 61.318182 | 205 | 0.730335 | 10,481 | 0.863273 | 0 | 0 | 6,753 | 0.556214 | 0 | 0 | 5,250 | 0.432419 |
2369b489eab801857e1ed7ae2c6d1938141cf46b | 8,530 | py | Python | tests/test_rpc.py | thrau/pymq | 7b924d475af8efb1e67e48a323d3f715a589a116 | [
"MIT"
] | 9 | 2019-08-20T20:31:56.000Z | 2022-03-13T23:17:05.000Z | tests/test_rpc.py | thrau/pymq | 7b924d475af8efb1e67e48a323d3f715a589a116 | [
"MIT"
] | 9 | 2019-08-20T21:13:23.000Z | 2020-10-20T11:48:21.000Z | tests/test_rpc.py | thrau/pymq | 7b924d475af8efb1e67e48a323d3f715a589a116 | [
"MIT"
] | null | null | null | import logging
import time
from typing import List
import pytest
import pymq
from pymq import NoSuchRemoteError
from pymq.exceptions import RemoteInvocationError
from pymq.typing import deep_from_dict, deep_to_dict
logger = logging.getLogger(__name__)
class EchoCommand:
param: str
def __init__(self, param... | 28.817568 | 100 | 0.661782 | 7,540 | 0.883939 | 0 | 0 | 6,719 | 0.787691 | 0 | 0 | 1,383 | 0.162134 |
236c5f0d3ad9eba2bd8b973cfc71aa175670c211 | 2,178 | py | Python | game/textIntro.py | guluc3m/ElJuegoDePusles | 45b5ac281c3ac8ec1f144556e588346a7a015021 | [
"MIT"
] | 1 | 2018-10-21T11:42:31.000Z | 2018-10-21T11:42:31.000Z | game/textIntro.py | guluc3m/ElJuegoDePusles | 45b5ac281c3ac8ec1f144556e588346a7a015021 | [
"MIT"
] | null | null | null | game/textIntro.py | guluc3m/ElJuegoDePusles | 45b5ac281c3ac8ec1f144556e588346a7a015021 | [
"MIT"
] | 2 | 2018-12-30T14:04:50.000Z | 2019-10-27T03:32:41.000Z | #Intro
Intro_Tavern_Elrick = u"¿Qué os parece? ¿Trabajaremos juntos?"
Intro_Tavern_Alida = u"¿Pero si todos superamos las pruebas, quien se casara con la princesa?"
Harek = u"Supongo que la princesa se casará con quién más le guste"
Elrick = u"Sería lo más inteligente. Utilizar las pruebas para conocernos y ver nuestra... | 87.12 | 246 | 0.772268 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,972 | 0.890293 |
236f461f8b6d07d3beef17a23e616ee5fd033b61 | 3,488 | py | Python | 02_Flask_REST/04_MongoDB_REST/app/main.py | CrispenGari/python-flask | 3e7896f401920b8dd045d807212ec24b8353a75a | [
"Apache-2.0"
] | 2 | 2021-11-08T07:37:18.000Z | 2021-11-13T09:23:46.000Z | 02_Flask_REST/04_MongoDB_REST/app/main.py | CrispenGari/Flask | 3e7896f401920b8dd045d807212ec24b8353a75a | [
"Apache-2.0"
] | null | null | null | 02_Flask_REST/04_MongoDB_REST/app/main.py | CrispenGari/Flask | 3e7896f401920b8dd045d807212ec24b8353a75a | [
"Apache-2.0"
] | null | null | null | from keys.keys import pwd
import pymongo
from flask import Flask, request, abort
from flask_restful import Resource, Api, reqparse, marshal_with, fields
"""
DATABASE CONFIGURATION
"""
databaseName = "students"
connection_url = f'mongodb+srv://crispen:{pwd}@cluster0.3zay8.mongodb.net/{databaseName}?retryWrites=true&w=... | 33.219048 | 117 | 0.641628 | 1,986 | 0.569381 | 0 | 0 | 1,630 | 0.467317 | 0 | 0 | 1,090 | 0.3125 |
236fe878b484e34a105ad050281a3bd06899f1d7 | 4,703 | py | Python | data/validate_possession.py | lpraat/scep2019 | f120ee20397648e708cce41a7949c70b523b6e56 | [
"MIT"
] | 1 | 2021-11-02T20:34:22.000Z | 2021-11-02T20:34:22.000Z | data/validate_possession.py | lpraat/scep2019 | f120ee20397648e708cce41a7949c70b523b6e56 | [
"MIT"
] | null | null | null | data/validate_possession.py | lpraat/scep2019 | f120ee20397648e708cce41a7949c70b523b6e56 | [
"MIT"
] | 1 | 2021-11-02T20:34:29.000Z | 2021-11-02T20:34:29.000Z | import csv
import math
import datetime
def build_target_possession(player_file, till):
possessions = []
to_skip = 1 # first line
with open(player_file) as csv_file:
reader = csv.reader(csv_file, delimiter=';')
for row in reader:
if to_skip:
to_skip -= 1
... | 26.874286 | 119 | 0.584095 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,040 | 0.221135 |
2370cb70aa4ccbe33c76c9f8fc510ffbcf707f15 | 6,065 | py | Python | directory_components/context_processors.py | uktrade/directory-components | f5f52ceeecd2975bff07d1bd3afa7a84046fdd50 | [
"MIT"
] | 2 | 2019-06-24T20:22:23.000Z | 2019-07-26T12:51:31.000Z | directory_components/context_processors.py | uktrade/directory-components | f5f52ceeecd2975bff07d1bd3afa7a84046fdd50 | [
"MIT"
] | 278 | 2018-02-21T11:49:46.000Z | 2021-09-16T08:27:54.000Z | directory_components/context_processors.py | uktrade/directory-components | f5f52ceeecd2975bff07d1bd3afa7a84046fdd50 | [
"MIT"
] | 3 | 2019-05-02T15:26:26.000Z | 2020-02-18T17:47:57.000Z | from directory_constants import urls
from django.conf import settings
from django.utils import translation
from directory_components import helpers
def ga360(request):
user = helpers.get_user(request)
is_logged_in = helpers.get_is_authenticated(request)
context = {'ga360': {'site_language': translation... | 41.541096 | 120 | 0.711459 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,545 | 0.25474 |
237138c111b7235bbb0b60fb326edee46f57fa80 | 1,962 | py | Python | src/leetcodepython/string/remove_duplicate_letters_316.py | zhangyu345293721/leetcode | 1aa5bcb984fd250b54dcfe6da4be3c1c67d14162 | [
"MIT"
] | 90 | 2018-12-25T06:01:30.000Z | 2022-01-03T14:01:26.000Z | src/leetcodepython/string/remove_duplicate_letters_316.py | zhangyu345293721/leetcode | 1aa5bcb984fd250b54dcfe6da4be3c1c67d14162 | [
"MIT"
] | 1 | 2020-08-27T09:53:49.000Z | 2020-08-28T08:57:49.000Z | src/leetcodepython/string/remove_duplicate_letters_316.py | zhangyu345293721/leetcode | 1aa5bcb984fd250b54dcfe6da4be3c1c67d14162 | [
"MIT"
] | 27 | 2019-01-02T01:41:32.000Z | 2022-01-03T14:01:30.000Z | # encoding='utf-8'
'''
/**
* This is the solution of No.316 problem in the LeetCode,
* the website of the problem is as follow:
* https://leetcode-cn.com/problems/smallest-subsequence-of-distinct-characters
* <p>
* The description of problem is as follow:
* =======================================================... | 25.480519 | 109 | 0.469929 | 1,027 | 0.464916 | 0 | 0 | 0 | 0 | 0 | 0 | 1,306 | 0.591218 |
23723b37428721d547ab23434d036479e7a2836c | 1,055 | py | Python | setup.py | julienvaslet/interactive-shell | 9ae800f2d9bb3365b5e68b2beef577fb39264f10 | [
"MIT"
] | null | null | null | setup.py | julienvaslet/interactive-shell | 9ae800f2d9bb3365b5e68b2beef577fb39264f10 | [
"MIT"
] | null | null | null | setup.py | julienvaslet/interactive-shell | 9ae800f2d9bb3365b5e68b2beef577fb39264f10 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import os
from setuptools import setup
current_directory = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(current_directory, "VERSION"), "r", encoding="utf-8") as f:
version = f.read()
with open(os.path.join(current_directory, "README.rst"), "r", encoding="utf-8") as f:... | 31.029412 | 91 | 0.660664 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 470 | 0.445498 |
2372e5c093d241cc7faa942820756f058a038286 | 4,530 | py | Python | spacetrading/create_svg/generate_planet_market.py | claudiobierig/doppeldenk | 770cd5322753450834ec393a0801de1d2de2bfa2 | [
"MIT"
] | 1 | 2020-11-08T12:32:36.000Z | 2020-11-08T12:32:36.000Z | spacetrading/create_svg/generate_planet_market.py | claudiobierig/doppeldenk | 770cd5322753450834ec393a0801de1d2de2bfa2 | [
"MIT"
] | 1 | 2021-06-04T22:23:30.000Z | 2021-06-04T22:23:30.000Z | spacetrading/create_svg/generate_planet_market.py | claudiobierig/doppeldenk | 770cd5322753450834ec393a0801de1d2de2bfa2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
generate the planet market
"""
from spacetrading.create_svg.svg_commands import Svg
from spacetrading.create_svg import generate_svg_symbols
def draw_planet(svg, planet, name, fill_colour):
"""
actually draw the planet market
"""
x_shift = 30
y_shift = [0, 30, 80]
x_... | 31.901408 | 87 | 0.593377 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 592 | 0.130684 |
2373ab8962f73ef7abf5effc552053ed5c20e4ab | 146 | py | Python | ex28_sh/sh_spike.py | techieguy007/learn-more-python-the-hard-way-solutions | 7886c860f69d69739a41d6490b8dc3fa777f227b | [
"Zed",
"Unlicense"
] | 466 | 2016-11-01T19:40:59.000Z | 2022-03-23T16:34:13.000Z | ex28_sh/sh_spike.py | Desperaaado/learn-more-python-the-hard-way-solutions | 7886c860f69d69739a41d6490b8dc3fa777f227b | [
"Zed",
"Unlicense"
] | 2 | 2017-09-20T09:01:53.000Z | 2017-09-21T15:03:56.000Z | ex28_sh/sh_spike.py | Desperaaado/learn-more-python-the-hard-way-solutions | 7886c860f69d69739a41d6490b8dc3fa777f227b | [
"Zed",
"Unlicense"
] | 241 | 2017-06-17T08:02:26.000Z | 2022-03-30T09:09:39.000Z | import subprocess
import sys
import os
while True:
line = input('> ')
exec = line.strip().split(' ')
status = subprocess.run(exec)
| 13.272727 | 34 | 0.630137 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 | 0.047945 |
2375cf7ad137352d0c5065ecc52c2afbf6c29b7b | 1,858 | py | Python | src/parser.py | Nanoteck137/Clockwoot | a2b039b2095834d4ad0a03ab030492a70ac097f5 | [
"MIT"
] | 1 | 2019-06-07T00:23:06.000Z | 2019-06-07T00:23:06.000Z | src/parser.py | Nanoteck137/Clockwoot | a2b039b2095834d4ad0a03ab030492a70ac097f5 | [
"MIT"
] | null | null | null | src/parser.py | Nanoteck137/Clockwoot | a2b039b2095834d4ad0a03ab030492a70ac097f5 | [
"MIT"
] | null | null | null | from sly import Lexer, Parser
import vm
class MyLexer(Lexer):
tokens = {IDENTIFIER, NUMBER, SEMICOLON, PLUS, MINUS,
ASTERISK, FORWARD_SLASH, EQUALS, KEYWORD_VAR}
KEYWORD_VAR = r'var'
IDENTIFIER = r'[a-zA-Z_][a-zA-Z0-9_]*'
NUMBER = r'[0-9]+'
SEMICOLON = r';'
PLUS = r'\+'
MINU... | 23.820513 | 59 | 0.577503 | 1,812 | 0.975242 | 0 | 0 | 1,191 | 0.641012 | 0 | 0 | 278 | 0.149623 |
23793e314023b1afee56b5645d0f4bbfd1a679ef | 1,098 | py | Python | jaxvi/models.py | sagar87/jaxvi | 78829552589f8d44082cf8a1a8e02da549d7c298 | [
"MIT"
] | null | null | null | jaxvi/models.py | sagar87/jaxvi | 78829552589f8d44082cf8a1a8e02da549d7c298 | [
"MIT"
] | null | null | null | jaxvi/models.py | sagar87/jaxvi | 78829552589f8d44082cf8a1a8e02da549d7c298 | [
"MIT"
] | null | null | null | from abc import abstractmethod
from jaxvi.abstract import ABCMeta, abstract_attribute
import jax.numpy as jnp
from jax.scipy.stats import norm, gamma
class Model(metaclass=ABCMeta):
@abstract_attribute
def latent_dim(self):
pass
@abstractmethod
def inv_T(self, zeta: jnp.DeviceArray) -> jnp.De... | 27.45 | 67 | 0.644809 | 942 | 0.857923 | 0 | 0 | 245 | 0.223133 | 0 | 0 | 0 | 0 |
237f62f7caaf963fa09ab8afd9854d8138aec5f6 | 696 | py | Python | testfile/upsampling.py | otsubo/CIFAR-ConvolutionalAutoEncoder-Chainer | bbda81dc7b52f42e07e9daaff38ce7453b24e008 | [
"MIT"
] | 1 | 2020-10-18T03:33:16.000Z | 2020-10-18T03:33:16.000Z | testfile/upsampling.py | otsubo/CIFAR-ConvolutionalAutoEncoder-Chainer | bbda81dc7b52f42e07e9daaff38ce7453b24e008 | [
"MIT"
] | null | null | null | testfile/upsampling.py | otsubo/CIFAR-ConvolutionalAutoEncoder-Chainer | bbda81dc7b52f42e07e9daaff38ce7453b24e008 | [
"MIT"
] | 1 | 2019-12-03T10:19:17.000Z | 2019-12-03T10:19:17.000Z | # -*- coding: utf-8 -*-
"""
Created on Sat Jul 21 22:59:41 2018
@author: user
"""
import chainer
import numpy as np
import chainer.functions as F
x = np.arange(1, 37).reshape(1, 1, 6, 6).astype(np.float32)
x = chainer.Variable(x)
print(x)
pooled_x, indexes = F.max_pooling_2d(x, ksize=2, stride=2, return_indices=Tru... | 24 | 88 | 0.752874 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 179 | 0.247922 |
2380077f114b5b16cc9a1100bc690d9cd9597308 | 36 | py | Python | coding/kakov-budet-vyvod-dlja-var-2-1/code.py | mowshon/python-quiz | 215fb23dbb0fa42b438f988e49172b87b48bade3 | [
"MIT"
] | 2 | 2020-07-17T21:08:26.000Z | 2020-08-16T03:12:07.000Z | coding/kakov-budet-vyvod-dlja-var-2-1/code.py | mowshon/python-quiz | 215fb23dbb0fa42b438f988e49172b87b48bade3 | [
"MIT"
] | 2 | 2021-06-08T22:04:35.000Z | 2022-01-13T03:03:32.000Z | coding/kakov-budet-vyvod-dlja-var-2-1/code.py | mowshon/python-quiz | 215fb23dbb0fa42b438f988e49172b87b48bade3 | [
"MIT"
] | null | null | null | var = "James Bond"
print(var[2::-1]) | 18 | 18 | 0.611111 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 12 | 0.333333 |
2380742d81c7c52a33d552870a8c7044b79787a1 | 1,322 | py | Python | src/ui_templates/wizard_depend_depend_version.py | GandaG/fomod-designer | 0bd333f33286adfaebecd5c2561f3aadaa017de0 | [
"Apache-2.0"
] | 15 | 2016-05-31T22:41:19.000Z | 2022-01-13T07:51:43.000Z | src/ui_templates/wizard_depend_depend_version.py | GandaG/fomod-designer | 0bd333f33286adfaebecd5c2561f3aadaa017de0 | [
"Apache-2.0"
] | 42 | 2016-05-20T18:30:45.000Z | 2019-07-18T20:27:37.000Z | src/ui_templates/wizard_depend_depend_version.py | GandaG/fomod-editor | 0bd333f33286adfaebecd5c2561f3aadaa017de0 | [
"Apache-2.0"
] | 3 | 2016-10-16T18:23:28.000Z | 2018-11-24T12:08:09.000Z | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'resources/templates/wizard_depend_depend_version.ui'
#
# Created by: PyQt5 UI code generator 5.5.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Form(object):
def setupUi(s... | 37.771429 | 106 | 0.708775 | 1,040 | 0.786687 | 0 | 0 | 0 | 0 | 0 | 0 | 304 | 0.229955 |
2381759676c1a13a9190cbf2cbe7006518dd9448 | 1,093 | py | Python | behaviour/models.py | red-and-black/friendly | f453344ad1e9173ad3545e4ea0c825b65190b3c5 | [
"Apache-2.0"
] | 2 | 2020-01-28T12:56:56.000Z | 2021-07-02T03:07:39.000Z | behaviour/models.py | red-and-black/friendly | f453344ad1e9173ad3545e4ea0c825b65190b3c5 | [
"Apache-2.0"
] | 5 | 2021-03-18T23:02:11.000Z | 2021-09-17T11:02:08.000Z | behaviour/models.py | red-and-black/goodchat | 1a391a04d4edfbcefaf87663f08308dd58578634 | [
"Apache-2.0"
] | null | null | null | from django.db import models
class BehaviourReport(models.Model):
NOT_REVIEWED = 'not_reviewed'
UNDER_REVIEW = 'under_review'
COMPLETED = 'completed'
STATUS_CHOICES = (
(NOT_REVIEWED, 'Not reviewed'),
(UNDER_REVIEW, 'Under review'),
(COMPLETED, 'Completed')
)
# Automa... | 25.418605 | 66 | 0.651418 | 1,061 | 0.970723 | 0 | 0 | 0 | 0 | 0 | 0 | 189 | 0.172919 |
2381e2b9c699c0ba9541e7eef0d109d8c8508180 | 121 | py | Python | setup.py | m0hithreddy/rpyc-mem | 72e46da34fe2165a89d702a02ec0bb7b6d64775e | [
"MIT"
] | 1 | 2022-03-12T23:29:13.000Z | 2022-03-12T23:29:13.000Z | setup.py | m0hithreddy/rpyc-mem | 72e46da34fe2165a89d702a02ec0bb7b6d64775e | [
"MIT"
] | null | null | null | setup.py | m0hithreddy/rpyc-mem | 72e46da34fe2165a89d702a02ec0bb7b6d64775e | [
"MIT"
] | null | null | null | from setuptools import setup
setup(
version=open("rpyc_mem/_version.py").readlines()[-1].split()[-1].strip("\"'")
)
| 20.166667 | 81 | 0.661157 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 27 | 0.22314 |
23823d970e12e704ee8efa4de2524ea2db2fa2ba | 957 | py | Python | myblog/blog/migrations/0001_initial.py | LikeLion-CAU-9th/spring-concept-blog | e1e16c5489a3b96d45d91bc43e15297270293dcb | [
"MIT"
] | null | null | null | myblog/blog/migrations/0001_initial.py | LikeLion-CAU-9th/spring-concept-blog | e1e16c5489a3b96d45d91bc43e15297270293dcb | [
"MIT"
] | null | null | null | myblog/blog/migrations/0001_initial.py | LikeLion-CAU-9th/spring-concept-blog | e1e16c5489a3b96d45d91bc43e15297270293dcb | [
"MIT"
] | 3 | 2021-08-10T19:00:18.000Z | 2021-08-11T00:53:09.000Z | # Generated by Django 3.2.2 on 2021-05-10 06:15
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Post',
fields=[
... | 35.444444 | 169 | 0.592476 | 851 | 0.874615 | 0 | 0 | 0 | 0 | 0 | 0 | 197 | 0.202467 |
88bb3f59329f873d5176f1525a62f453fd0b978d | 2,879 | py | Python | dockermap/map/runner/cmd.py | merll/docker-map | 54e325595fc0b6b9d154dacc790a222f957895da | [
"MIT"
] | 85 | 2015-01-02T01:05:14.000Z | 2022-03-23T22:23:12.000Z | dockermap/map/runner/cmd.py | merll/docker-map | 54e325595fc0b6b9d154dacc790a222f957895da | [
"MIT"
] | 21 | 2015-02-10T18:25:03.000Z | 2020-10-28T08:38:39.000Z | dockermap/map/runner/cmd.py | merll/docker-map | 54e325595fc0b6b9d154dacc790a222f957895da | [
"MIT"
] | 15 | 2015-02-27T12:19:35.000Z | 2021-09-29T06:20:14.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import logging
from ..action import ContainerUtilAction
from ..input import ItemType
log = logging.getLogger(__name__)
class ExecMixin(object):
"""
Utility mixin for executing configured commands inside containers.
"""
action_method_na... | 40.549296 | 115 | 0.64571 | 2,690 | 0.934352 | 0 | 0 | 0 | 0 | 0 | 0 | 1,450 | 0.503647 |
88bba0c5c1fe8347368f3e71bf8ff00b73e46934 | 846 | py | Python | tests/test_question_search_result_parsing.py | regardscitoyens/senapy | 84fb9c2228006b99c396f2c5e6a15ba6bae19873 | [
"MIT"
] | 6 | 2016-04-11T06:39:43.000Z | 2021-06-18T08:52:08.000Z | tests/test_question_search_result_parsing.py | regardscitoyens/senapy | 84fb9c2228006b99c396f2c5e6a15ba6bae19873 | [
"MIT"
] | 8 | 2016-05-31T19:46:50.000Z | 2019-08-30T13:20:27.000Z | tests/test_question_search_result_parsing.py | regardscitoyens/senapy | 84fb9c2228006b99c396f2c5e6a15ba6bae19873 | [
"MIT"
] | 3 | 2016-05-31T12:36:10.000Z | 2017-11-15T19:55:04.000Z | # -*- coding: utf-8 -*-
import codecs
from senapy.parsing.question_search_result_parser import parse_question_search_result
def test_parsing():
html = codecs.open('tests/resources/question_search_result.html', encoding='iso-8859-1')
url = 'http://www.senat.fr/basile/rechercheQuestion.do?off=30&rch=qa&de=201... | 47 | 177 | 0.751773 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 384 | 0.453365 |
88bc403d25f54bbc912895c21b6786cdfc90a30c | 3,678 | py | Python | main.py | PWN0N/Working-Time-lapse | 1ebe4cb1a669a1b77528b4f2583e27fdd4e5953b | [
"MIT"
] | null | null | null | main.py | PWN0N/Working-Time-lapse | 1ebe4cb1a669a1b77528b4f2583e27fdd4e5953b | [
"MIT"
] | null | null | null | main.py | PWN0N/Working-Time-lapse | 1ebe4cb1a669a1b77528b4f2583e27fdd4e5953b | [
"MIT"
] | null | null | null | import signal
import numpy as np
from PIL import ImageGrab
import cv2
import time
import sys
import os
flips_time_mins = 30
interval = 5 # seconds
num_frames = flips_time_mins*60/interval
num_frames = int(num_frames)
year = -1
month = -1
day = -1
out_fps = 24
cammode = 0
shutdown_msg = False
def signal_handler(sign... | 27.244444 | 83 | 0.637575 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 739 | 0.200924 |
88bd61d6346e9f097545fab6de60f3909f62dcdf | 1,823 | py | Python | tests/test_tokenizers.py | BMarcin/MordinezNLP | 884f6c2ccade8ac796d40d3081560021e96765ca | [
"MIT"
] | 1 | 2021-02-03T19:38:05.000Z | 2021-02-03T19:38:05.000Z | tests/test_tokenizers.py | BMarcin/MordinezNLP | 884f6c2ccade8ac796d40d3081560021e96765ca | [
"MIT"
] | 13 | 2020-11-30T21:01:56.000Z | 2021-03-12T21:23:45.000Z | tests/test_tokenizers.py | BMarcin/MordinezNLP | 884f6c2ccade8ac796d40d3081560021e96765ca | [
"MIT"
] | null | null | null | import unittest
import spacy
from spacy.language import Language
try:
from src.MordinezNLP.tokenizers import spacy_tokenizer
except:
from MordinezNLP.tokenizers import spacy_tokenizer
class TestTokenizers(unittest.TestCase):
nlp: Language = spacy.load("en_core_web_sm")
nlp.tokenizer = spacy_tokenizer... | 26.808824 | 126 | 0.397696 | 1,578 | 0.865606 | 0 | 0 | 0 | 0 | 0 | 0 | 386 | 0.211739 |
88bd9440904e4e745ea46a859a598eeb2a22bf97 | 20 | py | Python | python/testData/refactoring/changeSignature/nonDefaultAfterDefault1.py | jnthn/intellij-community | 8fa7c8a3ace62400c838e0d5926a7be106aa8557 | [
"Apache-2.0"
] | 2 | 2018-12-29T09:53:39.000Z | 2018-12-29T09:53:42.000Z | python/testData/refactoring/changeSignature/nonDefaultAfterDefault1.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 173 | 2018-07-05T13:59:39.000Z | 2018-08-09T01:12:03.000Z | python/testData/refactoring/changeSignature/nonDefaultAfterDefault1.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z | def foo(b=1):
pass | 10 | 13 | 0.6 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
88bdb402bf1da07ef8a27f4a47f88d7c557aae53 | 3,905 | py | Python | scripts/autopost/image_maker.py | sahawaee/quotes-indonesia | ef6f0dc5afa460d8da6266f5df89d2a350cc9835 | [
"MIT"
] | 6 | 2019-11-02T06:04:37.000Z | 2022-03-27T14:41:45.000Z | scripts/autopost/image_maker.py | sahawaee/quotes-indonesia | ef6f0dc5afa460d8da6266f5df89d2a350cc9835 | [
"MIT"
] | 1 | 2021-09-29T08:33:14.000Z | 2021-11-06T02:10:38.000Z | scripts/autopost/image_maker.py | sahawaee/quotes-indonesia | ef6f0dc5afa460d8da6266f5df89d2a350cc9835 | [
"MIT"
] | 8 | 2020-03-21T20:09:38.000Z | 2022-03-11T19:14:24.000Z | import random
import requests
import tempfile
from io import BytesIO
from PIL import Image, ImageDraw, ImageFont
FONTS = [
'https://cdn.statically.io/gh/google/fonts/main/ofl/neucha/Neucha.ttf',
# 'https://cdn.statically.io/gh/google/fonts/main/ofl/catamaran/Catamaran%5Bwght%5D.ttf',
# font_base_url + 'lob... | 33.956522 | 93 | 0.560051 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,782 | 0.456338 |