hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
c3a6ae868af3da0da200ed7803a12bdbf4c3d2e6 | 408 | py | Python | searchApp/management/commands/reindex.py | kunalgrover05/google-appengine-django-search | 6260caa67772c91f2c18e876ffb3738f9a503219 | [
"BSD-2-Clause"
] | 1 | 2017-04-28T22:18:38.000Z | 2017-04-28T22:18:38.000Z | searchApp/management/commands/reindex.py | kunalgrover05/google-appengine-django-search | 6260caa67772c91f2c18e876ffb3738f9a503219 | [
"BSD-2-Clause"
] | null | null | null | searchApp/management/commands/reindex.py | kunalgrover05/google-appengine-django-search | 6260caa67772c91f2c18e876ffb3738f9a503219 | [
"BSD-2-Clause"
] | null | null | null | from django.core.management.base import BaseCommand
from searchApp.models import IndexModel
class Command(BaseCommand):
help = 'Sets all indexes as not processed to allow reindex'
def handle(self, *args, **options):
IndexModel.objects.filter(deleted=False).filter(processed=True).update(processed=Fals... | 37.090909 | 95 | 0.757353 |
c4d9b8b2a19282185374caea6f8e643a4f460902 | 1,749 | py | Python | mainGrabing.py | orangeYao/twiOpinion | 4bc8e58b609c7d45ed2d5726ede594f40f55d313 | [
"MIT"
] | null | null | null | mainGrabing.py | orangeYao/twiOpinion | 4bc8e58b609c7d45ed2d5726ede594f40f55d313 | [
"MIT"
] | null | null | null | mainGrabing.py | orangeYao/twiOpinion | 4bc8e58b609c7d45ed2d5726ede594f40f55d313 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import time
import os
import subprocess
import functions
def grabSetting():
word_to_grab = raw_input("The tag or keyword you wish to grab from Twitter: ") or "China"
#path = raw_input("The folder you wish to store information in (default as ./output): ") or "./output"
path = "./outpu... | 40.674419 | 121 | 0.58948 |
318e82b74a21866c3216afba99755b2a77cd89be | 4,650 | py | Python | tutorial-contents/405_DQN_Reinforcement_learning.py | Feng-XiaoYue/Pytorch-RL | 86a22a0ee3c8bfe94efb989c98ede25a283d564a | [
"MIT"
] | null | null | null | tutorial-contents/405_DQN_Reinforcement_learning.py | Feng-XiaoYue/Pytorch-RL | 86a22a0ee3c8bfe94efb989c98ede25a283d564a | [
"MIT"
] | null | null | null | tutorial-contents/405_DQN_Reinforcement_learning.py | Feng-XiaoYue/Pytorch-RL | 86a22a0ee3c8bfe94efb989c98ede25a283d564a | [
"MIT"
] | null | null | null | """
View more, visit my tutorial page: https://mofanpy.com/tutorials/
My Youtube Channel: https://www.youtube.com/user/MorvanZhou
More about Reinforcement learning: https://mofanpy.com/tutorials/machine-learning/reinforcement-learning/
Dependencies:
torch: 0.4
gym: 0.8.1
numpy
"""
import torch
import torch.nn as nn
im... | 34.701493 | 125 | 0.606237 |
cc3a0216e863231d48ca7ab19d170226f9fb7644 | 7,175 | py | Python | var/spack/repos/builtin/packages/ffmpeg/package.py | carlabguillen/spack | 7070bb892f9bdb5cf9e76e0eecd64f6cc5f4695c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1 | 2019-12-10T12:41:38.000Z | 2019-12-10T12:41:38.000Z | var/spack/repos/builtin/packages/ffmpeg/package.py | carlabguillen/spack | 7070bb892f9bdb5cf9e76e0eecd64f6cc5f4695c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 6 | 2022-02-26T11:44:34.000Z | 2022-03-12T12:14:50.000Z | var/spack/repos/builtin/packages/ffmpeg/package.py | carlabguillen/spack | 7070bb892f9bdb5cf9e76e0eecd64f6cc5f4695c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1 | 2019-10-29T09:08:17.000Z | 2019-10-29T09:08:17.000Z | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Ffmpeg(AutotoolsPackage):
"""FFmpeg is a complete, cross-platform solution to record,
... | 39.640884 | 96 | 0.639164 |
30cb1b8721370af46484f1b3124bfcbb36a4af20 | 546 | py | Python | tests/test_status.py | carltongibson/rich | bc8737ba238c86f32c94d6c203681592487ed0ca | [
"MIT"
] | 1 | 2020-12-24T08:24:11.000Z | 2020-12-24T08:24:11.000Z | tests/test_status.py | carltongibson/rich | bc8737ba238c86f32c94d6c203681592487ed0ca | [
"MIT"
] | 6 | 2021-12-31T12:25:06.000Z | 2022-02-14T12:29:11.000Z | tests/test_status.py | carltongibson/rich | bc8737ba238c86f32c94d6c203681592487ed0ca | [
"MIT"
] | null | null | null | from time import sleep
from rich.console import Console
from rich.status import Status
from rich.table import Table
def test_status():
console = Console(
color_system=None, width=80, legacy_windows=False, get_time=lambda: 0.0
)
status = Status("foo", console=console)
assert status.console ==... | 24.818182 | 80 | 0.703297 |
29ee8f5ac85848a24451a122c239f21be9c14d47 | 1,769 | py | Python | tests/core/actions/test_get_not_completed_tasks.py | Himon-SYNCRAFT/taskplus | 9e6293840941d0cb4fd7bac0f8ff66f8e72cc62b | [
"BSD-3-Clause"
] | null | null | null | tests/core/actions/test_get_not_completed_tasks.py | Himon-SYNCRAFT/taskplus | 9e6293840941d0cb4fd7bac0f8ff66f8e72cc62b | [
"BSD-3-Clause"
] | null | null | null | tests/core/actions/test_get_not_completed_tasks.py | Himon-SYNCRAFT/taskplus | 9e6293840941d0cb4fd7bac0f8ff66f8e72cc62b | [
"BSD-3-Clause"
] | null | null | null | from unittest import mock
import pytest
from taskplus.core.actions import GetNotCompletedTasksAction,\
GetNotCompletedTasksRequest
from taskplus.core.domain import Task
from taskplus.core.shared.response import ResponseFailure
@pytest.fixture
def tasks():
return [
Task(name='name1', content=[], stat... | 28.079365 | 80 | 0.725269 |
f2389efec65c9932077756f7bb8c32336b4c9572 | 2,265 | py | Python | tests/test.py | zephenryus/botw-mate | 52c078a2cc93ff45e7e4e1946c253b6181bbd42e | [
"MIT"
] | 1 | 2020-10-11T07:07:26.000Z | 2020-10-11T07:07:26.000Z | tests/test.py | zephenryus/botw-mate | 52c078a2cc93ff45e7e4e1946c253b6181bbd42e | [
"MIT"
] | null | null | null | tests/test.py | zephenryus/botw-mate | 52c078a2cc93ff45e7e4e1946c253b6181bbd42e | [
"MIT"
] | 1 | 2020-10-11T07:07:29.000Z | 2020-10-11T07:07:29.000Z | import filecmp
import hashlib
import json
import mate
def mate_to_json():
"""
Tests reading of mate file and exports data as a json file
"""
data = mate.read_mate("assets/5000000000.mate")
print("Saving file output/5000000000.mate.json...")
with open("output/5000000000.mate.json", "w+") as o... | 29.038462 | 112 | 0.679912 |
192e356c7f8478e719c54a3697298779f0ddbd6e | 267 | py | Python | python/setup.py | badinmath/approxmc | aed834a1a253e4dfeb296cf907da5e4b68b4759c | [
"MIT"
] | 25 | 2018-11-25T22:16:20.000Z | 2020-06-23T11:07:36.000Z | python/setup.py | badinmath/approxmc | aed834a1a253e4dfeb296cf907da5e4b68b4759c | [
"MIT"
] | 12 | 2018-12-20T07:17:42.000Z | 2020-05-23T08:34:49.000Z | python/setup.py | badinmath/approxmc | aed834a1a253e4dfeb296cf907da5e4b68b4759c | [
"MIT"
] | 14 | 2018-11-30T06:51:47.000Z | 2020-05-24T12:07:25.000Z | from distutils.core import setup, Extension
pyapproxmc_module = Extension(
'pyapproxmc',
sources=['src/pyapproxmc.cpp'],
libraries=['approxmc', 'cryptominisat5'],
language='C++', )
setup(
name='pyapproxmc',
ext_modules=[pyapproxmc_module]
)
| 20.538462 | 45 | 0.685393 |
be885ff2fbb2444659d5831c11884e1bf6f16054 | 1,803 | py | Python | linearEquation.py | thebillington/linearEquationML | 4891fcad24543b13be7098cd409393e4bd7e3982 | [
"MIT"
] | null | null | null | linearEquation.py | thebillington/linearEquationML | 4891fcad24543b13be7098cd409393e4bd7e3982 | [
"MIT"
] | null | null | null | linearEquation.py | thebillington/linearEquationML | 4891fcad24543b13be7098cd409393e4bd7e3982 | [
"MIT"
] | null | null | null | # Disable compatability warnings
import os
os.environ['TF_CPP_MIN_LOG_LEVEL']='2'
# Import the tensorflow library
import tensorflow as tf
# Create a new tf session
sess = tf.Session()
# Store our mx + c equation variables
m = tf.Variable([.3], tf.float32)
c = tf.Variable([-.3], tf.float32)
x = tf.placeholder(tf.floa... | 31.631579 | 168 | 0.703272 |
d66d09b5d8f7b3655b8f04494f1fc54c03d2da33 | 4,770 | py | Python | news_scraping/main.py | autumnlewjb/NewsScraping | 0eec56495966cc1b5052a541638d0629cd29dff5 | [
"MIT"
] | 1 | 2020-10-24T17:13:22.000Z | 2020-10-24T17:13:22.000Z | news_scraping/main.py | autumnlewjb/NewsScraping | 0eec56495966cc1b5052a541638d0629cd29dff5 | [
"MIT"
] | 1 | 2021-03-31T20:04:06.000Z | 2021-03-31T20:04:06.000Z | news_scraping/main.py | autumnlewjb/NewsScraping | 0eec56495966cc1b5052a541638d0629cd29dff5 | [
"MIT"
] | null | null | null | import re
from pathlib import Path
from selenium import webdriver
from bs4 import BeautifulSoup as bs
from time import sleep
import os
from datetime import datetime
from news_scraping.month import month_in_words
from news_scraping.url_list import news_link
from news_scraping.notification import Notification
def crea... | 29.263804 | 107 | 0.564151 |
67f83aab92b2cc5b8c1c333ebc60a5a527e4a81c | 238 | py | Python | day019/main.py | rainleander/100daysofcode | 0391170af80b251e7fb3a78a60b55c3145e4551a | [
"Apache-2.0"
] | 8 | 2021-01-25T09:14:41.000Z | 2021-11-24T12:29:26.000Z | day019/main.py | rainleander/100daysofcode | 0391170af80b251e7fb3a78a60b55c3145e4551a | [
"Apache-2.0"
] | null | null | null | day019/main.py | rainleander/100daysofcode | 0391170af80b251e7fb3a78a60b55c3145e4551a | [
"Apache-2.0"
] | null | null | null | # Higher Order Functions and Event Listening
from turtle import Turtle, Screen
tim = Turtle()
screen = Screen()
def move_forward():
tim.forward(10)
screen.listen()
screen.onkey(key="space", fun=move_forward)
screen.exitonclick()
| 15.866667 | 44 | 0.739496 |
181b4e47c5db765492f948a5f9a356c6caf1b473 | 3,126 | py | Python | pureples/hyperneat/hyperneat.py | kevinrpb/pureples | c591fefd5b20085f1d0537553631e29733374b16 | [
"MIT"
] | null | null | null | pureples/hyperneat/hyperneat.py | kevinrpb/pureples | c591fefd5b20085f1d0537553631e29733374b16 | [
"MIT"
] | null | null | null | pureples/hyperneat/hyperneat.py | kevinrpb/pureples | c591fefd5b20085f1d0537553631e29733374b16 | [
"MIT"
] | null | null | null | import neat
# Creates a recurrent network using a cppn and a substrate.
def create_phenotype_network(cppn, substrate, activation_function="sigmoid"):
input_coordinates = substrate.input_coordinates
output_coordinates = substrate.output_coordinates
hidden_coordinates = substrate.hidden_coordinates # List... | 34.733333 | 114 | 0.639795 |
bcba2e505c86082a992d168eed91075aa4d9e9ac | 24,630 | py | Python | python/triton/ops/blocksparse/matmul.py | shauheen/triton | 12b6158c5cbc10c56f935985e6f466c9867d9238 | [
"MIT"
] | 3,352 | 2021-07-28T16:03:44.000Z | 2022-03-31T15:36:36.000Z | python/triton/ops/blocksparse/matmul.py | shauheen/triton | 12b6158c5cbc10c56f935985e6f466c9867d9238 | [
"MIT"
] | 169 | 2021-07-28T09:10:38.000Z | 2022-03-31T17:22:19.000Z | python/triton/ops/blocksparse/matmul.py | shauheen/triton | 12b6158c5cbc10c56f935985e6f466c9867d9238 | [
"MIT"
] | 204 | 2021-07-27T20:58:22.000Z | 2022-03-31T16:45:45.000Z | import triton
import triton.language as tl
import triton._C.libtriton as libtriton
import torch
# ********************************************************
# --------------------------------------------------------
# Sparse = Dense x Dense (SDD)
# This operation uses super-blocking to make sure that
# it's done efficie... | 39.661836 | 126 | 0.566829 |
a99fcb5b144a094a974b7bab5d0cd24188372d79 | 599 | py | Python | codigo/Live160/exemplo_02.py | BrunoPontesLira/live-de-python | da6e463a89ed90d9efaa1c34088ab6460e949de1 | [
"MIT"
] | 572 | 2018-04-03T03:17:08.000Z | 2022-03-31T19:05:32.000Z | codigo/Live160/exemplo_02.py | BrunoPontesLira/live-de-python | da6e463a89ed90d9efaa1c34088ab6460e949de1 | [
"MIT"
] | 176 | 2018-05-18T15:56:16.000Z | 2022-03-28T20:39:07.000Z | codigo/Live160/exemplo_02.py | BrunoPontesLira/live-de-python | da6e463a89ed90d9efaa1c34088ab6460e949de1 | [
"MIT"
] | 140 | 2018-04-18T13:59:11.000Z | 2022-03-29T00:43:49.000Z | from exemplo_01 import Pessoa, Grupo, Nota
eduardo = Pessoa(
nome='eduardo',
idade=18,
senha='1234567',
email='eu@dunossauro.live'
)
try:
eduardo.save()
Pessoa.create(
nome='Fausto',
idade=3,
email='fausto@live',
senha='7654321'
)
except:
...
pessoas ... | 19.322581 | 82 | 0.554257 |
8a9b0487329888d6ef011e4ce9bbea81af398d7b | 4,592 | py | Python | git/refs/reference.py | sampalest/GitPython | 8a1f87d69b128e9e25c6718269688c2c35414a4f | [
"BSD-3-Clause"
] | null | null | null | git/refs/reference.py | sampalest/GitPython | 8a1f87d69b128e9e25c6718269688c2c35414a4f | [
"BSD-3-Clause"
] | null | null | null | git/refs/reference.py | sampalest/GitPython | 8a1f87d69b128e9e25c6718269688c2c35414a4f | [
"BSD-3-Clause"
] | null | null | null | from git.util import (
LazyMixin,
IterableObj,
)
from .symbolic import SymbolicReference
__all__ = ["Reference"]
#{ Utilities
def require_remote_ref_path(func):
"""A decorator raising a TypeError if we are not a valid remote, based on the path"""
def wrapper(self, *args):
if not self.is_re... | 36.15748 | 102 | 0.62892 |
004f5f421090b78b9f9da83dd710c6f6eb112286 | 2,886 | py | Python | const.py | Ardarmy-best/ardarmy-best | cf97d895663f91ddf07342f43db6bb24846ee43b | [
"MIT"
] | null | null | null | const.py | Ardarmy-best/ardarmy-best | cf97d895663f91ddf07342f43db6bb24846ee43b | [
"MIT"
] | null | null | null | const.py | Ardarmy-best/ardarmy-best | cf97d895663f91ddf07342f43db6bb24846ee43b | [
"MIT"
] | null | null | null | from datetime import datetime
XML = """<?xml version="1.0"?>
<cross-domain-policy>
<allow-access-from domain="*" to-ports="*" />
</cross-domain-policy>
""".encode()
MAX_NAME_LEN = 70
ROOM_LIMIT = 40
EVENT_ROOM_LIMIT = 40
FREE_GOLD = True
room_items = [{"tpid": "wall15", "d": 3, "oid": 1, "x": 0.0, "y": 0.0,
... | 41.228571 | 71 | 0.340263 |
39ee92825813c6a6f3d49c932b8a7d43e8163d47 | 2,328 | py | Python | openomics_web/layouts/clinical_view.py | JonnyTran/open-omics | ef5db2dc2fdf486ee5e9fa4e0cf5be61b4531232 | [
"MIT"
] | 12 | 2021-01-14T19:33:48.000Z | 2022-01-06T16:13:03.000Z | openomics_web/layouts/clinical_view.py | JonnyTran/open-omics | ef5db2dc2fdf486ee5e9fa4e0cf5be61b4531232 | [
"MIT"
] | 13 | 2020-12-31T20:38:11.000Z | 2021-11-24T06:21:12.000Z | openomics_web/layouts/clinical_view.py | JonnyTran/open-omics | ef5db2dc2fdf486ee5e9fa4e0cf5be61b4531232 | [
"MIT"
] | 7 | 2021-02-08T13:42:01.000Z | 2021-10-21T21:37:14.000Z | import dash_core_components as dcc
import dash_html_components as html
import dash_table as dt
import pandas as pd
def ClinicalDataColumnSelect(columns):
"""
Args:
columns:
"""
return html.Div([
html.Div(['Select the gene id/name column to index by:']),
dcc.Dropdown(
... | 28.390244 | 78 | 0.491838 |
d5e42cd6ce36e1056af18d3c55a395bb762c3863 | 15,591 | py | Python | train.py | jingfeidu/fairseq | b41c74dc5be15918d5fd21f199b66b78a601192c | [
"BSD-3-Clause"
] | null | null | null | train.py | jingfeidu/fairseq | b41c74dc5be15918d5fd21f199b66b78a601192c | [
"BSD-3-Clause"
] | null | null | null | train.py | jingfeidu/fairseq | b41c74dc5be15918d5fd21f199b66b78a601192c | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3 -u
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
"""
Train... | 37.568675 | 112 | 0.647168 |
228a8f6efed3fe6d36dc0b35ea795ed0adcd0d62 | 1,579 | py | Python | mask_rcnn/modeling/generate_proposal_labels.py | rochesterxugroup/csc_249_final_proj_a2d_det | 0f742981699352181e94a001f3d6f4a5b1824a54 | [
"MIT"
] | 2 | 2019-04-17T21:03:54.000Z | 2021-07-14T19:03:19.000Z | mask_rcnn/modeling/generate_proposal_labels.py | rochesterxugroup/csc_249_final_proj_a2d_det | 0f742981699352181e94a001f3d6f4a5b1824a54 | [
"MIT"
] | null | null | null | mask_rcnn/modeling/generate_proposal_labels.py | rochesterxugroup/csc_249_final_proj_a2d_det | 0f742981699352181e94a001f3d6f4a5b1824a54 | [
"MIT"
] | 1 | 2019-04-22T23:16:35.000Z | 2019-04-22T23:16:35.000Z | from torch import nn
from mask_rcnn.core.config import cfg
from mask_rcnn.datasets import json_dataset
import mask_rcnn.roi_data.fast_rcnn
class GenerateProposalLabelsOp(nn.Module):
def __init__(self):
super(GenerateProposalLabelsOp, self).__init__()
def forward(self, rpn_rois, roidb, im_info):
... | 39.475 | 78 | 0.684611 |
991306105fbcad6ff0549c9641076238d82edc41 | 3,145 | py | Python | test/model-caching/onnx/multi-model-classifier/predictor.py | ourobouros/cortex | 1b3aaf909816b93f6a6e3edd0da8c10891e05be9 | [
"Apache-2.0"
] | 1 | 2022-02-23T08:45:19.000Z | 2022-02-23T08:45:19.000Z | test/model-caching/onnx/multi-model-classifier/predictor.py | ourobouros/cortex | 1b3aaf909816b93f6a6e3edd0da8c10891e05be9 | [
"Apache-2.0"
] | null | null | null | test/model-caching/onnx/multi-model-classifier/predictor.py | ourobouros/cortex | 1b3aaf909816b93f6a6e3edd0da8c10891e05be9 | [
"Apache-2.0"
] | null | null | null | # WARNING: you are on the master branch; please refer to examples on the branch corresponding to your `cortex version` (e.g. for version 0.24.*, run `git checkout -b 0.24` or switch to the `0.24` branch on GitHub)
import numpy as np
import cv2, requests
from scipy.special import softmax
def get_url_image(url_image):... | 31.45 | 213 | 0.644515 |
18f49ee2dce853b825f52f4eb056a0ef2ae8ab4f | 321 | py | Python | demo_app/demo/urls.py | areski/django-xadmin | fbe333894fdb2aaaba57d461e2968ef1312e2a0f | [
"BSD-3-Clause"
] | 1 | 2019-11-03T10:55:56.000Z | 2019-11-03T10:55:56.000Z | demo_app/demo/urls.py | areski/django-xadmin | fbe333894fdb2aaaba57d461e2968ef1312e2a0f | [
"BSD-3-Clause"
] | null | null | null | demo_app/demo/urls.py | areski/django-xadmin | fbe333894fdb2aaaba57d461e2968ef1312e2a0f | [
"BSD-3-Clause"
] | null | null | null | from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
import xadmin
xadmin.autodiscover()
# from xadmin.plugins import xversion
# xversion.registe_models()
urlpatterns = patterns('',
url(r'', include(xadmin.site.urls)),
)... | 24.692308 | 59 | 0.65109 |
15fbc65216d5873551a0b331b7a9168247923286 | 4,316 | py | Python | src/reversi_zero/play_game/game_model.py | qiqiguaitm/reversi-alpha-zero | 665c930707ac16e49bdc9771331631007529c688 | [
"MIT"
] | 2 | 2018-02-27T07:34:01.000Z | 2021-09-18T13:39:30.000Z | src/reversi_zero/play_game/game_model.py | qiqiguaitm/reversi-alpha-zero | 665c930707ac16e49bdc9771331631007529c688 | [
"MIT"
] | null | null | null | src/reversi_zero/play_game/game_model.py | qiqiguaitm/reversi-alpha-zero | 665c930707ac16e49bdc9771331631007529c688 | [
"MIT"
] | null | null | null | import enum
from logging import getLogger
from reversi_zero.agent.player import HistoryItem
from reversi_zero.agent.player import ReversiPlayer
from reversi_zero.config import Config
from reversi_zero.env.reversi_env import Player, ReversiEnv
from reversi_zero.lib.bitboard import find_correct_moves
from reversi_zero.l... | 31.97037 | 113 | 0.624652 |
3a50c6ed7d6df230dff02205914dfacf0d2a9315 | 12,106 | py | Python | airflow/providers/google/cloud/transfers/sql_to_gcs.py | bluecolor/airflow | d79e7221de76f01b5cd36c15224b59e8bb451c90 | [
"Apache-2.0"
] | null | null | null | airflow/providers/google/cloud/transfers/sql_to_gcs.py | bluecolor/airflow | d79e7221de76f01b5cd36c15224b59e8bb451c90 | [
"Apache-2.0"
] | null | null | null | airflow/providers/google/cloud/transfers/sql_to_gcs.py | bluecolor/airflow | d79e7221de76f01b5cd36c15224b59e8bb451c90 | [
"Apache-2.0"
] | null | null | null | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 41.176871 | 104 | 0.639765 |
6720f12e45c7d69ab855e04f2db589a9c24b4c7c | 20,683 | py | Python | sdk/python/pulumi_aws/get_ami.py | Otanikotani/pulumi-aws | 00e2b352da42c5b1b0ec7b4760eec5ad2b23ff21 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/get_ami.py | Otanikotani/pulumi-aws | 00e2b352da42c5b1b0ec7b4760eec5ad2b23ff21 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/get_ami.py | Otanikotani/pulumi-aws | 00e2b352da42c5b1b0ec7b4760eec5ad2b23ff21 | [
"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 warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from . import _utilities... | 39.851638 | 578 | 0.641541 |
1fb85092dea195057b2e56bc9c312881a11dfe14 | 658 | py | Python | labels/python/get_batch_points.py | HYPJUDY/human-pose-estimation-by-deep-learning | f873d368165b1564534979012b42d6967ba06efc | [
"MIT"
] | 46 | 2017-05-28T08:10:30.000Z | 2021-11-19T03:11:16.000Z | labels/python/get_batch_points.py | Sunshine352/human-pose-estimation-by-deep-learning | f873d368165b1564534979012b42d6967ba06efc | [
"MIT"
] | 9 | 2017-08-15T17:17:51.000Z | 2019-11-11T11:31:47.000Z | labels/python/get_batch_points.py | Sunshine352/human-pose-estimation-by-deep-learning | f873d368165b1564534979012b42d6967ba06efc | [
"MIT"
] | 17 | 2017-07-27T22:18:15.000Z | 2018-11-22T10:41:06.000Z | #!/usr/bin/env python
# encoding: utf-8
import re
import sys
def _get_point(from_list, idx):
return [from_list[idx*2], from_list[idx*2 + 1]]
def get_batch_points(src_file, dst_file):
# get half of data
count = 0
with open(src_file, 'rb') as fr, open(dst_file, 'wb') as fw:
for line in fr:
... | 23.5 | 64 | 0.595745 |
133077068bb7e25f28995ed8908592ee808ab104 | 2,673 | py | Python | tpdatasrc/co8infra/scr/Spell311 - Minor Globe of Invulnerability.py | edoipi/TemplePlus | f0e552289822fea908f16daa379fa568b1bd286d | [
"MIT"
] | 69 | 2015-05-05T14:09:25.000Z | 2022-02-15T06:13:04.000Z | tpdatasrc/co8infra/scr/Spell311 - Minor Globe of Invulnerability.py | edoipi/TemplePlus | f0e552289822fea908f16daa379fa568b1bd286d | [
"MIT"
] | 457 | 2015-05-01T22:07:45.000Z | 2022-03-31T02:19:10.000Z | tpdatasrc/co8infra/scr/Spell311 - Minor Globe of Invulnerability.py | edoipi/TemplePlus | f0e552289822fea908f16daa379fa568b1bd286d | [
"MIT"
] | 25 | 2016-02-04T21:19:53.000Z | 2021-11-15T23:14:51.000Z | from toee import *
import _include
from co8Util.PersistentData import *
from co8Util.ObjHandling import *
MINOR_GLOBE_OF_INVULNERABILITY_KEY = "Sp311_MINOR_GLOBE_OF_INVULNERABILITY_Activelist"
def OnBeginSpellCast( spell ):
print "Minor Globe of Invulnerability OnBeginSpellCast"
print "spell.target_list=", spell.t... | 36.616438 | 130 | 0.772166 |
143a057d69ff69d03d29b1f3ed410288ecb2b7b5 | 25,007 | py | Python | tacoma/tools.py | benmaier/tacoma | c34ea0778236df9e3ac6e2961c1a21801f12a46f | [
"MIT"
] | 89 | 2018-09-19T19:08:22.000Z | 2021-10-08T06:25:29.000Z | tacoma/tools.py | benmaier/tacoma | c34ea0778236df9e3ac6e2961c1a21801f12a46f | [
"MIT"
] | 12 | 2018-09-20T09:27:02.000Z | 2021-03-19T20:20:13.000Z | tacoma/tools.py | benmaier/tacoma | c34ea0778236df9e3ac6e2961c1a21801f12a46f | [
"MIT"
] | 7 | 2018-12-09T17:42:17.000Z | 2020-08-18T14:09:41.000Z | from math import log10
import json
import numpy as np
import tacoma as tc
from _tacoma import edge_changes as ec
from _tacoma import edge_lists as el
from _tacoma import edge_lists_with_histograms as el_h
from _tacoma import edge_changes_with_histograms as ec_h
from scipy.optimize import curve_fit
from scipy.stats... | 31.026055 | 179 | 0.593394 |
94e8db2be96fd1e6d69039d9e9c13143cba55184 | 6,984 | py | Python | vnpy/trader/optimize.py | lanchengjiu/vnpy | db3b8d81f5c5da16eb6ca89c2b3b08f2aa55db66 | [
"MIT"
] | null | null | null | vnpy/trader/optimize.py | lanchengjiu/vnpy | db3b8d81f5c5da16eb6ca89c2b3b08f2aa55db66 | [
"MIT"
] | null | null | null | vnpy/trader/optimize.py | lanchengjiu/vnpy | db3b8d81f5c5da16eb6ca89c2b3b08f2aa55db66 | [
"MIT"
] | null | null | null | from typing import Dict, List, Callable, Tuple
from itertools import product
from concurrent.futures import ProcessPoolExecutor
from random import random, choice
from time import perf_counter
from multiprocessing import Manager, Pool, get_context
from decimal import Decimal
from deap import creator, base, tools, algor... | 28.979253 | 118 | 0.609393 |
1938307d37aa6fe55b018a2eb22602a6af53cbbf | 4,336 | py | Python | nuitka/codegen/LoaderCodes.py | hclivess/Nuitka | 9c7ec9696e69a3901b25d5bce720c921d45c931b | [
"Apache-2.0"
] | null | null | null | nuitka/codegen/LoaderCodes.py | hclivess/Nuitka | 9c7ec9696e69a3901b25d5bce720c921d45c931b | [
"Apache-2.0"
] | 1 | 2019-03-01T11:33:40.000Z | 2019-03-01T11:33:40.000Z | nuitka/codegen/LoaderCodes.py | hclivess/Nuitka | 9c7ec9696e69a3901b25d5bce720c921d45c931b | [
"Apache-2.0"
] | 1 | 2019-03-26T16:56:21.000Z | 2019-03-26T16:56:21.000Z | # Copyright 2019, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... | 35.540984 | 78 | 0.6619 |
9571126f36283075c946000e425b039186b58383 | 1,494 | py | Python | src/sentry/security/emails.py | sigismund/sentry | 421a512cd3b4a4c9ed660af536dc5bc4c12a287c | [
"BSD-3-Clause"
] | 1 | 2019-05-28T06:18:03.000Z | 2019-05-28T06:18:03.000Z | src/sentry/security/emails.py | sigismund/sentry | 421a512cd3b4a4c9ed660af536dc5bc4c12a287c | [
"BSD-3-Clause"
] | 6 | 2018-10-19T10:04:23.000Z | 2019-12-09T20:29:12.000Z | src/sentry/security/emails.py | sigismund/sentry | 421a512cd3b4a4c9ed660af536dc5bc4c12a287c | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import, print_function
from django.utils import timezone
from sentry.utils.email import MessageBuilder
def generate_security_email(account, type, actor, ip_address, context=None, current_datetime=None):
if current_datetime is None:
current_datetime = timezone.now()
s... | 32.478261 | 99 | 0.670013 |
825291feb09758aa141b1cad46c67f89da369652 | 2,589 | py | Python | var/spack/repos/builtin/packages/gdb/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/gdb/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2018-07-06T19:11:46.000Z | 2018-07-06T19:12:28.000Z | var/spack/repos/builtin/packages/gdb/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2020-03-06T11:04:37.000Z | 2020-03-06T11:04:37.000Z | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Gdb(AutotoolsPackage, GNUMirrorPackage):
"""GDB, the GNU Project debugger, allows you to s... | 48.849057 | 96 | 0.760525 |
226f9aa206dcfca89f0b6df0ed18bcff735b39d8 | 5,949 | py | Python | hopper/utils/git/watcher.py | Xilinx/hopper | 77b35f0744cde4608fe051ec41535ca0d2ca01c6 | [
"MIT"
] | 2 | 2015-09-06T02:31:34.000Z | 2017-08-04T07:13:19.000Z | hopper/utils/git/watcher.py | Xilinx/hopper | 77b35f0744cde4608fe051ec41535ca0d2ca01c6 | [
"MIT"
] | null | null | null | hopper/utils/git/watcher.py | Xilinx/hopper | 77b35f0744cde4608fe051ec41535ca0d2ca01c6 | [
"MIT"
] | null | null | null | # Copyright (c) 2015 Xilinx Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distrib... | 29.019512 | 102 | 0.680114 |
5255fb08a4194089eb5c25082f883ba8a140c4ed | 1,198 | py | Python | myawards/forms.py | ucynthy12/awards | 51c993b2e5b779103f1a43246d939a66364a187c | [
"Unlicense"
] | 1 | 2021-02-15T16:53:39.000Z | 2021-02-15T16:53:39.000Z | myawards/forms.py | ucynthy12/awards | 51c993b2e5b779103f1a43246d939a66364a187c | [
"Unlicense"
] | null | null | null | myawards/forms.py | ucynthy12/awards | 51c993b2e5b779103f1a43246d939a66364a187c | [
"Unlicense"
] | null | null | null | from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
from .models import Profile,Rate,Project
from cloudinary.forms import CloudinaryFileField
class SignUpForm(UserCreationForm):
class Meta:
model = User
fields = ('username', '... | 24.958333 | 65 | 0.624374 |
82445e9e685df030a7d17d9cc0c0adac922d7eef | 345 | py | Python | malleefowl/processes/__init__.py | Ouranosinc/malleefowl | 685a4cabe4c4ccafc2721a50e1f8178b8b81689e | [
"Apache-2.0"
] | null | null | null | malleefowl/processes/__init__.py | Ouranosinc/malleefowl | 685a4cabe4c4ccafc2721a50e1f8178b8b81689e | [
"Apache-2.0"
] | 4 | 2017-09-21T17:14:45.000Z | 2020-11-11T03:20:42.000Z | malleefowl/processes/__init__.py | Ouranosinc/malleefowl | 685a4cabe4c4ccafc2721a50e1f8178b8b81689e | [
"Apache-2.0"
] | null | null | null | from .wps_esgsearch import ESGSearchProcess
from .wps_download import Download
from .wps_thredds import ThreddsDownload
from .wps_workflow import DispelWorkflow
from .wps_custom_workflow import DispelCustomWorkflow
processes = [
ESGSearchProcess(),
Download(),
ThreddsDownload(),
DispelWorkflow(),
D... | 24.642857 | 53 | 0.788406 |
bf8daf1d81200afaf91d98de1ac95b91d3211fdc | 868 | py | Python | xlsxwriter/test/comparison/test_image28.py | hugovk/XlsxWriter | e97cc66637d9895480ee32cfb5e561d652d3787b | [
"BSD-2-Clause"
] | null | null | null | xlsxwriter/test/comparison/test_image28.py | hugovk/XlsxWriter | e97cc66637d9895480ee32cfb5e561d652d3787b | [
"BSD-2-Clause"
] | null | null | null | xlsxwriter/test/comparison/test_image28.py | hugovk/XlsxWriter | e97cc66637d9895480ee32cfb5e561d652d3787b | [
"BSD-2-Clause"
] | null | null | null | ###############################################################################
#
# Tests for XlsxWriter.
#
# SPDX-License-Identifier: BSD-2-Clause
# Copyright (c), 2013-2022, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparison_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompar... | 24.8 | 101 | 0.619816 |
7611aab81b7d6f766310a43a2729304debf4e4fc | 16,471 | py | Python | project/venv/Lib/site-packages/IPython/core/application.py | Maleb44/Django2 | b58b6d6345a0fce158c2a5d5a4cc6161e5ca62ef | [
"MIT"
] | null | null | null | project/venv/Lib/site-packages/IPython/core/application.py | Maleb44/Django2 | b58b6d6345a0fce158c2a5d5a4cc6161e5ca62ef | [
"MIT"
] | null | null | null | project/venv/Lib/site-packages/IPython/core/application.py | Maleb44/Django2 | b58b6d6345a0fce158c2a5d5a4cc6161e5ca62ef | [
"MIT"
] | null | null | null | # encoding: utf-8
"""
An application for IPython.
All top-level applications should use the classes in this module for
handling configuration and creating configurables.
The job of an :class:`Application` is to create the master configuration
object and then create the configurable objects, passing the config to them... | 40.075426 | 110 | 0.607249 |
80ea1130d3b5945516725e8112e82a47b5976bb5 | 1,477 | py | Python | mindspore/python/mindspore/ops/_op_impl/tbe/log.py | PowerOlive/mindspore | bda20724a94113cedd12c3ed9083141012da1f15 | [
"Apache-2.0"
] | 3,200 | 2020-02-17T12:45:41.000Z | 2022-03-31T20:21:16.000Z | mindspore/python/mindspore/ops/_op_impl/tbe/log.py | zimo-geek/mindspore | 665ec683d4af85c71b2a1f0d6829356f2bc0e1ff | [
"Apache-2.0"
] | 176 | 2020-02-12T02:52:11.000Z | 2022-03-28T22:15:55.000Z | mindspore/python/mindspore/ops/_op_impl/tbe/log.py | zimo-geek/mindspore | 665ec683d4af85c71b2a1f0d6829356f2bc0e1ff | [
"Apache-2.0"
] | 621 | 2020-03-09T01:31:41.000Z | 2022-03-30T03:43:19.000Z | # Copyright 2020 Huawei Technologies Co., Ltd
#
# 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... | 36.02439 | 79 | 0.64455 |
bb3f5c6b046af3c9d190cead2fc8eb3f3e3b4eeb | 1,363 | py | Python | HW2/merge_sort_06123901.py | Maddiezheng/MyLearningNote | aec12ad3936bbdd377500256b9cf7628c16c3dc7 | [
"MIT"
] | null | null | null | HW2/merge_sort_06123901.py | Maddiezheng/MyLearningNote | aec12ad3936bbdd377500256b9cf7628c16c3dc7 | [
"MIT"
] | null | null | null | HW2/merge_sort_06123901.py | Maddiezheng/MyLearningNote | aec12ad3936bbdd377500256b9cf7628c16c3dc7 | [
"MIT"
] | 1 | 2019-10-23T08:30:57.000Z | 2019-10-23T08:30:57.000Z | class Solution():
def MergeSingle(self,left_arr,right_arr):
i = 0 #left array的index
j = 0 #right array的index
a=[] #設定的空list
mid=len(left_arr) #left array的最大index
end=len(right_arr) #right array的最大index
... | 35.868421 | 93 | 0.464417 |
d61538d3537aacc068a2c2bc48d4c906f44aea7b | 124,606 | py | Python | Babylon.js-2.4.0/Exporters/Blender/io_export_babylon.py | Chaseshak/RetroVRCade | 7e999af33941f159f40f8e15f648ae04d66c1f8f | [
"Apache-2.0"
] | null | null | null | Babylon.js-2.4.0/Exporters/Blender/io_export_babylon.py | Chaseshak/RetroVRCade | 7e999af33941f159f40f8e15f648ae04d66c1f8f | [
"Apache-2.0"
] | null | null | null | Babylon.js-2.4.0/Exporters/Blender/io_export_babylon.py | Chaseshak/RetroVRCade | 7e999af33941f159f40f8e15f648ae04d66c1f8f | [
"Apache-2.0"
] | null | null | null | bl_info = {
'name': 'Babylon.js',
'author': 'David Catuhe, Jeff Palmer',
'version': (4, 6, 1),
'blender': (2, 75, 0),
'location': 'File > Export > Babylon.js (.babylon)',
'description': 'Export Babylon.js scenes (.babylon)',
'wiki_url': 'https://github.com/BabylonJS/Babylon.js/tree/ma... | 44.327997 | 223 | 0.558256 |
2415915c52d59dc820b62bed1b3bbe9604bce025 | 4,641 | py | Python | instagram/settings.py | Ombae/neighbor | b4d3461bf24eb25259fa25f6e2d6564afb22ca5f | [
"MIT"
] | null | null | null | instagram/settings.py | Ombae/neighbor | b4d3461bf24eb25259fa25f6e2d6564afb22ca5f | [
"MIT"
] | 5 | 2020-06-05T22:44:26.000Z | 2021-09-08T01:16:21.000Z | instagram/settings.py | Ombae/neighbor | b4d3461bf24eb25259fa25f6e2d6564afb22ca5f | [
"MIT"
] | null | null | null | """
Django settings for tribune project.
Generated by 'django-admin startproject' using Django 2.2.3.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import os
im... | 26.52 | 91 | 0.702435 |
8de12b7758e5b288df7514735fdde365c38c031d | 31,242 | py | Python | evaluate/previous_works/HoHoNet/lib/misc/pano_lsd_align.py | Syniez/Joint_360depth | 4f28c3b5b7f648173480052e205e898c6c7a5151 | [
"MIT"
] | 11 | 2021-11-01T05:40:19.000Z | 2022-03-28T17:59:44.000Z | evaluate/previous_works/HoHoNet/lib/misc/pano_lsd_align.py | Syniez/Joint_360depth | 4f28c3b5b7f648173480052e205e898c6c7a5151 | [
"MIT"
] | null | null | null | evaluate/previous_works/HoHoNet/lib/misc/pano_lsd_align.py | Syniez/Joint_360depth | 4f28c3b5b7f648173480052e205e898c6c7a5151 | [
"MIT"
] | 1 | 2022-03-29T10:13:47.000Z | 2022-03-29T10:13:47.000Z | '''
This script is helper function for preprocessing.
Most of the code are converted from LayoutNet official's matlab code.
All functions, naming rule and data flow follow official for easier
converting and comparing.
Code is not optimized for python or numpy yet.
Author: Cheng Sun
Email : chengsun@gapp.nthu.edu.tw
''... | 33.775135 | 111 | 0.547404 |
fc5f685f1be1348c6b9f9c6e8dbbd846f615c755 | 2,234 | py | Python | src/aoc2021/day4/solution.py | marcelotrevisani/advent-of-code-2021 | 3855ecab180c23039ed4cb09e0645bf9bc5da38c | [
"Apache-2.0"
] | null | null | null | src/aoc2021/day4/solution.py | marcelotrevisani/advent-of-code-2021 | 3855ecab180c23039ed4cb09e0645bf9bc5da38c | [
"Apache-2.0"
] | null | null | null | src/aoc2021/day4/solution.py | marcelotrevisani/advent-of-code-2021 | 3855ecab180c23039ed4cb09e0645bf9bc5da38c | [
"Apache-2.0"
] | null | null | null | from pathlib import Path
from typing import Optional
import numpy as np
from numpy import ndarray
def parse_input(file_path):
with open(file_path, "r") as input_file:
numbers_draw = np.loadtxt(input_file, dtype=int, delimiter=",", max_rows=1)
all_boards = np.loadtxt(input_file, dtype=int, skiprow... | 33.343284 | 88 | 0.657117 |
c851915dd12d3bfc70de652c555fd112550cfc92 | 21,260 | py | Python | tests/unit/test_req_file.py | lyw07/kolibripip | e7039eca92b61827faa754311f1489e89a11519d | [
"MIT"
] | null | null | null | tests/unit/test_req_file.py | lyw07/kolibripip | e7039eca92b61827faa754311f1489e89a11519d | [
"MIT"
] | null | null | null | tests/unit/test_req_file.py | lyw07/kolibripip | e7039eca92b61827faa754311f1489e89a11519d | [
"MIT"
] | null | null | null | import os
import subprocess
import textwrap
import pytest
from mock import Mock, patch
from pretend import stub
import pip
from pip.download import PipSession
from pip.exceptions import InstallationError, RequirementsFileParseError
from pip.index import PackageFinder
from pip.req.req_file import (
break_args_opti... | 36.52921 | 79 | 0.599718 |
55a18ebeea2ea8a7f9a50ceb3c719c8772f16ea3 | 1,010 | py | Python | tests/ops/test_ssm_gp.py | Capri2014/pyro | 546f9010aeb2308ae566726b1cec67a7b4fda9c2 | [
"MIT"
] | null | null | null | tests/ops/test_ssm_gp.py | Capri2014/pyro | 546f9010aeb2308ae566726b1cec67a7b4fda9c2 | [
"MIT"
] | null | null | null | tests/ops/test_ssm_gp.py | Capri2014/pyro | 546f9010aeb2308ae566726b1cec67a7b4fda9c2 | [
"MIT"
] | 1 | 2020-01-06T03:19:17.000Z | 2020-01-06T03:19:17.000Z | import pytest
import torch
from pyro.ops.ssm_gp import MaternKernel
from tests.common import assert_equal
@pytest.mark.parametrize('num_gps', [1, 2, 3])
@pytest.mark.parametrize('nu', [0.5, 1.5, 2.5])
def test_matern_kernel(num_gps, nu):
mk = MaternKernel(nu=nu, num_gps=num_gps, length_scale_init=0.1 + torch.ran... | 34.827586 | 96 | 0.731683 |
eb56ef17ed2bea19ab06173d75533b2071ba5767 | 450 | py | Python | binarysearch.io/265_look_and_say.py | mishrakeshav/Competitive-Programming | b25dcfeec0fb9a9c71bf3a05644b619f4ca83dd2 | [
"MIT"
] | 2 | 2020-06-25T21:10:32.000Z | 2020-12-10T06:53:45.000Z | binarysearch.io/265_look_and_say.py | mishrakeshav/Competitive-Programming | b25dcfeec0fb9a9c71bf3a05644b619f4ca83dd2 | [
"MIT"
] | null | null | null | binarysearch.io/265_look_and_say.py | mishrakeshav/Competitive-Programming | b25dcfeec0fb9a9c71bf3a05644b619f4ca83dd2 | [
"MIT"
] | 3 | 2020-05-15T14:17:09.000Z | 2021-07-25T13:18:20.000Z | class Solution:
def solve(self, n):
num = '1'
for i in range(n-1):
count = 0
ans = ''
new = num[0]
for a in num:
if new == a:
count += 1
else:
ans += str(count) + new
... | 25 | 43 | 0.304444 |
763cdfda3839290e46dc67efe3f3d87490e334fa | 623 | py | Python | pdvega/tests/utils.py | Casyfill/pdvega | ff43a5313127a78e69e859261a5358f0b6ad2264 | [
"MIT"
] | 251 | 2018-01-12T09:35:06.000Z | 2018-08-06T16:28:11.000Z | pdvega/tests/utils.py | Casyfill/pdvega | ff43a5313127a78e69e859261a5358f0b6ad2264 | [
"MIT"
] | 28 | 2018-01-24T18:56:31.000Z | 2018-08-21T17:46:24.000Z | pdvega/tests/utils.py | Casyfill/pdvega | ff43a5313127a78e69e859261a5358f0b6ad2264 | [
"MIT"
] | 23 | 2018-01-12T06:51:39.000Z | 2018-08-01T00:16:18.000Z | IGNORE = object()
def check_encodings(chart, **fields):
edict = chart.encoding.to_dict()
assert set(edict.keys()) == set(fields.keys())
for encoding, expected_field in fields.items():
if expected_field is IGNORE:
continue
actual_field = edict[encoding]['field']
if actu... | 27.086957 | 79 | 0.629213 |
4b756d40a8014c7a6c12dcb1a149a189abf7a170 | 97 | py | Python | src/syncsign/__init__.py | syncsign/syncsign-python-sdk | 0bbfd46684f6805536623b1f42dffbf903f6d2ab | [
"Apache-2.0"
] | 2 | 2021-03-17T07:59:03.000Z | 2021-03-22T16:40:31.000Z | src/syncsign/__init__.py | syncsign/syncsign-python-sdk | 0bbfd46684f6805536623b1f42dffbf903f6d2ab | [
"Apache-2.0"
] | null | null | null | src/syncsign/__init__.py | syncsign/syncsign-python-sdk | 0bbfd46684f6805536623b1f42dffbf903f6d2ab | [
"Apache-2.0"
] | 1 | 2021-08-24T07:11:32.000Z | 2021-08-24T07:11:32.000Z | __all__ = [
'api_helper',
'client',
'configuration',
'decorators',
'http',
]
| 12.125 | 20 | 0.515464 |
79f935d8a4ed89b9ab1161b1b373bc8b7279edfe | 430 | py | Python | test/unittests/test_Withdrawal.py | mudkipmaster/gwlf-e | 9e058445537dd32d1916f76c4b73ca64261771cd | [
"Apache-2.0"
] | null | null | null | test/unittests/test_Withdrawal.py | mudkipmaster/gwlf-e | 9e058445537dd32d1916f76c4b73ca64261771cd | [
"Apache-2.0"
] | 6 | 2018-07-24T22:46:28.000Z | 2018-07-29T19:13:09.000Z | test/unittests/test_Withdrawal.py | mudkipmaster/gwlf-e | 9e058445537dd32d1916f76c4b73ca64261771cd | [
"Apache-2.0"
] | 1 | 2018-07-24T18:22:01.000Z | 2018-07-24T18:22:01.000Z | import numpy as np
from VariableUnittest import VariableUnitTest
from gwlfe.Input.WaterBudget import Withdrawal
class TestWithdrawal(VariableUnitTest):
def test_Withdrawal(self):
z = self.z
np.testing.assert_array_almost_equal(
Withdrawal.Withdrawal_f(z.NYrs, z.StreamWithdrawal, z.Gro... | 33.076923 | 93 | 0.751163 |
a19f0daabc52b61d6275633474e4cc57463dc401 | 1,241 | py | Python | dsa/patterns/dp/lcs/longest_repeating_sequence.py | bksahu/dsa | 4b36abbb3e00ce449c435c44260316f46d6d35ec | [
"MIT"
] | null | null | null | dsa/patterns/dp/lcs/longest_repeating_sequence.py | bksahu/dsa | 4b36abbb3e00ce449c435c44260316f46d6d35ec | [
"MIT"
] | 4 | 2019-10-02T14:24:54.000Z | 2020-03-26T07:06:15.000Z | dsa/patterns/dp/lcs/longest_repeating_sequence.py | bksahu/dsa | 4b36abbb3e00ce449c435c44260316f46d6d35ec | [
"MIT"
] | 2 | 2019-10-02T15:57:51.000Z | 2020-04-10T07:22:06.000Z | """
Longest Repeating Subsequence
Given a string, print the longest repeating subsequence such that the two subsequence don’t have same
string character at same position, i.e., any i’th character in the two subsequences shouldn’t have the
same index in the original string.
Example:
Input: str = "aab"
Output: "a"
The... | 28.204545 | 103 | 0.542305 |
7b8a958a350fccd0794ff31dcc37d62832f01d3c | 814 | py | Python | cfb-cursos/radiobutton.py | joseluizbrits/sobre-python | 316143c341e5a44070a3b13877419082774bd730 | [
"MIT"
] | null | null | null | cfb-cursos/radiobutton.py | joseluizbrits/sobre-python | 316143c341e5a44070a3b13877419082774bd730 | [
"MIT"
] | null | null | null | cfb-cursos/radiobutton.py | joseluizbrits/sobre-python | 316143c341e5a44070a3b13877419082774bd730 | [
"MIT"
] | null | null | null | from tkinter import *
def imprimirEsporte():
ve = vesporte.get()
if ve == 'f':
print('Esporte Futebol')
elif ve == 'v':
print('Esporte Vôlei')
elif ve == 'b':
print('Esporte Basquete')
else:
print('Selecione um esporte')
app = Tk()
app.title('BLOCO')
app.geometry('... | 21.421053 | 78 | 0.674447 |
608f488e8a567116f73981c0f5674d12a682554f | 678 | py | Python | arelle/examples/plugin/importTestImported1.py | jukrupa/Arelle-master | 0f8108e60fa86c8e324c5aa453765c44766f882f | [
"Apache-2.0"
] | null | null | null | arelle/examples/plugin/importTestImported1.py | jukrupa/Arelle-master | 0f8108e60fa86c8e324c5aa453765c44766f882f | [
"Apache-2.0"
] | null | null | null | arelle/examples/plugin/importTestImported1.py | jukrupa/Arelle-master | 0f8108e60fa86c8e324c5aa453765c44766f882f | [
"Apache-2.0"
] | null | null | null | '''
pluginPackages test case
(c) Copyright 2012 Mark V Systems Limited, All rights reserved.
'''
# this module would raise system error due to PEP 366 after python 3.4.3
from . import importTestImported11
def foo():
print ("imported unpackaged plug-in relative imported 1")
__pluginInfo__ = {
'name': 'Unpackaged... | 29.478261 | 83 | 0.69469 |
29d481f7b4f9de7eaa6cd69efae1197e5fe13efb | 978 | py | Python | test/test_playback_reporting_api_custom_query.py | stanionascu/python-embyapi | a3f7aa49aea4052277cc43605c0d89bc6ff21913 | [
"BSD-3-Clause"
] | null | null | null | test/test_playback_reporting_api_custom_query.py | stanionascu/python-embyapi | a3f7aa49aea4052277cc43605c0d89bc6ff21913 | [
"BSD-3-Clause"
] | null | null | null | test/test_playback_reporting_api_custom_query.py | stanionascu/python-embyapi | a3f7aa49aea4052277cc43605c0d89bc6ff21913 | [
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
"""
Emby Server API
Explore the Emby Server API # noqa: E501
OpenAPI spec version: 4.1.1.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import embyapi
from embyapi.models.playback_reporting_api_cus... | 24.45 | 116 | 0.734151 |
28ffe0f5fa8efad4e267111564084e65004179d3 | 2,619 | py | Python | restkit/handlers/http_user_handlers/http_report_handlers/report_csv_delete.py | ppolxda/restkit | eeb6177ccd75f8ba7b2faa252116f1e745d0f91b | [
"MIT"
] | null | null | null | restkit/handlers/http_user_handlers/http_report_handlers/report_csv_delete.py | ppolxda/restkit | eeb6177ccd75f8ba7b2faa252116f1e745d0f91b | [
"MIT"
] | null | null | null | restkit/handlers/http_user_handlers/http_report_handlers/report_csv_delete.py | ppolxda/restkit | eeb6177ccd75f8ba7b2faa252116f1e745d0f91b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
@create: 2019-09-28 18:18:54.
@author: name
@desc: report_csv_delete
"""
from tornado import gen
from restkit import rest
from restkit.transactions import trans_func
from restkit.transactions import Transaction
from restkit.handlers.http_user_conns.http_sessions import HttpSessionBaseHandl... | 30.453488 | 89 | 0.633066 |
84063d8f3bd7802c258521eb18d053f38b446a43 | 8,936 | py | Python | mbuild/formats/json_formats.py | chrisiacovella/mbuild | f4b880e0605c03f0612e087712df4836c47bb29e | [
"MIT"
] | null | null | null | mbuild/formats/json_formats.py | chrisiacovella/mbuild | f4b880e0605c03f0612e087712df4836c47bb29e | [
"MIT"
] | 1 | 2019-09-18T04:59:45.000Z | 2019-09-18T04:59:45.000Z | mbuild/formats/json_formats.py | chrisiacovella/mbuild | f4b880e0605c03f0612e087712df4836c47bb29e | [
"MIT"
] | null | null | null | import json
from collections import OrderedDict
import mbuild as mb
from mbuild.exceptions import MBuildError
def compound_from_json(json_file):
"""
Convert the given json file into a mb.Compound
Given an input json file, this method scans for the particles, bond information
as well as other hierarc... | 39.715556 | 117 | 0.649396 |
01e1f6b44893eec6dd3ee1674bbc477874284a3d | 21,279 | py | Python | experiment.py | mtanti/rnn-role | 89e77bbb226ee2ecc645591455d892fe03e5c271 | [
"MIT"
] | 14 | 2017-08-13T21:37:55.000Z | 2020-12-06T07:11:47.000Z | experiment.py | mtanti/rnn-role | 89e77bbb226ee2ecc645591455d892fe03e5c271 | [
"MIT"
] | 1 | 2017-09-22T10:19:40.000Z | 2017-09-28T07:57:41.000Z | experiment.py | mtanti/rnn-role | 89e77bbb226ee2ecc645591455d892fe03e5c271 | [
"MIT"
] | 5 | 2017-08-14T06:47:15.000Z | 2021-03-26T16:27:43.000Z | from __future__ import absolute_import, division, print_function, unicode_literals
from builtins import ascii, bytes, chr, dict, filter, hex, input, int, map, next, oct, open, pow, range, round, str, super, zip
import tensorflow as tf
import json
import numpy as np
import scipy.io
import sys, os, shutil
import... | 58.944598 | 200 | 0.492457 |
d860093fe9475d180dde2d94aa2e5ce5d237bc74 | 3,602 | py | Python | usaspending_api/etl/management/commands/es_configure.py | gaybro8777/usaspending-api | fe9d730acd632401bbbefa168e3d86d59560314b | [
"CC0-1.0"
] | null | null | null | usaspending_api/etl/management/commands/es_configure.py | gaybro8777/usaspending-api | fe9d730acd632401bbbefa168e3d86d59560314b | [
"CC0-1.0"
] | null | null | null | usaspending_api/etl/management/commands/es_configure.py | gaybro8777/usaspending-api | fe9d730acd632401bbbefa168e3d86d59560314b | [
"CC0-1.0"
] | null | null | null | import json
import subprocess
from django.core.management.base import BaseCommand
from usaspending_api import settings
from usaspending_api.etl.es_etl_helpers import VIEW_COLUMNS
CURL_STATEMENT = 'curl -XPUT "{url}" -H "Content-Type: application/json" -d \'{data}\''
CURL_COMMANDS = {
"template": "{host}/_templa... | 33.981132 | 115 | 0.684064 |
a333ed50794ace428a5bd18043c0deaaaadf30a2 | 2,696 | py | Python | scratch_explorer/tests/test_search.py | mattjohndavidson/scratch_analysis | 319423ecdbdb57b870d2e99851f90760496498c2 | [
"MIT"
] | null | null | null | scratch_explorer/tests/test_search.py | mattjohndavidson/scratch_analysis | 319423ecdbdb57b870d2e99851f90760496498c2 | [
"MIT"
] | 8 | 2020-12-05T03:11:04.000Z | 2020-12-18T01:04:34.000Z | scratch_explorer/tests/test_search.py | mattjohndavidson/scratch_analysis | 319423ecdbdb57b870d2e99851f90760496498c2 | [
"MIT"
] | null | null | null | """Unit tests for search.py"""
import unittest
import pandas as pd
from scratch_explorer import search
class test_search(unittest.TestCase):
"""Includes unit tests for search.py"""
data = pd.read_csv('scratch_explorer/data/scratch_sample.csv',
low_memory=False).drop(columns=['Unnamed: ... | 32.878049 | 71 | 0.591617 |
66459cb396ee87dd002288d76d721e4bb9aea3bc | 5,911 | py | Python | djgeojson/views.py | dennereed/paleocore | d6da6c39cde96050ee4b9e7213ec1200530cbeee | [
"MIT"
] | 1 | 2021-02-05T19:50:13.000Z | 2021-02-05T19:50:13.000Z | djgeojson/views.py | dennereed/paleocore | d6da6c39cde96050ee4b9e7213ec1200530cbeee | [
"MIT"
] | 59 | 2020-06-17T22:21:51.000Z | 2022-02-10T05:00:01.000Z | djgeojson/views.py | dennereed/paleocore | d6da6c39cde96050ee4b9e7213ec1200530cbeee | [
"MIT"
] | 2 | 2020-07-01T14:11:09.000Z | 2020-08-10T17:27:26.000Z | import math
import django
from django.core.exceptions import ImproperlyConfigured
try:
from django.contrib.gis.db.models.functions import Intersection
except (ImportError, ImproperlyConfigured):
Intersection = None
from django.views.generic import ListView
from django.utils.decorators import method_decorator
... | 35.39521 | 93 | 0.610726 |
8daa2d45f237e47c2966783fcc5a5c54b7ab7069 | 6,399 | py | Python | tests/test_07_render/test_712_render_curved_dimension.py | jkjt/ezdxf | 2acc5611b81476ea16b98063b9f55446a9182b81 | [
"MIT"
] | null | null | null | tests/test_07_render/test_712_render_curved_dimension.py | jkjt/ezdxf | 2acc5611b81476ea16b98063b9f55446a9182b81 | [
"MIT"
] | null | null | null | tests/test_07_render/test_712_render_curved_dimension.py | jkjt/ezdxf | 2acc5611b81476ea16b98063b9f55446a9182b81 | [
"MIT"
] | null | null | null | # Copyright (c) 2021, Manfred Moitzi
# License: MIT License
import math
import pytest
import ezdxf
from ezdxf.document import Drawing
from ezdxf.math import Vec2, arc_angle_span_deg
from ezdxf.render.dim_curved import detect_closer_defpoint, _CurvedDimensionLine
@pytest.fixture(scope="module")
def doc():
retur... | 32.647959 | 83 | 0.564776 |
bac73378b84e01c637ac97d3326b9cd792a2768b | 4,603 | py | Python | django/core/serializers/__init__.py | pomarec/django | 98514849dce07acfaa224a90a784bba9d97249e5 | [
"BSD-3-Clause"
] | 1 | 2015-06-14T07:55:29.000Z | 2015-06-14T07:55:29.000Z | django/core/serializers/__init__.py | pomarec/django | 98514849dce07acfaa224a90a784bba9d97249e5 | [
"BSD-3-Clause"
] | null | null | null | django/core/serializers/__init__.py | pomarec/django | 98514849dce07acfaa224a90a784bba9d97249e5 | [
"BSD-3-Clause"
] | null | null | null | """
Interfaces for serializing Django objects.
Usage::
from django.core import serializers
json = serializers.serialize("json", some_queryset)
objects = list(serializers.deserialize("json", json))
To add your own serializers, use the SERIALIZATION_MODULES setting::
SERIALIZATION_MODULES = {
... | 30.686667 | 92 | 0.705192 |
79611c5c2de8ef5098feb8fdd8f0271f18113662 | 317 | py | Python | Course-2:Graphs/shortest_path.py | karenk1010/Coursera-Algorithms-Specialization | 5d293ff6e74e7d6f2090696d21d282e1734f396a | [
"MIT"
] | null | null | null | Course-2:Graphs/shortest_path.py | karenk1010/Coursera-Algorithms-Specialization | 5d293ff6e74e7d6f2090696d21d282e1734f396a | [
"MIT"
] | null | null | null | Course-2:Graphs/shortest_path.py | karenk1010/Coursera-Algorithms-Specialization | 5d293ff6e74e7d6f2090696d21d282e1734f396a | [
"MIT"
] | 2 | 2021-02-04T22:20:15.000Z | 2021-02-11T13:27:24.000Z | #!/usr/bin/python3
"""
Implement Dijkstra's shortest path algorithm using 'dijkstraData.txt' graph.
Source Vertex = 1.
Report shortest path distance to the following vertices in the same order:
7,37,59,82,99,115,133,165,188,197
Problem answer: [2599, 2610, 2947, 2052, 2367, 2399, 2029, 2442, 2505, 3068]
"""
| 24.384615 | 76 | 0.722397 |
1f79eb0f8d5ad76a71568edd3e0b2269a683e236 | 726 | py | Python | livereload/cli.py | agustinhenze/python-livereload.debian | b2c6cc0882962251da14cf94b94d83b4c63ee786 | [
"BSD-3-Clause"
] | null | null | null | livereload/cli.py | agustinhenze/python-livereload.debian | b2c6cc0882962251da14cf94b94d83b4c63ee786 | [
"BSD-3-Clause"
] | null | null | null | livereload/cli.py | agustinhenze/python-livereload.debian | b2c6cc0882962251da14cf94b94d83b4c63ee786 | [
"BSD-3-Clause"
] | null | null | null | import argparse
from livereload.server import Server
parser = argparse.ArgumentParser(description='Start a `livereload` server')
parser.add_argument(
'--host',
help='Hostname to run `livereload` server on',
type=str,
default='127.0.0.1'
)
parser.add_argument(
'-p', '--port',
help='Port to run ... | 21.352941 | 75 | 0.666667 |
ffbeb4061d6dd866c1995804264ba8beca9493b9 | 1,132 | py | Python | server/util/wordembeddings.py | Yunicorn228/web-tools | 056d2d8310f3096c8be90638342bb3cc5715a89f | [
"Apache-2.0"
] | 32 | 2017-06-12T15:53:14.000Z | 2020-08-31T15:23:38.000Z | server/util/wordembeddings.py | Yunicorn228/web-tools | 056d2d8310f3096c8be90638342bb3cc5715a89f | [
"Apache-2.0"
] | 1,316 | 2017-05-04T17:14:15.000Z | 2020-09-28T18:32:00.000Z | server/util/wordembeddings.py | Yunicorn228/web-tools | 056d2d8310f3096c8be90638342bb3cc5715a89f | [
"Apache-2.0"
] | 20 | 2017-10-10T20:07:07.000Z | 2020-08-30T14:03:06.000Z | import requests
import json
from server import config
# Helpers for accessing data from the Media Cloud Word Embeddings server
def google_news_2d(words):
results = _query_for_json("/api/v2/google-news/2d",
{'words[]': words})
return results
def topic_2d(topics_id, snapshots_i... | 30.594595 | 109 | 0.644876 |
01db4af09803a6f73501d2f4599d5a7ddce2e736 | 4,477 | py | Python | XrayDataPlots/plotFcalcsrResolutionBin.py | MooersLab/jupyterlabcctbxsnips | c5f0947b4e8c4e5839b9b6b15c81c62915103155 | [
"MIT"
] | null | null | null | XrayDataPlots/plotFcalcsrResolutionBin.py | MooersLab/jupyterlabcctbxsnips | c5f0947b4e8c4e5839b9b6b15c81c62915103155 | [
"MIT"
] | null | null | null | XrayDataPlots/plotFcalcsrResolutionBin.py | MooersLab/jupyterlabcctbxsnips | c5f0947b4e8c4e5839b9b6b15c81c62915103155 | [
"MIT"
] | null | null | null | '''
This script reads in a phenix.refine mtz file.
It plots the R-factor by resolution bin.
The plots are made with matplotlib using miller arrays.
It also plots the correlation coefficients.
The plots were made with matplotlib.
This script was adapted from an example script in iotbx:
Source: https://github.com/cc... | 33.410448 | 79 | 0.726603 |
2ae005b12c4abf394935a156f5e38edd13ee56e3 | 3,078 | py | Python | libs/ts/ptp.py | scambra/HTPC-Manager | 1a1440db84ae1b6e7a2610c7f3bd5b6adf0aab1d | [
"MIT"
] | 422 | 2015-01-08T14:08:08.000Z | 2022-02-07T11:47:37.000Z | libs/ts/ptp.py | scambra/HTPC-Manager | 1a1440db84ae1b6e7a2610c7f3bd5b6adf0aab1d | [
"MIT"
] | 581 | 2015-01-01T08:07:16.000Z | 2022-02-23T11:44:37.000Z | libs/ts/ptp.py | scambra/HTPC-Manager | 1a1440db84ae1b6e7a2610c7f3bd5b6adf0aab1d | [
"MIT"
] | 115 | 2015-01-08T14:41:00.000Z | 2022-02-13T12:31:17.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests
import urllib
import logging
import htpc
def search(q, cat):
logger = logging.getLogger('modules.torrentsearch')
logger.info('Searching for %s on ptp' % q)
username = htpc.settings.get('torrents_ptp_username', '')
password = htpc.settings... | 35.790698 | 108 | 0.521442 |
b3a342974c28169e89793e8f93e7d695c9e5d2a1 | 31,257 | py | Python | tests/python_package_test/test_engine.py | zsh-89/LightGBM | 2df6d9a9bce01a642a3150dc054812eda97391ca | [
"MIT"
] | 1 | 2018-09-11T12:38:09.000Z | 2018-09-11T12:38:09.000Z | tests/python_package_test/test_engine.py | LisaJing/LightGBM | 9ed4a9552589c57af85b786534933152599cd1e7 | [
"MIT"
] | null | null | null | tests/python_package_test/test_engine.py | LisaJing/LightGBM | 9ed4a9552589c57af85b786534933152599cd1e7 | [
"MIT"
] | null | null | null | # coding: utf-8
# pylint: skip-file
import copy
import math
import os
import unittest
import lightgbm as lgb
import random
import numpy as np
from sklearn.datasets import (load_boston, load_breast_cancer, load_digits,
load_iris, load_svmlight_file)
from sklearn.metrics import log_loss, me... | 43.232365 | 144 | 0.576991 |
bfe85b7f03066a999bf2e7041df9e2c181f1a8c2 | 8,238 | py | Python | hyper_internal_service/worker.py | intellivoid/Hyper-Internal-Service | 16a13fe0a10a12007d286d7f30d7b72dab81d73f | [
"Unlicense"
] | null | null | null | hyper_internal_service/worker.py | intellivoid/Hyper-Internal-Service | 16a13fe0a10a12007d286d7f30d7b72dab81d73f | [
"Unlicense"
] | null | null | null | hyper_internal_service/worker.py | intellivoid/Hyper-Internal-Service | 16a13fe0a10a12007d286d7f30d7b72dab81d73f | [
"Unlicense"
] | null | null | null | """Async gunicorn worker for hyper_internal_service.web"""
import asyncio
import os
import re
import signal
import sys
from types import FrameType
from typing import Any, Awaitable, Callable, Optional, Union # noqa
from gunicorn.config import AccessLogFormat as GunicornAccessLogFormat
from gunicorn.workers import ba... | 33.901235 | 88 | 0.60925 |
c76c73eb2677b2adb45d9b3d1d09a40b410a18a6 | 692 | py | Python | tests/xlfunctions_vs_excel/count_test.py | ckp95/xlcalculator | 8f3f04a2a0a2ecb12c3d5837a5b13519137ae427 | [
"MIT"
] | 54 | 2020-04-26T09:18:29.000Z | 2022-03-30T08:47:45.000Z | tests/xlfunctions_vs_excel/count_test.py | st-lo/xlcalculator | 19190ec90e948b7ab1eceb06448b96cc1728bc51 | [
"MIT"
] | 41 | 2020-05-04T04:12:36.000Z | 2022-01-31T02:41:05.000Z | tests/xlfunctions_vs_excel/count_test.py | st-lo/xlcalculator | 19190ec90e948b7ab1eceb06448b96cc1728bc51 | [
"MIT"
] | 21 | 2020-05-21T20:49:23.000Z | 2022-02-20T14:15:56.000Z | from .. import testing
class CountTest(testing.FunctionalTestCase):
filename = "COUNT.xlsx"
def test_evaluation_A1(self):
excel_value = self.evaluator.get_cell_value('Sheet1!A1')
value = self.evaluator.evaluate('Sheet1!A1')
self.assertEqual(excel_value, value)
def test_evaluation... | 32.952381 | 64 | 0.695087 |
bdbde3119465c95783820a723b2f45a136448928 | 9,539 | py | Python | src/tourbillon_pytorch/tourbillon.py | Ramos-Ramos/tourbillon-pytorch | b25fbd02ae201569752e321eb5c612c3aa8eaddc | [
"MIT"
] | null | null | null | src/tourbillon_pytorch/tourbillon.py | Ramos-Ramos/tourbillon-pytorch | b25fbd02ae201569752e321eb5c612c3aa8eaddc | [
"MIT"
] | null | null | null | src/tourbillon_pytorch/tourbillon.py | Ramos-Ramos/tourbillon-pytorch | b25fbd02ae201569752e321eb5c612c3aa8eaddc | [
"MIT"
] | null | null | null | # Currently only supports one-layer encoder and decoders
from einops.layers.torch import Rearrange
import numpy as np
import torch
from torch import nn
from collections import OrderedDict
from typing import Union, Tuple, List, OrderedDict
def _preprocess_conv_arg(
arg: Union[int, Tuple[int, int]], num_blocks: i... | 32.893103 | 166 | 0.688961 |
2075e9d5a41cb2558188101bbf21202b478ea644 | 13,311 | py | Python | tests/scripts/test_serialization.py | drehak/leapp | 062c76859e6b4a68592c6a387e44a2c1d36949ff | [
"Apache-2.0"
] | null | null | null | tests/scripts/test_serialization.py | drehak/leapp | 062c76859e6b4a68592c6a387e44a2c1d36949ff | [
"Apache-2.0"
] | 3 | 2022-01-31T10:24:53.000Z | 2022-03-29T12:30:04.000Z | tests/scripts/test_serialization.py | drehak/leapp | 062c76859e6b4a68592c6a387e44a2c1d36949ff | [
"Apache-2.0"
] | null | null | null | import json
from datetime import datetime
import pytest
import six
from leapp.models import Model, fields
from leapp.topics import Topic
class BadBuiltinField(fields.BuiltinField):
pass
class ModelTestTopic(Topic):
name = 'model-test-topic'
class BasicModel(Model):
topic = ModelTestTopic
message... | 34.306701 | 114 | 0.704455 |
d8e5ae34bb4e1d4a53f8e67b01c262a653f369af | 1,751 | py | Python | build/android/PRESUBMIT.py | nagineni/chromium-crosswalk | 5725642f1c67d0f97e8613ec1c3e8107ab53fdf8 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 231 | 2015-01-08T09:04:44.000Z | 2021-12-30T03:03:10.000Z | build/android/PRESUBMIT.py | j4ckfrost/android_external_chromium_org | a1a3dad8b08d1fcf6b6b36c267158ed63217c780 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 8 | 2015-08-31T06:39:59.000Z | 2021-12-04T14:53:28.000Z | build/android/PRESUBMIT.py | j4ckfrost/android_external_chromium_org | a1a3dad8b08d1fcf6b6b36c267158ed63217c780 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 268 | 2015-01-21T05:53:28.000Z | 2022-03-25T22:09:01.000Z | # Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Presubmit script for android buildbot.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for
details on the presubmit API b... | 30.189655 | 79 | 0.723587 |
3bcace88c42c337aaf9d215ed68d604cd964bbaa | 2,810 | py | Python | random-forest/python/random_forest.py | benhsu75/sigopt-examples | 8ed99fc81fee2aa4d3e69aef03d3a4ec051a073a | [
"MIT"
] | null | null | null | random-forest/python/random_forest.py | benhsu75/sigopt-examples | 8ed99fc81fee2aa4d3e69aef03d3a4ec051a073a | [
"MIT"
] | 29 | 2020-01-28T22:11:43.000Z | 2022-03-11T23:48:02.000Z | random-forest/python/random_forest.py | benhsu75/sigopt-examples | 8ed99fc81fee2aa4d3e69aef03d3a4ec051a073a | [
"MIT"
] | null | null | null | # Use SigOpt to tune a Random Forest Classifier in Python
# Learn more about SigOpt's Python Client:
# https://sigopt.com/docs/overview/python
# Run `pip install sigopt` to download the python API client
# Run `pip install sklearn` to install scikit-learn, a machine learning
# library in Python (http://scikit-learn.or... | 36.025641 | 97 | 0.752669 |
20821c7cec6f0591d0ecab95c59711456008178c | 14,573 | py | Python | asks/sessions.py | dahlia/asks | 69f4416c99d35bea10032d138e6f823469e53cc4 | [
"MIT"
] | null | null | null | asks/sessions.py | dahlia/asks | 69f4416c99d35bea10032d138e6f823469e53cc4 | [
"MIT"
] | null | null | null | asks/sessions.py | dahlia/asks | 69f4416c99d35bea10032d138e6f823469e53cc4 | [
"MIT"
] | null | null | null | '''
The disparate session (Session) is for making requests to multiple locations.
'''
from abc import ABCMeta, abstractmethod
from copy import copy
from functools import partialmethod
from urllib.parse import urlparse, urlunparse
import ssl
from h11 import RemoteProtocolError
from anyio import connect_tcp, create_sem... | 35.285714 | 89 | 0.537432 |
a42159940096953ef92144cd532b623516183fbb | 4,900 | py | Python | app/controllers/subscribed_lists/forms.py | palazzem/gello | 19fe9e4aa8de485dd829a87047ec64f89b5fa7ee | [
"Apache-2.0"
] | 44 | 2018-03-28T14:22:23.000Z | 2022-03-15T07:25:06.000Z | app/controllers/subscribed_lists/forms.py | palazzem/gello | 19fe9e4aa8de485dd829a87047ec64f89b5fa7ee | [
"Apache-2.0"
] | 44 | 2018-03-28T14:19:03.000Z | 2022-02-16T10:24:57.000Z | app/controllers/subscribed_lists/forms.py | palazzem/gello | 19fe9e4aa8de485dd829a87047ec64f89b5fa7ee | [
"Apache-2.0"
] | 12 | 2018-03-28T14:15:43.000Z | 2021-07-19T17:33:20.000Z | # -*- coding: utf-8 -*-
#
# Unless explicitly stated otherwise all files in this repository are licensed
# under the Apache 2 License.
#
# This product includes software developed at Datadog
# (https://www.datadoghq.com/).
#
# Copyright 2018 Datadog, Inc.
#
"""subscribed_lists/forms.py
SubscribedList-related forms.
... | 28.654971 | 79 | 0.611224 |
6f070b6c31e33946916ec7d15e14e0312a8818a5 | 24,422 | py | Python | qtconsole/jupyter_widget.py | hmaarrfk/qtconsole | 2379cb7903730de343a917ceb91edf8bfde2659e | [
"BSD-3-Clause"
] | 2 | 2020-09-30T00:11:09.000Z | 2021-10-04T13:00:38.000Z | qtconsole/jupyter_widget.py | hmaarrfk/qtconsole | 2379cb7903730de343a917ceb91edf8bfde2659e | [
"BSD-3-Clause"
] | 3 | 2020-03-24T17:46:11.000Z | 2021-08-23T20:23:16.000Z | qtconsole/jupyter_widget.py | hmaarrfk/qtconsole | 2379cb7903730de343a917ceb91edf8bfde2659e | [
"BSD-3-Clause"
] | 2 | 2020-08-03T13:02:06.000Z | 2020-11-04T03:15:44.000Z | """A FrontendWidget that emulates a repl for a Jupyter kernel.
This supports the additional functionality provided by Jupyter kernel.
"""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
from collections import namedtuple
import os.path
import re
from subprocess im... | 40.433775 | 93 | 0.58132 |
f73e26be5e8339103201e497c6e376922c92d858 | 13,682 | py | Python | django/contrib/gis/db/models/fields.py | Perlence/django | 4f7328ce8a35160d155c41d362c3d674f8ef4d2d | [
"PSF-2.0",
"BSD-3-Clause"
] | 4 | 2017-01-09T10:51:20.000Z | 2020-06-30T14:00:41.000Z | django/contrib/gis/db/models/fields.py | Perlence/django | 4f7328ce8a35160d155c41d362c3d674f8ef4d2d | [
"PSF-2.0",
"BSD-3-Clause"
] | 10 | 2016-05-19T21:54:42.000Z | 2019-08-09T15:59:50.000Z | django/contrib/gis/db/models/fields.py | Perlence/django | 4f7328ce8a35160d155c41d362c3d674f8ef4d2d | [
"PSF-2.0",
"BSD-3-Clause"
] | 2 | 2016-08-02T20:16:08.000Z | 2020-01-07T19:45:38.000Z | from collections import defaultdict, namedtuple
from django.contrib.gis import forms, gdal
from django.contrib.gis.db.models.proxy import SpatialProxy
from django.contrib.gis.gdal.error import GDALException
from django.contrib.gis.geos import (
GeometryCollection, GEOSException, GEOSGeometry, LineString,
Multi... | 35.816754 | 119 | 0.656044 |
486b8cc1bfb57047caf90aff322176dfb8e80733 | 2,896 | py | Python | nicos_mlz/puma/setups/ecradle.py | jkrueger1/nicos | 5f4ce66c312dedd78995f9d91e8a6e3c891b262b | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | nicos_mlz/puma/setups/ecradle.py | jkrueger1/nicos | 5f4ce66c312dedd78995f9d91e8a6e3c891b262b | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | nicos_mlz/puma/setups/ecradle.py | jkrueger1/nicos | 5f4ce66c312dedd78995f9d91e8a6e3c891b262b | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | # -*- coding: utf-8 -*-
description = 'Eulerian cradle'
group = 'lowlevel'
includes = ['system', 'motorbus1', 'motorbus2', 'motorbus5']
excludes = ['euler']
devices = dict(
st_echi = device('nicos.devices.vendor.ipc.Motor',
bus = 'motorbus2',
addr = 61,
slope = 200,
unit = 'deg'... | 25.857143 | 60 | 0.501381 |
278f545d11e23c71123536cc4e67d68553d8f8ff | 8,381 | py | Python | src/mist/api/clouds/views.py | cc-daveloper/mist.io_mist.api | d3f9b8d478f23bf811c0bc6d3078e512aa975f86 | [
"Apache-2.0"
] | 1 | 2019-04-10T11:37:25.000Z | 2019-04-10T11:37:25.000Z | src/mist/api/clouds/views.py | d-mo/mist.api | d3f9b8d478f23bf811c0bc6d3078e512aa975f86 | [
"Apache-2.0"
] | 3 | 2021-04-07T23:15:17.000Z | 2021-09-23T23:21:45.000Z | src/mist/api/clouds/views.py | cc-daveloper/mist.io_mist.api | d3f9b8d478f23bf811c0bc6d3078e512aa975f86 | [
"Apache-2.0"
] | null | null | null | import logging
from pyramid.response import Response
from mist.api.clouds.models import Cloud
from mist.api.auth.methods import auth_context_from_request
from mist.api.helpers import trigger_session_update
from mist.api.helpers import view_config, params_from_request
from mist.api.exceptions import BadRequestError
f... | 28.604096 | 79 | 0.673547 |
1deef6a5518d7404f568dc417326a691bc7e95d9 | 5,106 | py | Python | py_main/ReadData.py | ChampionApe/GamsPythonModels | aaa234b2627cda2b92e478e8e8503bf9778aebeb | [
"MIT"
] | null | null | null | py_main/ReadData.py | ChampionApe/GamsPythonModels | aaa234b2627cda2b92e478e8e8503bf9778aebeb | [
"MIT"
] | null | null | null | py_main/ReadData.py | ChampionApe/GamsPythonModels | aaa234b2627cda2b92e478e8e8503bf9778aebeb | [
"MIT"
] | null | null | null | import os, numpy as np, pandas as pd, DataBase
def clean(db,clean_data):
for var in db.variables['variables']:
db[var] = db[var][(x not in clean_data for x in db[var])]
if np.nan in clean_data:
db[var] = db[var].dropna()
return db
class read_data:
def main(data,export_to=False,clean_data=[np.nan,'NA',0],com... | 39.581395 | 165 | 0.675088 |
c214a33169eeadc2e30af2157f4c1efd2be384a9 | 13,969 | py | Python | mijisou-devel/searx/preferences.py | xu1991/seartest | beb2d5e282d88b29544d2d17add2be6b97454ec1 | [
"CC0-1.0"
] | 1 | 2020-12-24T16:24:31.000Z | 2020-12-24T16:24:31.000Z | mijisou-devel/searx/preferences.py | xu1991/seartest | beb2d5e282d88b29544d2d17add2be6b97454ec1 | [
"CC0-1.0"
] | 6 | 2021-03-31T19:23:49.000Z | 2021-12-13T20:17:36.000Z | mijisou-devel/searx/preferences.py | xu1991/seartest | beb2d5e282d88b29544d2d17add2be6b97454ec1 | [
"CC0-1.0"
] | 1 | 2020-09-05T11:45:21.000Z | 2020-09-05T11:45:21.000Z | from base64 import urlsafe_b64encode, urlsafe_b64decode
from zlib import compress, decompress
from sys import version
from searx import settings, autocomplete
from searx.languages import language_codes as languages
from searx.url_utils import parse_qs, urlencode
if version[0] == '3':
unicode = str
COOKIE_MAX_AG... | 40.140805 | 120 | 0.569046 |
8aa0b1bbfb97d81f3f4da7f244c3d2f5412b3a65 | 2,934 | py | Python | src/oci/analytics/models/virtual_cloud_network.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/analytics/models/virtual_cloud_network.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/analytics/models/virtual_cloud_network.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 28.764706 | 245 | 0.639059 |
753ac3dcb7676f90afc23b493eaab5283806af61 | 3,417 | py | Python | tests/test_universal_kepler.py | benitocm/my-orbits | a8ca434af3295c8bcb04bb43fc9fb703deda0087 | [
"Apache-2.0"
] | 1 | 2021-10-18T13:23:21.000Z | 2021-10-18T13:23:21.000Z | tests/test_universal_kepler.py | benitocm/my-orbits | a8ca434af3295c8bcb04bb43fc9fb703deda0087 | [
"Apache-2.0"
] | null | null | null | tests/test_universal_kepler.py | benitocm/my-orbits | a8ca434af3295c8bcb04bb43fc9fb703deda0087 | [
"Apache-2.0"
] | null | null | null | """
This module contains the tests for timeconv function
"""
# Standard library imports
# Third party imports
from pytest import approx
#https://www.scivision.dev/pytest-approx-equal-assert-allclose/
import numpy as np
from pathlib import Path
import sys
# Local application imports
from myorbit.util.timeut import ... | 32.235849 | 104 | 0.707638 |
04aa5acd8050c5e0db0907ab5a9bb1ca3cfbbe93 | 1,664 | py | Python | _validate_init.py | potter420/dash-editor-components | 871c2f3677259c5563797eeada127dbc4d8a95b6 | [
"MIT"
] | 26 | 2019-09-19T04:43:23.000Z | 2021-08-09T14:17:16.000Z | _validate_init.py | potter420/dash-editor-components | 871c2f3677259c5563797eeada127dbc4d8a95b6 | [
"MIT"
] | 8 | 2019-09-20T14:38:19.000Z | 2021-06-28T19:24:15.000Z | _validate_init.py | potter420/dash-editor-components | 871c2f3677259c5563797eeada127dbc4d8a95b6 | [
"MIT"
] | 3 | 2020-03-12T16:18:41.000Z | 2021-07-15T07:50:03.000Z | """
DO NOT MODIFY
This file is used to validate your publish settings.
"""
from __future__ import print_function
import os
import sys
import importlib
components_package = 'dash_editor_components'
components_lib = importlib.import_module(components_package)
missing_dist_msg = 'Warning {} was not found in `{}.__ini... | 24.470588 | 78 | 0.644832 |
bdc6c9902c07a5515d5cb9e7531b2f1be3301e56 | 4,605 | py | Python | rp/IoT_SmartFridge.py | pranjalag19/freezls | 7d8dfab659b9e09c351fc9e68d995d4de6e774c1 | [
"Apache-2.0"
] | 3 | 2021-02-20T08:38:50.000Z | 2021-11-01T16:54:30.000Z | rp/IoT_SmartFridge.py | pranjalag19/freezls | 7d8dfab659b9e09c351fc9e68d995d4de6e774c1 | [
"Apache-2.0"
] | null | null | null | rp/IoT_SmartFridge.py | pranjalag19/freezls | 7d8dfab659b9e09c351fc9e68d995d4de6e774c1 | [
"Apache-2.0"
] | 1 | 2021-06-09T12:15:58.000Z | 2021-06-09T12:15:58.000Z | # import necessary packages
import RPi.GPIO as GPIO
import Adafruit_DHT
from Lcd import *
from imutils.video import VideoStream
from pyzbar import pyzbar
import cv2
import imutils
import multiprocessing as mp
import API
import datetime
import time
# setup GPIO mode
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
# GPIO ... | 36.259843 | 94 | 0.578502 |
ce5a13456c8ed8679043cf87ea77107615a7c8c7 | 95,952 | py | Python | python/getdist/mcsamples.py | sjoudaki/CosmoJBD | 3c1d029b74034b92cb2974de15e4c18637a5277e | [
"MIT"
] | null | null | null | python/getdist/mcsamples.py | sjoudaki/CosmoJBD | 3c1d029b74034b92cb2974de15e4c18637a5277e | [
"MIT"
] | null | null | null | python/getdist/mcsamples.py | sjoudaki/CosmoJBD | 3c1d029b74034b92cb2974de15e4c18637a5277e | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from __future__ import print_function
import os
import glob
import logging
import copy
import pickle
import math
import time
import numpy as np
from scipy.stats import norm
import getdist
from getdist import chains, types, covmat, ParamInfo, IniFile
from getdist.densities import D... | 45.324516 | 151 | 0.558373 |
553aa9aadf4e1b292f02d3cd5090f278d40ab4fb | 3,303 | py | Python | tools/runners/util.py | GerHobbelt/jerryscript | 483c867cb238df1b3d00ada3ee4648fc202dadb0 | [
"Apache-2.0"
] | null | null | null | tools/runners/util.py | GerHobbelt/jerryscript | 483c867cb238df1b3d00ada3ee4648fc202dadb0 | [
"Apache-2.0"
] | null | null | null | tools/runners/util.py | GerHobbelt/jerryscript | 483c867cb238df1b3d00ada3ee4648fc202dadb0 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright JS Foundation and other contributors, http://js.foundation
#
# 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.... | 36.296703 | 116 | 0.717832 |
9b4c3e59f83a9d37a9f63839fabae16d9b3a4ede | 1,609 | py | Python | azure-mgmt-web/azure/mgmt/web/models/slow_requests_based_trigger.py | HydAu/AzureSDKForPython | 5cbe34e9e0b8ea1faacc9f205633ccc0b885c0f3 | [
"Apache-2.0"
] | null | null | null | azure-mgmt-web/azure/mgmt/web/models/slow_requests_based_trigger.py | HydAu/AzureSDKForPython | 5cbe34e9e0b8ea1faacc9f205633ccc0b885c0f3 | [
"Apache-2.0"
] | null | null | null | azure-mgmt-web/azure/mgmt/web/models/slow_requests_based_trigger.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 ... | 34.234043 | 76 | 0.634556 |
415c2b2da383b904a8c11359a13dcaf7a2288e7c | 670 | py | Python | exer037.py | fabionunesdeparis/Fundamentos-em-python3 | b21d06b44d5b18e99419cd06b4e08363c1f7a7ce | [
"MIT"
] | null | null | null | exer037.py | fabionunesdeparis/Fundamentos-em-python3 | b21d06b44d5b18e99419cd06b4e08363c1f7a7ce | [
"MIT"
] | null | null | null | exer037.py | fabionunesdeparis/Fundamentos-em-python3 | b21d06b44d5b18e99419cd06b4e08363c1f7a7ce | [
"MIT"
] | null | null | null | # @ Fábio C. Nunes 11/05/20
numero = int(input('Digite um número inteiro: '))
print('[1] - Binário\n[2] - Octal\n[3] - Hexadecimal')
opcao = int(input('Digite a opção desejada: '))
if opcao == 1:
binario = str(bin(numero))
print('O número digitado {}, convertido para binário é {}'.format(numero, binario[2:]))
e... | 44.666667 | 99 | 0.656716 |
62196a73332a490a8dada1f7eb830f4d7abd9b01 | 15,745 | py | Python | sdk/communication/azure-communication-identity/azure/communication/identity/_generated/aio/operations/_communication_identity_operations.py | jalauzon-msft/azure-sdk-for-python | 15967f5c6d3376f2334a382486ba86339786e028 | [
"MIT"
] | 1 | 2022-02-01T18:50:12.000Z | 2022-02-01T18:50:12.000Z | sdk/communication/azure-communication-identity/azure/communication/identity/_generated/aio/operations/_communication_identity_operations.py | ellhe-blaster/azure-sdk-for-python | 82193ba5e81cc5e5e5a5239bba58abe62e86f469 | [
"MIT"
] | null | null | null | sdk/communication/azure-communication-identity/azure/communication/identity/_generated/aio/operations/_communication_identity_operations.py | ellhe-blaster/azure-sdk-for-python | 82193ba5e81cc5e5e5a5239bba58abe62e86f469 | [
"MIT"
] | null | null | null | # pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRe... | 43.614958 | 221 | 0.671578 |
3d68f0b3009610881e49643f6d47a34182772d75 | 77,967 | py | Python | dev-tools/scripts/releaseWizard.py | solr8/solr | c2f26ac784945dca6d096b58f2d0e98196562894 | [
"Apache-2.0"
] | null | null | null | dev-tools/scripts/releaseWizard.py | solr8/solr | c2f26ac784945dca6d096b58f2d0e98196562894 | [
"Apache-2.0"
] | null | null | null | dev-tools/scripts/releaseWizard.py | solr8/solr | c2f26ac784945dca6d096b58f2d0e98196562894 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, ... | 38.712512 | 192 | 0.58004 |
21eadc785c19591fc4ce1584c835e2140c2b7c81 | 3,324 | py | Python | src/settings.py | ititifad/daraja | 05a6d47ab2d645d1eb5479343a33889ccfb43234 | [
"MIT"
] | null | null | null | src/settings.py | ititifad/daraja | 05a6d47ab2d645d1eb5479343a33889ccfb43234 | [
"MIT"
] | null | null | null | src/settings.py | ititifad/daraja | 05a6d47ab2d645d1eb5479343a33889ccfb43234 | [
"MIT"
] | null | null | null | """
Django settings for src project.
Generated by 'django-admin startproject' using Django 3.1.6.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
from pathlib imp... | 25.569231 | 91 | 0.695848 |
1f5eee47162c7ff0384ff8ede95fee931e5d70eb | 658 | py | Python | app/migrations/0004_auto_20200916_1301.py | mono57/students.archives.fs | 14e20b7696f6a0d6481a3312b2ad8b7ba197eb59 | [
"MIT"
] | null | null | null | app/migrations/0004_auto_20200916_1301.py | mono57/students.archives.fs | 14e20b7696f6a0d6481a3312b2ad8b7ba197eb59 | [
"MIT"
] | 9 | 2021-03-30T14:09:12.000Z | 2022-03-12T00:46:23.000Z | app/migrations/0004_auto_20200916_1301.py | mono57/students.archives.fs | 14e20b7696f6a0d6481a3312b2ad8b7ba197eb59 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.8 on 2020-09-16 12:01
from django.db import migrations, models
import uuid
class Migration(migrations.Migration):
dependencies = [
('app', '0003_auto_20200916_1043'),
]
operations = [
migrations.AlterField(
model_name='student',
name='re... | 26.32 | 106 | 0.613982 |
724fa0d223ee126bdc4223ed3802633f384d3d60 | 802 | py | Python | users/migrations/0001_initial.py | Abezzam10/Wappp | 94f6f669ab0589b2398e42225eee4063b3213b59 | [
"Apache-2.0"
] | null | null | null | users/migrations/0001_initial.py | Abezzam10/Wappp | 94f6f669ab0589b2398e42225eee4063b3213b59 | [
"Apache-2.0"
] | null | null | null | users/migrations/0001_initial.py | Abezzam10/Wappp | 94f6f669ab0589b2398e42225eee4063b3213b59 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 2.2.1 on 2019-05-21 22:32
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
... | 30.846154 | 122 | 0.625935 |
f3338b95bc70748da460e948e035dec3265d940a | 190 | py | Python | lg_keyboard/src/lg_keyboard/__init__.py | carlosvquezada/lg_ros_nodes | 7560e99272d06ef5c80a5444131dad72c078a718 | [
"Apache-2.0"
] | null | null | null | lg_keyboard/src/lg_keyboard/__init__.py | carlosvquezada/lg_ros_nodes | 7560e99272d06ef5c80a5444131dad72c078a718 | [
"Apache-2.0"
] | null | null | null | lg_keyboard/src/lg_keyboard/__init__.py | carlosvquezada/lg_ros_nodes | 7560e99272d06ef5c80a5444131dad72c078a718 | [
"Apache-2.0"
] | null | null | null | from onboard import ROS_NODE_NAME
from onboard import OnboardViewportException
from onboard import OnboardLauncher
from onboard import OnboardConfig
from onboard_router import OnboardRouter
| 31.666667 | 44 | 0.894737 |
26ef676624805cb910607d31d4ec081a0aa44648 | 68 | py | Python | scripts/hello_streamlit.py | R-fred/awesome-streamlit | 10f2b132bc8e61a82edfacb4b3bb36d0da6c63d3 | [
"CC0-1.0"
] | 1,194 | 2019-10-09T06:15:27.000Z | 2022-03-31T14:53:00.000Z | scripts/hello_streamlit.py | R-fred/awesome-streamlit | 10f2b132bc8e61a82edfacb4b3bb36d0da6c63d3 | [
"CC0-1.0"
] | 55 | 2019-10-09T12:08:39.000Z | 2022-02-10T00:48:53.000Z | scripts/hello_streamlit.py | R-fred/awesome-streamlit | 10f2b132bc8e61a82edfacb4b3bb36d0da6c63d3 | [
"CC0-1.0"
] | 272 | 2019-10-09T12:04:31.000Z | 2022-03-29T02:43:30.000Z | import streamlit as st
st.title("Hello Streamlit again and again")
| 17 | 43 | 0.779412 |
b2ef7fd209032909347028e076ce2b708133239e | 1,403 | py | Python | iszigzag.py | pclumson1/Python3_Algorithms | 7b8106af1641aeb09b6bb1ac1881b8beecde1184 | [
"MIT"
] | null | null | null | iszigzag.py | pclumson1/Python3_Algorithms | 7b8106af1641aeb09b6bb1ac1881b8beecde1184 | [
"MIT"
] | null | null | null | iszigzag.py | pclumson1/Python3_Algorithms | 7b8106af1641aeb09b6bb1ac1881b8beecde1184 | [
"MIT"
] | null | null | null | # Let's say a triple (a, b, c) is a zigzag if either a < b > c or a > b < c.
# Given an array of integers numbers, your task is to check all the triples of its consecutive elements for being a zigzag. More formally, your task is to construct an array of length numbers.length - 2, where the ith element of the output ... | 45.258065 | 344 | 0.605132 |
3d631939f616a86d9597eb0cdfeb16f420c6144c | 10,053 | py | Python | arviz/tests/base_tests/test_rcparams.py | smit-s/arviz | 6a51574efc2dfa652d489091121a3c46da64d12e | [
"Apache-2.0"
] | null | null | null | arviz/tests/base_tests/test_rcparams.py | smit-s/arviz | 6a51574efc2dfa652d489091121a3c46da64d12e | [
"Apache-2.0"
] | null | null | null | arviz/tests/base_tests/test_rcparams.py | smit-s/arviz | 6a51574efc2dfa652d489091121a3c46da64d12e | [
"Apache-2.0"
] | null | null | null | # pylint: disable=redefined-outer-name
import os
import numpy as np
import pytest
from xarray.core.indexing import MemoryCachedArray
from ...data import load_arviz_data, datasets
from ...stats import compare
from ...rcparams import (
rcParams,
rc_context,
_make_validate_choice,
_make_validate_choice_r... | 33.51 | 99 | 0.676614 |
88c2ff1f70d5e7f39e74cd48ea49d34967f4f958 | 23,898 | py | Python | trio/_abc.py | matham/trio | ef7a32110b9565dd6f3a6132c105cec63a707968 | [
"Apache-2.0",
"MIT"
] | 4 | 2017-03-01T22:14:46.000Z | 2020-07-31T07:18:18.000Z | trio/_abc.py | matham/trio | ef7a32110b9565dd6f3a6132c105cec63a707968 | [
"Apache-2.0",
"MIT"
] | 81 | 2017-01-22T11:58:29.000Z | 2017-05-27T22:17:49.000Z | trio/_abc.py | matham/trio | ef7a32110b9565dd6f3a6132c105cec63a707968 | [
"Apache-2.0",
"MIT"
] | 1 | 2020-05-28T19:38:09.000Z | 2020-05-28T19:38:09.000Z | from abc import ABCMeta, abstractmethod
from typing import Generic, TypeVar
from ._util import aiter_compat
import trio
# We use ABCMeta instead of ABC, plus set __slots__=(), so as not to force a
# __dict__ onto subclasses.
class Clock(metaclass=ABCMeta):
"""The interface for custom run loop clocks.
"""
... | 36.766154 | 130 | 0.663905 |
4a4621be4f5356af2323f0ee733d1bd3d3ad9388 | 373 | py | Python | 01.Python/07.Range.py | rmatam/Deep-Learning | 665492254d36d3991e4b58abf6dd62d7fdac8769 | [
"Apache-2.0"
] | null | null | null | 01.Python/07.Range.py | rmatam/Deep-Learning | 665492254d36d3991e4b58abf6dd62d7fdac8769 | [
"Apache-2.0"
] | null | null | null | 01.Python/07.Range.py | rmatam/Deep-Learning | 665492254d36d3991e4b58abf6dd62d7fdac8769 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed Dec 21 18:08:37 2016
@author: rmatam
"""
import numpy as np
from scipy import stats
A = np.array([[10,14,11,7,9.5,15,19],[8,9,17,14.5,12,18,15.5],
[15,7.5,11.5,10,10.5,7,11],[11.5,11,9,12,14,12,7.5]])
B = A.T
print B
#a=np.median(B,axis=0)
a... | 20.722222 | 69 | 0.544236 |
69cd39fe7ebe8016d05a856c4ff6eaaddcdfabad | 99,454 | py | Python | tests/unit/gapic/service_v1beta1/test_environments.py | renovate-bot/python-orchestration-airflow | ca7e4935f1509a6e09c3d58fab7dfe4a4eabe782 | [
"Apache-2.0"
] | 5 | 2021-09-13T21:29:18.000Z | 2021-12-29T14:30:09.000Z | tests/unit/gapic/service_v1beta1/test_environments.py | renovate-bot/python-orchestration-airflow | ca7e4935f1509a6e09c3d58fab7dfe4a4eabe782 | [
"Apache-2.0"
] | 21 | 2021-07-23T11:14:26.000Z | 2022-03-07T17:06:22.000Z | tests/unit/gapic/service_v1beta1/test_environments.py | renovate-bot/python-orchestration-airflow | ca7e4935f1509a6e09c3d58fab7dfe4a4eabe782 | [
"Apache-2.0"
] | 2 | 2021-07-21T15:43:57.000Z | 2022-01-29T08:11:34.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 38.428903 | 138 | 0.689645 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.