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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
53288cd3f3fe6c0ca781d51cfff1e7589cfb1970 | 1,216 | py | Python | images/views.py | Ruweydha/Photo-Gallery | 1023cd665dfd60b82d3d1dea2e00aed704178b1e | [
"Unlicense"
] | null | null | null | images/views.py | Ruweydha/Photo-Gallery | 1023cd665dfd60b82d3d1dea2e00aed704178b1e | [
"Unlicense"
] | null | null | null | images/views.py | Ruweydha/Photo-Gallery | 1023cd665dfd60b82d3d1dea2e00aed704178b1e | [
"Unlicense"
] | null | null | null | from email.mime import image
from django.shortcuts import render
from django.http import HttpResponse
from .models import Images, Location
from images.models import Images
# Create your views here.
| 34.742857 | 127 | 0.727796 | from email.mime import image
from django.shortcuts import render
from django.http import HttpResponse
from .models import Images, Location
from images.models import Images
# Create your views here.
def home(request):
images = Images.objects.all()
location_list = Location.objects.all()
return render(reques... | 946 | 0 | 68 |
d34ddc8bf449753ebc04382f94c2f617a14eda65 | 747 | py | Python | Scripts/featureextraction.py | avinashsai/Cross-domain-sentiment-analysis | 44ab1ef74f0bfdbc81fcac0aa9a296b4197b9578 | [
"MIT"
] | 4 | 2018-03-23T05:09:37.000Z | 2020-05-08T03:04:46.000Z | Scripts/featureextraction.py | avinashsai/Cross-domain-sentiment-analysis | 44ab1ef74f0bfdbc81fcac0aa9a296b4197b9578 | [
"MIT"
] | null | null | null | Scripts/featureextraction.py | avinashsai/Cross-domain-sentiment-analysis | 44ab1ef74f0bfdbc81fcac0aa9a296b4197b9578 | [
"MIT"
] | 7 | 2018-04-19T13:46:49.000Z | 2021-09-07T14:16:14.000Z | import os
import re
import sklearn
import pandas as pd
import numpy as np
from sklearn.feature_extraction.text import TfidfVectorizer
vector_parameters = [[2,0.8],[3,0.8],[3,0.8],[3,0.8],[3,0.8],[3,0.8],[3,0.8],[3,0.8],[3,0.8],
[3,0.8],[3,0.8],[3,0.8]]
| 25.758621 | 108 | 0.756359 | import os
import re
import sklearn
import pandas as pd
import numpy as np
from sklearn.feature_extraction.text import TfidfVectorizer
vector_parameters = [[2,0.8],[3,0.8],[3,0.8],[3,0.8],[3,0.8],[3,0.8],[3,0.8],[3,0.8],[3,0.8],
[3,0.8],[3,0.8],[3,0.8]]
def featureextraction(train_corpus,test_corpus,label_train,tra... | 465 | 0 | 23 |
bd3169b772ecbfacb4278241d9c69a39bfe57166 | 474 | py | Python | tests/test_utilities_efficiency.py | chrisgilmerproj/brewing | fd8251e5bf34c20342034187fb30d9fffc723aa8 | [
"MIT"
] | 21 | 2016-08-16T17:34:17.000Z | 2021-05-09T13:44:48.000Z | tests/test_utilities_efficiency.py | chrisgilmerproj/brewing | fd8251e5bf34c20342034187fb30d9fffc723aa8 | [
"MIT"
] | 16 | 2016-11-16T17:07:12.000Z | 2020-12-16T18:11:49.000Z | tests/test_utilities_efficiency.py | chrisgilmerproj/brewing | fd8251e5bf34c20342034187fb30d9fffc723aa8 | [
"MIT"
] | 4 | 2016-08-16T16:40:49.000Z | 2019-10-31T01:53:00.000Z | # -*- coding: utf-8 -*-
import unittest
from brew.utilities.efficiency import calculate_brew_house_yield
from fixtures import recipe
| 27.882353 | 70 | 0.725738 | # -*- coding: utf-8 -*-
import unittest
from brew.utilities.efficiency import calculate_brew_house_yield
from fixtures import recipe
class TestEfficiencyUtilities(unittest.TestCase):
def setUp(self):
self.recipe = recipe
def test_calculate_brew_house_yield(self):
out = calculate_brew_house_y... | 235 | 28 | 76 |
817eb0fc42b1cccf5898caa6a744d5dcd6596f7f | 2,522 | py | Python | uni/bot/models.py | dennyown/uni_bot | e6e17b1c44efb30f24baf0f87823d6ce8a358d62 | [
"MIT"
] | null | null | null | uni/bot/models.py | dennyown/uni_bot | e6e17b1c44efb30f24baf0f87823d6ce8a358d62 | [
"MIT"
] | null | null | null | uni/bot/models.py | dennyown/uni_bot | e6e17b1c44efb30f24baf0f87823d6ce8a358d62 | [
"MIT"
] | null | null | null | from django.db import models
| 32.333333 | 106 | 0.598731 | from django.db import models
class UserUniModel(models.Model):
telegram_id_str = 'telegram_id'
user_types_str = 'user_types'
STUDENT = 'student'
TEACHER = 'teacher'
MANAGEMENT = 'manager'
ADMIN = 'admin'
CHOICE_USER_TYPES = (
(STUDENT, 'Студент'),
(TEACHER, 'В... | 508 | 1,994 | 24 |
501876e8ce05680da784a367ff27a4328f9a5709 | 3,863 | py | Python | 2021/code/4.py | Thijsvanede/Advent-of-Code | c2e040f610ec397e4b0f5e4f2e0704d40b94494f | [
"MIT"
] | null | null | null | 2021/code/4.py | Thijsvanede/Advent-of-Code | c2e040f610ec397e4b0f5e4f2e0704d40b94494f | [
"MIT"
] | null | null | null | 2021/code/4.py | Thijsvanede/Advent-of-Code | c2e040f610ec397e4b0f5e4f2e0704d40b94494f | [
"MIT"
] | null | null | null | import numpy as np
from challenge import Challenge
########################################################################
# Load data #
########################################################################
################################... | 34.491071 | 79 | 0.44758 | import numpy as np
from challenge import Challenge
class ChallengeSolution(Challenge):
########################################################################
# Load data #
########################################################################
... | 3,229 | 14 | 104 |
35a2ecea4f98c8fb88015b032be7e24e5c9849ac | 767 | py | Python | recursion_tree/settings.py | IgorZyktin/recursion_tree | 022d2381361689a12da2b2833dd4b00fda88b109 | [
"MIT"
] | 3 | 2019-01-11T18:16:03.000Z | 2020-02-14T01:45:27.000Z | recursion_tree/settings.py | IgorZyktin/recursion_tree | 022d2381361689a12da2b2833dd4b00fda88b109 | [
"MIT"
] | null | null | null | recursion_tree/settings.py | IgorZyktin/recursion_tree | 022d2381361689a12da2b2833dd4b00fda88b109 | [
"MIT"
] | 1 | 2019-05-26T18:25:31.000Z | 2019-05-26T18:25:31.000Z | """
Settings module
"""
settings = {
'file': None,
'autostart': True,
'min_node_width': 50,
'min_node_height': 50,
'char_width': 9,
'char_height': 10,
'ver_spacing': 200,
'margin': 20,
'draw_calls': True,
'draw_boundary': False,
'color_background': 'gray',
'color_nu... | 22.558824 | 38 | 0.602347 | """
Settings module
"""
settings = {
'file': None,
'autostart': True,
'min_node_width': 50,
'min_node_height': 50,
'char_width': 9,
'char_height': 10,
'ver_spacing': 200,
'margin': 20,
'draw_calls': True,
'draw_boundary': False,
'color_background': 'gray',
'color_nu... | 0 | 0 | 0 |
e0217e724727753105495e746bd9da882260864b | 426 | py | Python | euler 28.py | janajolovic/euler_project- | 8ed82f9ac82a17f7ba731a38d412a7c12b56c78b | [
"MIT"
] | null | null | null | euler 28.py | janajolovic/euler_project- | 8ed82f9ac82a17f7ba731a38d412a7c12b56c78b | [
"MIT"
] | null | null | null | euler 28.py | janajolovic/euler_project- | 8ed82f9ac82a17f7ba731a38d412a7c12b56c78b | [
"MIT"
] | null | null | null | #num is also the first terms of spiral
num = 1
x = 2
final_sum = 0
for i in range(500):
#for each for number in one circle (four numbers on diagonals), the numbers increases by the same numbers (x)
#in first circle it is 3,5,7,9, increases by 2
#in second it is 13,17,21,25, increases by 4...
for i in ra... | 30.428571 | 113 | 0.643192 | #num is also the first terms of spiral
num = 1
x = 2
final_sum = 0
for i in range(500):
#for each for number in one circle (four numbers on diagonals), the numbers increases by the same numbers (x)
#in first circle it is 3,5,7,9, increases by 2
#in second it is 13,17,21,25, increases by 4...
for i in ra... | 0 | 0 | 0 |
f15bfea2a16b096e1caa575e2d06ec2e6f4f4c4a | 4,976 | py | Python | collagen/modelzoo/segmentation/decoders/_fpn.py | MIPT-Oulu/Collagen | 0cbc4285d60e5c9fcc89f629fcf4321e80b7452c | [
"MIT"
] | 4 | 2019-05-14T14:44:51.000Z | 2020-03-13T08:37:48.000Z | collagen/modelzoo/segmentation/decoders/_fpn.py | MIPT-Oulu/Collagen | 0cbc4285d60e5c9fcc89f629fcf4321e80b7452c | [
"MIT"
] | 26 | 2019-04-21T20:35:22.000Z | 2022-03-12T00:32:57.000Z | collagen/modelzoo/segmentation/decoders/_fpn.py | MIPT-Oulu/Collagen | 0cbc4285d60e5c9fcc89f629fcf4321e80b7452c | [
"MIT"
] | 1 | 2019-05-14T14:53:28.000Z | 2019-05-14T14:53:28.000Z | import torch
import torch.nn.functional as F
from torch import nn
from collagen.core import Module
from collagen.modelzoo.modules import ConvBlock
class FPNBlock(Module):
"""
Extended implementation from https://github.com/qubvel/segmentation_models.pytorch
"""
class SegmentationBlock(Module):
"""... | 32.522876 | 100 | 0.60631 | import torch
import torch.nn.functional as F
from torch import nn
from collagen.core import Module
from collagen.modelzoo.modules import ConvBlock
class FPNBlock(Module):
"""
Extended implementation from https://github.com/qubvel/segmentation_models.pytorch
"""
def __init__(self, pyramid_channels, ... | 4,103 | 0 | 324 |
23c6906dc262e1bedff61096ac6336aad872615f | 2,800 | py | Python | src/inscriptis/model/canvas/block.py | rlskoeser/inscriptis | e23f79a4ad561f53943c3c6dd70a7d4981b0e0fb | [
"Apache-2.0"
] | 90 | 2016-01-29T15:09:21.000Z | 2022-03-08T15:08:57.000Z | src/inscriptis/model/canvas/block.py | rlskoeser/inscriptis | e23f79a4ad561f53943c3c6dd70a7d4981b0e0fb | [
"Apache-2.0"
] | 27 | 2016-01-14T10:30:10.000Z | 2022-03-24T08:00:31.000Z | src/inscriptis/model/canvas/block.py | rlskoeser/inscriptis | e23f79a4ad561f53943c3c6dd70a7d4981b0e0fb | [
"Apache-2.0"
] | 20 | 2016-01-14T12:50:55.000Z | 2022-03-04T07:26:30.000Z | """Representation of a text block within the HTML canvas."""
from html import unescape
from inscriptis.html_properties import WhiteSpace
class Block:
"""The current block of text.
A block usually refers to one line of output text.
.. note::
If pre-formatted content is merged with a block, it may... | 30.107527 | 76 | 0.577857 | """Representation of a text block within the HTML canvas."""
from html import unescape
from inscriptis.html_properties import WhiteSpace
class Block:
"""The current block of text.
A block usually refers to one line of output text.
.. note::
If pre-formatted content is merged with a block, it may... | 404 | 0 | 80 |
7366d41aef73200e69a6c6a8ad84308ec7c41171 | 855 | py | Python | tests/test_correction.py | phrenico/cmfsapy | 9eb0b335a3e1f2c4a02fd7edf7b22b78d4ea9931 | [
"MIT"
] | null | null | null | tests/test_correction.py | phrenico/cmfsapy | 9eb0b335a3e1f2c4a02fd7edf7b22b78d4ea9931 | [
"MIT"
] | null | null | null | tests/test_correction.py | phrenico/cmfsapy | 9eb0b335a3e1f2c4a02fd7edf7b22b78d4ea9931 | [
"MIT"
] | null | null | null | from unittest import TestCase
from cmfsapy.dimension.correction import correct_estimates, polynom_func, \
compute_mFSA_correction_coef, correct_mFSA
import numpy as np
| 29.482759 | 75 | 0.626901 | from unittest import TestCase
from cmfsapy.dimension.correction import correct_estimates, polynom_func, \
compute_mFSA_correction_coef, correct_mFSA
import numpy as np
class Test(TestCase):
def test_correct_estimates(self):
d = np.random.rand(100)
alpha = [0.1, 0.2, 0.3]
powers = [1, 2... | 551 | 0 | 130 |
80e0004ed68b1652ad16eb9b10e624bafeb15546 | 5,084 | py | Python | tests/data_reviews/test_data_reviews_queries.py | kids-first/kf-api-study-creator | 93a79b108b6474f9b4135ace06c89ddcf63dd257 | [
"Apache-2.0"
] | 3 | 2019-05-04T02:07:28.000Z | 2020-10-16T17:47:44.000Z | tests/data_reviews/test_data_reviews_queries.py | kids-first/kf-api-study-creator | 93a79b108b6474f9b4135ace06c89ddcf63dd257 | [
"Apache-2.0"
] | 604 | 2019-02-21T18:14:51.000Z | 2022-02-10T08:13:54.000Z | tests/data_reviews/test_data_reviews_queries.py | kids-first/kf-api-study-creator | 93a79b108b6474f9b4135ace06c89ddcf63dd257 | [
"Apache-2.0"
] | null | null | null | import pytest
from graphql_relay import to_global_id
from django.contrib.auth import get_user_model
from creator.studies.models import Membership
from creator.data_reviews.factories import DataReviewFactory
from creator.ingest_runs.factories import ValidationResultsetFactory
from creator.studies.models import Study
Us... | 26.617801 | 90 | 0.56845 | import pytest
from graphql_relay import to_global_id
from django.contrib.auth import get_user_model
from creator.studies.models import Membership
from creator.data_reviews.factories import DataReviewFactory
from creator.ingest_runs.factories import ValidationResultsetFactory
from creator.studies.models import Study
Us... | 2,746 | 0 | 66 |
aaafbfbd244d63f08d04a40c0fe3403a417b9be4 | 1,281 | py | Python | rl/PolicyNetwork.py | johntiger1/vaal_querying | c20da3b0b5ca9f25334523f831d0ba8a11f710ca | [
"BSD-2-Clause"
] | 1 | 2019-12-04T22:37:38.000Z | 2019-12-04T22:37:38.000Z | rl/PolicyNetwork.py | johntiger1/vaal_querying | c20da3b0b5ca9f25334523f831d0ba8a11f710ca | [
"BSD-2-Clause"
] | null | null | null | rl/PolicyNetwork.py | johntiger1/vaal_querying | c20da3b0b5ca9f25334523f831d0ba8a11f710ca | [
"BSD-2-Clause"
] | null | null | null |
import torch
import torch.nn as nn
import torch.nn.functional as F
'''
Direct Policy Gradient network.
Takes in STATE_DIM size vector, and outputs ACTIONS_DIM size vector.
Action select (sampling), and reward backprop is done in another function.
Make sure to subtract a baseline!
'''
#
# '''
# This Policy net... | 29.790698 | 109 | 0.68306 |
import torch
import torch.nn as nn
import torch.nn.functional as F
'''
Direct Policy Gradient network.
Takes in STATE_DIM size vector, and outputs ACTIONS_DIM size vector.
Action select (sampling), and reward backprop is done in another function.
Make sure to subtract a baseline!
'''
class PolicyNet(nn.Module)... | 352 | 6 | 76 |
df3f54b00aab8f0617251d68b88095e11661dd08 | 2,672 | py | Python | api/src/rate_limit/rate_limit.py | sjohnson31/ttbud | 456de60c7765f33630a8fd4bd18c4f6e75e1bf67 | [
"MIT"
] | null | null | null | api/src/rate_limit/rate_limit.py | sjohnson31/ttbud | 456de60c7765f33630a8fd4bd18c4f6e75e1bf67 | [
"MIT"
] | 152 | 2019-10-24T22:22:42.000Z | 2020-05-03T04:18:38.000Z | api/src/rate_limit/rate_limit.py | sjohnson31/ttbud | 456de60c7765f33630a8fd4bd18c4f6e75e1bf67 | [
"MIT"
] | 1 | 2020-04-28T23:24:52.000Z | 2020-04-28T23:24:52.000Z | from __future__ import annotations
from typing import Protocol, AsyncContextManager, Iterator
MAX_ROOMS_PER_TEN_MINUTES = 50
MAX_CONNECTIONS_PER_USER = 10
MAX_CONNECTIONS_PER_ROOM = 20
SERVER_LIVENESS_EXPIRATION_SECONDS = 60 * 10
| 32.987654 | 83 | 0.676272 | from __future__ import annotations
from typing import Protocol, AsyncContextManager, Iterator
MAX_ROOMS_PER_TEN_MINUTES = 50
MAX_CONNECTIONS_PER_USER = 10
MAX_CONNECTIONS_PER_ROOM = 20
SERVER_LIVENESS_EXPIRATION_SECONDS = 60 * 10
class RoomFullException(Exception):
pass
class TooManyConnectionsException(Excep... | 0 | 2,344 | 92 |
bc8caf871ea748fe7bbbec33022ed18ae8769dc2 | 646 | py | Python | Pyo_module/documentation_practice/filters/lowpass.py | sebcampos/music | b508654f9524127bd2681628a9ec4b88dc607c8d | [
"MIT"
] | null | null | null | Pyo_module/documentation_practice/filters/lowpass.py | sebcampos/music | b508654f9524127bd2681628a9ec4b88dc607c8d | [
"MIT"
] | null | null | null | Pyo_module/documentation_practice/filters/lowpass.py | sebcampos/music | b508654f9524127bd2681628a9ec4b88dc607c8d | [
"MIT"
] | null | null | null | #!/usr/local/Caskroom/miniconda/base/envs/music_venv/bin/pythonw
from pyo import *
s = Server().boot()
# white noise generator
n = Noise(0.5)
# Common cutoff frequency control
freq = Sig(1000)
freq.ctrl([SLMap(50, 5000, "lin", "value", 1000)], title = "Cutoff Frequency")
# Three different lowpass filters
tone = ... | 22.275862 | 78 | 0.712074 | #!/usr/local/Caskroom/miniconda/base/envs/music_venv/bin/pythonw
from pyo import *
s = Server().boot()
# white noise generator
n = Noise(0.5)
# Common cutoff frequency control
freq = Sig(1000)
freq.ctrl([SLMap(50, 5000, "lin", "value", 1000)], title = "Cutoff Frequency")
# Three different lowpass filters
tone = ... | 0 | 0 | 0 |
12d78236984c5665e4a055657333b8e5ac52d714 | 148 | py | Python | faq/urls.py | ryansujana15/tugas-tengah-semester-pbp | c61c3f7ed6c31f60bfe251c41de06e44052b2ba2 | [
"MIT"
] | null | null | null | faq/urls.py | ryansujana15/tugas-tengah-semester-pbp | c61c3f7ed6c31f60bfe251c41de06e44052b2ba2 | [
"MIT"
] | null | null | null | faq/urls.py | ryansujana15/tugas-tengah-semester-pbp | c61c3f7ed6c31f60bfe251c41de06e44052b2ba2 | [
"MIT"
] | null | null | null | from django.urls import path
from .views import index, qs
urlpatterns = [
path('', index, name='index_faq'),
path('qs', qs, name='qs'),
]
| 16.444444 | 38 | 0.628378 | from django.urls import path
from .views import index, qs
urlpatterns = [
path('', index, name='index_faq'),
path('qs', qs, name='qs'),
]
| 0 | 0 | 0 |
4f8a1886ba1b54feedbc619641baa6ae589fd186 | 3,011 | py | Python | src/game.py | briannice/sudoku | 6537f969a7995dfaf3c54c2bf0a672df90d355df | [
"MIT"
] | 1 | 2020-07-31T16:00:14.000Z | 2020-07-31T16:00:14.000Z | src/game.py | briannice/sudoku | 6537f969a7995dfaf3c54c2bf0a672df90d355df | [
"MIT"
] | null | null | null | src/game.py | briannice/sudoku | 6537f969a7995dfaf3c54c2bf0a672df90d355df | [
"MIT"
] | null | null | null | import pygame
from board import Board | 41.819444 | 85 | 0.481568 | import pygame
from board import Board
class Sudoku():
def __init__(self):
self.board = Board(10, 10, 9)
self.run = True
def play(self):
pygame.init()
win = pygame.display.set_mode((self.board.width + 20, self.board.width + 20))
clock = pygame.time.Clock()
py... | 2,902 | -6 | 77 |
ea75d5f94d9b7d2c764c9afc0a1431c3bf565cca | 1,098 | py | Python | contrib/vecs_io.py | ScriptBox99/facebook-faiss | 04d31fac53c609b6487a4cd6ead1c8b4ad926b0c | [
"MIT"
] | 17,006 | 2017-03-01T02:54:26.000Z | 2022-03-31T19:08:11.000Z | contrib/vecs_io.py | ScriptBox99/facebook-faiss | 04d31fac53c609b6487a4cd6ead1c8b4ad926b0c | [
"MIT"
] | 2,154 | 2017-03-01T10:30:34.000Z | 2022-03-31T11:35:40.000Z | contrib/vecs_io.py | ScriptBox99/facebook-faiss | 04d31fac53c609b6487a4cd6ead1c8b4ad926b0c | [
"MIT"
] | 2,790 | 2017-03-01T14:09:44.000Z | 2022-03-31T06:49:39.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import numpy as np
"""
I/O functions in fvecs, bvecs, ivecs formats
definition of the formats here: http://corpus-texmex.irisa.fr/
"""
... | 21.529412 | 65 | 0.619308 | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import numpy as np
"""
I/O functions in fvecs, bvecs, ivecs formats
definition of the formats here: http://corpus-texmex.irisa.fr/
"""
def ... | 616 | 0 | 161 |
f34aed4456c68e512e0c1edea52e8d88410aca9a | 71 | py | Python | rot13/__init__.py | pordino/FalcomBot-cogs | 869371b5e9a9395d84dfa186ddbb0b1f56771975 | [
"MIT"
] | 9 | 2018-10-12T07:04:29.000Z | 2021-06-12T03:20:01.000Z | rot13/__init__.py | pordino/FalcomBot-cogs | 869371b5e9a9395d84dfa186ddbb0b1f56771975 | [
"MIT"
] | 4 | 2018-10-22T19:43:20.000Z | 2021-07-21T09:15:43.000Z | rot13/__init__.py | pordino/FalcomBot-cogs | 869371b5e9a9395d84dfa186ddbb0b1f56771975 | [
"MIT"
] | 9 | 2018-11-20T14:04:11.000Z | 2021-09-20T13:21:35.000Z | from .rot13 import Rot13
| 11.833333 | 27 | 0.690141 | from .rot13 import Rot13
def setup(bot):
bot.add_cog(Rot13(bot))
| 22 | 0 | 23 |
420d2a0bc5060f2fc0cac50b4f35cd76f8ea034c | 415 | py | Python | numpy/8view_copy.py | vikaskushwah312/DS | cf8382d9ac5e24acd29ffe5da084e118e9fa4869 | [
"bzip2-1.0.6"
] | null | null | null | numpy/8view_copy.py | vikaskushwah312/DS | cf8382d9ac5e24acd29ffe5da084e118e9fa4869 | [
"bzip2-1.0.6"
] | null | null | null | numpy/8view_copy.py | vikaskushwah312/DS | cf8382d9ac5e24acd29ffe5da084e118e9fa4869 | [
"bzip2-1.0.6"
] | null | null | null | import numpy as np
'''view Example :- Board casting hoti h es me'''
arr = np.array([5,10,15])
arr_slice= arr[0:2]
# print(arr_slice) #[5,10]
arr_slice[:]= 0
# print(arr_slice) #[0,0]
# print(arr) #[0,0,15]
'''Copy Example :- Board casting hoti h es me'''
arr_copy = np.array([5,10,15])
arr_slice2= arr_copy[0:2].... | 14.310345 | 48 | 0.640964 | import numpy as np
'''view Example :- Board casting hoti h es me'''
arr = np.array([5,10,15])
arr_slice= arr[0:2]
# print(arr_slice) #[5,10]
arr_slice[:]= 0
# print(arr_slice) #[0,0]
# print(arr) #[0,0,15]
'''Copy Example :- Board casting hoti h es me'''
arr_copy = np.array([5,10,15])
arr_slice2= arr_copy[0:2].... | 0 | 0 | 0 |
5761b6a11ad60027a18e18fa121096e72cfb84bc | 427 | py | Python | metamapper/conf/gunicorn.py | getmetamapper/metamapper | 0b2f67eec03fbf7ece35ff9f58ea9bb2dde4d85f | [
"BSD-2-Clause"
] | 53 | 2020-07-01T23:11:59.000Z | 2022-03-31T19:10:28.000Z | metamapper/conf/gunicorn.py | metamapper-io/metamapper | 376716e72bcaca62f1ec09ca9a13a0346e5502f9 | [
"BSD-2-Clause"
] | 5 | 2020-11-25T19:48:57.000Z | 2022-02-27T23:50:18.000Z | metamapper/conf/gunicorn.py | metamapper-io/metamapper | 376716e72bcaca62f1ec09ca9a13a0346e5502f9 | [
"BSD-2-Clause"
] | 5 | 2020-08-29T16:43:59.000Z | 2022-01-17T19:05:30.000Z | #
# Gunicorn (https://docs.gunicorn.org/en/stable/configure.html)
#
# Metamapper uses Gunicorn to handle web requests by default. We recommend
# spinning up a few of these and putting them behind a reverse proxy like nginx.
#
# You can override these default settings by creating your own file and referencing the
# path... | 35.583333 | 87 | 0.777518 | #
# Gunicorn (https://docs.gunicorn.org/en/stable/configure.html)
#
# Metamapper uses Gunicorn to handle web requests by default. We recommend
# spinning up a few of these and putting them behind a reverse proxy like nginx.
#
# You can override these default settings by creating your own file and referencing the
# path... | 0 | 0 | 0 |
6c0667e924b11406522ed8a61a42f58da1d716b2 | 675 | py | Python | tests/import/import11.py | ktok07b6/polyphony | 657c5c7440520db6b4985970bd50547407693ac4 | [
"MIT"
] | 83 | 2015-11-30T09:59:13.000Z | 2021-08-03T09:12:28.000Z | tests/import/import11.py | jesseclin/polyphony | 657c5c7440520db6b4985970bd50547407693ac4 | [
"MIT"
] | 4 | 2017-02-10T01:43:11.000Z | 2020-07-14T03:52:25.000Z | tests/import/import11.py | jesseclin/polyphony | 657c5c7440520db6b4985970bd50547407693ac4 | [
"MIT"
] | 11 | 2016-11-18T14:39:15.000Z | 2021-02-23T10:05:20.000Z | import polyphony
import sub1
from sub3 import SUB3_GLOBAL_ARRAY, SUB3_GLOBAL_TUPLE
@polyphony.testbench
test()
| 17.307692 | 53 | 0.69037 | import polyphony
import sub1
from sub3 import SUB3_GLOBAL_ARRAY, SUB3_GLOBAL_TUPLE
def import11_a(i):
return sub1.SUB1_GLOBAL_ARRAY[i]
def import11_b(i):
return sub1.SUB1_GLOBAL_TUPLE[i]
def import11_c(i):
return SUB3_GLOBAL_ARRAY[i]
def import11_d(i):
return SUB3_GLOBAL_TUPLE[i]
def import11_e... | 419 | 0 | 137 |
08ae8ea695d2ebee6958e8066c472b62a744059f | 2,590 | py | Python | dz4/tests/test_jsonplaceholder.py | sergey-sy/otus_automation_homework | e283433e9beeea7ab2d8f34b6214e90c2f4d8776 | [
"MIT"
] | null | null | null | dz4/tests/test_jsonplaceholder.py | sergey-sy/otus_automation_homework | e283433e9beeea7ab2d8f34b6214e90c2f4d8776 | [
"MIT"
] | null | null | null | dz4/tests/test_jsonplaceholder.py | sergey-sy/otus_automation_homework | e283433e9beeea7ab2d8f34b6214e90c2f4d8776 | [
"MIT"
] | null | null | null | import pytest
import requests
import json
import os
from jsonschema import validate
API_LINK = 'https://jsonplaceholder.typicode.com/posts'
TMP_FILE = 'test_jsonplaceholder.json'
@pytest.yield_fixture(scope='session', autouse=True)
def make_tmp_file():
"""Create temporary file and delete in the end of the test ... | 28.777778 | 107 | 0.607336 | import pytest
import requests
import json
import os
from jsonschema import validate
API_LINK = 'https://jsonplaceholder.typicode.com/posts'
TMP_FILE = 'test_jsonplaceholder.json'
@pytest.yield_fixture(scope='session', autouse=True)
def make_tmp_file():
"""Create temporary file and delete in the end of the test ... | 0 | 920 | 22 |
cb1d900bfbbf37ec61e677dde0333b576f0746b3 | 5,613 | py | Python | geotagx/view/blog.py | othieno/plugin-geotagx | a8b6ea0c8bb8a2c8fe1b333431b3ddd1e717ce36 | [
"MIT"
] | null | null | null | geotagx/view/blog.py | othieno/plugin-geotagx | a8b6ea0c8bb8a2c8fe1b333431b3ddd1e717ce36 | [
"MIT"
] | 5 | 2016-07-31T15:52:54.000Z | 2016-11-10T04:06:22.000Z | geotagx/view/blog.py | othieno/plugin-geotagx | a8b6ea0c8bb8a2c8fe1b333431b3ddd1e717ce36 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# This module is part of the GeoTag-X PyBossa plugin.
#
# Author: Jeremy Othieno (j.othieno@gmail.com)
#
# Copyright (c) 2016 UNITAR/UNOSAT
#
# The MIT License (MIT)
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation f... | 34.018182 | 128 | 0.664529 | # -*- coding: utf-8 -*-
#
# This module is part of the GeoTag-X PyBossa plugin.
#
# Author: Jeremy Othieno (j.othieno@gmail.com)
#
# Copyright (c) 2016 UNITAR/UNOSAT
#
# The MIT License (MIT)
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation f... | 0 | 0 | 0 |
fb45d049f50bebedf5b8348f862b13e281846a62 | 17,515 | py | Python | appv1/awsdetails.py | CBitLabs/atlas | d205924dc3938ef49f156148ac1dda20220f7575 | [
"MIT"
] | null | null | null | appv1/awsdetails.py | CBitLabs/atlas | d205924dc3938ef49f156148ac1dda20220f7575 | [
"MIT"
] | null | null | null | appv1/awsdetails.py | CBitLabs/atlas | d205924dc3938ef49f156148ac1dda20220f7575 | [
"MIT"
] | null | null | null | import boto, boto.ec2
import re, datetime
from dateutil import parser
from dateutil import tz
import collections
from collections import OrderedDict
import ast
from operator import add
from atlas_helper_methods import AtlasHelper
from aws_helper import AwsHelper
| 62.109929 | 152 | 0.588752 | import boto, boto.ec2
import re, datetime
from dateutil import parser
from dateutil import tz
import collections
from collections import OrderedDict
import ast
from operator import add
from atlas_helper_methods import AtlasHelper
from aws_helper import AwsHelper
class AwsInstanceHelper:
#class to fetch data from aws f... | 10,833 | 6,395 | 23 |
4f71f62ff5be4c448e42605a9846a850fd9c58e7 | 28,275 | py | Python | scripts/addons/RetopoFlow/addon_common/common/useractions.py | Tilapiatsu/blender-custom_conf | 05592fedf74e4b7075a6228b8448a5cda10f7753 | [
"MIT"
] | 1,600 | 2015-03-19T12:26:15.000Z | 2022-03-30T21:07:37.000Z | addon_common/common/useractions.py | Varelshen/retopoflow | 5e9fd7ff65e7a5a64bf3078c78fb71cc270fdb71 | [
"OML"
] | 1,026 | 2015-03-18T22:17:42.000Z | 2022-03-28T17:47:04.000Z | addon_common/common/useractions.py | Varelshen/retopoflow | 5e9fd7ff65e7a5a64bf3078c78fb71cc270fdb71 | [
"OML"
] | 241 | 2015-03-19T13:44:36.000Z | 2022-03-30T21:07:39.000Z | '''
Copyright (C) 2021 CG Cookie
http://cgcookie.com
hello@cgcookie.com
Created by Jonathan Denning, Jonathan Williamson
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 ... | 42.327844 | 244 | 0.594271 | '''
Copyright (C) 2021 CG Cookie
http://cgcookie.com
hello@cgcookie.com
Created by Jonathan Denning, Jonathan Williamson
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 ... | 19,214 | 4,899 | 293 |
98c281f4477afafc99134cbb0f13513959bd60c0 | 4,327 | py | Python | openmdao/components/interp_util/interp_lagrange2.py | Subraiz/OpenMDAO | ba247746e76fc3a46b768d0f09955ef58ee71ae4 | [
"Apache-2.0"
] | null | null | null | openmdao/components/interp_util/interp_lagrange2.py | Subraiz/OpenMDAO | ba247746e76fc3a46b768d0f09955ef58ee71ae4 | [
"Apache-2.0"
] | 1 | 2015-08-12T17:58:18.000Z | 2015-08-12T17:58:18.000Z | openmdao/components/interp_util/interp_lagrange2.py | Subraiz/OpenMDAO | ba247746e76fc3a46b768d0f09955ef58ee71ae4 | [
"Apache-2.0"
] | 1 | 2021-01-17T14:03:48.000Z | 2021-01-17T14:03:48.000Z | """
Interpolate using a second order Lagrange polynomial.
Based on NPSS implementation.
"""
import numpy as np
from openmdao.components.interp_util.interp_algorithm import InterpAlgorithm
class InterpLagrange2(InterpAlgorithm):
"""
Interpolate using a second order Lagrange polynomial.
"""
def __ini... | 33.284615 | 98 | 0.536862 | """
Interpolate using a second order Lagrange polynomial.
Based on NPSS implementation.
"""
import numpy as np
from openmdao.components.interp_util.interp_algorithm import InterpAlgorithm
class InterpLagrange2(InterpAlgorithm):
"""
Interpolate using a second order Lagrange polynomial.
"""
def __ini... | 0 | 0 | 0 |
71de7cc1f6e8248a81b96ae7117976e8f263c5dd | 6,248 | py | Python | src/kivy_garden/zbarcam/zbarcam.py | richierh/zbarcam | fb989ec236da2d1e19d3272e6eecee5fb6125974 | [
"MIT"
] | 71 | 2019-09-09T02:32:14.000Z | 2022-03-17T09:22:58.000Z | src/kivy_garden/zbarcam/zbarcam.py | richierh/zbarcam | fb989ec236da2d1e19d3272e6eecee5fb6125974 | [
"MIT"
] | 58 | 2019-08-30T20:42:48.000Z | 2022-03-12T00:00:41.000Z | src/kivy_garden/zbarcam/zbarcam.py | richierh/zbarcam | fb989ec236da2d1e19d3272e6eecee5fb6125974 | [
"MIT"
] | 26 | 2019-09-30T10:51:47.000Z | 2022-03-12T19:40:03.000Z | import os
from collections import namedtuple
import PIL
from kivy.clock import Clock
from kivy.lang import Builder
from kivy.logger import Logger
from kivy.properties import ListProperty
from kivy.uix.anchorlayout import AnchorLayout
from .utils import fix_android_image
MODULE_DIRECTORY = os.path.dirname(os.path.rea... | 30.930693 | 77 | 0.630922 | import os
from collections import namedtuple
import PIL
from kivy.clock import Clock
from kivy.lang import Builder
from kivy.logger import Logger
from kivy.properties import ListProperty
from kivy.uix.anchorlayout import AnchorLayout
from .utils import fix_android_image
MODULE_DIRECTORY = os.path.dirname(os.path.rea... | 3,658 | 288 | 337 |
ca310529e9bbd0fb2b00721107a8ef2a53280835 | 671 | py | Python | src/common/database_tools.py | tangg555/acl-anthology-helper | 38a28d26ab6ca079645cc6956917938442677d6b | [
"MIT"
] | 1 | 2021-08-23T15:37:27.000Z | 2021-08-23T15:37:27.000Z | src/common/database_tools.py | tangg555/acl-anthology-helper | 38a28d26ab6ca079645cc6956917938442677d6b | [
"MIT"
] | null | null | null | src/common/database_tools.py | tangg555/acl-anthology-helper | 38a28d26ab6ca079645cc6956917938442677d6b | [
"MIT"
] | null | null | null | from src.modules.papers import Paper, PaperList
| 29.173913 | 53 | 0.576751 | from src.modules.papers import Paper, PaperList
class MySQLTools(object):
@classmethod
def dict_to_paper(cls, result: dict):
paper = Paper(
title=result['title'],
year=result['year'],
url=result['url'],
authors=result['authors'].split(', '),
a... | 509 | 91 | 23 |
42719be315b0012f075051bae2b76e3dbfb22822 | 1,450 | py | Python | mental_arithmetic.py | Traftmine/mental_arithmetic | e20d24f884b3ffc53003cbc1c2998e4d60034ffe | [
"MIT"
] | null | null | null | mental_arithmetic.py | Traftmine/mental_arithmetic | e20d24f884b3ffc53003cbc1c2998e4d60034ffe | [
"MIT"
] | null | null | null | mental_arithmetic.py | Traftmine/mental_arithmetic | e20d24f884b3ffc53003cbc1c2998e4d60034ffe | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sun Jun 20 18:12:59 2021
@author: Traftmine
"""
#the computer choose a number between 1 and a number x chosen by the user
import random as rm
import time as t
NUMBER_LIM = int(input("What's the limit number you're ok with? "))
Y = int(input("How many rounds do y... | 23.015873 | 78 | 0.530345 | # -*- coding: utf-8 -*-
"""
Created on Sun Jun 20 18:12:59 2021
@author: Traftmine
"""
#the computer choose a number between 1 and a number x chosen by the user
import random as rm
import time as t
NUMBER_LIM = int(input("What's the limit number you're ok with? "))
Y = int(input("How many rounds do y... | 0 | 0 | 0 |
edce1039bf7e6c901af6f50f97b236f286cda78f | 2,100 | py | Python | setup.py | Hoxbro/pyctdev | 837773ab8b05772d5ad9a240e717b6907e7c964a | [
"BSD-3-Clause"
] | 3 | 2019-10-12T11:17:20.000Z | 2020-07-01T13:49:31.000Z | setup.py | Hoxbro/pyctdev | 837773ab8b05772d5ad9a240e717b6907e7c964a | [
"BSD-3-Clause"
] | 62 | 2019-11-17T12:52:13.000Z | 2022-03-20T09:13:59.000Z | setup.py | Hoxbro/pyctdev | 837773ab8b05772d5ad9a240e717b6907e7c964a | [
"BSD-3-Clause"
] | 4 | 2019-11-29T10:35:29.000Z | 2021-12-26T10:55:48.000Z | #! /usr/bin/env python
import sys
from setuptools import setup
import versioneer
setup_args = dict(
name = 'pyctdev',
description = 'python packaging common tasks for developers',
long_description=open("README.md").read(),
long_description_content_type="text/markdown",
version = versioneer.get_ve... | 34.42623 | 71 | 0.622381 | #! /usr/bin/env python
import sys
from setuptools import setup
import versioneer
setup_args = dict(
name = 'pyctdev',
description = 'python packaging common tasks for developers',
long_description=open("README.md").read(),
long_description_content_type="text/markdown",
version = versioneer.get_ve... | 0 | 0 | 0 |
a173b8c3eb3ac293d3ccb0af0521b7185f04426c | 769 | py | Python | s8_deployment/exercise_files/main.py | jaschn/dtu_mlops | 59f404cffc756739433b5ccebb46ef6bfd467436 | [
"Apache-2.0"
] | null | null | null | s8_deployment/exercise_files/main.py | jaschn/dtu_mlops | 59f404cffc756739433b5ccebb46ef6bfd467436 | [
"Apache-2.0"
] | null | null | null | s8_deployment/exercise_files/main.py | jaschn/dtu_mlops | 59f404cffc756739433b5ccebb46ef6bfd467436 | [
"Apache-2.0"
] | null | null | null | from git import base
import torch
from PIL import Image
from torchvision import transforms
from google.cloud import storage
import io
import base64
BUCKET_NAME = "cloud_fn_storage"
MODEL_FILE = "deployable_model.pt"
client = storage.Client()
bucket = client.get_bucket(BUCKET_NAME)
blob = bucket.get_blob(MODEL_FILE)
m... | 25.633333 | 39 | 0.73472 | from git import base
import torch
from PIL import Image
from torchvision import transforms
from google.cloud import storage
import io
import base64
BUCKET_NAME = "cloud_fn_storage"
MODEL_FILE = "deployable_model.pt"
client = storage.Client()
bucket = client.get_bucket(BUCKET_NAME)
blob = bucket.get_blob(MODEL_FILE)
m... | 291 | 0 | 23 |
a28670ba50f26eff3c150ed92e03e9b425388695 | 173 | py | Python | src/ClipSpeech/__main__.py | Match-Yang/ClipSpeech | 5588e47886c30e7d7294ab23fb49e1d95bed8ec6 | [
"MIT"
] | 1 | 2022-02-22T10:04:37.000Z | 2022-02-22T10:04:37.000Z | src/ClipSpeech/__main__.py | Match-Yang/ClipSpeech | 5588e47886c30e7d7294ab23fb49e1d95bed8ec6 | [
"MIT"
] | 1 | 2021-12-14T07:45:17.000Z | 2021-12-14T07:46:03.000Z | src/ClipSpeech/__main__.py | Match-Yang/ClipSpeech | 5588e47886c30e7d7294ab23fb49e1d95bed8ec6 | [
"MIT"
] | 1 | 2022-02-22T10:04:39.000Z | 2022-02-22T10:04:39.000Z | import sys, os
# 为了兼容-m模式运行,我们主动将当前目录加入到sys.path,这样就能搜索本项目的的模块
sys.path.append(os.path.dirname(__file__))
from app import main
if __name__ == '__main__':
main()
| 21.625 | 48 | 0.722543 | import sys, os
# 为了兼容-m模式运行,我们主动将当前目录加入到sys.path,这样就能搜索本项目的的模块
sys.path.append(os.path.dirname(__file__))
from app import main
if __name__ == '__main__':
main()
| 0 | 0 | 0 |
c000be31c1c0e50b6d483d1e52392173fdd2283e | 2,812 | py | Python | modipyd/__init__.py | ishikawa/modipyd | 30bd7df9e9babb29b848dac6a46b1c909ab1e180 | [
"MIT"
] | 1 | 2016-05-08T13:21:04.000Z | 2016-05-08T13:21:04.000Z | modipyd/__init__.py | ishikawa/modipyd | 30bd7df9e9babb29b848dac6a46b1c909ab1e180 | [
"MIT"
] | null | null | null | modipyd/__init__.py | ishikawa/modipyd | 30bd7df9e9babb29b848dac6a46b1c909ab1e180 | [
"MIT"
] | null | null | null | """
Modipyd: Autotest for Python, and more
=======================================
**Modipyd** is a `Python`_ module dependency analysis and monitoring
modification framework, written by Takanori Ishikawa and licensed
under `the MIT license`_.
**This project aims to provide:**
* Automated testing tool **pyautotest**... | 32.697674 | 80 | 0.6234 | """
Modipyd: Autotest for Python, and more
=======================================
**Modipyd** is a `Python`_ module dependency analysis and monitoring
modification framework, written by Takanori Ishikawa and licensed
under `the MIT license`_.
**This project aims to provide:**
* Automated testing tool **pyautotest**... | 0 | 0 | 0 |
3ef017799d782b2927eb9e02595b18c35769b231 | 199 | py | Python | examples/docker/app.py | k24d/ssm-vault | d5876cc74d385cab96956068f013c5aa7619a20a | [
"MIT"
] | 3 | 2020-01-17T02:31:35.000Z | 2021-06-11T17:24:23.000Z | examples/docker/app.py | k24d/ssm-vault | d5876cc74d385cab96956068f013c5aa7619a20a | [
"MIT"
] | null | null | null | examples/docker/app.py | k24d/ssm-vault | d5876cc74d385cab96956068f013c5aa7619a20a | [
"MIT"
] | null | null | null | from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from config import Config
app = Flask(__name__)
app.config.from_object(Config())
db = SQLAlchemy(app)
db.engine.execute('select 1')
| 18.090909 | 39 | 0.788945 | from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from config import Config
app = Flask(__name__)
app.config.from_object(Config())
db = SQLAlchemy(app)
db.engine.execute('select 1')
| 0 | 0 | 0 |
a89bcb20a2d2ac470f841e015ea6342ab57b0a37 | 390 | py | Python | dog_finder/score_analyzer.py | jojo-en-code/foundations-project-template | 4378bbba60353710e9ec5424c7e0314b3361472c | [
"MIT"
] | null | null | null | dog_finder/score_analyzer.py | jojo-en-code/foundations-project-template | 4378bbba60353710e9ec5424c7e0314b3361472c | [
"MIT"
] | null | null | null | dog_finder/score_analyzer.py | jojo-en-code/foundations-project-template | 4378bbba60353710e9ec5424c7e0314b3361472c | [
"MIT"
] | null | null | null | # from website import score_comp | 35.454545 | 51 | 0.717949 | # from website import score_comp
def calculate_range(dog_breed_list, score):
dog_breed_range_list = []
for dog_breed in dog_breed_list:
min_score=dog_breed.min_score
max_score=dog_breed.max_score
if score > min_score and score < max_score:
dog_name=dog_breed.name
... | 336 | 0 | 22 |
0583262e1f547923b232c541d32988870414fa9b | 404 | py | Python | example_helloworld.py | htsong/manim | 4e6b7c73bb63c3a79f39e5277147e97df3d1298c | [
"MIT"
] | null | null | null | example_helloworld.py | htsong/manim | 4e6b7c73bb63c3a79f39e5277147e97df3d1298c | [
"MIT"
] | null | null | null | example_helloworld.py | htsong/manim | 4e6b7c73bb63c3a79f39e5277147e97df3d1298c | [
"MIT"
] | null | null | null | # from big_ol_pile_of_manim_imports import *
from manimlib.imports import *
from manimlib.constants import *
TEX_USE_CTEX = True
| 33.666667 | 82 | 0.663366 | # from big_ol_pile_of_manim_imports import *
from manimlib.imports import *
from manimlib.constants import *
TEX_USE_CTEX = True
class Hello_World(Scene):
def construct(self):
# helloworld = TextMobject("hello, manim!", color=BLUE)
helloworld = Text("hello, manim!你好!", color=BLUE, font="Mic... | 223 | 4 | 51 |
55a7deef48013423ac561687be9a2fe9708ce802 | 4,272 | py | Python | a10sdk/core/gslb/gslb_group_info_oper.py | deepfield/a10sdk-python | bfaa58099f51f085d5e91652d1d1a3fd5c529d5d | [
"Apache-2.0"
] | 16 | 2015-05-20T07:26:30.000Z | 2021-01-23T11:56:57.000Z | a10sdk/core/gslb/gslb_group_info_oper.py | deepfield/a10sdk-python | bfaa58099f51f085d5e91652d1d1a3fd5c529d5d | [
"Apache-2.0"
] | 6 | 2015-03-24T22:07:11.000Z | 2017-03-28T21:31:18.000Z | a10sdk/core/gslb/gslb_group_info_oper.py | deepfield/a10sdk-python | bfaa58099f51f085d5e91652d1d1a3fd5c529d5d | [
"Apache-2.0"
] | 23 | 2015-03-29T15:43:01.000Z | 2021-06-02T17:12:01.000Z | from a10sdk.common.A10BaseClass import A10BaseClass
class MemberList(A10BaseClass):
"""This class does not support CRUD Operations please use parent.
:param status: {"type": "string", "format": "string"}
:param passive: {"type": "number", "format": "number"}
:param connect_success: {"type": "num... | 39.192661 | 1,015 | 0.589654 | from a10sdk.common.A10BaseClass import A10BaseClass
class MemberList(A10BaseClass):
"""This class does not support CRUD Operations please use parent.
:param status: {"type": "string", "format": "string"}
:param passive: {"type": "number", "format": "number"}
:param connect_success: {"type": "num... | 1,147 | 0 | 78 |
bbb8059668ebe690434ab4184e851cea7d48e91e | 509 | py | Python | src/fact/lib.py | kown7/python-blueprint | 50e275cfd24ddedab10d8d00d53be8ff1c6216b1 | [
"MIT"
] | null | null | null | src/fact/lib.py | kown7/python-blueprint | 50e275cfd24ddedab10d8d00d53be8ff1c6216b1 | [
"MIT"
] | null | null | null | src/fact/lib.py | kown7/python-blueprint | 50e275cfd24ddedab10d8d00d53be8ff1c6216b1 | [
"MIT"
] | null | null | null | class InvalidFactorialError(RuntimeError):
"""Error generated if an invalid factorial input is given."""
def factorial(n: int) -> int:
"""Computes the factorial through a recursive algorithm.
Args:
n: A positive input value.
Raises:
InvalidFactorialError: If n is less than 0.
Re... | 22.130435 | 65 | 0.620825 | class InvalidFactorialError(RuntimeError):
"""Error generated if an invalid factorial input is given."""
def factorial(n: int) -> int:
"""Computes the factorial through a recursive algorithm.
Args:
n: A positive input value.
Raises:
InvalidFactorialError: If n is less than 0.
Re... | 0 | 0 | 0 |
423df074e92eff0f9482dd6cc080cfe837174aab | 977 | py | Python | fom/interfaces/topologies/finite_product_topology.py | MichalKononenko/FoundationsOfMechanics | d1ca2cc961a98be4761b3938f3a7f58d82daed62 | [
"MIT"
] | null | null | null | fom/interfaces/topologies/finite_product_topology.py | MichalKononenko/FoundationsOfMechanics | d1ca2cc961a98be4761b3938f3a7f58d82daed62 | [
"MIT"
] | null | null | null | fom/interfaces/topologies/finite_product_topology.py | MichalKononenko/FoundationsOfMechanics | d1ca2cc961a98be4761b3938f3a7f58d82daed62 | [
"MIT"
] | null | null | null | """
Defines a finite product topology. This is a product topology formed by
multiplying two finite topologies.
"""
import abc
from .finite_topology import FiniteTopology
from .product_topology import ProductTopology
from typing import TypeVar, Tuple, Set, Generic
X = TypeVar('X')
Y = TypeVar('Y')
class FiniteProduct... | 29.606061 | 79 | 0.702149 | """
Defines a finite product topology. This is a product topology formed by
multiplying two finite topologies.
"""
import abc
from .finite_topology import FiniteTopology
from .product_topology import ProductTopology
from typing import TypeVar, Tuple, Set, Generic
X = TypeVar('X')
Y = TypeVar('Y')
class FiniteProduct... | 0 | 0 | 0 |
ca9591aabe9dd5bb2938791c9e049200e7adf4e8 | 6,778 | py | Python | lm_eval/models/dec_only_t5.py | lintangsutawika/lm-evaluation-harness | babaf9082b626f13d5392e5665da730c5bf91d50 | [
"MIT"
] | null | null | null | lm_eval/models/dec_only_t5.py | lintangsutawika/lm-evaluation-harness | babaf9082b626f13d5392e5665da730c5bf91d50 | [
"MIT"
] | null | null | null | lm_eval/models/dec_only_t5.py | lintangsutawika/lm-evaluation-harness | babaf9082b626f13d5392e5665da730c5bf91d50 | [
"MIT"
] | null | null | null | from transformers import T5TokenizerFast
import torch
import torch.nn.functional as F
from lm_eval.base import LM
from lm_eval import utils
from tqdm import tqdm
### I very much dislike this solution. TODO: fix this abomination for jay-z repo
import os
import sys
from pathlib import Path
path = Path(os.path.realpath(_... | 42.628931 | 151 | 0.607996 | from transformers import T5TokenizerFast
import torch
import torch.nn.functional as F
from lm_eval.base import LM
from lm_eval import utils
from tqdm import tqdm
### I very much dislike this solution. TODO: fix this abomination for jay-z repo
import os
import sys
from pathlib import Path
path = Path(os.path.realpath(_... | 5,762 | 520 | 23 |
178703bea3a146636eedec9fe1f83cb95a9b8057 | 577 | py | Python | froide/campaign/listeners.py | manonthemat/froide | 698c49935eaf2e922f3c9f6a46af0fd545ccbbbb | [
"MIT"
] | null | null | null | froide/campaign/listeners.py | manonthemat/froide | 698c49935eaf2e922f3c9f6a46af0fd545ccbbbb | [
"MIT"
] | null | null | null | froide/campaign/listeners.py | manonthemat/froide | 698c49935eaf2e922f3c9f6a46af0fd545ccbbbb | [
"MIT"
] | null | null | null | from .models import Campaign
| 25.086957 | 57 | 0.639515 | from .models import Campaign
def connect_campaign(sender, **kwargs):
reference = kwargs.get('reference')
if not reference:
return
parts = reference.split(':', 1)
if len(parts) != 2:
return
namespace = parts[0]
try:
campaign = Campaign.objects.get(ident=namespace)
ex... | 524 | 0 | 23 |
a66665c688d5ea4fef712b8572555f0a25a89ae6 | 7,778 | py | Python | main.py | Muia23/Pass-Locker | 8e15a27478fa98c96044437892e50476b77256a2 | [
"Unlicense"
] | null | null | null | main.py | Muia23/Pass-Locker | 8e15a27478fa98c96044437892e50476b77256a2 | [
"Unlicense"
] | null | null | null | main.py | Muia23/Pass-Locker | 8e15a27478fa98c96044437892e50476b77256a2 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python3.8
from user import User
from credentials import Credential
import random
import string
Process = []
#sign in user
#program running
program_run = True
#exit program
#sign up user
def signup_user(username, password):
'''
Function to sign up a user
'''
new_user = User(userna... | 23.21791 | 185 | 0.506814 | #!/usr/bin/env python3.8
from user import User
from credentials import Credential
import random
import string
Process = []
#sign in user
#program running
program_run = True
#exit program
def exit_program():
global program_run
program_run = False
#sign up user
def signup_user(username, password):
'''
... | 4,793 | 0 | 90 |
89b738341a9febb6783af2686ce10240384d0eed | 353 | py | Python | __init__.py | kamyarkalhor/chopen | 505e1b927245e601aec140d0e61a9c6785700304 | [
"MIT"
] | null | null | null | __init__.py | kamyarkalhor/chopen | 505e1b927245e601aec140d0e61a9c6785700304 | [
"MIT"
] | null | null | null | __init__.py | kamyarkalhor/chopen | 505e1b927245e601aec140d0e61a9c6785700304 | [
"MIT"
] | null | null | null | import sys
import os
import django
CHOPEN_PATH = os.path.dirname(os.path.realpath(__file__))
| 25.214286 | 92 | 0.68272 | import sys
import os
import django
CHOPEN_PATH = os.path.dirname(os.path.realpath(__file__))
def django_setup():
if CHOPEN_PATH not in sys.path:
sys.path.append(CHOPEN_PATH)
os.environ.setdefault("DJANGO_SETTINGS_MODULE",
"web_app.settings") # web_app should be an app on the... | 236 | 0 | 23 |
878fcd250a87073cd29acdb61c82ab8d848b58aa | 1,099 | py | Python | test/trace_processor/parsing/very_long_sched.py | ztlevi/perfetto | a0de991bf39c5744ab4eef00eae823c378eb99a9 | [
"Apache-2.0"
] | 933 | 2019-12-10T10:45:28.000Z | 2022-03-31T03:43:44.000Z | test/trace_processor/parsing/very_long_sched.py | ztlevi/perfetto | a0de991bf39c5744ab4eef00eae823c378eb99a9 | [
"Apache-2.0"
] | 252 | 2019-12-10T16:13:57.000Z | 2022-03-31T09:56:46.000Z | test/trace_processor/parsing/very_long_sched.py | ztlevi/perfetto | a0de991bf39c5744ab4eef00eae823c378eb99a9 | [
"Apache-2.0"
] | 153 | 2020-01-08T20:17:27.000Z | 2022-03-30T20:53:21.000Z | #!/usr/bin/env python3
# Copyright (C) 2019 The Android Open Source Project
#
# 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 requ... | 31.4 | 74 | 0.747953 | #!/usr/bin/env python3
# Copyright (C) 2019 The Android Open Source Project
#
# 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 requ... | 0 | 0 | 0 |
3ac89cc64e8c1680393223828af8aa45e828e58a | 12,992 | py | Python | data/augmentation.py | chrizandr/FootAndBall | b42ffad4a0dba4bb6e6144754f71927c7c5a6c0e | [
"MIT"
] | 55 | 2020-10-21T22:24:03.000Z | 2022-03-23T18:31:53.000Z | data/augmentation.py | chrizandr/FootAndBall | b42ffad4a0dba4bb6e6144754f71927c7c5a6c0e | [
"MIT"
] | 5 | 2020-11-07T02:49:43.000Z | 2022-03-06T15:39:42.000Z | data/augmentation.py | chrizandr/FootAndBall | b42ffad4a0dba4bb6e6144754f71927c7c5a6c0e | [
"MIT"
] | 14 | 2021-01-22T08:39:41.000Z | 2022-03-29T00:48:15.000Z | # FootAndBall: Integrated Player and Ball Detector
# Jacek Komorowski, Grzegorz Kurzejamski, Grzegorz Sarwas
# Copyright (c) 2020 Sport Algorithmics and Gaming
from torchvision import transforms
from PIL import Image
import numpy as np
import numbers
import random
import cv2
import torchvision.transforms as transform... | 39.015015 | 128 | 0.612762 | # FootAndBall: Integrated Player and Ball Detector
# Jacek Komorowski, Grzegorz Kurzejamski, Grzegorz Sarwas
# Copyright (c) 2020 Sport Algorithmics and Gaming
from torchvision import transforms
from PIL import Image
import numpy as np
import numbers
import random
import cv2
import torchvision.transforms as transform... | 6,827 | 34 | 634 |
04dc41d9f91fef7f583e8393fc6202092b9d43b9 | 2,349 | py | Python | tests/test_01_futures/test_compatibility.py | primal100/aionetworking | a29cbb022cbae1a4ad1c3d44327e9d0b0c930227 | [
"MIT"
] | null | null | null | tests/test_01_futures/test_compatibility.py | primal100/aionetworking | a29cbb022cbae1a4ad1c3d44327e9d0b0c930227 | [
"MIT"
] | 1 | 2018-12-23T00:50:33.000Z | 2018-12-23T00:50:33.000Z | tests/test_01_futures/test_compatibility.py | primal100/aionetworking | a29cbb022cbae1a4ad1c3d44327e9d0b0c930227 | [
"MIT"
] | null | null | null | import pytest # noinspection PyPackageRequirements
import asyncio
from aionetworking.compatibility import (supports_task_name, get_task_name, get_current_task_name, set_task_name,
set_current_task_name, current_task)
| 38.508197 | 113 | 0.659004 | import pytest # noinspection PyPackageRequirements
import asyncio
from aionetworking.compatibility import (supports_task_name, get_task_name, get_current_task_name, set_task_name,
set_current_task_name, current_task)
class TestTaskNames:
@pytest.mark.asyncio
async d... | 1,761 | 303 | 23 |
d791b2f17c28bd4384f27cff306a400f0bb904f7 | 11,020 | py | Python | instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/__init__.py | epsagon/opentelemetry-python-contrib | 2671ff53c8643ad55dcf78dad072f2f0b82e84e1 | [
"Apache-2.0",
"BSD-3-Clause"
] | 3 | 2019-11-26T14:31:09.000Z | 2020-01-09T23:04:49.000Z | instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/__init__.py | epsagon/opentelemetry-python-contrib | 2671ff53c8643ad55dcf78dad072f2f0b82e84e1 | [
"Apache-2.0",
"BSD-3-Clause"
] | 16 | 2020-02-07T10:01:02.000Z | 2020-04-06T22:03:31.000Z | instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/__init__.py | epsagon/opentelemetry-python-contrib | 2671ff53c8643ad55dcf78dad072f2f0b82e84e1 | [
"Apache-2.0",
"BSD-3-Clause"
] | 5 | 2020-02-05T14:59:12.000Z | 2020-04-03T15:34:16.000Z | # Copyright 2020, OpenTelemetry Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 35.779221 | 239 | 0.684936 | # Copyright 2020, OpenTelemetry Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 3,290 | 1,803 | 46 |
1beb228b259a078a021b72906c1b41e44cb32729 | 10,418 | py | Python | backend/api/views/MiembroViewSet.py | kukiamarilla/polijira | 510dbc1473db973ac71fc68fa5a9b758b90a780b | [
"MIT"
] | 1 | 2022-03-02T02:28:49.000Z | 2022-03-02T02:28:49.000Z | backend/api/views/MiembroViewSet.py | kukiamarilla/polijira | 510dbc1473db973ac71fc68fa5a9b758b90a780b | [
"MIT"
] | 22 | 2021-09-01T17:44:25.000Z | 2021-10-07T19:39:09.000Z | backend/api/views/MiembroViewSet.py | kukiamarilla/polijira | 510dbc1473db973ac71fc68fa5a9b758b90a780b | [
"MIT"
] | null | null | null | from rest_framework import viewsets, status
from rest_framework.response import Response
from backend.api.models import Usuario, Miembro, Proyecto, RolProyecto, Horario
from backend.api.serializers import MiembroSerializer, HorarioSerializer
from rest_framework.decorators import action
from django.db import transaction... | 44.521368 | 104 | 0.569591 | from rest_framework import viewsets, status
from rest_framework.response import Response
from backend.api.models import Usuario, Miembro, Proyecto, RolProyecto, Horario
from backend.api.serializers import MiembroSerializer, HorarioSerializer
from rest_framework.decorators import action
from django.db import transaction... | 1,226 | 0 | 26 |
f06b0f93b8c451478f032677b3e9129ec47fd49d | 294 | py | Python | main/views.py | sonicyang/chiphub | 4075dd503a79077884cb23df3a67f2a641b735bc | [
"MIT"
] | null | null | null | main/views.py | sonicyang/chiphub | 4075dd503a79077884cb23df3a67f2a641b735bc | [
"MIT"
] | null | null | null | main/views.py | sonicyang/chiphub | 4075dd503a79077884cb23df3a67f2a641b735bc | [
"MIT"
] | null | null | null | from django.shortcuts import render
| 18.375 | 43 | 0.717687 | from django.shortcuts import render
def index(request):
return render(request, 'index.html')
def faq(request):
return render(request, 'faq.html')
def about_us(request):
return render(request, 'about_us.html')
def exchange(request):
return render(request, 'exchange.html')
| 164 | 0 | 92 |
0c617f67637602d18410213f2df404fd8d2feb32 | 377 | py | Python | wagtail/tests/testapp/forms.py | yohanlebret/wagtail | 03c623b467ef8ed3849872273ebad13d48f755ac | [
"BSD-3-Clause"
] | null | null | null | wagtail/tests/testapp/forms.py | yohanlebret/wagtail | 03c623b467ef8ed3849872273ebad13d48f755ac | [
"BSD-3-Clause"
] | null | null | null | wagtail/tests/testapp/forms.py | yohanlebret/wagtail | 03c623b467ef8ed3849872273ebad13d48f755ac | [
"BSD-3-Clause"
] | 1 | 2019-03-05T15:37:22.000Z | 2019-03-05T15:37:22.000Z | from django import forms
from wagtail.wagtailadmin.forms import WagtailAdminPageForm
| 25.133333 | 64 | 0.668435 | from django import forms
from wagtail.wagtailadmin.forms import WagtailAdminPageForm
class ValidatedPageForm(WagtailAdminPageForm):
def clean_foo(self):
if 'foo' not in self.cleaned_data:
return
value = self.cleaned_data['foo']
if value != 'bar':
raise forms.Valid... | 216 | 25 | 49 |
43d050af4fe22db0849ef1bc24742390be5fd565 | 7,688 | py | Python | wom_tributary/utils/tweet_summarizers.py | tibonihoo/wateronmars | bd5c71b3386d62200a08899659349657f053eed2 | [
"CC-BY-3.0",
"Apache-2.0"
] | 18 | 2015-05-07T15:43:08.000Z | 2018-05-11T18:41:15.000Z | wom_tributary/utils/tweet_summarizers.py | tibonihoo/wateronmars | bd5c71b3386d62200a08899659349657f053eed2 | [
"CC-BY-3.0",
"Apache-2.0"
] | 10 | 2015-03-29T20:11:28.000Z | 2017-05-02T21:37:14.000Z | wom_tributary/utils/tweet_summarizers.py | tibonihoo/wateronmars | bd5c71b3386d62200a08899659349657f053eed2 | [
"CC-BY-3.0",
"Apache-2.0"
] | 13 | 2015-05-05T19:02:34.000Z | 2018-01-10T18:31:13.000Z | # -*- coding: utf-8; indent-tabs-mode: nil; python-indent: 2 -*-
#
# Copyright (C) 2019 Thibauld Nion
#
# This file is part of WaterOnMars (https://github.com/tibonihoo/wateronmars)
#
# WaterOnMars is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as p... | 32.033333 | 160 | 0.662721 | # -*- coding: utf-8; indent-tabs-mode: nil; python-indent: 2 -*-
#
# Copyright (C) 2019 Thibauld Nion
#
# This file is part of WaterOnMars (https://github.com/tibonihoo/wateronmars)
#
# WaterOnMars is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as p... | 4,690 | 82 | 184 |
f64cc932d8441b43e990b5d8b3b0f07dea405ce5 | 663 | py | Python | setup.py | jfreissmann/SWSHplotting | 3cc6516115c43513de2ff817b7bce4b2c5abc076 | [
"MIT"
] | null | null | null | setup.py | jfreissmann/SWSHplotting | 3cc6516115c43513de2ff817b7bce4b2c5abc076 | [
"MIT"
] | null | null | null | setup.py | jfreissmann/SWSHplotting | 3cc6516115c43513de2ff817b7bce4b2c5abc076 | [
"MIT"
] | null | null | null | from setuptools import setup
with open('README.rst', 'r') as f:
long_discription = f.read()
setup(
name='SWSHplotting',
version='0.0.1',
author='Jonas Freißmann',
author_email='jonas.freissmann@hs-flensburg.de',
description='Plotting package for SWSH project.',
long_discription=long_discri... | 27.625 | 54 | 0.660633 | from setuptools import setup
with open('README.rst', 'r') as f:
long_discription = f.read()
setup(
name='SWSHplotting',
version='0.0.1',
author='Jonas Freißmann',
author_email='jonas.freissmann@hs-flensburg.de',
description='Plotting package for SWSH project.',
long_discription=long_discri... | 0 | 0 | 0 |
95fdcd84ec7a4cb3a4fffd244709e83994b1e4f2 | 145 | py | Python | custom_components/ping_socket/__init__.py | gtjamesa/hacs-ping-socket | f6573085c93b08227b2c9146589cdf52ee07208b | [
"Apache-2.0"
] | null | null | null | custom_components/ping_socket/__init__.py | gtjamesa/hacs-ping-socket | f6573085c93b08227b2c9146589cdf52ee07208b | [
"Apache-2.0"
] | null | null | null | custom_components/ping_socket/__init__.py | gtjamesa/hacs-ping-socket | f6573085c93b08227b2c9146589cdf52ee07208b | [
"Apache-2.0"
] | null | null | null | """The Ping (Socket) integration."""
from __future__ import annotations
from homeassistant.core import HomeAssistant
from .const import DOMAIN
| 20.714286 | 44 | 0.8 | """The Ping (Socket) integration."""
from __future__ import annotations
from homeassistant.core import HomeAssistant
from .const import DOMAIN
| 0 | 0 | 0 |
ef6dafc292592cc65495f02716c37ee2bd4f3e34 | 10,693 | py | Python | 11- TP 3/pruebas_grafo.py | ordonezf/algo2 | 5aa4d2594e558747cdb7f28eb302f5b386b920d9 | [
"MIT"
] | null | null | null | 11- TP 3/pruebas_grafo.py | ordonezf/algo2 | 5aa4d2594e558747cdb7f28eb302f5b386b920d9 | [
"MIT"
] | null | null | null | 11- TP 3/pruebas_grafo.py | ordonezf/algo2 | 5aa4d2594e558747cdb7f28eb302f5b386b920d9 | [
"MIT"
] | 3 | 2019-10-10T22:11:51.000Z | 2020-10-29T19:28:28.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import time
from grafo import *
global resultados_pruebas
resultados_pruebas = { "OK" : 0, "ERROR" : 0 }
def correr_prueba(caso_prueba, descripcion):
''' Comprueba la igualdad pasada por parámetro como caso_prueba y
muestra la descripción y su r... | 41.607004 | 127 | 0.59076 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import time
from grafo import *
global resultados_pruebas
resultados_pruebas = { "OK" : 0, "ERROR" : 0 }
def correr_prueba(caso_prueba, descripcion):
''' Comprueba la igualdad pasada por parámetro como caso_prueba y
muestra la descripción y su r... | 8,690 | 0 | 244 |
ac49714a48fb337d24a723172e257715708640b0 | 5,542 | py | Python | packages/models-library/src/models_library/utils/database_models_factory.py | colinRawlings/osparc-simcore | bf2f18d5bc1e574d5f4c238d08ad15156184c310 | [
"MIT"
] | 25 | 2018-04-13T12:44:12.000Z | 2022-03-12T15:01:17.000Z | packages/models-library/src/models_library/utils/database_models_factory.py | colinRawlings/osparc-simcore | bf2f18d5bc1e574d5f4c238d08ad15156184c310 | [
"MIT"
] | 2,553 | 2018-01-18T17:11:55.000Z | 2022-03-31T16:26:40.000Z | packages/models-library/src/models_library/utils/database_models_factory.py | mrnicegyu11/osparc-simcore | b6fa6c245dbfbc18cc74a387111a52de9b05d1f4 | [
"MIT"
] | 20 | 2018-01-18T19:45:33.000Z | 2022-03-29T07:08:47.000Z | """ Automatic creation of pydantic model classes from a sqlalchemy table
SEE: Copied and adapted from https://github.com/tiangolo/pydantic-sqlalchemy/blob/master/pydantic_sqlalchemy/main.py
"""
import json
import warnings
from datetime import datetime
from typing import Any, Callable, Container, Dict, List, Optional,... | 32.6 | 116 | 0.652652 | """ Automatic creation of pydantic model classes from a sqlalchemy table
SEE: Copied and adapted from https://github.com/tiangolo/pydantic-sqlalchemy/blob/master/pydantic_sqlalchemy/main.py
"""
import json
import warnings
from datetime import datetime
from typing import Any, Callable, Container, Dict, List, Optional,... | 2,283 | 27 | 46 |
1d6be19e939e1916d9f24b481180000afcaae393 | 721 | py | Python | setup.py | colin-nolan/patchwork-docker | 084b077724e98f0cdcdcf24626dee625b02ee38c | [
"MIT"
] | null | null | null | setup.py | colin-nolan/patchwork-docker | 084b077724e98f0cdcdcf24626dee625b02ee38c | [
"MIT"
] | 2 | 2018-11-15T21:51:13.000Z | 2019-12-24T19:15:20.000Z | setup.py | colin-nolan/patchwork-docker | 084b077724e98f0cdcdcf24626dee625b02ee38c | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
from patchworkdocker.meta import VERSION, DESCRIPTION, PACKAGE_NAME, EXECUTABLE_NAME
setup(
name=PACKAGE_NAME,
version=VERSION,
author="Colin Nolan",
author_email="cn580@alumni.york.ac.uk",
packages=find_packages(exclude=["tests"]),
install_requires=... | 30.041667 | 84 | 0.693481 | from setuptools import setup, find_packages
from patchworkdocker.meta import VERSION, DESCRIPTION, PACKAGE_NAME, EXECUTABLE_NAME
setup(
name=PACKAGE_NAME,
version=VERSION,
author="Colin Nolan",
author_email="cn580@alumni.york.ac.uk",
packages=find_packages(exclude=["tests"]),
install_requires=... | 0 | 0 | 0 |
dcb01feee41c2fe13555c3a52882495029d903b3 | 1,073 | py | Python | config.py | nonemaw/YeTi | 92a3ba89f5b7fd8b2d5d3f5929ade0bf0b9e5cbe | [
"MIT"
] | 1 | 2017-10-04T12:21:20.000Z | 2017-10-04T12:21:20.000Z | config.py | nonemaw/YeTi | 92a3ba89f5b7fd8b2d5d3f5929ade0bf0b9e5cbe | [
"MIT"
] | null | null | null | config.py | nonemaw/YeTi | 92a3ba89f5b7fd8b2d5d3f5929ade0bf0b9e5cbe | [
"MIT"
] | null | null | null | import os
basedir = os.path.abspath(os.path.dirname(__file__))
config = {
'test': TestingConfig,
'production': Config,
'default': DevelopmentConfig
}
| 27.512821 | 84 | 0.708295 | import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
# MASTER_KEY: for password encryption / decryption
# SECRET_KEY: for token encryption / decryption
MASTER_KEY = os.environ.get('MASTER_KEY') or 'QnpNp9A5tUFJKnQtWXRBHSnknRil24JmH'
SECRET_KEY = os.environ.get('SECRET_KEY') or ... | 10 | 827 | 69 |
157911bd40ad412e9ac2c7bb943ae3def4b20fad | 37,204 | py | Python | setup_process_process.py | karttur/geoimagine03-setup_processes | 375b2fbf7486c4326f60e4ce2cfcc4ffa7216133 | [
"BSD-3-Clause"
] | null | null | null | setup_process_process.py | karttur/geoimagine03-setup_processes | 375b2fbf7486c4326f60e4ce2cfcc4ffa7216133 | [
"BSD-3-Clause"
] | null | null | null | setup_process_process.py | karttur/geoimagine03-setup_processes | 375b2fbf7486c4326f60e4ce2cfcc4ffa7216133 | [
"BSD-3-Clause"
] | null | null | null | '''
Created on 20 Jan 2021
@author: thomasgumbricht
'''
# Standard library imports
from os import path, makedirs
from sys import exit
# Third party imports
import psycopg2
from base64 import b64encode, b64decode
import netrc
from pyproj import Proj, transform
# Package application imports
from geoimagine.anc... | 29.550437 | 199 | 0.552279 | '''
Created on 20 Jan 2021
@author: thomasgumbricht
'''
# Standard library imports
from os import path, makedirs
from sys import exit
# Third party imports
import psycopg2
from base64 import b64encode, b64decode
import netrc
from pyproj import Proj, transform
# Package application imports
from geoimagine.anc... | 1,782 | 0 | 80 |
db6aa0223ca8dc9eebb1ca064d506c779b6d6969 | 453 | py | Python | fedoralink/tests/test_inheritance.py | CESNET/fedoralink | d8afdccbfe8514522fb167fc7c59c4876a579b28 | [
"Apache-2.0"
] | null | null | null | fedoralink/tests/test_inheritance.py | CESNET/fedoralink | d8afdccbfe8514522fb167fc7c59c4876a579b28 | [
"Apache-2.0"
] | 14 | 2017-06-02T12:50:40.000Z | 2020-06-06T07:49:21.000Z | fedoralink/tests/test_inheritance.py | CESNET/fedoralink | d8afdccbfe8514522fb167fc7c59c4876a579b28 | [
"Apache-2.0"
] | null | null | null | import django
from rdflib.namespace import DC
from unittest import TestCase
from fedoralink.common_namespaces.dc import DCObject
from fedoralink.indexer.fields import IndexedTextField
django.setup()
| 19.695652 | 54 | 0.746137 | import django
from rdflib.namespace import DC
from unittest import TestCase
from fedoralink.common_namespaces.dc import DCObject
from fedoralink.indexer.fields import IndexedTextField
django.setup()
class BlahObject(DCObject):
blah = IndexedTextField(DC.blah)
class DCObjectTestCase(TestCase):
def setUp(s... | 95 | 55 | 99 |
c716ccca771f7f65da1c9401ff45f2e241878ac9 | 1,229 | py | Python | mosek/9.0/tools/examples/python/opt_server_sync.py | star2dust/MOSEK-MATLAB | c9be61935573ae07a5d4fdf76079874c6f821ca3 | [
"MIT"
] | null | null | null | mosek/9.0/tools/examples/python/opt_server_sync.py | star2dust/MOSEK-MATLAB | c9be61935573ae07a5d4fdf76079874c6f821ca3 | [
"MIT"
] | null | null | null | mosek/9.0/tools/examples/python/opt_server_sync.py | star2dust/MOSEK-MATLAB | c9be61935573ae07a5d4fdf76079874c6f821ca3 | [
"MIT"
] | 1 | 2022-02-24T02:51:35.000Z | 2022-02-24T02:51:35.000Z | ##
# Copyright : Copyright (c) MOSEK ApS, Denmark. All rights reserved.
#
# File : opt_server_sync.py
#
# Purpose : Demonstrates how to use MOSEK OptServer
# to solve optimization problem asynchronously
##
import mosek
import sys
if len(sys.argv) <= 3:
print("Missing argument, syntax is:")
... | 29.261905 | 74 | 0.637917 | ##
# Copyright : Copyright (c) MOSEK ApS, Denmark. All rights reserved.
#
# File : opt_server_sync.py
#
# Purpose : Demonstrates how to use MOSEK OptServer
# to solve optimization problem asynchronously
##
import mosek
import sys
def streamprinter(msg):
sys.stdout.write(msg)
sys.stdout.f... | 51 | 0 | 23 |
626900ffe1de120755b7f4fdf185f221175d8c4e | 4,683 | py | Python | api/pages/node/tasks.py | isabella232/incubator-warble-server | fa26696793fb7998ca7c207780d556f8006f63d9 | [
"Apache-2.0"
] | 1 | 2021-11-10T15:55:50.000Z | 2021-11-10T15:55:50.000Z | api/pages/node/tasks.py | apache/incubator-warble-server | fa26696793fb7998ca7c207780d556f8006f63d9 | [
"Apache-2.0"
] | 1 | 2021-11-04T12:36:21.000Z | 2021-11-04T12:36:21.000Z | api/pages/node/tasks.py | isabella232/incubator-warble-server | fa26696793fb7998ca7c207780d556f8006f63d9 | [
"Apache-2.0"
] | 2 | 2021-11-04T12:34:14.000Z | 2021-11-10T15:55:38.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# 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, ... | 38.385246 | 133 | 0.542814 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# 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, ... | 2,985 | 0 | 23 |
b6366e7bfc0344901258f14b4e44a60e4ac76ab4 | 1,405 | py | Python | benchmarks/bm-solver.py | MaxDesiatov/ttstar | 4ac6e124bddfbeaa133713d829dccaa596626be6 | [
"BSD-3-Clause"
] | 18 | 2015-06-12T14:58:05.000Z | 2021-08-31T14:36:48.000Z | benchmarks/bm-solver.py | MaxDesiatov/ttstar | 4ac6e124bddfbeaa133713d829dccaa596626be6 | [
"BSD-3-Clause"
] | 1 | 2016-02-03T12:43:32.000Z | 2017-09-12T17:13:40.000Z | benchmarks/bm-solver.py | MaxDesiatov/ttstar | 4ac6e124bddfbeaa133713d829dccaa596626be6 | [
"BSD-3-Clause"
] | 1 | 2021-08-31T19:08:56.000Z | 2021-08-31T19:08:56.000Z | #!/usr/bin/env python3
import os
import time
import json
import subprocess
WARMUPS = 8
SAMPLES = 64
if __name__ == '__main__':
main()
| 26.018519 | 96 | 0.520285 | #!/usr/bin/env python3
import os
import time
import json
import subprocess
WARMUPS = 8
SAMPLES = 64
def time_cmd(cmd):
# TODO: use perf stat -x \;
ts_start = time.perf_counter()
subprocess.check_call(cmd, stdout=subprocess.DEVNULL)
ts_end = time.perf_counter()
return ts_end - ts_start
def bench... | 1,195 | 0 | 69 |
4d84a444f2a53283c6de1b3e601f11d5f427c1d0 | 54 | py | Python | cwltool/__main__.py | wtsi-hgi/cwltool | 6d3e9f0b0f2c4fb78b76eb4270451f29515322f3 | [
"Apache-2.0"
] | 2 | 2017-07-06T13:25:23.000Z | 2017-07-06T13:26:15.000Z | cwltool/__main__.py | igormusinov/cwl_parser_python3 | 5b2cd24496c424fbe0923d6b1f715076fab1ca4c | [
"Apache-2.0"
] | 1 | 2018-05-10T06:45:21.000Z | 2018-05-10T06:45:21.000Z | cwltool/__main__.py | wtsi-hgi/cwltool | 6d3e9f0b0f2c4fb78b76eb4270451f29515322f3 | [
"Apache-2.0"
] | null | null | null | import sys
from . import main
sys.exit(main.main())
| 9 | 21 | 0.703704 | import sys
from . import main
sys.exit(main.main())
| 0 | 0 | 0 |
2c2d44421849e740579640e697d887ed33ae10ff | 339 | py | Python | python/Array/array_optimal_task.py | parizadas/HacktoberFest2020-3 | 48cb0c7f2d43d38cb7d8343df18035c9288c63ea | [
"MIT"
] | 51 | 2020-09-27T15:28:05.000Z | 2021-09-29T02:07:25.000Z | python/Array/array_optimal_task.py | parizadas/HacktoberFest2020-3 | 48cb0c7f2d43d38cb7d8343df18035c9288c63ea | [
"MIT"
] | 152 | 2020-09-27T12:12:12.000Z | 2021-10-03T18:22:15.000Z | python/Array/array_optimal_task.py | parizadas/HacktoberFest2020-3 | 48cb0c7f2d43d38cb7d8343df18035c9288c63ea | [
"MIT"
] | 453 | 2020-09-27T12:34:35.000Z | 2021-10-16T08:33:33.000Z | '''
Problem Statement: Assign tasks to workers so that the time it takes
to complete all the tasks is minimized given a count of workers and an
array where each element indicates the duration of a task.
Each worker must work on exactly two tasks.
'''
A = [5, 6, 1, 8, 3, 8]
A = sorted(A)
for i in range(len(A)//2):
... | 28.25 | 70 | 0.696165 | '''
Problem Statement: Assign tasks to workers so that the time it takes
to complete all the tasks is minimized given a count of workers and an
array where each element indicates the duration of a task.
Each worker must work on exactly two tasks.
'''
A = [5, 6, 1, 8, 3, 8]
A = sorted(A)
for i in range(len(A)//2):
... | 0 | 0 | 0 |
ea1a2a78718980b8b801d1f988b6e1deee5bf27a | 556 | py | Python | async_demos/async_demos/app_auth/views.py | Minkov/python-web-framework-demos- | 30f39de0b4344e1b7e5d4cf96f6d6bbbfe867305 | [
"MIT"
] | 2 | 2022-03-06T11:56:35.000Z | 2022-03-20T09:31:45.000Z | async_demos/async_demos/app_auth/views.py | Minkov/python-web-framework-demos- | 30f39de0b4344e1b7e5d4cf96f6d6bbbfe867305 | [
"MIT"
] | null | null | null | async_demos/async_demos/app_auth/views.py | Minkov/python-web-framework-demos- | 30f39de0b4344e1b7e5d4cf96f6d6bbbfe867305 | [
"MIT"
] | 4 | 2022-03-17T18:05:19.000Z | 2022-03-22T16:38:11.000Z | import random
from django.contrib.auth import get_user_model
from django.http import HttpResponse
from django.contrib.auth.views import PasswordResetView
UserModel = get_user_model()
| 27.8 | 86 | 0.730216 | import random
from django.contrib.auth import get_user_model
from django.http import HttpResponse
from django.contrib.auth.views import PasswordResetView
UserModel = get_user_model()
def create_fake_user(request):
rand_count = 6
username_suffix = ''.join(str(random.randint(1, 1000)) for _ in range(rand_cou... | 347 | 0 | 23 |
18d9b55a173fb8d115633edf07fb1af23e4a65aa | 2,957 | py | Python | fire_risk/backends/__init__.py | tbuffington7/fire-risk | c85fec01ae6d9940aed184db910a8d994ee7f8a1 | [
"MIT"
] | 4 | 2015-10-21T03:11:28.000Z | 2019-05-29T15:53:16.000Z | fire_risk/backends/__init__.py | tbuffington7/fire-risk | c85fec01ae6d9940aed184db910a8d994ee7f8a1 | [
"MIT"
] | 3 | 2015-07-30T14:06:03.000Z | 2017-03-16T15:41:11.000Z | fire_risk/backends/__init__.py | tbuffington7/fire-risk | c85fec01ae6d9940aed184db910a8d994ee7f8a1 | [
"MIT"
] | 7 | 2015-04-30T15:13:22.000Z | 2017-01-19T00:26:34.000Z | import psycopg2
from .queries import ALL_RESIDENTIAL_FIRES, RESIDENTIAL_FIRES_BY_FDID_STATE_HAZARD
from psycopg2.extras import DictCursor
class Backend(object):
"""
Backend mixin that should be used to implement APIs to read data.
"""
def connect(self):
"""
Connect to the backend.
... | 26.401786 | 112 | 0.620561 | import psycopg2
from .queries import ALL_RESIDENTIAL_FIRES, RESIDENTIAL_FIRES_BY_FDID_STATE_HAZARD
from psycopg2.extras import DictCursor
class Backend(object):
"""
Backend mixin that should be used to implement APIs to read data.
"""
def connect(self):
"""
Connect to the backend.
... | 1,649 | 0 | 243 |
75fa7f1f4b459809c4fe9c021ab8b1be2dbea216 | 9,404 | py | Python | src/hyperad/contents.py | huykingsofm/hyperad | f0de456a9d9550492263b134fad612fa8954f1f3 | [
"MIT"
] | null | null | null | src/hyperad/contents.py | huykingsofm/hyperad | f0de456a9d9550492263b134fad612fa8954f1f3 | [
"MIT"
] | null | null | null | src/hyperad/contents.py | huykingsofm/hyperad | f0de456a9d9550492263b134fad612fa8954f1f3 | [
"MIT"
] | null | null | null | import io
import os
import abc
import mimetypes
from json import dumps as jsondumps
from typing import Any, Dict, Iterable, List, Optional, Union
from hyperad.constants import (
CONTENT_TYPE, CONTENT_DISPOSITION,
APPLICATION_JSON, MULTIPART_FORM_DATA, TEXT_PLAIN,
APPLICATION_X_WWW_FORM_URLENCODED, APPLICAT... | 30.237942 | 79 | 0.579647 | import io
import os
import abc
import mimetypes
from json import dumps as jsondumps
from typing import Any, Dict, Iterable, List, Optional, Union
from hyperad.constants import (
CONTENT_TYPE, CONTENT_DISPOSITION,
APPLICATION_JSON, MULTIPART_FORM_DATA, TEXT_PLAIN,
APPLICATION_X_WWW_FORM_URLENCODED, APPLICAT... | 5,226 | 0 | 545 |
544bf537de2cb45094c403f8ac2839fa63362728 | 590 | py | Python | doc/src/harmonic/Programs/p1plot.py | Shield94/Physics321 | 9875a3bf840b0fa164b865a3cb13073aff9094ca | [
"CC0-1.0"
] | 20 | 2020-01-09T17:41:16.000Z | 2022-03-09T00:48:58.000Z | doc/src/harmonic/Programs/p1plot.py | Shield94/Physics321 | 9875a3bf840b0fa164b865a3cb13073aff9094ca | [
"CC0-1.0"
] | 6 | 2020-01-08T03:47:53.000Z | 2020-12-15T15:02:57.000Z | doc/src/harmonic/Programs/p1plot.py | Shield94/Physics321 | 9875a3bf840b0fa164b865a3cb13073aff9094ca | [
"CC0-1.0"
] | 33 | 2020-01-10T20:40:55.000Z | 2022-02-11T20:28:41.000Z | # Common imports
import numpy as np
import pandas as pd
from math import *
import matplotlib.pyplot as plt
Deltax = 0.01
#set up arrays
xinitial = -5.0
xfinal = 5.0
n = ceil((xfinal-xinitial)/Deltax)
x = np.zeros(n)
for i in range(n):
x[i] = xinitial+i*Deltax
V = np.zeros(n)
# Initial conditions as compact 2-dim... | 17.352941 | 52 | 0.659322 | # Common imports
import numpy as np
import pandas as pd
from math import *
import matplotlib.pyplot as plt
Deltax = 0.01
#set up arrays
xinitial = -5.0
xfinal = 5.0
n = ceil((xfinal-xinitial)/Deltax)
x = np.zeros(n)
for i in range(n):
x[i] = xinitial+i*Deltax
V = np.zeros(n)
# Initial conditions as compact 2-dim... | 0 | 0 | 0 |
808ddbc1ca80591d7d979f4448e9dc357298467a | 8,180 | py | Python | tests/test_cache.py | linkyndy/freon | d8bbfc0c0e53d082426faefc392a99c0074aa990 | [
"MIT"
] | 1 | 2020-05-17T09:09:03.000Z | 2020-05-17T09:09:03.000Z | tests/test_cache.py | linkyndy/freon | d8bbfc0c0e53d082426faefc392a99c0074aa990 | [
"MIT"
] | 1 | 2019-06-02T10:10:13.000Z | 2019-06-02T10:10:13.000Z | tests/test_cache.py | linkyndy/freon | d8bbfc0c0e53d082426faefc392a99c0074aa990 | [
"MIT"
] | 1 | 2020-05-17T07:12:15.000Z | 2020-05-17T07:12:15.000Z | try:
from unittest import mock
except ImportError:
import mock
from . import BaseTestCase
from freon.cache import Cache
from freon.backends.redis import RedisBackend
from freon.serializers.msgpack import MsgpackSerializer
@mock.patch.object(Cache, 'set')
| 39.516908 | 96 | 0.712714 | try:
from unittest import mock
except ImportError:
import mock
from . import BaseTestCase
from freon.cache import Cache
from freon.backends.redis import RedisBackend
from freon.serializers.msgpack import MsgpackSerializer
class CacheTestCase(BaseTestCase):
def setUp(self):
self.cache = Cache()
... | 6,582 | 131 | 1,191 |
f83d8fb2f22e4e4fb416e8955b98fde400ff2ba7 | 799 | py | Python | source/commons/environment.py | julio9246/hg-poker-api | 56805601bc26bf8bb80e05235ae22a59a174af09 | [
"Apache-2.0"
] | null | null | null | source/commons/environment.py | julio9246/hg-poker-api | 56805601bc26bf8bb80e05235ae22a59a174af09 | [
"Apache-2.0"
] | null | null | null | source/commons/environment.py | julio9246/hg-poker-api | 56805601bc26bf8bb80e05235ae22a59a174af09 | [
"Apache-2.0"
] | null | null | null | import os
APPLICATION_DEBUG = os.environ.get('APPLICATION_DEBUG', True)
APPLICATION_HOST = os.environ.get('APPLICATION_HOST', '0.0.0.0')
APPLICATION_PORT = os.environ.get('APPLICATION_PORT', 5000)
AWS_REGION = os.environ.get('AWS_REGION', 'us-east-1')
DATABASE_HOST = os.environ.get('DATABASE_HOST', 'hgpoker.c13gml6m... | 47 | 99 | 0.779725 | import os
APPLICATION_DEBUG = os.environ.get('APPLICATION_DEBUG', True)
APPLICATION_HOST = os.environ.get('APPLICATION_HOST', '0.0.0.0')
APPLICATION_PORT = os.environ.get('APPLICATION_PORT', 5000)
AWS_REGION = os.environ.get('AWS_REGION', 'us-east-1')
DATABASE_HOST = os.environ.get('DATABASE_HOST', 'hgpoker.c13gml6m... | 0 | 0 | 0 |
ca09ac72005c0005acb7e05fa46cf59f9c7364db | 1,507 | py | Python | portutil.py | Epistoteles/Modergator | fef4a17fbe0c848600b60e893c9b826cd07ce563 | [
"MIT"
] | 1 | 2021-08-22T00:19:08.000Z | 2021-08-22T00:19:08.000Z | portutil.py | epistoteles/Modergator | fef4a17fbe0c848600b60e893c9b826cd07ce563 | [
"MIT"
] | null | null | null | portutil.py | epistoteles/Modergator | fef4a17fbe0c848600b60e893c9b826cd07ce563 | [
"MIT"
] | 1 | 2021-08-22T00:19:11.000Z | 2021-08-22T00:19:11.000Z | import random
import subprocess
import pickle
| 33.488889 | 104 | 0.603849 | import random
import subprocess
import pickle
def get_unused_port(name):
port_suggestion = 0
netstat_output = ':0'
while f"{':'}{port_suggestion}" in str(netstat_output):
port_suggestion = random.randint(1000, 60000)
netstat_output, _ = subprocess.Popen(['netstat', '-lat'],
... | 1,366 | 0 | 92 |
546ffb6b7151bc82ed6e85afe3a5ce8babc0960a | 231 | py | Python | math-and-algorithm/015.py | silphire/training-with-books | bd07f7376996828b6cb4000d654cdc5f53d1c589 | [
"MIT"
] | null | null | null | math-and-algorithm/015.py | silphire/training-with-books | bd07f7376996828b6cb4000d654cdc5f53d1c589 | [
"MIT"
] | 4 | 2020-01-04T14:05:45.000Z | 2020-01-19T14:53:03.000Z | math-and-algorithm/015.py | silphire/training-with-books | bd07f7376996828b6cb4000d654cdc5f53d1c589 | [
"MIT"
] | null | null | null | # https://atcoder.jp/contests/math-and-algorithm/tasks/math_and_algorithm_o
a, b = map(int, input().split())
a, b = max(a, b), min(a, b)
while b > 0:
if a > b:
a, b = b, a % b
else:
a, b = b % a, a
print(a) | 23.1 | 75 | 0.536797 | # https://atcoder.jp/contests/math-and-algorithm/tasks/math_and_algorithm_o
a, b = map(int, input().split())
a, b = max(a, b), min(a, b)
while b > 0:
if a > b:
a, b = b, a % b
else:
a, b = b % a, a
print(a) | 0 | 0 | 0 |
16134b52b06ba3893dd34ead991a3bbda761e6bd | 6,415 | py | Python | test_demo/test.py | ymli39/ACEnet-for-Neuroanatomy-Segmentation | 6b3f59ece3f6bf04753b8ac78a6e0cf4d927f90b | [
"MIT"
] | 16 | 2020-02-21T15:35:47.000Z | 2022-02-17T09:08:30.000Z | test_demo/test.py | ymli39/ACEnet-for-Neuroanatomy-Segmentation | 6b3f59ece3f6bf04753b8ac78a6e0cf4d927f90b | [
"MIT"
] | 4 | 2021-06-13T13:53:09.000Z | 2021-07-30T02:38:01.000Z | test_demo/test.py | ymli39/ACEnet-for-Neuroanatomy-Segmentation | 6b3f59ece3f6bf04753b8ac78a6e0cf4d927f90b | [
"MIT"
] | 2 | 2021-06-29T00:19:57.000Z | 2022-01-04T07:01:03.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: Yuemeng Li
"""
from backbone import Backbone
import torch
import argparse
import os
import numpy as np
from torch.utils.data import DataLoader
from tqdm import tqdm
from torch.nn import DataParallel
import nibabel as nib
import pdb
#######run command#######... | 37.95858 | 171 | 0.577553 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: Yuemeng Li
"""
from backbone import Backbone
import torch
import argparse
import os
import numpy as np
from torch.utils.data import DataLoader
from tqdm import tqdm
from torch.nn import DataParallel
import nibabel as nib
import pdb
#######run command#######... | 5,750 | -6 | 107 |
a9d7da95d3c11bcacfb51db7bb4dd4b42dbb6edd | 11,456 | py | Python | cfc_app/legiscan_api.py | ephyle/Legit-Info | 7f3845563a64299aa64e4fdba75949276ed9a711 | [
"BSD-2-Clause",
"CC-BY-4.0",
"Apache-2.0"
] | 44 | 2020-10-19T13:06:10.000Z | 2022-01-23T10:56:31.000Z | cfc_app/legiscan_api.py | ephyle/Legit-Info | 7f3845563a64299aa64e4fdba75949276ed9a711 | [
"BSD-2-Clause",
"CC-BY-4.0",
"Apache-2.0"
] | 111 | 2020-10-20T22:12:58.000Z | 2022-03-28T00:25:13.000Z | cfc_app/legiscan_api.py | ephyle/Legit-Info | 7f3845563a64299aa64e4fdba75949276ed9a711 | [
"BSD-2-Clause",
"CC-BY-4.0",
"Apache-2.0"
] | 31 | 2021-02-08T22:32:37.000Z | 2022-03-11T10:57:29.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
# LegiscanAPI.py -- Pull data from Legiscan.com API
# By Uchechukwu Uboh and Tony Pearson, IBM, 202
#
# LegiscanAPI class automates the retrival and curation of bill data for a
# particular US state. Before running this class, your Legiscan.com apikey
# needs to be an ... | 37.933775 | 79 | 0.577339 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
# LegiscanAPI.py -- Pull data from Legiscan.com API
# By Uchechukwu Uboh and Tony Pearson, IBM, 202
#
# LegiscanAPI class automates the retrival and curation of bill data for a
# particular US state. Before running this class, your Legiscan.com apikey
# needs to be an ... | 353 | 0 | 27 |
be69d3e2004b89d66440902deba64e21d5e2d189 | 706 | py | Python | app/models/base.py | Luca-A-Magalhaes/himcd | 56c939bb077485adb8a75b37bf0655e1087bbfa4 | [
"MIT"
] | 2 | 2021-02-15T21:02:12.000Z | 2021-10-14T19:05:34.000Z | app/models/base.py | Luca-A-Magalhaes/himcd | 56c939bb077485adb8a75b37bf0655e1087bbfa4 | [
"MIT"
] | null | null | null | app/models/base.py | Luca-A-Magalhaes/himcd | 56c939bb077485adb8a75b37bf0655e1087bbfa4 | [
"MIT"
] | null | null | null | from flask import jsonify
from app import db
from datetime import datetime
from sqlalchemy import Column, Integer, DateTime, String, Boolean, Text | 27.153846 | 71 | 0.630312 | from flask import jsonify
from app import db
from datetime import datetime
from sqlalchemy import Column, Integer, DateTime, String, Boolean, Text
class Base(db.Model):
__abstract__ = True
id = Column(Integer, primary_key=True)
created_at = Column(DateTime, default=datetime.utcnow)
def save(self, comm... | 330 | 207 | 23 |
0750c61416b4988b208fa6de0bc198d85c47ad49 | 17,662 | py | Python | databricks/koalas/tests/test_indexing.py | manuzhang/koalas | 6d242edcf920233448d7be9a491595dbb3c58cb6 | [
"Apache-2.0"
] | 2 | 2020-01-13T14:40:37.000Z | 2020-03-13T20:59:08.000Z | databricks/koalas/tests/test_indexing.py | bogdanghit/koalas | b1e9033691cce74236382c23010c1ef4b1572f0e | [
"Apache-2.0"
] | null | null | null | databricks/koalas/tests/test_indexing.py | bogdanghit/koalas | b1e9033691cce74236382c23010c1ef4b1572f0e | [
"Apache-2.0"
] | 1 | 2019-12-31T16:38:32.000Z | 2019-12-31T16:38:32.000Z | #
# Copyright (C) 2019 Databricks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 41.952494 | 100 | 0.544163 | #
# Copyright (C) 2019 Databricks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 15,484 | 1,007 | 46 |
04c0f4a82986e04ce4ffab231bc208f979f99bca | 1,825 | py | Python | code/gifs-filter/c3d-models/train.py | raingo/TGIF-Release | 3e54d2f71418d8a2e9f5f61aa5be0edb9c0ac2b8 | [
"BSD-3-Clause"
] | 94 | 2016-04-07T15:07:13.000Z | 2022-02-25T07:19:57.000Z | code/gifs-filter/c3d-models/train.py | raingo/TGIF-Release | 3e54d2f71418d8a2e9f5f61aa5be0edb9c0ac2b8 | [
"BSD-3-Clause"
] | 9 | 2016-08-22T15:35:27.000Z | 2020-10-13T15:48:52.000Z | code/gifs-filter/c3d-models/train.py | raingo/TGIF-Release | 3e54d2f71418d8a2e9f5f61aa5be0edb9c0ac2b8 | [
"BSD-3-Clause"
] | 22 | 2016-04-07T15:39:57.000Z | 2022-03-04T08:04:47.000Z | #!/usr/bin/env python
"""
Python source code - replace this with a description of the code and write the code below this text.
"""
import os.path as osp
from sklearn import grid_search
from sklearn.ensemble import RandomForestClassifier
from sklearn import metrics
from sklearn.cross_validation import StratifiedKFold... | 26.071429 | 191 | 0.664658 | #!/usr/bin/env python
"""
Python source code - replace this with a description of the code and write the code below this text.
"""
import os.path as osp
from sklearn import grid_search
from sklearn.ensemble import RandomForestClassifier
from sklearn import metrics
from sklearn.cross_validation import StratifiedKFold... | 1,317 | 0 | 92 |
8acf7db52f991b13a6ffcaf21bf61c0336798336 | 9,213 | py | Python | scripts/ci/pre_commit/pre_commit_check_setup_extra_packages_ref.py | jkugiya/airflow | 1dfbb8d2031cb8a3e95e4bf91aa478857c5c3a85 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 3 | 2021-07-30T16:46:46.000Z | 2021-10-19T07:18:47.000Z | scripts/ci/pre_commit/pre_commit_check_setup_extra_packages_ref.py | jkugiya/airflow | 1dfbb8d2031cb8a3e95e4bf91aa478857c5c3a85 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 210 | 2021-07-17T00:25:52.000Z | 2021-12-29T00:44:48.000Z | scripts/ci/pre_commit/pre_commit_check_setup_extra_packages_ref.py | jkugiya/airflow | 1dfbb8d2031cb8a3e95e4bf91aa478857c5c3a85 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 2 | 2021-04-14T11:15:17.000Z | 2021-12-15T16:58:24.000Z | #!/usr/bin/env python
#
# 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
# "... | 35.848249 | 102 | 0.717356 | #!/usr/bin/env python
#
# 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
# "... | 171 | 0 | 23 |
d0efef840cef8d2b5fdd42cca170975704865cec | 3,419 | py | Python | tests/test_queue.py | jeancochrane/karaoke-party | 4290d4541fd210a6530e179e17220f3356f1e77e | [
"MIT"
] | null | null | null | tests/test_queue.py | jeancochrane/karaoke-party | 4290d4541fd210a6530e179e17220f3356f1e77e | [
"MIT"
] | 1 | 2018-02-27T02:29:49.000Z | 2018-02-27T03:11:17.000Z | tests/test_queue.py | jeancochrane/karaoke-party | 4290d4541fd210a6530e179e17220f3356f1e77e | [
"MIT"
] | null | null | null | from unittest import TestCase
import psycopg2 as pg
import psycopg2.extensions as pg_extensions
import tests.env
import karaoke
from karaoke.queue import Queue
from karaoke.exceptions import QueueError
from tests.conftest import KaraokeTestCase
class TestQueue(KaraokeTestCase):
'''
Test some methods of the ... | 28.256198 | 82 | 0.611582 | from unittest import TestCase
import psycopg2 as pg
import psycopg2.extensions as pg_extensions
import tests.env
import karaoke
from karaoke.queue import Queue
from karaoke.exceptions import QueueError
from tests.conftest import KaraokeTestCase
class TestQueue(KaraokeTestCase):
'''
Test some methods of the ... | 1,487 | 0 | 162 |
f00c8279de3ad9ca8cc305d62c3b23b069617356 | 4,011 | py | Python | my_code/plot_results.py | ilyakava/kaggle-dr | a025ab992b35b2680249d84bc631d63306f2d431 | [
"MIT"
] | 56 | 2015-07-28T04:57:46.000Z | 2021-06-23T02:56:20.000Z | my_code/plot_results.py | MissZhou666/kaggle-dr | a025ab992b35b2680249d84bc631d63306f2d431 | [
"MIT"
] | 2 | 2015-07-30T12:34:40.000Z | 2016-03-30T12:25:29.000Z | my_code/plot_results.py | MissZhou666/kaggle-dr | a025ab992b35b2680249d84bc631d63306f2d431 | [
"MIT"
] | 20 | 2015-07-28T05:03:13.000Z | 2019-04-25T08:52:52.000Z | import sys
import cPickle
import numpy
import matplotlib.pyplot as plt
import argparse
import pdb
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument("-f",
"--result-file",
type=str,
default=None)
parser.... | 41.78125 | 127 | 0.636749 | import sys
import cPickle
import numpy
import matplotlib.pyplot as plt
import argparse
import pdb
def plot_results(result_file, max_epoch, include_training_variance):
result_file_id = result_file.split('-')[0].split('/')[-1]
f = open(result_file)
historical_train_losses, historical_val_losses, historical_... | 3,275 | 0 | 23 |
d5f9acc5dc85c187806173357e4b6049068939aa | 494 | py | Python | backend/components/models.py | VilhelmPrytz/pong-online | d90d2cd8b1ee38972b36f6f5152588cb8c73e386 | [
"MIT"
] | null | null | null | backend/components/models.py | VilhelmPrytz/pong-online | d90d2cd8b1ee38972b36f6f5152588cb8c73e386 | [
"MIT"
] | null | null | null | backend/components/models.py | VilhelmPrytz/pong-online | d90d2cd8b1ee38972b36f6f5152588cb8c73e386 | [
"MIT"
] | null | null | null | # pong-online
# https://github.com/VilhelmPrytz/pong-online
# Copyright (C) Vilhelm Prytz 2019
from components.tools import random_string
# 1 - waiting for opponent to join
# 2 - in game
| 20.583333 | 50 | 0.6417 | # pong-online
# https://github.com/VilhelmPrytz/pong-online
# Copyright (C) Vilhelm Prytz 2019
from components.tools import random_string
# 1 - waiting for opponent to join
# 2 - in game
class Game:
def __init__(self):
self.p1_pos = 0
self.p2_pos = 0
self.p1_key = random_string(length=50... | 265 | -10 | 49 |
415d145766ab4dedf431022b54fe379823c64f40 | 182 | py | Python | version_check.py | git-ning/byte-of-python | 6b231667c6df30b009ac525276106cc0d9c839ce | [
"Apache-2.0"
] | 1 | 2017-08-23T02:18:29.000Z | 2017-08-23T02:18:29.000Z | version_check.py | git-ning/byte-of-python | 6b231667c6df30b009ac525276106cc0d9c839ce | [
"Apache-2.0"
] | null | null | null | version_check.py | git-ning/byte-of-python | 6b231667c6df30b009ac525276106cc0d9c839ce | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
import sys, warnings
if sys.version_info[0] < 3:
warnings.warn('Need Python 3.0 for this program to run', RuntimeWarning)
else:
print('Procees as normal') | 22.75 | 76 | 0.708791 | #!/usr/bin/python
import sys, warnings
if sys.version_info[0] < 3:
warnings.warn('Need Python 3.0 for this program to run', RuntimeWarning)
else:
print('Procees as normal') | 0 | 0 | 0 |
73f38655df36e25050a698b31a47ea632f87308b | 547 | py | Python | custom/icds/utils/data_pull.py | satyaakam/commcare-hq | 233f255ff20ab3a16013e9fdfdb9c1dcf632e415 | [
"BSD-3-Clause"
] | 1 | 2020-07-14T13:00:23.000Z | 2020-07-14T13:00:23.000Z | custom/icds/utils/data_pull.py | satyaakam/commcare-hq | 233f255ff20ab3a16013e9fdfdb9c1dcf632e415 | [
"BSD-3-Clause"
] | 1 | 2021-06-02T04:45:16.000Z | 2021-06-02T04:45:16.000Z | custom/icds/utils/data_pull.py | satyaakam/commcare-hq | 233f255ff20ab3a16013e9fdfdb9c1dcf632e415 | [
"BSD-3-Clause"
] | null | null | null | from datetime import datetime
from django.core.cache import cache
from custom.icds.const import (
DATA_PULL_CACHE_KEY,
DATA_PULL_PERMITTED_END_HOUR,
DATA_PULL_PERMITTED_START_HOUR,
)
from custom.icds_reports.const import INDIA_TIMEZONE
| 24.863636 | 55 | 0.780622 | from datetime import datetime
from django.core.cache import cache
from custom.icds.const import (
DATA_PULL_CACHE_KEY,
DATA_PULL_PERMITTED_END_HOUR,
DATA_PULL_PERMITTED_START_HOUR,
)
from custom.icds_reports.const import INDIA_TIMEZONE
def data_pull_is_in_progress():
return cache.get(DATA_PULL_CACHE_... | 250 | 0 | 46 |
b37d1c410788dc1e471824b9a7c765c37bbadd34 | 69 | py | Python | Exercicios/test.py | jotmar/PythonEx | bf026518ae5479d5c99ff7a4e95fc383dec22d36 | [
"MIT"
] | null | null | null | Exercicios/test.py | jotmar/PythonEx | bf026518ae5479d5c99ff7a4e95fc383dec22d36 | [
"MIT"
] | null | null | null | Exercicios/test.py | jotmar/PythonEx | bf026518ae5479d5c99ff7a4e95fc383dec22d36 | [
"MIT"
] | null | null | null | from datetime import date, datetime
print(str(datetime.today())[:4])
| 23 | 35 | 0.753623 | from datetime import date, datetime
print(str(datetime.today())[:4])
| 0 | 0 | 0 |
f0447c0cdbf4bc25eb65c3b05213081608f80569 | 4,084 | py | Python | cenv_tool/schemata.py | oozut/cenv_tool | a02977dc80a54c0045785ad97284fde0b9248aff | [
"MIT"
] | null | null | null | cenv_tool/schemata.py | oozut/cenv_tool | a02977dc80a54c0045785ad97284fde0b9248aff | [
"MIT"
] | null | null | null | cenv_tool/schemata.py | oozut/cenv_tool | a02977dc80a54c0045785ad97284fde0b9248aff | [
"MIT"
] | 1 | 2020-10-01T22:08:17.000Z | 2020-10-01T22:08:17.000Z | # -*- coding: utf-8 -*-
"""Contain schemata required by cenv-tool."""
from marshmallow import fields
from marshmallow import Schema
from marshmallow import validate
class SNPackage(Schema):
"""Contain the ``package``-section inside a ``meta.yaml``."""
name = fields.String(strict=True, required=True)
vers... | 29.171429 | 78 | 0.62904 | # -*- coding: utf-8 -*-
"""Contain schemata required by cenv-tool."""
from marshmallow import fields
from marshmallow import Schema
from marshmallow import validate
class SNPackage(Schema):
"""Contain the ``package``-section inside a ``meta.yaml``."""
name = fields.String(strict=True, required=True)
vers... | 0 | 493 | 23 |
796175de618944a446bb86f22f27908e06003134 | 1,111 | py | Python | Xana/SaxsAna/find_center.py | ClLov/Xana | 83d880432a457cff0f1fab2801e2530ddecb4019 | [
"MIT"
] | null | null | null | Xana/SaxsAna/find_center.py | ClLov/Xana | 83d880432a457cff0f1fab2801e2530ddecb4019 | [
"MIT"
] | null | null | null | Xana/SaxsAna/find_center.py | ClLov/Xana | 83d880432a457cff0f1fab2801e2530ddecb4019 | [
"MIT"
] | null | null | null | import numpy as np
from matplotlib import pyplot as plt
from lmfit.models import GaussianModel as gauss_mod
from lmfit.models import VoigtModel as voigt_mod
from lmfit.models import LinearModel as lin_mod
| 30.027027 | 66 | 0.573357 | import numpy as np
from matplotlib import pyplot as plt
from lmfit.models import GaussianModel as gauss_mod
from lmfit.models import VoigtModel as voigt_mod
from lmfit.models import LinearModel as lin_mod
def find_center(img, mask=None, doplot=False, fit_report=False):
mod = voigt_mod() + lin_mod()
if mas... | 883 | 0 | 23 |
3475a3835d34b20910fc7c5cc3289b8e260584d4 | 3,954 | py | Python | vocabquiz-autogen/main.py | jkcw/vocabquiz-autogen | 2242534d8142308dc8d5f318eb06b983df46e546 | [
"MIT"
] | 1 | 2021-08-21T05:00:34.000Z | 2021-08-21T05:00:34.000Z | vocabquiz-autogen/main.py | jkcw/vocabquiz-autogen | 2242534d8142308dc8d5f318eb06b983df46e546 | [
"MIT"
] | null | null | null | vocabquiz-autogen/main.py | jkcw/vocabquiz-autogen | 2242534d8142308dc8d5f318eb06b983df46e546 | [
"MIT"
] | null | null | null | import requests
import json
import random
from . import secretKey
print(secret_key)
# TODO: get some of questions only, not all.
# TODO: present tense, verbs with "s"
# TODO: full stop of each sentence
# TODO: will print the error msg out "error:rm_answer_to_blank"
# TODO: quality of the dictionary is too low
# Loa... | 27.84507 | 116 | 0.620637 | import requests
import json
import random
from . import secretKey
print(secret_key)
# TODO: get some of questions only, not all.
# TODO: present tense, verbs with "s"
# TODO: full stop of each sentence
# TODO: will print the error msg out "error:rm_answer_to_blank"
# TODO: quality of the dictionary is too low
# Loa... | 2,353 | 71 | 280 |
a10094fe76dba801777a5fd274be9cca1ac53ad5 | 13,716 | py | Python | Evaluation/frame_prediction_BG.py | arpane4c5/ActivityNet | 31a0972bb7461107e24d2be4fb76bf168382016f | [
"MIT"
] | 13 | 2017-07-31T22:00:34.000Z | 2020-03-19T01:40:57.000Z | Evaluation/frame_prediction_BG.py | zhangxgu/ActivityNet-1 | 31a0972bb7461107e24d2be4fb76bf168382016f | [
"MIT"
] | 1 | 2018-05-25T02:31:04.000Z | 2018-05-28T07:20:32.000Z | Evaluation/frame_prediction_BG.py | zhangxgu/ActivityNet-1 | 31a0972bb7461107e24d2be4fb76bf168382016f | [
"MIT"
] | 6 | 2017-08-19T01:45:47.000Z | 2020-11-23T12:05:26.000Z | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Mon Jul 3 14:49:28 2017
@author: Arpan
Description: Use c3d trained model for prediction. To be executed after
training_model_m4.py
"""
import json
import os
import utils
import numpy as np
import h5py
import pandas as pd
import collections
import cv2
im... | 41.563636 | 146 | 0.651502 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Mon Jul 3 14:49:28 2017
@author: Arpan
Description: Use c3d trained model for prediction. To be executed after
training_model_m4.py
"""
import json
import os
import utils
import numpy as np
import h5py
import pandas as pd
import collections
import cv2
im... | 2,748 | 0 | 69 |
c363fa928990a80be5a5204729d760da5a3c9cb3 | 2,335 | py | Python | arc_tool/arc_tool.py | joe--cool/woodworking | 1fd54702c8e752b1e111554fe419065c7c5e0225 | [
"MIT"
] | null | null | null | arc_tool/arc_tool.py | joe--cool/woodworking | 1fd54702c8e752b1e111554fe419065c7c5e0225 | [
"MIT"
] | null | null | null | arc_tool/arc_tool.py | joe--cool/woodworking | 1fd54702c8e752b1e111554fe419065c7c5e0225 | [
"MIT"
] | null | null | null | import argparse
from fractions import Fraction
import math
import numpy as np
import pandas as pd
from tabulate import tabulate
# Formatting function
#def format_fraction(val):
# f = Fraction(val)
# return '{:>5} {:>3} /{:>3}'.format(, f.numerator, f.denominator)
# Parse command line
parser = argparse.Argument... | 46.7 | 161 | 0.652677 | import argparse
from fractions import Fraction
import math
import numpy as np
import pandas as pd
from tabulate import tabulate
# Formatting function
#def format_fraction(val):
# f = Fraction(val)
# return '{:>5} {:>3} /{:>3}'.format(, f.numerator, f.denominator)
# Parse command line
parser = argparse.Argument... | 0 | 0 | 0 |
ee6d798cc2dcd7d17001dee8af0cee52840957a7 | 2,654 | py | Python | introduction/02_QueryParameters.py | IBM/api-samples | d69f7a7b74244012e835f023bceec2b0370be586 | [
"Apache-2.0"
] | 172 | 2015-02-18T21:18:31.000Z | 2022-03-13T17:51:11.000Z | introduction/02_QueryParameters.py | IBM/api-samples | d69f7a7b74244012e835f023bceec2b0370be586 | [
"Apache-2.0"
] | 15 | 2015-03-06T15:30:33.000Z | 2021-03-05T09:20:34.000Z | introduction/02_QueryParameters.py | IBM/api-samples | d69f7a7b74244012e835f023bceec2b0370be586 | [
"Apache-2.0"
] | 77 | 2015-03-06T13:14:06.000Z | 2022-02-14T15:35:58.000Z | #!/usr/bin/env python3
# This sample demonstrates how to use query parameters with a REST API
# endpoint.
# For a list of the endpoints that you can use along with the parameters that
# they accept you can view the REST API interactive help page on your
# deployment at https://<hostname>/api_doc
# You can also retriev... | 39.61194 | 79 | 0.720422 | #!/usr/bin/env python3
# This sample demonstrates how to use query parameters with a REST API
# endpoint.
# For a list of the endpoints that you can use along with the parameters that
# they accept you can view the REST API interactive help page on your
# deployment at https://<hostname>/api_doc
# You can also retriev... | 1,955 | 0 | 23 |
e405eb400288c9f8521071196f3827f3622495fc | 47 | py | Python | passwordConfig.py | jarivankaam/spambot-Python | b1bd47c7481e52a900a89c8ad92b969272cfe2c3 | [
"MIT"
] | 2 | 2022-02-27T07:15:30.000Z | 2022-03-15T18:27:12.000Z | passwordConfig.py | jarivankaam/spambot-Python | b1bd47c7481e52a900a89c8ad92b969272cfe2c3 | [
"MIT"
] | null | null | null | passwordConfig.py | jarivankaam/spambot-Python | b1bd47c7481e52a900a89c8ad92b969272cfe2c3 | [
"MIT"
] | null | null | null | password = {
"password": ""#password here
} | 15.666667 | 32 | 0.595745 | password = {
"password": ""#password here
} | 0 | 0 | 0 |
fd06c7333d4e62e3dfd574a686746e934124a2eb | 3,090 | py | Python | fifth_semester/Wbudowane/lab5.py | MajronMan/agh_stuff | d045e3bd47ac17880526203d9993d9b2389a9ffe | [
"Unlicense"
] | 2 | 2019-03-02T19:31:57.000Z | 2019-04-03T19:54:39.000Z | fifth_semester/Wbudowane/lab5.py | MajronMan/agh_stuff | d045e3bd47ac17880526203d9993d9b2389a9ffe | [
"Unlicense"
] | null | null | null | fifth_semester/Wbudowane/lab5.py | MajronMan/agh_stuff | d045e3bd47ac17880526203d9993d9b2389a9ffe | [
"Unlicense"
] | 1 | 2019-04-03T18:26:50.000Z | 2019-04-03T18:26:50.000Z | from typing import List, Tuple, Optional
import numpy as np
g = Graph([
[0, 1, 1, 0, 1],
[0, 0, 0, 0, 0],
[0, 0, 0, 1, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0]
])
print(g.BFS())
| 22.888889 | 73 | 0.486408 | from typing import List, Tuple, Optional
import numpy as np
def rmse(x: List[float], y: List[float]) -> float:
r = 0
for (a, b) in zip(x, y):
r += (a - b) ** 2
return r
def lin_reg(data: List[Tuple[float, float]]) -> Tuple[float, float]:
d = np.array(data)
m = d.shape[0]
p = np.sum(d... | 2,346 | 107 | 436 |
08acdf3c412cefa6cf27ac195df4e06a7d9e30d4 | 256 | py | Python | tapis_cli/commands/taccapis/v2/apps/init/templates.py | bpachev/tapis-cli | c3128fb5b63ef74e06b737bbd95ef28fb24f0d32 | [
"BSD-3-Clause"
] | 8 | 2020-10-18T22:48:23.000Z | 2022-01-10T09:16:14.000Z | tapis_cli/commands/taccapis/v2/apps/init/templates.py | bpachev/tapis-cli | c3128fb5b63ef74e06b737bbd95ef28fb24f0d32 | [
"BSD-3-Clause"
] | 238 | 2019-09-04T14:37:54.000Z | 2020-04-15T16:24:24.000Z | tapis_cli/commands/taccapis/v2/apps/init/templates.py | bpachev/tapis-cli | c3128fb5b63ef74e06b737bbd95ef28fb24f0d32 | [
"BSD-3-Clause"
] | 5 | 2019-09-20T04:23:49.000Z | 2020-01-16T17:45:14.000Z | """Provides key, name, description, and location for
cookiecutter apps templates
"""
__all__ = ['COOKIECUTTER_URI', 'DIRECTORY', 'CHECKOUT']
COOKIECUTTER_URI = 'https://github.com/TACC-Cloud/cc-tapis-v2-app.git'
DIRECTORY = 'default'
CHECKOUT = 'master'
| 25.6 | 70 | 0.738281 | """Provides key, name, description, and location for
cookiecutter apps templates
"""
__all__ = ['COOKIECUTTER_URI', 'DIRECTORY', 'CHECKOUT']
COOKIECUTTER_URI = 'https://github.com/TACC-Cloud/cc-tapis-v2-app.git'
DIRECTORY = 'default'
CHECKOUT = 'master'
| 0 | 0 | 0 |
ab0d9c97270d7743ca9f1adeb401249fd9546ca6 | 3,610 | py | Python | gaussian_processes/GPy_1_0_5/inference/latent_function_inference/__init__.py | highlandenergy/no-covid-19-climate-silver-lining-in-the-us-power-sector | 1568db61f4cfd5d1aa3ffc65ce594ad8fe5e3893 | [
"MIT"
] | null | null | null | gaussian_processes/GPy_1_0_5/inference/latent_function_inference/__init__.py | highlandenergy/no-covid-19-climate-silver-lining-in-the-us-power-sector | 1568db61f4cfd5d1aa3ffc65ce594ad8fe5e3893 | [
"MIT"
] | null | null | null | gaussian_processes/GPy_1_0_5/inference/latent_function_inference/__init__.py | highlandenergy/no-covid-19-climate-silver-lining-in-the-us-power-sector | 1568db61f4cfd5d1aa3ffc65ce594ad8fe5e3893 | [
"MIT"
] | null | null | null | # Copyright (c) 2012-2014, Max Zwiessele, James Hensman
# Licensed under the BSD 3-clause license (see LICENSE.txt)
__doc__ = """
Inference over Gaussian process latent functions
In all our GP models, the consistency propery means that we have a Gaussian
prior over a finite set of points f. This prior is
math:: N(... | 34.711538 | 93 | 0.710249 | # Copyright (c) 2012-2014, Max Zwiessele, James Hensman
# Licensed under the BSD 3-clause license (see LICENSE.txt)
__doc__ = """
Inference over Gaussian process latent functions
In all our GP models, the consistency propery means that we have a Gaussian
prior over a finite set of points f. This prior is
math:: N(... | 309 | 354 | 154 |
2980400d27dab31f8bad6ff0f84d71599b28e696 | 974 | py | Python | examples/src/dbnd_examples/dbnd_spark/pyspark_scripts/cut_salad.py | ipattarapong/dbnd | 7bd65621c46c73e078eb628f994127ad4c7dbd1a | [
"Apache-2.0"
] | 224 | 2020-01-02T10:46:37.000Z | 2022-03-02T13:54:08.000Z | examples/src/dbnd_examples/dbnd_spark/pyspark_scripts/cut_salad.py | ipattarapong/dbnd | 7bd65621c46c73e078eb628f994127ad4c7dbd1a | [
"Apache-2.0"
] | 16 | 2020-03-11T09:37:58.000Z | 2022-01-26T10:22:08.000Z | examples/src/dbnd_examples/dbnd_spark/pyspark_scripts/cut_salad.py | ipattarapong/dbnd | 7bd65621c46c73e078eb628f994127ad4c7dbd1a | [
"Apache-2.0"
] | 24 | 2020-03-24T13:53:50.000Z | 2022-03-22T11:55:18.000Z | import datetime
import logging
import sys
from random import shuffle
logger = logging.getLogger(__name__)
if __name__ == "__main__":
run_spark(sys.argv)
| 22.651163 | 83 | 0.666324 | import datetime
import logging
import sys
from random import shuffle
logger = logging.getLogger(__name__)
def run_spark(args):
from pyspark.sql import SparkSession
from pyspark.sql.types import StringType, StructField, StructType
timestamp = str(datetime.datetime.now()).replace(" ", "_")
spark = ... | 788 | 0 | 23 |
c0d20264002e298c5688c6b4c6c8412f17e36445 | 665 | py | Python | tests/base_tests/vector_tests/test_hash.py | lycantropos/gon | b3f811ece5989d1623b17d633a84071fbff6dd69 | [
"MIT"
] | 10 | 2020-07-18T12:55:52.000Z | 2022-03-20T07:09:10.000Z | tests/base_tests/vector_tests/test_hash.py | lycantropos/gon | b3f811ece5989d1623b17d633a84071fbff6dd69 | [
"MIT"
] | 52 | 2019-07-11T16:59:01.000Z | 2022-03-29T19:41:59.000Z | tests/base_tests/vector_tests/test_hash.py | lycantropos/gon | b3f811ece5989d1623b17d633a84071fbff6dd69 | [
"MIT"
] | 1 | 2020-03-22T12:56:07.000Z | 2020-03-22T12:56:07.000Z | from typing import Tuple
from hypothesis import given
from gon.base import Vector
from tests.utils import implication
from . import strategies
@given(strategies.vectors)
@given(strategies.vectors)
@given(strategies.vectors_pairs)
| 22.166667 | 69 | 0.706767 | from typing import Tuple
from hypothesis import given
from gon.base import Vector
from tests.utils import implication
from . import strategies
@given(strategies.vectors)
def test_basic(vector: Vector) -> None:
result = hash(vector)
assert isinstance(result, int)
@given(strategies.vectors)
def test_determ... | 361 | 0 | 66 |
ce74564e71956b24721fb93832bb798ca28d1093 | 1,719 | py | Python | ghostwriter/rolodex/migrations/0008_projectscope.py | bbhunter/Ghostwriter | 1b684ddd119feed9891e83b39c9b314b41d086ca | [
"BSD-3-Clause"
] | 601 | 2019-07-30T17:06:37.000Z | 2022-03-31T00:55:31.000Z | ghostwriter/rolodex/migrations/0008_projectscope.py | chrismaddalena/Ghostwriter | 5a938358450cd0e69a42883b1b18e067644744a8 | [
"BSD-3-Clause"
] | 150 | 2019-08-01T07:20:22.000Z | 2022-03-29T19:18:02.000Z | ghostwriter/rolodex/migrations/0008_projectscope.py | chrismaddalena/Ghostwriter | 5a938358450cd0e69a42883b1b18e067644744a8 | [
"BSD-3-Clause"
] | 126 | 2019-07-30T17:42:49.000Z | 2022-03-21T20:43:35.000Z | # Generated by Django 3.0.10 on 2021-01-22 22:02
from django.db import migrations, models
import django.db.models.deletion
| 53.71875 | 213 | 0.643979 | # Generated by Django 3.0.10 on 2021-01-22 22:02
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('rolodex', '0007_auto_20201027_1914'),
]
operations = [
migrations.CreateModel(
name='ProjectSc... | 0 | 1,571 | 23 |
21c58e28067f9673c8b4ddaba9798e3d5af0df10 | 1,184 | py | Python | tbonlineproject/archive/urls.py | nathangeffen/tbonline3 | 1b8a3af8d2dc1ee8083ca6638d025e94bd98f253 | [
"MIT"
] | null | null | null | tbonlineproject/archive/urls.py | nathangeffen/tbonline3 | 1b8a3af8d2dc1ee8083ca6638d025e94bd98f253 | [
"MIT"
] | 3 | 2021-06-08T23:57:13.000Z | 2022-01-13T03:42:01.000Z | tbonlineproject/archive/urls.py | nathangeffen/tbonline-2 | 0d5869197e66a0057fa07cb99f21dde7f5b47c30 | [
"MIT"
] | null | null | null | from django.conf.urls.defaults import *
from django.views.generic import DetailView, ListView
from archive.models import Catalogue, Document
urlpatterns = patterns('archive.views',
url(r'^$',
ListView.as_view(
context_object_name="catalogues",
queryset=Catalogu... | 34.823529 | 86 | 0.569257 | from django.conf.urls.defaults import *
from django.views.generic import DetailView, ListView
from archive.models import Catalogue, Document
urlpatterns = patterns('archive.views',
url(r'^$',
ListView.as_view(
context_object_name="catalogues",
queryset=Catalogu... | 0 | 0 | 0 |
a53ea13c9e8f16859fa4193aab2acfef32eda2ed | 506 | py | Python | main.py | MustafaTheCoder/Spam-Detector | 5e3545adbfe6ac1a6729c5cf769d463f01b77e17 | [
"MIT"
] | null | null | null | main.py | MustafaTheCoder/Spam-Detector | 5e3545adbfe6ac1a6729c5cf769d463f01b77e17 | [
"MIT"
] | null | null | null | main.py | MustafaTheCoder/Spam-Detector | 5e3545adbfe6ac1a6729c5cf769d463f01b77e17 | [
"MIT"
] | null | null | null | text = input("Text: ")
spam = False
if("make money fast"):
spam = True
print("Spam Detected!")
elif("subscribe this"):
spam = True
print("Spam Detected!")
elif("buy now"):
spam = True
print("Spam Detected!")
elif("purchase now"):
spam = True
print("Spam Detected!")
elif(... | 20.24 | 33 | 0.559289 | text = input("Text: ")
spam = False
if("make money fast"):
spam = True
print("Spam Detected!")
elif("subscribe this"):
spam = True
print("Spam Detected!")
elif("buy now"):
spam = True
print("Spam Detected!")
elif("purchase now"):
spam = True
print("Spam Detected!")
elif(... | 0 | 0 | 0 |
41c261c39d724212ea8e551fc7ba36bebd70a398 | 367 | py | Python | ex032.py | dsjocimar/python | 5716f46a9fa7f64aa78a39df9c262c5392571340 | [
"MIT"
] | null | null | null | ex032.py | dsjocimar/python | 5716f46a9fa7f64aa78a39df9c262c5392571340 | [
"MIT"
] | null | null | null | ex032.py | dsjocimar/python | 5716f46a9fa7f64aa78a39df9c262c5392571340 | [
"MIT"
] | null | null | null | # Exercício 032
from datetime import date
ano = int(input('Digite um ano qualquer. Digite 0 para analisar o ano ATUAL '))
if ano == 0:
ano = date.today().year
if ano % 4 == 0 and ano % 100 != 0 or ano % 400 == 0:
print(f'O ano de \033[1m{ano}\033[m \033[1;32mé BISSEXTO!\033[m')
else:
print(f'O Ano de \033... | 30.583333 | 79 | 0.637602 | # Exercício 032
from datetime import date
ano = int(input('Digite um ano qualquer. Digite 0 para analisar o ano ATUAL '))
if ano == 0:
ano = date.today().year
if ano % 4 == 0 and ano % 100 != 0 or ano % 400 == 0:
print(f'O ano de \033[1m{ano}\033[m \033[1;32mé BISSEXTO!\033[m')
else:
print(f'O Ano de \033... | 0 | 0 | 0 |