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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
b05589ad0f9c30e8df5ee640687faaac63b79d6d | 2,896 | py | Python | src/lhtml.py | drohmer/lhtml | 44a9306e15d7ae0d270af9a80cf9c21cc13b39ea | [
"MIT"
] | null | null | null | src/lhtml.py | drohmer/lhtml | 44a9306e15d7ae0d270af9a80cf9c21cc13b39ea | [
"MIT"
] | null | null | null | src/lhtml.py | drohmer/lhtml | 44a9306e15d7ae0d270af9a80cf9c21cc13b39ea | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os
import argparse
import re
import lhtmlLib
meta_default = {
'wrap-auto': False,
'add_title_id': False,
'title': 'Webpage',
'css': [],
'js': [],
'wrap-custom-pre': '',
'wrap-custom-post': '',
'directory_include': [os.getcwd()+'/'],
}
if __name__== '__main__... | 25.182609 | 105 | 0.67576 | #!/usr/bin/env python3
import os
import argparse
import re
import lhtmlLib
meta_default = {
'wrap-auto': False,
'add_title_id': False,
'title': 'Webpage',
'css': [],
'js': [],
'wrap-custom-pre': '',
'wrap-custom-post': '',
'directory_include': [os.getcwd()+'/'],
}
def read_yaml(text_in):
_... | 1,455 | 0 | 46 |
5759fe8e2aff60caa0c1517f34551e600bebcab2 | 2,134 | py | Python | src/plugins/public.py | sh1nra-dx/cyberelf-2722 | 59c13ffa83d846c679a9a079531f12bbe16435d4 | [
"MIT"
] | null | null | null | src/plugins/public.py | sh1nra-dx/cyberelf-2722 | 59c13ffa83d846c679a9a079531f12bbe16435d4 | [
"MIT"
] | null | null | null | src/plugins/public.py | sh1nra-dx/cyberelf-2722 | 59c13ffa83d846c679a9a079531f12bbe16435d4 | [
"MIT"
] | null | null | null | import random
import re
from PIL import Image
from nonebot import on_command, on_message, on_notice, require, get_driver, on_regex
from nonebot.typing import T_State
from nonebot.adapters.cqhttp import Message, Event, Bot
from src.libraries.maimaidx.image import *
from random import randint
from src.libraries.dbutil i... | 25.105882 | 112 | 0.619025 | import random
import re
from PIL import Image
from nonebot import on_command, on_message, on_notice, require, get_driver, on_regex
from nonebot.typing import T_State
from nonebot.adapters.cqhttp import Message, Event, Bot
from src.libraries.maimaidx.image import *
from random import randint
from src.libraries.dbutil i... | 2,130 | 0 | 67 |
2a718ce1e89a6d2406ce5a4268c0a73c0a93885b | 26,227 | py | Python | tests/package_info.py | gaborbernat/pipx | d5ab566f4a1c83d6d3bca735b4a6ccd9bbce64f1 | [
"MIT"
] | 1 | 2020-12-11T08:05:54.000Z | 2020-12-11T08:05:54.000Z | tests/package_info.py | gaborbernat/pipx | d5ab566f4a1c83d6d3bca735b4a6ccd9bbce64f1 | [
"MIT"
] | null | null | null | tests/package_info.py | gaborbernat/pipx | d5ab566f4a1c83d6d3bca735b4a6ccd9bbce64f1 | [
"MIT"
] | null | null | null | import sys
from typing import Any, Dict
WIN = sys.platform.startswith("win")
# Versions of all packages possibly used in our tests
# Only apply _exe_if_win to entry_points, NOT scripts
PKG: Dict[str, Dict[str, Any]] = {
"ansible": {
"spec": "ansible==2.9.13",
"apps": [
"ansible",
... | 32.062347 | 90 | 0.435925 | import sys
from typing import Any, Dict
WIN = sys.platform.startswith("win")
def _exe_if_win(apps):
app_strings = []
app_strings = [f"{app}.exe" if WIN else app for app in apps]
return app_strings
# Versions of all packages possibly used in our tests
# Only apply _exe_if_win to entry_points, NOT script... | 110 | 0 | 23 |
c17b740f93ea6899b85b3a4188c5c57850d8836c | 9,992 | py | Python | torch_geometric/nn/conv/sage_conv.py | giannipele/pytorch_geometric | 187d49dcce53a630e36c85c53138345f5bfdc876 | [
"MIT"
] | null | null | null | torch_geometric/nn/conv/sage_conv.py | giannipele/pytorch_geometric | 187d49dcce53a630e36c85c53138345f5bfdc876 | [
"MIT"
] | null | null | null | torch_geometric/nn/conv/sage_conv.py | giannipele/pytorch_geometric | 187d49dcce53a630e36c85c53138345f5bfdc876 | [
"MIT"
] | null | null | null | from __future__ import division
import torch
import torch.nn.functional as F
from torch.nn import Parameter
from torch_geometric.nn.conv import MessagePassing
from torch_geometric.utils import add_remaining_self_loops
from torch_geometric.laf import ElementAggregationLayer, FractionalElementAggregationLayer, ScatterAgg... | 37.007407 | 115 | 0.583867 | from __future__ import division
import torch
import torch.nn.functional as F
from torch.nn import Parameter
from torch_geometric.nn.conv import MessagePassing
from torch_geometric.utils import add_remaining_self_loops
from torch_geometric.laf import ElementAggregationLayer, FractionalElementAggregationLayer, ScatterAgg... | 4,878 | 1,272 | 293 |
c33f211669a36a2afc0840f014d474bb444dec0f | 7,487 | py | Python | tests/test_temperature/test_extension_array.py | domdfcoding/si_unit_pandas | 6912d775f88dcfb9112199a57c14b6ce6a979d0e | [
"BSD-3-Clause"
] | null | null | null | tests/test_temperature/test_extension_array.py | domdfcoding/si_unit_pandas | 6912d775f88dcfb9112199a57c14b6ce6a979d0e | [
"BSD-3-Clause"
] | 19 | 2020-12-21T18:26:24.000Z | 2022-01-16T11:47:58.000Z | tests/test_temperature/test_extension_array.py | domdfcoding/si_unit_pandas | 6912d775f88dcfb9112199a57c14b6ce6a979d0e | [
"BSD-3-Clause"
] | null | null | null | # 3rd party
import numpy # type: ignore
import pytest
# this package
from si_unit_pandas import CelsiusType, TemperatureArray
_non_empty_sets = [
{1},
{1, 2},
{1, 2, 3},
{1, 2, 3, 4},
{1, 2, 3, 4, 5},
]
_non_empty_lists = [
[1],
[1, 2],
[1, 2, 3],
[1, 2, 3, 4],
[1, 2, 3, 4, 5],
]
_non_empty... | 36.169082 | 112 | 0.700147 | # 3rd party
import numpy # type: ignore
import pytest
# this package
from si_unit_pandas import CelsiusType, TemperatureArray
_non_empty_sets = [
{1},
{1, 2},
{1, 2, 3},
{1, 2, 3, 4},
{1, 2, 3, 4, 5},
]
_non_empty_lists = [
[1],
[1, 2],
[1, 2, 3],
[1, 2, 3, 4],
[1, 2, 3, 4, 5],
]
_non_empty... | 5,944 | 0 | 409 |
4ac6b5ecb2889367a9de1e5429425af6d5b00551 | 176 | py | Python | src/web_app/tests/conftest.py | drcrook1/AI_Accelerators_Quality | bace0b5a41271885d1e052bdefae1389e8090ed2 | [
"MIT"
] | 2 | 2019-09-13T20:22:57.000Z | 2019-10-18T16:06:54.000Z | src/inference_function/tests/conftest.py | drcrook1/AI_Accelerators_Quality | bace0b5a41271885d1e052bdefae1389e8090ed2 | [
"MIT"
] | 7 | 2019-10-10T14:39:29.000Z | 2019-11-07T23:55:15.000Z | src/inference_function/tests/conftest.py | drcrook1/AI_Accelerators_Quality | bace0b5a41271885d1e052bdefae1389e8090ed2 | [
"MIT"
] | 2 | 2019-07-03T19:25:31.000Z | 2021-10-13T18:25:18.000Z | import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), 'helpers'))
myPath = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, myPath + '/../') | 35.2 | 67 | 0.727273 | import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), 'helpers'))
myPath = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, myPath + '/../') | 0 | 0 | 0 |
28743e3a2094b477cd03626d4772df15c2a184d3 | 5,527 | py | Python | cmonitor/scraper.py | FilipOsowski/craigslist-monitor | 57e008263898acb6fc03f58f4808ee0a12acac33 | [
"MIT"
] | 2 | 2018-04-27T21:48:49.000Z | 2018-05-18T19:08:58.000Z | cmonitor/scraper.py | FilipOsowski/craigslist-monitor | 57e008263898acb6fc03f58f4808ee0a12acac33 | [
"MIT"
] | null | null | null | cmonitor/scraper.py | FilipOsowski/craigslist-monitor | 57e008263898acb6fc03f58f4808ee0a12acac33 | [
"MIT"
] | null | null | null | import requests
import sys
import random
from time import sleep
from collections import deque
from lxml import html
# The class that handles craigslist item monitoring and parsing.
# Flushes the stdout of the scraper (a file) so that output is live.
# Interface for creating the scraper.
| 35.203822 | 90 | 0.604668 | import requests
import sys
import random
from time import sleep
from collections import deque
from lxml import html
# The class that handles craigslist item monitoring and parsing.
class item_scraper():
# The last_item_ids que stores existing item ids to determine whether an
# item is new.
last_item_ids ... | 4,202 | 965 | 66 |
be6fcabcff305815749769a764a1caf8cffb701b | 8,954 | py | Python | dashboard/views.py | njenga5/django-mediastore-site | 579fe162f32520ca95917e95fa4c841e1bbe0ab1 | [
"MIT"
] | 1 | 2020-12-19T20:49:04.000Z | 2020-12-19T20:49:04.000Z | dashboard/views.py | njenga5/django-mediastore-site | 579fe162f32520ca95917e95fa4c841e1bbe0ab1 | [
"MIT"
] | null | null | null | dashboard/views.py | njenga5/django-mediastore-site | 579fe162f32520ca95917e95fa4c841e1bbe0ab1 | [
"MIT"
] | null | null | null | import os
from django.shortcuts import render, HttpResponse, redirect
from django.http import Http404
from django.contrib import messages
from django.utils import timezone
from django.contrib.auth import logout
from . import forms
from . import models
MUSIC_TYPES = ['mp3', 'ogg', 'm4a', 'wav', 'opus']
VIDEO_TYPES = ['... | 40.333333 | 120 | 0.555841 | import os
from django.shortcuts import render, HttpResponse, redirect
from django.http import Http404
from django.contrib import messages
from django.utils import timezone
from django.contrib.auth import logout
from . import forms
from . import models
MUSIC_TYPES = ['mp3', 'ogg', 'm4a', 'wav', 'opus']
VIDEO_TYPES = ['... | 8,377 | 0 | 207 |
0ae09cad6790a4d08edade1563e5ff562dd1556a | 345 | py | Python | construct_editor/gallery/test_flags_enum.py | jpsnyder/construct-editor | 9ad73aa89430a35f3b5bc71f965feb2e9cbb0568 | [
"MIT"
] | null | null | null | construct_editor/gallery/test_flags_enum.py | jpsnyder/construct-editor | 9ad73aa89430a35f3b5bc71f965feb2e9cbb0568 | [
"MIT"
] | null | null | null | construct_editor/gallery/test_flags_enum.py | jpsnyder/construct-editor | 9ad73aa89430a35f3b5bc71f965feb2e9cbb0568 | [
"MIT"
] | null | null | null | import construct as cs
import construct_typed as cst
import dataclasses
import typing as t
from . import GalleryItem
constr = cs.Struct(
"permissions" / cs.FlagsEnum(cs.Int8ul, R=4, W=2, X=1),
)
gallery_item = GalleryItem(
construct=constr,
example_binarys={
"read": bytes([4]),
"read_wri... | 18.157895 | 59 | 0.657971 | import construct as cs
import construct_typed as cst
import dataclasses
import typing as t
from . import GalleryItem
constr = cs.Struct(
"permissions" / cs.FlagsEnum(cs.Int8ul, R=4, W=2, X=1),
)
gallery_item = GalleryItem(
construct=constr,
example_binarys={
"read": bytes([4]),
"read_wri... | 0 | 0 | 0 |
79e77dde243795532b0f5543e8cfbf5b6eb53d7c | 137 | py | Python | python programs/forelse.py | saddam-gif/Python-crushcourse | 63e1e1ff1eeb9a5d34bb0354cc86566c4de60260 | [
"MIT"
] | null | null | null | python programs/forelse.py | saddam-gif/Python-crushcourse | 63e1e1ff1eeb9a5d34bb0354cc86566c4de60260 | [
"MIT"
] | null | null | null | python programs/forelse.py | saddam-gif/Python-crushcourse | 63e1e1ff1eeb9a5d34bb0354cc86566c4de60260 | [
"MIT"
] | null | null | null | nums = [12,100,14,27,33]
for num in nums:
if num%5 == 0:
print(num)
break
else:
print("Not found")
| 13.7 | 26 | 0.467153 | nums = [12,100,14,27,33]
for num in nums:
if num%5 == 0:
print(num)
break
else:
print("Not found")
| 0 | 0 | 0 |
9ae5daa0b2defdc51c902c5d4880bd4f995b3ec9 | 1,836 | py | Python | gunicorn.py | iamjdcollins/districtwebsite | 89e2aea47ca3d221665bc23586a4374421be5800 | [
"MIT"
] | null | null | null | gunicorn.py | iamjdcollins/districtwebsite | 89e2aea47ca3d221665bc23586a4374421be5800 | [
"MIT"
] | null | null | null | gunicorn.py | iamjdcollins/districtwebsite | 89e2aea47ca3d221665bc23586a4374421be5800 | [
"MIT"
] | null | null | null | import glob
import multiprocessing
import os
import json
from django.core.exceptions import ImproperlyConfigured
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
# Load Secrets
secrets = load_secrets()
# Get a secret
proc_name = 'dis... | 26.608696 | 79 | 0.646514 | import glob
import multiprocessing
import os
import json
from django.core.exceptions import ImproperlyConfigured
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
# Load Secrets
def load_secrets(file=os.path.join(BASE_DIR, '.secrets.json'))... | 1,001 | 0 | 67 |
e1d5eb71793375c94806c287d2c4a7eecbf3b110 | 83 | py | Python | 03Aula09-09/ex07.py | danicon/Curso-IPE | 3b9e2a9d187492d6561a512363bd06156286df6a | [
"MIT"
] | 2 | 2020-09-09T12:50:57.000Z | 2020-09-09T12:56:02.000Z | 03Aula09-09/ex07.py | danicon/Curso-IPE | 3b9e2a9d187492d6561a512363bd06156286df6a | [
"MIT"
] | null | null | null | 03Aula09-09/ex07.py | danicon/Curso-IPE | 3b9e2a9d187492d6561a512363bd06156286df6a | [
"MIT"
] | null | null | null | fat=1
n=5
while n>=1:
fat = fat * n
n-=1
print(f"O fatoria de 5! = {fat}") | 11.857143 | 33 | 0.506024 | fat=1
n=5
while n>=1:
fat = fat * n
n-=1
print(f"O fatoria de 5! = {fat}") | 0 | 0 | 0 |
c5a0854b82d43910e78084f5cf1ffe42faa2b527 | 165 | py | Python | movies/admin.py | bertocarl/RestAPI-CRUD | 5c32bcd92b5eb5e26d74aa658d284463cb3d72cb | [
"MIT"
] | null | null | null | movies/admin.py | bertocarl/RestAPI-CRUD | 5c32bcd92b5eb5e26d74aa658d284463cb3d72cb | [
"MIT"
] | null | null | null | movies/admin.py | bertocarl/RestAPI-CRUD | 5c32bcd92b5eb5e26d74aa658d284463cb3d72cb | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Movie
| 16.5 | 37 | 0.757576 | from django.contrib import admin
from .models import Movie
class ProjectAdmin(admin.ModelAdmin):
# Register your models here.
admin.site.register(Movie) | 0 | 83 | 23 |
e3a459d1ce29c6763786ea2e8a3d1c040352dde8 | 5,395 | py | Python | demo/20newsgroups/demo.py | bond005/impartial_text_cls | d7503c55388625b988098b307350b1f899e48e3c | [
"Apache-2.0"
] | 14 | 2019-06-30T06:15:06.000Z | 2021-11-02T15:55:17.000Z | demo/20newsgroups/demo.py | bond005/impartial_text_cls | d7503c55388625b988098b307350b1f899e48e3c | [
"Apache-2.0"
] | 8 | 2019-11-08T08:17:39.000Z | 2022-02-09T23:30:55.000Z | demo/20newsgroups/demo.py | bond005/impartial_text_cls | d7503c55388625b988098b307350b1f899e48e3c | [
"Apache-2.0"
] | 3 | 2019-06-30T06:15:42.000Z | 2021-02-16T11:12:47.000Z | # Copyright 2019 Ivan Bondarenko
#
# 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 writi... | 56.197917 | 120 | 0.670065 | # Copyright 2019 Ivan Bondarenko
#
# 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 writi... | 4,193 | 0 | 46 |
dca914d98b86097dc27778e74bbbd63f44391333 | 354 | py | Python | cotr/cms/migrations/0007_renamed_fields.py | kingsdigitallab/cotr | 4afbfdd36d4dd0ee9f56152d3c963453c81e440c | [
"MIT"
] | null | null | null | cotr/cms/migrations/0007_renamed_fields.py | kingsdigitallab/cotr | 4afbfdd36d4dd0ee9f56152d3c963453c81e440c | [
"MIT"
] | 27 | 2020-12-28T17:34:59.000Z | 2022-03-12T00:25:43.000Z | cms/migrations/0007_renamed_fields.py | kingsdigitallab/ctrs-django | 7170b4f15bd9d097d00f215d747a02a9b656768c | [
"MIT"
] | null | null | null | # Generated by Django 2.0 on 2018-08-10 16:28
from django.db import migrations
| 18.631579 | 45 | 0.576271 | # Generated by Django 2.0 on 2018-08-10 16:28
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('cms', '0006_peoplepage'),
]
operations = [
migrations.RenameField(
model_name='peoplepage',
old_name='name',
new_n... | 0 | 250 | 23 |
aafa73c93edfeec99dae5514f18024670697cacd | 13,051 | py | Python | server_automation/tests/test_ingestion_discrete.py | MapColonies/automation-ingestion-test | 851e6015850da00811bb91dcad2dd08222a37e8f | [
"MIT"
] | null | null | null | server_automation/tests/test_ingestion_discrete.py | MapColonies/automation-ingestion-test | 851e6015850da00811bb91dcad2dd08222a37e8f | [
"MIT"
] | null | null | null | server_automation/tests/test_ingestion_discrete.py | MapColonies/automation-ingestion-test | 851e6015850da00811bb91dcad2dd08222a37e8f | [
"MIT"
] | null | null | null | """This module provide multiple test of ingestion services"""
import shutil
from time import sleep
from conftest import ValueStorage
import logging
import json
from server_automation.configuration import config
from discrete_kit.validator.json_compare_pycsw import *
from discrete_kit.functions.shape_functions import Sh... | 41.170347 | 139 | 0.620106 | """This module provide multiple test of ingestion services"""
import shutil
from time import sleep
from conftest import ValueStorage
import logging
import json
from server_automation.configuration import config
from discrete_kit.validator.json_compare_pycsw import *
from discrete_kit.functions.shape_functions import Sh... | 0 | 0 | 0 |
6755c433a898ac8587818c91b4cd5361bb85a5dd | 3,518 | py | Python | 5-6-19/Files/Calculus.py | QueenChristina/Calculus-Zombies | 81611015ba505bff6679d029280854e3934fad15 | [
"MIT"
] | 3 | 2019-08-30T02:53:34.000Z | 2022-01-03T07:05:39.000Z | 5-6-19/Files/Calculus.py | QueenChristina/Calculus-Zombies | 81611015ba505bff6679d029280854e3934fad15 | [
"MIT"
] | null | null | null | 5-6-19/Files/Calculus.py | QueenChristina/Calculus-Zombies | 81611015ba505bff6679d029280854e3934fad15 | [
"MIT"
] | null | null | null | import sympy, random, pygame
from sympy import *
from pygame.locals import *
from Files import Var, Sprite, Thing
x, y = symbols("x y")
pygame.font.init()
WHITE = (255, 255, 255)
frames = 0
waiting = 'done'
derivatives = [x + 3, x**2 + 5, x**2 + 6*x, tan(x), sec(x)]
integrals = [x + 5, x + 2, 1/(1 +... | 32.878505 | 137 | 0.555713 | import sympy, random, pygame
from sympy import *
from pygame.locals import *
from Files import Var, Sprite, Thing
x, y = symbols("x y")
pygame.font.init()
WHITE = (255, 255, 255)
def show_text(text):
# small_font = pygame.font.Font("PixelFont.ttf", 35)
#text_surface = small_font.render(text, Fals... | 2,589 | 0 | 94 |
3dd10f77435f270d4b14b5caf0aa80b5b50948e9 | 6,193 | py | Python | dfa/server/services/firewall/native/fw_constants.py | CiscoSystems/fabric_enabler | d5318624dd15692197a7212ecd4b0ceea42dc73e | [
"Apache-2.0"
] | 1 | 2015-03-05T02:48:15.000Z | 2015-03-05T02:48:15.000Z | dfa/server/services/firewall/native/fw_constants.py | CiscoSystems/fabric_enabler | d5318624dd15692197a7212ecd4b0ceea42dc73e | [
"Apache-2.0"
] | 1 | 2016-05-25T22:13:43.000Z | 2016-07-21T20:49:48.000Z | dfa/server/services/firewall/native/fw_constants.py | CiscoSystems/fabric_enabler | d5318624dd15692197a7212ecd4b0ceea42dc73e | [
"Apache-2.0"
] | 2 | 2017-05-02T21:32:46.000Z | 2018-08-22T16:52:40.000Z | # Copyright 2014 Cisco Systems, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | 44.235714 | 79 | 0.850315 | # Copyright 2014 Cisco Systems, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | 0 | 0 | 0 |
68e928594ef5448f2f786775d06b081e8919f37d | 475 | py | Python | Dataset/Leetcode/test/62/486.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | Dataset/Leetcode/test/62/486.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | Dataset/Leetcode/test/62/486.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | //中止条件
if i>=m or j>=n:
return;
if i==m-1 and j==n-1:
res.append(ans)
return
//递归调用
dfs(i+1,j,ans,res)
ans.append([i+1,j])
dfs(i,j+1,ans,res)
ans.pop()
ans.append([i,j+1])
ans=[]
... | 20.652174 | 41 | 0.383158 | class Solution:
def XXX(self, m: int, n: int) -> int:
def dfs(i,j,ans,res):
//中止条件
if i>=m or j>=n:
return;
if i==m-1 and j==n-1:
res.append(ans)
return
//递归调用
dfs(i+1,j,ans,res)
ans.append([i+1,j])
... | 46 | -6 | 48 |
e7fb2a10e0bab4428f45874889bd4bc3397d3fe2 | 2,910 | py | Python | os_test.py | bdastur/openstackclients | 693099743294d54d26abdc6719d7a8fdc2bb8325 | [
"Apache-2.0"
] | 1 | 2015-07-19T16:15:33.000Z | 2015-07-19T16:15:33.000Z | os_test.py | bdastur/openstackclients | 693099743294d54d26abdc6719d7a8fdc2bb8325 | [
"Apache-2.0"
] | null | null | null | os_test.py | bdastur/openstackclients | 693099743294d54d26abdc6719d7a8fdc2bb8325 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Openstack Client Test code.
'''
import unittest
import credentials
import osnetwork_client as neutronclient
class OSTest(unittest.TestCase):
'''
Test Openstack client handlers.
'''
def get_openstack_credentials(self, rcfile):
'''
Get ... | 29.1 | 76 | 0.551546 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Openstack Client Test code.
'''
import unittest
import credentials
import osnetwork_client as neutronclient
class OSTest(unittest.TestCase):
'''
Test Openstack client handlers.
'''
def get_openstack_credentials(self, rcfile):
'''
Get ... | 0 | 0 | 0 |
581f38a4825fa56464d32c2e25b3ff9f1ee8bd8a | 397 | py | Python | runtests.py | logitnet/django-htpayway | e5f336cc686e618df58ed6b3c107c994088291a4 | [
"MIT"
] | 1 | 2015-07-07T12:53:55.000Z | 2015-07-07T12:53:55.000Z | runtests.py | logitnet/django-htpayway | e5f336cc686e618df58ed6b3c107c994088291a4 | [
"MIT"
] | null | null | null | runtests.py | logitnet/django-htpayway | e5f336cc686e618df58ed6b3c107c994088291a4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import sys
from django.conf import settings
settings.configure(
DATABASES={
'default': {'ENGINE': 'django.db.backends.sqlite3'}
},
INSTALLED_APPS=[
'htpayway',
],
MIDDLEWARE_CLASSES=[],
)
if __name__ == '__main__':
from django.test.simple import run_test... | 18.904762 | 59 | 0.647355 | #!/usr/bin/env python
import sys
from django.conf import settings
settings.configure(
DATABASES={
'default': {'ENGINE': 'django.db.backends.sqlite3'}
},
INSTALLED_APPS=[
'htpayway',
],
MIDDLEWARE_CLASSES=[],
)
if __name__ == '__main__':
from django.test.simple import run_test... | 0 | 0 | 0 |
7566d3e5ae86f6d5db588332434277fa2c9aea16 | 127 | py | Python | gaz/gaz/views.py | aafedotov/lpg | ee3eb015e6c5ccf01a3114c35d1c0b127d5570ea | [
"MIT"
] | null | null | null | gaz/gaz/views.py | aafedotov/lpg | ee3eb015e6c5ccf01a3114c35d1c0b127d5570ea | [
"MIT"
] | null | null | null | gaz/gaz/views.py | aafedotov/lpg | ee3eb015e6c5ccf01a3114c35d1c0b127d5570ea | [
"MIT"
] | null | null | null | from django.shortcuts import render | 25.4 | 36 | 0.748031 | from django.shortcuts import render
def index(request):
template = 'index/index.html'
return render(request, template) | 69 | 0 | 23 |
10810cc46f835c1502a9f2941b98dcf4eff9e74f | 916 | py | Python | ann_benchmarks/algorithms/annoy_learned.py | Justinyu1618/ann-benchmarks | 9a5e1b7e6c128e94c01fcf25b65c4521cbde4efe | [
"MIT"
] | null | null | null | ann_benchmarks/algorithms/annoy_learned.py | Justinyu1618/ann-benchmarks | 9a5e1b7e6c128e94c01fcf25b65c4521cbde4efe | [
"MIT"
] | null | null | null | ann_benchmarks/algorithms/annoy_learned.py | Justinyu1618/ann-benchmarks | 9a5e1b7e6c128e94c01fcf25b65c4521cbde4efe | [
"MIT"
] | null | null | null | from __future__ import absolute_import
import annoy
from ann_benchmarks.algorithms.base import BaseANN
| 30.533333 | 75 | 0.606987 | from __future__ import absolute_import
import annoy
from ann_benchmarks.algorithms.base import BaseANN
class Annoy(BaseANN):
def __init__(self, metric, n_trees):
self._n_trees = n_trees
self._search_k = None
self._metric = metric
def fit(self, X):
self._annoy = annoy.AnnoyInde... | 655 | 0 | 157 |
681d3d123e56d04a5ea1a2b300ac7532f454ed66 | 1,484 | py | Python | google_news_result_opener.py | Atropos148/AutomateTheBoringStuff2E | cd2ca61057e279329b8858b38677d6fbe6d50394 | [
"MIT"
] | null | null | null | google_news_result_opener.py | Atropos148/AutomateTheBoringStuff2E | cd2ca61057e279329b8858b38677d6fbe6d50394 | [
"MIT"
] | null | null | null | google_news_result_opener.py | Atropos148/AutomateTheBoringStuff2E | cd2ca61057e279329b8858b38677d6fbe6d50394 | [
"MIT"
] | null | null | null | from typing import List
import webbrowser
import sys
import requests
import bs4
if __name__ == "__main__":
main()
# https://www.google.com/search?q=dfs&tbm=nws
# rso > div:nth-child(2) > g-card > div > div > div.dbsr > a
# rso > div:nth-child(1) > g-card > div > div > div.dbsr > a
| 28.538462 | 71 | 0.589623 | from typing import List
import webbrowser
import sys
import requests
import bs4
def main():
print("hello")
search_url: List = ["https://www.google.com/search?q=", "&tbm=nws"]
# if len(sys.argv) == 2:
# topic_name: str = sys.argv[1]
while True:
topic_name = input("What do you want to... | 1,171 | 0 | 23 |
a1b37af0c8c4a29979cda9887da815441db255c0 | 36 | py | Python | schemdraw/parsing/__init__.py | bastienvoirin/schemdraw | ebfbfa839b6421eeac5815b808870f9d1c7418ba | [
"MIT"
] | 17 | 2021-02-19T22:27:32.000Z | 2022-03-12T09:47:10.000Z | schemdraw/parsing/__init__.py | bastienvoirin/schemdraw | ebfbfa839b6421eeac5815b808870f9d1c7418ba | [
"MIT"
] | 1 | 2021-06-02T14:18:22.000Z | 2021-06-02T14:18:22.000Z | schemdraw/parsing/__init__.py | bastienvoirin/schemdraw | ebfbfa839b6421eeac5815b808870f9d1c7418ba | [
"MIT"
] | 2 | 2022-02-14T07:19:24.000Z | 2022-03-23T17:49:30.000Z | from .logic_parser import logicparse | 36 | 36 | 0.888889 | from .logic_parser import logicparse | 0 | 0 | 0 |
2c08cb63ec1515c129af84af4fc50ea3d2610c0d | 215 | py | Python | dice_roll_simulator.py | R4ULtv/easy-project | afc63974d2a271730d992e5b829666b74ac8b8b0 | [
"MIT"
] | 1 | 2021-09-16T19:53:13.000Z | 2021-09-16T19:53:13.000Z | dice_roll_simulator.py | R4ULtv/easy-project | afc63974d2a271730d992e5b829666b74ac8b8b0 | [
"MIT"
] | null | null | null | dice_roll_simulator.py | R4ULtv/easy-project | afc63974d2a271730d992e5b829666b74ac8b8b0 | [
"MIT"
] | null | null | null | import random
while True:
print('1. Lancia il dado\n2. Esci')
user = int(input())
if user == 1:
num = random.randint(1,6)
print('Numero generato : ',num)
else:
break | 21.5 | 40 | 0.525581 | import random
while True:
print('1. Lancia il dado\n2. Esci')
user = int(input())
if user == 1:
num = random.randint(1,6)
print('Numero generato : ',num)
else:
break | 0 | 0 | 0 |
df068df49549d2cd3bbe05c91e50644dec614846 | 22 | py | Python | lib/algorithms/__init__.py | farfanoide/libhdd-sched | cb81d68aeb42d77357006e369caa71ee17620092 | [
"MIT"
] | null | null | null | lib/algorithms/__init__.py | farfanoide/libhdd-sched | cb81d68aeb42d77357006e369caa71ee17620092 | [
"MIT"
] | null | null | null | lib/algorithms/__init__.py | farfanoide/libhdd-sched | cb81d68aeb42d77357006e369caa71ee17620092 | [
"MIT"
] | null | null | null | from fcfs import FCFS
| 11 | 21 | 0.818182 | from fcfs import FCFS
| 0 | 0 | 0 |
21c17ffe76cd4624b248f6524c153beeed073e14 | 9,681 | py | Python | train.py | cheniison/e2e-joint-coref | 9ebe518e5fa0d49f8ceab4b04909523d09161462 | [
"MIT"
] | 4 | 2021-11-11T08:03:13.000Z | 2022-02-05T04:32:56.000Z | train.py | wangyang-stu/e2e-joint-coref | 02ff8f47f6c87d827ce799d56da214239ed7ae2c | [
"MIT"
] | 1 | 2021-11-30T08:55:33.000Z | 2021-12-16T08:16:08.000Z | train.py | wangyang-stu/e2e-joint-coref | 02ff8f47f6c87d827ce799d56da214239ed7ae2c | [
"MIT"
] | 2 | 2021-11-30T06:09:22.000Z | 2021-12-24T12:51:28.000Z | import model
import config
import torch
import time
import tools
import json
import _pickle
import os
import copy
import numpy as np
import random
import math
import pprint
from torch.utils.data import BatchSampler, SequentialSampler, RandomSampler
from transformers import AutoTokenizer, AutoModel, AdamW
torch.backend... | 47.925743 | 295 | 0.600041 | import model
import config
import torch
import time
import tools
import json
import _pickle
import os
import copy
import numpy as np
import random
import math
import pprint
from torch.utils.data import BatchSampler, SequentialSampler, RandomSampler
from transformers import AutoTokenizer, AutoModel, AdamW
torch.backend... | 9,184 | 0 | 23 |
9609c031bedaa23e5862d29f6f9297ada06c6808 | 28,921 | py | Python | training/layers.py | BrandoZhang/alis | 9699eba112eda2ea27d6023221df2df9dc270b7f | [
"CC-BY-2.0"
] | 176 | 2021-04-15T05:28:59.000Z | 2022-03-30T07:06:00.000Z | training/layers.py | BrandoZhang/alis | 9699eba112eda2ea27d6023221df2df9dc270b7f | [
"CC-BY-2.0"
] | 12 | 2021-04-17T20:20:53.000Z | 2022-03-19T07:04:58.000Z | training/layers.py | BrandoZhang/alis | 9699eba112eda2ea27d6023221df2df9dc270b7f | [
"CC-BY-2.0"
] | 22 | 2021-04-16T02:05:41.000Z | 2022-03-03T12:23:10.000Z | from typing import Dict, List, Optional
import torch
import torch.nn as nn
from torch import Tensor
import torch.nn.functional as F
import numpy as np
from omegaconf import OmegaConf, DictConfig
from torch_utils import persistence
from torch_utils.ops import bias_act
from torch_utils import misc
from torch_utils.ops.... | 43.101341 | 150 | 0.635317 | from typing import Dict, List, Optional
import torch
import torch.nn as nn
from torch import Tensor
import torch.nn.functional as F
import numpy as np
from omegaconf import OmegaConf, DictConfig
from torch_utils import persistence
from torch_utils.ops import bias_act
from torch_utils import misc
from torch_utils.ops.... | 18,153 | 70 | 877 |
ec0542b472203c0b4efba1ed7813abea26d53b69 | 3,524 | py | Python | script/training_script.py | analytique-bourassa/VAE-Classifier | d334cdd63e0c5a96b13d8a80c8b352f9a9c3d493 | [
"MIT"
] | 12 | 2020-02-19T01:00:10.000Z | 2022-03-17T11:52:35.000Z | script/training_script.py | analytique-bourassa/VAE-Classifier | d334cdd63e0c5a96b13d8a80c8b352f9a9c3d493 | [
"MIT"
] | null | null | null | script/training_script.py | analytique-bourassa/VAE-Classifier | d334cdd63e0c5a96b13d8a80c8b352f9a9c3d493 | [
"MIT"
] | 3 | 2019-07-04T12:52:11.000Z | 2021-07-01T01:51:38.000Z | from tools.tools import setup_data_loaders
from VariationalAutoEncoder.utils import evaluate_vae, train_vae
from VariationalAutoEncoder.VariationalAutoEncoder import VAE
import torch
import pyro
import pyro.distributions as dist
from pyro.infer import SVI, Trace_ELBO
from pyro.optim import Adam
from tqdm import tqdm... | 34.891089 | 99 | 0.755392 | from tools.tools import setup_data_loaders
from VariationalAutoEncoder.utils import evaluate_vae, train_vae
from VariationalAutoEncoder.VariationalAutoEncoder import VAE
import torch
import pyro
import pyro.distributions as dist
from pyro.infer import SVI, Trace_ELBO
from pyro.optim import Adam
from tqdm import tqdm... | 0 | 0 | 0 |
28d6dce909234aad8d19c90e2196aae0439bfff1 | 4,881 | py | Python | test/test_indexing.py | iamhatesz/torchstruct | 27b64534f7aa3ab4c3c0d3519209f2a6fc9b3d51 | [
"MIT"
] | 7 | 2019-11-08T11:44:18.000Z | 2020-01-23T03:16:58.000Z | test/test_indexing.py | iamhatesz/torchstruct | 27b64534f7aa3ab4c3c0d3519209f2a6fc9b3d51 | [
"MIT"
] | null | null | null | test/test_indexing.py | iamhatesz/torchstruct | 27b64534f7aa3ab4c3c0d3519209f2a6fc9b3d51 | [
"MIT"
] | null | null | null | import pytest
import torch
from torchstruct import TensorStruct
| 23.809756 | 84 | 0.49539 | import pytest
import torch
from torchstruct import TensorStruct
def test_struct_should_raise_when_given_invalid_key():
t = TensorStruct.ones({
'a': (10, 2),
'b': (10, 1)
})
with pytest.raises(KeyError):
_ = t['c']
def test_struct_should_return_element_when_indexin... | 4,380 | 0 | 400 |
356a2a356c7333feb46fb03cea0073f96b990937 | 1,574 | py | Python | model.py | thrilliams/who | cb9bc18f86d573c9f4e6378e72f819306c5a4ef3 | [
"MIT"
] | null | null | null | model.py | thrilliams/who | cb9bc18f86d573c9f4e6378e72f819306c5a4ef3 | [
"MIT"
] | null | null | null | model.py | thrilliams/who | cb9bc18f86d573c9f4e6378e72f819306c5a4ef3 | [
"MIT"
] | null | null | null | from sklearn.naive_bayes import GaussianNB as GNB
from sklearn.svm import SVC
from preprocessor import preprocess
learn() | 26.233333 | 52 | 0.507624 | from sklearn.naive_bayes import GaussianNB as GNB
from sklearn.svm import SVC
from preprocessor import preprocess
def testm(model, chunks, test):
set = [[], []]
for chunk in chunks:
set[0] += chunk[0]
set[1] += chunk[1]
model.fit(set[0], set[1])
data = model.predict(test[0])
num = 0... | 1,406 | 0 | 46 |
5cadcade5ead6d46840fcd48644b5053d2e3f572 | 3,293 | py | Python | netapp_lib/api/rest/rest.py | dprts/netapp-lib-dev | b6845e0de9904075fe4f68fb147c1e8a84121abf | [
"Apache-2.0"
] | null | null | null | netapp_lib/api/rest/rest.py | dprts/netapp-lib-dev | b6845e0de9904075fe4f68fb147c1e8a84121abf | [
"Apache-2.0"
] | null | null | null | netapp_lib/api/rest/rest.py | dprts/netapp-lib-dev | b6845e0de9904075fe4f68fb147c1e8a84121abf | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 NetApp, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 39.202381 | 79 | 0.644701 | # Copyright 2015 NetApp, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 1,089 | 0 | 54 |
926340aed8b623037716e4348377371416e7e37d | 5,038 | py | Python | idfy_sdk/services/signature/models/link.py | idfy-io/idfy-sdk-python | 0f7ced0cf0df080b1c73e2451bf02a23710b5bf1 | [
"Apache-2.0"
] | null | null | null | idfy_sdk/services/signature/models/link.py | idfy-io/idfy-sdk-python | 0f7ced0cf0df080b1c73e2451bf02a23710b5bf1 | [
"Apache-2.0"
] | null | null | null | idfy_sdk/services/signature/models/link.py | idfy-io/idfy-sdk-python | 0f7ced0cf0df080b1c73e2451bf02a23710b5bf1 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Idfy.Signature
Sign contracts, declarations, forms and other documents using digital signatures. ## Last update Last build date for this endpoint: 18.03.2019
"""
import pprint
import re
from typing import List, Dict
from datetime import datetime as datetime
class Link(object):
... | 23.652582 | 150 | 0.548432 | # coding: utf-8
"""
Idfy.Signature
Sign contracts, declarations, forms and other documents using digital signatures. ## Last update Last build date for this endpoint: 18.03.2019
"""
import pprint
import re
from typing import List, Dict
from datetime import datetime as datetime
class Link(object):
... | 604 | 0 | 27 |
19e978b9dbaf3ac71fc17bb402cfdd9c840d4863 | 8,407 | py | Python | tests/test_parser.py | Grk0/docker-cleanup | 0b4aa8866360eac65e59c78449270249ef24eb98 | [
"Apache-2.0"
] | 9 | 2016-12-03T18:11:05.000Z | 2021-01-07T16:58:29.000Z | tests/test_parser.py | Grk0/docker-cleanup | 0b4aa8866360eac65e59c78449270249ef24eb98 | [
"Apache-2.0"
] | null | null | null | tests/test_parser.py | Grk0/docker-cleanup | 0b4aa8866360eac65e59c78449270249ef24eb98 | [
"Apache-2.0"
] | 3 | 2018-09-13T01:41:39.000Z | 2019-10-03T16:04:10.000Z | # Copyright 2015 Christian Aichinger <Greek0@gmx.net>
#
# 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 ... | 30.132616 | 77 | 0.607708 | # Copyright 2015 Christian Aichinger <Greek0@gmx.net>
#
# 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 ... | 1,979 | 0 | 302 |
b03f2c7164e71d1d149f0c7b8612e0a573f52c62 | 643 | py | Python | Aprendendo Python/cursopythonudamy/aula9condicoes.py | JlucasS777/Aprendendo-Python | a3a960260070f0d604c27fbbc41578a6ab11edb5 | [
"MIT"
] | null | null | null | Aprendendo Python/cursopythonudamy/aula9condicoes.py | JlucasS777/Aprendendo-Python | a3a960260070f0d604c27fbbc41578a6ab11edb5 | [
"MIT"
] | null | null | null | Aprendendo Python/cursopythonudamy/aula9condicoes.py | JlucasS777/Aprendendo-Python | a3a960260070f0d604c27fbbc41578a6ab11edb5 | [
"MIT"
] | null | null | null | # Na identação do python utilizar apenas 4 espaços como convenção
print("Olá meu caro seja bem-vindo ao seu programa PYTHON\n")
num_1=int(input("Digite um número interiro :"))
print("Vamos trabalhar com soma agora ")
num_2=int(input("\nDigite outro número interiro :"))
total=num_1+num_2
if total <=5:
print(f" A som... | 37.823529 | 69 | 0.687403 | # Na identação do python utilizar apenas 4 espaços como convenção
print("Olá meu caro seja bem-vindo ao seu programa PYTHON\n")
num_1=int(input("Digite um número interiro :"))
print("Vamos trabalhar com soma agora ")
num_2=int(input("\nDigite outro número interiro :"))
total=num_1+num_2
if total <=5:
print(f" A som... | 0 | 0 | 0 |
b1862fd3754adbd970d8d6b450e04dfca2a81394 | 500 | py | Python | leetcode/0066_Plus_One/result.py | theck17/notes | f32f0f4b8f821b1ed38d173ef0913efddd094b91 | [
"MIT"
] | null | null | null | leetcode/0066_Plus_One/result.py | theck17/notes | f32f0f4b8f821b1ed38d173ef0913efddd094b91 | [
"MIT"
] | null | null | null | leetcode/0066_Plus_One/result.py | theck17/notes | f32f0f4b8f821b1ed38d173ef0913efddd094b91 | [
"MIT"
] | null | null | null | # !/usr/bin/env python3
# Author: C.K
# Email: theck17@163.com
# DateTime:2021-01-21 21:30:34
# Description:
import os, sys
if __name__ == "__main__":
pass
| 20 | 54 | 0.524 | # !/usr/bin/env python3
# Author: C.K
# Email: theck17@163.com
# DateTime:2021-01-21 21:30:34
# Description:
import os, sys
class Solution:
def plusOne(self, digits: List[int]) -> List[int]:
token = 1
for i in range(len(digits) - 1, -1, -1):
sum = digits[i] + token
digits[... | 293 | -6 | 49 |
6efe214e57645d173e5e7d5b1c83a633d3ccce1d | 869 | py | Python | test_tflite.py | qinweizhang-1/yolov3-tiny-pb-nms | e35cd0ab7dd2769d12a32340f4de244ad52c2cde | [
"Apache-2.0"
] | 2 | 2021-04-13T06:02:14.000Z | 2021-05-24T03:29:20.000Z | test_tflite.py | qinweizhang-1/yolov3-tiny-pb-nms | e35cd0ab7dd2769d12a32340f4de244ad52c2cde | [
"Apache-2.0"
] | null | null | null | test_tflite.py | qinweizhang-1/yolov3-tiny-pb-nms | e35cd0ab7dd2769d12a32340f4de244ad52c2cde | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
# -*- author:ZuoJianHao -*-
# -*- coding:utf-8 -*-
# -*- author:ZuoJianHao -*-
import tensorflow as tf
import cv2
import numpy as np
weights = "./yolov3_tiny_widerface_boxes_int8.tflite"
image_path = "./416_416.jpg"
original_image = cv2.imread(image_path)
original_image = cv2.cvtColor(original_i... | 33.423077 | 100 | 0.774453 | # -*- coding:utf-8 -*-
# -*- author:ZuoJianHao -*-
# -*- coding:utf-8 -*-
# -*- author:ZuoJianHao -*-
import tensorflow as tf
import cv2
import numpy as np
weights = "./yolov3_tiny_widerface_boxes_int8.tflite"
image_path = "./416_416.jpg"
original_image = cv2.imread(image_path)
original_image = cv2.cvtColor(original_i... | 0 | 0 | 0 |
c77cfa80e77b7705bd3eaa8d5b29bbc2e97fb41b | 9,725 | py | Python | cyrtranslit/mapping.py | opendatakosovo/serbian-transliterator | 308ec9fba59f96c5eb8cf74371db8a3c0a3a78d8 | [
"MIT"
] | 53 | 2016-02-05T14:03:26.000Z | 2022-03-28T09:26:49.000Z | cyrtranslit/mapping.py | opendatakosovo/serbian-transliterator | 308ec9fba59f96c5eb8cf74371db8a3c0a3a78d8 | [
"MIT"
] | 14 | 2016-02-27T15:19:03.000Z | 2021-03-29T00:58:11.000Z | cyrtranslit/mapping.py | opendatakosovo/serbian-transliterator | 308ec9fba59f96c5eb8cf74371db8a3c0a3a78d8 | [
"MIT"
] | 19 | 2016-02-05T16:34:09.000Z | 2021-12-27T04:49:55.000Z | # -*- coding: utf-8 -*-
import copy
# Build the dictionaries to transliterate Serbian cyrillic to latin and vice versa.
# This dictionary is to transliterate from cyrillic to latin.
SR_CYR_TO_LAT_DICT = {
u'А': u'A', u'а': u'a',
u'Б': u'B', u'б': u'b',
u'В': u'V', u'в': u'v',
u'Г': u'G', u'г': u'g',
... | 33.419244 | 116 | 0.613368 | # -*- coding: utf-8 -*-
import copy
# Build the dictionaries to transliterate Serbian cyrillic to latin and vice versa.
# This dictionary is to transliterate from cyrillic to latin.
SR_CYR_TO_LAT_DICT = {
u'А': u'A', u'а': u'a',
u'Б': u'B', u'б': u'b',
u'В': u'V', u'в': u'v',
u'Г': u'G', u'г': u'g',
... | 0 | 0 | 0 |
11cad09c3f55143e830ec1012461eacd6a70c9c0 | 4,599 | py | Python | scripts/05_nlcd92_to_tracts.py | snmarkley1/HHUUD10 | 9b8ef34d55a37aea4b6cf634cb5ef0c4b24bf977 | [
"MIT"
] | 3 | 2022-03-11T15:22:03.000Z | 2022-03-22T17:02:20.000Z | scripts/05_nlcd92_to_tracts.py | snmarkley1/HHUUD10 | 9b8ef34d55a37aea4b6cf634cb5ef0c4b24bf977 | [
"MIT"
] | null | null | null | scripts/05_nlcd92_to_tracts.py | snmarkley1/HHUUD10 | 9b8ef34d55a37aea4b6cf634cb5ef0c4b24bf977 | [
"MIT"
] | null | null | null |
#####################################################################################
#####################################################################################
#### --------------------------------------------------------------------------- ####
#### ASSIGNING 1992 NLCD CATEGORIES to 2010 TRAC... | 38.647059 | 128 | 0.542509 |
#####################################################################################
#####################################################################################
#### --------------------------------------------------------------------------- ####
#### ASSIGNING 1992 NLCD CATEGORIES to 2010 TRAC... | 0 | 0 | 0 |
402d4255b6153426a7aec9c54bb412f444ffe5cd | 4,734 | py | Python | pesto-cli/pesto/cli/core/docker_builder.py | tapiab/pesto | 786645ba0e82a1231c6cf58b626686fa4fdb943e | [
"Apache-2.0"
] | 25 | 2020-05-19T16:22:52.000Z | 2022-01-06T13:31:19.000Z | pesto-cli/pesto/cli/core/docker_builder.py | tapiab/pesto | 786645ba0e82a1231c6cf58b626686fa4fdb943e | [
"Apache-2.0"
] | 5 | 2020-10-12T09:30:20.000Z | 2021-12-13T12:49:06.000Z | pesto-cli/pesto/cli/core/docker_builder.py | tapiab/pesto | 786645ba0e82a1231c6cf58b626686fa4fdb943e | [
"Apache-2.0"
] | 5 | 2020-06-19T16:05:13.000Z | 2021-03-11T11:51:19.000Z | import os
import shlex
import subprocess
from typing import List
import shutil
from jinja2 import Environment, FileSystemLoader
from pesto.cli import PROCESSING_FACTORY_PATH
from pesto.cli.core.build_config import BuildConfig
from pesto.cli.core.utils import PESTO_LOG
| 40.118644 | 98 | 0.644487 | import os
import shlex
import subprocess
from typing import List
import shutil
from jinja2 import Environment, FileSystemLoader
from pesto.cli import PROCESSING_FACTORY_PATH
from pesto.cli.core.build_config import BuildConfig
from pesto.cli.core.utils import PESTO_LOG
class DockerBuilder(object):
@staticmethod... | 4,157 | 282 | 23 |
39967ca31d2f5acf9f77d22eed28cdf2d14aab38 | 726 | py | Python | subt/test_octomap.py | robotika/osgar | 6f4f584d5553ab62c08a1c7bb493fefdc9033173 | [
"MIT"
] | 12 | 2017-02-16T10:22:59.000Z | 2022-03-20T05:48:06.000Z | subt/test_octomap.py | robotika/osgar | 6f4f584d5553ab62c08a1c7bb493fefdc9033173 | [
"MIT"
] | 618 | 2016-08-30T04:46:12.000Z | 2022-03-25T16:03:10.000Z | subt/test_octomap.py | robotika/osgar | 6f4f584d5553ab62c08a1c7bb493fefdc9033173 | [
"MIT"
] | 11 | 2016-08-27T20:02:55.000Z | 2022-03-07T08:53:53.000Z | import unittest
from unittest.mock import MagicMock
import os
import cv2
import numpy as np
from subt.octomap import Octomap, data2maplevel, frontiers
# vim: expandtab sw=4 ts=4
| 25.928571 | 105 | 0.657025 | import unittest
from unittest.mock import MagicMock
import os
import cv2
import numpy as np
from subt.octomap import Octomap, data2maplevel, frontiers
class OctomapTest(unittest.TestCase):
def test_map(self):
with open(os.path.join(os.path.dirname(__file__), 'test_data', 'freyja-octomap.bin'), 'rb') as... | 450 | 16 | 77 |
ae1e6667fe0f2b408cf01203a620f45e42df1c2b | 1,080 | py | Python | mooda/input/read_df.py | rbardaji/mooda | 00c0f9fae657d3d0f7dd3772a029f78a182a07b2 | [
"MIT"
] | 15 | 2018-08-08T10:46:04.000Z | 2021-09-24T14:38:37.000Z | mooda/input/read_df.py | rbardaji/mooda | 00c0f9fae657d3d0f7dd3772a029f78a182a07b2 | [
"MIT"
] | 3 | 2019-05-14T11:40:40.000Z | 2020-04-30T07:17:15.000Z | mooda/input/read_df.py | rbardaji/mooda | 00c0f9fae657d3d0f7dd3772a029f78a182a07b2 | [
"MIT"
] | 4 | 2018-11-02T14:44:59.000Z | 2021-05-10T21:57:25.000Z | from ..waterframe import WaterFrame
def read_df(df, index_time, index_depth=None, metadata={}, vocabulary={}):
"""
Get a WaterFrame from a pandas DataFrame.
Parameters
----------
df: Pandas.DataFrame
index_time: str
Column with the TIME index
index_depth: str
... | 20.769231 | 74 | 0.563889 | from ..waterframe import WaterFrame
def read_df(df, index_time, index_depth=None, metadata={}, vocabulary={}):
"""
Get a WaterFrame from a pandas DataFrame.
Parameters
----------
df: Pandas.DataFrame
index_time: str
Column with the TIME index
index_depth: str
... | 0 | 0 | 0 |
09417630659f623fe8ff6fbb061c62312b984a9c | 43,554 | py | Python | src/appetite.py | layamba25/appetites | 5ecf38a064e00920b0aed6de0db9f9f171091962 | [
"Apache-2.0"
] | 34 | 2017-03-31T18:28:10.000Z | 2022-03-23T22:49:18.000Z | src/appetite.py | layamba25/appetites | 5ecf38a064e00920b0aed6de0db9f9f171091962 | [
"Apache-2.0"
] | 13 | 2017-04-04T19:22:42.000Z | 2020-07-29T08:58:39.000Z | src/appetite.py | layamba25/appetites | 5ecf38a064e00920b0aed6de0db9f9f171091962 | [
"Apache-2.0"
] | 19 | 2017-04-03T18:44:01.000Z | 2021-07-02T19:49:35.000Z | #!/usr/bin/env python
# pylint: disable=too-complex,no-name-in-module,import-error,relative-import,missing-returns-doc,too-many-instance-attributes,too-many-branches,too-many-statements,too-many-arguments,too-many-locals,no-member,invalid-name
"""Appetite Main.
Parent appetite class
"""
import os
import sys
import tr... | 43.993939 | 221 | 0.543808 | #!/usr/bin/env python
# pylint: disable=too-complex,no-name-in-module,import-error,relative-import,missing-returns-doc,too-many-instance-attributes,too-many-branches,too-many-statements,too-many-arguments,too-many-locals,no-member,invalid-name
"""Appetite Main.
Parent appetite class
"""
import os
import sys
import tr... | 9,373 | 0 | 130 |
19883638b9af42f61b8d150852eef6a91b9b70db | 1,317 | py | Python | src/genie/libs/parser/iosxe/tests/ShowIpArp/cli/equal/golden_output_expected.py | balmasea/genieparser | d1e71a96dfb081e0a8591707b9d4872decd5d9d3 | [
"Apache-2.0"
] | 204 | 2018-06-27T00:55:27.000Z | 2022-03-06T21:12:18.000Z | src/genie/libs/parser/iosxe/tests/ShowIpArp/cli/equal/golden_output_expected.py | balmasea/genieparser | d1e71a96dfb081e0a8591707b9d4872decd5d9d3 | [
"Apache-2.0"
] | 468 | 2018-06-19T00:33:18.000Z | 2022-03-31T23:23:35.000Z | src/genie/libs/parser/iosxe/tests/ShowIpArp/cli/equal/golden_output_expected.py | balmasea/genieparser | d1e71a96dfb081e0a8591707b9d4872decd5d9d3 | [
"Apache-2.0"
] | 309 | 2019-01-16T20:21:07.000Z | 2022-03-30T12:56:41.000Z | expected_output = {
"interfaces": {
"GigabitEthernet2.390": {
"ipv4": {
"neighbors": {
"10.12.90.1": {
"age": "-",
"ip": "10.12.90.1",
"link_layer_address": "fa16.3eff.9c9e",
... | 32.121951 | 63 | 0.265756 | expected_output = {
"interfaces": {
"GigabitEthernet2.390": {
"ipv4": {
"neighbors": {
"10.12.90.1": {
"age": "-",
"ip": "10.12.90.1",
"link_layer_address": "fa16.3eff.9c9e",
... | 0 | 0 | 0 |
d51c2dd166f49926770b54d7c5e8b303712398d5 | 446 | py | Python | samples/post_receiver.py | webpie/webpie | c7f1bc29a63c0be683c60756165a6c65260211f9 | [
"BSD-3-Clause"
] | 2 | 2021-12-10T16:12:51.000Z | 2022-01-06T17:29:12.000Z | samples/post_receiver.py | webpie/webpie | c7f1bc29a63c0be683c60756165a6c65260211f9 | [
"BSD-3-Clause"
] | null | null | null | samples/post_receiver.py | webpie/webpie | c7f1bc29a63c0be683c60756165a6c65260211f9 | [
"BSD-3-Clause"
] | null | null | null | from webpie import WPApp, WPHandler
WPApp(Handler).run_server(8080)
| 31.857143 | 68 | 0.533632 | from webpie import WPApp, WPHandler
class Handler(WPHandler):
def post(self, request, relpath, **args):
print("Request method:", request.method)
print("Request headers:")
for h, v in request.headers.items():
print("%s: %s" % (h,v))
... | 319 | 4 | 54 |
e20586be55085431e58e69b48e220f0d98849b88 | 206 | py | Python | grokking_algorithms/sieve_eratosthenes.py | David2261/Python_Algorithms | cc354766658715d65430a82ebdf7f6ad18b0ab69 | [
"MIT"
] | null | null | null | grokking_algorithms/sieve_eratosthenes.py | David2261/Python_Algorithms | cc354766658715d65430a82ebdf7f6ad18b0ab69 | [
"MIT"
] | null | null | null | grokking_algorithms/sieve_eratosthenes.py | David2261/Python_Algorithms | cc354766658715d65430a82ebdf7f6ad18b0ab69 | [
"MIT"
] | null | null | null | n = int(input("n="))
for a in range(n+1):
continue
lst = []
i = 2
while i <= n:
if a[i] != 0:
lst.append(a[i])
for j in range(i, n+1, i):
a[j] = 0
i += 1
print(lst) | 14.714286 | 34 | 0.42233 | n = int(input("n="))
for a in range(n+1):
continue
lst = []
i = 2
while i <= n:
if a[i] != 0:
lst.append(a[i])
for j in range(i, n+1, i):
a[j] = 0
i += 1
print(lst) | 0 | 0 | 0 |
478bf374458895c34105d64427a1d825de1469f1 | 1,087 | py | Python | draw_captcha/constants.py | henu/django_draw_captcha | 7c910a168d547a650f33f9c6c68624b3a8f77625 | [
"MIT"
] | 1 | 2019-12-01T13:49:52.000Z | 2019-12-01T13:49:52.000Z | draw_captcha/constants.py | henu/django_draw_captcha | 7c910a168d547a650f33f9c6c68624b3a8f77625 | [
"MIT"
] | 1 | 2019-02-13T06:30:59.000Z | 2019-02-13T06:30:59.000Z | draw_captcha/constants.py | henu/django_draw_captcha | 7c910a168d547a650f33f9c6c68624b3a8f77625 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.utils.translation import ugettext_lazy as _
ADJECTIVES = {
'colorful': _('colorful'),
'hairy': _('hairy'),
'wet': _('wet'),
'flying': _('flying'),
'burning': _('burning'),
'dirty': _('dirty'),
}
NOUNS = {
'cat': ... | 21.74 | 55 | 0.50046 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.utils.translation import ugettext_lazy as _
ADJECTIVES = {
'colorful': _('colorful'),
'hairy': _('hairy'),
'wet': _('wet'),
'flying': _('flying'),
'burning': _('burning'),
'dirty': _('dirty'),
}
NOUNS = {
'cat': ... | 0 | 0 | 0 |
8e34086c4f3bd3197e66829b4c7556b434c5f973 | 504 | py | Python | python-django/django-rest-framework/1.QuotesApi/api/serializers.py | Rokon-Uz-Zaman/thinkdiff_python_django | 5010c5f1dd8a028fb9e5235319bb6bb434831e6c | [
"MIT"
] | 92 | 2018-04-03T20:53:07.000Z | 2022-03-04T05:53:10.000Z | django-rest-framework/2.QuotesAPI_DRF_React/quotes/api/serializers.py | mostafijur-rahman299/thinkdiff | b0e0c01fe38c406f4dfa8cc80b2f0c5654017079 | [
"MIT"
] | 11 | 2018-10-01T15:35:33.000Z | 2021-09-01T04:59:56.000Z | django-rest-framework/2.QuotesAPI_DRF_React/quotes/api/serializers.py | mostafijur-rahman299/thinkdiff | b0e0c01fe38c406f4dfa8cc80b2f0c5654017079 | [
"MIT"
] | 98 | 2018-03-13T08:03:54.000Z | 2022-03-22T08:11:44.000Z | from rest_framework import serializers
from quotes.models import Quote
from quotes.models import QuoteCategory | 28 | 59 | 0.64881 | from rest_framework import serializers
from quotes.models import Quote
from quotes.models import QuoteCategory
class QuoteSerializer(serializers.ModelSerializer):
class Meta:
model = Quote
# ('__all__') for all fields
# ['quote', 'author']
fields = ['quote', 'author']
class Quo... | 0 | 346 | 46 |
12d558b923134c8704a52e5eb3a015965fa39656 | 10,818 | py | Python | tsad/useful/ts.py | waico/DL-anomaly-detection | c69eeecfd3376e6e3544ab34e36d6360dbebeb94 | [
"BSD-3-Clause"
] | 8 | 2021-04-27T01:13:37.000Z | 2022-03-26T08:57:44.000Z | tsad/useful/ts.py | waico/DL-anomaly-detection | c69eeecfd3376e6e3544ab34e36d6360dbebeb94 | [
"BSD-3-Clause"
] | 1 | 2021-12-23T16:05:26.000Z | 2021-12-23T16:05:26.000Z | tsad/useful/ts.py | waico/DL-anomaly-detection | c69eeecfd3376e6e3544ab34e36d6360dbebeb94 | [
"BSD-3-Clause"
] | 3 | 2021-04-11T09:34:55.000Z | 2021-12-14T15:54:51.000Z | # косяк, мой подсчет метрик не работает если там нет трушных 1
"""
CDSDSDS
"""
from sklearn.model_selection import train_test_split
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import torch
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
def ts_train_test_split(df, l... | 37.825175 | 123 | 0.612775 | # косяк, мой подсчет метрик не работает если там нет трушных 1
"""
CDSDSDS
"""
from sklearn.model_selection import train_test_split
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import torch
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
def ts_train_test_split(df, l... | 115 | 0 | 60 |
c7cc3d591f8c1c43580a175134be66faf9b07552 | 1,960 | py | Python | treenav/signals.py | itsdkey/django-treenav | cea0bea7212333071f9a8a4731acdb2873a13010 | [
"BSD-3-Clause"
] | null | null | null | treenav/signals.py | itsdkey/django-treenav | cea0bea7212333071f9a8a4731acdb2873a13010 | [
"BSD-3-Clause"
] | null | null | null | treenav/signals.py | itsdkey/django-treenav | cea0bea7212333071f9a8a4731acdb2873a13010 | [
"BSD-3-Clause"
] | null | null | null | from django.core.cache import cache
from django.db.models.signals import post_save
def treenav_save_other_object_handler(sender, instance, created, **kwargs):
"""
This signal attempts to update the HREF of any menu items that point to
another model object, when that objects is saved.
"""
# import ... | 38.431373 | 80 | 0.719388 | from django.core.cache import cache
from django.db.models.signals import post_save
def treenav_save_other_object_handler(sender, instance, created, **kwargs):
"""
This signal attempts to update the HREF of any menu items that point to
another model object, when that objects is saved.
"""
# import ... | 0 | 0 | 0 |
a97f3ec2def04d0f1232f5d84247ba74f4c8641b | 1,881 | py | Python | Model/predictor-dl-model/predictor_dl_model/pipeline/util.py | sanjaynirmal/blue-marlin | 725d614e941e5de76562d354edf11ac18897f242 | [
"Apache-2.0"
] | 1 | 2020-03-06T09:41:49.000Z | 2020-03-06T09:41:49.000Z | Model/predictor-dl-model/predictor_dl_model/pipeline/util.py | sanjaynirmal/blue-marlin | 725d614e941e5de76562d354edf11ac18897f242 | [
"Apache-2.0"
] | null | null | null | Model/predictor-dl-model/predictor_dl_model/pipeline/util.py | sanjaynirmal/blue-marlin | 725d614e941e5de76562d354edf11ac18897f242 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may... | 35.490566 | 82 | 0.633174 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may... | 996 | 0 | 46 |
73731e1a58539d01db4ec0a2ddd7ea1d78bae868 | 357 | py | Python | fastagram/posts/models/like.py | dobestan/fastagram | 8c57401512d7621890a4f160d4b27c6e0d3ab326 | [
"MIT"
] | 1 | 2016-03-27T10:36:01.000Z | 2016-03-27T10:36:01.000Z | fastagram/posts/models/like.py | dobestan/django-101-fastagram | 8c57401512d7621890a4f160d4b27c6e0d3ab326 | [
"MIT"
] | 3 | 2016-03-25T05:32:39.000Z | 2016-03-28T04:59:17.000Z | fastagram/posts/models/like.py | dobestan/django-101-fastagram | 8c57401512d7621890a4f160d4b27c6e0d3ab326 | [
"MIT"
] | 1 | 2016-03-28T16:35:36.000Z | 2016-03-28T16:35:36.000Z | from django.db import models
from django.conf import settings
from posts.models import Post
| 19.833333 | 58 | 0.70028 | from django.db import models
from django.conf import settings
from posts.models import Post
class Like(models.Model):
user = models.ForeignKey(
settings.AUTH_USER_MODEL,
)
post = models.ForeignKey(
Post,
)
created_at = models.DateTimeField(auto_now_add=True, )
updated_at = m... | 0 | 240 | 23 |
d9afe2871c0e09ba936cbd01d73b618a1039280e | 756 | py | Python | test/test_mod_group.py | TamaraGonchar/python_training | 29e289308722d4d4124b1969a832808aa64a5d51 | [
"Apache-2.0"
] | null | null | null | test/test_mod_group.py | TamaraGonchar/python_training | 29e289308722d4d4124b1969a832808aa64a5d51 | [
"Apache-2.0"
] | null | null | null | test/test_mod_group.py | TamaraGonchar/python_training | 29e289308722d4d4124b1969a832808aa64a5d51 | [
"Apache-2.0"
] | null | null | null | from model.group import Group
import random
| 34.363636 | 113 | 0.720899 | from model.group import Group
import random
def test_mod_group_name(app, db, check_ui):
if len(db.get_group_list()) == 0:
app.group.create(Group(name="test"))
old_groups = db.get_group_list()
new_group = Group(name="zxczxcczxc")
mod_group = random.choice(old_groups)
new_group.id = mod_grou... | 686 | 0 | 23 |
015bec3760c2d705619bd01c7c8dfd4ee66ac855 | 404 | py | Python | aircal/dao/airflow.py | BioGeek/aircal | b64d3bb7e30d2cbf13531ce68366ed4af5de8326 | [
"MIT"
] | 66 | 2020-04-20T10:01:08.000Z | 2022-03-25T06:03:42.000Z | aircal/dao/airflow.py | BioGeek/aircal | b64d3bb7e30d2cbf13531ce68366ed4af5de8326 | [
"MIT"
] | 1 | 2020-10-27T06:58:24.000Z | 2020-10-29T17:22:17.000Z | aircal/dao/airflow.py | BioGeek/aircal | b64d3bb7e30d2cbf13531ce68366ed4af5de8326 | [
"MIT"
] | 5 | 2020-10-26T23:20:57.000Z | 2022-02-15T07:55:58.000Z | import pandas as pd
| 26.933333 | 108 | 0.690594 | import pandas as pd
class AirflowDb(object):
def __init__(self, engine):
self.engine = engine
def load_dag_metadata(self):
return pd.read_sql('SELECT dag_id, schedule_interval FROM dag WHERE is_paused = \'0\'', self.engine)
def load_dag_run_metadata(self):
df_dr = pd.read_sql('S... | 276 | 3 | 104 |
fa514c55f70665aa714e676a0f3acd1c42046e2f | 11,517 | py | Python | laske_export/management/commands/get_payments_from_laske.py | suutari-ai/mvj | c39dbc692afcb3b26366783414c2d5a88a57b25a | [
"MIT"
] | 1 | 2021-01-12T08:14:10.000Z | 2021-01-12T08:14:10.000Z | laske_export/management/commands/get_payments_from_laske.py | suutari-ai/mvj | c39dbc692afcb3b26366783414c2d5a88a57b25a | [
"MIT"
] | 249 | 2017-04-18T14:00:13.000Z | 2022-03-30T12:18:03.000Z | laske_export/management/commands/get_payments_from_laske.py | suutari-ai/mvj | c39dbc692afcb3b26366783414c2d5a88a57b25a | [
"MIT"
] | 7 | 2017-04-18T08:43:54.000Z | 2021-07-28T07:29:30.000Z | import datetime
import glob
import os
import sys
import tempfile
from decimal import ROUND_HALF_UP, Decimal
from pathlib import Path
from django.conf import settings
from django.core.management.base import BaseCommand
from django.utils import timezone
from laske_export.models import LaskePaymentsLog
from leasing.mode... | 36.446203 | 109 | 0.510636 | import datetime
import glob
import os
import sys
import tempfile
from decimal import ROUND_HALF_UP, Decimal
from pathlib import Path
from django.conf import settings
from django.core.management.base import BaseCommand
from django.utils import timezone
from laske_export.models import LaskePaymentsLog
from leasing.mode... | 10,848 | 232 | 46 |
7e7184916186c2b8275c1c06b4d9ab8427d7189a | 8,459 | py | Python | cryptopalsolutions/sets/set1.py | maxwolfe/cryptopal-solutions | 525acfe4293597cd15e55dffb07d9e95c6fc44bb | [
"MIT"
] | null | null | null | cryptopalsolutions/sets/set1.py | maxwolfe/cryptopal-solutions | 525acfe4293597cd15e55dffb07d9e95c6fc44bb | [
"MIT"
] | null | null | null | cryptopalsolutions/sets/set1.py | maxwolfe/cryptopal-solutions | 525acfe4293597cd15e55dffb07d9e95c6fc44bb | [
"MIT"
] | null | null | null | """Cryptopals Set 1.
Basics
"""
from base64 import b64decode
from dataclasses import dataclass
from itertools import zip_longest
import cryptopalsolutions.algorithms.binary as binary_helper
import cryptopalsolutions.algorithms.language as language_helper
import cryptopalsolutions.models.solutions as cryptopal_solutio... | 28.385906 | 86 | 0.636837 | """Cryptopals Set 1.
Basics
"""
from base64 import b64decode
from dataclasses import dataclass
from itertools import zip_longest
import cryptopalsolutions.algorithms.binary as binary_helper
import cryptopalsolutions.algorithms.language as language_helper
import cryptopalsolutions.models.solutions as cryptopal_solutio... | 0 | 0 | 0 |
f10c30ce68ca580dba21c6ce0cff79266b24cb2f | 1,636 | py | Python | arima_util.py | jiaorenyu/koubei | 299421f1a96268ca3daafc01d91f1141cfd4f042 | [
"MIT"
] | null | null | null | arima_util.py | jiaorenyu/koubei | 299421f1a96268ca3daafc01d91f1141cfd4f042 | [
"MIT"
] | null | null | null | arima_util.py | jiaorenyu/koubei | 299421f1a96268ca3daafc01d91f1141cfd4f042 | [
"MIT"
] | null | null | null | import pandas as pd
import pyflux as pf
import sys
import date_util
import common
if __name__ == "__main__":
fn = sys.argv[1]
start_date = sys.argv[2]
end_date = sys.argv[3]
predict_start = sys.argv[4]
predict_end = sys.argv[5]
action_count = common.load_action_stat(fn)
count, date, real_v... | 29.214286 | 109 | 0.65709 | import pandas as pd
import pyflux as pf
import sys
import date_util
import common
def get_history_pay(action_count, start_date, end_date, predict_start, predict_end):
date = []
count = []
date_list = date_util.get_date_list(start_date, end_date)
predict_list = date_util.get_date_list(predict_start, pre... | 977 | 0 | 46 |
93e421987f13120e22b8cc1acb04b40173de4857 | 137 | py | Python | tests/__init__.py | lchojnacki/master | 582553e6fa262a310511304f66cf94753308246c | [
"BSD-3-Clause"
] | 1 | 2021-06-11T12:32:12.000Z | 2021-06-11T12:32:12.000Z | tests/__init__.py | lchojnacki/master | 582553e6fa262a310511304f66cf94753308246c | [
"BSD-3-Clause"
] | null | null | null | tests/__init__.py | lchojnacki/master | 582553e6fa262a310511304f66cf94753308246c | [
"BSD-3-Clause"
] | 2 | 2020-08-20T16:13:27.000Z | 2022-03-01T13:49:07.000Z | # TODO: Test verbose name and plural needed for translation.
# TODO: Incorporate HTML process to send message as text/html content type.
| 45.666667 | 75 | 0.788321 | # TODO: Test verbose name and plural needed for translation.
# TODO: Incorporate HTML process to send message as text/html content type.
| 0 | 0 | 0 |
f79f113487327846663a9bac2669e621e1e25c63 | 316 | py | Python | ZMQ(recommended)/python/client-server/manual_ip_port/client.py | enriquecoronadozu/NEP_samples | f3ec18011d38cbb6fa0903b45d4e046dcb0523f1 | [
"MIT"
] | 1 | 2021-04-23T03:56:45.000Z | 2021-04-23T03:56:45.000Z | ZMQ(recommended)/python/client-server/manual_ip_port/client.py | enriquecoronadozu/NEP_samples | f3ec18011d38cbb6fa0903b45d4e046dcb0523f1 | [
"MIT"
] | null | null | null | ZMQ(recommended)/python/client-server/manual_ip_port/client.py | enriquecoronadozu/NEP_samples | f3ec18011d38cbb6fa0903b45d4e046dcb0523f1 | [
"MIT"
] | null | null | null | import nep
import time
client = nep.client('127.0.0.1', 8000) # Create a new client instance
while True:
msg = {"message":"client request"} # Message to send as request
client.send_info(msg) # Send request
print (client.listen_info()) # Wait for server response
time.sleep(1) # Wait one second
| 28.727273 | 69 | 0.686709 | import nep
import time
client = nep.client('127.0.0.1', 8000) # Create a new client instance
while True:
msg = {"message":"client request"} # Message to send as request
client.send_info(msg) # Send request
print (client.listen_info()) # Wait for server response
time.sleep(1) # Wait one second
| 0 | 0 | 0 |
5b7a58a561a63d7007b9296c84fb39a3aaf71504 | 4,445 | py | Python | quickdraw/code/main.py | nkarantzas/quick_draw | 756e5a7a20f617047ba15d3dc2fcc736b673e65e | [
"MIT"
] | null | null | null | quickdraw/code/main.py | nkarantzas/quick_draw | 756e5a7a20f617047ba15d3dc2fcc736b673e65e | [
"MIT"
] | null | null | null | quickdraw/code/main.py | nkarantzas/quick_draw | 756e5a7a20f617047ba15d3dc2fcc736b673e65e | [
"MIT"
] | null | null | null | from glob import glob
import os
import h5py
import resnet_one
import torch
from tqdm import tqdm
import torch.nn as nn
from flags import FLAGS
import json
from get_dataloaders import get_data
from training_functions import train_function, validation_function, validation_summary, test_function
from scoring_functions imp... | 38.652174 | 101 | 0.64072 | from glob import glob
import os
import h5py
import resnet_one
import torch
from tqdm import tqdm
import torch.nn as nn
from flags import FLAGS
import json
from get_dataloaders import get_data
from training_functions import train_function, validation_function, validation_summary, test_function
from scoring_functions imp... | 4,037 | 0 | 23 |
60cad833c868b7feb407f2857a4badefb06f5622 | 590 | py | Python | cfr/input_structures/game.py | andCelli/efg_tools | 0de50f41e971d6ebb461ae4733843096af87e014 | [
"MIT"
] | null | null | null | cfr/input_structures/game.py | andCelli/efg_tools | 0de50f41e971d6ebb461ae4733843096af87e014 | [
"MIT"
] | null | null | null | cfr/input_structures/game.py | andCelli/efg_tools | 0de50f41e971d6ebb461ae4733843096af87e014 | [
"MIT"
] | null | null | null | from cfr.input_structures.utility_matrix import UtilMatrix
| 32.777778 | 107 | 0.713559 | from cfr.input_structures.utility_matrix import UtilMatrix
class Game:
def __init__(self, player_id, opponent_id, player_treeplex, opponent_treeplex, util_matrix: UtilMatrix,
utils_type=UtilMatrix.GENERAL_SUM):
# player vs opponent
self.player_id = player_id
self.opponent_... | 491 | -10 | 49 |
8c9a6d4ff645386abb22e0b3c2a46918871ed8d6 | 814 | py | Python | locations/spiders/goodstart.py | mfjackson/alltheplaces | 37c90b4041c80a574e6e4c2f886883e97df4b636 | [
"MIT"
] | null | null | null | locations/spiders/goodstart.py | mfjackson/alltheplaces | 37c90b4041c80a574e6e4c2f886883e97df4b636 | [
"MIT"
] | null | null | null | locations/spiders/goodstart.py | mfjackson/alltheplaces | 37c90b4041c80a574e6e4c2f886883e97df4b636 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import re
import scrapy
import json
from locations.items import GeojsonPointItem
| 24.666667 | 59 | 0.523342 | # -*- coding: utf-8 -*-
import re
import scrapy
import json
from locations.items import GeojsonPointItem
class GoodstartsSpider(scrapy.Spider):
name = "goodstart"
item_attributes = {"brand": "GoodStart Early Learning"}
allowed_domains = ["goodstart.org.au"]
start_urls = [
"https://www.goodst... | 430 | 253 | 23 |
90819ba5103155765a3fe6ab15f31da57a753251 | 801 | py | Python | src/processing/processing.py | martinjeannot/movie-recommendation-engine | dae5304c609ff725edcb5ac77fd25aee9a910725 | [
"MIT"
] | null | null | null | src/processing/processing.py | martinjeannot/movie-recommendation-engine | dae5304c609ff725edcb5ac77fd25aee9a910725 | [
"MIT"
] | null | null | null | src/processing/processing.py | martinjeannot/movie-recommendation-engine | dae5304c609ff725edcb5ac77fd25aee9a910725 | [
"MIT"
] | null | null | null | from pathlib import Path
import numpy as np
import pandas as pd
if __name__ == '__main__':
main()
| 33.375 | 96 | 0.701623 | from pathlib import Path
import numpy as np
import pandas as pd
def main():
data_path = (Path(__file__).parent / '../../data').resolve()
ratings = pd.read_csv(data_path / 'raw/ml-latest-small/ratings.csv')
ratings_matrix = ratings.pivot(index='userId', columns='movieId', values='rating').fillna(0)
#... | 672 | 0 | 23 |
944f6e94db8d871700ce068404145c8a4b62694a | 3,170 | py | Python | docs/cornell CS class/Lesson 29. Coroutines/demos/pipe.py | LizzieDeng/kalman_fliter_analysis | 50e728f32c496c3fcbb8ca3ee00857b999b88d99 | [
"MIT"
] | null | null | null | docs/cornell CS class/Lesson 29. Coroutines/demos/pipe.py | LizzieDeng/kalman_fliter_analysis | 50e728f32c496c3fcbb8ca3ee00857b999b88d99 | [
"MIT"
] | null | null | null | docs/cornell CS class/Lesson 29. Coroutines/demos/pipe.py | LizzieDeng/kalman_fliter_analysis | 50e728f32c496c3fcbb8ca3ee00857b999b88d99 | [
"MIT"
] | null | null | null | """
A module to show off a native coroutine pipeline.
This pipe allows us to send messages back-and-forth between coroutines,
simulating what we can do with the yield statement/expression. However,
it is very arcane it shows with the native coroutines are not as useful
for animation or other modern applications. In f... | 26.638655 | 71 | 0.63123 | """
A module to show off a native coroutine pipeline.
This pipe allows us to send messages back-and-forth between coroutines,
simulating what we can do with the yield statement/expression. However,
it is very arcane it shows with the native coroutines are not as useful
for animation or other modern applications. In f... | 0 | 0 | 0 |
dea1e8625da801ead3d87c5d23aecaca370e7052 | 744 | py | Python | tests/test_site_parser/test_get_page_html.py | PavliukKonstantin/wallpaper-downloader | 104b5ca1bfdb26b9132f7619406d4e756eb3654c | [
"MIT"
] | null | null | null | tests/test_site_parser/test_get_page_html.py | PavliukKonstantin/wallpaper-downloader | 104b5ca1bfdb26b9132f7619406d4e756eb3654c | [
"MIT"
] | null | null | null | tests/test_site_parser/test_get_page_html.py | PavliukKonstantin/wallpaper-downloader | 104b5ca1bfdb26b9132f7619406d4e756eb3654c | [
"MIT"
] | null | null | null | from wallpaper_downloader import site_parser
from bs4 import BeautifulSoup
def test_good_page_url():
"""
Test '_get_page_html' function of site_parser module.
Function is tested with the good URL of the page.
"""
page_html = site_parser._get_page_html(
"https://www.smashingmagazine.com/ca... | 24 | 67 | 0.672043 | from wallpaper_downloader import site_parser
from bs4 import BeautifulSoup
def test_good_page_url():
"""
Test '_get_page_html' function of site_parser module.
Function is tested with the good URL of the page.
"""
page_html = site_parser._get_page_html(
"https://www.smashingmagazine.com/ca... | 0 | 0 | 0 |
6b36748b221bcc039ee582de8745f4ffb93eb4da | 7,932 | py | Python | mirrorscript-v2.py | VineetBhawsar/Kali-Linux-Repository-Mirrorscript | b72279ba5cb57e48fce4ed36bd5cdf14e8dea00d | [
"MIT"
] | null | null | null | mirrorscript-v2.py | VineetBhawsar/Kali-Linux-Repository-Mirrorscript | b72279ba5cb57e48fce4ed36bd5cdf14e8dea00d | [
"MIT"
] | null | null | null | mirrorscript-v2.py | VineetBhawsar/Kali-Linux-Repository-Mirrorscript | b72279ba5cb57e48fce4ed36bd5cdf14e8dea00d | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# Mirrorscript v2 By Hazmirul Afiq
import subprocess, requests, re, sys
import operator
import argparse, apt, os
import threading
from shutil import copyfile
result_url = []
ping_result = []
mirrors = {}
headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, l... | 30.045455 | 162 | 0.652168 | #!/usr/bin/python3
# Mirrorscript v2 By Hazmirul Afiq
import subprocess, requests, re, sys
import operator
import argparse, apt, os
import threading
from shutil import copyfile
result_url = []
ping_result = []
mirrors = {}
headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, l... | 2,219 | 31 | 210 |
80f427bf3945bfae038215ddc7b6bf51339d4e7a | 4,908 | py | Python | parrec/parread.py | GyroTools/parrec-reader-py | 332183f419a73a4092cae43dd496ef751985a977 | [
"MIT"
] | 1 | 2021-04-29T09:52:59.000Z | 2021-04-29T09:52:59.000Z | parrec/parread.py | GyroTools/parrec-reader-py | 332183f419a73a4092cae43dd496ef751985a977 | [
"MIT"
] | null | null | null | parrec/parread.py | GyroTools/parrec-reader-py | 332183f419a73a4092cae43dd496ef751985a977 | [
"MIT"
] | null | null | null | import os
import re
| 32.078431 | 106 | 0.470456 | import os
import re
class Parread:
NONE = 0
INTEGER = 1
FLOAT = 2
STRING = 3
def __init__(self, filename):
self.parfile = filename
def read(self):
with open(self.parfile) as file:
pars = self._read_upper_part(file)
pars['ImageInformation'] = self._read... | 4,579 | 285 | 23 |
070315fbed82ed038c3dadff4cc995095b5a78dd | 4,234 | py | Python | src/spn/structure/leaves/parametric/MPE.py | tkrons/SPFlow_topdownrules | 6227fc973f4f36da7fbe25fa500d656eb7273033 | [
"Apache-2.0"
] | 199 | 2018-11-13T10:37:45.000Z | 2022-02-06T17:07:28.000Z | src/spn/structure/leaves/parametric/MPE.py | tkrons/SPFlow_topdownrules | 6227fc973f4f36da7fbe25fa500d656eb7273033 | [
"Apache-2.0"
] | 46 | 2018-11-30T13:40:38.000Z | 2022-01-22T21:05:07.000Z | src/spn/structure/leaves/parametric/MPE.py | tkrons/SPFlow_topdownrules | 6227fc973f4f36da7fbe25fa500d656eb7273033 | [
"Apache-2.0"
] | 78 | 2018-11-13T10:37:48.000Z | 2022-03-14T21:34:13.000Z | """
Created on July 02, 2018
@author: Alejandro Molina
"""
from spn.algorithms.MPE import get_mpe_top_down_leaf, add_node_mpe
from spn.structure.leaves.parametric.Inference import continuous_log_likelihood, gamma_log_likelihood, \
discrete_log_likelihood, categorical_log_likelihood, categorical_dictionary_log_like... | 27.855263 | 120 | 0.70359 | """
Created on July 02, 2018
@author: Alejandro Molina
"""
from spn.algorithms.MPE import get_mpe_top_down_leaf, add_node_mpe
from spn.structure.leaves.parametric.Inference import continuous_log_likelihood, gamma_log_likelihood, \
discrete_log_likelihood, categorical_log_likelihood, categorical_dictionary_log_like... | 3,517 | 0 | 69 |
1628492f0fa3bfdbfaadb16b61c20a45afdf47df | 12,159 | py | Python | simscale_sdk/models/pressure_inlet_bc.py | slainesimscale/simscale-python-sdk | db483eeabe558e55d020f5f829a3bf13c9c287a7 | [
"MIT"
] | 8 | 2021-01-22T13:41:03.000Z | 2022-01-03T09:00:10.000Z | simscale_sdk/models/pressure_inlet_bc.py | slainesimscale/simscale-python-sdk | db483eeabe558e55d020f5f829a3bf13c9c287a7 | [
"MIT"
] | null | null | null | simscale_sdk/models/pressure_inlet_bc.py | slainesimscale/simscale-python-sdk | db483eeabe558e55d020f5f829a3bf13c9c287a7 | [
"MIT"
] | 3 | 2021-03-18T15:52:52.000Z | 2022-01-03T08:59:30.000Z | # coding: utf-8
"""
SimScale API
The version of the OpenAPI document: 0.0.0
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from simscale_sdk.configuration import Configuration
class PressureInletBC(object):
"""NOTE: This class is auto generated ... | 31.664063 | 305 | 0.64076 | # coding: utf-8
"""
SimScale API
The version of the OpenAPI document: 0.0.0
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from simscale_sdk.configuration import Configuration
class PressureInletBC(object):
"""NOTE: This class is auto generated ... | 0 | 0 | 0 |
eb213d6bd854228c7adc6f7b3b8654771cb9a171 | 32,145 | py | Python | models/action.py | u-n-i-c-o-rn/jimiPlugin-inga | bfbde6d3412b56360288c5b7baceea31a33115e8 | [
"Apache-2.0"
] | null | null | null | models/action.py | u-n-i-c-o-rn/jimiPlugin-inga | bfbde6d3412b56360288c5b7baceea31a33115e8 | [
"Apache-2.0"
] | null | null | null | models/action.py | u-n-i-c-o-rn/jimiPlugin-inga | bfbde6d3412b56360288c5b7baceea31a33115e8 | [
"Apache-2.0"
] | null | null | null | import time
import uuid
import re
from pathlib import Path
import subprocess
import requests
import base64
from netaddr import *
from urllib3.exceptions import InsecureRequestWarning
from core import settings, helpers, audit, db, storage
from core.models import action
from plugins.inga.models import inga
from plugins.... | 48.630862 | 275 | 0.539773 | import time
import uuid
import re
from pathlib import Path
import subprocess
import requests
import base64
from netaddr import *
from urllib3.exceptions import InsecureRequestWarning
from core import settings, helpers, audit, db, storage
from core.models import action
from plugins.inga.models import inga
from plugins.... | 29,885 | 1,544 | 321 |
a879336b1e8a2ea96a2570c509c7665edb53dd82 | 100 | py | Python | src/pysdjango/stockview_app/apps.py | NIAGroup/PyStockAnalyze-2019 | 49a92b3b9ff487295bb3a30a88f1ca388281a77f | [
"MIT"
] | 2 | 2019-03-21T04:42:23.000Z | 2019-04-05T23:06:06.000Z | src/pysdjango/stockview_app/apps.py | NIAGroup/PyStockAnalyze | 49a92b3b9ff487295bb3a30a88f1ca388281a77f | [
"MIT"
] | 48 | 2019-02-17T20:51:39.000Z | 2019-03-12T21:40:04.000Z | src/pysdjango/stockview_app/apps.py | NIAGroup/PyStockAnalyze-2019 | 49a92b3b9ff487295bb3a30a88f1ca388281a77f | [
"MIT"
] | 1 | 2019-04-13T00:31:09.000Z | 2019-04-13T00:31:09.000Z | from django.apps import AppConfig
| 16.666667 | 36 | 0.78 | from django.apps import AppConfig
class StockviewAppConfig(AppConfig):
name = 'stockview_app'
| 0 | 42 | 23 |
5a7c3086541f0164db1b43c6fba5be19bfaa1b13 | 9,784 | py | Python | tests/test_configuration.py | FAIRDataPipeline/FAIR-CLI | 465cd164a47bf38aa8b16c933e072cff9c4cb23c | [
"BSD-2-Clause"
] | null | null | null | tests/test_configuration.py | FAIRDataPipeline/FAIR-CLI | 465cd164a47bf38aa8b16c933e072cff9c4cb23c | [
"BSD-2-Clause"
] | 213 | 2021-06-30T07:48:26.000Z | 2022-03-29T08:11:52.000Z | tests/test_configuration.py | FAIRDataPipeline/FAIR-CLI | 465cd164a47bf38aa8b16c933e072cff9c4cb23c | [
"BSD-2-Clause"
] | 1 | 2021-09-15T13:55:22.000Z | 2021-09-15T13:55:22.000Z | import os
import typing
import deepdiff
import pytest
import pytest_mock
import fair.configuration as fdp_conf
import fair.identifiers as fdp_id
@pytest.mark.configuration
@pytest.mark.configuration
@pytest.mark.configuration
@pytest.mark.configuration
@pytest.mark.configuration
@pytest.mark.configuration... | 31.56129 | 79 | 0.638083 | import os
import typing
import deepdiff
import pytest
import pytest_mock
import fair.configuration as fdp_conf
import fair.identifiers as fdp_id
@pytest.mark.configuration
def test_local_cli_config_read(local_config: typing.Tuple[str, str]):
_read = fdp_conf.read_local_fdpconfig(local_config[1])
assert _rea... | 8,821 | 0 | 352 |
9ad18fb0f9acdc9f574d5240c690fd471b76c44e | 18,966 | py | Python | tworaven_apps/ta2_interfaces/models.py | TwoRavens/TwoRavens | e5f820557d6646df525ceed15e17d79f4159cf0a | [
"Apache-2.0"
] | 20 | 2017-12-11T07:26:06.000Z | 2021-11-22T16:16:20.000Z | tworaven_apps/ta2_interfaces/models.py | TwoRavens/TwoRavens | e5f820557d6646df525ceed15e17d79f4159cf0a | [
"Apache-2.0"
] | 849 | 2017-10-20T18:21:18.000Z | 2022-02-18T02:45:44.000Z | tworaven_apps/ta2_interfaces/models.py | TwoRavens/TwoRavens | e5f820557d6646df525ceed15e17d79f4159cf0a | [
"Apache-2.0"
] | 1 | 2020-05-18T06:02:13.000Z | 2020-05-18T06:02:13.000Z | from collections import OrderedDict
import hashlib
from django.db import models
from django.conf import settings
from django.urls import reverse
from django.utils.safestring import mark_safe
import jsonfield
from model_utils.models import TimeStampedModel
from tworaven_apps.utils.basic_response import (ok_resp, err_... | 33.041812 | 88 | 0.577665 | from collections import OrderedDict
import hashlib
from django.db import models
from django.conf import settings
from django.urls import reverse
from django.utils.safestring import mark_safe
import jsonfield
from model_utils.models import TimeStampedModel
from tworaven_apps.utils.basic_response import (ok_resp, err_... | 0 | 0 | 0 |
3c91c91dd9e0d52f5b7a1ab3b325699bb2413149 | 6,080 | py | Python | cv_framework/data_access/data_prep.py | gafergus/CV_scientist | 7feb42c72e91d677c317e97c916be3eef0d8e270 | [
"ECL-2.0",
"Apache-2.0"
] | 3 | 2019-05-21T12:53:25.000Z | 2022-02-17T20:26:38.000Z | cv_framework/data_access/data_prep.py | gafergus/CV_scientist | 7feb42c72e91d677c317e97c916be3eef0d8e270 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | cv_framework/data_access/data_prep.py | gafergus/CV_scientist | 7feb42c72e91d677c317e97c916be3eef0d8e270 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | import os
import pandas as pd
import numpy as np
import gin
import shutil
from sklearn.model_selection import train_test_split
@gin.configurable
| 50.247934 | 122 | 0.561678 | import os
import pandas as pd
import numpy as np
import gin
import shutil
from sklearn.model_selection import train_test_split
@gin.configurable
class FilePrep:
def __init__(self, exp_directory=None, image_directory=None, remake_train_test=False, train=0.60,
labels_csv_path=None, file_na... | 5,735 | -6 | 195 |
3eed5ba3f4bb78d7a630b0bb4f1bff61fc635219 | 3,767 | py | Python | Blackjack/test_blackjack.py | nairoukh-code/Python_Projects | 9a0e2adb6e352b301ed9e542be9c9f1cd16b95b0 | [
"MIT"
] | null | null | null | Blackjack/test_blackjack.py | nairoukh-code/Python_Projects | 9a0e2adb6e352b301ed9e542be9c9f1cd16b95b0 | [
"MIT"
] | null | null | null | Blackjack/test_blackjack.py | nairoukh-code/Python_Projects | 9a0e2adb6e352b301ed9e542be9c9f1cd16b95b0 | [
"MIT"
] | null | null | null | from unittest import TestCase
from Blackjack.blackjack import Hand, Card, Deck
| 31.132231 | 53 | 0.601274 | from unittest import TestCase
from Blackjack.blackjack import Hand, Card, Deck
class TestDeck(TestCase):
def test_deal(self):
player_hand = []
deck = Deck()
player_hand.append(deck.deal())
player_hand.append(deck.deal())
actual = len(player_hand)
self.assertEqual(a... | 3,335 | 8 | 341 |
bae0ae26bd84544a49ca8061d720569943a23250 | 549 | py | Python | 03_ubuntu-weather-app/code/cleanup.py | rishirdua/eep702-software-laboratory | 9914a96db69607255d62cb2eebdea0cdfcf7ebcd | [
"MIT"
] | 1 | 2015-05-18T10:39:19.000Z | 2015-05-18T10:39:19.000Z | 03_ubuntu-weather-app/code/weather/cleanup.py | rishirdua/eep702-software-laboratory | 9914a96db69607255d62cb2eebdea0cdfcf7ebcd | [
"MIT"
] | null | null | null | 03_ubuntu-weather-app/code/weather/cleanup.py | rishirdua/eep702-software-laboratory | 9914a96db69607255d62cb2eebdea0cdfcf7ebcd | [
"MIT"
] | null | null | null | import MySQLdb
import urllib2, urllib, re, sys
import xml
from datetime import datetime
##removes all records older than 30 days.. run as cron job
#main file, run as parseweather(woeid)
if __name__ == '__main__':
cleandb()
| 26.142857 | 97 | 0.70674 | import MySQLdb
import urllib2, urllib, re, sys
import xml
from datetime import datetime
##removes all records older than 30 days.. run as cron job
def cleandb(woeid):
try:
# connect to database
db = MySQLdb.connect(host="localhost", user="root", passwd="4c9hq5ea", db="cmaxopaw_weather")
cursor = db.cursor()
c... | 298 | 0 | 22 |
4b00363ed458cce24c170f92ec83aee2a23be13b | 165 | py | Python | cubam/BinaryModel.py | welinder/cubam | fe5ba700f1adbb489c69af311558d64370d73d36 | [
"BSD-3-Clause-Clear"
] | 20 | 2015-01-10T02:53:44.000Z | 2022-03-20T18:10:15.000Z | cubam/BinaryModel.py | afcarl/cubam | fe5ba700f1adbb489c69af311558d64370d73d36 | [
"BSD-3-Clause-Clear"
] | 1 | 2019-01-30T17:02:51.000Z | 2019-01-30T17:02:51.000Z | cubam/BinaryModel.py | afcarl/cubam | fe5ba700f1adbb489c69af311558d64370d73d36 | [
"BSD-3-Clause-Clear"
] | 12 | 2016-02-22T02:43:55.000Z | 2021-09-19T20:50:09.000Z | from Model import *
from numpy import sign
| 23.571429 | 49 | 0.721212 | from Model import *
from numpy import sign
class BinaryModel(Model):
def __init__(self, filename=None, data=None):
Model.__init__(self, filename, data)
| 69 | 4 | 49 |
c3af073d48be7df1154eaf58e220576398dfeae9 | 9,197 | py | Python | src/blockdag/blockdag.py | pritchardn/BlockDAG | 6de9c39b4408d95fbe2f3d89d5f7f9ea2764438f | [
"MIT"
] | null | null | null | src/blockdag/blockdag.py | pritchardn/BlockDAG | 6de9c39b4408d95fbe2f3d89d5f7f9ea2764438f | [
"MIT"
] | null | null | null | src/blockdag/blockdag.py | pritchardn/BlockDAG | 6de9c39b4408d95fbe2f3d89d5f7f9ea2764438f | [
"MIT"
] | null | null | null | """BlockDAG generator
This package contains code to build and compare BlockDAG in a lightweight-as-possible manner.
The main method (build_block_dag) performs a Kahn topological sort of the vertices (dict) and edges
(list of (u, v) tuples) building blocks for each vertex as needed.
"""
import json
import hashlib
impo... | 34.70566 | 99 | 0.64869 | """BlockDAG generator
This package contains code to build and compare BlockDAG in a lightweight-as-possible manner.
The main method (build_block_dag) performs a Kahn topological sort of the vertices (dict) and edges
(list of (u, v) tuples) building blocks for each vertex as needed.
"""
import json
import hashlib
impo... | 2,016 | 0 | 138 |
8a932aae702122d52a86af536e1089b97bdabc88 | 151 | py | Python | paderwasn/paths.py | fgnt/paderwasn | ff88f73a51228bb2cb4372f7595169dd716f4f2f | [
"MIT"
] | 7 | 2021-09-06T03:42:37.000Z | 2022-01-11T15:51:19.000Z | paderwasn/paths.py | fgnt/paderwasn | ff88f73a51228bb2cb4372f7595169dd716f4f2f | [
"MIT"
] | null | null | null | paderwasn/paths.py | fgnt/paderwasn | ff88f73a51228bb2cb4372f7595169dd716f4f2f | [
"MIT"
] | 1 | 2022-03-22T03:06:58.000Z | 2022-03-22T03:06:58.000Z | from pathlib import Path
calib_set_json_path = (Path(__file__).parent
/ 'databases/geometry_calibration/calibration_set.json')
| 30.2 | 79 | 0.701987 | from pathlib import Path
calib_set_json_path = (Path(__file__).parent
/ 'databases/geometry_calibration/calibration_set.json')
| 0 | 0 | 0 |
5d3e5d36c184f62417d304b41d1d64ec58689730 | 20,272 | py | Python | xlwings/tests/udfs/udf_tests.py | Vip1225/testxlwings | 894685144916ab7056be17c0cdc1baa71e8d3af9 | [
"BSD-3-Clause"
] | null | null | null | xlwings/tests/udfs/udf_tests.py | Vip1225/testxlwings | 894685144916ab7056be17c0cdc1baa71e8d3af9 | [
"BSD-3-Clause"
] | null | null | null | xlwings/tests/udfs/udf_tests.py | Vip1225/testxlwings | 894685144916ab7056be17c0cdc1baa71e8d3af9 | [
"BSD-3-Clause"
] | 1 | 2021-11-06T16:26:35.000Z | 2021-11-06T16:26:35.000Z | from datetime import datetime, date
import sys
if sys.version_info >= (2, 7):
from nose.tools import assert_dict_equal
import xlwings as xw
try:
import numpy as np
from numpy.testing import assert_array_equal
except ImportError:
np = None
try:
import pandas as pd
from pandas import DataFrame, S... | 28.116505 | 138 | 0.569159 | from datetime import datetime, date
import sys
if sys.version_info >= (2, 7):
from nose.tools import assert_dict_equal
import xlwings as xw
try:
import numpy as np
from numpy.testing import assert_array_equal
def nparray_equal(a, b):
try:
assert_array_equal(a, b)
except Asse... | 12,310 | 0 | 2,732 |
5281f09deaa23402d6e61d9c47670c0a2419461a | 1,762 | py | Python | task/daily_daysign.py | dhbowen1/unicom-task | 2ff711a1346422f71bbd6796a9f8a1f59ea9c379 | [
"MIT"
] | 178 | 2021-08-16T09:42:47.000Z | 2022-03-25T07:06:35.000Z | task/daily_daysign.py | dhbowen1/unicom-task | 2ff711a1346422f71bbd6796a9f8a1f59ea9c379 | [
"MIT"
] | 43 | 2021-08-16T02:38:29.000Z | 2022-02-04T08:01:50.000Z | task/daily_daysign.py | dhbowen1/unicom-task | 2ff711a1346422f71bbd6796a9f8a1f59ea9c379 | [
"MIT"
] | 120 | 2021-08-17T10:12:37.000Z | 2022-03-30T04:24:25.000Z | # -*- coding: utf-8 -*-
# @Time : 2021/08/14 16:30
# @Author : srcrs
# @Email : srcrs@foxmail.com
import requests,json,time,re,login,logging,traceback,os,random,notify,datetime
from lxml.html import fromstring
#每日签到,1积分 ,第七天得到 1G 日包
#位置: 我的 --> 我的金币 | 50.342857 | 121 | 0.61067 | # -*- coding: utf-8 -*-
# @Time : 2021/08/14 16:30
# @Author : srcrs
# @Email : srcrs@foxmail.com
import requests,json,time,re,login,logging,traceback,os,random,notify,datetime
from lxml.html import fromstring
#每日签到,1积分 ,第七天得到 1G 日包
#位置: 我的 --> 我的金币
class daily_daysign:
def run(self, client, user):
t... | 1,621 | -1 | 48 |
9839efc19a78863f6bd387adf855489cb1d99d1e | 1,889 | py | Python | plugins/joe_sandbox/komand_joe_sandbox/connection/connection.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 46 | 2019-06-05T20:47:58.000Z | 2022-03-29T10:18:01.000Z | plugins/joe_sandbox/komand_joe_sandbox/connection/connection.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 386 | 2019-06-07T20:20:39.000Z | 2022-03-30T17:35:01.000Z | plugins/joe_sandbox/komand_joe_sandbox/connection/connection.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 43 | 2019-07-09T14:13:58.000Z | 2022-03-28T12:04:46.000Z | import komand
from .schema import ConnectionSchema, Input
# Custom imports below
import jbxapi
from komand.exceptions import ConnectionTestException
| 39.354167 | 115 | 0.678666 | import komand
from .schema import ConnectionSchema, Input
# Custom imports below
import jbxapi
from komand.exceptions import ConnectionTestException
class Connection(komand.Connection):
def __init__(self):
super(self.__class__, self).__init__(input=ConnectionSchema())
def connect(self, params):
... | 1,620 | 15 | 103 |
0afc257fe640d7bbaae886cd9133d6d5161b0d89 | 5,091 | py | Python | tests/test_buffer_util.py | mhils/python-zstandard | 70dcc805d7761b1d7e35fd219a4d5d4512acd96a | [
"BSD-3-Clause"
] | null | null | null | tests/test_buffer_util.py | mhils/python-zstandard | 70dcc805d7761b1d7e35fd219a4d5d4512acd96a | [
"BSD-3-Clause"
] | null | null | null | tests/test_buffer_util.py | mhils/python-zstandard | 70dcc805d7761b1d7e35fd219a4d5d4512acd96a | [
"BSD-3-Clause"
] | null | null | null | import struct
import unittest
import zstandard as zstd
ss = struct.Struct("=QQ")
| 35.110345 | 88 | 0.633471 | import struct
import unittest
import zstandard as zstd
ss = struct.Struct("=QQ")
class TestBufferWithSegments(unittest.TestCase):
def test_arguments(self):
if not hasattr(zstd, "BufferWithSegments"):
self.skipTest("BufferWithSegments not available")
with self.assertRaises(TypeError)... | 4,655 | 64 | 287 |
e64ab51a771b2157da2527fe9df8a1bc9cadcaf8 | 2,962 | py | Python | flask_resql/resql/inspect.py | twocucao/flask-resql | 6d5573293b04f2fa64411b5c85e36d377426b676 | [
"MIT"
] | 1 | 2020-12-09T14:54:38.000Z | 2020-12-09T14:54:38.000Z | flask_resql/resql/inspect.py | twocucao/flask-resql | 6d5573293b04f2fa64411b5c85e36d377426b676 | [
"MIT"
] | null | null | null | flask_resql/resql/inspect.py | twocucao/flask-resql | 6d5573293b04f2fa64411b5c85e36d377426b676 | [
"MIT"
] | null | null | null | import inspect
import typing
from typing import Callable, Dict, Any
from flask_resql import resql as rs
from flask_resql.resql import gen_args_from_params
| 30.854167 | 85 | 0.661377 | import inspect
import typing
from typing import Callable, Dict, Any
from flask_resql import resql as rs
from flask_resql.resql import gen_args_from_params
def get_typed_signature(call: Callable) -> inspect.Signature:
signature = inspect.signature(call)
global_ns = getattr(call, "__globals__", {})
typed_p... | 2,419 | 291 | 92 |
14aaf108131e71fa427262f5ee129addc001ddae | 33,527 | py | Python | canopy/openapi/api/sim_version_api.py | CanopySimulations/canopy-python | 9ec37e674e65d6fbef0402ac0c612c163d55631e | [
"MIT"
] | null | null | null | canopy/openapi/api/sim_version_api.py | CanopySimulations/canopy-python | 9ec37e674e65d6fbef0402ac0c612c163d55631e | [
"MIT"
] | 1 | 2022-01-31T10:18:08.000Z | 2022-01-31T10:18:08.000Z | canopy/openapi/api/sim_version_api.py | CanopySimulations/canopy-python | 9ec37e674e65d6fbef0402ac0c612c163d55631e | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Canopy.Api
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v1
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # noqa:... | 45.063172 | 142 | 0.601068 | # coding: utf-8
"""
Canopy.Api
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v1
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # noqa:... | 120 | 0 | 27 |
188c1a7cce062d9cabbd1c83f59bdcfba4816ea6 | 493 | py | Python | dpoll/polls/migrations/0014_auto_20190205_1016.py | tymmesyde/dpoll.xyz | d3b6b204026f05b3b7a8e0baccf23dee6a41d679 | [
"MIT"
] | 22 | 2018-09-21T09:58:49.000Z | 2020-11-12T08:27:06.000Z | dpoll/polls/migrations/0014_auto_20190205_1016.py | tymmesyde/dpoll.xyz | d3b6b204026f05b3b7a8e0baccf23dee6a41d679 | [
"MIT"
] | 60 | 2018-09-21T10:18:15.000Z | 2021-06-10T20:48:53.000Z | dpoll/polls/migrations/0014_auto_20190205_1016.py | tymmesyde/dpoll.xyz | d3b6b204026f05b3b7a8e0baccf23dee6a41d679 | [
"MIT"
] | 9 | 2018-09-23T02:04:23.000Z | 2021-05-23T16:28:34.000Z | # Generated by Django 2.1.1 on 2019-02-05 10:16
from django.db import migrations, models
| 21.434783 | 60 | 0.565923 | # Generated by Django 2.1.1 on 2019-02-05 10:16
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('polls', '0013_voteaudit'),
]
operations = [
migrations.RemoveField(
model_name='voteaudit',
name='choice',
)... | 0 | 379 | 23 |
4cfb195bd85c1b8d9082780bde130e06463acb3e | 2,549 | py | Python | Unsupervised_Learning/FuzzyKmeans.py | shyamsn97/artificial-intelligence | 9f15906f0b342195ba66c20bcc77d895ba64169f | [
"MIT"
] | null | null | null | Unsupervised_Learning/FuzzyKmeans.py | shyamsn97/artificial-intelligence | 9f15906f0b342195ba66c20bcc77d895ba64169f | [
"MIT"
] | null | null | null | Unsupervised_Learning/FuzzyKmeans.py | shyamsn97/artificial-intelligence | 9f15906f0b342195ba66c20bcc77d895ba64169f | [
"MIT"
] | null | null | null | import numpy as np
class FuzzyKmeans():
"""
Fuzzy Kmeans calculates cluster probabilities in regards to euclidian distance
Equivalent to vanilla Kmeans if we assign a given point to the cluster with the highest fuzzy probability
Parameters:
X: numpy array() data matrix
U: cluster probab... | 35.402778 | 109 | 0.571204 | import numpy as np
class FuzzyKmeans():
"""
Fuzzy Kmeans calculates cluster probabilities in regards to euclidian distance
Equivalent to vanilla Kmeans if we assign a given point to the cluster with the highest fuzzy probability
Parameters:
X: numpy array() data matrix
U: cluster probab... | 795 | 0 | 88 |
5699963d0cec794c69b5478f1e5642ba6e0669f4 | 623 | py | Python | data.py | codexhyperloop/iMX6-Data-Processing | d0e5ec70f5409838d180dddd9f05244eb17ac370 | [
"MIT"
] | 1 | 2017-01-14T18:35:48.000Z | 2017-01-14T18:35:48.000Z | data.py | codexhyperloop/iMX6-Data-Processing | d0e5ec70f5409838d180dddd9f05244eb17ac370 | [
"MIT"
] | null | null | null | data.py | codexhyperloop/iMX6-Data-Processing | d0e5ec70f5409838d180dddd9f05244eb17ac370 | [
"MIT"
] | null | null | null | Python 2.7.9 (default, Sep 17 2016, 20:26:04)
[GCC 4.9.2] on linux2
Type "copyright", "credits" or "license()" for more information.
>>> ================================ RESTART ================================
>>>
Initializing...
1
Primary SAM3X8E Serial Connected
00
f1
31
32
2e
33
34
35
36
37
20
20
ff
55
34
35
36
3... | 5.5625 | 77 | 0.616372 | Python 2.7.9 (default, Sep 17 2016, 20:26:04)
[GCC 4.9.2] on linux2
Type "copyright", "credits" or "license()" for more information.
>>> ================================ RESTART ================================
>>>
Initializing...
1
Primary SAM3X8E Serial Connected
00
f1
31
32
2e
33
34
35
36
37
20
20
ff
55
34
35
36
3... | 0 | 0 | 0 |
f39d44746650cb3773a771d4bf829f10d9e72f45 | 47,523 | py | Python | grplot/features/plot/plot_single_def.py | ghiffaryr/grplot | 43ea08febac4ffecbce0a6a3d679850f5013aa28 | [
"BSD-3-Clause"
] | null | null | null | grplot/features/plot/plot_single_def.py | ghiffaryr/grplot | 43ea08febac4ffecbce0a6a3d679850f5013aa28 | [
"BSD-3-Clause"
] | null | null | null | grplot/features/plot/plot_single_def.py | ghiffaryr/grplot | 43ea08febac4ffecbce0a6a3d679850f5013aa28 | [
"BSD-3-Clause"
] | null | null | null | import numpy
import seaborn as sns
from matplotlib.ticker import PercentFormatter
from pandas.api.types import is_numeric_dtype, is_object_dtype, is_categorical_dtype
from grplot.features.plot.packedbubbles import plot as pb
from grplot.features.plot.treemaps import plot as tms
| 34.115578 | 286 | 0.341498 | import numpy
import seaborn as sns
from matplotlib.ticker import PercentFormatter
from pandas.api.types import is_numeric_dtype, is_object_dtype, is_categorical_dtype
from grplot.features.plot.packedbubbles import plot as pb
from grplot.features.plot.treemaps import plot as tms
def plot_single_def(plot,
... | 47,221 | 0 | 23 |
909029fb6eecc1b3676465c6ec4bc40b837c755d | 5,230 | py | Python | conkit/core/tests/test_distance.py | jjavier-bm/conkit | da54f0679bcc346e9dbeb67c71c31800ccbb2172 | [
"BSD-3-Clause"
] | 2 | 2016-10-05T09:00:24.000Z | 2016-10-05T21:12:15.000Z | conkit/core/tests/test_distance.py | fsimkovic/cptbx | 9888e40caa1720a9905c551b963ffd4f99f9c913 | [
"BSD-3-Clause"
] | null | null | null | conkit/core/tests/test_distance.py | fsimkovic/cptbx | 9888e40caa1720a9905c551b963ffd4f99f9c913 | [
"BSD-3-Clause"
] | null | null | null | """Testing facility for conkit.core.distance.Distance"""
import unittest
import numpy as np
from conkit.core.distance import Distance
from conkit.core.distogram import Distogram
if __name__ == "__main__":
unittest.main(verbosity=2)
| 49.809524 | 114 | 0.62218 | """Testing facility for conkit.core.distance.Distance"""
import unittest
import numpy as np
from conkit.core.distance import Distance
from conkit.core.distogram import Distogram
class TestDistance(unittest.TestCase):
def test_predicted_distance_1(self):
distance = Distance(1, 25, (0.15, 0.45, 0.25, 0.05... | 4,572 | 17 | 401 |
055e81a472eb633602fe24ac6ab1bce6102a3c04 | 572 | py | Python | mmdet/core/utils/__init__.py | opencv/mmdetection | 6a7dfa5b954d6bbad7f8d33db8268b0fafc7d555 | [
"Apache-2.0"
] | 24 | 2020-04-15T14:54:44.000Z | 2020-08-12T12:45:57.000Z | mmdet/core/utils/__init__.py | opencv/mmdetection | 6a7dfa5b954d6bbad7f8d33db8268b0fafc7d555 | [
"Apache-2.0"
] | 46 | 2020-04-10T12:01:59.000Z | 2020-09-04T06:25:56.000Z | mmdet/core/utils/__init__.py | ovextra/mmdetection | 230fb739a50d8495e826013c7bbf64b7e0aff939 | [
"Apache-2.0"
] | 11 | 2020-04-16T17:55:29.000Z | 2020-08-25T11:13:58.000Z | # Copyright (C) 2018-2021 OpenMMLab
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2020-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
from .dist_utils import (DistOptimizerHook, all_reduce_dict,
allreduce_grads, reduce_mean)
from .lr_updater import CosineAnnealingUntil... | 33.647059 | 64 | 0.748252 | # Copyright (C) 2018-2021 OpenMMLab
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2020-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
from .dist_utils import (DistOptimizerHook, all_reduce_dict,
allreduce_grads, reduce_mean)
from .lr_updater import CosineAnnealingUntil... | 0 | 0 | 0 |
e98fe05eea9777274c2e140ddd0bd4b5f8d2fc3a | 1,801 | py | Python | testsuite/tests/apicast/policy/content_limits/test_payload_limits_response.py | dlaso99/3scale-tests | b31a3b3596af6d632b393e383c0417ea56bd95ca | [
"Apache-2.0"
] | 5 | 2021-11-04T14:09:24.000Z | 2021-12-23T13:48:36.000Z | testsuite/tests/apicast/policy/content_limits/test_payload_limits_response.py | dlaso99/3scale-tests | b31a3b3596af6d632b393e383c0417ea56bd95ca | [
"Apache-2.0"
] | 41 | 2021-11-03T14:27:21.000Z | 2022-03-29T14:46:16.000Z | testsuite/tests/apicast/policy/content_limits/test_payload_limits_response.py | dlaso99/3scale-tests | b31a3b3596af6d632b393e383c0417ea56bd95ca | [
"Apache-2.0"
] | 12 | 2021-11-03T17:28:31.000Z | 2021-11-30T12:28:25.000Z | """
Testing that the request/response content limit policy limits the content-length of the
response body
"""
import pytest
from packaging.version import Version # noqa # pylint: disable=unused-import
from testsuite import rawobj, TESTED_VERSION # noqa # pylint: disable=unused-import
pytestmark = [pytest.mark.issue... | 39.152174 | 95 | 0.684064 | """
Testing that the request/response content limit policy limits the content-length of the
response body
"""
import pytest
from packaging.version import Version # noqa # pylint: disable=unused-import
from testsuite import rawobj, TESTED_VERSION # noqa # pylint: disable=unused-import
pytestmark = [pytest.mark.issue... | 0 | 0 | 0 |
f14e83fa5f5b32dab5d8e26d70332e7dc7c2a536 | 2,051 | py | Python | tests/test_output_file.py | gertjanklein/iris-export-builder | 5b8c14429c923f653b04b78badc5dc84ad5d9ce7 | [
"Apache-2.0"
] | null | null | null | tests/test_output_file.py | gertjanklein/iris-export-builder | 5b8c14429c923f653b04b78badc5dc84ad5d9ce7 | [
"Apache-2.0"
] | null | null | null | tests/test_output_file.py | gertjanklein/iris-export-builder | 5b8c14429c923f653b04b78badc5dc84ad5d9ce7 | [
"Apache-2.0"
] | null | null | null | """ Tests output file handling.
"""
from importlib import import_module
from typing import Any
from os.path import join
from unittest.mock import patch
import pytest
builder = import_module("build-export") # type: Any
CFG = """
[Source]
type = "directory"
srctype = 'xml'
cspdir = 'csp'
datadir = 'data'
srcdir = 's... | 23.574713 | 99 | 0.652852 | """ Tests output file handling.
"""
from importlib import import_module
from typing import Any
from os.path import join
from unittest.mock import patch
import pytest
builder = import_module("build-export") # type: Any
CFG = """
[Source]
type = "directory"
srctype = 'xml'
cspdir = 'csp'
datadir = 'data'
srcdir = 's... | 0 | 0 | 0 |
873b6fa77b54c4ccb7675ad94b0f18bdce632a07 | 14,796 | py | Python | src/mission_report/tests/test_parse_mission_log_line.py | Flyingfox646/flyingfox | fc936ca1c2631a5f9d842d0deae1e197d50e7a96 | [
"MIT"
] | null | null | null | src/mission_report/tests/test_parse_mission_log_line.py | Flyingfox646/flyingfox | fc936ca1c2631a5f9d842d0deae1e197d50e7a96 | [
"MIT"
] | null | null | null | src/mission_report/tests/test_parse_mission_log_line.py | Flyingfox646/flyingfox | fc936ca1c2631a5f9d842d0deae1e197d50e7a96 | [
"MIT"
] | null | null | null | from datetime import datetime
import pytest
from ..parse_mission_log_line import parse, UnexpectedATypeWarning
| 47.271565 | 121 | 0.625439 | from datetime import datetime
import pytest
from ..parse_mission_log_line import parse, UnexpectedATypeWarning
def test_atype_0():
line = ('T:0 AType:0 GDate:1942.9.19 GTime:14:0:0 MFile:Multiplayer/Dogfight\_gen.msnbin MID: GType:2 '
'CNTRS:0:0,101:1,201:2 SETTS:000000000010000100000000110 MODS:0 P... | 13,676 | 0 | 966 |
590e157b48856d7b3d22e9f52ba60229dfe09377 | 1,385 | py | Python | python/tools/games/scrabble.py | xanderyzwich/Playground | 3c8bbfc33383f7ac1c88c2093fbe096cc2c44c3a | [
"Apache-2.0"
] | 1 | 2021-08-19T13:40:26.000Z | 2021-08-19T13:40:26.000Z | python/tools/games/scrabble.py | xanderyzwich/Playground | 3c8bbfc33383f7ac1c88c2093fbe096cc2c44c3a | [
"Apache-2.0"
] | null | null | null | python/tools/games/scrabble.py | xanderyzwich/Playground | 3c8bbfc33383f7ac1c88c2093fbe096cc2c44c3a | [
"Apache-2.0"
] | 1 | 2021-03-31T12:37:14.000Z | 2021-03-31T12:37:14.000Z | """
Scrabble Hand
Given an array of scrabble tiles,
create a function that outputs the maximum possible score a player can achieve
by summing up the total number of points for all the tiles in their hand.
Each hand contains 7 scrabble tiles.
"""
from unittest import TestCase
tile, score = 'tile', ... | 27.156863 | 83 | 0.441155 | """
Scrabble Hand
Given an array of scrabble tiles,
create a function that outputs the maximum possible score a player can achieve
by summing up the total number of points for all the tiles in their hand.
Each hand contains 7 scrabble tiles.
"""
from unittest import TestCase
tile, score = 'tile', ... | 180 | 789 | 48 |
9f39718a43ee9c4e0b949020153755c7e5ac19e6 | 1,642 | py | Python | Accuracy_test/Evaluation.py | punch872/EyeWarnYou | 71ea21a8b3f1ae213478d735a10a240524b89702 | [
"MIT"
] | 1 | 2019-03-04T08:37:26.000Z | 2019-03-04T08:37:26.000Z | Accuracy_test/Evaluation.py | punch872/EyeWarnYou | 71ea21a8b3f1ae213478d735a10a240524b89702 | [
"MIT"
] | null | null | null | Accuracy_test/Evaluation.py | punch872/EyeWarnYou | 71ea21a8b3f1ae213478d735a10a240524b89702 | [
"MIT"
] | null | null | null | features_data = np.array(sentences)
# แบ่งข้อมูลเป็น 10 ชุด โดยไม่เรียง
k_fold = KFold(n_splits=10, random_state=1992, shuffle=True)
word_features = None
accuracy_scores = []
for train_set, test_set in k_fold.split(features_data):
word_features = get_word_features(get_words_in_sentences(features_data[train_set].tol... | 48.294118 | 96 | 0.621194 | features_data = np.array(sentences)
# แบ่งข้อมูลเป็น 10 ชุด โดยไม่เรียง
k_fold = KFold(n_splits=10, random_state=1992, shuffle=True)
word_features = None
accuracy_scores = []
for train_set, test_set in k_fold.split(features_data):
word_features = get_word_features(get_words_in_sentences(features_data[train_set].tol... | 0 | 0 | 0 |
220241ed486dc264ff2364e8bb6b8299482ab594 | 814 | py | Python | examples/create_report_with_author.py | imuledx/client-python | 4f4c407b86d6a6778892a09da38c1ba512e69bff | [
"Apache-2.0"
] | 42 | 2019-06-26T19:07:26.000Z | 2022-03-24T00:44:53.000Z | examples/create_report_with_author.py | imuledx/client-python | 4f4c407b86d6a6778892a09da38c1ba512e69bff | [
"Apache-2.0"
] | 178 | 2019-06-23T23:04:04.000Z | 2022-03-30T18:26:38.000Z | examples/create_report_with_author.py | imuledx/client-python | 4f4c407b86d6a6778892a09da38c1ba512e69bff | [
"Apache-2.0"
] | 55 | 2019-07-11T17:16:34.000Z | 2022-03-30T16:33:26.000Z | # coding: utf-8
from dateutil.parser import parse
from pycti import OpenCTIApiClient
# Variables
api_url = "https://demo.opencti.io"
api_token = "YOUR_TOKEN"
# OpenCTI initialization
opencti_api_client = OpenCTIApiClient(api_url, api_token)
# Define the date
date = parse("2019-12-01").strftime("%Y-%m-%dT%H:%M:%SZ"... | 22.611111 | 57 | 0.723587 | # coding: utf-8
from dateutil.parser import parse
from pycti import OpenCTIApiClient
# Variables
api_url = "https://demo.opencti.io"
api_token = "YOUR_TOKEN"
# OpenCTI initialization
opencti_api_client = OpenCTIApiClient(api_url, api_token)
# Define the date
date = parse("2019-12-01").strftime("%Y-%m-%dT%H:%M:%SZ"... | 0 | 0 | 0 |
5631494df59e8db24a1222c7ee79f6627fe535de | 262 | py | Python | src/m2/src/preprocess_flow.py | pvzteam/pvz_recsys2019 | 3fd14d3b82033474d2e172402abd0ebc5e7b0afc | [
"Apache-2.0"
] | 1 | 2019-07-24T08:41:53.000Z | 2019-07-24T08:41:53.000Z | src/m2/src/preprocess_flow.py | pvzteam/pvz_recsys2019 | 3fd14d3b82033474d2e172402abd0ebc5e7b0afc | [
"Apache-2.0"
] | null | null | null | src/m2/src/preprocess_flow.py | pvzteam/pvz_recsys2019 | 3fd14d3b82033474d2e172402abd0ebc5e7b0afc | [
"Apache-2.0"
] | 1 | 2020-12-02T09:49:12.000Z | 2020-12-02T09:49:12.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# 基础模块
import os
import sys
print ('filter_useless_data')
os.system('python filter_useless_data.py')
print ('gen_imprs')
os.system('python gen_imprs.py')
print ('gen_samples')
os.system('python gen_samples.py')
| 15.411765 | 42 | 0.71374 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# 基础模块
import os
import sys
print ('filter_useless_data')
os.system('python filter_useless_data.py')
print ('gen_imprs')
os.system('python gen_imprs.py')
print ('gen_samples')
os.system('python gen_samples.py')
| 0 | 0 | 0 |
7b6e3d762ff69c818d31742f3481de6375b7d6f9 | 1,317 | py | Python | tests/test_service.py | drankinn/wolverine | 22c3e59db70c96edb3f4c2ebaf8482eda10a3e2a | [
"MIT"
] | 4 | 2015-10-19T23:09:42.000Z | 2016-01-07T09:52:13.000Z | tests/test_service.py | drankinn/wolverine | 22c3e59db70c96edb3f4c2ebaf8482eda10a3e2a | [
"MIT"
] | 2 | 2015-10-21T20:46:12.000Z | 2021-03-22T17:15:17.000Z | tests/test_service.py | drankinn/wolverine | 22c3e59db70c96edb3f4c2ebaf8482eda10a3e2a | [
"MIT"
] | 3 | 2015-11-13T12:33:40.000Z | 2021-10-04T17:42:14.000Z | from wolverine.module.service import MicroService, ServiceMessage, ServiceDef
from wolverine.test import TestMicroApp
#class TestService(object):
# def test_micro_service(event_loop):
# app = TestMicroApp(loop=event_loop)
# options = {'op_1': 'test', 'op_2': True}
# service = MicroService(app... | 37.628571 | 77 | 0.572513 | from wolverine.module.service import MicroService, ServiceMessage, ServiceDef
from wolverine.test import TestMicroApp
#class TestService(object):
# def test_micro_service(event_loop):
# app = TestMicroApp(loop=event_loop)
# options = {'op_1': 'test', 'op_2': True}
# service = MicroService(app... | 0 | 0 | 0 |