hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | 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 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f714e47b106eac676e74b6b6d55a7dccf1215a4c | 8,482 | py | Python | datasets/wikitext/wikitext.py | WojciechKusa/datasets | 1406a04c3e911cec2680d8bc513653e0cafcaaa4 | [
"Apache-2.0"
] | 10,608 | 2020-09-10T15:47:50.000Z | 2022-03-31T22:51:47.000Z | datasets/wikitext/wikitext.py | WojciechKusa/datasets | 1406a04c3e911cec2680d8bc513653e0cafcaaa4 | [
"Apache-2.0"
] | 2,396 | 2020-09-10T14:55:31.000Z | 2022-03-31T19:41:04.000Z | datasets/wikitext/wikitext.py | WojciechKusa/datasets | 1406a04c3e911cec2680d8bc513653e0cafcaaa4 | [
"Apache-2.0"
] | 1,530 | 2020-09-10T21:43:10.000Z | 2022-03-31T01:59:12.000Z | """TODO(wikitext): Add a description here."""
import os
import datasets
_CITATION = """\
@misc{merity2016pointer,
title={Pointer Sentinel Mixture Models},
author={Stephen Merity and Caiming Xiong and James Bradbury and Richard Socher},
year={2016},
eprint={1609.07843},
archivePrefix={... | 43.948187 | 119 | 0.524051 |
import os
import datasets
_CITATION = """\
@misc{merity2016pointer,
title={Pointer Sentinel Mixture Models},
author={Stephen Merity and Caiming Xiong and James Bradbury and Richard Socher},
year={2016},
eprint={1609.07843},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
"""
_DES... | true | true |
f714e500f25c13cb0f457c6b3760cad8137b7541 | 52,413 | py | Python | gen_models/PixelVAE/cifarinterpolation1_filter_3_mean_beta_largesample.py | leilayasmeen/MSc_Thesis | ee5e1782ab4a1d86c5dc0f5dc4111b4432ae204d | [
"MIT"
] | 2 | 2019-10-29T03:26:20.000Z | 2021-03-07T10:02:39.000Z | gen_models/PixelVAE/cifarinterpolation1_filter_3_mean_beta_largesample.py | leilayasmeen/MSc_Thesis | ee5e1782ab4a1d86c5dc0f5dc4111b4432ae204d | [
"MIT"
] | null | null | null | gen_models/PixelVAE/cifarinterpolation1_filter_3_mean_beta_largesample.py | leilayasmeen/MSc_Thesis | ee5e1782ab4a1d86c5dc0f5dc4111b4432ae204d | [
"MIT"
] | null | null | null |
"""
PixelVAE: A Latent Variable Model for Natural Images
Ishaan Gulrajani, Kundan Kumar, Faruk Ahmed, Adrien Ali Taiga, Francesco Visin, David Vazquez, Aaron Courville
"""
import os, sys
sys.path.append(os.getcwd())
N_GPUS = 2
import random
import tflib as lib
import tflib.sampling_loop_cifar_filter_3
import tflib.... | 48.530556 | 202 | 0.609791 |
"""
PixelVAE: A Latent Variable Model for Natural Images
Ishaan Gulrajani, Kundan Kumar, Faruk Ahmed, Adrien Ali Taiga, Francesco Visin, David Vazquez, Aaron Courville
"""
import os, sys
sys.path.append(os.getcwd())
N_GPUS = 2
import random
import tflib as lib
import tflib.sampling_loop_cifar_filter_3
import tflib.... | false | true |
f714e52d70d6ddff64b9a0a585c2e4068c9397b7 | 48,390 | py | Python | wagtail/api/v2/tests/test_pages.py | sir-sigurd/wagtail | 18dd01a4cc7f7c51680400d7f39f80d661c4b1d5 | [
"BSD-3-Clause"
] | 1 | 2021-08-14T13:47:33.000Z | 2021-08-14T13:47:33.000Z | wagtail/api/v2/tests/test_pages.py | denza/wagtail | 3939397850f2c73d3f960cea5cc9c2cfae2d005d | [
"BSD-3-Clause"
] | 2 | 2021-03-10T14:04:08.000Z | 2021-05-08T21:24:46.000Z | wagtail/api/v2/tests/test_pages.py | denza/wagtail | 3939397850f2c73d3f960cea5cc9c2cfae2d005d | [
"BSD-3-Clause"
] | null | null | null | import collections
import json
import mock
from django.test import TestCase
from django.test.utils import override_settings
from django.urls import reverse
from wagtail.api.v2 import signal_handlers
from wagtail.core.models import Page, Site
from wagtail.tests.demosite import models
from wagtail.tests.testapp.models ... | 42.410167 | 172 | 0.666171 | import collections
import json
import mock
from django.test import TestCase
from django.test.utils import override_settings
from django.urls import reverse
from wagtail.api.v2 import signal_handlers
from wagtail.core.models import Page, Site
from wagtail.tests.demosite import models
from wagtail.tests.testapp.models ... | true | true |
f714e5ccca4b369e0fbd09fb0a4e6218788b9ed7 | 3,513 | py | Python | google_or_tools/coloring_ip_sat.py | tias/hakank | 87b7f180c9393afce440864eb9e5fb119bdec1a4 | [
"MIT"
] | 279 | 2015-01-10T09:55:35.000Z | 2022-03-28T02:34:03.000Z | google_or_tools/coloring_ip_sat.py | tias/hakank | 87b7f180c9393afce440864eb9e5fb119bdec1a4 | [
"MIT"
] | 10 | 2017-10-05T15:48:50.000Z | 2021-09-20T12:06:52.000Z | google_or_tools/coloring_ip_sat.py | tias/hakank | 87b7f180c9393afce440864eb9e5fb119bdec1a4 | [
"MIT"
] | 83 | 2015-01-20T03:44:00.000Z | 2022-03-13T23:53:06.000Z | # Copyright 2021 Hakan Kjellerstrand hakank@gmail.com
#
# 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 ... | 27.232558 | 78 | 0.63507 | from __future__ import print_function
from ortools.sat.python import cp_model as cp
import math, sys
def main():
model = cp.CpModel()
nc = 5
n = 11
V = list(range(n))
num_edges = 20
E = [[1, 2], [1, 4], [1, 7], [1, 9], [2, 3], [2, 6], [2, 8], [3, 5], [3, 7],
[3, 10], [4, ... | true | true |
f714e6ac55f4e95ed142d9f2bf5143a5d4edabf6 | 1,179 | py | Python | utils/summaries.py | lzhmarkk/pytorch-deeplab-xception | 63f699214e4095a4edda21173012cc29e53125b3 | [
"MIT"
] | 2,766 | 2018-06-15T11:30:06.000Z | 2022-03-30T08:22:29.000Z | utils/summaries.py | lzhmarkk/pytorch-deeplab-xception | 63f699214e4095a4edda21173012cc29e53125b3 | [
"MIT"
] | 211 | 2018-06-29T07:02:02.000Z | 2022-03-25T03:38:19.000Z | utils/summaries.py | lzhmarkk/pytorch-deeplab-xception | 63f699214e4095a4edda21173012cc29e53125b3 | [
"MIT"
] | 867 | 2018-07-03T10:09:34.000Z | 2022-03-31T09:52:40.000Z | import os
import torch
from torchvision.utils import make_grid
from tensorboardX import SummaryWriter
from dataloaders.utils import decode_seg_map_sequence
class TensorboardSummary(object):
def __init__(self, directory):
self.directory = directory
def create_summary(self):
writer = SummaryWrit... | 51.26087 | 108 | 0.659033 | import os
import torch
from torchvision.utils import make_grid
from tensorboardX import SummaryWriter
from dataloaders.utils import decode_seg_map_sequence
class TensorboardSummary(object):
def __init__(self, directory):
self.directory = directory
def create_summary(self):
writer = SummaryWrit... | true | true |
f714e7fafd9de41aaacfbf8d84f6f21e60c66856 | 3,410 | py | Python | app/__init__.py | brandiqa/microblog-pytest | 652429fb440dc9e9f912b8376d3587641ab14348 | [
"MIT"
] | null | null | null | app/__init__.py | brandiqa/microblog-pytest | 652429fb440dc9e9f912b8376d3587641ab14348 | [
"MIT"
] | 1 | 2021-06-02T00:35:14.000Z | 2021-06-02T00:35:14.000Z | app/__init__.py | brandiqa/microblog-pytest | 652429fb440dc9e9f912b8376d3587641ab14348 | [
"MIT"
] | null | null | null | import logging
from logging.handlers import SMTPHandler, RotatingFileHandler
import os
from flask import Flask, request, current_app
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_login import LoginManager
from flask_mail import Mail
from flask_bootstrap import Bootstrap
from flask... | 32.788462 | 79 | 0.660411 | import logging
from logging.handlers import SMTPHandler, RotatingFileHandler
import os
from flask import Flask, request, current_app
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_login import LoginManager
from flask_mail import Mail
from flask_bootstrap import Bootstrap
from flask... | true | true |
f714e80b7cf0f0a4bbd27f451d6c99bb727e414c | 863 | py | Python | Ninja/Leetcode/88_Merge_Sorted_Array.py | cyandterry/Python-Study | b40e6c4db10da417e72247f61146f7570621106a | [
"MIT"
] | 61 | 2015-02-03T20:25:55.000Z | 2021-05-17T19:33:40.000Z | Ninja/Leetcode/88_Merge_Sorted_Array.py | cyandterry/Python-Study | b40e6c4db10da417e72247f61146f7570621106a | [
"MIT"
] | null | null | null | Ninja/Leetcode/88_Merge_Sorted_Array.py | cyandterry/Python-Study | b40e6c4db10da417e72247f61146f7570621106a | [
"MIT"
] | 37 | 2015-02-04T07:12:52.000Z | 2020-05-16T18:47:16.000Z | """
Given two sorted integer arrays A and B, merge B into A as one sorted array.
Note:
You may assume that A has enough space (size that is greater or equal to m + n) to hold additional elements from B. The number of elements initialized in A and B are m and n respectively.
"""
class Solution:
# @param A a list ... | 27.83871 | 187 | 0.479722 |
class Solution:
def merge(self, A, m, B, n):
i = m - 1
j = n - 1
x = m + n - 1
while i>=0 and j>=0:
if A[i] > B[j]:
A[x] = A[i]
i -= 1
else:
A[x] = B[j]
j -= 1
x -... | true | true |
f714e82ca1013c68e6fdf12798491074bf08099a | 13,720 | py | Python | jirafs/migrations.py | mcepl/jirafs | abe18222b8bbfb23877d176bab966809556a9637 | [
"MIT"
] | null | null | null | jirafs/migrations.py | mcepl/jirafs | abe18222b8bbfb23877d176bab966809556a9637 | [
"MIT"
] | null | null | null | jirafs/migrations.py | mcepl/jirafs | abe18222b8bbfb23877d176bab966809556a9637 | [
"MIT"
] | null | null | null | import json
import os
import shutil
import subprocess
from six.moves.urllib import parse
from . import utils
from .exceptions import GitCommandError
def set_repo_version(repo, version):
with open(repo.get_metadata_path('version'), 'w') as out:
out.write(str(version))
repo.run_git_command(
'a... | 26.537718 | 79 | 0.571574 | import json
import os
import shutil
import subprocess
from six.moves.urllib import parse
from . import utils
from .exceptions import GitCommandError
def set_repo_version(repo, version):
with open(repo.get_metadata_path('version'), 'w') as out:
out.write(str(version))
repo.run_git_command(
'a... | true | true |
f714e83d2f50d6b29bdbd9adf5eabbbb4ba0812e | 6,187 | py | Python | Compiler/ppc.py | fqliao/MP-SPDZ | 070fca5c52ee225fe681f16f150f5fb1a7b4b3ca | [
"BSD-2-Clause"
] | null | null | null | Compiler/ppc.py | fqliao/MP-SPDZ | 070fca5c52ee225fe681f16f150f5fb1a7b4b3ca | [
"BSD-2-Clause"
] | null | null | null | Compiler/ppc.py | fqliao/MP-SPDZ | 070fca5c52ee225fe681f16f150f5fb1a7b4b3ca | [
"BSD-2-Clause"
] | null | null | null | import util
import math
from Compiler.types import Array, sint, sfloat, sfix, MemValue, cint, Matrix, _int
# import operator
# import math
# from Compiler.instructions import *
from Compiler.library import for_range, print_str, for_range, print_float_prec
import ml
pint = sint
pfloat = sfloat
pfix = sfix
pnum = pflo... | 27.255507 | 84 | 0.659286 | import util
import math
from Compiler.types import Array, sint, sfloat, sfix, MemValue, cint, Matrix, _int
from Compiler.library import for_range, print_str, for_range, print_float_prec
import ml
pint = sint
pfloat = sfloat
pfix = sfix
pnum = pfloat
print_float_prec(4)
MAX_DATA_LENGTH = 500
MAX_ML_SIZE = 500
ppcC... | true | true |
f714e8841d230fa94120f748f64ae122d1b782d6 | 17,326 | py | Python | dscript/commands/train.py | samsledje/D-SCRIPT | 3fa7ea685f7fcdc63468380267d1672f63bb8772 | [
"MIT"
] | 12 | 2020-11-15T11:36:27.000Z | 2022-03-14T13:30:35.000Z | dscript/commands/train.py | samsledje/D-SCRIPT | 3fa7ea685f7fcdc63468380267d1672f63bb8772 | [
"MIT"
] | 27 | 2020-12-01T02:38:55.000Z | 2022-02-25T19:08:18.000Z | dscript/commands/train.py | samsledje/D-SCRIPT | 3fa7ea685f7fcdc63468380267d1672f63bb8772 | [
"MIT"
] | 6 | 2021-07-05T23:16:56.000Z | 2022-03-30T03:29:12.000Z | """
Train a new model.
"""
import sys
import argparse
import h5py
import datetime
import subprocess as sp
import numpy as np
import pandas as pd
import gzip as gz
from tqdm import tqdm
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.autograd import Variable
fr... | 31.387681 | 140 | 0.609546 |
import sys
import argparse
import h5py
import datetime
import subprocess as sp
import numpy as np
import pandas as pd
import gzip as gz
from tqdm import tqdm
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.autograd import Variable
from torch.utils.data import ... | true | true |
f714e944300f9dc8d4448ae55e5b7c4d463b66f6 | 667 | py | Python | setup.py | ameya98/roc2pr | ab19d7552e2e9ae32ca00a1be4a17b29a3f915fa | [
"MIT"
] | 1 | 2020-09-08T14:51:48.000Z | 2020-09-08T14:51:48.000Z | setup.py | ameya98/pr2roc | ab19d7552e2e9ae32ca00a1be4a17b29a3f915fa | [
"MIT"
] | null | null | null | setup.py | ameya98/pr2roc | ab19d7552e2e9ae32ca00a1be4a17b29a3f915fa | [
"MIT"
] | null | null | null | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="pr2roc",
version="0.0.1",
author="Ameya Daigavane",
author_email="ameya.d.98@gmail.com",
description="A package to resample precision-recall curves correctly.",
long_description=long_d... | 30.318182 | 75 | 0.667166 | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="pr2roc",
version="0.0.1",
author="Ameya Daigavane",
author_email="ameya.d.98@gmail.com",
description="A package to resample precision-recall curves correctly.",
long_description=long_d... | true | true |
f714eaabcfc91716d629e476a3730ed8f6d6ff30 | 2,766 | py | Python | core/converter/coordinate_converter.py | tringuyenminh23/chronos | cf20e65ca81b7cd2f3000383e870902b421fe3b0 | [
"MIT"
] | null | null | null | core/converter/coordinate_converter.py | tringuyenminh23/chronos | cf20e65ca81b7cd2f3000383e870902b421fe3b0 | [
"MIT"
] | null | null | null | core/converter/coordinate_converter.py | tringuyenminh23/chronos | cf20e65ca81b7cd2f3000383e870902b421fe3b0 | [
"MIT"
] | null | null | null | import requests
from abc import ABC, abstractmethod
from typing import Tuple, List
import json
class CoordinateConverter(ABC):
def __init__(self):
super().__init__()
@abstractmethod
def convert_coordinate(self, coordinate: Tuple, base_system_code, target_system_code):
pass
@abstractm... | 39.514286 | 108 | 0.630875 | import requests
from abc import ABC, abstractmethod
from typing import Tuple, List
import json
class CoordinateConverter(ABC):
def __init__(self):
super().__init__()
@abstractmethod
def convert_coordinate(self, coordinate: Tuple, base_system_code, target_system_code):
pass
@abstractm... | true | true |
f714ec32dd2c3ee61a6b4c3f6009a99ad349e191 | 314 | py | Python | day4/1.py | bujiie/adventofcode2015 | 40d04b078bf9ebd90a544e4259c65cb77de36928 | [
"MIT"
] | null | null | null | day4/1.py | bujiie/adventofcode2015 | 40d04b078bf9ebd90a544e4259c65cb77de36928 | [
"MIT"
] | null | null | null | day4/1.py | bujiie/adventofcode2015 | 40d04b078bf9ebd90a544e4259c65cb77de36928 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import fileinput
import hashlib
hash = None
with fileinput.input() as fp:
hash = fp.readline().strip()
res = None
i = 0
zeros = 5
while True:
s = f'{hash}{str(i)}'
h = hashlib.md5(s.encode())
res = h.hexdigest()
if res.startswith('0'*zeros):
break;
i += 1
print(i)
print(res)
| 12.56 | 30 | 0.636943 |
import fileinput
import hashlib
hash = None
with fileinput.input() as fp:
hash = fp.readline().strip()
res = None
i = 0
zeros = 5
while True:
s = f'{hash}{str(i)}'
h = hashlib.md5(s.encode())
res = h.hexdigest()
if res.startswith('0'*zeros):
break;
i += 1
print(i)
print(res)
| true | true |
f714edb5b8db1159d14893789256eff798138f9d | 17,348 | py | Python | thespian/test/test_deadLettering.py | dendron2000/Thespian | 0acbc5a0803f6d2be3421ea6eb08c6beecbf3802 | [
"MIT"
] | 210 | 2015-08-31T19:39:34.000Z | 2020-01-10T08:07:48.000Z | thespian/test/test_deadLettering.py | dendron2000/Thespian | 0acbc5a0803f6d2be3421ea6eb08c6beecbf3802 | [
"MIT"
] | 85 | 2017-04-08T19:28:42.000Z | 2022-03-23T15:25:49.000Z | thespian/test/test_deadLettering.py | dendron2000/Thespian | 0acbc5a0803f6d2be3421ea6eb08c6beecbf3802 | [
"MIT"
] | 47 | 2015-09-01T19:24:20.000Z | 2020-01-02T20:03:05.000Z | """Verify DeadLetter handling behavior.
Current behavior is that an Actor may register for DeadLetter
handling. If it is registered, any message sent to an Actor that is
no longer present will be redirected to the register DeadLetter actor
(in its original form).
On exit of the DeadLetter handling Actor, the system ... | 37.227468 | 94 | 0.640016 |
import time
from thespian.actors import *
from thespian.test import *
from datetime import timedelta
ASK_WAIT = timedelta(seconds=15)
dead_routing_wait = lambda: inTestDelay(timedelta(milliseconds=125))
actor_exit_wait = lambda: inTestDelay(timedelta(milliseconds=50))
actor_create_wait = lambda: inTestDelay(timedel... | true | true |
f714edba273ac98faf971ba9c109eee8aee8bd86 | 2,833 | py | Python | z2/part2/batch/jm/parser_errors_2/366414300.py | kozakusek/ipp-2020-testy | 09aa008fa53d159672cc7cbf969a6b237e15a7b8 | [
"MIT"
] | 1 | 2020-04-16T12:13:47.000Z | 2020-04-16T12:13:47.000Z | z2/part2/batch/jm/parser_errors_2/366414300.py | kozakusek/ipp-2020-testy | 09aa008fa53d159672cc7cbf969a6b237e15a7b8 | [
"MIT"
] | 18 | 2020-03-06T17:50:15.000Z | 2020-05-19T14:58:30.000Z | z2/part2/batch/jm/parser_errors_2/366414300.py | kozakusek/ipp-2020-testy | 09aa008fa53d159672cc7cbf969a6b237e15a7b8 | [
"MIT"
] | 18 | 2020-03-06T17:45:13.000Z | 2020-06-09T19:18:31.000Z | from part1 import (
gamma_board,
gamma_busy_fields,
gamma_delete,
gamma_free_fields,
gamma_golden_move,
gamma_golden_possible,
gamma_move,
gamma_new,
)
"""
scenario: test_random_actions
uuid: 366414300
"""
"""
random actions, total chaos
"""
board = gamma_new(5, 4, 4, 1)
assert board is... | 30.462366 | 44 | 0.650547 | from part1 import (
gamma_board,
gamma_busy_fields,
gamma_delete,
gamma_free_fields,
gamma_golden_move,
gamma_golden_possible,
gamma_move,
gamma_new,
)
board = gamma_new(5, 4, 4, 1)
assert board is not None
assert gamma_move(board, 1, 2, 0) == 1
assert gamma_free_fields(board, 1) == ... | true | true |
f714edba6f5e54b2903a01e66bac1da132698edc | 1,773 | py | Python | examples/part_c.py | Viasat/salabim_plus | f68b207a469648f75cafdb9a3a0e3f772ad9b08a | [
"MIT"
] | 3 | 2020-07-12T16:18:08.000Z | 2022-03-31T20:29:51.000Z | examples/part_c.py | JackNelson/salabim_plus | f68b207a469648f75cafdb9a3a0e3f772ad9b08a | [
"MIT"
] | null | null | null | examples/part_c.py | JackNelson/salabim_plus | f68b207a469648f75cafdb9a3a0e3f772ad9b08a | [
"MIT"
] | 1 | 2020-06-12T20:19:45.000Z | 2020-06-12T20:19:45.000Z | import misc_tools
import random
def create_routing(env, first_step='op1'):
tasks = {
'op1': misc_tools.make_assembly_step(
env=env,
run_time=random.gauss(mu=12, sigma=0.5),
route_to='op2'),
'op2': {
'location': env['machine_3'],
'worker... | 29.55 | 68 | 0.478849 | import misc_tools
import random
def create_routing(env, first_step='op1'):
tasks = {
'op1': misc_tools.make_assembly_step(
env=env,
run_time=random.gauss(mu=12, sigma=0.5),
route_to='op2'),
'op2': {
'location': env['machine_3'],
'worker... | true | true |
f714edde1080126efd87ebb2e29ea0002cb76a78 | 122 | py | Python | irnl_rdt_correction/__main__.py | pylhc/irnl_rdt_correction | 7360728ffaa66b0c9f7b4825c241a3949df18962 | [
"MIT"
] | null | null | null | irnl_rdt_correction/__main__.py | pylhc/irnl_rdt_correction | 7360728ffaa66b0c9f7b4825c241a3949df18962 | [
"MIT"
] | null | null | null | irnl_rdt_correction/__main__.py | pylhc/irnl_rdt_correction | 7360728ffaa66b0c9f7b4825c241a3949df18962 | [
"MIT"
] | null | null | null | from irnl_rdt_correction.irnl_rdt_correction import main, log_setup
if __name__ == '__main__':
log_setup()
main() | 24.4 | 67 | 0.754098 | from irnl_rdt_correction.irnl_rdt_correction import main, log_setup
if __name__ == '__main__':
log_setup()
main() | true | true |
f714eea8b200ced2a6fd1482b2234ba9eb5303f0 | 27 | py | Python | reolink_baichuan/camera_api.py | xannor/reolink_baichuan | 390f469d19eb4308cd390ed2357705aa4fe7fb38 | [
"MIT"
] | 1 | 2021-08-13T16:14:32.000Z | 2021-08-13T16:14:32.000Z | reolink_baichuan/camera_api.py | xannor/reolink_baichuan | 390f469d19eb4308cd390ed2357705aa4fe7fb38 | [
"MIT"
] | null | null | null | reolink_baichuan/camera_api.py | xannor/reolink_baichuan | 390f469d19eb4308cd390ed2357705aa4fe7fb38 | [
"MIT"
] | 1 | 2021-05-15T12:51:34.000Z | 2021-05-15T12:51:34.000Z | """
Reolink Camera API
"""
| 6.75 | 18 | 0.592593 | true | true | |
f714ef557ca4ceb8492ccb8cd834a8c222a15a93 | 6,909 | py | Python | test.py | spk921/RTFNet | 4dad2a63e13e9c302da45ad5a3af4d85cf474694 | [
"MIT"
] | 1 | 2020-11-04T10:38:33.000Z | 2020-11-04T10:38:33.000Z | test.py | spk921/RTFNet | 4dad2a63e13e9c302da45ad5a3af4d85cf474694 | [
"MIT"
] | null | null | null | test.py | spk921/RTFNet | 4dad2a63e13e9c302da45ad5a3af4d85cf474694 | [
"MIT"
] | 1 | 2021-02-25T03:27:16.000Z | 2021-02-25T03:27:16.000Z | # coding:utf-8
# modified from: https://github.com/haqishen/MFNet-pytorch
# By Yuxiang Sun, Aug. 2, 2019
# Email: sun.yuxiang@outlook.com
import os
import argparse
import time
import datetime
import numpy as np
import sys
import torch
from torch.autograd import Variable
from torch.utils.data import DataLoader
from ut... | 49.35 | 253 | 0.627587 |
import os
import argparse
import time
import datetime
import numpy as np
import sys
import torch
from torch.autograd import Variable
from torch.utils.data import DataLoader
from util.MF_dataset import MF_dataset
from model import RTFNet
from sklearn.metrics import confusion_matrix
n_class = 9
data_dir = './da... | true | true |
f714f0b9624cf9de0c997ff4a2f5217b29268d2c | 5,779 | py | Python | tests/unit/test_validator_cli.py | ajenie/sawtooth-validator | c21436b3abbac4d2ce7cf6a65d9c71ea79d78e98 | [
"Apache-2.0"
] | 4 | 2017-05-22T15:53:29.000Z | 2021-12-03T02:11:30.000Z | tests/unit/test_validator_cli.py | ajenie/sawtooth-validator | c21436b3abbac4d2ce7cf6a65d9c71ea79d78e98 | [
"Apache-2.0"
] | null | null | null | tests/unit/test_validator_cli.py | ajenie/sawtooth-validator | c21436b3abbac4d2ce7cf6a65d9c71ea79d78e98 | [
"Apache-2.0"
] | 2 | 2017-10-16T02:36:34.000Z | 2021-12-03T02:11:19.000Z | # Copyright 2016 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 35.89441 | 80 | 0.59249 |
import os
import unittest
from txnmain.validator_cli import get_configuration
class TestValidatorCLI(unittest.TestCase):
def test_currency_home(self):
os.environ.clear()
os.environ["CURRENCYHOME"] = "/test_path"
cfg = get_configuration(args=[], config_files_required=False)
self... | true | true |
f714f3d1f909cc42bd23a2c7442b97bb0ce95b3a | 13,654 | py | Python | samples/client/petstore/python/petstore_api/model/child_lizard.py | JigarJoshi/openapi-generator | 785535b8d6881b358463994823abbda2b26ff42e | [
"Apache-2.0"
] | 1 | 2022-01-03T04:40:07.000Z | 2022-01-03T04:40:07.000Z | samples/client/petstore/python/petstore_api/model/child_lizard.py | JigarJoshi/openapi-generator | 785535b8d6881b358463994823abbda2b26ff42e | [
"Apache-2.0"
] | 28 | 2021-04-07T07:38:36.000Z | 2022-03-31T03:10:56.000Z | samples/client/petstore/python/petstore_api/model/child_lizard.py | JigarJoshi/openapi-generator | 785535b8d6881b358463994823abbda2b26ff42e | [
"Apache-2.0"
] | 2 | 2021-11-03T10:07:15.000Z | 2021-12-17T13:00:53.000Z | """
OpenAPI Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
import re # noq... | 42.403727 | 174 | 0.581075 |
import re import sys
from petstore_api.model_utils import ( ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_composed_info,
OpenAp... | true | true |
f714f53f337435de514cd32802ebf103c855cc8e | 319 | py | Python | backend/server/go-spider.py | thomas5566/new-django-react-app | 25a1f499de60a35d4cc40a7dca3696e04d92d5dc | [
"MIT"
] | null | null | null | backend/server/go-spider.py | thomas5566/new-django-react-app | 25a1f499de60a35d4cc40a7dca3696e04d92d5dc | [
"MIT"
] | null | null | null | backend/server/go-spider.py | thomas5566/new-django-react-app | 25a1f499de60a35d4cc40a7dca3696e04d92d5dc | [
"MIT"
] | null | null | null | from scrapy.crawler import CrawlerProcess
from scrapy.utils.project import get_project_settings
from botmovies.spiders.ptt import PttMoviesSpider
from botmovies.spiders.yahoo import YahooSpider
process = CrawlerProcess(get_project_settings())
process.crawl(PttMoviesSpider)
process.crawl(YahooSpider)
process.start()
| 29 | 53 | 0.858934 | from scrapy.crawler import CrawlerProcess
from scrapy.utils.project import get_project_settings
from botmovies.spiders.ptt import PttMoviesSpider
from botmovies.spiders.yahoo import YahooSpider
process = CrawlerProcess(get_project_settings())
process.crawl(PttMoviesSpider)
process.crawl(YahooSpider)
process.start()
| true | true |
f714f642a68008e196da074e26144251d4a5f260 | 611 | py | Python | python/network/Foundations-of-Python-Network-Programming/foundations-of-python-network-programming-14/source/chapter18/rpyc_server.py | bosserbosser/codetest | 987563900d912e891b53eeda8e2cf36f3c769430 | [
"Apache-2.0"
] | null | null | null | python/network/Foundations-of-Python-Network-Programming/foundations-of-python-network-programming-14/source/chapter18/rpyc_server.py | bosserbosser/codetest | 987563900d912e891b53eeda8e2cf36f3c769430 | [
"Apache-2.0"
] | null | null | null | python/network/Foundations-of-Python-Network-Programming/foundations-of-python-network-programming-14/source/chapter18/rpyc_server.py | bosserbosser/codetest | 987563900d912e891b53eeda8e2cf36f3c769430 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Foundations of Python Network Programming, Third Edition
# https://github.com/brandon-rhodes/fopnp/blob/m/py3/chapter18/rpyc_server.py
# RPyC server
import rpyc
def main():
from rpyc.utils.server import ThreadedServer
t = ThreadedServer(MyService, port = 18861)
t.start()
class My... | 27.772727 | 77 | 0.702128 |
import rpyc
def main():
from rpyc.utils.server import ThreadedServer
t = ThreadedServer(MyService, port = 18861)
t.start()
class MyService(rpyc.Service):
def exposed_line_counter(self, fileobj, function):
print('Client has invoked exposed_line_counter()')
for linenum, line in enumerat... | true | true |
f714f69a08b35e1b9d65ff1ce11b3bc8d056174d | 531 | py | Python | Task2B.py | henryseal/PartIA-Flood-Warning-System-main | 4110a22b4b4a1b6ac8778aa176ddb1a577d245b1 | [
"MIT"
] | null | null | null | Task2B.py | henryseal/PartIA-Flood-Warning-System-main | 4110a22b4b4a1b6ac8778aa176ddb1a577d245b1 | [
"MIT"
] | null | null | null | Task2B.py | henryseal/PartIA-Flood-Warning-System-main | 4110a22b4b4a1b6ac8778aa176ddb1a577d245b1 | [
"MIT"
] | null | null | null | # Copyright (C) 2018 Garth N. Wells
#
# SPDX-License-Identifier: MIT
from floodsystem.stationdata import build_station_list, update_water_levels
from floodsystem.flood import stations_level_over_threshold
def run():
stations = build_station_list()
update_water_levels(stations)
for station_tuple in stati... | 26.55 | 75 | 0.73258 |
from floodsystem.stationdata import build_station_list, update_water_levels
from floodsystem.flood import stations_level_over_threshold
def run():
stations = build_station_list()
update_water_levels(stations)
for station_tuple in stations_level_over_threshold(stations, 0.8):
print(station_tuple[... | true | true |
f714f6e6db1898081eaba5c2d3937b62899fb8ac | 476 | py | Python | Desafios/Desafio101.py | Felix-xilef/Curso-de-Python | cdff7c7f3850e6326e274c8c1987b9e1a18ce910 | [
"MIT"
] | null | null | null | Desafios/Desafio101.py | Felix-xilef/Curso-de-Python | cdff7c7f3850e6326e274c8c1987b9e1a18ce910 | [
"MIT"
] | null | null | null | Desafios/Desafio101.py | Felix-xilef/Curso-de-Python | cdff7c7f3850e6326e274c8c1987b9e1a18ce910 | [
"MIT"
] | null | null | null | from auxiliar import receberInt
def voto(nasc):
from datetime import date
idade = int(date.today().year) - nasc
if idade < 16:
return f'Com {idade} anos, voto: NEGADO'
elif idade < 18 or idade >= 60:
return f'Com {idade} anos, voto: OPCIONAL'
else:
return f'Com {idade} anos,... | 25.052632 | 55 | 0.655462 | from auxiliar import receberInt
def voto(nasc):
from datetime import date
idade = int(date.today().year) - nasc
if idade < 16:
return f'Com {idade} anos, voto: NEGADO'
elif idade < 18 or idade >= 60:
return f'Com {idade} anos, voto: OPCIONAL'
else:
return f'Com {idade} anos,... | true | true |
f714f71252970ab103635098b3af05715486c851 | 675 | py | Python | examples/argument_group.py | gmerz/ArgTyper | 56e1d60ce2cc8f7d889fb8890ddbe922b85ab9f3 | [
"MIT"
] | 1 | 2021-04-26T19:46:33.000Z | 2021-04-26T19:46:33.000Z | examples/argument_group.py | gmerz/ArgTyper | 56e1d60ce2cc8f7d889fb8890ddbe922b85ab9f3 | [
"MIT"
] | null | null | null | examples/argument_group.py | gmerz/ArgTyper | 56e1d60ce2cc8f7d889fb8890ddbe922b85ab9f3 | [
"MIT"
] | null | null | null | import argtyper
@argtyper.ArgumentGroup(
["firstname", "lastname"],
title="Name details",
description="Give your full name here",
)
@argtyper.ArgumentGroup(
["nickname", "firstname"],
title="Nickname details",
description="Give your Nickname here",
)
@argtyper.Argument(
"amount", "repetiti... | 25.961538 | 85 | 0.662222 | import argtyper
@argtyper.ArgumentGroup(
["firstname", "lastname"],
title="Name details",
description="Give your full name here",
)
@argtyper.ArgumentGroup(
["nickname", "firstname"],
title="Nickname details",
description="Give your Nickname here",
)
@argtyper.Argument(
"amount", "repetiti... | true | true |
f714f92a92fb4764cbd9b8709835322bbc54cf6b | 1,474 | py | Python | tensorflow_datasets/text/__init__.py | MyWhiteCastle/datasets | e75a54948bb8aaf9cf45933a538502d2f66c41a6 | [
"Apache-2.0"
] | 2 | 2019-11-23T18:41:58.000Z | 2020-08-12T21:00:39.000Z | tensorflow_datasets/text/__init__.py | MyWhiteCastle/datasets | e75a54948bb8aaf9cf45933a538502d2f66c41a6 | [
"Apache-2.0"
] | null | null | null | tensorflow_datasets/text/__init__.py | MyWhiteCastle/datasets | e75a54948bb8aaf9cf45933a538502d2f66c41a6 | [
"Apache-2.0"
] | 1 | 2019-12-14T00:32:08.000Z | 2019-12-14T00:32:08.000Z | # coding=utf-8
# Copyright 2019 The TensorFlow Datasets 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 appl... | 44.666667 | 90 | 0.833786 |
from tensorflow_datasets.text.definite_pronoun_resolution import DefinitePronounResolution
from tensorflow_datasets.text.gap import Gap
from tensorflow_datasets.text.glue import Glue
from tensorflow_datasets.text.imdb import IMDBReviews
from tensorflow_datasets.text.imdb import IMDBReviewsConfig
from tensorflow_datas... | true | true |
f714f98147bf1c6b56576249d2a0857054514332 | 5,166 | py | Python | tests/test_development_scripts.py | dmwcode/ntc-templates | 684f45b34e453c5d2a20df2a8769c66555017e22 | [
"Apache-2.0"
] | 817 | 2016-04-27T22:47:59.000Z | 2022-03-29T21:47:37.000Z | tests/test_development_scripts.py | dmwcode/ntc-templates | 684f45b34e453c5d2a20df2a8769c66555017e22 | [
"Apache-2.0"
] | 577 | 2016-05-13T12:41:12.000Z | 2022-03-31T02:42:14.000Z | tests/test_development_scripts.py | dmwcode/ntc-templates | 684f45b34e453c5d2a20df2a8769c66555017e22 | [
"Apache-2.0"
] | 677 | 2016-04-27T22:48:03.000Z | 2022-03-28T16:20:36.000Z | import os
import glob
from copy import deepcopy
import pytest
from ruamel.yaml.compat import StringIO
import development_scripts
@pytest.fixture(scope="module")
def yaml_comments_file():
with open("tests/mocks/load/yaml_comments.yml", encoding="utf-8") as fh:
return development_scripts.YAML_OBJECT.load(... | 33.115385 | 88 | 0.734611 | import os
import glob
from copy import deepcopy
import pytest
from ruamel.yaml.compat import StringIO
import development_scripts
@pytest.fixture(scope="module")
def yaml_comments_file():
with open("tests/mocks/load/yaml_comments.yml", encoding="utf-8") as fh:
return development_scripts.YAML_OBJECT.load(... | true | true |
f714f9af20d505dd8a6b78bf8ee9169697d1f5cd | 8,853 | py | Python | custom_components/xiaomi_miot/light.py | ss109/hass-xiaomi-miot | a69c8e0e44400b9aa0f94f1003d3c6f3de4996fd | [
"Apache-2.0"
] | 1 | 2021-12-10T12:30:34.000Z | 2021-12-10T12:30:34.000Z | custom_components/xiaomi_miot/light.py | ss109/hass-xiaomi-miot | a69c8e0e44400b9aa0f94f1003d3c6f3de4996fd | [
"Apache-2.0"
] | null | null | null | custom_components/xiaomi_miot/light.py | ss109/hass-xiaomi-miot | a69c8e0e44400b9aa0f94f1003d3c6f3de4996fd | [
"Apache-2.0"
] | null | null | null | """Support for Xiaomi lights."""
import logging
from functools import partial
from homeassistant.const import * # noqa: F401
from homeassistant.components.light import (
DOMAIN as ENTITY_DOMAIN,
LightEntity,
SUPPORT_BRIGHTNESS,
SUPPORT_COLOR_TEMP,
SUPPORT_COLOR,
SUPPORT_EFFECT,
ATTR_BRIGHT... | 33.790076 | 112 | 0.656952 | import logging
from functools import partial
from homeassistant.const import * from homeassistant.components.light import (
DOMAIN as ENTITY_DOMAIN,
LightEntity,
SUPPORT_BRIGHTNESS,
SUPPORT_COLOR_TEMP,
SUPPORT_COLOR,
SUPPORT_EFFECT,
ATTR_BRIGHTNESS,
ATTR_COLOR_TEMP,
ATTR_HS_COLOR,
... | true | true |
f714f9e04cfc2c6e3e123f7aa5966dc910128689 | 10,457 | py | Python | tests/test_app/test_result.py | u6052029/cogent3 | ca0efcb7f60b715bcbfbecd924cdb98a53cefe20 | [
"BSD-3-Clause"
] | null | null | null | tests/test_app/test_result.py | u6052029/cogent3 | ca0efcb7f60b715bcbfbecd924cdb98a53cefe20 | [
"BSD-3-Clause"
] | null | null | null | tests/test_app/test_result.py | u6052029/cogent3 | ca0efcb7f60b715bcbfbecd924cdb98a53cefe20 | [
"BSD-3-Clause"
] | null | null | null | from unittest import TestCase, main
from cogent3 import make_aligned_seqs
from cogent3.app import evo as evo_app
from cogent3.app.result import (
generic_result,
model_collection_result,
model_result,
)
from cogent3.util.deserialise import deserialise_object
__author__ = "Gavin Huttley"
__copyright__ = "... | 35.568027 | 83 | 0.609353 | from unittest import TestCase, main
from cogent3 import make_aligned_seqs
from cogent3.app import evo as evo_app
from cogent3.app.result import (
generic_result,
model_collection_result,
model_result,
)
from cogent3.util.deserialise import deserialise_object
__author__ = "Gavin Huttley"
__copyright__ = "... | true | true |
f714fbc79b42edf40142a4ad4bbb7a90e3778f3f | 789 | py | Python | account/views.py | AhteshamSid/College_school_management_system | a8504708ea2f347d18d4ac59198f29d05c0374d2 | [
"MIT"
] | null | null | null | account/views.py | AhteshamSid/College_school_management_system | a8504708ea2f347d18d4ac59198f29d05c0374d2 | [
"MIT"
] | null | null | null | account/views.py | AhteshamSid/College_school_management_system | a8504708ea2f347d18d4ac59198f29d05c0374d2 | [
"MIT"
] | null | null | null | from django.shortcuts import render, redirect
from django.contrib.auth.models import User
from .models import UserProfile
from .forms import ProfileForm
def profile(request, pk):
profile = UserProfile.objects.get(id=pk)
context = {
'profile': profile
}
return render(request, 'accoun... | 29.222222 | 75 | 0.653992 | from django.shortcuts import render, redirect
from django.contrib.auth.models import User
from .models import UserProfile
from .forms import ProfileForm
def profile(request, pk):
profile = UserProfile.objects.get(id=pk)
context = {
'profile': profile
}
return render(request, 'accoun... | true | true |
f714fbdb129a1c7ec713e34c3c33a04f1236e5c5 | 9,949 | py | Python | pyanalyze/test_annotations.py | sobolevn/pyanalyze | f3851db84e57e3ff7f8e2dd271c3b218e2d3bbcc | [
"Apache-2.0"
] | null | null | null | pyanalyze/test_annotations.py | sobolevn/pyanalyze | f3851db84e57e3ff7f8e2dd271c3b218e2d3bbcc | [
"Apache-2.0"
] | null | null | null | pyanalyze/test_annotations.py | sobolevn/pyanalyze | f3851db84e57e3ff7f8e2dd271c3b218e2d3bbcc | [
"Apache-2.0"
] | null | null | null | # static analysis: ignore
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from .test_name_check_visitor import TestNameCheckVisitorBase
from .test_node_visitor import skip_before
from .error_code import ErrorCode
class TestAnnotations(TestNameCheckVisitorB... | 22.976905 | 113 | 0.592924 | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from .test_name_check_visitor import TestNameCheckVisitorBase
from .test_node_visitor import skip_before
from .error_code import ErrorCode
class TestAnnotations(TestNameCheckVisitorBase):
@skip_before((3,... | true | true |
f714fbdff2030a894d929ef9760be334f88cab44 | 556 | py | Python | problem3.py | skandamohan/Euler-Problems | 4f9b54effe325c21c279069dd0a86d1a07ff93ee | [
"MIT"
] | null | null | null | problem3.py | skandamohan/Euler-Problems | 4f9b54effe325c21c279069dd0a86d1a07ff93ee | [
"MIT"
] | null | null | null | problem3.py | skandamohan/Euler-Problems | 4f9b54effe325c21c279069dd0a86d1a07ff93ee | [
"MIT"
] | null | null | null | '''https://projecteuler.net/problem=3'''
'''Please see the README document for details'''
def run(upper_bound):
if(upper_bound%2 == 0):
upper_bound = upper_bound-1
for decrementor in range(upper_bound, 0,-2):
print str(decrementor)+", ",
counter = 2
while(counter < decrementor):
if(decrementor%counter == ... | 27.8 | 77 | 0.678058 | '''https://projecteuler.net/problem=3'''
'''Please see the README document for details'''
def run(upper_bound):
if(upper_bound%2 == 0):
upper_bound = upper_bound-1
for decrementor in range(upper_bound, 0,-2):
print str(decrementor)+", ",
counter = 2
while(counter < decrementor):
if(decrementor%counter == ... | false | true |
f714fc4571882f467493e6f5ded8f4fd81a3114e | 9,403 | py | Python | src/ebay_rest/api/buy_browse/models/payment_method.py | gbm001/ebay_rest | 077d3478423ccd80ff35e0361821d6a11180bc54 | [
"MIT"
] | null | null | null | src/ebay_rest/api/buy_browse/models/payment_method.py | gbm001/ebay_rest | 077d3478423ccd80ff35e0361821d6a11180bc54 | [
"MIT"
] | null | null | null | src/ebay_rest/api/buy_browse/models/payment_method.py | gbm001/ebay_rest | 077d3478423ccd80ff35e0361821d6a11180bc54 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Browse API
<p>The Browse API has the following resources:</p> <ul> <li><b> item_summary: </b> Lets shoppers search for specific items by keyword, GTIN, category, charity, product, or item aspects and refine the results by using filters, such as aspects, compatibility, and fields values.<... | 47.730964 | 2,314 | 0.668829 |
import pprint
import re
import six
class PaymentMethod(object):
swagger_types = {
'payment_instructions': 'list[str]',
'payment_method_brands': 'list[PaymentMethodBrand]',
'payment_method_type': 'str',
'seller_instructions': 'list[str]'
}
attribute_map = {
'paym... | true | true |
f714fc808fcfb6c6731b0e09e82f0d3179f49b65 | 2,971 | py | Python | v1/awsbuild/bao_signal_handler.py | badassops/ops-aws | 2e6b76e62e7b9edaa3ba43ff57df90b75c75aba7 | [
"BSD-3-Clause"
] | 2 | 2019-02-28T06:49:19.000Z | 2019-12-30T09:41:17.000Z | v1/awsbuild/bao_signal_handler.py | badassops/ops-aws | 2e6b76e62e7b9edaa3ba43ff57df90b75c75aba7 | [
"BSD-3-Clause"
] | null | null | null | v1/awsbuild/bao_signal_handler.py | badassops/ops-aws | 2e6b76e62e7b9edaa3ba43ff57df90b75c75aba7 | [
"BSD-3-Clause"
] | null | null | null | # vim:fileencoding=utf-8:noet
""" python method """
# Copyright (c) 2010 - 2019, © Badassops LLC / Luc Suryo
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code... | 43.691176 | 85 | 0.703467 |
import signal
import sys
def signal_handler(signum, frame):
if signum is int(signal.SIGHUP):
print('Received -HUP, app does not support reload. {}'.format(frame))
elif signum is int(signal.SIGINT):
print('Received ctrl-c, aborted on your request. {}'.format(frame))
elif signum is int(sig... | true | true |
f714fd687acb9dcd38aefae007bf9b8459b33ed2 | 2,485 | py | Python | svc/lycanthropy/auth/client.py | kryptops/lycanthropy | 8b18a78e1586b9e5d4d433f307a3dd72d961f4fe | [
"BSD-3-Clause"
] | 11 | 2020-08-14T18:55:17.000Z | 2022-02-18T07:35:12.000Z | svc/lycanthropy/auth/client.py | kryptops/lycanthropy | 8b18a78e1586b9e5d4d433f307a3dd72d961f4fe | [
"BSD-3-Clause"
] | 9 | 2020-08-17T02:26:11.000Z | 2022-02-19T22:59:53.000Z | svc/lycanthropy/auth/client.py | kryptops/lycanthropy | 8b18a78e1586b9e5d4d433f307a3dd72d961f4fe | [
"BSD-3-Clause"
] | 2 | 2020-09-14T15:23:47.000Z | 2022-02-20T03:04:54.000Z | import hashlib
import random
import lycanthropy.sql.interface
import lycanthropy.crypto
import jwt
def decodeToken(token,config):
rawData = jwt.decode(
token,
config['secret'],
algorithms=['HS256']
)
return rawData
def monitoringToken(user,config,remote,identity):
userData = ly... | 26.157895 | 97 | 0.615292 | import hashlib
import random
import lycanthropy.sql.interface
import lycanthropy.crypto
import jwt
def decodeToken(token,config):
rawData = jwt.decode(
token,
config['secret'],
algorithms=['HS256']
)
return rawData
def monitoringToken(user,config,remote,identity):
userData = ly... | true | true |
f714fec78acf88635ae3a5489d89aaa3ac2fe45a | 1,162 | py | Python | app/view/index.py | InnopolisAero/uavcan.org | cef212cdb4fb2c3f672b04780445229607c93eaa | [
"MIT"
] | null | null | null | app/view/index.py | InnopolisAero/uavcan.org | cef212cdb4fb2c3f672b04780445229607c93eaa | [
"MIT"
] | null | null | null | app/view/index.py | InnopolisAero/uavcan.org | cef212cdb4fb2c3f672b04780445229607c93eaa | [
"MIT"
] | null | null | null | #
# Copyright (C) 2019 UAVCAN Development Team <info@zubax.com>.
# Author: Pavel Kirienko <pavel.kirienko@zubax.com>
#
from .. import app
from ..model import devel_feed, forum_feed, adopters
from flask import render_template
FEED_LENGTH = 15
TITLE = 'UAVCAN - a lightweight protocol designed for reliable communicat... | 29.05 | 80 | 0.674699 |
from .. import app
from ..model import devel_feed, forum_feed, adopters
from flask import render_template
FEED_LENGTH = 15
TITLE = 'UAVCAN - a lightweight protocol designed for reliable communication ' \
'in aerospace and robotic applications over robust vehicular networks'
@app.route('/')
def _index():
... | true | true |
f714ffc25bab8da9a862bf45880ff26921b227b0 | 5,358 | py | Python | pynextcaller/tests/test_by_address.py | trezorg/nextcaller-python-api | 452ea9dbd945d8bf1bc2122ac1ffb886346d78cc | [
"MIT"
] | null | null | null | pynextcaller/tests/test_by_address.py | trezorg/nextcaller-python-api | 452ea9dbd945d8bf1bc2122ac1ffb886346d78cc | [
"MIT"
] | null | null | null | pynextcaller/tests/test_by_address.py | trezorg/nextcaller-python-api | 452ea9dbd945d8bf1bc2122ac1ffb886346d78cc | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
import unittest
try:
from unittest import mock
except ImportError:
import mock
try:
from .base import BaseTestCase, BasePlatformTestCase
except (ValueError, ImportError):
from pynextcaller.tests.base import BaseTestCase, BasePlatformTestCase
ADDRESS_JSON_RESULT_... | 31.333333 | 83 | 0.573162 | from __future__ import unicode_literals
import unittest
try:
from unittest import mock
except ImportError:
import mock
try:
from .base import BaseTestCase, BasePlatformTestCase
except (ValueError, ImportError):
from pynextcaller.tests.base import BaseTestCase, BasePlatformTestCase
ADDRESS_JSON_RESULT_... | true | true |
f71501f1216ea4346d3b0a6f63bb45fb0f07341f | 52,205 | py | Python | sympy/matrices/tests/test_commonmatrix.py | AugustinJose1221/sympy | 94731be8cc4ee7d2a63065732dd086fb272029ad | [
"BSD-3-Clause"
] | 2 | 2019-10-18T12:45:34.000Z | 2020-08-10T08:27:59.000Z | sympy/matrices/tests/test_commonmatrix.py | AugustinJose1221/sympy | 94731be8cc4ee7d2a63065732dd086fb272029ad | [
"BSD-3-Clause"
] | null | null | null | sympy/matrices/tests/test_commonmatrix.py | AugustinJose1221/sympy | 94731be8cc4ee7d2a63065732dd086fb272029ad | [
"BSD-3-Clause"
] | 1 | 2019-10-18T12:39:41.000Z | 2019-10-18T12:39:41.000Z | import collections
import random
from sympy.assumptions import Q
from sympy.core.add import Add
from sympy.core.compatibility import range
from sympy.core.function import (Function, diff)
from sympy.core.numbers import (E, Float, I, Integer, oo, pi)
from sympy.core.relational import (Eq, Lt)
from sympy.core.singleton ... | 33.400512 | 123 | 0.5279 | import collections
import random
from sympy.assumptions import Q
from sympy.core.add import Add
from sympy.core.compatibility import range
from sympy.core.function import (Function, diff)
from sympy.core.numbers import (E, Float, I, Integer, oo, pi)
from sympy.core.relational import (Eq, Lt)
from sympy.core.singleton ... | true | true |
f71502012c2112fc320b40aba0ee9fe0ae69053c | 4,289 | py | Python | azure-batch/azure/batch/models/subtask_information.py | HydAu/AzureSDKForPython | 5cbe34e9e0b8ea1faacc9f205633ccc0b885c0f3 | [
"Apache-2.0"
] | null | null | null | azure-batch/azure/batch/models/subtask_information.py | HydAu/AzureSDKForPython | 5cbe34e9e0b8ea1faacc9f205633ccc0b885c0f3 | [
"Apache-2.0"
] | null | null | null | azure-batch/azure/batch/models/subtask_information.py | HydAu/AzureSDKForPython | 5cbe34e9e0b8ea1faacc9f205633ccc0b885c0f3 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft and contributors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of ... | 47.655556 | 217 | 0.683143 |
from msrest.serialization import Model
class SubtaskInformation(Model):
_attribute_map = {
'id': {'key': 'id', 'type': 'int'},
'node_info': {'key': 'nodeInfo', 'type': 'ComputeNodeInformation'},
'start_time': {'key': 'startTime', 'type': 'iso-8601'},
'end_time': {'key': 'endTime'... | true | true |
f71502d262586243fcb871571f56d5965f4c4430 | 1,805 | py | Python | misc/logger.py | abraker95/ultimate_osu_analyzer | bea58c997d13c3f461ccbe682f52799f0f88fdea | [
"MIT"
] | 23 | 2019-02-27T06:20:15.000Z | 2022-03-31T22:54:11.000Z | misc/logger.py | abraker95/ultimate_osu_analyzer | bea58c997d13c3f461ccbe682f52799f0f88fdea | [
"MIT"
] | 38 | 2019-03-03T17:35:39.000Z | 2021-08-23T20:43:34.000Z | misc/logger.py | abraker95/ultimate_osu_analyzer | bea58c997d13c3f461ccbe682f52799f0f88fdea | [
"MIT"
] | 4 | 2020-03-30T20:43:14.000Z | 2022-03-06T19:40:15.000Z | import logging
import traceback
import config
import pathlib
class Logger(logging.getLoggerClass()):
def __init__(self, name, level=logging.NOTSET):
super().__init__(name, level=logging.DEBUG)
formatter = logging.Formatter('%(levelname)s %(asctime)s [ %(name)s ] %(message)s')
... | 29.112903 | 104 | 0.574515 | import logging
import traceback
import config
import pathlib
class Logger(logging.getLoggerClass()):
def __init__(self, name, level=logging.NOTSET):
super().__init__(name, level=logging.DEBUG)
formatter = logging.Formatter('%(levelname)s %(asctime)s [ %(name)s ] %(message)s')
... | true | true |
f71503d83257c56d9a08f215294410fe3f0189c1 | 4,679 | py | Python | venv/Lib/site-packages/pyrogram/parser/markdown.py | D1ne2021/jjhhhjj | a090da30983b3ef276dfe4cef2ded4526f36002a | [
"MIT"
] | 2 | 2021-12-13T07:09:55.000Z | 2022-01-12T12:15:20.000Z | venv/Lib/site-packages/pyrogram/parser/markdown.py | hoangkiet1906/Botcie_ver1 | c133b915edde06dac690a7dc6ca160f6792fc4c8 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/pyrogram/parser/markdown.py | hoangkiet1906/Botcie_ver1 | c133b915edde06dac690a7dc6ca160f6792fc4c8 | [
"MIT"
] | null | null | null | # Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2021 Dan <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free... | 30.986755 | 94 | 0.551186 |
import html
import re
from typing import Optional
import pyrogram
from . import utils
from .html import HTML
BOLD_DELIM = "**"
ITALIC_DELIM = "__"
UNDERLINE_DELIM = "--"
STRIKE_DELIM = "~~"
CODE_DELIM = "`"
PRE_DELIM = "```"
MARKDOWN_RE = re.compile(r"({d})|\[(.+?)\]\((.+?)\)".format(
d="|".join(
["".jo... | true | true |
f715042ccd8dab4bb318453fc8081500dd54c9f3 | 6,397 | py | Python | python_toolbox/combi/perming/_variation_adding_mixin.py | hboshnak/python_toolbox | cb9ef64b48f1d03275484d707dc5079b6701ad0c | [
"MIT"
] | 119 | 2015-02-05T17:59:47.000Z | 2022-02-21T22:43:40.000Z | python_toolbox/combi/perming/_variation_adding_mixin.py | hboshnak/python_toolbox | cb9ef64b48f1d03275484d707dc5079b6701ad0c | [
"MIT"
] | 4 | 2019-04-24T14:01:14.000Z | 2020-05-21T12:03:29.000Z | python_toolbox/combi/perming/_variation_adding_mixin.py | hboshnak/python_toolbox | cb9ef64b48f1d03275484d707dc5079b6701ad0c | [
"MIT"
] | 14 | 2015-03-30T06:30:42.000Z | 2021-12-24T23:45:11.000Z | # Copyright 2009-2017 Ram Rachum.
# This program is distributed under the MIT license.
from python_toolbox import caching
from python_toolbox import sequence_tools
# (`PermSpace` exported to here from `perm_space.py` to avoid import loop.)
class _VariationAddingMixin:
'''Mixin for `PermSpace` to add variations ... | 41.00641 | 80 | 0.601688 |
from python_toolbox import caching
from python_toolbox import sequence_tools
class _VariationAddingMixin:
def get_rapplied(self, sequence):
if self.is_rapplied:
raise TypeError('This space is already rapplied, to rapply it to a '
'different sequence please use `.u... | true | true |
f715048138799b0ac641454d95df68f3f905c56a | 239 | py | Python | Pwn/turbofastcrypto/bin/tfc.py | aliencaocao/Sieberrsec-CTF-3.0 | 9b27b11279a7529d3affd22bbd0399c22d24f977 | [
"Apache-2.0"
] | 7 | 2021-12-30T11:54:09.000Z | 2022-01-31T09:11:04.000Z | Pwn/turbofastcrypto/bin/tfc.py | aliencaocao/Sieberrsec-CTF-3.0 | 9b27b11279a7529d3affd22bbd0399c22d24f977 | [
"Apache-2.0"
] | 1 | 2022-01-31T09:04:16.000Z | 2022-01-31T09:04:16.000Z | Pwn/turbofastcrypto/bin/tfc.py | aliencaocao/Sieberrsec-CTF-3.0 | 9b27b11279a7529d3affd22bbd0399c22d24f977 | [
"Apache-2.0"
] | 3 | 2021-12-31T02:28:08.000Z | 2022-02-24T13:11:09.000Z | import turbofastcrypto # The source code for this module is only available for part 2 of this challenge :)
while 1:
plaintext = input('> ')
ciphertext = turbofastcrypto.encrypt(plaintext)
print('Encrypted: ' + str(ciphertext))
| 39.833333 | 106 | 0.723849 | import turbofastcrypto while 1:
plaintext = input('> ')
ciphertext = turbofastcrypto.encrypt(plaintext)
print('Encrypted: ' + str(ciphertext))
| true | true |
f715058418459dfa648e6522e744f2a5b97481cd | 1,225 | py | Python | rastervision/augmentor/augmentor_config.py | Yochengliu/raster-vision | f5badc387df86ce02d84e0e274a08026dbf65bd6 | [
"Apache-2.0"
] | 1 | 2019-12-10T13:37:39.000Z | 2019-12-10T13:37:39.000Z | rastervision/augmentor/augmentor_config.py | Yochengliu/raster-vision | f5badc387df86ce02d84e0e274a08026dbf65bd6 | [
"Apache-2.0"
] | null | null | null | rastervision/augmentor/augmentor_config.py | Yochengliu/raster-vision | f5badc387df86ce02d84e0e274a08026dbf65bd6 | [
"Apache-2.0"
] | null | null | null | from abc import abstractmethod
import rastervision as rv
from rastervision.core import (Config, ConfigBuilder)
class AugmentorConfig(Config):
def __init__(self, augmentor_type):
self.augmentor_type = augmentor_type
@abstractmethod
def create_augmentor(self):
"""Create the Augmentor that ... | 31.410256 | 84 | 0.663673 | from abc import abstractmethod
import rastervision as rv
from rastervision.core import (Config, ConfigBuilder)
class AugmentorConfig(Config):
def __init__(self, augmentor_type):
self.augmentor_type = augmentor_type
@abstractmethod
def create_augmentor(self):
pass
def to_builder(self... | true | true |
f7150631edcb84ba360da036d61bdd309326a6e6 | 854 | py | Python | test/scenarios/driver/linode/molecule/default/tests/test_default.py | dericcrago/molecule | cb4dec0a7d4993395f123b2c9b0590d41e9dd557 | [
"MIT"
] | null | null | null | test/scenarios/driver/linode/molecule/default/tests/test_default.py | dericcrago/molecule | cb4dec0a7d4993395f123b2c9b0590d41e9dd557 | [
"MIT"
] | null | null | null | test/scenarios/driver/linode/molecule/default/tests/test_default.py | dericcrago/molecule | cb4dec0a7d4993395f123b2c9b0590d41e9dd557 | [
"MIT"
] | null | null | null | import os
import pytest
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']
).get_hosts('all')
@pytest.mark.skip(reason='Scenario tests not implemented yet')
def test_hostname(host):
assert 'instance' == host.check_outp... | 24.4 | 63 | 0.723653 | import os
import pytest
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']
).get_hosts('all')
@pytest.mark.skip(reason='Scenario tests not implemented yet')
def test_hostname(host):
assert 'instance' == host.check_outp... | true | true |
f7150789857f831893207971e213c8b17f00080e | 54,478 | py | Python | megatron/arguments.py | deepakn94/Megatron-DeepSpeed | 541b967fbf9fd97ce090ca464ccd205b55aae59c | [
"MIT"
] | null | null | null | megatron/arguments.py | deepakn94/Megatron-DeepSpeed | 541b967fbf9fd97ce090ca464ccd205b55aae59c | [
"MIT"
] | null | null | null | megatron/arguments.py | deepakn94/Megatron-DeepSpeed | 541b967fbf9fd97ce090ca464ccd205b55aae59c | [
"MIT"
] | null | null | null | # coding=utf-8
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 52.28215 | 167 | 0.600169 |
import argparse
import collections
import os
import re
import time
import torch
import deepspeed
from megatron.enums import PositionEmbeddingType
import megatron
from megatron.logging import log_levels
def parse_args(extra_args_provider=None, defaults={},
ignore_unknown_args=False):
parser = ar... | true | true |
f71508036be54c36e5daf87e785d178e4ded75db | 3,571 | py | Python | openpyxlzip/packaging/tests/test_core.py | ankitJoshi03/openpyxlzip | f3b8aa2f80f9d8bc31ce5fcf05c822d88d2ff647 | [
"MIT"
] | null | null | null | openpyxlzip/packaging/tests/test_core.py | ankitJoshi03/openpyxlzip | f3b8aa2f80f9d8bc31ce5fcf05c822d88d2ff647 | [
"MIT"
] | null | null | null | openpyxlzip/packaging/tests/test_core.py | ankitJoshi03/openpyxlzip | f3b8aa2f80f9d8bc31ce5fcf05c822d88d2ff647 | [
"MIT"
] | null | null | null | # copyright openpyxlzip 2014
import datetime
import pytest
from openpyxlzip.tests.helper import compare_xml
from openpyxlzip.xml.constants import DCTERMS_PREFIX, DCTERMS_NS, XSI_NS
from openpyxlzip.xml.functions import (
fromstring,
tostring,
register_namespace,
NS_REGEX,
)
@pytest.fixture()
def Sa... | 32.761468 | 91 | 0.681322 |
import datetime
import pytest
from openpyxlzip.tests.helper import compare_xml
from openpyxlzip.xml.constants import DCTERMS_PREFIX, DCTERMS_NS, XSI_NS
from openpyxlzip.xml.functions import (
fromstring,
tostring,
register_namespace,
NS_REGEX,
)
@pytest.fixture()
def SampleProperties():
from ..... | true | true |
f7150806ca03c83bb4c23c630e2ac8e54993a8f6 | 223 | py | Python | gumo/task/bind.py | gumo-py/gumo-task | 412c8351da206299ad2785963c8e7e6c7117e75c | [
"MIT"
] | null | null | null | gumo/task/bind.py | gumo-py/gumo-task | 412c8351da206299ad2785963c8e7e6c7117e75c | [
"MIT"
] | 54 | 2019-08-08T02:08:15.000Z | 2022-02-11T02:55:47.000Z | gumo/task/bind.py | gumo-py/gumo-task | 412c8351da206299ad2785963c8e7e6c7117e75c | [
"MIT"
] | 1 | 2019-04-10T09:24:03.000Z | 2019-04-10T09:24:03.000Z | from gumo.task.application.repository import GumoTaskRepository
from gumo.task.infrastructure.repository import GumoTaskRepositoryImpl
def task_bind(binder):
binder.bind(GumoTaskRepository, to=GumoTaskRepositoryImpl)
| 31.857143 | 70 | 0.856502 | from gumo.task.application.repository import GumoTaskRepository
from gumo.task.infrastructure.repository import GumoTaskRepositoryImpl
def task_bind(binder):
binder.bind(GumoTaskRepository, to=GumoTaskRepositoryImpl)
| true | true |
f715095c652e3a7692eb07b19d8b2822fddca9ac | 3,595 | py | Python | practice contest 2018/Palindrome/solution2.py | robingan7/ACSL | 3e1c35b0282e8317ff6820ae76ebcad6506a3b53 | [
"MIT"
] | 6 | 2018-11-05T22:59:42.000Z | 2021-09-13T05:43:08.000Z | practice contest 2018/Palindrome/solution2.py | robin-gan/ACSL | 3e1c35b0282e8317ff6820ae76ebcad6506a3b53 | [
"MIT"
] | null | null | null | practice contest 2018/Palindrome/solution2.py | robin-gan/ACSL | 3e1c35b0282e8317ff6820ae76ebcad6506a3b53 | [
"MIT"
] | 2 | 2020-01-12T17:46:37.000Z | 2021-09-13T05:29:38.000Z | def main():
global originalNum
global base
ipl=input("Enter the input")
originalNum=ipl[0:len(ipl)-3]
base=ipl[len(ipl)-2:]
def ABCD(num):
num=str(num)
if(num=='1'):
return '1'
if(num=='2'):
return '2'
if(num=='3'):
return '3'
if(num=='4'):
retur... | 21.526946 | 112 | 0.51516 | def main():
global originalNum
global base
ipl=input("Enter the input")
originalNum=ipl[0:len(ipl)-3]
base=ipl[len(ipl)-2:]
def ABCD(num):
num=str(num)
if(num=='1'):
return '1'
if(num=='2'):
return '2'
if(num=='3'):
return '3'
if(num=='4'):
retur... | true | true |
f7150987acbe3caf5f386ef1600ec19dfb6f7681 | 10,064 | py | Python | WDL/runtime/download.py | TMiguelT/miniwdl | 5a7724fbf1cbe7bd3b4f251994c83820646ecd9d | [
"MIT"
] | null | null | null | WDL/runtime/download.py | TMiguelT/miniwdl | 5a7724fbf1cbe7bd3b4f251994c83820646ecd9d | [
"MIT"
] | null | null | null | WDL/runtime/download.py | TMiguelT/miniwdl | 5a7724fbf1cbe7bd3b4f251994c83820646ecd9d | [
"MIT"
] | null | null | null | """
Downloading input files from URIs, with plugin modules for different URI schemes
Download URI plugins are installed & registered using the setuptools entry point group
"miniwdl.plugin.file_download", with name equal to the URI scheme (e.g. "gs" or "s3").
The plugin entry point should be a context manager, which t... | 34.465753 | 101 | 0.588335 | import os
import logging
import traceback
import tempfile
import hashlib
import importlib_metadata
from contextlib import ExitStack
from typing import Optional, List, Generator, Dict, Any, Tuple, Callable
from . import config
from .cache import CallCache
from .._util import compose_coroutines
from .._util import Struct... | true | true |
f7150a970357699aca9cf473334a78e6e5582097 | 130 | py | Python | palindrome_string.py | arghya-007/collage_python_scripts | 5260c30b86209293ba8caa2fbb1d8afdf5230519 | [
"MIT"
] | 3 | 2020-09-24T18:45:56.000Z | 2020-10-02T02:28:42.000Z | palindrome_string.py | arghya-007/collage_python_scripts | 5260c30b86209293ba8caa2fbb1d8afdf5230519 | [
"MIT"
] | null | null | null | palindrome_string.py | arghya-007/collage_python_scripts | 5260c30b86209293ba8caa2fbb1d8afdf5230519 | [
"MIT"
] | null | null | null | s = input("Please enter your own String : ")
if(s == s[:: - 1]):
print("Palindrome")
else:
print("Not a Palindrome string") | 21.666667 | 44 | 0.607692 | s = input("Please enter your own String : ")
if(s == s[:: - 1]):
print("Palindrome")
else:
print("Not a Palindrome string") | true | true |
f7150d2bc449be689d702bd308ab77339d0f7e3d | 24,627 | py | Python | xalpha/multiple.py | wxw-matt/xalpha | b142a5daebac5f1129ead0553efcd40cd471190c | [
"MIT"
] | null | null | null | xalpha/multiple.py | wxw-matt/xalpha | b142a5daebac5f1129ead0553efcd40cd471190c | [
"MIT"
] | null | null | null | xalpha/multiple.py | wxw-matt/xalpha | b142a5daebac5f1129ead0553efcd40cd471190c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
module for mul and mulfix class: fund combination management
"""
import logging
import pandas as pd
from pyecharts import options as opts
from pyecharts.charts import Pie, ThemeRiver
from xalpha.cons import convert_date, myround, yesterdaydash, yesterdayobj
from xalpha.evaluate import eval... | 36.538576 | 152 | 0.511999 |
import logging
import pandas as pd
from pyecharts import options as opts
from pyecharts.charts import Pie, ThemeRiver
from xalpha.cons import convert_date, myround, yesterdaydash, yesterdayobj
from xalpha.evaluate import evaluate
from xalpha.exceptions import FundTypeError, TradeBehaviorError
from xalpha.record impor... | true | true |
f7150d4f3994a0060df418ddb3fbabd3267a1aec | 27,846 | py | Python | tensorflow/python/ops/op_def_library.py | smrutiranjans/tensorflow | d8e8b872eae63188c75046d5bb068e03a81b3f85 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/ops/op_def_library.py | smrutiranjans/tensorflow | d8e8b872eae63188c75046d5bb068e03a81b3f85 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/ops/op_def_library.py | smrutiranjans/tensorflow | d8e8b872eae63188c75046d5bb068e03a81b3f85 | [
"Apache-2.0"
] | 1 | 2020-03-08T13:12:13.000Z | 2020-03-08T13:12:13.000Z | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 39.666667 | 80 | 0.602097 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import contextlib
import six
from tensorflow.core.framework import attr_value_pb2
from tensorflow.core.framework import op_def_pb2
from tensorflow.core.framework import tensor_pb2
from tensorflow.core.frame... | true | true |
f7150df7efc2173d6fc9c35645e25cb08e4e030d | 5,210 | py | Python | tests/components/freebox/test_config_flow.py | miccico/core | 14c205384171dee59c1a908f8449f9864778b2dc | [
"Apache-2.0"
] | 6 | 2017-08-02T19:26:39.000Z | 2020-03-14T22:47:41.000Z | tests/components/freebox/test_config_flow.py | miccico/core | 14c205384171dee59c1a908f8449f9864778b2dc | [
"Apache-2.0"
] | 54 | 2020-11-17T07:04:57.000Z | 2022-03-31T06:45:39.000Z | tests/components/freebox/test_config_flow.py | miccico/core | 14c205384171dee59c1a908f8449f9864778b2dc | [
"Apache-2.0"
] | 14 | 2018-08-19T16:28:26.000Z | 2021-09-02T18:26:53.000Z | """Tests for the Freebox config flow."""
from unittest.mock import AsyncMock, patch
from aiofreepybox.exceptions import (
AuthorizationError,
HttpRequestError,
InvalidTokenError,
)
import pytest
from homeassistant import data_entry_flow
from homeassistant.components.freebox.const import DOMAIN
from homeas... | 34.276316 | 86 | 0.673321 | from unittest.mock import AsyncMock, patch
from aiofreepybox.exceptions import (
AuthorizationError,
HttpRequestError,
InvalidTokenError,
)
import pytest
from homeassistant import data_entry_flow
from homeassistant.components.freebox.const import DOMAIN
from homeassistant.config_entries import SOURCE_DISC... | true | true |
f7150e4ced48a3dd4e84f1e34c3cf0335508d142 | 620 | py | Python | PythonModulo1/ex028.py | BossNX/ExerciciosDePython | 27c79d284794f65f94d3a07de11429d665ec92da | [
"MIT"
] | null | null | null | PythonModulo1/ex028.py | BossNX/ExerciciosDePython | 27c79d284794f65f94d3a07de11429d665ec92da | [
"MIT"
] | null | null | null | PythonModulo1/ex028.py | BossNX/ExerciciosDePython | 27c79d284794f65f94d3a07de11429d665ec92da | [
"MIT"
] | null | null | null | from random import randint
import playsound
from time import sleep
print('-=-' * 20)
print('Vou pensar em um número entre 0 e 5. Tente advinhar... ')
print('-=-' * 20)
jogador = int(input('Em que número você pensou? '))
print('PROCESSANDO... ')
sleep(3)
computador = randint(0, 5)
if jogador == computador:
print('PA... | 34.444444 | 106 | 0.695161 | from random import randint
import playsound
from time import sleep
print('-=-' * 20)
print('Vou pensar em um número entre 0 e 5. Tente advinhar... ')
print('-=-' * 20)
jogador = int(input('Em que número você pensou? '))
print('PROCESSANDO... ')
sleep(3)
computador = randint(0, 5)
if jogador == computador:
print('PA... | true | true |
f7150fdd54d3ad81b16118068731af80a1829d37 | 5,393 | py | Python | picar.py | ElwinCabrera/picar | 975a5c49ea4c12a0dd8faefb4e0a405d902ccd62 | [
"MIT"
] | null | null | null | picar.py | ElwinCabrera/picar | 975a5c49ea4c12a0dd8faefb4e0a405d902ccd62 | [
"MIT"
] | null | null | null | picar.py | ElwinCabrera/picar | 975a5c49ea4c12a0dd8faefb4e0a405d902ccd62 | [
"MIT"
] | null | null | null | """
PI power
5V on pin
GND on pin
The GPIO mode is set to BCM
H-Bridge Motor Driver Pin Configuration
in1 -> BCM 05 (board pin 29 or GPIO 5)
in2 -> BCM 06 (board pin 31 or GPIO 6)
enable -> BCM 13 (board pin 33 or GPIO 13, PWM)
PCA9685 (16-Channel Servo Driver) Pin Configuration
SDA -> BCM 2 (board pin ... | 29.79558 | 112 | 0.597627 |
from adafruit_servokit import ServoKit
from gpiozero import Motor, PWMOutputDevice
from time import sleep
from enum import Enum
class ServoCh(Enum):
STEERING = 0
CAM_PAN = 1
CAM_TILT = 2
TRIGHT_HYDR = 4
TLEFT_HYDR = 5
BRIGHT_HYDR = 6
BLEFT_HYDR = 7
class PiCar:
def __init__(self):
... | true | true |
f7151043e58b5a9e39f8c3bb1497ebe774d3ce3c | 11,345 | py | Python | nltk/chat/zen.py | Pandinosaurus/nltk | 53dbaa5591003f6764a3d69834e92bc83e3a754c | [
"Apache-2.0"
] | 2 | 2021-12-06T04:28:18.000Z | 2021-12-20T03:33:00.000Z | nltk/chat/zen.py | Pandinosaurus/nltk | 53dbaa5591003f6764a3d69834e92bc83e3a754c | [
"Apache-2.0"
] | null | null | null | nltk/chat/zen.py | Pandinosaurus/nltk | 53dbaa5591003f6764a3d69834e92bc83e3a754c | [
"Apache-2.0"
] | 1 | 2021-12-29T16:44:59.000Z | 2021-12-29T16:44:59.000Z | # Natural Language Toolkit: Zen Chatbot
#
# Copyright (C) 2001-2021 NLTK Project
# Author: Amy Holland <amyrh@csse.unimelb.edu.au>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
"""
Zen Chatbot talks in gems of Zen wisdom.
This is a sample conversation with Zen Chatbot:
ZC: Welcome, my child.... | 34.378788 | 200 | 0.545439 |
from nltk.chat.util import Chat, reflections
responses = (
(
r"(hello(.*))|(good [a-zA-Z]+)",
(
"The path to enlightenment is often difficult to see.",
"Greetings. I sense your mind is troubled. Tell me of your troubles.",
"Ask the question you ... | true | true |
f71511f5483a56d525eed60470acbd3271e7bc13 | 4,890 | py | Python | doc/conf.py | kcleal/InSilicoSeqSplit | 3ed2881570b3984c82a6e56200c5e6d0f9067e59 | [
"MIT"
] | 109 | 2017-09-06T00:46:07.000Z | 2022-03-31T14:41:53.000Z | doc/conf.py | kcleal/InSilicoSeqSplit | 3ed2881570b3984c82a6e56200c5e6d0f9067e59 | [
"MIT"
] | 210 | 2016-11-16T21:04:37.000Z | 2022-03-25T16:37:05.000Z | doc/conf.py | kcleal/InSilicoSeqSplit | 3ed2881570b3984c82a6e56200c5e6d0f9067e59 | [
"MIT"
] | 31 | 2017-05-23T11:53:52.000Z | 2021-12-27T05:57:27.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# InSilicoSeq documentation build configuration file, created by
# sphinx-quickstart on Tue May 30 11:45:01 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
... | 30.949367 | 79 | 0.684663 |
from iss.version import __version__
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.napoleon',
'sphinx.ext.viewcode']
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = 'InSilicoSeq'
copyright = '2017, Hadrien Gourle'
author = 'Hadrien Gourle'
# |version| and |re... | true | true |
f71512a29b12796c7073840bf47222a9f69148b6 | 213 | py | Python | donations/payment_gateways/offline/constants.py | diffractive/newstream | cf1a1f230e18d01c63b50ab9d360aa44ac5a486f | [
"MIT"
] | 1 | 2020-05-03T12:33:42.000Z | 2020-05-03T12:33:42.000Z | donations/payment_gateways/offline/constants.py | diffractive/newstream | cf1a1f230e18d01c63b50ab9d360aa44ac5a486f | [
"MIT"
] | 14 | 2020-07-06T20:05:57.000Z | 2022-03-12T00:39:11.000Z | donations/payment_gateways/offline/constants.py | diffractive/newstream | cf1a1f230e18d01c63b50ab9d360aa44ac5a486f | [
"MIT"
] | null | null | null | from site_settings.models import GATEWAY_CAN_EDIT_SUBSCRIPTION, GATEWAY_CAN_TOGGLE_SUBSCRIPTION, GATEWAY_CAN_CANCEL_SUBSCRIPTION
API_CAPABILITIES = [GATEWAY_CAN_EDIT_SUBSCRIPTION, GATEWAY_CAN_CANCEL_SUBSCRIPTION] | 71 | 128 | 0.920188 | from site_settings.models import GATEWAY_CAN_EDIT_SUBSCRIPTION, GATEWAY_CAN_TOGGLE_SUBSCRIPTION, GATEWAY_CAN_CANCEL_SUBSCRIPTION
API_CAPABILITIES = [GATEWAY_CAN_EDIT_SUBSCRIPTION, GATEWAY_CAN_CANCEL_SUBSCRIPTION] | true | true |
f7151307628b5972cb55056043855b80acf50ddc | 16,890 | py | Python | var/spack/repos/builtin/packages/wrf/package.py | marcost2/spack | d23bb6b3af31186d3933b9946b5f4c5d97addf74 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/wrf/package.py | marcost2/spack | d23bb6b3af31186d3933b9946b5f4c5d97addf74 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/wrf/package.py | marcost2/spack | d23bb6b3af31186d3933b9946b5f4c5d97addf74 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import glob
import re
import time
from os.path import basename
from subprocess import PIPE, Popen
from sys import platform... | 39.555035 | 161 | 0.60148 |
import glob
import re
import time
from os.path import basename
from subprocess import PIPE, Popen
from sys import platform, stdout
from llnl.util import tty
from spack import *
is_windows = platform == 'win32'
if not is_windows:
from fcntl import F_GETFL, F_SETFL, fcntl
from os import O_NONBLOCK
re_optlin... | true | true |
f71513d9753f7f0ac33b142e11457712ae4430d5 | 6,367 | py | Python | robel/components/tracking/group_config.py | Del9fina/robel | 63dfac65932757134e5766f1e20a339efe281bc7 | [
"Apache-2.0"
] | 109 | 2019-08-29T22:55:41.000Z | 2022-03-19T18:26:37.000Z | robel/components/tracking/group_config.py | Del9fina/robel | 63dfac65932757134e5766f1e20a339efe281bc7 | [
"Apache-2.0"
] | 12 | 2019-11-14T05:16:00.000Z | 2021-02-21T07:49:32.000Z | robel/components/tracking/group_config.py | Del9fina/robel | 63dfac65932757134e5766f1e20a339efe281bc7 | [
"Apache-2.0"
] | 40 | 2019-09-29T06:50:44.000Z | 2022-03-19T18:34:20.000Z | # Copyright 2019 The ROBEL 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 in wr... | 44.215278 | 79 | 0.613162 |
from typing import Iterable, Optional
import numpy as np
from transforms3d.euler import euler2mat, quat2euler
from transforms3d.quaternions import quat2mat
from robel.simulation.sim_scene import SimScene
class TrackerGroupConfig:
def __init__(self,
sim_scene: SimScene,
eleme... | true | true |
f7151463007effd34f97b1411f3c8126fe6337ed | 26,377 | py | Python | geopandas/tests/test_geom_methods.py | raphacosta27/geopandas | 2c22a26bd40ec48536026b160c54c6fe523d22d7 | [
"BSD-3-Clause"
] | null | null | null | geopandas/tests/test_geom_methods.py | raphacosta27/geopandas | 2c22a26bd40ec48536026b160c54c6fe523d22d7 | [
"BSD-3-Clause"
] | null | null | null | geopandas/tests/test_geom_methods.py | raphacosta27/geopandas | 2c22a26bd40ec48536026b160c54c6fe523d22d7 | [
"BSD-3-Clause"
] | 2 | 2020-02-18T13:25:58.000Z | 2021-02-15T21:25:07.000Z | import string
import numpy as np
from numpy.testing import assert_array_equal
from pandas import DataFrame, MultiIndex, Series
from shapely.geometry import LinearRing, LineString, MultiPoint, Point, Polygon
from shapely.geometry.collection import GeometryCollection
from shapely.ops import unary_union
from geopandas ... | 37.627675 | 88 | 0.601812 | import string
import numpy as np
from numpy.testing import assert_array_equal
from pandas import DataFrame, MultiIndex, Series
from shapely.geometry import LinearRing, LineString, MultiPoint, Point, Polygon
from shapely.geometry.collection import GeometryCollection
from shapely.ops import unary_union
from geopandas ... | true | true |
f71514719dd30abf00b523af63d90107b7beea30 | 111 | py | Python | src/routes/donate.py | BuildForSDG/team-247 | 4115c32078189c581a6155f57a3f321eebe361a8 | [
"MIT"
] | 1 | 2020-05-11T07:33:03.000Z | 2020-05-11T07:33:03.000Z | src/routes/donate.py | BuildForSDG/team-247 | 4115c32078189c581a6155f57a3f321eebe361a8 | [
"MIT"
] | 15 | 2020-05-03T10:44:22.000Z | 2021-05-11T12:05:39.000Z | src/routes/donate.py | BuildForSDG/team-247 | 4115c32078189c581a6155f57a3f321eebe361a8 | [
"MIT"
] | 5 | 2020-05-01T16:38:47.000Z | 2020-07-26T19:55:58.000Z | from flask import Blueprint, render_template
from src.extensions import db
from src.models import Donated
| 12.333333 | 44 | 0.810811 | from flask import Blueprint, render_template
from src.extensions import db
from src.models import Donated
| true | true |
f71514d7bb61d91d8c7004b1e432aad584aeea1a | 25,261 | py | Python | tf_agents/policies/tf_policy.py | moesio-f/agents | 53ce87c9203222585fdcd833e052fcdce1b6fa37 | [
"Apache-2.0"
] | null | null | null | tf_agents/policies/tf_policy.py | moesio-f/agents | 53ce87c9203222585fdcd833e052fcdce1b6fa37 | [
"Apache-2.0"
] | null | null | null | tf_agents/policies/tf_policy.py | moesio-f/agents | 53ce87c9203222585fdcd833e052fcdce1b6fa37 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2020 The TF-Agents 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 41.343699 | 118 | 0.702585 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import abc
from typing import Optional, Text, Sequence
import six
import tensorflow as tf
import tensorflow_probability as tfp
from tf_agents.distributions import reparameterized_sampling
from tf_agents.spe... | true | true |
f71514f0dad88cf3e04985d36511d73d2b429e0f | 2,737 | py | Python | salt/modules/freebsdkmod.py | abh/salt | e8870573a2d3eca1a7794ce8340797fa487de04d | [
"Apache-2.0"
] | 1 | 2017-09-09T11:21:13.000Z | 2017-09-09T11:21:13.000Z | salt/modules/freebsdkmod.py | abh/salt | e8870573a2d3eca1a7794ce8340797fa487de04d | [
"Apache-2.0"
] | null | null | null | salt/modules/freebsdkmod.py | abh/salt | e8870573a2d3eca1a7794ce8340797fa487de04d | [
"Apache-2.0"
] | null | null | null | '''
Module to manage FreeBSD kernel modules
'''
import os
def __virtual__():
'''
Only runs on FreeBSD systems
'''
return 'kmod' if __grains__['kernel'] == 'FreeBSD' else False
def _new_mods(pre_mods, post_mods):
'''
Return a list of the new modules, pass an kldstat dict before running
m... | 21.896 | 79 | 0.569236 |
import os
def __virtual__():
return 'kmod' if __grains__['kernel'] == 'FreeBSD' else False
def _new_mods(pre_mods, post_mods):
pre = set()
post = set()
for mod in pre_mods:
pre.add(mod['module'])
for mod in post_mods:
post.add(mod['module'])
return list(post - pre)
def _rm... | true | true |
f715150d07f9689d433e3b3d3176bd3af0b5ace6 | 72 | py | Python | run.py | priscillapepe/News-API | 7931edf4bac58fbc894f9007c91c0a55c480736d | [
"MIT"
] | null | null | null | run.py | priscillapepe/News-API | 7931edf4bac58fbc894f9007c91c0a55c480736d | [
"MIT"
] | null | null | null | run.py | priscillapepe/News-API | 7931edf4bac58fbc894f9007c91c0a55c480736d | [
"MIT"
] | null | null | null | # from app import app
# if __name__ == "__main__":
# app.run()
| 14.4 | 28 | 0.555556 | true | true | |
f71515bd965b1d9750e3c8f9bcbd37c39cad5398 | 679 | py | Python | aiogram/types/file.py | muhammedfurkan/aiogram | 692c1340b4dda556da640e5f9ea2200848c06840 | [
"MIT"
] | null | null | null | aiogram/types/file.py | muhammedfurkan/aiogram | 692c1340b4dda556da640e5f9ea2200848c06840 | [
"MIT"
] | 4 | 2020-11-04T15:55:55.000Z | 2020-11-08T21:36:02.000Z | aiogram/types/file.py | muhammedfurkan/aiogram | 692c1340b4dda556da640e5f9ea2200848c06840 | [
"MIT"
] | null | null | null | from . import base, fields, mixins
class File(base.TelegramObject, mixins.Downloadable):
"""
This object represents a file ready to be downloaded.
The file can be downloaded via the link https://api.telegram.org/file/bot<token>/<file_path>.
It is guaranteed that the link will be valid for at least 1... | 30.863636 | 97 | 0.705449 | from . import base, fields, mixins
class File(base.TelegramObject, mixins.Downloadable):
file_id: base.String = fields.Field()
file_unique_id: base.String = fields.Field()
file_size: base.Integer = fields.Field()
file_path: base.String = fields.Field()
| true | true |
f7151637a20ed087dc8cfe8bbbaa192496fb0745 | 13,806 | py | Python | kinto/core/storage/__init__.py | taus-semmle/kinto | a4cd7c6413d1d7809fe02670c0224959390dc25d | [
"Apache-2.0"
] | null | null | null | kinto/core/storage/__init__.py | taus-semmle/kinto | a4cd7c6413d1d7809fe02670c0224959390dc25d | [
"Apache-2.0"
] | null | null | null | kinto/core/storage/__init__.py | taus-semmle/kinto | a4cd7c6413d1d7809fe02670c0224959390dc25d | [
"Apache-2.0"
] | null | null | null | import json
import logging
import random
import warnings
from collections import namedtuple
from pyramid.settings import asbool
import ujson
from kinto.core.decorators import deprecate_kwargs
from . import generators
class Missing:
"""Dummy value to represent a value that is completely absent from an object.
... | 33.028708 | 99 | 0.640519 | import json
import logging
import random
import warnings
from collections import namedtuple
from pyramid.settings import asbool
import ujson
from kinto.core.decorators import deprecate_kwargs
from . import generators
class Missing:
pass
MISSING = Missing()
logger = logging.getLogger(__name__)
Filter = na... | true | true |
f715167091a8b5611e5d6929e5426cf12480693e | 2,883 | py | Python | coovie2/coovie2.py | deshi-basara/coovie2 | 07351aa9cc132d1bd95b02d37fc9230cc9f81b2c | [
"MIT"
] | null | null | null | coovie2/coovie2.py | deshi-basara/coovie2 | 07351aa9cc132d1bd95b02d37fc9230cc9f81b2c | [
"MIT"
] | null | null | null | coovie2/coovie2.py | deshi-basara/coovie2 | 07351aa9cc132d1bd95b02d37fc9230cc9f81b2c | [
"MIT"
] | null | null | null |
import os
import click
from movie import Movie
from scan import Scan
from helper import Helper
@click.command()
@click.option('--endings',
default='mp4, mkv',
help='File-endings that are accepted as valid movie-files. ' +
'Default: [.mkv, .mp4]'
)
@click.option... | 32.761364 | 79 | 0.589317 |
import os
import click
from movie import Movie
from scan import Scan
from helper import Helper
@click.command()
@click.option('--endings',
default='mp4, mkv',
help='File-endings that are accepted as valid movie-files. ' +
'Default: [.mkv, .mp4]'
)
@click.option... | true | true |
f715167252441cd29ac5fc75d9b88326376c06e6 | 1,381 | py | Python | strategic.py | rayanf/Liars-Dice | bf68d08eb2d48bbceca4c79a91c3b88054143305 | [
"MIT"
] | 1 | 2021-11-21T18:10:15.000Z | 2021-11-21T18:10:15.000Z | strategic.py | rayanf/Liars-Dice | bf68d08eb2d48bbceca4c79a91c3b88054143305 | [
"MIT"
] | null | null | null | strategic.py | rayanf/Liars-Dice | bf68d08eb2d48bbceca4c79a91c3b88054143305 | [
"MIT"
] | null | null | null | import math
class Player:
def __init__(self):
pass
# self.most_common = lambda : self.numbers.index(max(self.numbers)) + 1
def initcards(self,num1,num2,num3,num4,num_all):
self.numbers = [num1,num2,num3,num4]
self.num_all = num_all
self.common = self.numbers.index(... | 23.016667 | 79 | 0.57929 | import math
class Player:
def __init__(self):
pass
def initcards(self,num1,num2,num3,num4,num_all):
self.numbers = [num1,num2,num3,num4]
self.num_all = num_all
self.common = self.numbers.index(max(self.numbers)) + 1
def guess(self):
prob = self.num_al... | true | true |
f715167bc39c8d99f903da2fe8c83bd99f51806e | 20,547 | py | Python | purity_fb/purity_fb_1dot3/apis/file_systems_api.py | mabdelhafez/purity_fb_python_client | a9856875b3df43b4302a2e4addd1a6b71f51f5ce | [
"Apache-2.0"
] | null | null | null | purity_fb/purity_fb_1dot3/apis/file_systems_api.py | mabdelhafez/purity_fb_python_client | a9856875b3df43b4302a2e4addd1a6b71f51f5ce | [
"Apache-2.0"
] | null | null | null | purity_fb/purity_fb_1dot3/apis/file_systems_api.py | mabdelhafez/purity_fb_python_client | a9856875b3df43b4302a2e4addd1a6b71f51f5ce | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Pure Storage FlashBlade REST 1.3 Python SDK
Pure Storage FlashBlade REST 1.3 Python SDK, developed by [Pure Storage, Inc](http://www.purestorage.com/). Documentations can be found at [purity-fb.readthedocs.io](http://purity-fb.readthedocs.io/).
OpenAPI spec version: 1.3
Contact: i... | 41.847251 | 204 | 0.575607 |
from __future__ import absolute_import
import sys
import os
import re
from six import iteritems
from ..configuration import Configuration
from ..api_client import ApiClient
class FileSystemsApi(object):
def __init__(self, api_client=None):
config = Configuration()
if api_client:
... | true | true |
f71516f50db00136d8aa0339afcc29694d8dbf29 | 131 | py | Python | Exercises/Exercises Chapter 06/Question 01.py | tonysulfaro/CSE-231 | 0e3ff5422fe42624a90a17d7f33174346662a6fc | [
"MIT"
] | 2 | 2021-09-23T19:17:24.000Z | 2021-11-29T09:03:56.000Z | Exercises/Exercises Chapter 06/Question 01.py | tonysulfaro/CSE-231 | 0e3ff5422fe42624a90a17d7f33174346662a6fc | [
"MIT"
] | null | null | null | Exercises/Exercises Chapter 06/Question 01.py | tonysulfaro/CSE-231 | 0e3ff5422fe42624a90a17d7f33174346662a6fc | [
"MIT"
] | 1 | 2020-10-25T13:03:18.000Z | 2020-10-25T13:03:18.000Z | fp = open('test.txt')
output = ""
for line in fp:
line = line.strip()
line = line.replace(" ", "")
output+=line
print(output) | 18.714286 | 30 | 0.603053 | fp = open('test.txt')
output = ""
for line in fp:
line = line.strip()
line = line.replace(" ", "")
output+=line
print(output) | true | true |
f71517a589dede7e1d422b652aa255171a8a9b17 | 27,911 | py | Python | Lib/site-packages/plumber/tests/test_plumber.py | Dr8Ninja/ShareSpace | 7b445783a313cbdebb1938e824e98370a42def5f | [
"MIT"
] | 1 | 2022-02-10T03:44:55.000Z | 2022-02-10T03:44:55.000Z | Lib/site-packages/plumber/tests/test_plumber.py | Dr8Ninja/ShareSpace | 7b445783a313cbdebb1938e824e98370a42def5f | [
"MIT"
] | 2 | 2022-01-29T15:29:19.000Z | 2022-02-13T20:28:17.000Z | Lib/site-packages/plumber/tests/test_plumber.py | Dr8Ninja/ShareSpace | 7b445783a313cbdebb1938e824e98370a42def5f | [
"MIT"
] | null | null | null | from plumber import Behavior
from plumber import PlumbingCollision
from plumber import default
from plumber import finalize
from plumber import override
from plumber import plumb
from plumber import plumber
from plumber import plumbifexists
from plumber import plumbing
from plumber.behavior import behaviormetaclass
fro... | 30.076509 | 79 | 0.555802 | from plumber import Behavior
from plumber import PlumbingCollision
from plumber import default
from plumber import finalize
from plumber import override
from plumber import plumb
from plumber import plumber
from plumber import plumbifexists
from plumber import plumbing
from plumber.behavior import behaviormetaclass
fro... | true | true |
f71517dfa9159f9c8d86c55e1e9fd94923af99e2 | 2,797 | py | Python | trajectoryPlugin/collate.py | zhangyuwangumass/General-Data-Driven-Adaptive-Learning | 63c4ddef36b2b7bd7078cd9b431e3502c358915a | [
"MIT"
] | null | null | null | trajectoryPlugin/collate.py | zhangyuwangumass/General-Data-Driven-Adaptive-Learning | 63c4ddef36b2b7bd7078cd9b431e3502c358915a | [
"MIT"
] | null | null | null | trajectoryPlugin/collate.py | zhangyuwangumass/General-Data-Driven-Adaptive-Learning | 63c4ddef36b2b7bd7078cd9b431e3502c358915a | [
"MIT"
] | null | null | null | r""""Contains definitions of the methods used by the _DataLoaderIter workers to
collate samples fetched from dataset into Tensor(s).
These **needs** to be in global scope since Py2 doesn't support serializing
static methods.
"""
import torch
import re
from torch._six import container_abcs, string_classes, int_classes... | 39.957143 | 85 | 0.672506 |
import torch
import re
from torch._six import container_abcs, string_classes, int_classes
_use_shared_memory = False
np_str_obj_array_pattern = re.compile(r'[SaUO]')
error_msg_fmt = "batch must contain tensors, numbers, dicts or lists; found {}"
numpy_type_map = {
'float64': torch.DoubleTensor,
'float32': ... | true | true |
f715180246192055bfecfdc8fa0f2adb72606868 | 793 | py | Python | Day 9/Blind Auction.py | anti-batman/100-Days-of-Code | 2ba087a8eacd86f23104349f3044baf9965d5073 | [
"MIT"
] | 72 | 2021-02-20T06:00:46.000Z | 2022-03-29T21:54:01.000Z | Day 9/Blind Auction.py | anti-batman/100-Days-of-Code | 2ba087a8eacd86f23104349f3044baf9965d5073 | [
"MIT"
] | 2 | 2021-06-05T17:39:16.000Z | 2022-01-30T08:58:14.000Z | Day 9/Blind Auction.py | anti-batman/100-Days-of-Code | 2ba087a8eacd86f23104349f3044baf9965d5073 | [
"MIT"
] | 21 | 2021-04-03T09:59:48.000Z | 2022-01-30T20:24:43.000Z | from replit import clear
from art import logo
print(logo)
bids = {}
bidding_finished = False
def find_highest_bidder(bidding_record):
highest_bid = 0
winner = ""
for bidder in bidding_record:
bid_amount = bidding_record[bidder]
if bid_amount > highest_bid:
highest_bid = bid_... | 24.78125 | 80 | 0.644388 | from replit import clear
from art import logo
print(logo)
bids = {}
bidding_finished = False
def find_highest_bidder(bidding_record):
highest_bid = 0
winner = ""
for bidder in bidding_record:
bid_amount = bidding_record[bidder]
if bid_amount > highest_bid:
highest_bid = bid_... | true | true |
f715181158ed97a842f823c3209fa5647bf6dec5 | 246 | py | Python | lightning_plus/api_basebone/app/client_urls.py | twocucao/lightning-plus | e69c81da9c15fdfc37355e0362ff7ed804e94b2a | [
"MIT"
] | 1 | 2021-04-15T14:52:12.000Z | 2021-04-15T14:52:12.000Z | lightning_plus/api_basebone/app/client_urls.py | twocucao/lightning | e69c81da9c15fdfc37355e0362ff7ed804e94b2a | [
"MIT"
] | null | null | null | lightning_plus/api_basebone/app/client_urls.py | twocucao/lightning | e69c81da9c15fdfc37355e0362ff7ed804e94b2a | [
"MIT"
] | null | null | null | from lightning_plus.api_basebone.drf.routers import SimpleRouter
from .upload import views as upload_views
router = SimpleRouter(custom_base_name="basebone-app")
router.register("upload", upload_views.UploadViewSet)
urlpatterns = router.urls
| 24.6 | 64 | 0.829268 | from lightning_plus.api_basebone.drf.routers import SimpleRouter
from .upload import views as upload_views
router = SimpleRouter(custom_base_name="basebone-app")
router.register("upload", upload_views.UploadViewSet)
urlpatterns = router.urls
| true | true |
f715182910b4d2b719d57bc37051be59f816ba91 | 2,850 | py | Python | curriculum/envs/maze/maze_swim/swimmer_env.py | coco-robotics/rllab-curriculum | f55b50224fcf5a9a5c064542eb0850a966cab223 | [
"MIT"
] | 115 | 2017-12-06T16:31:10.000Z | 2022-03-01T13:13:55.000Z | curriculum/envs/maze/maze_swim/swimmer_env.py | coco-robotics/rllab-curriculum | f55b50224fcf5a9a5c064542eb0850a966cab223 | [
"MIT"
] | 21 | 2017-11-15T18:28:16.000Z | 2021-04-22T15:26:45.000Z | curriculum/envs/maze/maze_swim/swimmer_env.py | coco-robotics/rllab-curriculum | f55b50224fcf5a9a5c064542eb0850a966cab223 | [
"MIT"
] | 46 | 2017-12-22T22:26:01.000Z | 2022-02-17T06:34:15.000Z | from rllab.envs.base import Step
from rllab.misc.overrides import overrides
from rllab.envs.mujoco.mujoco_env import MujocoEnv
import numpy as np
from rllab.core.serializable import Serializable
from rllab.misc import logger
from rllab.misc import autoargs
from contextlib import contextmanager
class SwimmerEnv(MujocoE... | 36.538462 | 92 | 0.626316 | from rllab.envs.base import Step
from rllab.misc.overrides import overrides
from rllab.envs.mujoco.mujoco_env import MujocoEnv
import numpy as np
from rllab.core.serializable import Serializable
from rllab.misc import logger
from rllab.misc import autoargs
from contextlib import contextmanager
class SwimmerEnv(MujocoE... | true | true |
f71519f0a0fdeeeaa35b6e3d88c07e3139a2deb6 | 24,935 | py | Python | tests/core/test_task.py | dsaxton/prefect | 2b7e9c33cfeedebdb6ce3a8e468ac130c3a48bbf | [
"Apache-2.0"
] | null | null | null | tests/core/test_task.py | dsaxton/prefect | 2b7e9c33cfeedebdb6ce3a8e468ac130c3a48bbf | [
"Apache-2.0"
] | null | null | null | tests/core/test_task.py | dsaxton/prefect | 2b7e9c33cfeedebdb6ce3a8e468ac130c3a48bbf | [
"Apache-2.0"
] | null | null | null | import inspect
import logging
from datetime import timedelta
from typing import Any, Tuple
import pytest
import prefect
from prefect.core import Edge, Flow, Parameter, Task
from prefect.engine.cache_validators import all_inputs, duration_only, never_use
from prefect.engine.results import PrefectResult, LocalResult
fr... | 29.404481 | 105 | 0.585121 | import inspect
import logging
from datetime import timedelta
from typing import Any, Tuple
import pytest
import prefect
from prefect.core import Edge, Flow, Parameter, Task
from prefect.engine.cache_validators import all_inputs, duration_only, never_use
from prefect.engine.results import PrefectResult, LocalResult
fr... | true | true |
f7151a63c16bac48a603b6c0bc9d747a9402ec51 | 5,462 | py | Python | openstates/openstates-master/openstates/wv/actions.py | Jgorsick/Advocacy_Angular | 8906af3ba729b2303880f319d52bce0d6595764c | [
"CC-BY-4.0"
] | null | null | null | openstates/openstates-master/openstates/wv/actions.py | Jgorsick/Advocacy_Angular | 8906af3ba729b2303880f319d52bce0d6595764c | [
"CC-BY-4.0"
] | null | null | null | openstates/openstates-master/openstates/wv/actions.py | Jgorsick/Advocacy_Angular | 8906af3ba729b2303880f319d52bce0d6595764c | [
"CC-BY-4.0"
] | null | null | null | '''
'''
import re
from billy.scrape.actions import Rule, BaseCategorizer
committees = [
u"Veterans' Affairs",
u'Agriculture and Agri-business Committee',
u'Agriculture',
u'Banking and Insurance',
u'Banking',
u'Children, Juveniles and Other Issues',
u'Constitutional Revision',
u'Counci... | 36.413333 | 83 | 0.598499 | import re
from billy.scrape.actions import Rule, BaseCategorizer
committees = [
u"Veterans' Affairs",
u'Agriculture and Agri-business Committee',
u'Agriculture',
u'Banking and Insurance',
u'Banking',
u'Children, Juveniles and Other Issues',
u'Constitutional Revision',
u'Council of Fina... | true | true |
f7151a7c2677a8ca25b3ce9f5abd7ef3436c4d4b | 576 | py | Python | demo/django/tutorial/polls/admin.py | sirex/htsql | 52275f6a584b412c109822d2ed2a5e69ac522cdf | [
"Apache-2.0"
] | 15 | 2020-02-11T11:24:34.000Z | 2022-03-03T20:46:34.000Z | demo/django/tutorial/polls/admin.py | sirex/htsql | 52275f6a584b412c109822d2ed2a5e69ac522cdf | [
"Apache-2.0"
] | 1 | 2020-02-13T14:08:34.000Z | 2020-02-13T14:16:04.000Z | demo/django/tutorial/polls/admin.py | sirex/htsql | 52275f6a584b412c109822d2ed2a5e69ac522cdf | [
"Apache-2.0"
] | 2 | 2020-02-13T14:10:06.000Z | 2021-02-25T04:36:05.000Z | from polls.models import Poll, Choice
from django.contrib import admin
class ChoiceInline(admin.TabularInline):
model = Choice
extra = 3
class PollAdmin(admin.ModelAdmin):
fieldsets = [
(None, {'fields': ['question']}),
('Date information', {'fields': ['pub_date'], 'classes':... | 28.8 | 80 | 0.645833 | from polls.models import Poll, Choice
from django.contrib import admin
class ChoiceInline(admin.TabularInline):
model = Choice
extra = 3
class PollAdmin(admin.ModelAdmin):
fieldsets = [
(None, {'fields': ['question']}),
('Date information', {'fields': ['pub_date'], 'classes':... | true | true |
f7151a8b4f49161c83c9c9662463097d49d3993d | 2,251 | py | Python | Lib/lib2to3/fixes/fix_renames.py | sireliah/polish-python | 605df4944c2d3bc25f8bf6964b274c0a0d297cc3 | [
"PSF-2.0"
] | 1 | 2018-06-21T18:21:24.000Z | 2018-06-21T18:21:24.000Z | Lib/lib2to3/fixes/fix_renames.py | sireliah/polish-python | 605df4944c2d3bc25f8bf6964b274c0a0d297cc3 | [
"PSF-2.0"
] | null | null | null | Lib/lib2to3/fixes/fix_renames.py | sireliah/polish-python | 605df4944c2d3bc25f8bf6964b274c0a0d297cc3 | [
"PSF-2.0"
] | null | null | null | """Fix incompatible renames
Fixes:
* sys.maxint -> sys.maxsize
"""
# Author: Christian Heimes
# based on Collin Winter's fix_import
# Local imports
z .. zaimportuj fixer_base
z ..fixer_util zaimportuj Name, attr_chain
MAPPING = {"sys": {"maxint" : "maxsize"},
}
LOOKUP = {}
def alternates(members):
... | 31.704225 | 81 | 0.571746 | """Fix incompatible renames
Fixes:
* sys.maxint -> sys.maxsize
"""
# Local imports
z .. zaimportuj fixer_base
z ..fixer_util zaimportuj Name, attr_chain
MAPPING = {"sys": {"maxint" : "maxsize"},
}
LOOKUP = {}
def alternates(members):
zwróć "(" + "|".join(map(repr, members)) + ")"
def build_patter... | false | true |
f7151aa262aee8fc1d6bd3aea5334c778feb0cc4 | 219 | py | Python | parsyfiles/profiling/exec_on_test_by_type.py | smarie/python-simple-file-collection-parsing-framework | 344b37e1151e8d4e7c2ee49ae09d6568715ae64e | [
"BSD-3-Clause"
] | null | null | null | parsyfiles/profiling/exec_on_test_by_type.py | smarie/python-simple-file-collection-parsing-framework | 344b37e1151e8d4e7c2ee49ae09d6568715ae64e | [
"BSD-3-Clause"
] | null | null | null | parsyfiles/profiling/exec_on_test_by_type.py | smarie/python-simple-file-collection-parsing-framework | 344b37e1151e8d4e7c2ee49ae09d6568715ae64e | [
"BSD-3-Clause"
] | null | null | null | import os
import pytest
THIS_DIR = os.path.dirname(os.path.abspath(__file__))
if __name__ == '__main__':
# for profiling purposes...
pytest.main(os.path.join(THIS_DIR, '../tests/test_parsyfiles_by_type.py'))
| 21.9 | 78 | 0.721461 | import os
import pytest
THIS_DIR = os.path.dirname(os.path.abspath(__file__))
if __name__ == '__main__':
pytest.main(os.path.join(THIS_DIR, '../tests/test_parsyfiles_by_type.py'))
| true | true |
f7151ade5974d9fd42771cf7639194622d837538 | 5,015 | py | Python | src/phoebe_shelves_clt/manage.py | anthony-agbay/owl_shelves_clt | da09e1579f8d134a585b50de2f8da38c889c23b9 | [
"MIT"
] | 1 | 2021-05-04T03:06:13.000Z | 2021-05-04T03:06:13.000Z | src/phoebe_shelves_clt/manage.py | anthony-agbay/phoebe-shelves-clt | da09e1579f8d134a585b50de2f8da38c889c23b9 | [
"MIT"
] | null | null | null | src/phoebe_shelves_clt/manage.py | anthony-agbay/phoebe-shelves-clt | da09e1579f8d134a585b50de2f8da38c889c23b9 | [
"MIT"
] | null | null | null | """ Launching point and supporting functions for database management tools.
This module serves as the launching point for the database management tools.
Backend-specific implementations are located within their specific modules and
common functions and methods are included in this file.
"""
import numpy as np
from t... | 36.079137 | 84 | 0.664008 |
import numpy as np
from typing import Tuple, Dict
from phoebe_shelves_clt.csv_backend import manage_csv
from phoebe_shelves_clt.sql_backend import manage_sql
from phoebe_shelves_clt.utils import data_model
from phoebe_shelves_clt.utils import sql_api
def prompt_for_rating(prompt: str):
rating = input(prompt)
... | true | true |
f7151b2281b1a36bdf79beb5dc8c7718f7a9c8cb | 4,165 | py | Python | ansible/roles/relay/files/fanout/hls.py | fkusei/cm | 7a6b20f5c57bb90a3568cbbf67d72f3a41721c89 | [
"MIT"
] | null | null | null | ansible/roles/relay/files/fanout/hls.py | fkusei/cm | 7a6b20f5c57bb90a3568cbbf67d72f3a41721c89 | [
"MIT"
] | null | null | null | ansible/roles/relay/files/fanout/hls.py | fkusei/cm | 7a6b20f5c57bb90a3568cbbf67d72f3a41721c89 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os
import time
import itertools
import contextlib
import fanout_utils
def fanout_hls(context):
context += {
"starttime": int(time.time()),
}
cleanup(context)
context += calculate_map_and_varmap(context)
generate_master_playlists(context)
fanout(context)
print("Cleaning up")... | 28.141892 | 188 | 0.693637 |
import os
import time
import itertools
import contextlib
import fanout_utils
def fanout_hls(context):
context += {
"starttime": int(time.time()),
}
cleanup(context)
context += calculate_map_and_varmap(context)
generate_master_playlists(context)
fanout(context)
print("Cleaning up")
cleanup(context)
de... | true | true |
f7151b5dd7ec24f50098503c2316a5b09f21b826 | 1,104 | py | Python | tests/test_httpclient.py | singulret/pyrabbit | b7efb24e9f1da5ad903e6b8699f807a144acb1a0 | [
"BSD-3-Clause"
] | 41 | 2015-01-27T15:10:28.000Z | 2021-11-03T17:57:49.000Z | tests/test_httpclient.py | singulret/pyrabbit | b7efb24e9f1da5ad903e6b8699f807a144acb1a0 | [
"BSD-3-Clause"
] | 34 | 2015-01-21T17:11:00.000Z | 2022-01-07T15:21:36.000Z | tests/test_httpclient.py | singulret/pyrabbit | b7efb24e9f1da5ad903e6b8699f807a144acb1a0 | [
"BSD-3-Clause"
] | 58 | 2015-01-28T19:23:43.000Z | 2022-03-20T08:14:05.000Z | try:
import unittest2 as unittest
except ImportError:
import unittest
import sys
sys.path.append('..')
from pyrabbit import http
class TestHTTPClient(unittest.TestCase):
"""
Except for the init test, these are largely functional tests that
require a RabbitMQ management API to be available on loc... | 28.307692 | 77 | 0.707428 | try:
import unittest2 as unittest
except ImportError:
import unittest
import sys
sys.path.append('..')
from pyrabbit import http
class TestHTTPClient(unittest.TestCase):
testhost = 'localhost:15672'
testuser = 'guest'
testpass = 'guest'
def setUp(self):
self.c = http.HTTPClient(self.... | true | true |
f7151c247a299ed10ae06ffcbdf0a28cce6a04c2 | 18,329 | py | Python | src/olympia/editors/views_themes.py | mstriemer/olympia | 2e700c20e0a8ed3f0dd389d1521c3798bf7ed7f7 | [
"BSD-3-Clause"
] | 1 | 2020-04-07T07:21:25.000Z | 2020-04-07T07:21:25.000Z | src/olympia/editors/views_themes.py | mstriemer/olympia | 2e700c20e0a8ed3f0dd389d1521c3798bf7ed7f7 | [
"BSD-3-Clause"
] | null | null | null | src/olympia/editors/views_themes.py | mstriemer/olympia | 2e700c20e0a8ed3f0dd389d1521c3798bf7ed7f7 | [
"BSD-3-Clause"
] | 2 | 2018-03-04T00:11:22.000Z | 2019-12-14T09:45:55.000Z | import datetime
import json
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django.db.models import Q
from django.forms.formsets import formset_factory
from django.shortcuts import get_object_or_404, redirect
from django.utils.datastructures import MultiValueDictKeyError
fro... | 36.29505 | 79 | 0.634132 | import datetime
import json
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django.db.models import Q
from django.forms.formsets import formset_factory
from django.shortcuts import get_object_or_404, redirect
from django.utils.datastructures import MultiValueDictKeyError
fro... | true | true |
f7151d1d59556e1af3df7bc93bfb1d6c1c861363 | 1,217 | py | Python | django_2gis_maps/tests/test_widget.py | NursErgesh/django_2gis_maps | 42f561519eeb769c8713fdb0cd394313a657eb9f | [
"MIT"
] | 7 | 2018-07-30T03:20:33.000Z | 2020-09-15T08:20:31.000Z | django_2gis_maps/tests/test_widget.py | NursErgesh/django-2gis-maps | 42f561519eeb769c8713fdb0cd394313a657eb9f | [
"MIT"
] | 4 | 2020-04-13T11:22:57.000Z | 2020-09-16T00:24:54.000Z | django_2gis_maps/tests/test_widget.py | NursErgesh/django-2gis-maps | 42f561519eeb769c8713fdb0cd394313a657eb9f | [
"MIT"
] | 2 | 2018-07-29T17:55:12.000Z | 2020-09-16T05:41:12.000Z | from django import test
from django.conf import settings
from django_2gis_maps.widgets import DoubleGisMapsAddressWidget
class WidgetTests(test.TestCase):
def test_render_returns_xxxxxxx(self):
widget = DoubleGisMapsAddressWidget()
results = widget.render('name', 'value', attrs={'a1': 1, 'a2': 2})... | 45.074074 | 89 | 0.665571 | from django import test
from django.conf import settings
from django_2gis_maps.widgets import DoubleGisMapsAddressWidget
class WidgetTests(test.TestCase):
def test_render_returns_xxxxxxx(self):
widget = DoubleGisMapsAddressWidget()
results = widget.render('name', 'value', attrs={'a1': 1, 'a2': 2})... | true | true |
f7151d81ac3753cf1b8aa541756a774f0dd9b255 | 198 | py | Python | Harvard's CS50/ints.py | RichelleT/Python | 87aff2392964ca5630ffa44225f9e13d040cdd91 | [
"MIT"
] | 1 | 2019-03-04T05:43:35.000Z | 2019-03-04T05:43:35.000Z | Harvard's CS50/ints.py | RichelleT/Python | 87aff2392964ca5630ffa44225f9e13d040cdd91 | [
"MIT"
] | null | null | null | Harvard's CS50/ints.py | RichelleT/Python | 87aff2392964ca5630ffa44225f9e13d040cdd91 | [
"MIT"
] | null | null | null | from cs50 import get_int
x = get_int("x: ")
y = get_int("y: ")
print(f"x + y = {x + y}")
print(f"x - y = {x - y}")
print(f"x * y = {x * y}")
print(f"x / y = {x / y}")
print(f"x mod y = {x % y}")
| 16.5 | 27 | 0.464646 | from cs50 import get_int
x = get_int("x: ")
y = get_int("y: ")
print(f"x + y = {x + y}")
print(f"x - y = {x - y}")
print(f"x * y = {x * y}")
print(f"x / y = {x / y}")
print(f"x mod y = {x % y}")
| true | true |
f7151db4fc3ad6adda43fc7246c135eb4b5779ae | 1,370 | py | Python | cornflow-server/migrations/versions/a472b5ad50b7_.py | ggsdc/corn | 4c17c46a70f95b8882bcb6a55ef7daa1f69e0456 | [
"MIT"
] | 2 | 2020-07-09T20:58:47.000Z | 2020-07-20T20:40:46.000Z | cornflow-server/migrations/versions/a472b5ad50b7_.py | baobabsoluciones/cornflow | bd7cae22107e5fe148704d5f41d4f58f9c410b40 | [
"Apache-2.0"
] | 2 | 2022-03-31T08:42:10.000Z | 2022-03-31T12:05:23.000Z | cornflow-server/migrations/versions/a472b5ad50b7_.py | ggsdc/corn | 4c17c46a70f95b8882bcb6a55ef7daa1f69e0456 | [
"MIT"
] | null | null | null | """
Modified state columns in executions table
Revision ID: a472b5ad50b7
Revises: e1a50dae1ac9
Create Date: 2021-01-21 13:25:45.815775
"""
import sqlalchemy as sa
from alembic import op
# TODO: import DEFAULT EXECUTION CODE HERE
# revision identifiers, used by Alembic.
revision = "a472b5ad50b7"
down_revision = "e1a... | 24.909091 | 85 | 0.621898 | import sqlalchemy as sa
from alembic import op
revision = "a472b5ad50b7"
down_revision = "e1a50dae1ac9"
branch_labels = None
depends_on = None
def upgrade():
op.add_column(
"executions",
sa.Column(
"state",
sa.SmallInteger(),
nullable=False,
se... | true | true |
f7151e12353ec6f42deedb97b338a0018cfc050e | 6,304 | py | Python | sdk/python/pulumi_gcp/compute/route.py | stack72/pulumi-gcp | e63e4ed3129fe8e64e4869f4839ba2b20f57cb57 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_gcp/compute/route.py | stack72/pulumi-gcp | e63e4ed3129fe8e64e4869f4839ba2b20f57cb57 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_gcp/compute/route.py | stack72/pulumi-gcp | e63e4ed3129fe8e64e4869f4839ba2b20f57cb57 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import json
import warnings
import pulumi
import pulumi.runtime
from .. import utilities, tables
class Route(pulumi.CustomResource):
... | 43.777778 | 372 | 0.682265 |
import json
import warnings
import pulumi
import pulumi.runtime
from .. import utilities, tables
class Route(pulumi.CustomResource):
description: pulumi.Output[str]
dest_range: pulumi.Output[str]
name: pulumi.Output[str]
network: pulumi.Output[str]
next_hop_gateway: pulumi.Output[str]
next_hop... | true | true |
f7151ede1353f7e6906097e8ade4346f2390410d | 3,022 | py | Python | code/main.py | ynandwan/step-function-approximator | 7f4a59841d6d938e0cc97e726ce6ba6b65a6267f | [
"MIT"
] | null | null | null | code/main.py | ynandwan/step-function-approximator | 7f4a59841d6d938e0cc97e726ce6ba6b65a6267f | [
"MIT"
] | null | null | null | code/main.py | ynandwan/step-function-approximator | 7f4a59841d6d938e0cc97e726ce6ba6b65a6267f | [
"MIT"
] | null | null | null | from __future__ import print_function
import os
import utils
import argparse
import point
import one_step_approximator
from IPython.core.debugger import Pdb
MAX = float('inf')
def print_output(output,output_file):
if output_file == '':
fh = None
else:
fh = open(output_file,'w')
#
pri... | 31.479167 | 91 | 0.603905 | from __future__ import print_function
import os
import utils
import argparse
import point
import one_step_approximator
from IPython.core.debugger import Pdb
MAX = float('inf')
def print_output(output,output_file):
if output_file == '':
fh = None
else:
fh = open(output_file,'w')
print... | true | true |
f71521568544b636c6596c9aea9ff6e5391602ad | 27,240 | py | Python | src/geopackage/_wkb.py | karmic-creditor/pygeopackage | 13366d54f80bd827b84c6538b9b08b6656111ef4 | [
"Apache-2.0"
] | null | null | null | src/geopackage/_wkb.py | karmic-creditor/pygeopackage | 13366d54f80bd827b84c6538b9b08b6656111ef4 | [
"Apache-2.0"
] | null | null | null | src/geopackage/_wkb.py | karmic-creditor/pygeopackage | 13366d54f80bd827b84c6538b9b08b6656111ef4 | [
"Apache-2.0"
] | null | null | null | """
This code has been a variation of geomet: https://github.com/geomet/geomet
It has been modified under the Apache 2.0 license to fit the needs of the
Esri JSON specificaction as defined here: https://developers.arcgis.com/documentation/common-data-types/geometry-objects.htm
"""
import binascii
import struct
from ._... | 31.310345 | 124 | 0.615932 | import binascii
import struct
from ._utils import block_splitter
from ._utils import take
from ._utils import as_bin_str
from ._utils import flatten_multi_dim
from itertools import chain
BIG_ENDIAN = b'\x00'
LITTLE_ENDIAN = b'\x01'
SRID_FLAG = b'\x20'
WKB_2D = {
'Point': b'\x00\x00\x00\x01',
'LineString': b'... | true | true |
f715225dc353f1b54d4a6b1bdb2fd62dea0595db | 1,881 | py | Python | alipay/aop/api/domain/ContentPrizeInfoModel.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/ContentPrizeInfoModel.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/ContentPrizeInfoModel.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.constant.ParamConstants import *
class ContentPrizeInfoModel(object):
def __init__(self):
self._prize_id = None
self._prize_logo = None
self._prize_name = None
@property
def prize_id(self... | 26.492958 | 71 | 0.585327 | import simplejson as json
from alipay.aop.api.constant.ParamConstants import *
class ContentPrizeInfoModel(object):
def __init__(self):
self._prize_id = None
self._prize_logo = None
self._prize_name = None
@property
def prize_id(self):
return self._prize_id
@prize_i... | true | true |
f71522b5c9555ec99171925ed4d27c211020afac | 28,605 | py | Python | pandas/io/common.py | stragu/pandas | b8890eb33b40993da00656f16c65070c42429f0d | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | pandas/io/common.py | stragu/pandas | b8890eb33b40993da00656f16c65070c42429f0d | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | pandas/io/common.py | stragu/pandas | b8890eb33b40993da00656f16c65070c42429f0d | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | """Common IO api utilities"""
from __future__ import annotations
import bz2
import codecs
from collections import abc
import dataclasses
import gzip
from io import BufferedIOBase, BytesIO, RawIOBase, StringIO, TextIOWrapper
import mmap
import os
from typing import IO, Any, AnyStr, Dict, List, Mapping, Optional, Tuple,... | 32.917146 | 87 | 0.635833 | from __future__ import annotations
import bz2
import codecs
from collections import abc
import dataclasses
import gzip
from io import BufferedIOBase, BytesIO, RawIOBase, StringIO, TextIOWrapper
import mmap
import os
from typing import IO, Any, AnyStr, Dict, List, Mapping, Optional, Tuple, Union, cast
from urllib.parse... | true | true |
f715230aa02adaf67d5dae2703f0b43403c478f7 | 4,874 | py | Python | pyhanabi/common_utils/helper.py | ravihammond/hanabi-convention-adaptation | 5dafa91742de8e8d5810e8213e0e2771818b2f54 | [
"MIT"
] | 1 | 2022-03-24T19:41:22.000Z | 2022-03-24T19:41:22.000Z | pyhanabi/common_utils/helper.py | ravihammond/hanabi-convention-adaptation | 5dafa91742de8e8d5810e8213e0e2771818b2f54 | [
"MIT"
] | null | null | null | pyhanabi/common_utils/helper.py | ravihammond/hanabi-convention-adaptation | 5dafa91742de8e8d5810e8213e0e2771818b2f54 | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
import os
import random
import numpy as np
import torch
from torch import nn
from typing import Dict
def to_device(data... | 26.48913 | 77 | 0.586992 | import os
import random
import numpy as np
import torch
from torch import nn
from typing import Dict
def to_device(data, device):
if isinstance(data, torch.Tensor):
return data.to(device)
elif isinstance(data, dict):
return {k: to_device(v, device) for k, v in data.items()}
elif isinstanc... | true | true |
f715230f4f2ce5d2a6cd06dbc6f0136712d5c553 | 4,871 | py | Python | pymetalog/pdf_quantile_functions.py | gboehl/pymetalog | bcc1bfbf658f44f48d63a594d2b9de8b700a11a7 | [
"MIT"
] | null | null | null | pymetalog/pdf_quantile_functions.py | gboehl/pymetalog | bcc1bfbf658f44f48d63a594d2b9de8b700a11a7 | [
"MIT"
] | null | null | null | pymetalog/pdf_quantile_functions.py | gboehl/pymetalog | bcc1bfbf658f44f48d63a594d2b9de8b700a11a7 | [
"MIT"
] | null | null | null | import numpy as np
from .support import pdfMetalog, quantileMetalog
def pdf_quantile_builder(temp, y, term_limit, bounds, boundedness):
"""Builds the metalog pdf and quantile arrays based on the a coefficients found by fitting metalog distribution.
Args:
temp (:obj: `numpy.ndarray` of type float): Ar... | 39.282258 | 133 | 0.583453 | import numpy as np
from .support import pdfMetalog, quantileMetalog
def pdf_quantile_builder(temp, y, term_limit, bounds, boundedness):
q_dict = {}
m = pdfMetalog(temp, y[0], term_limit, bounds=bounds, boundedness=boundedness)
for j in range(2, len(y) + 1):
tempPDF = pdfMetalog(
... | true | true |
f7152491c656ec2239d0ca0d5473ee941e003d64 | 24,833 | py | Python | airbyte-integrations/connectors/source-s3/source_s3/source_files_abstract/stream.py | Mu-L/airbyte | d6c684b3e495f1cb5c08d94e57ab55288ce47ea6 | [
"MIT"
] | 1 | 2022-02-02T20:42:41.000Z | 2022-02-02T20:42:41.000Z | airbyte-integrations/connectors/source-s3/source_s3/source_files_abstract/stream.py | Mu-L/airbyte | d6c684b3e495f1cb5c08d94e57ab55288ce47ea6 | [
"MIT"
] | 2 | 2021-09-30T16:58:58.000Z | 2021-11-26T17:58:59.000Z | airbyte-integrations/connectors/source-s3/source_s3/source_files_abstract/stream.py | Mu-L/airbyte | d6c684b3e495f1cb5c08d94e57ab55288ce47ea6 | [
"MIT"
] | 1 | 2022-03-18T21:58:33.000Z | 2022-03-18T21:58:33.000Z | #
# Copyright (c) 2021 Airbyte, Inc., all rights reserved.
#
import concurrent
import json
from abc import ABC, abstractmethod
from copy import deepcopy
from datetime import datetime
from functools import lru_cache
from operator import itemgetter
from traceback import format_exc
from typing import Any, Iterable, Iter... | 51.951883 | 150 | 0.663432 |
import concurrent
import json
from abc import ABC, abstractmethod
from copy import deepcopy
from datetime import datetime
from functools import lru_cache
from operator import itemgetter
from traceback import format_exc
from typing import Any, Iterable, Iterator, List, Mapping, MutableMapping, Optional, Tuple, Union
... | true | true |
f715250228b280bbd2a5350070a71e1887f4c22e | 36,247 | py | Python | lib/python3.7/site-packages/boltons/funcutils.py | nguyentranhoan/uit-mobile | 8546312b01373d94cf00c64f7eacb769e0f4ccce | [
"BSD-3-Clause"
] | null | null | null | lib/python3.7/site-packages/boltons/funcutils.py | nguyentranhoan/uit-mobile | 8546312b01373d94cf00c64f7eacb769e0f4ccce | [
"BSD-3-Clause"
] | null | null | null | lib/python3.7/site-packages/boltons/funcutils.py | nguyentranhoan/uit-mobile | 8546312b01373d94cf00c64f7eacb769e0f4ccce | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""Python's built-in :mod:`functools` module builds several useful
utilities on top of Python's first-class function
support. ``funcutils`` generally stays in the same vein, adding to and
correcting Python's standard metaprogramming facilities.
"""
from __future__ import print_function
import s... | 36.539315 | 118 | 0.585648 | from __future__ import print_function
import sys
import re
import inspect
import functools
import itertools
from types import MethodType, FunctionType
try:
xrange
make_method = MethodType
except NameError:
make_method = lambda desc, obj, obj_type: MethodType(desc, obj)
basestring = (str, bytes) ... | true | true |
f7152509f06d29375bdf82999b5fe6fe5470fe85 | 10,642 | py | Python | deslib/dcs/a_posteriori.py | vishalbelsare/DESlib | 64260ae7c6dd745ef0003cc6322c9f829c807708 | [
"BSD-3-Clause"
] | 310 | 2019-01-02T12:33:03.000Z | 2022-03-30T08:35:24.000Z | deslib/dcs/a_posteriori.py | vishalbelsare/DESlib | 64260ae7c6dd745ef0003cc6322c9f829c807708 | [
"BSD-3-Clause"
] | 95 | 2019-01-12T03:34:32.000Z | 2022-02-22T18:35:46.000Z | deslib/dcs/a_posteriori.py | vishalbelsare/DESlib | 64260ae7c6dd745ef0003cc6322c9f829c807708 | [
"BSD-3-Clause"
] | 51 | 2018-12-29T13:21:06.000Z | 2022-03-25T22:56:27.000Z | # coding=utf-8
# Author: Rafael Menelau Oliveira e Cruz <rafaelmenelau@gmail.com>
#
# License: BSD 3 clause
import numpy as np
from deslib.dcs.base import BaseDCS
class APosteriori(BaseDCS):
"""A Posteriori Dynamic classifier selection.
The A Posteriori method uses the probability of correct classificatio... | 44.157676 | 79 | 0.652603 |
import numpy as np
from deslib.dcs.base import BaseDCS
class APosteriori(BaseDCS):
def __init__(self, pool_classifiers=None, k=7, DFP=False, with_IH=False,
safe_k=None, IH_rate=0.30, selection_method='diff',
diff_thresh=0.1, random_state=None, knn_classifier='knn',
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.