hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | 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 4 247 | max_issues_repo_name stringlengths 4 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 4 247 | max_forks_repo_name stringlengths 4 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 1 1.04M | avg_line_length float64 1.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f225bf12838e6351622f05bd70af7bf51152e126 | 148 | py | Python | djusagi/groups/forms.py | carthage-college/django-djusagi | 8fb2fe0b9100ac4bd6ebd0ea7cf44d732f7fcc5a | [
"BSD-3-Clause"
] | null | null | null | djusagi/groups/forms.py | carthage-college/django-djusagi | 8fb2fe0b9100ac4bd6ebd0ea7cf44d732f7fcc5a | [
"BSD-3-Clause"
] | 2 | 2020-03-06T14:09:23.000Z | 2021-11-30T21:33:26.000Z | djusagi/groups/forms.py | carthage-college/django-djusagi | 8fb2fe0b9100ac4bd6ebd0ea7cf44d732f7fcc5a | [
"BSD-3-Clause"
] | null | null | null | from django import forms
| 16.444444 | 30 | 0.587838 | from django import forms
class SearchForm(forms.Form):
email = forms.EmailField(
label="Email",
required = True
)
| 0 | 95 | 25 |
fe9d384ff8c4fedbe2ffc2321bdfe27173895e5f | 783 | py | Python | tests/settings.py | anthonyalmarza/django-timeseries | e7ce5ef15daad18d11e4c0e49603df7d0fff2dc5 | [
"MIT"
] | 15 | 2017-11-04T19:13:11.000Z | 2021-06-08T04:42:31.000Z | tests/settings.py | anthonyalmarza/django-timeseries | e7ce5ef15daad18d11e4c0e49603df7d0fff2dc5 | [
"MIT"
] | 1 | 2019-12-10T23:25:12.000Z | 2019-12-10T23:25:12.000Z | tests/settings.py | anthonyalmarza/timeseries | e7ce5ef15daad18d11e4c0e49603df7d0fff2dc5 | [
"MIT"
] | 2 | 2017-04-24T11:59:04.000Z | 2017-06-07T13:37:09.000Z | import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'tdzf@9g8lofi@lo$=126jrka1ydzjix^!8j)vg$6cd+kz^ei5h'
INSTALLED_APPS = [
'django.contrib.contenttypes',
'tests'
]
test_db = os.environ.get('TE... | 25.258065 | 71 | 0.65645 | import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'tdzf@9g8lofi@lo$=126jrka1ydzjix^!8j)vg$6cd+kz^ei5h'
INSTALLED_APPS = [
'django.contrib.contenttypes',
'tests'
]
test_db = os.environ.get('TE... | 0 | 0 | 0 |
ba9c44aaf47f5818535f2580276719050a477e45 | 1,284 | py | Python | pygcn/models.py | han-2059/GCN | f7a701e78d761531d3dd26b9485ec19977161711 | [
"MIT"
] | 2 | 2021-07-26T08:06:45.000Z | 2022-01-20T01:18:56.000Z | pygcn/models.py | han-2059/GCN | f7a701e78d761531d3dd26b9485ec19977161711 | [
"MIT"
] | null | null | null | pygcn/models.py | han-2059/GCN | f7a701e78d761531d3dd26b9485ec19977161711 | [
"MIT"
] | null | null | null | import torch.nn as nn
import torch.nn.functional as F
from .layers import GraphConvolution
| 34.702703 | 107 | 0.661994 | import torch.nn as nn
import torch.nn.functional as F
from .layers import GraphConvolution
class GCN(nn.Module):
# 底层节点的参数,feature的个数;隐层节点个数;最终的分类数
def __init__(self, nfeat, nhid, nclass, dropout):
'''
:param nfeat: 底层节点的参数,feature的个数
:param nhid: 隐层节点个数
:param ncla... | 583 | 982 | 23 |
85055fd4450669db56357200de53a076f91cd15a | 1,287 | py | Python | Talk/catalog/models.py | alex545228/def_hack_brain | 9d3e9f3918619e32ec187afdb48a17312aa6308c | [
"Apache-2.0"
] | null | null | null | Talk/catalog/models.py | alex545228/def_hack_brain | 9d3e9f3918619e32ec187afdb48a17312aa6308c | [
"Apache-2.0"
] | null | null | null | Talk/catalog/models.py | alex545228/def_hack_brain | 9d3e9f3918619e32ec187afdb48a17312aa6308c | [
"Apache-2.0"
] | 2 | 2021-11-03T21:16:30.000Z | 2021-11-05T08:54:13.000Z | from django.db import models
# class Person(models.Model):
# name = models.CharField(max_length=50)
# age = models.IntegerField()
# city = models.CharField(max_length=50)
# rating = models.IntegerField()
#
#
# class PersonalData(models.Model):
# name = models.CharField(max_length=50)
# mail ... | 33 | 51 | 0.724165 | from django.db import models
class Category(models.Model):
title = models.CharField(max_length=20)
class Group(models.Model):
category = models.CharField(max_length=20)
vk_id = models.IntegerField(null=True)
# class Person(models.Model):
# name = models.CharField(max_length=50)
# age = models.... | 0 | 605 | 69 |
0e8200286fd6502b0076e32d38a0d61232742e74 | 756 | py | Python | src/common/processor_worker.py | amarbasic/python-processor-setup | 25481ee79cbcf7af20544341fb0a3aa8470457ba | [
"MIT"
] | null | null | null | src/common/processor_worker.py | amarbasic/python-processor-setup | 25481ee79cbcf7af20544341fb0a3aa8470457ba | [
"MIT"
] | null | null | null | src/common/processor_worker.py | amarbasic/python-processor-setup | 25481ee79cbcf7af20544341fb0a3aa8470457ba | [
"MIT"
] | null | null | null | import logging
import traceback
import sys
from .processor_work_manager import ProcessorWorkManager
class ProcessorWorker:
"""Process worker class"""
def run(self):
"""Run worker"""
while self._running:
try:
self.process()
except Exception as ex:
... | 26.068966 | 74 | 0.628307 | import logging
import traceback
import sys
from .processor_work_manager import ProcessorWorkManager
class ProcessorWorker:
"""Process worker class"""
def __init__(self, processor_work_manager: ProcessorWorkManager):
self._running = True
self.processor_work_manager = processor_work_manager
... | 134 | 0 | 27 |
9caef61a006ff74f4975d7994384f2da8800709a | 520 | py | Python | src/Quiet.X.Tests/debug.py | callwyat/Quiet-Firmware | 864c210e44d368a4a683704841067717ebc8ac43 | [
"MIT"
] | null | null | null | src/Quiet.X.Tests/debug.py | callwyat/Quiet-Firmware | 864c210e44d368a4a683704841067717ebc8ac43 | [
"MIT"
] | null | null | null | src/Quiet.X.Tests/debug.py | callwyat/Quiet-Firmware | 864c210e44d368a4a683704841067717ebc8ac43 | [
"MIT"
] | null | null | null | from email.charset import QP
from serial import Serial
from serial.tools.list_ports import comports
qPort = None
for p in list(comports()):
if p.product and 'FT232R' in p.product:
qPort = p.device
break
if not qPort:
raise Exception('No Quiet Board found')
quite = Serial(qPort, 5760... | 20 | 55 | 0.648077 | from email.charset import QP
from serial import Serial
from serial.tools.list_ports import comports
qPort = None
for p in list(comports()):
if p.product and 'FT232R' in p.product:
qPort = p.device
break
if not qPort:
raise Exception('No Quiet Board found')
quite = Serial(qPort, 5760... | 0 | 0 | 0 |
29850a776755e89c74dc40bad748f55147252d21 | 1,228 | py | Python | setup.py | morepath/more.body_model | 6f581224adfefb42a9e140350937aa8b4b1de921 | [
"BSD-3-Clause"
] | null | null | null | setup.py | morepath/more.body_model | 6f581224adfefb42a9e140350937aa8b4b1de921 | [
"BSD-3-Clause"
] | 4 | 2017-02-22T15:26:06.000Z | 2021-01-20T14:35:30.000Z | setup.py | morepath/more.body_model | 6f581224adfefb42a9e140350937aa8b4b1de921 | [
"BSD-3-Clause"
] | null | null | null | from setuptools import setup, find_packages
long_description = (
open("README.rst", encoding="utf-8").read()
+ "\n\n"
+ open("CHANGES.rst", encoding="utf-8").read()
)
setup(
name="more.body_model",
version="0.1dev0",
description="load_json infrastructure for Morepath",
long_description=lon... | 28.55814 | 76 | 0.595277 | from setuptools import setup, find_packages
long_description = (
open("README.rst", encoding="utf-8").read()
+ "\n\n"
+ open("CHANGES.rst", encoding="utf-8").read()
)
setup(
name="more.body_model",
version="0.1dev0",
description="load_json infrastructure for Morepath",
long_description=lon... | 0 | 0 | 0 |
2a5d9abc674e05d7760ec7aa0780fcfea6fd76c5 | 2,972 | py | Python | back/api/messages.py | LyonParapente/EventOrganizer | b263c2ce61b6ad1d6c414eb388ca5ee9492a9b73 | [
"MIT"
] | 4 | 2018-07-29T10:48:53.000Z | 2018-08-23T13:02:15.000Z | back/api/messages.py | LyonParapente/EventOrganizer | b263c2ce61b6ad1d6c414eb388ca5ee9492a9b73 | [
"MIT"
] | 7 | 2018-11-15T15:17:45.000Z | 2021-05-11T19:58:55.000Z | back/api/messages.py | LyonParapente/EventOrganizer | b263c2ce61b6ad1d6c414eb388ca5ee9492a9b73 | [
"MIT"
] | null | null | null | from flask import abort
from flask_restful_swagger_3 import Resource, swagger
from flask_jwt_extended import jwt_required
from models.message import Messages, MessagesComment, MessagesUser
from models.user import silence_user_fields
from database.manager import db
| 26.774775 | 78 | 0.596904 | from flask import abort
from flask_restful_swagger_3 import Resource, swagger
from flask_jwt_extended import jwt_required
from models.message import Messages, MessagesComment, MessagesUser
from models.user import silence_user_fields
from database.manager import db
def create_basic_user_infos(props):
user_infos = {
... | 319 | 2,342 | 46 |
0863b84ee32b6351f62db01edd9b09b8388608e0 | 739 | py | Python | scripts/quest/q6508e.py | pantskun/swordiemen | fc33ffec168e6611587fdc75de8270f6827a4176 | [
"MIT"
] | null | null | null | scripts/quest/q6508e.py | pantskun/swordiemen | fc33ffec168e6611587fdc75de8270f6827a4176 | [
"MIT"
] | null | null | null | scripts/quest/q6508e.py | pantskun/swordiemen | fc33ffec168e6611587fdc75de8270f6827a4176 | [
"MIT"
] | null | null | null | # Teary Expression (6508)
from net.swordie.ms.enums import Stat
camilla = 1012108
rubble = 4000022
ouch = 5160024
# Grab current fame for quest-induced defame later
fame = chr.getStat(Stat.pop)
sm.setSpeakerID(camilla)
sm.sendNext(''.join(["Hello. Is there something I can... Eeek! "
"Is that #t", repr(rubble), "#?... | 28.423077 | 89 | 0.705007 | # Teary Expression (6508)
from net.swordie.ms.enums import Stat
camilla = 1012108
rubble = 4000022
ouch = 5160024
# Grab current fame for quest-induced defame later
fame = chr.getStat(Stat.pop)
sm.setSpeakerID(camilla)
sm.sendNext(''.join(["Hello. Is there something I can... Eeek! "
"Is that #t", repr(rubble), "#?... | 0 | 0 | 0 |
0310c49ff233035805061ff9975d3bbd318b49cb | 862 | py | Python | time_app/admin.py | MthwBrwn/Varius_project | 478d423f49665becae41eda60597899d4940050c | [
"MIT"
] | null | null | null | time_app/admin.py | MthwBrwn/Varius_project | 478d423f49665becae41eda60597899d4940050c | [
"MIT"
] | 7 | 2020-02-11T01:59:04.000Z | 2021-06-10T18:04:40.000Z | time_app/admin.py | MthwBrwn/Varius_project | 478d423f49665becae41eda60597899d4940050c | [
"MIT"
] | null | null | null | from import_export import resources
from import_export.admin import ImportExportModelAdmin
# from import_export.admin import ImportExportActionModelAdmin
from django.contrib import admin
from .models import TimePost, Client, Project
# admin.site.register(TimePost)
@admin.register(TimePost)
# class TimePostAdmin(Imp... | 26.9375 | 62 | 0.704176 | from import_export import resources
from import_export.admin import ImportExportModelAdmin
# from import_export.admin import ImportExportActionModelAdmin
from django.contrib import admin
from .models import TimePost, Client, Project
class TimePostResource(resources.ModelResource):
class Meta:
model = Tim... | 0 | 406 | 45 |
8c154bf2c335e8afd259563bae152d057158498d | 4,174 | py | Python | cosmosis-standard-library/intrinsic_alignments/flexible_grid/bias_grid.py | ktanidis2/Modified_CosmoSIS_for_galaxy_number_count_angular_power_spectra | 07e5d308c6a8641a369a3e0b8d13c4104988cd2b | [
"BSD-2-Clause"
] | 1 | 2021-09-15T10:10:26.000Z | 2021-09-15T10:10:26.000Z | cosmosis-standard-library/intrinsic_alignments/flexible_grid/bias_grid.py | ktanidis2/Modified_CosmoSIS_for_galaxy_number_count_angular_power_spectra | 07e5d308c6a8641a369a3e0b8d13c4104988cd2b | [
"BSD-2-Clause"
] | null | null | null | cosmosis-standard-library/intrinsic_alignments/flexible_grid/bias_grid.py | ktanidis2/Modified_CosmoSIS_for_galaxy_number_count_angular_power_spectra | 07e5d308c6a8641a369a3e0b8d13c4104988cd2b | [
"BSD-2-Clause"
] | 1 | 2021-06-11T15:29:43.000Z | 2021-06-11T15:29:43.000Z | from __future__ import print_function
from builtins import range
from builtins import object
import scipy.interpolate as interp
import numpy as np
import pdb
"""
This module calculates the galaxy and intrinsic alignment bias
using the flexible grid parameterisation of Joachimi and Bridle
(2010) p 6-9.
Outputs both sto... | 42.161616 | 103 | 0.572353 | from __future__ import print_function
from builtins import range
from builtins import object
import scipy.interpolate as interp
import numpy as np
import pdb
"""
This module calculates the galaxy and intrinsic alignment bias
using the flexible grid parameterisation of Joachimi and Bridle
(2010) p 6-9.
Outputs both sto... | 3,632 | 7 | 153 |
5bd1e639df502451d94703c409a07112f3d074f5 | 3,501 | py | Python | src/core/db/connection.py | KevinXuxuxu/datahub_lsems | 87ecaf877117b6747f2432fa4379243fdd3d87bd | [
"MIT"
] | null | null | null | src/core/db/connection.py | KevinXuxuxu/datahub_lsems | 87ecaf877117b6747f2432fa4379243fdd3d87bd | [
"MIT"
] | null | null | null | src/core/db/connection.py | KevinXuxuxu/datahub_lsems | 87ecaf877117b6747f2432fa4379243fdd3d87bd | [
"MIT"
] | null | null | null | import psycopg2
import re
from backend.mg import MGBackend
'''
@author: anant bhardwaj
@date: Oct 3, 2013
DataHub DB wrapper for backends (only postgres implemented)
Any new backend must implement the DataHubConnection interface
'''
class DataHubConnection:
'''
The following methods works only in superuser mo... | 30.982301 | 78 | 0.734076 | import psycopg2
import re
from backend.mg import MGBackend
'''
@author: anant bhardwaj
@date: Oct 3, 2013
DataHub DB wrapper for backends (only postgres implemented)
Any new backend must implement the DataHubConnection interface
'''
class DataHubConnection:
def __init__(self, user, password, repo_base=None):
... | 2,598 | 0 | 574 |
97d3f582ae3778129b742bcae3eec88c274dde87 | 2,046 | py | Python | djdt_api_requests/panels/api_requests.py | ingresso-group/django-debug-toolbar-api-requests | c95a515bba61e1be1ee6870d734b71491a019ace | [
"MIT"
] | 1 | 2020-05-19T20:07:28.000Z | 2020-05-19T20:07:28.000Z | djdt_api_requests/panels/api_requests.py | ingresso-group/django-debug-toolbar-api-requests | c95a515bba61e1be1ee6870d734b71491a019ace | [
"MIT"
] | 1 | 2018-08-08T14:59:44.000Z | 2018-08-08T14:59:44.000Z | djdt_api_requests/panels/api_requests.py | ingresso-group/django-debug-toolbar-api-requests | c95a515bba61e1be1ee6870d734b71491a019ace | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from debug_toolbar.panels import Panel
from django.utils.translation import ugettext_lazy as _, ungettext
import requests.sessions
| 31 | 79 | 0.637341 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from debug_toolbar.panels import Panel
from django.utils.translation import ugettext_lazy as _, ungettext
import requests.sessions
def patch_send(send_method, panel):
def patched_send(self, request, **kwargs):
response = send_method(self, ... | 1,495 | 305 | 46 |
71f31158310c6b260a6cf8639123a46af5e52575 | 106 | py | Python | functions/villain/get/getVillain.py | jeffpignataro/hero-villan-serverless-api | 5c28e03f1a8b5c4de6e72c9cf718256b34e4a2df | [
"MIT"
] | null | null | null | functions/villain/get/getVillain.py | jeffpignataro/hero-villan-serverless-api | 5c28e03f1a8b5c4de6e72c9cf718256b34e4a2df | [
"MIT"
] | null | null | null | functions/villain/get/getVillain.py | jeffpignataro/hero-villan-serverless-api | 5c28e03f1a8b5c4de6e72c9cf718256b34e4a2df | [
"MIT"
] | null | null | null | from models.villain.villain import Villain
| 17.666667 | 43 | 0.688679 | from models.villain.villain import Villain
def getVillain(id):
return "Villain #{}".format(id)
| 35 | 0 | 25 |
9fb8d1876f501522b165c627bb68a7858bed948d | 201 | py | Python | aula15/tupla.py | Eduardo-Quirino/python | acece64c8ed9f35bc94d111861acf65b50ae263c | [
"Apache-2.0"
] | null | null | null | aula15/tupla.py | Eduardo-Quirino/python | acece64c8ed9f35bc94d111861acf65b50ae263c | [
"Apache-2.0"
] | null | null | null | aula15/tupla.py | Eduardo-Quirino/python | acece64c8ed9f35bc94d111861acf65b50ae263c | [
"Apache-2.0"
] | null | null | null | t_carros = ("HRV", "Golf", "Argo")#tupla, não pode alterar o valor
l_carros = list(t_carros)
l_carros[2] = "Focus"
t_carros = tuple(l_carros)
for x in t_carros:
print(x)
input()#lista fica aberta | 25.125 | 66 | 0.691542 | t_carros = ("HRV", "Golf", "Argo")#tupla, não pode alterar o valor
l_carros = list(t_carros)
l_carros[2] = "Focus"
t_carros = tuple(l_carros)
for x in t_carros:
print(x)
input()#lista fica aberta | 0 | 0 | 0 |
16a06257e948c6830419cd90d23115c71afc82b4 | 1,835 | py | Python | build_tools/benchmarks/common/linux_device_utils.py | anthonycanino/iree | be167a62f8872597eac1b72e26b4c62e291bfd5c | [
"Apache-2.0"
] | 1 | 2022-02-12T17:56:47.000Z | 2022-02-12T17:56:47.000Z | build_tools/benchmarks/common/linux_device_utils.py | okkwon/iree | e32cc76952d37a14f73c8a7da889edf47fcc2fce | [
"Apache-2.0"
] | null | null | null | build_tools/benchmarks/common/linux_device_utils.py | okkwon/iree | e32cc76952d37a14f73c8a7da889edf47fcc2fce | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2022 The IREE Authors
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
"""Utils for accessing Linux device information."""
import re
from typing impor... | 35.980392 | 77 | 0.680654 | #!/usr/bin/env python3
# Copyright 2022 The IREE Authors
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
"""Utils for accessing Linux device information."""
import re
from typing impor... | 192 | 0 | 23 |
64e7ede2dcf9bdda884108d88c7d2da7d27bbc3b | 8,791 | py | Python | 8.py | ZerocksX/AOC2020 | 930a4d1da9e5a9efe0f1f94cb93d6b39039f774f | [
"MIT"
] | null | null | null | 8.py | ZerocksX/AOC2020 | 930a4d1da9e5a9efe0f1f94cb93d6b39039f774f | [
"MIT"
] | null | null | null | 8.py | ZerocksX/AOC2020 | 930a4d1da9e5a9efe0f1f94cb93d6b39039f774f | [
"MIT"
] | null | null | null | input = """nop +116
acc +12
acc -8
acc +34
jmp +485
acc +42
jmp +388
acc +36
nop +605
acc +17
jmp +411
acc +49
jmp +1
acc -9
jmp +289
jmp +288
jmp +74
acc +4
acc +42
jmp +258
acc +14
acc -13
nop +106
jmp +280
jmp +534
acc +41
acc +40
jmp +224
acc +43
acc +10
nop +240
jmp +211
acc +7
acc... | 11.69016 | 60 | 0.550336 | input = """nop +116
acc +12
acc -8
acc +34
jmp +485
acc +42
jmp +388
acc +36
nop +605
acc +17
jmp +411
acc +49
jmp +1
acc -9
jmp +289
jmp +288
jmp +74
acc +4
acc +42
jmp +258
acc +14
acc -13
nop +106
jmp +280
jmp +534
acc +41
acc +40
jmp +224
acc +43
acc +10
nop +240
jmp +211
acc +7
acc... | 1,316 | -21 | 810 |
9cac231cf2fe33aff15be82cbd15f524945be850 | 7,744 | py | Python | radloggerpy/tests/cli/device/test_device_show.py | Dantali0n/RadLoggerPy | c630ce730519001ee39fb3a02dd3652943a23067 | [
"Apache-2.0"
] | null | null | null | radloggerpy/tests/cli/device/test_device_show.py | Dantali0n/RadLoggerPy | c630ce730519001ee39fb3a02dd3652943a23067 | [
"Apache-2.0"
] | null | null | null | radloggerpy/tests/cli/device/test_device_show.py | Dantali0n/RadLoggerPy | c630ce730519001ee39fb3a02dd3652943a23067 | [
"Apache-2.0"
] | null | null | null | # -*- encoding: utf-8 -*-
# Copyright (c) 2020 Dantali0n
#
# 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 ... | 38.336634 | 76 | 0.685434 | # -*- encoding: utf-8 -*-
# Copyright (c) 2020 Dantali0n
#
# 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 ... | 5,964 | 488 | 23 |
c7bc657d45cc79f3ce95dbf8ffc06c54afd1ceaf | 1,884 | py | Python | app/core/tests/test_commands.py | SuEpoch254/recipe-app-api | bdd37b2b1b8cc0ed7d67ed19375b51d2ad315106 | [
"MIT"
] | null | null | null | app/core/tests/test_commands.py | SuEpoch254/recipe-app-api | bdd37b2b1b8cc0ed7d67ed19375b51d2ad315106 | [
"MIT"
] | null | null | null | app/core/tests/test_commands.py | SuEpoch254/recipe-app-api | bdd37b2b1b8cc0ed7d67ed19375b51d2ad315106 | [
"MIT"
] | null | null | null | from unittest.mock import patch
from django.core.management import call_command
from django.db.utils import OperationalError
from django.test import TestCase
| 43.813953 | 79 | 0.673567 | from unittest.mock import patch
from django.core.management import call_command
from django.db.utils import OperationalError
from django.test import TestCase
class CommandsTestCase(TestCase):
def test_wait_for_db_ready(self):
"""Test waiting for db when db is available"""
with patch('django.db.... | 0 | 1,702 | 23 |
e0b2a8431f343b1996b3b1f088fb8091f32ff84a | 2,500 | py | Python | faucet.py | topnoom259/railblock | b164ae05d70a2c6af637bcf0f07c74f60f81e175 | [
"BSD-3-Clause"
] | 1 | 2018-11-09T08:53:23.000Z | 2018-11-09T08:53:23.000Z | faucet.py | topnoom259/railblock | b164ae05d70a2c6af637bcf0f07c74f60f81e175 | [
"BSD-3-Clause"
] | null | null | null | faucet.py | topnoom259/railblock | b164ae05d70a2c6af637bcf0f07c74f60f81e175 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# RaiBlocks Telegram bot
# @RaiWalletBot https://t.me/RaiWalletBot
#
# Source code:
# https://github.com/SergiySW/RaiWalletBot
#
# Released under the BSD 3-Clause License
#
#
# Run by cron every hour, 1-2 minutes after distribution starts
# With new rules it can be in... | 27.777778 | 132 | 0.7368 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# RaiBlocks Telegram bot
# @RaiWalletBot https://t.me/RaiWalletBot
#
# Source code:
# https://github.com/SergiySW/RaiWalletBot
#
# Released under the BSD 3-Clause License
#
#
# Run by cron every hour, 1-2 minutes after distribution starts
# With new rules it can be in... | 1,237 | 0 | 44 |
ff12e324df12b9288d3b1c80e2fba0ab24fcb1d8 | 1,762 | py | Python | 2020/day19/solve2.py | krother/advent_of_code | fd7d5199666b2f3a60c41c6cf24b747322ad88e5 | [
"MIT"
] | 3 | 2021-12-01T09:27:34.000Z | 2022-02-24T23:35:56.000Z | 2020/day19/solve2.py | krother/advent_of_code | fd7d5199666b2f3a60c41c6cf24b747322ad88e5 | [
"MIT"
] | null | null | null | 2020/day19/solve2.py | krother/advent_of_code | fd7d5199666b2f3a60c41c6cf24b747322ad88e5 | [
"MIT"
] | null | null | null |
# TODO: check https://en.wikipedia.org/wiki/Earley_parser
data = '''
0: 1 2 3
1: "a"
2: "b"
3: 1 1 4 2
4: 1 | 2
abaabb
baaabb
ababab
abaaab
abaabb
abaabc'''.strip()
def solve(rules, message):
"""check whether message matches r"""
queue = [(0, ['0'])]
while queue:
position, (rule, *following... | 22.025 | 66 | 0.529512 |
# TODO: check https://en.wikipedia.org/wiki/Earley_parser
data = '''
0: 1 2 3
1: "a"
2: "b"
3: 1 1 4 2
4: 1 | 2
abaabb
baaabb
ababab
abaaab
abaabb
abaabc'''.strip()
def parse(data):
r, msg = data.strip().split('\n\n')
msg = msg.split('\n')
rules = {}
for line in r.split('\n'):
k, v = l... | 413 | 0 | 69 |
c9da19a1134f1020da00255ec415e6701fe851e1 | 14,390 | py | Python | MainWindow.py | Khairiazim/Uniten-sprout | 1f1ed2368e57c8977aedd59284945661a5befe02 | [
"BSD-3-Clause"
] | null | null | null | MainWindow.py | Khairiazim/Uniten-sprout | 1f1ed2368e57c8977aedd59284945661a5befe02 | [
"BSD-3-Clause"
] | null | null | null | MainWindow.py | Khairiazim/Uniten-sprout | 1f1ed2368e57c8977aedd59284945661a5befe02 | [
"BSD-3-Clause"
] | null | null | null | #todo / schedule/ internet connection
#todo instabot.log at api.py / instabot started at bot.py
#todo set follow followers count limit
#generate random number at server send to apps
#both check
import os
import random
import shutil
import sys
import time
import threading
import errno
import requests
... | 35.183374 | 125 | 0.570327 | #todo / schedule/ internet connection
#todo instabot.log at api.py / instabot started at bot.py
#todo set follow followers count limit
#generate random number at server send to apps
#both check
import os
import random
import shutil
import sys
import time
import threading
import errno
import requests
... | 11,676 | 62 | 681 |
5022073b94aa06c9a780426f2c33cd14e5791612 | 1,978 | py | Python | egressive.py | P4tches/Egress-ive | 403aa2e9aa56ffdff4c465c78ba0be86638ca398 | [
"MIT"
] | null | null | null | egressive.py | P4tches/Egress-ive | 403aa2e9aa56ffdff4c465c78ba0be86638ca398 | [
"MIT"
] | null | null | null | egressive.py | P4tches/Egress-ive | 403aa2e9aa56ffdff4c465c78ba0be86638ca398 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import subprocess,sys
## Rules
#I1 = ['''-A OUTPUT -m state --state RELATED,ESTABLISHED -j ACCEPT''','''-A OUTPUT -j REJECT''']
I1 = ['''ufw-not-local -j DROP'''] #For testing purposes
B1 = ['''-A INPUT -p tcp --dport 53 -j DROP''']
B2 = ['''-A INPUT -p icmp -j REJECT --reject-with icmp-port-unreach... | 23.547619 | 108 | 0.664307 | #!/usr/bin/python3
import subprocess,sys
def main():
menu()
def menu():
ruleDump()
print("")
print("Options:")
# Ingress
print(appliedBox(ruleMatch(I1)) + "I1) Only Allow Incoming Traffic (Very Restrictive)")
# Egress
print("E1) Only Allow Top 10,000 Sites (Somewhat Restrictive)")
print("E2) Only Allow 53,80... | 1,389 | 0 | 205 |
0507760acbce99cc1430bb26727d75edc9909bd0 | 1,090 | py | Python | medium/problem113/solution.py | cutoutsy/leetcode | 0734f1060a0340370b8234e8072d70c10d4306d9 | [
"Apache-2.0"
] | 1 | 2018-02-25T03:45:04.000Z | 2018-02-25T03:45:04.000Z | medium/problem113/solution.py | cutoutsy/leetcode | 0734f1060a0340370b8234e8072d70c10d4306d9 | [
"Apache-2.0"
] | null | null | null | medium/problem113/solution.py | cutoutsy/leetcode | 0734f1060a0340370b8234e8072d70c10d4306d9 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
root = TreeNode(1)
root.left = TreeNode(2)
root.right = TreeNode(3)
solution = Solution()
ans = solution.pathSum(root, 4)
for i in range(len(ans)):
print(ans[i])
| 23.191489 | 56 | 0.53211 | #!/usr/bin/python
# -*- coding: utf-8 -*-
class TreeNode(object):
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution(object):
def pathSum(self, root, sum):
"""
:type root: TreeNode
:type sum: int
:rtype: List[List[int]]... | 395 | 414 | 72 |
b2ea83662d0b2689f48c9ba46c2246a7903f0702 | 310 | py | Python | src/main.py | abeakkas/ipho-unofficial.org | 803ab3cc20670304f7be899ecc48b753765c2ddc | [
"MIT"
] | 5 | 2020-04-10T19:32:43.000Z | 2021-05-08T23:39:21.000Z | src/main.py | abeakkas/ipho-unofficial.org | 803ab3cc20670304f7be899ecc48b753765c2ddc | [
"MIT"
] | 5 | 2016-09-01T04:38:53.000Z | 2019-01-31T15:51:39.000Z | src/main.py | abeakkas/ipho-unofficial.org | 803ab3cc20670304f7be899ecc48b753765c2ddc | [
"MIT"
] | 7 | 2016-08-10T10:30:59.000Z | 2020-02-21T14:12:35.000Z | import countries
import e404
import index
import search
import static_files
import timeline
if __name__ == "__main__":
run()
| 16.315789 | 40 | 0.635484 | import countries
import e404
import index
import search
import static_files
import timeline
def run():
print("Creating the whole project")
index.run()
e404.run()
timeline.run()
countries.run()
search.run()
static_files.run()
if __name__ == "__main__":
run()
| 146 | 0 | 25 |
297edefe6ee585ccb2d96661b63396fac71557fd | 8,907 | py | Python | src/GeneralProcess/InitialParser.py | haganenoneko/EphysAnalysisTools | c404e213095ff4f14831d78f810101c19bce152e | [
"MIT"
] | null | null | null | src/GeneralProcess/InitialParser.py | haganenoneko/EphysAnalysisTools | c404e213095ff4f14831d78f810101c19bce152e | [
"MIT"
] | 1 | 2021-12-26T17:09:21.000Z | 2021-12-26T17:09:21.000Z | src/GeneralProcess/InitialParser.py | haganenoneko/EphysAnalysisTools | c404e213095ff4f14831d78f810101c19bce152e | [
"MIT"
] | null | null | null | # Copyright (c) 2021 Delbert Yip
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
import os
import logging
import pandas as pd
from pathlib import Path
from typing import Dict, Any, List
import GeneralProcess.base as base
from GeneralProcess.ephys_info_filter import EphysIn... | 30.608247 | 108 | 0.581453 | # Copyright (c) 2021 Delbert Yip
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
import os
import logging
import pandas as pd
from pathlib import Path
from typing import Dict, Any, List
import GeneralProcess.base as base
from GeneralProcess.ephys_info_filter import EphysIn... | 3,490 | 53 | 236 |
b17570f975254eb582451c8008a5f8277305ca87 | 306 | py | Python | fstmt/table/__init__.py | mission-liao/fin-stmt-additional | da9ef5299e6ff10406996d0cb0975b46498d3c39 | [
"MIT"
] | null | null | null | fstmt/table/__init__.py | mission-liao/fin-stmt-additional | da9ef5299e6ff10406996d0cb0975b46498d3c39 | [
"MIT"
] | null | null | null | fstmt/table/__init__.py | mission-liao/fin-stmt-additional | da9ef5299e6ff10406996d0cb0975b46498d3c39 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from .cost_breakdown import CostBreakdown
from .manufacturing_expense import ManufacturingExpense
from .stock import Stock
from .factory import TableAdaptorFactory
from .me2 import ManufacturingExpense2
from .product_price import ProductPrice
from .product_cost import ProductCost
| 30.6 | 55 | 0.836601 | # -*- coding: utf-8 -*-
from .cost_breakdown import CostBreakdown
from .manufacturing_expense import ManufacturingExpense
from .stock import Stock
from .factory import TableAdaptorFactory
from .me2 import ManufacturingExpense2
from .product_price import ProductPrice
from .product_cost import ProductCost
| 0 | 0 | 0 |
7524574830bfd648c2c773c48d37d248d559da32 | 608 | py | Python | oops_fhir/r4/value_set/v3_processing_mode.py | Mikuana/oops_fhir | 77963315d123756b7d21ae881f433778096a1d25 | [
"MIT"
] | null | null | null | oops_fhir/r4/value_set/v3_processing_mode.py | Mikuana/oops_fhir | 77963315d123756b7d21ae881f433778096a1d25 | [
"MIT"
] | null | null | null | oops_fhir/r4/value_set/v3_processing_mode.py | Mikuana/oops_fhir | 77963315d123756b7d21ae881f433778096a1d25 | [
"MIT"
] | null | null | null | from pathlib import Path
from fhir.resources.valueset import ValueSet as _ValueSet
from oops_fhir.utils import ValueSet
from oops_fhir.r4.code_system.v3_processing_mode import (
v3ProcessingMode as v3ProcessingMode_,
)
__all__ = ["v3ProcessingMode"]
_resource = _ValueSet.parse_file(Path(__file__).with_suffix... | 19.612903 | 69 | 0.733553 | from pathlib import Path
from fhir.resources.valueset import ValueSet as _ValueSet
from oops_fhir.utils import ValueSet
from oops_fhir.r4.code_system.v3_processing_mode import (
v3ProcessingMode as v3ProcessingMode_,
)
__all__ = ["v3ProcessingMode"]
_resource = _ValueSet.parse_file(Path(__file__).with_suffix... | 0 | 19 | 27 |
457aaaf1dfd9f71afd38241785863148c7859cb4 | 161 | py | Python | uploading/admin.py | trevin-livele/django_api_awwwards | 604a480cfe3d0efc01019c4ba15ffba5c140be0b | [
"MIT"
] | null | null | null | uploading/admin.py | trevin-livele/django_api_awwwards | 604a480cfe3d0efc01019c4ba15ffba5c140be0b | [
"MIT"
] | null | null | null | uploading/admin.py | trevin-livele/django_api_awwwards | 604a480cfe3d0efc01019c4ba15ffba5c140be0b | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Post,ReviewRating
# Register your models here.
admin.site.register(Post)
admin.site.register(ReviewRating) | 23 | 37 | 0.819876 | from django.contrib import admin
from .models import Post,ReviewRating
# Register your models here.
admin.site.register(Post)
admin.site.register(ReviewRating) | 0 | 0 | 0 |
a188f1c773c39a2017c2542f0382177d7951c891 | 3,966 | py | Python | cd4ml/ml_model.py | muralipoola/CD4ML-Scenarios | 2efb4adc3221d6daaa28fd62c3df1c1ff2c78424 | [
"MIT"
] | null | null | null | cd4ml/ml_model.py | muralipoola/CD4ML-Scenarios | 2efb4adc3221d6daaa28fd62c3df1c1ff2c78424 | [
"MIT"
] | null | null | null | cd4ml/ml_model.py | muralipoola/CD4ML-Scenarios | 2efb4adc3221d6daaa28fd62c3df1c1ff2c78424 | [
"MIT"
] | null | null | null | import joblib
from wickedhot import OneHotEncoder
from cd4ml.train import get_trained_model
from cd4ml.model_utils import get_target_id_features_lists
import logging
import mlflow.sklearn
import mlflow
import os
from cd4ml.utils.utils import mini_batch_eval
| 40.469388 | 115 | 0.652547 | import joblib
from wickedhot import OneHotEncoder
from cd4ml.train import get_trained_model
from cd4ml.model_utils import get_target_id_features_lists
import logging
import mlflow.sklearn
import mlflow
import os
from cd4ml.utils.utils import mini_batch_eval
class MLModel:
def __init__(self, algorithm_name,
... | 3,475 | -7 | 238 |
4a3816d4c395304ae8175a3ae48d262adc748f0d | 8,409 | py | Python | games/management/commands/fillrankingdb.py | MarkusShepherd/ludoj-server | 6cfb218029e6e1cf520eed1ccab2576c990cd287 | [
"MIT"
] | 1 | 2018-11-10T21:03:48.000Z | 2018-11-10T21:03:48.000Z | games/management/commands/fillrankingdb.py | MarkusShepherd/ludoj-server | 6cfb218029e6e1cf520eed1ccab2576c990cd287 | [
"MIT"
] | null | null | null | games/management/commands/fillrankingdb.py | MarkusShepherd/ludoj-server | 6cfb218029e6e1cf520eed1ccab2576c990cd287 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Parses the ranking CSVs and writes them to the database."""
import csv
import logging
import os
import sys
from datetime import datetime, timezone
from functools import lru_cache
from itertools import groupby
from pathlib import Path
import pandas as pd
from django.core.management.base i... | 30.139785 | 87 | 0.593888 | # -*- coding: utf-8 -*-
"""Parses the ranking CSVs and writes them to the database."""
import csv
import logging
import os
import sys
from datetime import datetime, timezone
from functools import lru_cache
from itertools import groupby
from pathlib import Path
import pandas as pd
from django.core.management.base i... | 5,155 | 0 | 240 |
941ffa52dfc4e009046f91e469fc8909811556a1 | 4,567 | py | Python | event_store_client.py | martinez099/event-store | bc007adcf7ce6a3cb2a9d99cf9ab32708dcb17a9 | [
"MIT"
] | 5 | 2020-06-14T10:08:29.000Z | 2021-07-06T05:46:14.000Z | event_store_client.py | martinez099/event-store | bc007adcf7ce6a3cb2a9d99cf9ab32708dcb17a9 | [
"MIT"
] | null | null | null | event_store_client.py | martinez099/event-store | bc007adcf7ce6a3cb2a9d99cf9ab32708dcb17a9 | [
"MIT"
] | 3 | 2020-09-30T13:49:33.000Z | 2021-09-04T23:48:51.000Z | import json
import logging
import os
import threading
import uuid
import grpc
from event_store_pb2 import PublishRequest, SubscribeRequest, UnsubscribeRequest, GetRequest
from event_store_pb2_grpc import EventStoreStub
EVENT_STORE_HOSTNAME = os.getenv('EVENT_STORE_HOSTNAME', 'localhost')
EVENT_STORE_PORTNR = os.gete... | 27.184524 | 92 | 0.592511 | import json
import logging
import os
import threading
import uuid
import grpc
from event_store_pb2 import PublishRequest, SubscribeRequest, UnsubscribeRequest, GetRequest
from event_store_pb2_grpc import EventStoreStub
EVENT_STORE_HOSTNAME = os.getenv('EVENT_STORE_HOSTNAME', 'localhost')
EVENT_STORE_PORTNR = os.gete... | 269 | 0 | 81 |
c0752693a81375be4af89460a0fc8ed1656c43af | 2,133 | py | Python | ntgen/utils.py | mrapacz/ntgen | 62f1e04624a0b406060418eb4f89af132a635a3f | [
"MIT"
] | 4 | 2020-03-29T09:31:52.000Z | 2020-04-27T19:02:54.000Z | ntgen/utils.py | mrapacz/ntgen | 62f1e04624a0b406060418eb4f89af132a635a3f | [
"MIT"
] | 2 | 2020-03-29T10:47:09.000Z | 2020-04-05T08:12:38.000Z | ntgen/utils.py | mrapacz/ntgen | 62f1e04624a0b406060418eb4f89af132a635a3f | [
"MIT"
] | null | null | null | import re
from typing import Optional
def normalize_field_name(name: str, leading_undescores_prefix: Optional[str] = None) -> str:
"""
Normalize a string to take a Pythonic form.
Normalize a string to take a Pythonic form by:
- replacing leading underscores with a given (optional) prefix
- conver... | 31.835821 | 117 | 0.676981 | import re
from typing import Optional
def normalize_field_name(name: str, leading_undescores_prefix: Optional[str] = None) -> str:
"""
Normalize a string to take a Pythonic form.
Normalize a string to take a Pythonic form by:
- replacing leading underscores with a given (optional) prefix
- conver... | 0 | 0 | 0 |
0e45a7779e2663718ced38640283e0176e71c2af | 2,158 | py | Python | dostuff.py | rumkex/IonTools | e4c80a6385fa41fd7dd3721636a1a4b177839625 | [
"BSD-3-Clause"
] | 3 | 2018-08-09T08:49:40.000Z | 2019-07-24T02:48:55.000Z | dostuff.py | rumkex/IonTools | e4c80a6385fa41fd7dd3721636a1a4b177839625 | [
"BSD-3-Clause"
] | null | null | null | dostuff.py | rumkex/IonTools | e4c80a6385fa41fd7dd3721636a1a4b177839625 | [
"BSD-3-Clause"
] | 1 | 2019-05-22T12:22:45.000Z | 2019-05-22T12:22:45.000Z | #!/usr/bin/env python3
from math import pi
from multiprocessing import Pool
from tempfile import NamedTemporaryFile
from subprocess import call, DEVNULL
import time
import os
import os.path as path
from shared import update_progress, plot_data
baseflags = ['--interpolate=linear', '--enable-weights']
config = {
... | 30.394366 | 117 | 0.603336 | #!/usr/bin/env python3
from math import pi
from multiprocessing import Pool
from tempfile import NamedTemporaryFile
from subprocess import call, DEVNULL
import time
import os
import os.path as path
from shared import update_progress, plot_data
baseflags = ['--interpolate=linear', '--enable-weights']
config = {
... | 1,528 | 0 | 46 |
4008b775c8f08dd29efc36b744c6a3bd6e47d7fe | 106 | py | Python | Misc/10print.py | sparkstark03/Awesome-Scripts | 7326f2480bdeb4d843c50488bc790a5139820c8a | [
"MIT"
] | 141 | 2018-10-04T10:02:15.000Z | 2022-03-18T08:47:01.000Z | Misc/10print.py | sparkstark03/Awesome-Scripts | 7326f2480bdeb4d843c50488bc790a5139820c8a | [
"MIT"
] | 34 | 2018-10-04T08:28:01.000Z | 2020-11-02T09:36:02.000Z | Misc/10print.py | sparkstark03/Awesome-Scripts | 7326f2480bdeb4d843c50488bc790a5139820c8a | [
"MIT"
] | 110 | 2018-10-04T04:28:11.000Z | 2022-03-22T05:49:02.000Z | #!/usr/bin/env python3
import random
for i in range(100000):print(chr(9585+random.randint(0,1)), end="")
| 21.2 | 67 | 0.707547 | #!/usr/bin/env python3
import random
for i in range(100000):print(chr(9585+random.randint(0,1)), end="")
| 0 | 0 | 0 |
41739de9d63f3025d9be0b4a264539bc8a971b23 | 4,395 | py | Python | sa/profiles/Zyxel/ZyNOS/get_switchport.py | xUndero/noc | 9fb34627721149fcf7064860bd63887e38849131 | [
"BSD-3-Clause"
] | 1 | 2019-09-20T09:36:48.000Z | 2019-09-20T09:36:48.000Z | sa/profiles/Zyxel/ZyNOS/get_switchport.py | ewwwcha/noc | aba08dc328296bb0e8e181c2ac9a766e1ec2a0bb | [
"BSD-3-Clause"
] | null | null | null | sa/profiles/Zyxel/ZyNOS/get_switchport.py | ewwwcha/noc | aba08dc328296bb0e8e181c2ac9a766e1ec2a0bb | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# ---------------------------------------------------------------------
# Zyxel.ZyNOS.get_switchport
# ---------------------------------------------------------------------
# Copyright (C) 2007-2015 The NOC Project
# See LICENSE for details
# -----------------------------------------------------... | 36.932773 | 87 | 0.471445 | # -*- coding: utf-8 -*-
# ---------------------------------------------------------------------
# Zyxel.ZyNOS.get_switchport
# ---------------------------------------------------------------------
# Copyright (C) 2007-2015 The NOC Project
# See LICENSE for details
# -----------------------------------------------------... | 3,157 | 730 | 23 |
52bf3108b8781fe487dcaa7f471df575358ab42e | 157 | py | Python | practice/practice52.py | tomhaoye/LetsPython | 3c5f66d2e672067ed9aea33c0abd6b01708734ff | [
"MIT"
] | null | null | null | practice/practice52.py | tomhaoye/LetsPython | 3c5f66d2e672067ed9aea33c0abd6b01708734ff | [
"MIT"
] | null | null | null | practice/practice52.py | tomhaoye/LetsPython | 3c5f66d2e672067ed9aea33c0abd6b01708734ff | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: UTF-8 -*-
if __name__ == '__main__':
a = 077
b = a | 3
print 'a | b = %d' % b
b |= 7
print 'a|b=%d' % b
| 15.7 | 26 | 0.426752 | #!/usr/bin/python
# -*- coding: UTF-8 -*-
if __name__ == '__main__':
a = 077
b = a | 3
print 'a | b = %d' % b
b |= 7
print 'a|b=%d' % b
| 0 | 0 | 0 |
628473232007d9a6c34401980c9d1a671512e47e | 8,572 | py | Python | postprocess/ensemble_masks.py | shawnau/DataScienceBowl2018 | 3c6f0f26dd86b71aad55fca52314e6432d0b3a82 | [
"MIT"
] | null | null | null | postprocess/ensemble_masks.py | shawnau/DataScienceBowl2018 | 3c6f0f26dd86b71aad55fca52314e6432d0b3a82 | [
"MIT"
] | null | null | null | postprocess/ensemble_masks.py | shawnau/DataScienceBowl2018 | 3c6f0f26dd86b71aad55fca52314e6432d0b3a82 | [
"MIT"
] | null | null | null | import sys, operator
sys.path.append('..')
from scipy.ndimage.morphology import binary_fill_holes
from configuration import Configuration
from dataset.reader import *
from dataset.folder import TrainFolder
from utility.draw import *
from net.lib.nms.cython_nms.cython_nms import cython_nms
from net.layer.mask import in... | 34.425703 | 112 | 0.625758 | import sys, operator
sys.path.append('..')
from scipy.ndimage.morphology import binary_fill_holes
from configuration import Configuration
from dataset.reader import *
from dataset.folder import TrainFolder
from utility.draw import *
from net.lib.nms.cython_nms.cython_nms import cython_nms
from net.layer.mask import in... | 4,671 | 767 | 91 |
f28bdca64ae4805bfca0002fe2ade27265ccf4c1 | 6,675 | py | Python | ssdpipelineClass.py | scrambleegg7/ssd_prescription | 37932d16d5b7a7741fcdf6afff5be0804ef958a8 | [
"MIT"
] | null | null | null | ssdpipelineClass.py | scrambleegg7/ssd_prescription | 37932d16d5b7a7741fcdf6afff5be0804ef958a8 | [
"MIT"
] | null | null | null | ssdpipelineClass.py | scrambleegg7/ssd_prescription | 37932d16d5b7a7741fcdf6afff5be0804ef958a8 | [
"MIT"
] | null | null | null | import cv2
import keras
from keras.applications.imagenet_utils import preprocess_input
from keras.backend.tensorflow_backend import set_session
from keras.models import Model
from keras.preprocessing import image
import matplotlib.pyplot as plt
import numpy as np
from scipy.misc import imread
import tensorflow as tf
i... | 35.31746 | 238 | 0.578876 | import cv2
import keras
from keras.applications.imagenet_utils import preprocess_input
from keras.backend.tensorflow_backend import set_session
from keras.models import Model
from keras.preprocessing import image
import matplotlib.pyplot as plt
import numpy as np
from scipy.misc import imread
import tensorflow as tf
i... | 5,705 | 5 | 140 |
5d5aaa78abda3a5dac6f04c7e1a655e11a29afae | 3,017 | py | Python | var/spack/repos/builtin/packages/libtree/package.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2018-11-16T02:42:57.000Z | 2019-06-06T19:18:50.000Z | var/spack/repos/builtin/packages/libtree/package.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 25 | 2021-02-08T14:39:48.000Z | 2022-03-21T18:37:29.000Z | var/spack/repos/builtin/packages/libtree/package.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 7 | 2018-09-13T18:04:56.000Z | 2020-03-18T20:52:06.000Z | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Libtree(CMakePackage):
"""ldd as a tree with an option to bundle dependencies into a
... | 45.029851 | 109 | 0.721246 | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Libtree(CMakePackage):
"""ldd as a tree with an option to bundle dependencies into a
... | 632 | 0 | 81 |
903f4d9031aff626c4315c70f8e2f674feff8b97 | 3,316 | py | Python | postgres/postgres.py | p-wu-214/NewsSummary | 67b3a42f69c79dadbc319473999bdc77b8e3647e | [
"MIT"
] | null | null | null | postgres/postgres.py | p-wu-214/NewsSummary | 67b3a42f69c79dadbc319473999bdc77b8e3647e | [
"MIT"
] | null | null | null | postgres/postgres.py | p-wu-214/NewsSummary | 67b3a42f69c79dadbc319473999bdc77b8e3647e | [
"MIT"
] | null | null | null | import psycopg2
# Redownloading the models is a pain, maybe a better solution is to keep the models on the ram and transfer back and forth from video card | 46.704225 | 155 | 0.579312 | import psycopg2
def model_name_to_db_column(model_name):
return model_name.replace('google/', '').replace('-', '_')
class PostGres:
def __init__(self):
self.connection = psycopg2.connect(user="patterson",
password="jeramywu0214",
... | 2,984 | -6 | 179 |
8f64320db148dc392c0150c92254121a2a9d2158 | 44 | py | Python | users/urls.py | casol/Digital-Library | 2ba8586ac861ea1bbd291128ea6b9e0341cbdc15 | [
"MIT"
] | null | null | null | users/urls.py | casol/Digital-Library | 2ba8586ac861ea1bbd291128ea6b9e0341cbdc15 | [
"MIT"
] | 11 | 2020-06-05T22:23:17.000Z | 2022-03-12T00:03:36.000Z | users/urls.py | casol/Digital-Library | 2ba8586ac861ea1bbd291128ea6b9e0341cbdc15 | [
"MIT"
] | null | null | null | from django.urls import path, include # new
| 22 | 43 | 0.772727 | from django.urls import path, include # new
| 0 | 0 | 0 |
8b54be24e2e3815e5d119808a2523cd5ff0a4e7f | 1,819 | py | Python | tests/test_env_yaml_from_manifest.py | rigzba21/conda-vendor | be06c520af0a08f6dc58a6bdc46e760b04e55869 | [
"MIT"
] | 10 | 2021-08-25T14:31:01.000Z | 2021-12-27T19:46:38.000Z | tests/test_env_yaml_from_manifest.py | rigzba21/conda-vendor | be06c520af0a08f6dc58a6bdc46e760b04e55869 | [
"MIT"
] | 6 | 2021-09-22T21:08:51.000Z | 2022-03-31T17:28:41.000Z | tests/test_env_yaml_from_manifest.py | rigzba21/conda-vendor | be06c520af0a08f6dc58a6bdc46e760b04e55869 | [
"MIT"
] | 2 | 2021-10-06T13:28:48.000Z | 2022-01-27T16:47:30.000Z | # TODO: Utils ? like load so we don't duplicate code ?
from unittest import TestCase
from unittest.mock import patch
import pytest
from ruamel.yaml import YAML
from yaml import SafeLoader
from conda_vendor.env_yaml_from_manifest import YamlFromManifest
@pytest.fixture
| 36.38 | 80 | 0.772402 | # TODO: Utils ? like load so we don't duplicate code ?
from unittest import TestCase
from unittest.mock import patch
import pytest
from ruamel.yaml import YAML
from yaml import SafeLoader
from conda_vendor.env_yaml_from_manifest import YamlFromManifest
@pytest.fixture
def yml_man_fixture(tmp_path, get_path_location... | 1,428 | 0 | 114 |
e64f42e56034356f778ffe1a7cb05be62e8ad980 | 112 | py | Python | arquivos-py/2109/seis2109.py | byancasantos/exercicios-python | b7796b9e2e7c714ebc1dbe8ca31d37c4f40cb19c | [
"MIT"
] | null | null | null | arquivos-py/2109/seis2109.py | byancasantos/exercicios-python | b7796b9e2e7c714ebc1dbe8ca31d37c4f40cb19c | [
"MIT"
] | null | null | null | arquivos-py/2109/seis2109.py | byancasantos/exercicios-python | b7796b9e2e7c714ebc1dbe8ca31d37c4f40cb19c | [
"MIT"
] | null | null | null | cont=0
while cont<5:
print(cont)
cont=cont+1
else:
print('o loop while foi encerrado com sucesso.')
| 16 | 52 | 0.660714 | cont=0
while cont<5:
print(cont)
cont=cont+1
else:
print('o loop while foi encerrado com sucesso.')
| 0 | 0 | 0 |
9fed3a96c9c373a5bc11bfec86583807e2dc75ca | 64 | py | Python | spire/version.py | bugout-dev/spire | def55cb64fbd306ddde47067d8573cf4b234115c | [
"Apache-2.0"
] | 1 | 2021-12-01T14:18:12.000Z | 2021-12-01T14:18:12.000Z | spire/version.py | bugout-dev/spire | def55cb64fbd306ddde47067d8573cf4b234115c | [
"Apache-2.0"
] | 13 | 2021-07-13T19:19:22.000Z | 2022-01-14T16:33:42.000Z | spire/version.py | bugout-dev/spire | def55cb64fbd306ddde47067d8573cf4b234115c | [
"Apache-2.0"
] | null | null | null | """
Spire library and API version.
"""
SPIRE_VERSION = "0.4.0"
| 10.666667 | 30 | 0.640625 | """
Spire library and API version.
"""
SPIRE_VERSION = "0.4.0"
| 0 | 0 | 0 |
07ef4ed51a1c3b6623a2b51b57ad186416813ed1 | 9,706 | py | Python | archive/v0.0.1/0.5x/mdm_model.py | pw1316/ShuffleV2-Face-Alignment | 1b76e706cad7fce18f78f871a3a7e1ca6afef375 | [
"BSD-3-Clause"
] | 1 | 2019-02-11T06:00:23.000Z | 2019-02-11T06:00:23.000Z | archive/v0.0.1/0.5x/mdm_model.py | pw1316/mdm | 1b76e706cad7fce18f78f871a3a7e1ca6afef375 | [
"BSD-3-Clause"
] | null | null | null | archive/v0.0.1/0.5x/mdm_model.py | pw1316/mdm | 1b76e706cad7fce18f78f871a3a7e1ca6afef375 | [
"BSD-3-Clause"
] | null | null | null | import tensorflow as tf
import utils
| 44.935185 | 121 | 0.589429 | import tensorflow as tf
import utils
def align_reference_shape(reference_shape, reference_shape_bb, im, bb):
def norm(x):
return tf.sqrt(tf.reduce_sum(tf.square(x - tf.reduce_mean(x, 0))))
ratio = norm(bb) / norm(reference_shape_bb)
align_mean_shape = (reference_shape - tf.reduce_mean(reference_s... | 9,367 | -6 | 303 |
e81f8c1235c94ae563d3aeb7457fa6c02b3fd29a | 4,769 | py | Python | file_operations/file_methods.py | asiftandel96/WaferFaultDetectionProject | 4578e00c1b354c6dfcb9e218ce9bd1fe17e95cd1 | [
"MIT"
] | 1 | 2021-12-03T08:14:15.000Z | 2021-12-03T08:14:15.000Z | file_operations/file_methods.py | asiftandel96/WaferFaultDetectionProject | 4578e00c1b354c6dfcb9e218ce9bd1fe17e95cd1 | [
"MIT"
] | null | null | null | file_operations/file_methods.py | asiftandel96/WaferFaultDetectionProject | 4578e00c1b354c6dfcb9e218ce9bd1fe17e95cd1 | [
"MIT"
] | null | null | null | import pickle
import os
import shutil
class File_Operation:
"""This class shall be used to save the model after training and load the saved model for prediction."""
def save_model(self,model,filename):
"""
Method Name: save_model
Description: Save the model file to ... | 51.27957 | 151 | 0.561963 | import pickle
import os
import shutil
class File_Operation:
"""This class shall be used to save the model after training and load the saved model for prediction."""
def __init__(self,file_object,logger_object):
self.file_object = file_object
self.logger_object = logger_object
... | 148 | 0 | 27 |
5c8e9b7b9fa7a13fbc7df412245423487884e294 | 424 | py | Python | roda_purchase/api/serializers.py | sanss021/roda_case | 1e8cf876ae6856615aea0a2f8946b8f542a42bc0 | [
"MIT"
] | null | null | null | roda_purchase/api/serializers.py | sanss021/roda_case | 1e8cf876ae6856615aea0a2f8946b8f542a42bc0 | [
"MIT"
] | null | null | null | roda_purchase/api/serializers.py | sanss021/roda_case | 1e8cf876ae6856615aea0a2f8946b8f542a42bc0 | [
"MIT"
] | null | null | null | from rest_framework import serializers
from roda_purchase import models
'''Aqui é onde transformamos dados em um formato que pode ser armazenado ou transmitido''' | 28.266667 | 90 | 0.738208 | from rest_framework import serializers
from roda_purchase import models
class PurchaseSerializer(serializers.ModelSerializer):
class Meta:
model = models.Purchase
fields = '__all__'
class ProductSerializer(serializers.ModelSerializer):
class Meta:
model = models.Product
fields ... | 0 | 214 | 46 |
9afc46003dbb0c41cf0b8a68be575471e0c01980 | 925 | py | Python | setup.py | pptx704/torpedo | f35e66b571f07d5d3553434da25cb29e05a1a6fb | [
"MIT"
] | 16 | 2021-07-09T16:39:47.000Z | 2021-12-26T20:29:18.000Z | setup.py | pptx704/torpedo | f35e66b571f07d5d3553434da25cb29e05a1a6fb | [
"MIT"
] | null | null | null | setup.py | pptx704/torpedo | f35e66b571f07d5d3553434da25cb29e05a1a6fb | [
"MIT"
] | 2 | 2021-07-09T17:58:25.000Z | 2021-10-01T20:21:45.000Z | import setuptools
long_description = "Check full documentation [here](https://github.com/pptx704/torpedo)"
setuptools.setup(
name="mailtorpedo",
version="1.1.0",
author="Rafeed M. Bhuiyan",
author_email="rafeedm.bhuiyan@gmail.com",
description="A Python package for sending personalized emails usin... | 31.896552 | 90 | 0.661622 | import setuptools
long_description = "Check full documentation [here](https://github.com/pptx704/torpedo)"
setuptools.setup(
name="mailtorpedo",
version="1.1.0",
author="Rafeed M. Bhuiyan",
author_email="rafeedm.bhuiyan@gmail.com",
description="A Python package for sending personalized emails usin... | 0 | 0 | 0 |
5f63848fe6683f638aa250ed3d73f59ef6dba171 | 1,171 | py | Python | oct/tools/rebuild_results.py | gregadc/oct | 7e9bddeb3b8495a26442b1c86744e9fb187fe88f | [
"MIT"
] | 10 | 2015-01-06T11:59:05.000Z | 2016-03-25T15:19:55.000Z | oct/tools/rebuild_results.py | gregadc/oct | 7e9bddeb3b8495a26442b1c86744e9fb187fe88f | [
"MIT"
] | 33 | 2016-04-17T09:57:38.000Z | 2020-09-25T12:40:35.000Z | oct/tools/rebuild_results.py | gregadc/oct | 7e9bddeb3b8495a26442b1c86744e9fb187fe88f | [
"MIT"
] | 3 | 2016-12-14T14:38:04.000Z | 2019-11-15T21:57:21.000Z | import six
from oct.core.exceptions import OctConfigurationError
from oct.results.output import output
from oct.results.models import db, set_database
from oct.utilities.configuration import configure, get_db_uri
| 35.484848 | 118 | 0.730999 | import six
from oct.core.exceptions import OctConfigurationError
from oct.results.output import output
from oct.results.models import db, set_database
from oct.utilities.configuration import configure, get_db_uri
def rebuild(args):
config = configure(None, args.config_file)
if args.results_file is None:
... | 909 | 0 | 46 |
e5bb9621225aaadac5ceca87a02f4a40632c3701 | 2,575 | py | Python | python/l0904.py | daidaifan/leetcode-problem-solver | 1793eada501a2a18d05f118a98ac52e2edd12ef8 | [
"MIT"
] | null | null | null | python/l0904.py | daidaifan/leetcode-problem-solver | 1793eada501a2a18d05f118a98ac52e2edd12ef8 | [
"MIT"
] | null | null | null | python/l0904.py | daidaifan/leetcode-problem-solver | 1793eada501a2a18d05f118a98ac52e2edd12ef8 | [
"MIT"
] | null | null | null | """
In a row of trees, the i-th tree produces fruit with type tree[i].
You start at any tree of your choice, then repeatedly perform the following steps:
Add one piece of fruit from this tree to your baskets. If you cannot, stop.
Move to the next tree to the right of the current tree. If there is no tree to the rig... | 31.024096 | 203 | 0.641165 | """
In a row of trees, the i-th tree produces fruit with type tree[i].
You start at any tree of your choice, then repeatedly perform the following steps:
Add one piece of fruit from this tree to your baskets. If you cannot, stop.
Move to the next tree to the right of the current tree. If there is no tree to the rig... | 0 | 714 | 23 |
bd66867f86dfd9aa4e1aaffdb68dbb54cb15d46b | 12,454 | py | Python | testing/test_streaming.py | vincent-antaki/Neuraxle | cef1284a261010c655f8ef02b4fca5b8bb45850c | [
"Apache-2.0"
] | 1 | 2021-04-26T23:46:40.000Z | 2021-04-26T23:46:40.000Z | testing/test_streaming.py | Tubbz-alt/Neuraxle | 308f24248cdb242b7e2f6ec7c51daf2ee3e38834 | [
"Apache-2.0"
] | null | null | null | testing/test_streaming.py | Tubbz-alt/Neuraxle | 308f24248cdb242b7e2f6ec7c51daf2ee3e38834 | [
"Apache-2.0"
] | null | null | null | import time
import numpy as np
import pytest
from neuraxle.base import BaseStep, ExecutionContext
from neuraxle.data_container import DataContainer, AbsentValuesNullObject
from neuraxle.distributed.streaming import SequentialQueuedPipeline, ParallelQueuedFeatureUnion, QueueJoiner
from neuraxle.hyperparams.space impor... | 34.787709 | 112 | 0.689979 | import time
import numpy as np
import pytest
from neuraxle.base import BaseStep, ExecutionContext
from neuraxle.data_container import DataContainer, AbsentValuesNullObject
from neuraxle.distributed.streaming import SequentialQueuedPipeline, ParallelQueuedFeatureUnion, QueueJoiner
from neuraxle.hyperparams.space impor... | 11,205 | 17 | 536 |
5882a31d0860d31e880c999a1557a68bd379e23b | 630 | py | Python | atbash-cipher/atbash_cipher.py | gordonli08/Exercism-python | ff3d79ccc61bac7475641ee6c2f19a0367e3e254 | [
"MIT"
] | null | null | null | atbash-cipher/atbash_cipher.py | gordonli08/Exercism-python | ff3d79ccc61bac7475641ee6c2f19a0367e3e254 | [
"MIT"
] | null | null | null | atbash-cipher/atbash_cipher.py | gordonli08/Exercism-python | ff3d79ccc61bac7475641ee6c2f19a0367e3e254 | [
"MIT"
] | null | null | null | import string
cipheren = dict(zip(list(string.ascii_lowercase), string.ascii_lowercase[::-1]))
cipherde = dict(zip(string.ascii_lowercase[::-1], list(string.ascii_lowercase)))
| 37.058824 | 87 | 0.680952 | import string
cipheren = dict(zip(list(string.ascii_lowercase), string.ascii_lowercase[::-1]))
cipherde = dict(zip(string.ascii_lowercase[::-1], list(string.ascii_lowercase)))
def encode(plain_text):
stripped = [ch for ch in plain_text.lower() if ch.isalnum()]
stripped = [cipheren[ch] if ch.isalpha() else ch f... | 408 | 0 | 46 |
f119b86d9b0f095daf2dc2565973dd23411342c0 | 3,205 | py | Python | img.py | Naruki-Ichihara/portraitprinter | c3720d71cd9ac275dde90a7f5c5856b78326e397 | [
"MIT"
] | null | null | null | img.py | Naruki-Ichihara/portraitprinter | c3720d71cd9ac275dde90a7f5c5856b78326e397 | [
"MIT"
] | null | null | null | img.py | Naruki-Ichihara/portraitprinter | c3720d71cd9ac275dde90a7f5c5856b78326e397 | [
"MIT"
] | null | null | null | from dolfin import *
import matplotlib.pyplot as plt
import numpy as np
import scipy.interpolate as s
eps = 0.3
g = 0.0
w0 = 0.8
dt = 1e-5
gamma = 1.0
file = File('./test.pvd')
eps = 0.3
g = 0.0
w0 = 0.8
dt = 0.01
gamma = 1.0
img = plt.imread("./img/newton.jpeg")/256
(Nx, Ny) = img.shape
print(img)
L = 100
x = np.l... | 23.394161 | 97 | 0.614041 | from dolfin import *
import matplotlib.pyplot as plt
import numpy as np
import scipy.interpolate as s
eps = 0.3
g = 0.0
w0 = 0.8
dt = 1e-5
gamma = 1.0
file = File('./test.pvd')
eps = 0.3
g = 0.0
w0 = 0.8
dt = 0.01
gamma = 1.0
img = plt.imread("./img/newton.jpeg")/256
(Nx, Ny) = img.shape
print(img)
L = 100
x = np.l... | 938 | 64 | 494 |
cd63c3b8b53f2f236bd67362d698bb3d491c86cb | 189 | py | Python | kw6/__init__.py | Aiwizo/kw6 | c079b2a57a07d9c56fefd90de65cf3f41d81e70f | [
"Apache-2.0"
] | 3 | 2020-09-18T22:31:28.000Z | 2020-09-21T09:38:42.000Z | kw6/__init__.py | Aiwizo/kw6 | c079b2a57a07d9c56fefd90de65cf3f41d81e70f | [
"Apache-2.0"
] | 2 | 2021-06-15T09:29:17.000Z | 2021-07-15T10:41:00.000Z | kw6/__init__.py | Aiwizo/kw6 | c079b2a57a07d9c56fefd90de65cf3f41d81e70f | [
"Apache-2.0"
] | null | null | null | from kw6.reader import Reader
from pkg_resources import get_distribution, DistributionNotFound
try:
__version__ = get_distribution("kw6").version
except DistributionNotFound:
pass
| 23.625 | 64 | 0.814815 | from kw6.reader import Reader
from pkg_resources import get_distribution, DistributionNotFound
try:
__version__ = get_distribution("kw6").version
except DistributionNotFound:
pass
| 0 | 0 | 0 |
8c88cd80bf347df648b894c24aa16ce5b07cee02 | 11,125 | py | Python | figures.py | mattjj/dirichlet-truncated-multinomial | 1b239e8960042bbf0f063d4f9e0400dfa6cb648b | [
"MIT"
] | 2 | 2020-07-24T20:50:29.000Z | 2020-07-26T08:30:42.000Z | figures.py | mattjj/dirichlet-truncated-multinomial | 1b239e8960042bbf0f063d4f9e0400dfa6cb648b | [
"MIT"
] | null | null | null | figures.py | mattjj/dirichlet-truncated-multinomial | 1b239e8960042bbf0f063d4f9e0400dfa6cb648b | [
"MIT"
] | null | null | null | from __future__ import division
from matplotlib import pyplot as plt
import numpy as np
na = np.newaxis
from scipy.interpolate import griddata
import simplex, dirichlet, sampling, tests, density, timing
allfigfuncs = []
SAVING = True
# plt.interactive(False)
#################################
# Figure-Generating Fun... | 39.874552 | 111 | 0.65609 | from __future__ import division
from matplotlib import pyplot as plt
import numpy as np
na = np.newaxis
from scipy.interpolate import griddata
import simplex, dirichlet, sampling, tests, density, timing
allfigfuncs = []
SAVING = True
# plt.interactive(False)
#################################
# Figure-Generating Fun... | 9,612 | 0 | 160 |
056005ab7f53638037cc2312b0332cac8f1847ec | 655 | py | Python | nad_logging_service/tests/logger/exception_test.py | KaiPrince/NAD-Logging-Service | f6310f459a1770a2a4664843cfdca5f05506cf66 | [
"MIT"
] | null | null | null | nad_logging_service/tests/logger/exception_test.py | KaiPrince/NAD-Logging-Service | f6310f459a1770a2a4664843cfdca5f05506cf66 | [
"MIT"
] | null | null | null | nad_logging_service/tests/logger/exception_test.py | KaiPrince/NAD-Logging-Service | f6310f459a1770a2a4664843cfdca5f05506cf66 | [
"MIT"
] | null | null | null | """
* Project Name: NAD-Logging-Service
* File Name: exception_test.py
* Programmer: Kai Prince
* Date: Sun, Nov 15, 2020
* Description: This file contains exception tests for the Logger app.
"""
import pytest
from .sample_data import exception_logs as sample_logs
@pytest.mark.parametrize("data", sample_logs)... | 21.129032 | 70 | 0.665649 | """
* Project Name: NAD-Logging-Service
* File Name: exception_test.py
* Programmer: Kai Prince
* Date: Sun, Nov 15, 2020
* Description: This file contains exception tests for the Logger app.
"""
import pytest
from .sample_data import exception_logs as sample_logs
@pytest.mark.parametrize("data", sample_logs)... | 0 | 0 | 0 |
16831f50a27decf1bee87652dafc18da6a10e031 | 1,604 | py | Python | zerver/lib/url_preview/oembed.py | pranayshahxyz/zulip | 3da483487af79fde9dce2d21124dfa39b94936a5 | [
"Apache-2.0"
] | 1 | 2020-03-19T00:52:48.000Z | 2020-03-19T00:52:48.000Z | zerver/lib/url_preview/oembed.py | pranayshahxyz/zulip | 3da483487af79fde9dce2d21124dfa39b94936a5 | [
"Apache-2.0"
] | null | null | null | zerver/lib/url_preview/oembed.py | pranayshahxyz/zulip | 3da483487af79fde9dce2d21124dfa39b94936a5 | [
"Apache-2.0"
] | 1 | 2020-07-06T11:43:28.000Z | 2020-07-06T11:43:28.000Z | from typing import Optional, Dict, Any
from pyoembed import oEmbed, PyOembedException
import json
| 32.734694 | 78 | 0.595387 | from typing import Optional, Dict, Any
from pyoembed import oEmbed, PyOembedException
import json
def get_oembed_data(url: str,
maxwidth: Optional[int]=640,
maxheight: Optional[int]=480) -> Optional[Dict[str, Any]]:
try:
data = oEmbed(url, maxwidth=maxwidth, maxheigh... | 1,460 | 0 | 46 |
e557939ae3675417623f858389f1ee28f2bb3c74 | 9,585 | py | Python | common/crypto_utils/avalon_crypto_utils/crypto_utility.py | karthikamurthy/avalon | 5aca5d6236f18ecf8c44ffe7ff9ada3640c1d6e2 | [
"Apache-2.0"
] | null | null | null | common/crypto_utils/avalon_crypto_utils/crypto_utility.py | karthikamurthy/avalon | 5aca5d6236f18ecf8c44ffe7ff9ada3640c1d6e2 | [
"Apache-2.0"
] | 1 | 2020-06-12T11:55:38.000Z | 2020-06-12T12:35:25.000Z | common/crypto_utils/avalon_crypto_utils/crypto_utility.py | pankajgoyal2/trusted-compute-framework | c060755995864f05516206e98c46e00e3826e425 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 34.981752 | 79 | 0.592175 | # Copyright 2020 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 460 | 0 | 88 |
594c3766a3d4935123686d1e634bf726cb601e9a | 1,020 | py | Python | mkt/zadmin/models.py | oremj/zamboni | a751dc6d22f7af947da327b0a091cbab0a999f49 | [
"BSD-3-Clause"
] | null | null | null | mkt/zadmin/models.py | oremj/zamboni | a751dc6d22f7af947da327b0a091cbab0a999f49 | [
"BSD-3-Clause"
] | null | null | null | mkt/zadmin/models.py | oremj/zamboni | a751dc6d22f7af947da327b0a091cbab0a999f49 | [
"BSD-3-Clause"
] | null | null | null | from django.db import models
from addons.models import Category
import amo
import mkt
from mkt.webapps.models import Webapp
| 30.909091 | 74 | 0.681373 | from django.db import models
from addons.models import Category
import amo
import mkt
from mkt.webapps.models import Webapp
class FeaturedApp(amo.models.ModelBase):
app = models.ForeignKey(Webapp, null=False)
category = models.ForeignKey(Category, null=True)
is_sponsor = models.BooleanField(default=Fal... | 0 | 821 | 69 |
753ec3ebf2072f47ab0e4ff3a93374bb9a709c8e | 372 | py | Python | QR_code_generator/qrcode.py | Wish1991/Python | 11b407ea1c47f63cb07dbf8cb90df93d2190821f | [
"MIT"
] | 1 | 2022-03-23T23:04:02.000Z | 2022-03-23T23:04:02.000Z | QR_code_generator/qrcode.py | Wish1991/Python | 11b407ea1c47f63cb07dbf8cb90df93d2190821f | [
"MIT"
] | null | null | null | QR_code_generator/qrcode.py | Wish1991/Python | 11b407ea1c47f63cb07dbf8cb90df93d2190821f | [
"MIT"
] | 1 | 2022-03-23T23:04:40.000Z | 2022-03-23T23:04:40.000Z | import pyqrcode
import png
from pyqrcode import QRCode
# Text which is to be converted to QR code
print("Enter text to convert")
s = input(": ")
# Name of QR code png file
print("Enter image name to save")
n = input(": ")
# Adding extension as .pnf
d = n + ".png"
# Creating QR code
url = pyqrcode.create(s)
# Saving QR... | 20.666667 | 42 | 0.69086 | import pyqrcode
import png
from pyqrcode import QRCode
# Text which is to be converted to QR code
print("Enter text to convert")
s = input(": ")
# Name of QR code png file
print("Enter image name to save")
n = input(": ")
# Adding extension as .pnf
d = n + ".png"
# Creating QR code
url = pyqrcode.create(s)
# Saving QR... | 0 | 0 | 0 |
fa39a00958f800d57a2c9d07e16cfacc1534663c | 413 | py | Python | advanced/decorator.py | djordjijeK/python-essentials | 51dac04ac44090ae01a65c5adb6c57f6f4d15189 | [
"Unlicense"
] | null | null | null | advanced/decorator.py | djordjijeK/python-essentials | 51dac04ac44090ae01a65c5adb6c57f6f4d15189 | [
"Unlicense"
] | null | null | null | advanced/decorator.py | djordjijeK/python-essentials | 51dac04ac44090ae01a65c5adb6c57f6f4d15189 | [
"Unlicense"
] | null | null | null | def log(funct):
"""
Logs the function.
"""
return wrapper
@log # decorator
if __name__ == '__main__':
f = log(multiply) # process and return `multipy` function.
print(f(2,5))
print(add(10, 7))
| 17.208333 | 65 | 0.566586 | def log(funct):
"""
Logs the function.
"""
def wrapper(*args, **kwargs):
print('Calling', funct.__name__)
return funct(*args, **kwargs)
return wrapper
@log # decorator
def add(x, y):
return x + y
def multiply(x, y):
return x*y
if __name__ == '__main__':
f = log(mu... | 110 | 0 | 71 |
1506ccd3ee1896c80a197be88f1e591912327e05 | 14,929 | py | Python | lib_pypy/_ctypes/primitive.py | olliemath/pypy | 8b873bd0b8bf76075aba3d915c260789f26f5788 | [
"Apache-2.0",
"OpenSSL"
] | null | null | null | lib_pypy/_ctypes/primitive.py | olliemath/pypy | 8b873bd0b8bf76075aba3d915c260789f26f5788 | [
"Apache-2.0",
"OpenSSL"
] | 1 | 2022-02-22T00:59:49.000Z | 2022-02-22T00:59:49.000Z | lib_pypy/_ctypes/primitive.py | olliemath/pypy | 8b873bd0b8bf76075aba3d915c260789f26f5788 | [
"Apache-2.0",
"OpenSSL"
] | 1 | 2022-03-30T11:42:37.000Z | 2022-03-30T11:42:37.000Z | from _rawffi import alt as _ffi
import _rawffi
import weakref
import sys
SIMPLE_TYPE_CHARS = "cbBhHiIlLdfguzZqQPXOv?"
from _ctypes.basics import (
_CData, _CDataMeta, cdata_from_address, CArgObject, sizeof)
from _ctypes.builtin import ConvMode
from _ctypes.array import Array, byteorder
from _ctypes.pointer import... | 33.699774 | 99 | 0.523947 | from _rawffi import alt as _ffi
import _rawffi
import weakref
import sys
SIMPLE_TYPE_CHARS = "cbBhHiIlLdfguzZqQPXOv?"
from _ctypes.basics import (
_CData, _CDataMeta, cdata_from_address, CArgObject, sizeof)
from _ctypes.builtin import ConvMode
from _ctypes.array import Array, byteorder
from _ctypes.pointer import... | 12,136 | 598 | 218 |
7291ac4c6404121ed688cb756ac95e7bc65b9fde | 7,645 | py | Python | tests/test_cassandra3.py | criteo-forks/testing.cassandra | f25bc20e0679849daae073c41281607e756e4d56 | [
"Apache-2.0"
] | 1 | 2021-02-18T04:58:04.000Z | 2021-02-18T04:58:04.000Z | tests/test_cassandra3.py | criteo-forks/testing.cassandra | f25bc20e0679849daae073c41281607e756e4d56 | [
"Apache-2.0"
] | null | null | null | tests/test_cassandra3.py | criteo-forks/testing.cassandra | f25bc20e0679849daae073c41281607e756e4d56 | [
"Apache-2.0"
] | 1 | 2018-07-10T13:06:46.000Z | 2018-07-10T13:06:46.000Z | # -*- coding: utf-8 -*-
import os
import sys
import signal
import cassandra.cluster as cassandra_cluster
import tempfile
import testing.cassandra3
from mock import patch
from time import sleep
from shutil import rmtree
if sys.version_info < (2, 7):
import unittest2 as unittest
else:
import unittest
| 34.75 | 114 | 0.650098 | # -*- coding: utf-8 -*-
import os
import sys
import signal
import cassandra.cluster as cassandra_cluster
import tempfile
import testing.cassandra3
from mock import patch
from time import sleep
from shutil import rmtree
if sys.version_info < (2, 7):
import unittest2 as unittest
else:
import unittest
class Te... | 6,648 | 663 | 23 |
f32d576af2373b821cd21cbecd7889f472c37d1f | 8,254 | py | Python | ding/reward_model/rnd_reward_model.py | jayyoung0802/DI-engine | efbb35ddaf184d1009291e6842fbbae09f193492 | [
"Apache-2.0"
] | null | null | null | ding/reward_model/rnd_reward_model.py | jayyoung0802/DI-engine | efbb35ddaf184d1009291e6842fbbae09f193492 | [
"Apache-2.0"
] | null | null | null | ding/reward_model/rnd_reward_model.py | jayyoung0802/DI-engine | efbb35ddaf184d1009291e6842fbbae09f193492 | [
"Apache-2.0"
] | null | null | null | from typing import Union, Tuple, List, Dict, Any
from easydict import EasyDict
import random
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from ding.utils import SequenceType, REWARD_MODEL_REGISTRY
from ding.model import FCEncoder, ConvEncoder
from .base_reward_model i... | 46.370787 | 118 | 0.663194 | from typing import Union, Tuple, List, Dict, Any
from easydict import EasyDict
import random
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from ding.utils import SequenceType, REWARD_MODEL_REGISTRY
from ding.model import FCEncoder, ConvEncoder
from .base_reward_model i... | 3,074 | 4,572 | 122 |
9705b305739f77edfc4d4a38d56f9a475f434e5b | 4,830 | py | Python | pychron/classifier/isotope_trainer.py | ASUPychron/pychron | dfe551bdeb4ff8b8ba5cdea0edab336025e8cc76 | [
"Apache-2.0"
] | 31 | 2016-03-07T02:38:17.000Z | 2022-02-14T18:23:43.000Z | pychron/classifier/isotope_trainer.py | ASUPychron/pychron | dfe551bdeb4ff8b8ba5cdea0edab336025e8cc76 | [
"Apache-2.0"
] | 1,626 | 2015-01-07T04:52:35.000Z | 2022-03-25T19:15:59.000Z | pychron/classifier/isotope_trainer.py | UIllinoisHALPychron/pychron | f21b79f4592a9fb9dc9a4cb2e4e943a3885ededc | [
"Apache-2.0"
] | 26 | 2015-05-23T00:10:06.000Z | 2022-03-07T16:51:57.000Z | # ===============================================================================
# Copyright 2015 Jake Ross
#
# 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... | 32.416107 | 86 | 0.52029 | # ===============================================================================
# Copyright 2015 Jake Ross
#
# 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... | 2,841 | 398 | 126 |
1c697e22fa7daef87d2323415a45758719dc0eb3 | 11,875 | py | Python | song_text_widget.py | maccesch/songscreen | de10f1d4cb0489d56861eaf633cf61d75dfd51c7 | [
"BSD-3-Clause-Clear"
] | 2 | 2016-03-30T15:42:35.000Z | 2017-03-05T13:26:55.000Z | song_text_widget.py | maccesch/songscreen | de10f1d4cb0489d56861eaf633cf61d75dfd51c7 | [
"BSD-3-Clause-Clear"
] | null | null | null | song_text_widget.py | maccesch/songscreen | de10f1d4cb0489d56861eaf633cf61d75dfd51c7 | [
"BSD-3-Clause-Clear"
] | null | null | null | from operator import attrgetter
from PyQt5.QtCore import Qt, QRectF, QAbstractAnimation, QPropertyAnimation, QEasingCurve
from PyQt5.QtGui import QPen, QBrush, QColor, QPainter, QFont, QFontMetricsF, QTransform
from PyQt5.QtWidgets import QGraphicsObject, QGraphicsView, QSizePolicy, QGraphicsScene
from marker_mixin i... | 36.314985 | 130 | 0.635789 | from operator import attrgetter
from PyQt5.QtCore import Qt, QRectF, QAbstractAnimation, QPropertyAnimation, QEasingCurve
from PyQt5.QtGui import QPen, QBrush, QColor, QPainter, QFont, QFontMetricsF, QTransform
from PyQt5.QtWidgets import QGraphicsObject, QGraphicsView, QSizePolicy, QGraphicsScene
from marker_mixin i... | 10,688 | 721 | 126 |
72d434e21fa91e7cedeb6a72ca4b69bf41ba142f | 7,173 | py | Python | dataedit.py | dnsbob/password-dongle | a2e04ec4bd370401a14d55fedf2ea9da065fc4cf | [
"Apache-2.0"
] | null | null | null | dataedit.py | dnsbob/password-dongle | a2e04ec4bd370401a14d55fedf2ea9da065fc4cf | [
"Apache-2.0"
] | null | null | null | dataedit.py | dnsbob/password-dongle | a2e04ec4bd370401a14d55fedf2ea9da065fc4cf | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
'''
dataedit.py
menu password edit for passworddongle.py
'''
import time
import random
import getpass
import json
# all printable ascii chars, plus space, except double quote, tab, backslash
mychars="`aZ0+nM<bY1!oL>cX2@pK;dW3#qJ:eV4$rI'fU5%sH[gT6^tG]hS7&uF{iR8*vE}jQ9(wD-kP,)xC=lO.~yB_mN/ zA"
my... | 32.753425 | 101 | 0.500209 | #!/usr/bin/env python3
'''
dataedit.py
menu password edit for passworddongle.py
'''
import time
import random
import getpass
import json
# all printable ascii chars, plus space, except double quote, tab, backslash
mychars="`aZ0+nM<bY1!oL>cX2@pK;dW3#qJ:eV4$rI'fU5%sH[gT6^tG]hS7&uF{iR8*vE}jQ9(wD-kP,)xC=lO.~yB_mN/ zA"
my... | 4,244 | 0 | 138 |
1ffcc5a067d5b5c360ec8a38fa4992ad81a61a36 | 929 | py | Python | 34/__init__.py | sc4599/LeetCode | a2ce242e20e485cc8f6cc6083f4993332d414bbf | [
"MIT"
] | null | null | null | 34/__init__.py | sc4599/LeetCode | a2ce242e20e485cc8f6cc6083f4993332d414bbf | [
"MIT"
] | null | null | null | 34/__init__.py | sc4599/LeetCode | a2ce242e20e485cc8f6cc6083f4993332d414bbf | [
"MIT"
] | null | null | null |
import unittest
if __name__ == "__main__":
unittest.main() | 24.447368 | 51 | 0.53606 | class Solution(object):
def searchRange(self, nums, target):
"""
:type nums: List[int]
:type target: int
:rtype: List[int]
"""
count = 0
first_position = -1
last_position = -1
if target in nums:
first_position = nums.index(target)
... | 195 | 596 | 71 |
c458f982932f71bc17123edf426223766b7d5c2f | 147 | py | Python | test/factorial.py | radiilab/Rad-lang | 39eb4762c5bfea8537f4f269a2e8457dd5409e3a | [
"BSD-3-Clause"
] | 1 | 2019-07-18T23:30:38.000Z | 2019-07-18T23:30:38.000Z | test/factorial.py | radiilab/Rad-lang | 39eb4762c5bfea8537f4f269a2e8457dd5409e3a | [
"BSD-3-Clause"
] | null | null | null | test/factorial.py | radiilab/Rad-lang | 39eb4762c5bfea8537f4f269a2e8457dd5409e3a | [
"BSD-3-Clause"
] | null | null | null | end
print factorial(5) # should output 120
| 14.7 | 40 | 0.557823 | def factorial(n):
if n < 1:
return 1
else:
return n * factorial(n-1)
end
end
print factorial(5) # should output 120
| 79 | 0 | 22 |
bf27071cdd5a17a6a5d80fc5d40d8393c9bb5247 | 4,537 | py | Python | src/sleuthdeck/actions.py | sleuth-io/sleuth-deck | 289b9967e7d395de8aa05268eb5e686b67285c1e | [
"Apache-2.0"
] | null | null | null | src/sleuthdeck/actions.py | sleuth-io/sleuth-deck | 289b9967e7d395de8aa05268eb5e686b67285c1e | [
"Apache-2.0"
] | null | null | null | src/sleuthdeck/actions.py | sleuth-io/sleuth-deck | 289b9967e7d395de8aa05268eb5e686b67285c1e | [
"Apache-2.0"
] | null | null | null | from __future__ import annotations
import signal
import subprocess
from time import sleep
from typing import Optional, Union, Tuple
from PIL.Image import Image
from pyautogui import hotkey
from sleuthdeck.deck import Action
from sleuthdeck.deck import ClickType
from sleuthdeck.deck import Key
from sleuthdeck.deck imp... | 29.083333 | 93 | 0.638748 | from __future__ import annotations
import signal
import subprocess
from time import sleep
from typing import Optional, Union, Tuple
from PIL.Image import Image
from pyautogui import hotkey
from sleuthdeck.deck import Action
from sleuthdeck.deck import ClickType
from sleuthdeck.deck import Key
from sleuthdeck.deck imp... | 3,087 | 54 | 934 |
59f02b823d905cf3630bb0e8dff47036b37d5821 | 1,582 | py | Python | pages/insights.py | illicitDev/kepler-observations | c520632f8abc091511259cea83dacdb4aa0d6a4a | [
"MIT"
] | null | null | null | pages/insights.py | illicitDev/kepler-observations | c520632f8abc091511259cea83dacdb4aa0d6a4a | [
"MIT"
] | null | null | null | pages/insights.py | illicitDev/kepler-observations | c520632f8abc091511259cea83dacdb4aa0d6a4a | [
"MIT"
] | null | null | null | # Imports from 3rd party libraries
import dash
import dash_bootstrap_components as dbc
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
# Imports from this application
from app import app
# 1 column layout
# https://dash-bootstrap-components.opensource... | 36.790698 | 134 | 0.639697 | # Imports from 3rd party libraries
import dash
import dash_bootstrap_components as dbc
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
# Imports from this application
from app import app
# 1 column layout
# https://dash-bootstrap-components.opensource... | 0 | 0 | 0 |
9bae94530088cda6422abe15142ca4a38cf8641a | 2,551 | py | Python | code.py | Moreyash/olympic-hero | 091ee3a95fd128060c1781922d027ee02a06e7ce | [
"MIT"
] | null | null | null | code.py | Moreyash/olympic-hero | 091ee3a95fd128060c1781922d027ee02a06e7ce | [
"MIT"
] | null | null | null | code.py | Moreyash/olympic-hero | 091ee3a95fd128060c1781922d027ee02a06e7ce | [
"MIT"
] | null | null | null | # --------------
#Importing header files
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
#Path of the file
path
data=pd.read_csv(path).rename(columns={'Total':'Total_Medals'})
data.head(10)
#Code starts here
# --------------
#Code starts here
data['Better_Event']=np.whe... | 22.182609 | 163 | 0.693062 | # --------------
#Importing header files
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
#Path of the file
path
data=pd.read_csv(path).rename(columns={'Total':'Total_Medals'})
data.head(10)
#Code starts here
# --------------
#Code starts here
data['Better_Event']=np.whe... | 111 | 0 | 25 |
321be22ce44c5c5bcb005091a744cd129736f3a8 | 48 | py | Python | code/main.py | famaxth/Random.py | f8806ecf5b73be2cafe7e956d52bd8da54d715ac | [
"Unlicense"
] | null | null | null | code/main.py | famaxth/Random.py | f8806ecf5b73be2cafe7e956d52bd8da54d715ac | [
"Unlicense"
] | null | null | null | code/main.py | famaxth/Random.py | f8806ecf5b73be2cafe7e956d52bd8da54d715ac | [
"Unlicense"
] | null | null | null | import random
print(random.randint(1, 100))
| 12 | 30 | 0.708333 | import random
print(random.randint(1, 100))
| 0 | 0 | 0 |
ac84f7fdf5aaab9edad6d5a0f1b53873e9010961 | 283 | py | Python | web/autoapp.py | ChristoferHuynh/web | a7b92e5c8c3a85c6ab8182571cc4186a50b67df6 | [
"BSD-3-Clause"
] | null | null | null | web/autoapp.py | ChristoferHuynh/web | a7b92e5c8c3a85c6ab8182571cc4186a50b67df6 | [
"BSD-3-Clause"
] | null | null | null | web/autoapp.py | ChristoferHuynh/web | a7b92e5c8c3a85c6ab8182571cc4186a50b67df6 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""Create an application instance."""
from flask.helpers import get_debug_flag
from web.app import create_app
from web.settings import DevConfig, ProdConfig
#CONFIG = DevConfig if get_debug_flag() else ProdConfig
CONFIG = DevConfig
app = create_app(CONFIG)
| 25.727273 | 55 | 0.770318 | # -*- coding: utf-8 -*-
"""Create an application instance."""
from flask.helpers import get_debug_flag
from web.app import create_app
from web.settings import DevConfig, ProdConfig
#CONFIG = DevConfig if get_debug_flag() else ProdConfig
CONFIG = DevConfig
app = create_app(CONFIG)
| 0 | 0 | 0 |
c565bed72f6369a687a95b3bac63f41b5356c413 | 94 | py | Python | tracking/dummy.py | athrn/kognitivo | 15822338778213c09ea654ec4e06a300129f9478 | [
"Apache-2.0"
] | 80 | 2017-11-13T21:58:55.000Z | 2022-01-03T20:10:42.000Z | tracking/dummy.py | athrn/kognitivo | 15822338778213c09ea654ec4e06a300129f9478 | [
"Apache-2.0"
] | null | null | null | tracking/dummy.py | athrn/kognitivo | 15822338778213c09ea654ec4e06a300129f9478 | [
"Apache-2.0"
] | 21 | 2017-11-14T09:47:41.000Z | 2021-11-23T06:44:31.000Z | from tracking.abstract import AbstractTracker
| 15.666667 | 45 | 0.819149 | from tracking.abstract import AbstractTracker
class DummyTracker(AbstractTracker):
pass
| 0 | 24 | 23 |
74e0b709e83e18377aa4305b9ecdb1dfc071a640 | 510 | py | Python | 30-days-of-code/day8-dictionaries.py | kasimte/hackerrank | d43e6bb91428488b35fc344893612da631e0e770 | [
"MIT"
] | null | null | null | 30-days-of-code/day8-dictionaries.py | kasimte/hackerrank | d43e6bb91428488b35fc344893612da631e0e770 | [
"MIT"
] | null | null | null | 30-days-of-code/day8-dictionaries.py | kasimte/hackerrank | d43e6bb91428488b35fc344893612da631e0e770 | [
"MIT"
] | null | null | null | # https://www.hackerrank.com/challenges/30-dictionaries-and-maps/problem
# Enter your code here. Read input from STDIN. Print output to STDOUT
n = int(input())
book = {}
for x in range(0,n):
line = input().split()
book[line[0]] = line[1]
while True:
try:
line = input().split()
name = lin... | 22.173913 | 72 | 0.558824 | # https://www.hackerrank.com/challenges/30-dictionaries-and-maps/problem
# Enter your code here. Read input from STDIN. Print output to STDOUT
n = int(input())
book = {}
for x in range(0,n):
line = input().split()
book[line[0]] = line[1]
while True:
try:
line = input().split()
name = lin... | 0 | 0 | 0 |
70ddec5a00a2079779e22798a547a9b46b167c08 | 14,937 | py | Python | lorentz.py | theSage21/lorentz-embeddings | deb57587af284087045dcb9f4c6d4b140965d172 | [
"MIT"
] | 66 | 2019-02-20T06:29:29.000Z | 2022-03-07T21:58:59.000Z | lorentz.py | theSage21/lorentz-embeddings | deb57587af284087045dcb9f4c6d4b140965d172 | [
"MIT"
] | 6 | 2019-02-17T16:10:44.000Z | 2021-07-29T12:46:46.000Z | lorentz.py | theSage21/lorentz-embeddings | deb57587af284087045dcb9f4c6d4b140965d172 | [
"MIT"
] | 14 | 2019-02-13T09:03:35.000Z | 2021-11-08T15:25:03.000Z | import os
import sys
import torch
import random
import numpy as np
from torch import nn
from torch import optim
from tqdm import trange, tqdm
from collections import Counter
from datetime import datetime
from tensorboardX import SummaryWriter
from torch.utils.data import Dataset, DataLoader
import matplotlib
matplotl... | 34.656613 | 88 | 0.54991 | import os
import sys
import torch
import random
import numpy as np
from torch import nn
from torch import optim
from tqdm import trange, tqdm
from collections import Counter
from datetime import datetime
from tensorboardX import SummaryWriter
from torch.utils.data import Dataset, DataLoader
import matplotlib
matplotl... | 4,536 | 7 | 425 |
27881eb6fa948140af012299c81579cdcda82f22 | 519 | py | Python | Python/retest.py | yutakakn/MyScript | cb40e0077fdce1d64f658227952ae1654e7510ae | [
"BSD-3-Clause"
] | null | null | null | Python/retest.py | yutakakn/MyScript | cb40e0077fdce1d64f658227952ae1654e7510ae | [
"BSD-3-Clause"
] | null | null | null | Python/retest.py | yutakakn/MyScript | cb40e0077fdce1d64f658227952ae1654e7510ae | [
"BSD-3-Clause"
] | 2 | 2017-07-19T15:26:19.000Z | 2017-07-19T15:50:59.000Z | # coding: utf-8
#
# Pythonでの正規表現サンプル
#
# Update: 2018/3/21
#
import re
# 検索対象のテキスト
textdata = '''
Welcome to Infra workshop!
Kusotsui
Hikariare
Misogi
Misogi999
Misogi9999
'''.strip()
# print m.groups(0)
# メインルーチン
if __name__ == "__main__":
main()
| 12.658537 | 34 | 0.635838 | # coding: utf-8
#
# Pythonでの正規表現サンプル
#
# Update: 2018/3/21
#
import re
# 検索対象のテキスト
textdata = '''
Welcome to Infra workshop!
Kusotsui
Hikariare
Misogi
Misogi999
Misogi9999
'''.strip()
def displaymatch(m):
if (m is None):
print('No match')
else:
print('Match: %r, groups=%r'
% (m.group(), m.groups())
)
# ... | 223 | 0 | 46 |
f8d3247de75c172564bcdc54e2ae4384a81a46f1 | 91 | py | Python | benefits/apps.py | linikerunk/tcc-people-analytics | fdda975682d5299c8384e31ebb974dc085330875 | [
"MIT"
] | null | null | null | benefits/apps.py | linikerunk/tcc-people-analytics | fdda975682d5299c8384e31ebb974dc085330875 | [
"MIT"
] | 1 | 2020-10-11T10:09:39.000Z | 2020-10-11T10:09:39.000Z | benefits/apps.py | linikerunk/TCC_PeopleAnalytics | fdda975682d5299c8384e31ebb974dc085330875 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
| 15.166667 | 33 | 0.758242 | from django.apps import AppConfig
class BenefitsConfig(AppConfig):
name = 'benefits'
| 0 | 33 | 23 |
5ea1c26b7f60345f58e78ab7f9520a367c9920ad | 1,313 | py | Python | caching.py | kudep/df_addon_turn_caching | f70bba0a8c60a92fab836605431b2bd8a4f6bc83 | [
"Apache-2.0"
] | null | null | null | caching.py | kudep/df_addon_turn_caching | f70bba0a8c60a92fab836605431b2bd8a4f6bc83 | [
"Apache-2.0"
] | null | null | null | caching.py | kudep/df_addon_turn_caching | f70bba0a8c60a92fab836605431b2bd8a4f6bc83 | [
"Apache-2.0"
] | null | null | null | """
Caching
---------------------------
"""
import functools
from df_engine.core import Actor, Context
from df_engine.core.types import ActorStage
class OneTurnCache:
"""
Class that caches the information from the last turn.
"""
| 26.795918 | 79 | 0.620716 | """
Caching
---------------------------
"""
import functools
from df_engine.core import Actor, Context
from df_engine.core.types import ActorStage
class OneTurnCache:
"""
Class that caches the information from the last turn.
"""
def __init__(self):
self.wrappers = []
def update_actor_h... | 933 | 0 | 135 |
85d5dd82fb31e2230af5808895e2ef4990361f83 | 4,854 | py | Python | multiple_pattern_durations/code/filter_results.py | INM-6/SPADE_applications | 1633907a5c8c295f758a07fe4d594efbfa94155e | [
"BSD-3-Clause"
] | 2 | 2020-04-10T08:47:32.000Z | 2020-10-10T01:30:18.000Z | multiple_pattern_durations/code/filter_results.py | INM-6/SPADE_applications | 1633907a5c8c295f758a07fe4d594efbfa94155e | [
"BSD-3-Clause"
] | 1 | 2020-10-10T10:08:43.000Z | 2021-02-05T06:57:11.000Z | multiple_pattern_durations/code/filter_results.py | INM-6/SPADE_applications | 1633907a5c8c295f758a07fe4d594efbfa94155e | [
"BSD-3-Clause"
] | 2 | 2020-10-10T05:21:28.000Z | 2021-08-25T09:56:50.000Z | import numpy as np
import elephant.spade as spade
import argparse
import yaml
from yaml import Loader
# Function to filter patterns when the output format of spade function
# is 'patterns'
def _pattern_spectrum_filter(patterns, ns_signature, spectrum, winlen):
"""
Filter to select concept which signature is s... | 42.578947 | 83 | 0.54965 | import numpy as np
import elephant.spade as spade
import argparse
import yaml
from yaml import Loader
# Function to filter patterns when the output format of spade function
# is 'patterns'
def _pattern_spectrum_filter(patterns, ns_signature, spectrum, winlen):
"""
Filter to select concept which signature is s... | 0 | 0 | 0 |
ed71b3a65a656d7d6424d6da1dcc78046962b2fd | 4,635 | py | Python | OAparser.py | mickolaine/OAstats | 6d8f8677fb9f807cfcd4f18f894d983c872983bf | [
"Unlicense"
] | null | null | null | OAparser.py | mickolaine/OAstats | 6d8f8677fb9f807cfcd4f18f894d983c872983bf | [
"Unlicense"
] | null | null | null | OAparser.py | mickolaine/OAstats | 6d8f8677fb9f807cfcd4f18f894d983c872983bf | [
"Unlicense"
] | null | null | null | """
Parser handles reading and interpreting the OA logfile
"""
from player import Player | 30.493421 | 142 | 0.480475 | """
Parser handles reading and interpreting the OA logfile
"""
from player import Player
class Parser:
def __init__(self, logfile):
self.logfile = logfile
self.loglist = []
self.log = []
self.players = {}
self.open()
self.get_timecodes()
self.get_comm... | 4,218 | 305 | 23 |
c1741bf2d02de78900fad92c0710ae53ffbbf44b | 528 | py | Python | cla_backend/apps/legalaid/migrations/0009_remove_case_old_eod_details.py | uk-gov-mirror/ministryofjustice.cla_backend | 4d524c10e7bd31f085d9c5f7bf6e08a6bb39c0a6 | [
"MIT"
] | 3 | 2019-10-02T15:31:03.000Z | 2022-01-13T10:15:53.000Z | cla_backend/apps/legalaid/migrations/0009_remove_case_old_eod_details.py | uk-gov-mirror/ministryofjustice.cla_backend | 4d524c10e7bd31f085d9c5f7bf6e08a6bb39c0a6 | [
"MIT"
] | 206 | 2015-01-02T16:50:11.000Z | 2022-02-16T20:16:05.000Z | cla_backend/apps/legalaid/migrations/0009_remove_case_old_eod_details.py | uk-gov-mirror/ministryofjustice.cla_backend | 4d524c10e7bd31f085d9c5f7bf6e08a6bb39c0a6 | [
"MIT"
] | 6 | 2015-03-23T23:08:42.000Z | 2022-02-15T17:04:44.000Z | # coding=utf-8
from __future__ import unicode_literals
from django.db import models, migrations
| 26.4 | 87 | 0.660985 | # coding=utf-8
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [("legalaid", "0008_eod_data_migration")]
operations = [
migrations.RemoveField(model_name="case", name="old_eod_details"),
migrations.AlterF... | 0 | 407 | 23 |
edc0c4f5c8e1beb9abd5438d714fc99b83402b63 | 702 | py | Python | tests/internet_search_demo.py | xiaobuguilaile/service-oriented-chatbot | 3966b4fa1c2ee9bf5544b11a0241df9f3fa6ec2a | [
"MIT"
] | null | null | null | tests/internet_search_demo.py | xiaobuguilaile/service-oriented-chatbot | 3966b4fa1c2ee9bf5544b11a0241df9f3fa6ec2a | [
"MIT"
] | null | null | null | tests/internet_search_demo.py | xiaobuguilaile/service-oriented-chatbot | 3966b4fa1c2ee9bf5544b11a0241df9f3fa6ec2a | [
"MIT"
] | null | null | null | # -*-coding:utf-8 -*-
'''
@File : internet_search_demo.py
@Author : HW Shen
@Date : 2020/5/26
@Desc :
'''
from ServiceOrientedChatbot.search_dialog import SearchEngine
from ServiceOrientedChatbot.utils import logger
if __name__ == '__main__':
engine = SearchEngine()
logger.debug(engi... | 21.9375 | 61 | 0.632479 | # -*-coding:utf-8 -*-
'''
@File : internet_search_demo.py
@Author : HW Shen
@Date : 2020/5/26
@Desc :
'''
from ServiceOrientedChatbot.search_dialog import SearchEngine
from ServiceOrientedChatbot.utils import logger
if __name__ == '__main__':
engine = SearchEngine()
logger.debug(engi... | 0 | 0 | 0 |
ba66223be12038ddd3602f3150abab92c7d6c0c4 | 5,502 | py | Python | openmdao/devtools/iprof_utils.py | hwangjt/blue | 609defbe476c86a4a2eddd12977b47e649ea7f50 | [
"Apache-2.0"
] | null | null | null | openmdao/devtools/iprof_utils.py | hwangjt/blue | 609defbe476c86a4a2eddd12977b47e649ea7f50 | [
"Apache-2.0"
] | null | null | null | openmdao/devtools/iprof_utils.py | hwangjt/blue | 609defbe476c86a4a2eddd12977b47e649ea7f50 | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
import os
import sys
import ast
from inspect import getmembers
from fnmatch import fnmatchcase
from collections import defaultdict
from openmdao.core.system import System
from openmdao.core.problem import Problem
from openmdao.core.driver import Driver
from openmdao.solvers.solv... | 30.230769 | 108 | 0.614686 | from __future__ import print_function
import os
import sys
import ast
from inspect import getmembers
from fnmatch import fnmatchcase
from collections import defaultdict
from openmdao.core.system import System
from openmdao.core.problem import Problem
from openmdao.core.driver import Driver
from openmdao.solvers.solv... | 1,065 | 0 | 106 |
7539d6048376b2a8eb5311e0e53339fd000755eb | 1,261 | py | Python | tests/heap_profiler_test.py | ROCmSoftwarePlatform/jax | be34a14dc40384ac8876fad2b23b5e205ccfe22e | [
"Apache-2.0"
] | 7 | 2020-12-04T16:54:54.000Z | 2022-02-15T07:26:56.000Z | tests/heap_profiler_test.py | ROCmSoftwarePlatform/jax | be34a14dc40384ac8876fad2b23b5e205ccfe22e | [
"Apache-2.0"
] | 20 | 2021-08-17T20:31:56.000Z | 2022-03-31T11:56:24.000Z | tests/heap_profiler_test.py | ROCmSoftwarePlatform/jax | be34a14dc40384ac8876fad2b23b5e205ccfe22e | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 28.659091 | 78 | 0.750991 | # Copyright 2021 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 238 | 21 | 48 |
538398ac392be8d56ff9a45cc270efad1b75ff36 | 1,378 | py | Python | HANDWRITING/model.py | MacuXavier/S1_ML_Practices | 4cd29c5537c95cfd940e13e741db8d363c57ab1d | [
"Apache-2.0"
] | null | null | null | HANDWRITING/model.py | MacuXavier/S1_ML_Practices | 4cd29c5537c95cfd940e13e741db8d363c57ab1d | [
"Apache-2.0"
] | null | null | null | HANDWRITING/model.py | MacuXavier/S1_ML_Practices | 4cd29c5537c95cfd940e13e741db8d363c57ab1d | [
"Apache-2.0"
] | null | null | null | '''
Author: MJ.XU
Date: 2021-11-29 17:16:33
LastEditTime: 2021-12-18 23:28:25
LastEditors: MJ.XU
Description: Tech4better
FilePath: \Tutorial-HandWriting-Cls-master\model.py
Personal URL: https://www.squirrelled.cn/
'''
# pytorch related packages
import torch
import torch.nn as nn
import torch.nn.functional as F
# Mo... | 29.956522 | 79 | 0.576923 | '''
Author: MJ.XU
Date: 2021-11-29 17:16:33
LastEditTime: 2021-12-18 23:28:25
LastEditors: MJ.XU
Description: Tech4better
FilePath: \Tutorial-HandWriting-Cls-master\model.py
Personal URL: https://www.squirrelled.cn/
'''
# pytorch related packages
import torch
import torch.nn as nn
import torch.nn.functional as F
# Mo... | 968 | 0 | 75 |
867d8fefb40283c3ae65dc325f1f0f4d512cb133 | 3,481 | py | Python | src/data/Bert.py | VictorCallejas/FB_MMHM | 9a2d4a990a51811406bec9dc76dde612e5ec1c5c | [
"MIT"
] | 4 | 2020-11-19T18:52:23.000Z | 2022-01-05T02:36:14.000Z | src/data/Bert.py | VictorCallejas/FB_MMHM | 9a2d4a990a51811406bec9dc76dde612e5ec1c5c | [
"MIT"
] | null | null | null | src/data/Bert.py | VictorCallejas/FB_MMHM | 9a2d4a990a51811406bec9dc76dde612e5ec1c5c | [
"MIT"
] | 1 | 2020-11-20T08:35:31.000Z | 2020-11-20T08:35:31.000Z | import pandas as pd
import torch
from torch.utils.data import TensorDataset, DataLoader, RandomSampler, SequentialSampler
from data.utils import get_Data, calculate_max_len, get_tokenized
from transformers import AutoTokenizer
from config import cfg, BertConfig
| 36.260417 | 116 | 0.673082 | import pandas as pd
import torch
from torch.utils.data import TensorDataset, DataLoader, RandomSampler, SequentialSampler
from data.utils import get_Data, calculate_max_len, get_tokenized
from transformers import AutoTokenizer
from config import cfg, BertConfig
def getData(fold_idx):
train, dev, ... | 3,107 | 0 | 99 |
34f33bc559f7e13b93d515ea080396c7ef24cad3 | 1,973 | py | Python | test/test_connection.py | abudarevsky/solrcloudpy | 8ba59f1079d9b4efab03ddc892337a467c9671b2 | [
"BSD-3-Clause"
] | null | null | null | test/test_connection.py | abudarevsky/solrcloudpy | 8ba59f1079d9b4efab03ddc892337a467c9671b2 | [
"BSD-3-Clause"
] | null | null | null | test/test_connection.py | abudarevsky/solrcloudpy | 8ba59f1079d9b4efab03ddc892337a467c9671b2 | [
"BSD-3-Clause"
] | null | null | null | import os
import time
import unittest
from solr_instance import SolrInstance
from solrcloudpy import SolrCollection, SolrConnection
solrprocess = None
if __name__ == "__main__":
unittest.main()
| 29.447761 | 78 | 0.671566 | import os
import time
import unittest
from solr_instance import SolrInstance
from solrcloudpy import SolrCollection, SolrConnection
solrprocess = None
class TestConnection(unittest.TestCase):
def setUp(self):
self.conn = SolrConnection(version=os.getenv("SOLR_VERSION", "6.1.0"))
self.collparams ... | 1,519 | 19 | 230 |
a28f6c929b4e051e721250e8f3d1e7cb4d98de6a | 1,252 | py | Python | docs/conf.py | LevinZ2016/pyvinecopulib | e8fc0e6805daa71ab3fa1e03fd257a9f4063605d | [
"MIT"
] | null | null | null | docs/conf.py | LevinZ2016/pyvinecopulib | e8fc0e6805daa71ab3fa1e03fd257a9f4063605d | [
"MIT"
] | null | null | null | docs/conf.py | LevinZ2016/pyvinecopulib | e8fc0e6805daa71ab3fa1e03fd257a9f4063605d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# pyvinecopulib documentation build configuration file
# Sphinx extension modules
from pkg_resources import get_distribution
# -- General configuration ------------------------------------------------
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.githubpages',
'sphinx.ext.mat... | 21.964912 | 78 | 0.683706 | # -*- coding: utf-8 -*-
#
# pyvinecopulib documentation build configuration file
# Sphinx extension modules
from pkg_resources import get_distribution
# -- General configuration ------------------------------------------------
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.githubpages',
'sphinx.ext.mat... | 0 | 0 | 0 |
602b7684bce5d19dfcadd0ec598781b30fb4448c | 14,439 | py | Python | src/parse_args.py | dertilo/MultiHopKG | ee103c10c633ab808f063b0d3d8a4b3388b21aa5 | [
"BSD-3-Clause"
] | null | null | null | src/parse_args.py | dertilo/MultiHopKG | ee103c10c633ab808f063b0d3d8a4b3388b21aa5 | [
"BSD-3-Clause"
] | null | null | null | src/parse_args.py | dertilo/MultiHopKG | ee103c10c633ab808f063b0d3d8a4b3388b21aa5 | [
"BSD-3-Clause"
] | 1 | 2020-02-03T09:39:44.000Z | 2020-02-03T09:39:44.000Z | """
Copyright (c) 2018, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
Experiment Hyperparameters.
"""
import argparse
import os
parser = argparse.ArgumentParser(
d... | 26.689464 | 109 | 0.689037 | """
Copyright (c) 2018, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
Experiment Hyperparameters.
"""
import argparse
import os
parser = argparse.ArgumentParser(
d... | 0 | 0 | 0 |
48575c772d18785191b360395e995f192472cd72 | 642 | py | Python | db/mongo_connection.py | stivenramireza/airflow-service | 8945fc7062cfedec855ba421d5a417ca0cbf9b67 | [
"MIT"
] | null | null | null | db/mongo_connection.py | stivenramireza/airflow-service | 8945fc7062cfedec855ba421d5a417ca0cbf9b67 | [
"MIT"
] | null | null | null | db/mongo_connection.py | stivenramireza/airflow-service | 8945fc7062cfedec855ba421d5a417ca0cbf9b67 | [
"MIT"
] | null | null | null | from pymongo import MongoClient | 29.181818 | 73 | 0.67757 | from pymongo import MongoClient
class MongoConnection:
__instance = None
def __init__(self, url_conn: str) -> None:
self.url_conn = url_conn
if MongoConnection.__instance is None:
MongoConnection.__instance = MongoClient(url_conn)
else:
raise Exception('You can... | 447 | 141 | 23 |
73489b4fbb0f389aa5ee1c07ce8d7a8eda40e35e | 846 | py | Python | metadeploy/api/management/commands/tests/truncate_data.py | sfdc-qbranch/MetaDeploy | d22547b3814dbec6aefa4d86b9f81c6f175c1b67 | [
"BSD-3-Clause"
] | 33 | 2019-03-20T15:34:39.000Z | 2022-03-30T15:59:40.000Z | metadeploy/api/management/commands/tests/truncate_data.py | sfdc-qbranch/MetaDeploy | d22547b3814dbec6aefa4d86b9f81c6f175c1b67 | [
"BSD-3-Clause"
] | 2,718 | 2019-02-27T19:46:07.000Z | 2022-03-11T23:18:09.000Z | metadeploy/api/management/commands/tests/truncate_data.py | sfdc-qbranch/MetaDeploy | d22547b3814dbec6aefa4d86b9f81c6f175c1b67 | [
"BSD-3-Clause"
] | 28 | 2019-03-28T04:57:16.000Z | 2022-02-04T16:49:25.000Z | import pytest
from django.core.management import call_command
from ....models import (
Plan,
PlanSlug,
Product,
ProductCategory,
ProductSlug,
Step,
Version,
)
@pytest.mark.django_db
| 23.5 | 54 | 0.699764 | import pytest
from django.core.management import call_command
from ....models import (
Plan,
PlanSlug,
Product,
ProductCategory,
ProductSlug,
Step,
Version,
)
@pytest.mark.django_db
def test_truncate_data(product_factory, step_factory):
p1 = product_factory()
p2 = product_factory(... | 611 | 0 | 22 |
8aab240ab7b20f968d87a6141bb0f294e611b3d5 | 329 | py | Python | Algorithms/DynamicProgramming/maximum-difference-zeros-ones-binary-string-set-2-time.py | Sangeerththan/pythonDSA | d126b3a7a8acc1e202107e20a21ed96fb4ab144e | [
"MIT"
] | 1 | 2021-09-12T20:40:37.000Z | 2021-09-12T20:40:37.000Z | Algorithms/DynamicProgramming/maximum-difference-zeros-ones-binary-string-set-2-time.py | Sangeerththan/pythonDataStructure | d126b3a7a8acc1e202107e20a21ed96fb4ab144e | [
"MIT"
] | null | null | null | Algorithms/DynamicProgramming/maximum-difference-zeros-ones-binary-string-set-2-time.py | Sangeerththan/pythonDataStructure | d126b3a7a8acc1e202107e20a21ed96fb4ab144e | [
"MIT"
] | null | null | null |
s = "11000010001"
n = 11
print(findLength(s, n))
| 21.933333 | 54 | 0.583587 | def findLength(string, n):
current_sum = 0
max_sum = 0
for i in range(n):
current_sum += (1 if string[i] == '0' else -1)
if current_sum < 0:
current_sum = 0
max_sum = max(current_sum, max_sum)
return max_sum if max_sum else 0
s = "11000010001"
n = 11
print(findLengt... | 256 | 0 | 22 |
4e619c206ae0df10192fe968b3a3efbb68e98129 | 94 | py | Python | src/mlb/models/app_mode.py | benbrandt22/MagTagMLB | 1ec347743bc7df9339fb8e3de0f86ea037b7694f | [
"MIT"
] | null | null | null | src/mlb/models/app_mode.py | benbrandt22/MagTagMLB | 1ec347743bc7df9339fb8e3de0f86ea037b7694f | [
"MIT"
] | null | null | null | src/mlb/models/app_mode.py | benbrandt22/MagTagMLB | 1ec347743bc7df9339fb8e3de0f86ea037b7694f | [
"MIT"
] | null | null | null | # (doesn't seem to be any official Enum support in Circuitpython)
Schedule = 1
ScoreBoard = 2 | 23.5 | 65 | 0.755319 | # (doesn't seem to be any official Enum support in Circuitpython)
Schedule = 1
ScoreBoard = 2 | 0 | 0 | 0 |
3c4e0e95661b4e2c5aca203fb3b2a20b1b33339b | 731 | py | Python | src/caterpillar/variants.py | overhacked/caterpillar | dc51e551a938705f5e200087720caa15b4a31371 | [
"MIT"
] | 37 | 2017-12-27T03:41:59.000Z | 2022-02-05T04:11:07.000Z | src/caterpillar/variants.py | overhacked/caterpillar | dc51e551a938705f5e200087720caa15b4a31371 | [
"MIT"
] | 7 | 2019-01-25T18:39:52.000Z | 2020-11-11T03:57:54.000Z | src/caterpillar/variants.py | overhacked/caterpillar | dc51e551a938705f5e200087720caa15b4a31371 | [
"MIT"
] | 7 | 2020-04-25T03:06:18.000Z | 2021-10-30T21:24:10.000Z | import m3u8
from typing import Tuple
# Rate variant stream by resolution, average bandwidth, and bandwidth.
# Select the best variant stream (best effort).
#
# Assumption: m3u8 object has one or more variants.
| 31.782609 | 73 | 0.740082 | import m3u8
from typing import Tuple
# Rate variant stream by resolution, average bandwidth, and bandwidth.
def variant_score(variant: m3u8.Playlist) -> Tuple[int, int, int, int]:
stream_info = variant.stream_info
if stream_info.resolution:
width, height = stream_info.resolution
else:
wid... | 472 | 0 | 44 |
ca4cbeb6e31114d37f1c1518d066fa96e13438cb | 2,177 | py | Python | Transformation Scenes/2_Linear_Transformation_with_matrix.py | samsub18/Visualizing-Linear-Transformations | cf3e3aeb463d4a73de8a13a951191e8e191dbe62 | [
"MIT"
] | 5 | 2020-08-21T04:42:44.000Z | 2021-04-24T14:11:32.000Z | Transformation Scenes/2_Linear_Transformation_with_matrix.py | samsub18/Visualizing-Linear-Transformations | cf3e3aeb463d4a73de8a13a951191e8e191dbe62 | [
"MIT"
] | null | null | null | Transformation Scenes/2_Linear_Transformation_with_matrix.py | samsub18/Visualizing-Linear-Transformations | cf3e3aeb463d4a73de8a13a951191e8e191dbe62 | [
"MIT"
] | 3 | 2020-09-19T05:15:01.000Z | 2021-06-03T05:47:22.000Z | from big_ol_pile_of_manim_imports import *
| 27.556962 | 126 | 0.661001 | from big_ol_pile_of_manim_imports import *
class Introduction(Scene):
def construct(self):
t1 = TexMobject(r"Visualzing\quad Linear\quad Transformations")
t2 = TexMobject(r"Using\quad python\quad \& \quad manim")
t3 = TexMobject(r"Sameer\quad Prasad\quad Subhedar")
t4 = TexMobject("PES2201800323")
self.pla... | 1,842 | 129 | 161 |
d33307b24d598e56c3104322bb0aa7d9d0d9c14a | 748 | py | Python | unsdgbot/config.py | btaba/UN-SDG-bot | 46fde9a866cefe37b8e600e87b37ed0f73bc94a2 | [
"MIT"
] | null | null | null | unsdgbot/config.py | btaba/UN-SDG-bot | 46fde9a866cefe37b8e600e87b37ed0f73bc94a2 | [
"MIT"
] | null | null | null | unsdgbot/config.py | btaba/UN-SDG-bot | 46fde9a866cefe37b8e600e87b37ed0f73bc94a2 | [
"MIT"
] | null | null | null | import os
import logging
basedir = os.path.abspath(os.path.dirname(__file__))
| 22 | 62 | 0.657754 | import os
import logging
basedir = os.path.abspath(os.path.dirname(__file__))
class Config(object):
DEBUG = False
TESTING = False
CSRF_ENABLED = True
FB_API_VERSION = 2.7
FB_ACCESS_TOKEN = 'this-is-in-local-config'
FB_VERIFY_TOKEN = 'this-is-in-local-config'
FB_WEBHOOK_URL = 'this-is-in-... | 0 | 597 | 69 |
fae3809523280baaf1bed07b85c14642416d98e2 | 2,458 | py | Python | yahoo_quote_download/validater.py | manniealfaro/yahoo_quote_download | 31fd8a3a239712764cc1da48251fb94fee9a1313 | [
"BSD-2-Clause"
] | 153 | 2017-05-21T13:24:00.000Z | 2022-03-18T00:56:13.000Z | yahoo_quote_download/validater.py | manniealfaro/yahoo_quote_download | 31fd8a3a239712764cc1da48251fb94fee9a1313 | [
"BSD-2-Clause"
] | 15 | 2017-05-25T19:23:50.000Z | 2021-07-26T17:06:28.000Z | yahoo_quote_download/validater.py | manniealfaro/yahoo_quote_download | 31fd8a3a239712764cc1da48251fb94fee9a1313 | [
"BSD-2-Clause"
] | 77 | 2017-05-21T13:24:11.000Z | 2021-06-22T10:58:18.000Z | # -*- coding: utf-8 -*-
"""
validate.py - Trivial data validater
Created on December 24, 2019
@author: c0redumb
"""
# To make print working for Python2/3
from __future__ import print_function
def validate(ticker, data, begindate='1920-01-01', verbose=0):
'''
This function perform a query and extract the matc... | 28.581395 | 76 | 0.463792 | # -*- coding: utf-8 -*-
"""
validate.py - Trivial data validater
Created on December 24, 2019
@author: c0redumb
"""
# To make print working for Python2/3
from __future__ import print_function
def validate(ticker, data, begindate='1920-01-01', verbose=0):
'''
This function perform a query and extract the matc... | 0 | 0 | 0 |