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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c3bef769f1d16258c11bb8c78ca85740b02ff61 | 3,923 | py | Python | detect.py | 6abi/pi08 | fa49d256569ba359ecde0f82a8f03d01db6d6a65 | [
"MIT"
] | null | null | null | detect.py | 6abi/pi08 | fa49d256569ba359ecde0f82a8f03d01db6d6a65 | [
"MIT"
] | null | null | null | detect.py | 6abi/pi08 | fa49d256569ba359ecde0f82a8f03d01db6d6a65 | [
"MIT"
] | null | null | null | import tensorflow as tf
physical_devices = tf.config.experimental.list_physical_devices('GPU')
if len(physical_devices) > 0:
tf.config.experimental.set_memory_growth(physical_devices[0], True)
from absl import app, flags, logging
from absl.flags import FLAGS
import core.utils as utils
from core.yolov4 import filter... | 42.641304 | 134 | 0.708386 | import tensorflow as tf
physical_devices = tf.config.experimental.list_physical_devices('GPU')
if len(physical_devices) > 0:
tf.config.experimental.set_memory_growth(physical_devices[0], True)
from absl import app, flags, logging
from absl.flags import FLAGS
import core.utils as utils
from core.yolov4 import filter... | true | true |
1c3bf053ead7c364acfd7dd4e6499ef957758d21 | 2,194 | py | Python | cnn_example.py | OleguerCanal/transplanter | 854fa727747a484dedde9092eeee6884d7d1b44b | [
"MIT"
] | 1 | 2022-03-23T09:27:56.000Z | 2022-03-23T09:27:56.000Z | cnn_example.py | OleguerCanal/transplanter | 854fa727747a484dedde9092eeee6884d7d1b44b | [
"MIT"
] | null | null | null | cnn_example.py | OleguerCanal/transplanter | 854fa727747a484dedde9092eeee6884d7d1b44b | [
"MIT"
] | null | null | null | import logging
from torch.utils.data import DataLoader
from src.transplanter import Transplanter
from test_models.models import ConvNet
from src.datasets import RandomDataset
from src.utilities.block_module import BlockModule
from src.utilities.helpers import InputShapes
from test_models.train_cnn import train
loggin... | 38.491228 | 122 | 0.72516 | import logging
from torch.utils.data import DataLoader
from src.transplanter import Transplanter
from test_models.models import ConvNet
from src.datasets import RandomDataset
from src.utilities.block_module import BlockModule
from src.utilities.helpers import InputShapes
from test_models.train_cnn import train
loggin... | true | true |
1c3bf21f90d9d62e92b23d7aed9f6ad7aecc177a | 409 | py | Python | python01/PythonCoroutine.py | zhayangtao/HelloPython | e0e8b450afba1382f56411344ad54ef9910a5004 | [
"Apache-2.0"
] | null | null | null | python01/PythonCoroutine.py | zhayangtao/HelloPython | e0e8b450afba1382f56411344ad54ef9910a5004 | [
"Apache-2.0"
] | 1 | 2017-09-01T03:59:11.000Z | 2017-09-01T03:59:11.000Z | python01/PythonCoroutine.py | zhayangtao/HelloPython | e0e8b450afba1382f56411344ad54ef9910a5004 | [
"Apache-2.0"
] | null | null | null | # 协程
def consumer():
r = ''
while True:
n = yield r
if not n:
return
print('[CONSUMER] Consuming %s' % n)
r = '200 OK'
def produce(c):
c.send(None)
n = 0
while n < 5:
n += 1
print('[PRODUCER] Producing %s' % n)
r = c.send(n)
... | 17.041667 | 51 | 0.454768 |
def consumer():
r = ''
while True:
n = yield r
if not n:
return
print('[CONSUMER] Consuming %s' % n)
r = '200 OK'
def produce(c):
c.send(None)
n = 0
while n < 5:
n += 1
print('[PRODUCER] Producing %s' % n)
r = c.send(n)
p... | true | true |
1c3bf412148318abb67e3975e1293954678bf770 | 7,746 | py | Python | tdsa_augmentation/data_augmentation/target_extraction_train_predict.py | apmoore1/tdsa_augmentation | 71c9ffa79ea48e817408d0dc496cc146ce75a942 | [
"Apache-2.0"
] | null | null | null | tdsa_augmentation/data_augmentation/target_extraction_train_predict.py | apmoore1/tdsa_augmentation | 71c9ffa79ea48e817408d0dc496cc146ce75a942 | [
"Apache-2.0"
] | null | null | null | tdsa_augmentation/data_augmentation/target_extraction_train_predict.py | apmoore1/tdsa_augmentation | 71c9ffa79ea48e817408d0dc496cc146ce75a942 | [
"Apache-2.0"
] | null | null | null | import argparse
from pathlib import Path
import json
from typing import Iterable
import tempfile
import random
from allennlp.models import Model
from sklearn.model_selection import train_test_split
import target_extraction
from target_extraction.data_types import TargetTextCollection
from target_extraction.dataset_par... | 46.945455 | 125 | 0.639556 | import argparse
from pathlib import Path
import json
from typing import Iterable
import tempfile
import random
from allennlp.models import Model
from sklearn.model_selection import train_test_split
import target_extraction
from target_extraction.data_types import TargetTextCollection
from target_extraction.dataset_par... | true | true |
1c3bf41fff909ff93e310492d5406989841b8adb | 7,216 | py | Python | tensorflow_datasets/translate/wmt.py | alexalemi/datasets | 45282fbf6b42aac0ff58d40a7941a983be7c9f18 | [
"Apache-2.0"
] | 1 | 2019-03-19T10:38:38.000Z | 2019-03-19T10:38:38.000Z | tensorflow_datasets/translate/wmt.py | alexalemi/datasets | 45282fbf6b42aac0ff58d40a7941a983be7c9f18 | [
"Apache-2.0"
] | null | null | null | tensorflow_datasets/translate/wmt.py | alexalemi/datasets | 45282fbf6b42aac0ff58d40a7941a983be7c9f18 | [
"Apache-2.0"
] | null | null | null | # 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... | 37.583333 | 80 | 0.667129 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import abc
import collections
import json
import os
import tensorflow as tf
from tensorflow_datasets.core import api_utils
import tensorflow_datasets.public_api as tfds
_DESCRIPTION = """\
Tra... | true | true |
1c3bf528230677da54091dd3ef37661d1b3ce393 | 1,521 | py | Python | qurator/dinglehopper/tests/test_integ_character_error_rate_ocr.py | bertsky/dinglehopper | a51f0b3dcdd03105c2d7e352d37503237de3bd48 | [
"Apache-2.0"
] | null | null | null | qurator/dinglehopper/tests/test_integ_character_error_rate_ocr.py | bertsky/dinglehopper | a51f0b3dcdd03105c2d7e352d37503237de3bd48 | [
"Apache-2.0"
] | null | null | null | qurator/dinglehopper/tests/test_integ_character_error_rate_ocr.py | bertsky/dinglehopper | a51f0b3dcdd03105c2d7e352d37503237de3bd48 | [
"Apache-2.0"
] | null | null | null | from __future__ import division, print_function
import os
import pytest
from lxml import etree as ET
from uniseg.graphemecluster import grapheme_clusters
from .. import character_error_rate, page_text, alto_text
data_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'data')
@pytest.mark.integration
d... | 36.214286 | 115 | 0.745562 | from __future__ import division, print_function
import os
import pytest
from lxml import etree as ET
from uniseg.graphemecluster import grapheme_clusters
from .. import character_error_rate, page_text, alto_text
data_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'data')
@pytest.mark.integration
d... | true | true |
1c3bf5961901ee63852fa32b005ee5d138026167 | 2,537 | py | Python | 2019/day22/solutions.py | ivobatkovic/advent-of-code | e43489bcd2307f0f3ac8b0ec4e850f0a201f9944 | [
"MIT"
] | 3 | 2019-12-14T16:24:50.000Z | 2020-12-06T16:40:13.000Z | 2019/day22/solutions.py | ivobatkovic/advent-of-code | e43489bcd2307f0f3ac8b0ec4e850f0a201f9944 | [
"MIT"
] | 4 | 2019-12-03T14:18:13.000Z | 2020-12-03T08:29:32.000Z | 2019/day22/solutions.py | ivobatkovic/advent-of-code | e43489bcd2307f0f3ac8b0ec4e850f0a201f9944 | [
"MIT"
] | 2 | 2019-12-06T07:25:57.000Z | 2020-12-08T12:42:37.000Z | from os.path import dirname
from os.path import realpath
from os.path import join
import time
import sys
sys.path.append(join(dirname(realpath(__file__)), *[".."]))
from day22.deck import Deck
def part1(input_):
"""Part one: apply the linear transformation y = a*x + b to get which
position card x ends up in... | 29.847059 | 79 | 0.530548 | from os.path import dirname
from os.path import realpath
from os.path import join
import time
import sys
sys.path.append(join(dirname(realpath(__file__)), *[".."]))
from day22.deck import Deck
def part1(input_):
n, card = 10007, 2019
deck = Deck(input_, num_cards=10007)
return (deck.a * card + deck.b)... | true | true |
1c3bf5b90d873c517d7f9aea4a8bad8f1429c5ae | 586 | py | Python | Task/Rosetta-Code-Count-examples/Python/rosetta-code-count-examples.py | djgoku/RosettaCodeData | 91df62d46142e921b3eacdb52b0316c39ee236bc | [
"Info-ZIP"
] | null | null | null | Task/Rosetta-Code-Count-examples/Python/rosetta-code-count-examples.py | djgoku/RosettaCodeData | 91df62d46142e921b3eacdb52b0316c39ee236bc | [
"Info-ZIP"
] | null | null | null | Task/Rosetta-Code-Count-examples/Python/rosetta-code-count-examples.py | djgoku/RosettaCodeData | 91df62d46142e921b3eacdb52b0316c39ee236bc | [
"Info-ZIP"
] | null | null | null | import urllib, xml.dom.minidom
x = urllib.urlopen("http://www.rosettacode.org/w/api.php?action=query&list=categorymembers&cmtitle=Category:Programming_Tasks&cmlimit=500&format=xml")
tasks = []
for i in xml.dom.minidom.parseString(x.read()).getElementsByTagName("cm"):
t = i.getAttribute('title').replace(" ", "_")
... | 45.076923 | 150 | 0.675768 | import urllib, xml.dom.minidom
x = urllib.urlopen("http://www.rosettacode.org/w/api.php?action=query&list=categorymembers&cmtitle=Category:Programming_Tasks&cmlimit=500&format=xml")
tasks = []
for i in xml.dom.minidom.parseString(x.read()).getElementsByTagName("cm"):
t = i.getAttribute('title').replace(" ", "_")
... | false | true |
1c3bf5bb31389340de26901c9e03e78d456874a5 | 731 | py | Python | Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/openedx/core/djangoapps/video_pipeline/migrations/0002_auto_20171114_0704.py | osoco/better-ways-of-thinking-about-software | 83e70d23c873509e22362a09a10d3510e10f6992 | [
"MIT"
] | 3 | 2021-12-15T04:58:18.000Z | 2022-02-06T12:15:37.000Z | Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/openedx/core/djangoapps/video_pipeline/migrations/0002_auto_20171114_0704.py | osoco/better-ways-of-thinking-about-software | 83e70d23c873509e22362a09a10d3510e10f6992 | [
"MIT"
] | null | null | null | Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/openedx/core/djangoapps/video_pipeline/migrations/0002_auto_20171114_0704.py | osoco/better-ways-of-thinking-about-software | 83e70d23c873509e22362a09a10d3510e10f6992 | [
"MIT"
] | 1 | 2019-01-02T14:38:50.000Z | 2019-01-02T14:38:50.000Z | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('video_pipeline', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='videopipelineintegration',
name='client_name',
field=models.CharField... | 33.227273 | 166 | 0.652531 | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('video_pipeline', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='videopipelineintegration',
name='client_name',
field=models.CharField... | true | true |
1c3bf6091943521a6f7c5138a45928ad7e7d8eff | 1,261 | py | Python | pythonaulas/Aula 15/Desafio 068.py | jrwarg/Estudos-Phyton | 2207ec1ee9880501e12fbfecf7dfaaf38bb2ebca | [
"MIT"
] | null | null | null | pythonaulas/Aula 15/Desafio 068.py | jrwarg/Estudos-Phyton | 2207ec1ee9880501e12fbfecf7dfaaf38bb2ebca | [
"MIT"
] | null | null | null | pythonaulas/Aula 15/Desafio 068.py | jrwarg/Estudos-Phyton | 2207ec1ee9880501e12fbfecf7dfaaf38bb2ebca | [
"MIT"
] | null | null | null | """
DESAFIO 068: Jogo do Par ou Ímpar
Faça um programa que jogue par ou ímpar com o computador. O jogo só será interrompido quando o
jogador PERDER, mostrando o total de vitórias consecutivas que ele conquistou no final do jogo.
"""
from random import randint
sep1 = '-=' * 28
sep2 = '-' * 56
pontos = 0
print(sep1)
tit... | 26.829787 | 95 | 0.586043 | from random import randint
sep1 = '-=' * 28
sep2 = '-' * 56
pontos = 0
print(sep1)
titulo = 'VAMOS JOGAR PAR OU ÍMPAR'
print(f'{titulo:^56}')
print(sep1)
while True:
pc = randint(1, 10)
jogada = int(input('Digite um valor: '))
pi = 'X'
while pi != 'P' and pi != 'I':
pi = str(input('Par ou Ímpar ... | true | true |
1c3bf78dcebdcc2308b23146529097323402bf79 | 4,544 | py | Python | test2.py | jonathanmagal/BlackJack1 | 5af0a0c6ce8aabeb4af994ed374b7f8193cb49cf | [
"Unlicense"
] | null | null | null | test2.py | jonathanmagal/BlackJack1 | 5af0a0c6ce8aabeb4af994ed374b7f8193cb49cf | [
"Unlicense"
] | null | null | null | test2.py | jonathanmagal/BlackJack1 | 5af0a0c6ce8aabeb4af994ed374b7f8193cb49cf | [
"Unlicense"
] | null | null | null |
from blackjack2 import Player, Suit, Card, Deck, Game
from hashlib import new
def test_repr():
assert str(Card(Suit.HEARTS, 5)) == "Card 5 of HEARTS"
assert str(Card(Suit.DIAMONDS, 11)) == "Card Jack of DIAMONDS"
assert str(Card(Suit.CLUBS, 12)) == "Card Queen of CLUBS"
assert str(Card(Suit.CLUBS, 13... | 30.092715 | 66 | 0.638644 |
from blackjack2 import Player, Suit, Card, Deck, Game
from hashlib import new
def test_repr():
assert str(Card(Suit.HEARTS, 5)) == "Card 5 of HEARTS"
assert str(Card(Suit.DIAMONDS, 11)) == "Card Jack of DIAMONDS"
assert str(Card(Suit.CLUBS, 12)) == "Card Queen of CLUBS"
assert str(Card(Suit.CLUBS, 13... | true | true |
1c3bf78dcf5f48602ae173f78b1c183288bed5b8 | 71,367 | py | Python | vlcp/service/sdn/ioprocessing.py | geek-plus/vlcp | e7936e00929fcef00c04d4da39b67d9679d5f083 | [
"Apache-2.0"
] | 1 | 2016-09-10T12:09:29.000Z | 2016-09-10T12:09:29.000Z | vlcp/service/sdn/ioprocessing.py | wan-qy/vlcp | e7936e00929fcef00c04d4da39b67d9679d5f083 | [
"Apache-2.0"
] | null | null | null | vlcp/service/sdn/ioprocessing.py | wan-qy/vlcp | e7936e00929fcef00c04d4da39b67d9679d5f083 | [
"Apache-2.0"
] | null | null | null | '''
Created on 2016/4/13
:author: hubo
'''
from vlcp.service.sdn.flowbase import FlowBase
from vlcp.server.module import depend, ModuleNotification, callAPI
import vlcp.service.sdn.ofpportmanager as ofpportmanager
import vlcp.service.sdn.ovsdbportmanager as ovsdbportmanager
import vlcp.service.kvdb.objectdb as objectd... | 71.797787 | 186 | 0.402273 | from vlcp.service.sdn.flowbase import FlowBase
from vlcp.server.module import depend, ModuleNotification, callAPI
import vlcp.service.sdn.ofpportmanager as ofpportmanager
import vlcp.service.sdn.ovsdbportmanager as ovsdbportmanager
import vlcp.service.kvdb.objectdb as objectdb
from vlcp.event.event import Event, withIn... | true | true |
1c3bf793413a01c5a3666ed29a0957de712d44d4 | 40 | py | Python | crslab/data/dataset/durecdial/__init__.py | hcmus-nlp-chatbot/CRSLab | b3ab262a4ad93cbae98fe66541eb735377768a35 | [
"MIT"
] | 315 | 2021-01-05T06:31:57.000Z | 2022-03-16T21:12:23.000Z | crslab/data/dataset/durecdial/__init__.py | hcmus-nlp-chatbot/CRSLab | b3ab262a4ad93cbae98fe66541eb735377768a35 | [
"MIT"
] | 23 | 2021-01-09T05:43:26.000Z | 2022-03-28T21:05:49.000Z | crslab/data/dataset/durecdial/__init__.py | hcmus-nlp-chatbot/CRSLab | b3ab262a4ad93cbae98fe66541eb735377768a35 | [
"MIT"
] | 71 | 2021-01-05T06:31:59.000Z | 2022-03-06T06:30:35.000Z | from .durecdial import DuRecDialDataset
| 20 | 39 | 0.875 | from .durecdial import DuRecDialDataset
| true | true |
1c3bf8ef0212f14efbfd1e0e7d3f8a907c38e4f8 | 9,060 | py | Python | plot_barchart.py | codeformuenster/COVID-19-NRW | 6e35f28fc29e76b2839145880f4d796b70950661 | [
"Apache-2.0"
] | 1 | 2020-03-21T19:53:26.000Z | 2020-03-21T19:53:26.000Z | plot_barchart.py | codeformuenster/COVID-19-NRW | 6e35f28fc29e76b2839145880f4d796b70950661 | [
"Apache-2.0"
] | 5 | 2020-03-23T07:52:53.000Z | 2020-04-16T07:05:46.000Z | plot_barchart.py | codeformuenster/COVID-19-NRW | 6e35f28fc29e76b2839145880f4d796b70950661 | [
"Apache-2.0"
] | 1 | 2020-03-25T21:43:26.000Z | 2020-03-25T21:43:26.000Z | from functools import reduce
from datetime import datetime as dt
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.figure import Figure
matplotlib.use("agg")
COLOR_DEATHS = "#dd6600"
COLOR_RECOVERED = "#dbcd00"
COLOR_ACTIVE = "#2792cb"
C... | 33.308824 | 95 | 0.566115 | from functools import reduce
from datetime import datetime as dt
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.figure import Figure
matplotlib.use("agg")
COLOR_DEATHS = "#dd6600"
COLOR_RECOVERED = "#dbcd00"
COLOR_ACTIVE = "#2792cb"
C... | true | true |
1c3bf9262057662eec051c8daa4b8632d602656a | 5,537 | py | Python | cms/blogs/tests.py | dragon-dxw/nhs-ei.website | 6b513040f2cbf5c4359dc0f9431712d74bc6aa02 | [
"MIT"
] | null | null | null | cms/blogs/tests.py | dragon-dxw/nhs-ei.website | 6b513040f2cbf5c4359dc0f9431712d74bc6aa02 | [
"MIT"
] | 35 | 2021-06-25T10:22:48.000Z | 2022-03-30T11:26:22.000Z | cms/blogs/tests.py | dxw/nhs-ei.website | 6b513040f2cbf5c4359dc0f9431712d74bc6aa02 | [
"MIT"
] | null | null | null | from bs4 import BeautifulSoup
from cms.blogs.models import BlogIndexPage
from django.test import TestCase
class TestBlogIndexPage(TestCase):
# or load whichever file you piped it to
fixtures = ["fixtures/testdata.json"]
"""below was changed"""
def test_first_heading(self):
response = self.c... | 34.391304 | 86 | 0.613509 | from bs4 import BeautifulSoup
from cms.blogs.models import BlogIndexPage
from django.test import TestCase
class TestBlogIndexPage(TestCase):
fixtures = ["fixtures/testdata.json"]
def test_first_heading(self):
response = self.client.get("/blog-index-page/")
soup = BeautifulSoup(response... | true | true |
1c3bfa1e34f27db25293ec754957ea98940d5284 | 10,638 | py | Python | heat/tests/engine/service/test_stack_events.py | itachaaa/heat | a73fa991dbd93fbcfd93c3d19e74f1e8b5a0b870 | [
"Apache-2.0"
] | 1 | 2018-07-04T07:59:26.000Z | 2018-07-04T07:59:26.000Z | heat/tests/engine/service/test_stack_events.py | ljzjohnson/heat | 9e463f4af77513980b1fd215d5d2ad3bf7b979f9 | [
"Apache-2.0"
] | null | null | null | heat/tests/engine/service/test_stack_events.py | ljzjohnson/heat | 9e463f4af77513980b1fd215d5d2ad3bf7b979f9 | [
"Apache-2.0"
] | null | null | null | #
# 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 writing, software
# ... | 41.88189 | 78 | 0.586482 |
import mock
from heat.engine import resource as res
from heat.engine.resources.aws.ec2 import instance as instances
from heat.engine import service
from heat.engine import stack as parser
from heat.objects import event as event_object
from heat.objects import stack as stack_object
from heat.tests import c... | true | true |
1c3bfa42909e72f3da5ec15ede1344602925a55d | 118 | py | Python | ELAB02/02-08.py | tawanchaiii/01204111_63 | edf1174f287f5174d93729d9b5c940c74d3b6553 | [
"WTFPL"
] | null | null | null | ELAB02/02-08.py | tawanchaiii/01204111_63 | edf1174f287f5174d93729d9b5c940c74d3b6553 | [
"WTFPL"
] | null | null | null | ELAB02/02-08.py | tawanchaiii/01204111_63 | edf1174f287f5174d93729d9b5c940c74d3b6553 | [
"WTFPL"
] | null | null | null | x = int(input())
l = [1000,500,100,50,20,10,5,1]
for i in range(8):
print(f"{l[i]} => {x//l[i]}")
x = x%l[i] | 16.857143 | 32 | 0.466102 | x = int(input())
l = [1000,500,100,50,20,10,5,1]
for i in range(8):
print(f"{l[i]} => {x//l[i]}")
x = x%l[i] | true | true |
1c3bfbe80ab567fdd06ee0a5a2bf27ffc624e805 | 6,419 | py | Python | lisa/tools/fio.py | tyhicks/lisa | 50d07cbd13e4e777eaa211b01387721fe2d2094f | [
"MIT"
] | 65 | 2020-12-15T13:42:29.000Z | 2022-03-03T13:14:16.000Z | lisa/tools/fio.py | acidburn0zzz/lisa | 3934d0546592d3ff71bc3e2c4aab5d4bc646a3b9 | [
"MIT"
] | 236 | 2020-11-24T18:28:26.000Z | 2022-03-30T19:19:25.000Z | lisa/tools/fio.py | acidburn0zzz/lisa | 3934d0546592d3ff71bc3e2c4aab5d4bc646a3b9 | [
"MIT"
] | 52 | 2020-12-08T17:40:46.000Z | 2022-03-31T18:24:14.000Z | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import re
from decimal import Decimal
from enum import Enum
from typing import Any, Dict, List, cast
from lisa.executable import Tool
from lisa.notifier import DiskPerformanceMessage
from lisa.operating_system import Debian, Posix, Redhat, Suse
f... | 32.75 | 88 | 0.5599 |
import re
from decimal import Decimal
from enum import Enum
from typing import Any, Dict, List, cast
from lisa.executable import Tool
from lisa.notifier import DiskPerformanceMessage
from lisa.operating_system import Debian, Posix, Redhat, Suse
from lisa.util import LisaException, dict_to_fields
from .git import Gi... | true | true |
1c3bfeaecfa2403813f01c1c52f8e68f000a05b9 | 17,452 | py | Python | code/default/gae_proxy/server/lib/google/appengine/tools/appengine_rpc_httplib2.py | wuyongwen/XX-Net | 313aefd862b8f230f7c61dc29db1b2b93a17e6ab | [
"BSD-2-Clause"
] | 1,463 | 2015-04-07T09:41:28.000Z | 2022-03-30T02:05:19.000Z | server/lib/google/appengine/tools/appengine_rpc_httplib2.py | Palsoso/GoAgent-Always-Available | 86c2fee6474890ff26b5a66b74a1306f7f31988b | [
"WTFPL",
"Apache-2.0"
] | 73 | 2015-04-08T05:08:52.000Z | 2019-06-05T06:38:21.000Z | server/lib/google/appengine/tools/appengine_rpc_httplib2.py | Palsoso/GoAgent-Always-Available | 86c2fee6474890ff26b5a66b74a1306f7f31988b | [
"WTFPL",
"Apache-2.0"
] | 698 | 2015-04-28T12:02:00.000Z | 2022-03-19T23:53:55.000Z | #!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 36.434238 | 80 | 0.679177 |
"""Library with a variant of appengine_rpc using httplib2.
The httplib2 module offers some of the features in appengine_rpc, with
one important one being a simple integration point for OAuth2 integration.
"""
import cStringIO
import logging
import os
import random
import re
import time
import types... | false | true |
1c3bff3506a1d1a7fef511425f2a717b3d9fe8df | 1,434 | py | Python | day05/main.py | Tessmore/advent-of-code-2021 | eb54f77b00bf2540669499318633ab8dbf820420 | [
"MIT"
] | null | null | null | day05/main.py | Tessmore/advent-of-code-2021 | eb54f77b00bf2540669499318633ab8dbf820420 | [
"MIT"
] | null | null | null | day05/main.py | Tessmore/advent-of-code-2021 | eb54f77b00bf2540669499318633ab8dbf820420 | [
"MIT"
] | null | null | null |
class Line:
nr = 0
x1 = 0
y1 = 0
x2 = 0
y2 = 0
slope = None
def __init__(self, nr):
self.nr = nr
(x, y)= input().split("->")
(x1, y1) = [int(i) for i in x.split(",")]
(x2, y2) = [int(i) for i in y.split(",")]
self.x1 = x1
self.x2 = x2
... | 17.487805 | 55 | 0.480474 |
class Line:
nr = 0
x1 = 0
y1 = 0
x2 = 0
y2 = 0
slope = None
def __init__(self, nr):
self.nr = nr
(x, y)= input().split("->")
(x1, y1) = [int(i) for i in x.split(",")]
(x2, y2) = [int(i) for i in y.split(",")]
self.x1 = x1
self.x2 = x2
... | true | true |
1c3c002b09572fc0891b800d1b56631ea71d9d56 | 907 | py | Python | rl-rc-car/vis.py | sourav-roni/rl-rc-car | 4833ec6bf40b971caeec9bf0eb85a14138f91de4 | [
"MIT"
] | 47 | 2016-07-16T22:37:34.000Z | 2021-04-13T12:10:04.000Z | rl-rc-car/vis.py | harvitronix/rl-rc-car | 4833ec6bf40b971caeec9bf0eb85a14138f91de4 | [
"MIT"
] | null | null | null | rl-rc-car/vis.py | harvitronix/rl-rc-car | 4833ec6bf40b971caeec9bf0eb85a14138f91de4 | [
"MIT"
] | 23 | 2016-07-29T08:18:54.000Z | 2022-03-14T20:45:18.000Z | """
Make a "matrix" plot of what the Robocar sees so we can see like it.
"""
import seaborn as sns
import matplotlib.pyplot as plt
import math
sns.set()
def visualize_polar(state):
plt.clf()
sonar = state[0][-1:]
readings = state[0][:-1]
r = []
t = []
for i, s in enumerate(readings):
... | 18.14 | 68 | 0.601985 | import seaborn as sns
import matplotlib.pyplot as plt
import math
sns.set()
def visualize_polar(state):
plt.clf()
sonar = state[0][-1:]
readings = state[0][:-1]
r = []
t = []
for i, s in enumerate(readings):
r.append(math.radians(i * 6))
t.append(s)
ax = plt.subplot(111... | true | true |
1c3c003897a1a6088e30c1caded7269e068585a5 | 5,489 | py | Python | rpython/tool/error.py | nanjekyejoannah/pypy | e80079fe13c29eda7b2a6b4cd4557051f975a2d9 | [
"Apache-2.0",
"OpenSSL"
] | 333 | 2015-08-08T18:03:38.000Z | 2022-03-22T18:13:12.000Z | rpython/tool/error.py | nanjekyejoannah/pypy | e80079fe13c29eda7b2a6b4cd4557051f975a2d9 | [
"Apache-2.0",
"OpenSSL"
] | 7 | 2020-02-16T16:49:05.000Z | 2021-11-26T09:00:56.000Z | rpython/tool/error.py | nanjekyejoannah/pypy | e80079fe13c29eda7b2a6b4cd4557051f975a2d9 | [
"Apache-2.0",
"OpenSSL"
] | 55 | 2015-08-16T02:41:30.000Z | 2022-03-20T20:33:35.000Z |
""" error handling features, just a way of displaying errors
"""
import sys
import py
from rpython.flowspace.model import Variable
from rpython.rlib import jit
SHOW_TRACEBACK = False
SHOW_ANNOTATIONS = True
SHOW_DEFAULT_LINES_OF_CODE = 0
def source_lines1(graph, block, operindex=None, offset=None, long=False,
... | 31.912791 | 93 | 0.5726 |
import sys
import py
from rpython.flowspace.model import Variable
from rpython.rlib import jit
SHOW_TRACEBACK = False
SHOW_ANNOTATIONS = True
SHOW_DEFAULT_LINES_OF_CODE = 0
def source_lines1(graph, block, operindex=None, offset=None, long=False,
show_lines_of_code=SHOW_DEFAULT_LINES_OF_CODE):
if block i... | true | true |
1c3c0230a734c982c54b25fd01431cd10dd44691 | 8,361 | py | Python | mabwiser/linear.py | vishalbelsare/mabwiser | b0785a7b1da5342cc9b68be604f8f42f8a67958e | [
"Apache-2.0"
] | 60 | 2020-06-10T11:20:52.000Z | 2022-03-25T02:16:47.000Z | mabwiser/linear.py | vishalbelsare/mabwiser | b0785a7b1da5342cc9b68be604f8f42f8a67958e | [
"Apache-2.0"
] | 24 | 2020-06-04T18:40:21.000Z | 2022-03-24T16:49:51.000Z | mabwiser/linear.py | vishalbelsare/mabwiser | b0785a7b1da5342cc9b68be604f8f42f8a67958e | [
"Apache-2.0"
] | 12 | 2020-11-30T10:37:05.000Z | 2022-03-25T02:16:41.000Z | # -*- coding: utf-8 -*-
# SPDX-License-Identifier: Apache-2.0
from copy import deepcopy
from typing import Callable, Dict, List, NoReturn, Optional
import numpy as np
from mabwiser.base_mab import BaseMAB
from mabwiser.utils import Arm, Num, argmax, _BaseRNG
class _RidgeRegression:
def __init__(self, rng: _Ba... | 35.427966 | 116 | 0.621457 |
from copy import deepcopy
from typing import Callable, Dict, List, NoReturn, Optional
import numpy as np
from mabwiser.base_mab import BaseMAB
from mabwiser.utils import Arm, Num, argmax, _BaseRNG
class _RidgeRegression:
def __init__(self, rng: _BaseRNG, l2_lambda: Num = 1.0, alpha: Num = 1.0,
... | true | true |
1c3c03f2db10438b81045ad71d95cfd8f9dee172 | 3,911 | py | Python | src-tmp/relations2.py | EulerProject/EulerX | 49e63e6a27be97ab30832180a47d214494388e15 | [
"MIT"
] | 15 | 2016-02-17T20:48:29.000Z | 2021-03-05T20:38:05.000Z | src-tmp/relations2.py | eddy7896/EulerX | 49e63e6a27be97ab30832180a47d214494388e15 | [
"MIT"
] | 16 | 2015-02-05T18:38:48.000Z | 2021-06-14T11:38:36.000Z | src-tmp/relations2.py | eddy7896/EulerX | 49e63e6a27be97ab30832180a47d214494388e15 | [
"MIT"
] | 4 | 2016-01-26T03:24:52.000Z | 2020-01-09T07:57:15.000Z | # Copyright (c) 2014 University of California, Davis
#
#
# 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,... | 35.554545 | 73 | 0.500639 |
rcc5 = {}
rcc5["equals"] = 1 << 0
rcc5["includes"] = 1 << 1
rcc5["is_included_in"] = 1 << 2
rcc5["disjoint"] = 1 << 3
rcc5["overlaps"] = 1 << 4
rcc5['"="'] = 1 << 0
rcc5['">"'] = 1 << 1
rcc5['"<"'] = 1 << 2
rcc5['"!"'] = 1 << 3
rcc5['"><"'] = 1 << 4
logmap = {}
logmap[1<<0] = 0
logmap[1<<1] = 1
l... | true | true |
1c3c040dd71440deedbd87f357b20847ab96f47a | 5,488 | py | Python | cloudferry/lib/os/discovery/keystone.py | SVilgelm/CloudFerry | 4459c0d21ba7ccffe51176932197b352e426ba63 | [
"Apache-2.0"
] | 6 | 2017-04-20T00:49:49.000Z | 2020-12-20T16:27:10.000Z | cloudferry/lib/os/discovery/keystone.py | SVilgelm/CloudFerry | 4459c0d21ba7ccffe51176932197b352e426ba63 | [
"Apache-2.0"
] | 3 | 2017-04-08T15:47:16.000Z | 2017-05-18T17:40:59.000Z | cloudferry/lib/os/discovery/keystone.py | SVilgelm/CloudFerry | 4459c0d21ba7ccffe51176932197b352e426ba63 | [
"Apache-2.0"
] | 8 | 2017-04-07T23:42:36.000Z | 2021-08-10T11:05:10.000Z | # Copyright 2016 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | 33.060241 | 79 | 0.637937 |
import json
import logging
from keystoneclient import exceptions
from cloudferry import discover
from cloudferry import model
from cloudferry.model import identity
from cloudferry.lib.os import clients
from cloudferry.lib.os import cloud_db
LOG = logging.getLogger(__name__)
class BaseKeystoneDiscovere... | true | true |
1c3c074720fc037e86fe585d72e59f4145d914a7 | 1,234 | py | Python | DesignPattern/bridge.py | zzragida/PythonExamples | ed94ae2773a580a42e158ebdc7321a89ca4e991b | [
"MIT"
] | null | null | null | DesignPattern/bridge.py | zzragida/PythonExamples | ed94ae2773a580a42e158ebdc7321a89ca4e991b | [
"MIT"
] | null | null | null | DesignPattern/bridge.py | zzragida/PythonExamples | ed94ae2773a580a42e158ebdc7321a89ca4e991b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""http://en.wikibooks.org/wiki/Computer_Science_Design_Patterns/Bridge_Pattern#Python"""
# ConcreteImplementor 1/2
class DrawingAPI1(object):
def draw_circle(self, x, y, radius):
print('API1.circle at {}:{} radius {}'.format(x, y, radius))
# ConcreteImple... | 22.035714 | 89 | 0.623177 |
class DrawingAPI1(object):
def draw_circle(self, x, y, radius):
print('API1.circle at {}:{} radius {}'.format(x, y, radius))
class DrawingAPI2(object):
def draw_circle(self, x, y, radius):
print('API2.circle at {}:{} radius {}'.format(x, y, radius))
class CircleShape(object):
... | true | true |
1c3c074b01d2299f1d4162559c1204f13dcc05ed | 332 | py | Python | currency_converter/conversion.py | Shadwz17/currency-converter | 817037ab73412f803e5a2f032c9de5337fe38272 | [
"MIT"
] | null | null | null | currency_converter/conversion.py | Shadwz17/currency-converter | 817037ab73412f803e5a2f032c9de5337fe38272 | [
"MIT"
] | null | null | null | currency_converter/conversion.py | Shadwz17/currency-converter | 817037ab73412f803e5a2f032c9de5337fe38272 | [
"MIT"
] | null | null | null | dollar_euro = 0.88
euro_pound = 0.84
def dollar_to_euro(amount):
amount *= dollar_euro
return amount
def euro_to_dollar(amount):
amount /= dollar_euro
return amount
def euro_to_pound(amount):
amount *= euro_pound
return amount
def pound_to_euro(amount):
amount /= euro_pound
ret... | 14.434783 | 28 | 0.695783 | dollar_euro = 0.88
euro_pound = 0.84
def dollar_to_euro(amount):
amount *= dollar_euro
return amount
def euro_to_dollar(amount):
amount /= dollar_euro
return amount
def euro_to_pound(amount):
amount *= euro_pound
return amount
def pound_to_euro(amount):
amount /= euro_pound
ret... | true | true |
1c3c083a00678b16d92e2b26a315d5b428d414f7 | 922 | py | Python | tests/check_contact.py | tinytoon1/python | cc320fddea962fec97eb928e2c4ebbd5bad3ed43 | [
"Apache-2.0"
] | null | null | null | tests/check_contact.py | tinytoon1/python | cc320fddea962fec97eb928e2c4ebbd5bad3ed43 | [
"Apache-2.0"
] | null | null | null | tests/check_contact.py | tinytoon1/python | cc320fddea962fec97eb928e2c4ebbd5bad3ed43 | [
"Apache-2.0"
] | null | null | null | from model.contact import Contact
def test_check_contacts_info(app, orm):
if len(orm.get_contacts()) == 0:
app.contact.add(Contact(firstname='Alex', lastname='Murphy'))
contacts_from_homepage = sorted(app.contact.get_contacts(), key=Contact.id_or_max)
contacts_from_db = sorted(orm.get_contacts(), ... | 54.235294 | 86 | 0.745119 | from model.contact import Contact
def test_check_contacts_info(app, orm):
if len(orm.get_contacts()) == 0:
app.contact.add(Contact(firstname='Alex', lastname='Murphy'))
contacts_from_homepage = sorted(app.contact.get_contacts(), key=Contact.id_or_max)
contacts_from_db = sorted(orm.get_contacts(), ... | true | true |
1c3c08801649b292a420c115798a8f04cf0701ed | 8,334 | py | Python | benchmark/fluid/MADDPG/train.py | lp2333/PARL | e4bde1f5b7e69c5f8d3ee3a90a647dfe12204bd3 | [
"ECL-2.0",
"Apache-2.0"
] | 3,172 | 2018-05-22T02:02:29.000Z | 2022-03-31T09:14:56.000Z | benchmark/fluid/MADDPG/train.py | BKBK00/PARL | f508bc6085420431b504441c7ff129e64826603e | [
"Apache-2.0"
] | 422 | 2018-05-17T16:58:45.000Z | 2022-03-31T02:03:25.000Z | benchmark/fluid/MADDPG/train.py | BKBK00/PARL | f508bc6085420431b504441c7ff129e64826603e | [
"Apache-2.0"
] | 794 | 2018-05-21T18:33:19.000Z | 2022-03-30T13:38:09.000Z | # Copyright (c) 2018 PaddlePaddle Authors. 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 app... | 35.313559 | 78 | 0.605232 |
from parl.utils import check_version_for_fluid
check_version_for_fluid()
import os
import time
import argparse
import numpy as np
from simple_model import MAModel
from simple_agent import MAAgent
import parl
from parl.env.multiagent_simple_env import MAenv
from parl.utils import logger, summary
def r... | true | true |
1c3c08a7f77c687cc114ee800aa666888ac08b4a | 3,084 | py | Python | pwn/__init__.py | Haabb/pwnfork | c2530ea2fd2f9d4e65df234afeb8f7def93afe49 | [
"MIT"
] | 1 | 2016-08-29T03:38:42.000Z | 2016-08-29T03:38:42.000Z | pwn/__init__.py | Haabb/pwnfork | c2530ea2fd2f9d4e65df234afeb8f7def93afe49 | [
"MIT"
] | null | null | null | pwn/__init__.py | Haabb/pwnfork | c2530ea2fd2f9d4e65df234afeb8f7def93afe49 | [
"MIT"
] | null | null | null | # Submodules used in this file (they are deleted at the end)
import os, traceback
# Useful re-exports
from time import sleep
# Install path
installpath = os.path.dirname(os.path.realpath(__file__))
installpath = os.path.realpath(os.path.join(installpath, '..'))
# Argument parsing
TRACE = True
DEBUG = 0
# Ugly hack ... | 29.371429 | 76 | 0.624189 |
import os, traceback
from time import sleep
installpath = os.path.dirname(os.path.realpath(__file__))
installpath = os.path.realpath(os.path.join(installpath, '..'))
TRACE = True
DEBUG = 0
_do_argv = True
try:
if 'pwn.noargv' in traceback.extract_stack(limit=2)[0][3]:
_do_argv = False
except:
p... | false | true |
1c3c09ff7db1d4fedc0b924ff9e82237138e432c | 139 | py | Python | termux/termuxapi.py | gornostay25/other | eb75606f56af6472fb65ed85db06b699b6dbce7e | [
"MIT"
] | null | null | null | termux/termuxapi.py | gornostay25/other | eb75606f56af6472fb65ed85db06b699b6dbce7e | [
"MIT"
] | null | null | null | termux/termuxapi.py | gornostay25/other | eb75606f56af6472fb65ed85db06b699b6dbce7e | [
"MIT"
] | null | null | null | proc = subprocess.Popen(["termux-dialog -t test"], stdout=subprocess.PIPE, shell=True) \n a = proc.stdout \n a = a.read().strip().decode()
| 69.5 | 138 | 0.683453 | proc = subprocess.Popen(["termux-dialog -t test"], stdout=subprocess.PIPE, shell=True) \n a = proc.stdout \n a = a.read().strip().decode()
| false | true |
1c3c0a1ec48294d0382bda0f7bd55891216e2a4b | 1,199 | py | Python | tests/offline/test_main.py | franklouwers/maestral | 18434b6f651bdf94bb06dea1575d2c036be1b451 | [
"MIT"
] | 1,373 | 2020-04-26T09:13:15.000Z | 2021-12-18T07:19:52.000Z | tests/offline/test_main.py | franklouwers/maestral | 18434b6f651bdf94bb06dea1575d2c036be1b451 | [
"MIT"
] | 300 | 2018-12-08T20:44:39.000Z | 2021-12-16T17:42:09.000Z | tests/offline/test_main.py | franklouwers/maestral | 18434b6f651bdf94bb06dea1575d2c036be1b451 | [
"MIT"
] | 36 | 2020-08-17T18:36:06.000Z | 2021-11-23T22:21:51.000Z | # -*- coding: utf-8 -*-
import requests
import maestral.main
from maestral.constants import GITHUB_RELEASES_API
def test_check_for_updates(m):
# get current releases from GitHub
resp = requests.get(GITHUB_RELEASES_API)
try:
resp.raise_for_status()
except Exception:
# rate limit etc... | 26.065217 | 67 | 0.710592 |
import requests
import maestral.main
from maestral.constants import GITHUB_RELEASES_API
def test_check_for_updates(m):
resp = requests.get(GITHUB_RELEASES_API)
try:
resp.raise_for_status()
except Exception:
return
data = resp.json()
previous_release = data[1]["... | true | true |
1c3c0a2de9a7a9a25a23b6dfadc1bc7963a40b1c | 646 | py | Python | test_save_reload_user.py | afarizap/AirBnB_clone | 4155a42f631890824bc6c5613e0e3cb0f9b57069 | [
"MIT"
] | 1 | 2021-07-12T00:14:03.000Z | 2021-07-12T00:14:03.000Z | test_save_reload_user.py | afarizap/AirBnB_clone | 4155a42f631890824bc6c5613e0e3cb0f9b57069 | [
"MIT"
] | 2 | 2020-11-12T04:55:58.000Z | 2020-11-12T05:00:57.000Z | test_save_reload_user.py | afarizap/AirBnB_clone | 4155a42f631890824bc6c5613e0e3cb0f9b57069 | [
"MIT"
] | 2 | 2021-02-18T03:36:54.000Z | 2021-07-09T21:01:05.000Z | #!/usr/bin/python3
from models import storage
from models.base_model import BaseModel
from models.user import User
all_objs = storage.all()
print("-- Reloaded objects --")
for obj_id in all_objs.keys():
obj = all_objs[obj_id]
print(obj)
print("-- Create a new User --")
my_user = User()
my_user.first_name = "B... | 23.071429 | 45 | 0.729102 |
from models import storage
from models.base_model import BaseModel
from models.user import User
all_objs = storage.all()
print("-- Reloaded objects --")
for obj_id in all_objs.keys():
obj = all_objs[obj_id]
print(obj)
print("-- Create a new User --")
my_user = User()
my_user.first_name = "Betty"
my_user.last... | true | true |
1c3c0aaaed18d6205d74d11aadffa39d5be8f22f | 7,721 | py | Python | Gds/src/fprime_gds/common/gds_cli/command_send.py | SSteve/fprime | 12c478bd79c2c4ba2d9f9e634e47f8b6557c54a8 | [
"Apache-2.0"
] | 2 | 2021-02-23T06:56:03.000Z | 2021-02-23T07:03:53.000Z | Gds/src/fprime_gds/common/gds_cli/command_send.py | SSteve/fprime | 12c478bd79c2c4ba2d9f9e634e47f8b6557c54a8 | [
"Apache-2.0"
] | 9 | 2021-02-21T07:27:44.000Z | 2021-02-21T07:27:58.000Z | Gds/src/fprime_gds/common/gds_cli/command_send.py | SSteve/fprime | 12c478bd79c2c4ba2d9f9e634e47f8b6557c54a8 | [
"Apache-2.0"
] | 1 | 2021-02-23T17:10:44.000Z | 2021-02-23T17:10:44.000Z | """
The implementation code for the command-send GDS CLI commands
"""
import difflib
from typing import Iterable, List
import fprime_gds.common.gds_cli.misc_utils as misc_utils
import fprime_gds.common.gds_cli.test_api_utils as test_api_utils
from fprime.common.models.serialize.type_exceptions import NotInitializedEx... | 37.848039 | 147 | 0.633338 |
import difflib
from typing import Iterable, List
import fprime_gds.common.gds_cli.misc_utils as misc_utils
import fprime_gds.common.gds_cli.test_api_utils as test_api_utils
from fprime.common.models.serialize.type_exceptions import NotInitializedException
from fprime_gds.common.data_types.cmd_data import CommandArgum... | true | true |
1c3c0ac0ba0df2cc9f85fdfde3ef47b426d2b062 | 916 | py | Python | nngen/verify/leaky_relu.py | kindsenior/nngen | cba265b1a140f2aef7208926703782b6dac9e8be | [
"Apache-2.0"
] | null | null | null | nngen/verify/leaky_relu.py | kindsenior/nngen | cba265b1a140f2aef7208926703782b6dac9e8be | [
"Apache-2.0"
] | null | null | null | nngen/verify/leaky_relu.py | kindsenior/nngen | cba265b1a140f2aef7208926703782b6dac9e8be | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import numpy as np
import functools
def leaky_relu(features, slope, rshift, dtype=None, name=None, par=1,
features_dtype=None):
if rshift is None:
rshift = dtype.width if dtype is ... | 27.757576 | 74 | 0.676856 | from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import numpy as np
import functools
def leaky_relu(features, slope, rshift, dtype=None, name=None, par=1,
features_dtype=None):
if rshift is None:
rshift = dtype.width if dtype is ... | true | true |
1c3c0ac91f87c00934ec7a861efe77d8c6e2ce91 | 7,875 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_express_route_ports_locations_operations.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | 8 | 2021-01-13T23:44:08.000Z | 2021-03-17T10:13:36.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_express_route_ports_locations_operations.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | null | null | null | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_express_route_ports_locations_operations.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | null | null | null | # 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) AutoRest Code Generator.
# Changes may ... | 47.439759 | 147 | 0.673651 |
from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pi... | true | true |
1c3c0b0b3fe76d7836b1ccbf0ff20dbbb1690314 | 609 | py | Python | 268. Missing Number.py | Muthu2093/Algorithms-practice | 999434103a9098a4361104fd39cba5913860fa9d | [
"MIT"
] | null | null | null | 268. Missing Number.py | Muthu2093/Algorithms-practice | 999434103a9098a4361104fd39cba5913860fa9d | [
"MIT"
] | null | null | null | 268. Missing Number.py | Muthu2093/Algorithms-practice | 999434103a9098a4361104fd39cba5913860fa9d | [
"MIT"
] | null | null | null | ##
## Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array.
## Example 1:
## Input: [3,0,1]
## Output: 2
## Example 2:
## Input: [9,6,4,2,3,5,7,0,1]
## Output: 8
## Note:
## Your algorithm should run in linear runtime complexity. Could you implement it... | 24.36 | 125 | 0.604269 | true | true | |
1c3c0b481b5224d69161eb95f3073cb1eb07956b | 6,128 | py | Python | rust_ext.py | Lukasa/certitude | 33845ae0a6b123f084f10c7dd27f11485dd73ca6 | [
"MIT"
] | 22 | 2015-12-23T22:30:13.000Z | 2019-02-09T02:49:53.000Z | rust_ext.py | Lukasa/certitude | 33845ae0a6b123f084f10c7dd27f11485dd73ca6 | [
"MIT"
] | 12 | 2015-12-23T22:31:15.000Z | 2020-10-27T21:05:34.000Z | rust_ext.py | Lukasa/certitude | 33845ae0a6b123f084f10c7dd27f11485dd73ca6 | [
"MIT"
] | 1 | 2016-04-25T13:12:31.000Z | 2016-04-25T13:12:31.000Z | # From https://github.com/novocaine/rust-python-ext
# The MIT License (MIT)
#
# Copyright (c) 2015 James Salter
#
# 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, includin... | 35.836257 | 88 | 0.640503 |
from __future__ import print_function
import platform
import sys
import subprocess
import os.path
import glob
from distutils.cmd import Command
from distutils.command.install_lib import install_lib
import shutil
class RustBuildCommand(Command):
description = "build rust crates into Python e... | true | true |
1c3c0b517e48c8f1a6cbd38886cbcfed7779cf9b | 2,500 | py | Python | Data Structure/Binary Tree/Height of Binary Tree.py | smsubham/Data-Structure-Algorithms-Questions | 45da68231907068ef4e4a0444ffdac69b337fa7c | [
"Apache-2.0"
] | null | null | null | Data Structure/Binary Tree/Height of Binary Tree.py | smsubham/Data-Structure-Algorithms-Questions | 45da68231907068ef4e4a0444ffdac69b337fa7c | [
"Apache-2.0"
] | null | null | null | Data Structure/Binary Tree/Height of Binary Tree.py | smsubham/Data-Structure-Algorithms-Questions | 45da68231907068ef4e4a0444ffdac69b337fa7c | [
"Apache-2.0"
] | null | null | null | # https://practice.geeksforgeeks.org/problems/height-of-binary-tree
#User function Template for python3
'''
# Node Class:
class Node:
def _init_(self,val):
self.data = val
self.left = None
self.right = None
'''
class Solution:
#Function to find the height of a binary tree.
... | 24.271845 | 73 | 0.5084 |
class Solution:
def maximum(a, b):
if a >= b:
return a
else:
return b
def height(self, root):
if node == None:
return 0
return (1 + max(self.height(root.left), self.height(root.right)))
from collections import deque
clas... | true | true |
1c3c0b61a272f2fc4da9624add2db582ffc59577 | 62,321 | py | Python | web_app_utilities.py | Tak-Man/ML-rapid-text-labeling-app | 3741253c4fadef6e4450ad1874c40c311344b309 | [
"MIT"
] | null | null | null | web_app_utilities.py | Tak-Man/ML-rapid-text-labeling-app | 3741253c4fadef6e4450ad1874c40c311344b309 | [
"MIT"
] | null | null | null | web_app_utilities.py | Tak-Man/ML-rapid-text-labeling-app | 3741253c4fadef6e4450ad1874c40c311344b309 | [
"MIT"
] | null | null | null | import pandas as pd
import random
import sklearn.preprocessing as pp
from datetime import datetime
import itertools
import re
from scipy.stats import entropy
import uuid
import pickle
import os
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.cluster import KMeans
import sqlite3
from collections... | 41.71419 | 141 | 0.631456 | import pandas as pd
import random
import sklearn.preprocessing as pp
from datetime import datetime
import itertools
import re
from scipy.stats import entropy
import uuid
import pickle
import os
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.cluster import KMeans
import sqlite3
from collections... | true | true |
1c3c0ce4b4e2c6a7db5c9927674ea4fad1b17918 | 2,271 | py | Python | Chapter2/dna_search.py | trenton3983/ClassicComputerScienceProblemsInPython | f20edef60a072ab43bda98c5a5cb659ddd385b7f | [
"Apache-2.0"
] | 792 | 2018-07-10T18:44:04.000Z | 2022-03-25T19:19:22.000Z | Chapter2/dna_search.py | trenton3983/ClassicComputerScienceProblemsInPython | f20edef60a072ab43bda98c5a5cb659ddd385b7f | [
"Apache-2.0"
] | 17 | 2019-01-29T04:07:58.000Z | 2021-04-27T08:28:23.000Z | Chapter2/dna_search.py | trenton3983/ClassicComputerScienceProblemsInPython | f20edef60a072ab43bda98c5a5cb659ddd385b7f | [
"Apache-2.0"
] | 340 | 2018-07-26T22:23:55.000Z | 2022-03-30T03:44:02.000Z | # dna_search.py
# From Classic Computer Science Problems in Python Chapter 2
# Copyright 2018 David Kopec
#
# 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/LI... | 32.913043 | 85 | 0.676794 |
from enum import IntEnum
from typing import Tuple, List
Nucleotide: IntEnum = IntEnum('Nucleotide', ('A', 'C', 'G', 'T'))
Codon = Tuple[Nucleotide, Nucleotide, Nucleotide]
Gene = List[Codon]
gene_str: str = "ACGTGGCTCTCTAACGTACGTACGTACGGGGTTTATATATACCCTAGGACTCCCTTT"
def string_to_gene(s: str) -> ... | true | true |
1c3c0d69435d264693a977b63370557d2de9213f | 43,850 | py | Python | lib/galaxy/objectstore/__init__.py | npinter/galaxy | a18a6b9938bae282f9228891e72442bf8ab51476 | [
"CC-BY-3.0"
] | null | null | null | lib/galaxy/objectstore/__init__.py | npinter/galaxy | a18a6b9938bae282f9228891e72442bf8ab51476 | [
"CC-BY-3.0"
] | null | null | null | lib/galaxy/objectstore/__init__.py | npinter/galaxy | a18a6b9938bae282f9228891e72442bf8ab51476 | [
"CC-BY-3.0"
] | null | null | null | """
objectstore package, abstraction for storing blobs of data for use in Galaxy.
all providers ensure that data can be accessed on the filesystem for running
tools
"""
import abc
import logging
import os
import random
import shutil
import threading
import time
from collections import OrderedDict
import yaml
from g... | 40.340386 | 167 | 0.630627 |
import abc
import logging
import os
import random
import shutil
import threading
import time
from collections import OrderedDict
import yaml
from galaxy.exceptions import ObjectInvalid, ObjectNotFound
from galaxy.util import (
directory_hash_id,
force_symlink,
parse_xml,
umask_fix_perms,
)
from galax... | true | true |
1c3c0db35e5980f991c1935641bf247688c58588 | 3,092 | py | Python | src/third_party/wiredtiger/test/suite/test_bug011.py | SunguckLee/real-mongodb | fef0e44fafc6d3709a84101327e7d2f54dd18d88 | [
"Apache-2.0"
] | 4 | 2018-02-06T01:53:12.000Z | 2018-02-20T01:47:36.000Z | src/third_party/wiredtiger/test/suite/test_bug011.py | SunguckLee/real-mongodb | fef0e44fafc6d3709a84101327e7d2f54dd18d88 | [
"Apache-2.0"
] | null | null | null | src/third_party/wiredtiger/test/suite/test_bug011.py | SunguckLee/real-mongodb | fef0e44fafc6d3709a84101327e7d2f54dd18d88 | [
"Apache-2.0"
] | 3 | 2018-02-06T01:53:18.000Z | 2021-07-28T09:48:15.000Z | #!usr/bin/env python
#
# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a... | 40.155844 | 79 | 0.667206 |
import random, wiredtiger, wttest
from wtdataset import SimpleDataSet
class test_bug011(wttest.WiredTigerTestCase):
table_name = 'test_bug011'
ntables = 2000
nrows = 10000
nops = 10000
def conn_config(self):
return 'cache_size=1GB'
@wtte... | true | true |
1c3c0e1a20ec82d2c18e9e846b46216ed165c356 | 1,075 | py | Python | web/polls/migrations/0001_initial.py | yhmun/portfolio | fd06acb779dd1da227a1db265246165f6975ee58 | [
"Unlicense"
] | null | null | null | web/polls/migrations/0001_initial.py | yhmun/portfolio | fd06acb779dd1da227a1db265246165f6975ee58 | [
"Unlicense"
] | 5 | 2021-06-04T23:19:31.000Z | 2021-09-22T19:08:08.000Z | web/polls/migrations/0001_initial.py | yhmun/portfolio | fd06acb779dd1da227a1db265246165f6975ee58 | [
"Unlicense"
] | null | null | null | # Generated by Django 3.0.6 on 2020-05-31 21:26
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Question',
fields=[
... | 32.575758 | 114 | 0.586047 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Question',
fields=[
('id', models.AutoField(auto_created=... | true | true |
1c3c0f273d3aedaf69b93c9b0765066b82b32c34 | 7,255 | py | Python | selfdrive/controls/lib/pathplanner.py | TiffanyInAPot/openpilot | ca9cad56a3b11760ae3a2c3ed0ac0dbe852ab18a | [
"MIT"
] | 1 | 2019-06-06T03:10:46.000Z | 2019-06-06T03:10:46.000Z | selfdrive/controls/lib/pathplanner.py | TiffanyInAPot/openpilot | ca9cad56a3b11760ae3a2c3ed0ac0dbe852ab18a | [
"MIT"
] | null | null | null | selfdrive/controls/lib/pathplanner.py | TiffanyInAPot/openpilot | ca9cad56a3b11760ae3a2c3ed0ac0dbe852ab18a | [
"MIT"
] | null | null | null | import os
import math
import numpy as np
from common.numpy_fast import clip
from common.realtime import sec_since_boot
from selfdrive.services import service_list
from selfdrive.swaglog import cloudlog
from selfdrive.controls.lib.lateral_mpc import libmpc_py
from selfdrive.controls.lib.drive_helpers import MPC_COST_LA... | 45.062112 | 189 | 0.715507 | import os
import math
import numpy as np
from common.numpy_fast import clip
from common.realtime import sec_since_boot
from selfdrive.services import service_list
from selfdrive.swaglog import cloudlog
from selfdrive.controls.lib.lateral_mpc import libmpc_py
from selfdrive.controls.lib.drive_helpers import MPC_COST_LA... | true | true |
1c3c10767b90990f4219390186db711aa2387ba1 | 1,949 | py | Python | sparv/util/install.py | heatherleaf/sparv-pipeline | 0fe5f27d0d82548ecc6cb21a69289668aac54cf1 | [
"MIT"
] | null | null | null | sparv/util/install.py | heatherleaf/sparv-pipeline | 0fe5f27d0d82548ecc6cb21a69289668aac54cf1 | [
"MIT"
] | null | null | null | sparv/util/install.py | heatherleaf/sparv-pipeline | 0fe5f27d0d82548ecc6cb21a69289668aac54cf1 | [
"MIT"
] | null | null | null | """Util functions for installations on remote servers."""
import logging
import os
import subprocess
from glob import glob
from sparv.util import system
log = logging.getLogger(__name__)
def install_file(host, local_file, remote_file):
"""Rsync a file to a target host."""
system.rsync(local_file, host, rem... | 33.603448 | 112 | 0.647512 |
import logging
import os
import subprocess
from glob import glob
from sparv.util import system
log = logging.getLogger(__name__)
def install_file(host, local_file, remote_file):
system.rsync(local_file, host, remote_file)
def install_directory(host, directory):
for local in glob(os.path.join(directory, '... | true | true |
1c3c10a8ec1e11f5539e1b0e56b8babde0787984 | 1,857 | py | Python | Game/python/pyserial_comm_test.py | TimothyThompkins/InteractiveGame | 06042a217ede1239b4a3dd8e5adaa5e28ef7095f | [
"MIT"
] | null | null | null | Game/python/pyserial_comm_test.py | TimothyThompkins/InteractiveGame | 06042a217ede1239b4a3dd8e5adaa5e28ef7095f | [
"MIT"
] | null | null | null | Game/python/pyserial_comm_test.py | TimothyThompkins/InteractiveGame | 06042a217ede1239b4a3dd8e5adaa5e28ef7095f | [
"MIT"
] | null | null | null | import serial
import time
#ser = serial.Serial('/dev/tty.usbmodem1431') # open first serial port
ser = serial.Serial(
# port = '/dev/tty.usbmodem1431', # For Macbook pro running OSX
port = '/dev/ttyACM0', # For Ubuntu 14.04. Middle right port
baudrate = 9600,
parity = serial.PARITY_NONE,
stopbits =... | 27.716418 | 119 | 0.541195 | import serial
import time
baudrate = 9600,
parity = serial.PARITY_NONE,
stopbits = serial.STOPBITS_ONE,
bytesize = serial.EIGHTBITS,
timeout = 5
)
try:
ser.isOpen()
print ('Connected.')
except:
print ('Connection Failure')
while 1 :
print ('Enter your commands be... | true | true |
1c3c129d1d95b2a6ed8bea144df8ec679147077c | 1,942 | py | Python | services/web/apps/pm/ddash/views.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | null | null | null | services/web/apps/pm/ddash/views.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | null | null | null | services/web/apps/pm/ddash/views.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | null | null | null | # ---------------------------------------------------------------------
# pm.ddash application
# ---------------------------------------------------------------------
# Copyright (C) 2007-2021 The NOC Project
# See LICENSE for details
# ---------------------------------------------------------------------
# NOC modul... | 35.962963 | 99 | 0.556128 |
from noc.lib.app.extapplication import ExtApplication, view
from noc.sa.models.managedobject import ManagedObject
from .dashboards.loader import loader
from .dashboards.base import BaseDashboard
from noc.core.translation import ugettext as _
class DynamicDashboardApplication(ExtApplication):
title = _("... | true | true |
1c3c13112b99f811fee28d8c227ef456a6878bf9 | 3,243 | py | Python | fastargs/validation.py | lengstrom/fastargs | bf2e0ac826bfb81f7559cd44e956c6a4aad982f1 | [
"MIT"
] | 20 | 2021-04-02T06:43:37.000Z | 2022-02-16T18:33:10.000Z | fastargs/validation.py | lengstrom/fastargs | bf2e0ac826bfb81f7559cd44e956c6a4aad982f1 | [
"MIT"
] | 16 | 2021-04-02T05:27:26.000Z | 2022-03-07T18:11:11.000Z | fastargs/validation.py | lengstrom/fastargs | bf2e0ac826bfb81f7559cd44e956c6a4aad982f1 | [
"MIT"
] | 1 | 2021-11-11T03:31:10.000Z | 2021-11-11T03:31:10.000Z | import importlib
from abc import ABC, abstractmethod
class Checker(ABC):
@abstractmethod
def check(self, value):
raise NotImplementedError
@abstractmethod
def help(self) -> str:
raise NotImplementedError
def get_checker(checker):
if checker in DEFAULT_CHECKERS:
return DE... | 20.922581 | 78 | 0.599137 | import importlib
from abc import ABC, abstractmethod
class Checker(ABC):
@abstractmethod
def check(self, value):
raise NotImplementedError
@abstractmethod
def help(self) -> str:
raise NotImplementedError
def get_checker(checker):
if checker in DEFAULT_CHECKERS:
return DE... | true | true |
1c3c13c36821751f07bc687e0f64ade992b00094 | 4,137 | py | Python | scrape_mars.py | bbruzos/Web-scraping-challenge | 1c432b80cb368b7c233927b46542f87fe8933f2d | [
"ADSL"
] | null | null | null | scrape_mars.py | bbruzos/Web-scraping-challenge | 1c432b80cb368b7c233927b46542f87fe8933f2d | [
"ADSL"
] | null | null | null | scrape_mars.py | bbruzos/Web-scraping-challenge | 1c432b80cb368b7c233927b46542f87fe8933f2d | [
"ADSL"
] | null | null | null | from bs4 import BeautifulSoup as bs
import requests
import pandas as pd
from splinter import Browser
from webdriver_manager.chrome import ChromeDriverManager
def init_browser():
# @NOTE: Replace the path with your actual path to the chromedriver
executable_path = {'executable_path': ChromeDriverManager().insta... | 35.973913 | 165 | 0.688663 | from bs4 import BeautifulSoup as bs
import requests
import pandas as pd
from splinter import Browser
from webdriver_manager.chrome import ChromeDriverManager
def init_browser():
executable_path = {'executable_path': ChromeDriverManager().install()}
return Browser("chrome", **executable_path, headless=Fals... | true | true |
1c3c140d8492e84c6ed370281753f82162088160 | 184,869 | py | Python | MadSpin/decay.py | jlrainbolt/MG5_v2_6_1 | 241f0c6f309342d6e8b813284467b2edd393c7d6 | [
"NCSA"
] | null | null | null | MadSpin/decay.py | jlrainbolt/MG5_v2_6_1 | 241f0c6f309342d6e8b813284467b2edd393c7d6 | [
"NCSA"
] | null | null | null | MadSpin/decay.py | jlrainbolt/MG5_v2_6_1 | 241f0c6f309342d6e8b813284467b2edd393c7d6 | [
"NCSA"
] | null | null | null | #!/usr/bin/env python
from __future__ import division
from madgraph.interface import reweight_interface
################################################################################
#
# Copyright (c) 2009 The MadGraph5_aMC@NLO Development team and Contributors
#
# This file is a part of the MadGraph5_aMC@NLO proje... | 44.28 | 149 | 0.518064 |
from __future__ import division
from madgraph.interface import reweight_interface
momentum"].px,leg["momentum"].py,\
leg["momentum"].pz,leg["momentum"].E, leg["mass"],\
0.0,float(leg["helicity"]) )
line+="\n"
return line
def reshuffle_resonances(self,mother):
... | false | true |
1c3c14bdfc28c2e1a20a60aea74599200803b67b | 9,123 | py | Python | pgmpy/estimators/EM.py | dg46/pgmpy | caea6ef7c914464736818fb185a1d395937ed52f | [
"MIT"
] | 2,144 | 2015-01-05T21:25:04.000Z | 2022-03-31T08:24:15.000Z | pgmpy/estimators/EM.py | dg46/pgmpy | caea6ef7c914464736818fb185a1d395937ed52f | [
"MIT"
] | 1,181 | 2015-01-04T18:19:44.000Z | 2022-03-30T17:21:19.000Z | pgmpy/estimators/EM.py | dg46/pgmpy | caea6ef7c914464736818fb185a1d395937ed52f | [
"MIT"
] | 777 | 2015-01-01T11:13:27.000Z | 2022-03-28T12:31:57.000Z | import warnings
from itertools import product, chain
import numpy as np
import pandas as pd
from tqdm.auto import tqdm
from pgmpy.estimators import ParameterEstimator, MaximumLikelihoodEstimator
from pgmpy.models import BayesianNetwork
from pgmpy.factors.discrete import TabularCPD
from pgmpy.global_vars import SHOW_P... | 39.493506 | 88 | 0.59213 | import warnings
from itertools import product, chain
import numpy as np
import pandas as pd
from tqdm.auto import tqdm
from pgmpy.estimators import ParameterEstimator, MaximumLikelihoodEstimator
from pgmpy.models import BayesianNetwork
from pgmpy.factors.discrete import TabularCPD
from pgmpy.global_vars import SHOW_P... | true | true |
1c3c16f2f9c12a308f80775d111741f371af1209 | 1,044 | py | Python | python/bitcoin_101/bitcoin_client.py | fcracker79/python_bitcoin_101 | 3af1b1e1b817d9676981f3c6c87d93064ac8febe | [
"MIT"
] | 1 | 2018-09-26T18:10:36.000Z | 2018-09-26T18:10:36.000Z | python/bitcoin_101/bitcoin_client.py | fcracker79/python_bitcoin_101 | 3af1b1e1b817d9676981f3c6c87d93064ac8febe | [
"MIT"
] | null | null | null | python/bitcoin_101/bitcoin_client.py | fcracker79/python_bitcoin_101 | 3af1b1e1b817d9676981f3c6c87d93064ac8febe | [
"MIT"
] | null | null | null | import base64
from bitcoin_101 import bitjson_dumps, bitjson_loads
import requests
class BitcoinClient:
def __init__(self):
btcd_auth_header = b'Basic ' + base64.b64encode(b'bitcoin:qwertyuiop')
self.btcd_headers = {'content-type': 'application/json', 'Authorization': btcd_auth_header}
def __... | 30.705882 | 99 | 0.59387 | import base64
from bitcoin_101 import bitjson_dumps, bitjson_loads
import requests
class BitcoinClient:
def __init__(self):
btcd_auth_header = b'Basic ' + base64.b64encode(b'bitcoin:qwertyuiop')
self.btcd_headers = {'content-type': 'application/json', 'Authorization': btcd_auth_header}
def __... | true | true |
1c3c1726f5d0b409cb8cfc71d00d47de1723023a | 3,345 | py | Python | rlpyt/ul/envs/atari.py | traffic-lights/rlpyt | ec4689cddd55d98c037194685cfd6ca8e6785014 | [
"MIT"
] | 2,122 | 2019-07-02T13:19:10.000Z | 2022-03-22T09:59:42.000Z | rlpyt/ul/envs/atari.py | traffic-lights/rlpyt | ec4689cddd55d98c037194685cfd6ca8e6785014 | [
"MIT"
] | 206 | 2019-07-02T14:19:42.000Z | 2022-02-15T02:34:28.000Z | rlpyt/ul/envs/atari.py | traffic-lights/rlpyt | ec4689cddd55d98c037194685cfd6ca8e6785014 | [
"MIT"
] | 369 | 2019-07-02T13:38:28.000Z | 2022-03-28T11:16:39.000Z |
import numpy as np
import cv2
import atari_py
import os
from rlpyt.spaces.int_box import IntBox
from rlpyt.envs.atari.atari_env import AtariEnv
from rlpyt.utils.quick_args import save__init__args
class AtariEnv84(AtariEnv):
"""
Same as built-in AtariEnv except returns standard 84x84 frames.
Actually, c... | 37.166667 | 91 | 0.615546 |
import numpy as np
import cv2
import atari_py
import os
from rlpyt.spaces.int_box import IntBox
from rlpyt.envs.atari.atari_env import AtariEnv
from rlpyt.utils.quick_args import save__init__args
class AtariEnv84(AtariEnv):
def __init__(self,
game="pong",
frame_skip=4,
... | true | true |
1c3c17813cd1d03fcc24ee310d43a134760247e8 | 4,011 | py | Python | cliboa/adapter/sftp.py | bp-gen-aihara/cliboa | 978b5b484a988083768e0ebb021ff5480180e9cc | [
"MIT"
] | 27 | 2019-11-11T11:09:47.000Z | 2022-03-01T14:27:59.000Z | cliboa/adapter/sftp.py | bp-gen-aihara/cliboa | 978b5b484a988083768e0ebb021ff5480180e9cc | [
"MIT"
] | 228 | 2019-11-11T11:04:26.000Z | 2022-03-29T02:16:05.000Z | cliboa/adapter/sftp.py | bp-gen-aihara/cliboa | 978b5b484a988083768e0ebb021ff5480180e9cc | [
"MIT"
] | 11 | 2019-11-12T03:15:52.000Z | 2022-01-11T05:46:02.000Z | #
# Copyright BrainPad Inc. All Rights Reserved.
#
# 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, ... | 29.932836 | 90 | 0.537522 |
import logging
from time import sleep
from paramiko import AutoAddPolicy, SSHClient
class SftpAdapter(object):
TIMEOUT_SEC = 30
def __init__(
self,
host,
user,
password=None,
key=None,
passphrase=None,
timeout=TIMEOUT_SEC,
retryTi... | true | true |
1c3c1a1f7a8dfa35cd7c76d0f8fb37fa6fc86163 | 9,929 | py | Python | net/gnn_base.py | Steven177/intra_batch | 7fa9340ee39f5970f308153931620bcf061d6285 | [
"MIT"
] | null | null | null | net/gnn_base.py | Steven177/intra_batch | 7fa9340ee39f5970f308153931620bcf061d6285 | [
"MIT"
] | null | null | null | net/gnn_base.py | Steven177/intra_batch | 7fa9340ee39f5970f308153931620bcf061d6285 | [
"MIT"
] | null | null | null | from torch_scatter import scatter_mean, scatter_max, scatter_add
import torch
from torch import nn
import math
import torch.nn.functional as F
import numpy as np
import torch
import logging
from .utils import *
from .attentions import MultiHeadDotProduct
import torch.utils.checkpoint as checkpoint
logger = logging.getL... | 37.467925 | 164 | 0.5352 | from torch_scatter import scatter_mean, scatter_max, scatter_add
import torch
from torch import nn
import math
import torch.nn.functional as F
import numpy as np
import torch
import logging
from .utils import *
from .attentions import MultiHeadDotProduct
import torch.utils.checkpoint as checkpoint
logger = logging.getL... | true | true |
1c3c1a584c0796e1dee8b8abfa321415a02b745c | 55,455 | py | Python | search.py | mariac-molina/KR | 742496b94d922e0c2ad8ed2443cfa5dbca2255ab | [
"MIT"
] | null | null | null | search.py | mariac-molina/KR | 742496b94d922e0c2ad8ed2443cfa5dbca2255ab | [
"MIT"
] | null | null | null | search.py | mariac-molina/KR | 742496b94d922e0c2ad8ed2443cfa5dbca2255ab | [
"MIT"
] | null | null | null | """Search (Chapters 3-4)
The way to use this code is to subclass Problem to create a class of problems,
then create problem instances and solve them with calls to the various search
functions."""
import bisect
import math
import random
import sys
from collections import deque
from utils import (
is_in, argmin, a... | 35.209524 | 103 | 0.606997 |
import bisect
import math
import random
import sys
from collections import deque
from utils import (
is_in, argmin, argmax, argmax_random_tie, probability, weighted_sampler,
memoize, print_table, open_data, PriorityQueue, name,
distance, vector_add
)
infinity = float('inf')
class Problem(object):
... | true | true |
1c3c1a89991aca11b841886d909194893dc2d35d | 3,207 | py | Python | tests/__init__.py | fperetti/callee | 58740f73ff9a76f5fe0075bf18d7345a0f9d961c | [
"BSD-3-Clause"
] | 72 | 2016-03-21T03:58:33.000Z | 2022-03-29T10:24:51.000Z | tests/__init__.py | fperetti/callee | 58740f73ff9a76f5fe0075bf18d7345a0f9d961c | [
"BSD-3-Clause"
] | 14 | 2016-03-21T03:58:39.000Z | 2021-09-07T16:26:03.000Z | tests/__init__.py | fperetti/callee | 58740f73ff9a76f5fe0075bf18d7345a0f9d961c | [
"BSD-3-Clause"
] | 9 | 2016-10-26T14:39:00.000Z | 2021-08-13T17:39:35.000Z | """
Test package.
"""
import os
import sys
try:
import unittest.mock as mock
except ImportError:
import mock
from taipan.testing import TestCase as _TestCase
from callee._compat import asyncio
__all__ = [
'IS_PY34', 'IS_PY35',
'MatcherTestCase',
'python_code'
]
IS_PY34 = sys.version_info >= (... | 25.862903 | 77 | 0.61584 | import os
import sys
try:
import unittest.mock as mock
except ImportError:
import mock
from taipan.testing import TestCase as _TestCase
from callee._compat import asyncio
__all__ = [
'IS_PY34', 'IS_PY35',
'MatcherTestCase',
'python_code'
]
IS_PY34 = sys.version_info >= (3, 4)
IS_PY35 = sys.ve... | true | true |
1c3c1b6d1bf3418e30f84f8cf25639559ef31943 | 3,970 | py | Python | utils/polus-imagej-util/{{cookiecutter.project_slug}}/src/ij_converter.py | LabShare/polus-plugin-utils | 9332ca6c229401d57b063a81973d48ce718c654c | [
"MIT"
] | null | null | null | utils/polus-imagej-util/{{cookiecutter.project_slug}}/src/ij_converter.py | LabShare/polus-plugin-utils | 9332ca6c229401d57b063a81973d48ce718c654c | [
"MIT"
] | null | null | null | utils/polus-imagej-util/{{cookiecutter.project_slug}}/src/ij_converter.py | LabShare/polus-plugin-utils | 9332ca6c229401d57b063a81973d48ce718c654c | [
"MIT"
] | null | null | null |
'''
A conversion utility built to convert abstract to primitive
'''
import imagej
import logging
import imglyb
import jpype
import numpy as np
import scyjava
# Initialize the logger
logging.basicConfig(format='%(asctime)s - %(name)-8s - %(levelname)-8s - %(message)s',
datefmt='%d-%b-%y %H:%M:%S')... | 27.569444 | 92 | 0.581612 |
import imagej
import logging
import imglyb
import jpype
import numpy as np
import scyjava
logging.basicConfig(format='%(asctime)s - %(name)-8s - %(levelname)-8s - %(message)s',
datefmt='%d-%b-%y %H:%M:%S')
logger = logging.getLogger("ij_converter")
logger.setLevel(logging.INFO)
'IterableInter... | true | true |
1c3c1b943af1cf8f343f2b4dac3ce1ef888fde1d | 1,202 | py | Python | ex100.py | ArthurCorrea/python-exercises | 0c2ac46b8c40dd9868b132e847cfa42e025095e3 | [
"MIT"
] | null | null | null | ex100.py | ArthurCorrea/python-exercises | 0c2ac46b8c40dd9868b132e847cfa42e025095e3 | [
"MIT"
] | null | null | null | ex100.py | ArthurCorrea/python-exercises | 0c2ac46b8c40dd9868b132e847cfa42e025095e3 | [
"MIT"
] | null | null | null | # Crie um programa que tenha uma lista chamada números e duas
# funções chamadas sorteia() e somaPar(). A primeira função
# vai sortear 5 números e vai colocá-los dentro da lista e
# a segunda função vai mostrar a soma entre todos os valores
# PARES sorteados pela função anterior.
from random import randint
from time i... | 21.854545 | 94 | 0.601498 |
from random import randint
from time import sleep
def sorteia():
soma = 0
valores = [randint(1, 15), randint(1, 15), randint(1, 15), randint(1, 15), randint(1, 15)]
print(f'5 valores sorteados: ', end='')
for item in valores:
print(f'{item} ', end='')
sleep(0.3)
for n in valor... | true | true |
1c3c1bc0bdfeb11d42c1fefef32e5893a855a255 | 8,658 | py | Python | tests/p2p/test_discovery.py | jestersimpps/py-evm | 6135904fb27b322619559e7637be40014ae254ac | [
"MIT"
] | null | null | null | tests/p2p/test_discovery.py | jestersimpps/py-evm | 6135904fb27b322619559e7637be40014ae254ac | [
"MIT"
] | 4 | 2018-12-07T21:32:48.000Z | 2019-02-22T15:25:01.000Z | tests/p2p/test_discovery.py | jestersimpps/py-evm | 6135904fb27b322619559e7637be40014ae254ac | [
"MIT"
] | null | null | null | import random
import string
import rlp
from eth_utils import (
decode_hex,
keccak,
to_bytes,
)
from eth_keys import keys
from p2p import discovery
from p2p import kademlia
from p2p.utils import safe_ord
def test_ping_pong():
alice = get_discovery_protocol(b"alice")
bob = get_discovery_protocol... | 42.861386 | 184 | 0.763918 | import random
import string
import rlp
from eth_utils import (
decode_hex,
keccak,
to_bytes,
)
from eth_keys import keys
from p2p import discovery
from p2p import kademlia
from p2p.utils import safe_ord
def test_ping_pong():
alice = get_discovery_protocol(b"alice")
bob = get_discovery_protocol... | true | true |
1c3c1d296dc79fc3d50fbd66b4bbe1736789472f | 1,818 | py | Python | setup.py | karinakozarova/luxconnector | a814f2b123dc6508a5f9042186470bc44c7098f2 | [
"Apache-2.0"
] | null | null | null | setup.py | karinakozarova/luxconnector | a814f2b123dc6508a5f9042186470bc44c7098f2 | [
"Apache-2.0"
] | null | null | null | setup.py | karinakozarova/luxconnector | a814f2b123dc6508a5f9042186470bc44c7098f2 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The setup script."""
from setuptools import setup, find_packages
with open("README.md") as readme_file:
readme = readme_file.read()
with open("HISTORY.rst") as history_file:
history = history_file.read()
requirements = [
"pillow>=6.2.2, <8",
"request... | 31.894737 | 82 | 0.648515 |
from setuptools import setup, find_packages
with open("README.md") as readme_file:
readme = readme_file.read()
with open("HISTORY.rst") as history_file:
history = history_file.read()
requirements = [
"pillow>=6.2.2, <8",
"requests>=2.24.0, <3",
"websocket>=0.2.1, <0.3",
"websocket-client>... | true | true |
1c3c1d81a04b1d86f1b8141bb3e96163b116f969 | 667 | py | Python | portal/urls.py | eugenechia95/sherpalearn | 27dc5e0e70521e15d266d9decbb4efe2b12f5583 | [
"MIT"
] | null | null | null | portal/urls.py | eugenechia95/sherpalearn | 27dc5e0e70521e15d266d9decbb4efe2b12f5583 | [
"MIT"
] | null | null | null | portal/urls.py | eugenechia95/sherpalearn | 27dc5e0e70521e15d266d9decbb4efe2b12f5583 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri Oct 19 14:35:04 2018
@author: Eugene
"""
from django.urls import path
from portal import views
from django.contrib.auth import views as auth_views
urlpatterns = [
path('', views.checkauth, name='checkauth'),
]
urlpatterns += [
path('users/', views.users, name='... | 24.703704 | 70 | 0.647676 |
from django.urls import path
from portal import views
from django.contrib.auth import views as auth_views
urlpatterns = [
path('', views.checkauth, name='checkauth'),
]
urlpatterns += [
path('users/', views.users, name='users'),
path('gwoo/', views.gwoo, name='gwoo'),
path('circle/', views.cir... | true | true |
1c3c1dbcedc7c4aac85625f49cd4c14ae2ccab97 | 2,460 | py | Python | src/moca_modules/moca_level_db.py | el-ideal-ideas/MocaUsersAPI | 8acc17d14ad1e3c57142b24a812a1806c44180a5 | [
"MIT"
] | null | null | null | src/moca_modules/moca_level_db.py | el-ideal-ideas/MocaUsersAPI | 8acc17d14ad1e3c57142b24a812a1806c44180a5 | [
"MIT"
] | null | null | null | src/moca_modules/moca_level_db.py | el-ideal-ideas/MocaUsersAPI | 8acc17d14ad1e3c57142b24a812a1806c44180a5 | [
"MIT"
] | null | null | null | # Ω*
# ■ ■■■■■
# ■ ■■ ■■
# ■ ■■ ■
# ■ ■■
# ■■■■■ ■ ■■■
# ■■ ■■ ■ ■■■
# ■■ ■■ ■ ■■■■
# ■■ ■■ ■ ■■■■
# ■■■■■■■■■ ■ ■■■
... | 28.941176 | 93 | 0.411789 |
from typing import *
from leveldb import LevelDB, LevelDBError
from .moca_base_class import MocaClassCache, MocaNamedInstance
from pathlib import Path
from .moca_utils import moca_dumps as dumps, moca_loads as loads
class MocaLevelDB(MocaClassCache, MocaNamedInstance):
def __init__(self,... | true | true |
1c3c1e5cc3ad2e80f9355c2aa54874bcf5276034 | 4,312 | py | Python | tests/cmdline/commands/test_group_ls.py | mkrack/aiida-core | bab1ad6cfc8e4ff041bce268f9270c613663cb35 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | tests/cmdline/commands/test_group_ls.py | mkrack/aiida-core | bab1ad6cfc8e4ff041bce268f9270c613663cb35 | [
"MIT",
"BSD-3-Clause"
] | 8 | 2022-01-18T10:45:50.000Z | 2022-03-19T18:49:42.000Z | tests/cmdline/commands/test_group_ls.py | mkrack/aiida-core | bab1ad6cfc8e4ff041bce268f9270c613663cb35 | [
"MIT",
"BSD-3-Clause"
] | 1 | 2019-02-12T16:57:54.000Z | 2019-02-12T16:57:54.000Z | # -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... | 33.6875 | 86 | 0.513451 | true | true | |
1c3c1f372fd25f32ecd58709d57a52a7aaea2810 | 8,493 | py | Python | preliminaries/filtering.py | Asichurter/APISeqFewShot | b4b7843da1f53cdc1d1711537c31305e7d5c6555 | [
"MIT"
] | 8 | 2020-05-14T19:29:41.000Z | 2022-03-09T03:29:51.000Z | preliminaries/filtering.py | Asichurter/APISeqFewShot | b4b7843da1f53cdc1d1711537c31305e7d5c6555 | [
"MIT"
] | null | null | null | preliminaries/filtering.py | Asichurter/APISeqFewShot | b4b7843da1f53cdc1d1711537c31305e7d5c6555 | [
"MIT"
] | null | null | null |
from sklearn.decomposition import PCA
import matplotlib.pyplot as plt
from sklearn.cluster import KMeans, AffinityPropagation
from utils.color import getRandomColor
from preliminaries.embedding import aggregateApiSequences, trainW2Vmodel
from preliminaries.preprocessing import mappingApiNormalize, \
apiStat, remo... | 82.456311 | 5,333 | 0.713176 |
from sklearn.decomposition import PCA
import matplotlib.pyplot as plt
from sklearn.cluster import KMeans, AffinityPropagation
from utils.color import getRandomColor
from preliminaries.embedding import aggregateApiSequences, trainW2Vmodel
from preliminaries.preprocessing import mappingApiNormalize, \
apiStat, remo... | true | true |
1c3c1f8189be70f87b6c864b7af1e8bb8ee5b5af | 6,205 | py | Python | sdk/python/pulumi_azure_native/operationalinsights/v20200801/linked_storage_account.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/operationalinsights/v20200801/linked_storage_account.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/operationalinsights/v20200801/linked_storage_account.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** 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, _tables
__a... | 47.730769 | 843 | 0.677518 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
__all__ = ['LinkedStorageAccount']
class LinkedStorageAccount(pulumi.CustomResource):
def __init__(__self__,
resource_name: str,
... | true | true |
1c3c208bc3115e328bdbaa03eb1d900c68f5300d | 5,072 | py | Python | contrib/codeanalysis/src/python/pants/contrib/codeanalysis/tasks/extract_java.py | AllClearID/pants | c4fdf00a3bdf9f26f876e85c46909d0729f7132c | [
"Apache-2.0"
] | 1 | 2018-12-10T21:31:02.000Z | 2018-12-10T21:31:02.000Z | contrib/codeanalysis/src/python/pants/contrib/codeanalysis/tasks/extract_java.py | AllClearID/pants | c4fdf00a3bdf9f26f876e85c46909d0729f7132c | [
"Apache-2.0"
] | 2 | 2016-10-13T21:37:42.000Z | 2018-07-20T20:14:33.000Z | contrib/codeanalysis/src/python/pants/contrib/codeanalysis/tasks/extract_java.py | AllClearID/pants | c4fdf00a3bdf9f26f876e85c46909d0729f7132c | [
"Apache-2.0"
] | 1 | 2018-03-08T22:21:44.000Z | 2018-03-08T22:21:44.000Z | # coding=utf-8
# Copyright 2017 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from pant... | 43.724138 | 100 | 0.680402 |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from pants.backend.jvm.subsystems.shader import Shader
from pants.backend.jvm.tasks.jvm_tool_task_mixin import JvmToolTaskMixin
from pants.base.exceptio... | true | true |
1c3c212e7a2dc8acb2f8c2353668660dbf5ad18d | 11,367 | py | Python | google/cloud/vision_v1p3beta1/types/text_annotation.py | dylancaponi/python-vision | f94fb5b03bf8932e75967249292d23fed2ae2213 | [
"Apache-2.0"
] | null | null | null | google/cloud/vision_v1p3beta1/types/text_annotation.py | dylancaponi/python-vision | f94fb5b03bf8932e75967249292d23fed2ae2213 | [
"Apache-2.0"
] | 1 | 2021-02-23T12:41:14.000Z | 2021-02-23T12:41:14.000Z | google/cloud/vision_v1p3beta1/types/text_annotation.py | dylancaponi/python-vision | f94fb5b03bf8932e75967249292d23fed2ae2213 | [
"Apache-2.0"
] | null | null | null | # -*- 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 o... | 35.411215 | 93 | 0.6218 |
import proto
from google.cloud.vision_v1p3beta1.types import geometry
__protobuf__ = proto.module(
package="google.cloud.vision.v1p3beta1",
manifest={"TextAnnotation", "Page", "Block", "Paragraph", "Word", "Symbol",},
)
class TextAnnotation(proto.Message):
class DetectedLanguage(pr... | true | true |
1c3c21d0c4a699da716e72bd35a8ee5be65f2683 | 1,015 | py | Python | hackathon/column0/problem_17_1_score_combinations.py | abdurahmanadilovic/elements-of-programming-interviews | 14d05935aa901f453ea2086e449b670e993a4c83 | [
"MIT"
] | null | null | null | hackathon/column0/problem_17_1_score_combinations.py | abdurahmanadilovic/elements-of-programming-interviews | 14d05935aa901f453ea2086e449b670e993a4c83 | [
"MIT"
] | null | null | null | hackathon/column0/problem_17_1_score_combinations.py | abdurahmanadilovic/elements-of-programming-interviews | 14d05935aa901f453ea2086e449b670e993a4c83 | [
"MIT"
] | null | null | null | def solution(score):
# solutions = {}
# solve(0, score, [], solutions)
# return len(solutions.keys())
return solve2(score)
def solve(current_score, target_score, path, solutions):
if current_score > target_score:
return 0
elif current_score == target_score:
path_sorted = str(so... | 30.757576 | 88 | 0.618719 | def solution(score):
return solve2(score)
def solve(current_score, target_score, path, solutions):
if current_score > target_score:
return 0
elif current_score == target_score:
path_sorted = str(sorted(path))
if path_sorted not in solutions:
solutions[pat... | true | true |
1c3c223ac0a6341c7f6c17c1b2f4f4166e4fb6d7 | 4,636 | py | Python | examples/motor-imagery/plot_single.py | gabelstein/parRiemann | 466c20570c797f588cbe58f2f93d32180ea1e533 | [
"BSD-3-Clause"
] | null | null | null | examples/motor-imagery/plot_single.py | gabelstein/parRiemann | 466c20570c797f588cbe58f2f93d32180ea1e533 | [
"BSD-3-Clause"
] | null | null | null | examples/motor-imagery/plot_single.py | gabelstein/parRiemann | 466c20570c797f588cbe58f2f93d32180ea1e533 | [
"BSD-3-Clause"
] | null | null | null | """
====================================================================
Motor imagery classification
====================================================================
Classify Motor imagery data with Riemannian Geometry.
"""
# generic import
import numpy as np
import pandas as pd
import seaborn as sns
from matplot... | 32.194444 | 79 | 0.648619 |
import numpy as np
import pandas as pd
import seaborn as sns
from matplotlib import pyplot as plt
from mne import Epochs, pick_types, events_from_annotations
from mne.io import concatenate_raws
from mne.io.edf import read_raw_edf
from mne.datasets import eegbci
from mne.decoding import CSP
from parriemann.classifi... | true | true |
1c3c22847d924bebf8aacb779617861b86eb5501 | 5,442 | py | Python | zhengma/source.py | smaji-org/cjkv_info_sample | 12440b938a58b2384a3c9d11c0897dd4101d6fe6 | [
"MIT"
] | null | null | null | zhengma/source.py | smaji-org/cjkv_info_sample | 12440b938a58b2384a3c9d11c0897dd4101d6fe6 | [
"MIT"
] | null | null | null | zhengma/source.py | smaji-org/cjkv_info_sample | 12440b938a58b2384a3c9d11c0897dd4101d6fe6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
# -*- coding:utf-8 -*-
info= {
"China": {
"G0": "GB 2312-80",
"G1": "GB 12345-90",
"G3": "GB 7589-87 traditional form",
"G5": "GB 7590-87 traditional form",
"G7": "Modern Chinese general character chart (Simplified Chinese: 现代汉语通用字表)",
"G8": "G... | 41.227273 | 170 | 0.571849 |
info= {
"China": {
"G0": "GB 2312-80",
"G1": "GB 12345-90",
"G3": "GB 7589-87 traditional form",
"G5": "GB 7590-87 traditional form",
"G7": "Modern Chinese general character chart (Simplified Chinese: 现代汉语通用字表)",
"G8": "GB8565-88",
"GCE": "National Academy ... | true | true |
1c3c23c2c041ff29f3353f05b8b75d5b32b84180 | 176 | py | Python | kub/services/archive/cdk/python/sample-app/app.py | randyzingle/tools | 8ef80f15665d2c3f58a419c79eec049ade7a4d40 | [
"Apache-2.0"
] | null | null | null | kub/services/archive/cdk/python/sample-app/app.py | randyzingle/tools | 8ef80f15665d2c3f58a419c79eec049ade7a4d40 | [
"Apache-2.0"
] | 1 | 2021-06-23T20:28:53.000Z | 2021-06-23T20:28:53.000Z | kub/services/archive/cdk/python/sample-app/app.py | randyzingle/tools | 8ef80f15665d2c3f58a419c79eec049ade7a4d40 | [
"Apache-2.0"
] | 2 | 2018-09-21T01:01:07.000Z | 2020-03-06T20:21:49.000Z | #!/usr/bin/env python3
from aws_cdk import core
from hello.hello_stack import MyStack
app = core.App()
MyStack(app, "baldur-cdk", env={'region': 'us-east-1'})
app.synth()
| 14.666667 | 55 | 0.698864 |
from aws_cdk import core
from hello.hello_stack import MyStack
app = core.App()
MyStack(app, "baldur-cdk", env={'region': 'us-east-1'})
app.synth()
| true | true |
1c3c24037502dd9466339d6e17744833d41471d2 | 2,517 | py | Python | lab/refactoring-pep8/docstrings_blank_lines.py | Andre-Williams22/SPD-2.31-Testing-and-Architecture | a28abb56c7b0c920144867f5aa138f70aae65260 | [
"MIT"
] | null | null | null | lab/refactoring-pep8/docstrings_blank_lines.py | Andre-Williams22/SPD-2.31-Testing-and-Architecture | a28abb56c7b0c920144867f5aa138f70aae65260 | [
"MIT"
] | null | null | null | lab/refactoring-pep8/docstrings_blank_lines.py | Andre-Williams22/SPD-2.31-Testing-and-Architecture | a28abb56c7b0c920144867f5aa138f70aae65260 | [
"MIT"
] | null | null | null | # by Kami Bigdely
# Docstrings and blank lines
class OnBoardTemperatureSensor:
'''Calculates Temperature Sensor'''
VOLTAGE_TO_TEMP_FACTOR = 5.6
def __init__(self):
''' Initializes variables '''
pass
def read_voltage(self):
''' Initializes variables '''
return 2.7
... | 34.958333 | 104 | 0.658323 |
class OnBoardTemperatureSensor:
VOLTAGE_TO_TEMP_FACTOR = 5.6
def __init__(self):
pass
def read_voltage(self):
return 2.7
def get_temperature(self):
return self.read_voltage() * OnBoardTemperatureSensor.VOLTAGE_TO_TEMP_FACTOR
class CarbonMonoxideSensor:
VOLTAGE_TO_CO_FAC... | true | true |
1c3c255519b39d2e52290b2a72f7aeb0882989ba | 2,277 | py | Python | backend/module_options_test_29674/urls.py | crowdbotics-apps/module-options-test-29674 | 914d0b52507564bcd382e973bd31c879f3059d79 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/module_options_test_29674/urls.py | crowdbotics-apps/module-options-test-29674 | 914d0b52507564bcd382e973bd31c879f3059d79 | [
"FTL",
"AML",
"RSA-MD"
] | 19 | 2021-08-15T17:17:39.000Z | 2021-12-12T17:09:48.000Z | backend/module_options_test_29674/urls.py | crowdbotics-apps/module-options-test-29674 | 914d0b52507564bcd382e973bd31c879f3059d79 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | """module_options_test_29674 URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='... | 36.142857 | 87 | 0.716293 |
from django.contrib import admin
from django.urls import path, include, re_path
from django.views.generic.base import TemplateView
from allauth.account.views import confirm_email
from rest_framework import permissions
from drf_yasg.views import get_schema_view
from drf_yasg import openapi
urlpatterns = [
path("",... | true | true |
1c3c258d6a6997ded70db7b88526e0f209e43b1c | 812 | py | Python | google-cloud-sdk/lib/surface/genomics/referencesets/__init__.py | bopopescu/searchparty | afdc2805cb1b77bd5ac9fdd1a76217f4841f0ea6 | [
"Apache-2.0"
] | 1 | 2017-11-29T18:52:27.000Z | 2017-11-29T18:52:27.000Z | google-cloud-sdk/lib/surface/genomics/referencesets/__init__.py | bopopescu/searchparty | afdc2805cb1b77bd5ac9fdd1a76217f4841f0ea6 | [
"Apache-2.0"
] | null | null | null | google-cloud-sdk/lib/surface/genomics/referencesets/__init__.py | bopopescu/searchparty | afdc2805cb1b77bd5ac9fdd1a76217f4841f0ea6 | [
"Apache-2.0"
] | 3 | 2017-07-27T18:44:13.000Z | 2020-07-25T17:48:53.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 ag... | 32.48 | 74 | 0.759852 |
from googlecloudsdk.calliope import base
class ReferenceSets(base.Group):
| true | true |
1c3c26a85503f2e2bc5ed297f4de94cbd014dbfe | 163 | py | Python | stravapy/resources/segment_efforts.py | JoshGuarino/stravapy | b7cb404137535f2ccda2fa03b9ba65fc6d4e289d | [
"MIT"
] | null | null | null | stravapy/resources/segment_efforts.py | JoshGuarino/stravapy | b7cb404137535f2ccda2fa03b9ba65fc6d4e289d | [
"MIT"
] | null | null | null | stravapy/resources/segment_efforts.py | JoshGuarino/stravapy | b7cb404137535f2ccda2fa03b9ba65fc6d4e289d | [
"MIT"
] | null | null | null | from request import Request
class SegmentEfforts(object):
def get_efforts_by_segment_id():
return
def get_segment_effort_by_id():
return | 18.111111 | 36 | 0.711656 | from request import Request
class SegmentEfforts(object):
def get_efforts_by_segment_id():
return
def get_segment_effort_by_id():
return | true | true |
1c3c26d50ae1aefb8f8a05348b29b560a04e3f0d | 2,253 | py | Python | tests/models/symbol/iscsi_negotiation_defaults_test.py | NetApp/santricity-webapi-pythonsdk | 1d3df4a00561192f4cdcdd1890f4d27547ed2de2 | [
"BSD-3-Clause-Clear"
] | 5 | 2016-08-23T17:52:22.000Z | 2019-05-16T08:45:30.000Z | tests/models/symbol/iscsi_negotiation_defaults_test.py | NetApp/santricity-webapi-pythonsdk | 1d3df4a00561192f4cdcdd1890f4d27547ed2de2 | [
"BSD-3-Clause-Clear"
] | 2 | 2016-11-10T05:30:21.000Z | 2019-04-05T15:03:37.000Z | tests/models/symbol/iscsi_negotiation_defaults_test.py | NetApp/santricity-webapi-pythonsdk | 1d3df4a00561192f4cdcdd1890f4d27547ed2de2 | [
"BSD-3-Clause-Clear"
] | 7 | 2016-08-25T16:11:44.000Z | 2021-02-22T05:31:25.000Z | #!/usr/bin/env python
# coding: utf-8
"""
The Clear BSD License
Copyright (c) – 2016, NetApp, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following conditions... | 59.289474 | 845 | 0.780737 |
import unittest
from netapp.santricity.models.symbol.iscsi_negotiation_defaults import IscsiNegotiationDefaults
class IscsiNegotiationDefaultsTest(unittest.TestCase):
def test_iscsi_negotiation_defaults(self):
iscsi_negotiation_defaults_obj = IscsiNegotiationDefaults()
... | true | true |
1c3c2736c10a8be6fba2336f8ba8f09bf734aabf | 7,051 | py | Python | ctfcli/__main__.py | mister-hai/sandboxy | 861fc4eb37bb37db10e0123150f587c997b146e3 | [
"MIT"
] | 3 | 2021-09-14T04:35:42.000Z | 2021-10-13T20:43:55.000Z | ctfcli/__main__.py | mister-hai/sandboxy | 861fc4eb37bb37db10e0123150f587c997b146e3 | [
"MIT"
] | null | null | null | ctfcli/__main__.py | mister-hai/sandboxy | 861fc4eb37bb37db10e0123150f587c997b146e3 | [
"MIT"
] | null | null | null | import os,sys,fire
sys.path.insert(0, os.path.abspath('.'))
#from ctfcli.utils.config import Config
from pathlib import Path
from ctfcli.utils.utils import errorlogger, yellowboldprint,greenprint,redprint
from ctfcli.utils.config import Config
from ctfcli.linkage import SandBoxyCTFdLinkage
from ctfcli.core.gitrepo impo... | 44.910828 | 111 | 0.621756 | import os,sys,fire
sys.path.insert(0, os.path.abspath('.'))
from pathlib import Path
from ctfcli.utils.utils import errorlogger, yellowboldprint,greenprint,redprint
from ctfcli.utils.config import Config
from ctfcli.linkage import SandBoxyCTFdLinkage
from ctfcli.core.gitrepo import SandboxyGitRepository
| true | true |
1c3c27aa684ac4e9f43471853a9978214cef8589 | 5,259 | py | Python | examples/ssd_mobilenet2/train.py | dodler/torchcv | 10fd69bbb9180e399d93ee5c70abd5072401ea84 | [
"MIT"
] | null | null | null | examples/ssd_mobilenet2/train.py | dodler/torchcv | 10fd69bbb9180e399d93ee5c70abd5072401ea84 | [
"MIT"
] | null | null | null | examples/ssd_mobilenet2/train.py | dodler/torchcv | 10fd69bbb9180e399d93ee5c70abd5072401ea84 | [
"MIT"
] | null | null | null | from __future__ import print_function
import argparse
import os
import random
import torch
import torch.backends.cudnn as cudnn
import torch.optim as optim
import torchvision.transforms as transforms
from torchcv.datasets import ListDataset
from torchcv.loss import SSDLoss
from torchcv.models.mobilenetv2.net import ... | 34.598684 | 122 | 0.678076 | from __future__ import print_function
import argparse
import os
import random
import torch
import torch.backends.cudnn as cudnn
import torch.optim as optim
import torchvision.transforms as transforms
from torchcv.datasets import ListDataset
from torchcv.loss import SSDLoss
from torchcv.models.mobilenetv2.net import ... | true | true |
1c3c27fead46191315579857bb2922c827022fc8 | 661 | py | Python | webshots/popular-webshots.py | acamero/evo-web | 5229ff89e2ac2d3f6a3a7f80d3f514fd3ed728c9 | [
"MIT"
] | null | null | null | webshots/popular-webshots.py | acamero/evo-web | 5229ff89e2ac2d3f6a3a7f80d3f514fd3ed728c9 | [
"MIT"
] | null | null | null | webshots/popular-webshots.py | acamero/evo-web | 5229ff89e2ac2d3f6a3a7f80d3f514fd3ed728c9 | [
"MIT"
] | null | null | null | import os
csv_file_name = "../webshot_data/popular-web-sites.csv"
with open(csv_file_name) as f:
lines = f.readlines()
for line in lines:
path = line.split(',')[1]
path = path.replace('\n','')
if not path.startswith('http') and not path.startswith('www.'):
path = 'www.' + p... | 27.541667 | 109 | 0.555219 | import os
csv_file_name = "../webshot_data/popular-web-sites.csv"
with open(csv_file_name) as f:
lines = f.readlines()
for line in lines:
path = line.split(',')[1]
path = path.replace('\n','')
if not path.startswith('http') and not path.startswith('www.'):
path = 'www.' + p... | false | true |
1c3c286951a9a0c7728cd4978c2d0791a490927a | 1,402 | py | Python | examples/applications/clustering/kmeans.py | shelleyyyyu/sentence-transformers | f004fba1dc23bbbe3caebd044748cbea3b2257e2 | [
"Apache-2.0"
] | 1 | 2021-09-20T14:12:36.000Z | 2021-09-20T14:12:36.000Z | examples/applications/clustering/kmeans.py | shelleyyyyu/sentence-transformers | f004fba1dc23bbbe3caebd044748cbea3b2257e2 | [
"Apache-2.0"
] | null | null | null | examples/applications/clustering/kmeans.py | shelleyyyyu/sentence-transformers | f004fba1dc23bbbe3caebd044748cbea3b2257e2 | [
"Apache-2.0"
] | null | null | null | """
This is a simple application for sentence embeddings: clustering
Sentences are mapped to sentence embeddings and then k-mean clustering is applied.
"""
from sentence_transformers import SentenceTransformer
from sklearn.cluster import KMeans
embedder = SentenceTransformer('distilroberta-base-paraphrase-v1')
# Cor... | 35.05 | 82 | 0.710414 | from sentence_transformers import SentenceTransformer
from sklearn.cluster import KMeans
embedder = SentenceTransformer('distilroberta-base-paraphrase-v1')
corpus = ['A man is eating food.',
'A man is eating a piece of bread.',
'A man is eating pasta.',
'The girl is carrying a baby.',
... | true | true |
1c3c294e57e6f958d38ee04d5b0c84c2fe60f121 | 835 | py | Python | tests/conftest.py | Leoberti/thesaurus | 07de6d9d29e71a565c84cc49a248d4e3ca8f4426 | [
"Unlicense"
] | null | null | null | tests/conftest.py | Leoberti/thesaurus | 07de6d9d29e71a565c84cc49a248d4e3ca8f4426 | [
"Unlicense"
] | null | null | null | tests/conftest.py | Leoberti/thesaurus | 07de6d9d29e71a565c84cc49a248d4e3ca8f4426 | [
"Unlicense"
] | null | null | null | import sys
import pytest
from thesaurus import create_app
from thesaurus.ext.commands import populate_db
from thesaurus.ext.database import db
@pytest.fixture(scope="session")
def app():
app = create_app(FORCE_ENV_FOR_DYNACONF="testing")
with app.app_context():
db.create_all(app=app)
yield ap... | 24.558824 | 56 | 0.707784 | import sys
import pytest
from thesaurus import create_app
from thesaurus.ext.commands import populate_db
from thesaurus.ext.database import db
@pytest.fixture(scope="session")
def app():
app = create_app(FORCE_ENV_FOR_DYNACONF="testing")
with app.app_context():
db.create_all(app=app)
yield ap... | true | true |
1c3c295dc7c39ccb0c3a4384a5235d3a11b23c3d | 7,554 | py | Python | config/settings/production.py | skaaldig/borrowing | 70a19a1f3db3719247e42814176ed6b69afe081c | [
"MIT"
] | null | null | null | config/settings/production.py | skaaldig/borrowing | 70a19a1f3db3719247e42814176ed6b69afe081c | [
"MIT"
] | null | null | null | config/settings/production.py | skaaldig/borrowing | 70a19a1f3db3719247e42814176ed6b69afe081c | [
"MIT"
] | null | null | null | from .base import * # noqa
from .base import env
# GENERAL
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
SECRET_KEY = env("DJANGO_SECRET_KEY")
# https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts
ALLOWED... | 40.832432 | 89 | 0.601006 | from .base import *
from .base import env
= env("DJANGO_SECRET_KEY")
= env.list("DJANGO_ALLOWED_HOSTS", default=["example.com"])
DATABASES["default"] = env.db("DATABASE_URL")
DATABASES["default"]["ATOMIC_REQUESTS"] = True
DATABASES["default"]["CONN_MAX_AGE"] = env.int("CONN_MAX_AGE", default=60)
CACH... | true | true |
1c3c2a3cd8795d8dc828dbd50e17d361211a931d | 2,757 | py | Python | core/actionProxy/owplatform/__init__.py | IISAS/openwhisk-runtime-docker | a23dcfd4276399b5aa90a55520345307632dfbb4 | [
"Apache-2.0"
] | 11 | 2017-10-18T19:16:43.000Z | 2019-05-20T21:54:32.000Z | core/actionProxy/owplatform/__init__.py | IISAS/openwhisk-runtime-docker | a23dcfd4276399b5aa90a55520345307632dfbb4 | [
"Apache-2.0"
] | 30 | 2018-01-24T17:30:14.000Z | 2019-05-06T13:58:17.000Z | core/actionProxy/owplatform/__init__.py | IISAS/openwhisk-runtime-docker | a23dcfd4276399b5aa90a55520345307632dfbb4 | [
"Apache-2.0"
] | 26 | 2017-10-06T13:23:28.000Z | 2019-07-08T00:47:45.000Z | #
# 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 us... | 31.329545 | 108 | 0.704389 |
class PlatformFactory:
_SUPPORTED_PLATFORMS = set()
_PLATFORM_IMPLEMENTATIONS = {}
def __init__(self):
pass
@classmethod
def supportedPlatforms(cls):
return cls._SUPPORTED_PLATFORMS
@classmethod
def isSupportedPlatform(cls, id):
return id.lower() ... | true | true |
1c3c2aad137d4fbf23ed920a2adf9041a0b2b0ef | 571 | py | Python | stockquant/util/stringhelper.py | dabuc/StockQuant | d9de6409b421aa2bf859cb93d46f4344cdb47bc1 | [
"MIT"
] | null | null | null | stockquant/util/stringhelper.py | dabuc/StockQuant | d9de6409b421aa2bf859cb93d46f4344cdb47bc1 | [
"MIT"
] | null | null | null | stockquant/util/stringhelper.py | dabuc/StockQuant | d9de6409b421aa2bf859cb93d46f4344cdb47bc1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from enum import Enum, unique
@unique
class TaskEnum(Enum):
"""
任务枚举
"""
季频盈利能力 = "profit"
BS日线历史A股K线后复权数据 = "bs_daily_hfq"
BS周线历史A股K线后复权数据 = "bs_weekly_hfq"
BS日线历史A股K线数据 = "bs_daily"
BS计算指定日期往后N日涨跌幅 = "bs_calc_later_n_pctChg"
BS60分钟K线后复权数据 = "BS_m60_hfq"
... | 20.392857 | 46 | 0.625219 |
from enum import Enum, unique
@unique
class TaskEnum(Enum):
季频盈利能力 = "profit"
BS日线历史A股K线后复权数据 = "bs_daily_hfq"
BS周线历史A股K线后复权数据 = "bs_weekly_hfq"
BS日线历史A股K线数据 = "bs_daily"
BS计算指定日期往后N日涨跌幅 = "bs_calc_later_n_pctChg"
BS60分钟K线后复权数据 = "BS_m60_hfq"
TS更新每日指标 = "ts_daily_basic"
TS日线行情 = "t... | true | true |
1c3c2b0ef02ab6428b5ad87044165abfa69acf04 | 1,041 | py | Python | nas_big_data/attn/problem_ae.py | deephyper/NASBigData | 18f083a402b80b1d006eada00db7287ff1802592 | [
"BSD-2-Clause"
] | 3 | 2020-08-07T12:05:12.000Z | 2021-04-05T19:38:37.000Z | nas_big_data/attn/problem_ae.py | deephyper/NASBigData | 18f083a402b80b1d006eada00db7287ff1802592 | [
"BSD-2-Clause"
] | 2 | 2020-07-17T14:44:12.000Z | 2021-04-04T14:52:11.000Z | nas_big_data/attn/problem_ae.py | deephyper/NASBigData | 18f083a402b80b1d006eada00db7287ff1802592 | [
"BSD-2-Clause"
] | 1 | 2021-03-28T01:49:21.000Z | 2021-03-28T01:49:21.000Z | from deephyper.problem import NaProblem
from nas_big_data.attn.search_space import create_search_space
from nas_big_data.attn.load_data import load_data_cache
Problem = NaProblem(seed=2019)
Problem.load_data(load_data_cache)
Problem.search_space(create_search_space, num_layers=5)
Problem.hyperparameters(
lsr_ba... | 26.692308 | 99 | 0.728146 | from deephyper.problem import NaProblem
from nas_big_data.attn.search_space import create_search_space
from nas_big_data.attn.load_data import load_data_cache
Problem = NaProblem(seed=2019)
Problem.load_data(load_data_cache)
Problem.search_space(create_search_space, num_layers=5)
Problem.hyperparameters(
lsr_ba... | true | true |
1c3c2bbf993e5d9a61acc51620c1b3d80a4ee045 | 3,213 | py | Python | piat/servers/trap_server.py | Ali-aqrabawi/piat | 3f6744490e846a3a5db32affad9f89439bf5b7f2 | [
"MIT"
] | 7 | 2019-04-29T08:30:13.000Z | 2022-01-07T01:50:01.000Z | piat/servers/trap_server.py | Ali-aqrabawi/piat | 3f6744490e846a3a5db32affad9f89439bf5b7f2 | [
"MIT"
] | 3 | 2019-05-03T18:17:59.000Z | 2019-05-10T15:55:32.000Z | piat/servers/trap_server.py | Ali-aqrabawi/piat | 3f6744490e846a3a5db32affad9f89439bf5b7f2 | [
"MIT"
] | 2 | 2019-04-28T20:24:29.000Z | 2019-12-19T23:57:14.000Z | import os
from pysnmp.entity import engine, config
from pysnmp.carrier.asyncore.dgram import udp
from pysnmp.smi import view, builder
from pysnmp.entity.rfc3413 import ntfrcv
from piat.utils.threads import ThreadsManager
from piat.utils.decorators import restart_on_failure
from piat.parsers.traps.trap import TrapMsg
fr... | 35.7 | 115 | 0.646748 | import os
from pysnmp.entity import engine, config
from pysnmp.carrier.asyncore.dgram import udp
from pysnmp.smi import view, builder
from pysnmp.entity.rfc3413 import ntfrcv
from piat.utils.threads import ThreadsManager
from piat.utils.decorators import restart_on_failure
from piat.parsers.traps.trap import TrapMsg
fr... | true | true |
1c3c2e9931e330b8af72364c8f069c6dee7b3a6a | 61 | py | Python | ex047.py | mateusloped/curso-python | 1b5b3927141e985911c9b2344b3d4d663a90c29c | [
"MIT"
] | null | null | null | ex047.py | mateusloped/curso-python | 1b5b3927141e985911c9b2344b3d4d663a90c29c | [
"MIT"
] | null | null | null | ex047.py | mateusloped/curso-python | 1b5b3927141e985911c9b2344b3d4d663a90c29c | [
"MIT"
] | null | null | null | for c in range(2, 51, 2):
print(c, end=' ')
print('FIM') | 20.333333 | 25 | 0.52459 | for c in range(2, 51, 2):
print(c, end=' ')
print('FIM') | true | true |
1c3c2ebbf2a88dc388bb0314813d8b32b385e4b0 | 3,133 | py | Python | rqalpha/data/instrument_mixin.py | mysky528/rqalpha | ecd550fc30aee96f9995e8152e2c48f5512f8b11 | [
"Apache-2.0"
] | 3 | 2017-07-11T15:37:24.000Z | 2021-11-22T14:21:13.000Z | rqalpha/data/instrument_mixin.py | mysky528/rqalpha | ecd550fc30aee96f9995e8152e2c48f5512f8b11 | [
"Apache-2.0"
] | null | null | null | rqalpha/data/instrument_mixin.py | mysky528/rqalpha | ecd550fc30aee96f9995e8152e2c48f5512f8b11 | [
"Apache-2.0"
] | 2 | 2019-04-26T07:51:08.000Z | 2020-12-01T20:59:04.000Z | # -*- coding: utf-8 -*-
#
# Copyright 2017 Ricequant, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 40.166667 | 100 | 0.620172 |
import six
class InstrumentMixin(object):
def __init__(self, instruments):
self._instruments = {i.order_book_id: i for i in instruments}
self._sym_id_map = {i.symbol: k for k, i in six.iteritems(self._instruments)
if not i.or... | true | true |
1c3c30b8afcf0d6188c24b6749e59cf45ef9a702 | 170 | py | Python | problem/01000~09999/04344/4344.py3.py | njw1204/BOJ-AC | 1de41685725ae4657a7ff94e413febd97a888567 | [
"MIT"
] | 1 | 2019-04-19T16:37:44.000Z | 2019-04-19T16:37:44.000Z | problem/01000~09999/04344/4344.py3.py | njw1204/BOJ-AC | 1de41685725ae4657a7ff94e413febd97a888567 | [
"MIT"
] | 1 | 2019-04-20T11:42:44.000Z | 2019-04-20T11:42:44.000Z | problem/01000~09999/04344/4344.py3.py | njw1204/BOJ-AC | 1de41685725ae4657a7ff94e413febd97a888567 | [
"MIT"
] | 3 | 2019-04-19T16:37:47.000Z | 2021-10-25T00:45:00.000Z | for i in range(int(input())):
x=[*map(int,input().split())]
a=sum(x[1:])
p=a/x[0]
c=0
for i in range(1,len(x)):
if x[i]>p: c+=1
print('%.3f%%'%(c/(len(x)-1)*100)) | 21.25 | 35 | 0.511765 | for i in range(int(input())):
x=[*map(int,input().split())]
a=sum(x[1:])
p=a/x[0]
c=0
for i in range(1,len(x)):
if x[i]>p: c+=1
print('%.3f%%'%(c/(len(x)-1)*100)) | true | true |
1c3c30eaabdca35f894764b12da5eeff5b76e3e6 | 724 | py | Python | lab9.py | morganqr/ia241-github-1 | 212d0d67c5c6b8b46997bad370b17c2fe7584320 | [
"MIT"
] | null | null | null | lab9.py | morganqr/ia241-github-1 | 212d0d67c5c6b8b46997bad370b17c2fe7584320 | [
"MIT"
] | null | null | null | lab9.py | morganqr/ia241-github-1 | 212d0d67c5c6b8b46997bad370b17c2fe7584320 | [
"MIT"
] | null | null | null | '''
lab 9
'''
#3.1
class my_stat():
def cal_sigma(self,m,n):
result = 0
for i in range (n, m+1):
result = result +i
return result
def cal_pi(self,m,n):
result = 1
for i in range (n,m+1):
... | 15.083333 | 44 | 0.44337 |
class my_stat():
def cal_sigma(self,m,n):
result = 0
for i in range (n, m+1):
result = result +i
return result
def cal_pi(self,m,n):
result = 1
for i in range (n,m+1):
result = result*i
... | true | true |
1c3c3220f3e1c306f67c1041d89c521be650fc0e | 5,715 | py | Python | autovectorization-tests/scripts/procedures.py | clayne/toys | ec06411e2d3b920403607888d4a573e41390ee5b | [
"BSD-2-Clause"
] | null | null | null | autovectorization-tests/scripts/procedures.py | clayne/toys | ec06411e2d3b920403607888d4a573e41390ee5b | [
"BSD-2-Clause"
] | null | null | null | autovectorization-tests/scripts/procedures.py | clayne/toys | ec06411e2d3b920403607888d4a573e41390ee5b | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python3
import sys
PROCEDURES = {
'accumulate_default.cpp' : {
'title' : "accumulate --- default",
'link' : 'https://en.cppreference.com/w/cpp/algorithm/accumulate',
'procedures' : ["accumulate_epi8", "accumulate_epi32"],
},
'accumula... | 35.943396 | 92 | 0.472616 |
import sys
PROCEDURES = {
'accumulate_default.cpp' : {
'title' : "accumulate --- default",
'link' : 'https://en.cppreference.com/w/cpp/algorithm/accumulate',
'procedures' : ["accumulate_epi8", "accumulate_epi32"],
},
'accumulate_custom.cpp' : {
... | true | true |
1c3c322ab4a9cfca0ce7257199597e574f2a659c | 1,005 | py | Python | geotrek/api/mobile/urls.py | mviadere-openig/Geotrek-admin | 7f2343db50e97bb407e66dc499ab3684e1629661 | [
"BSD-2-Clause"
] | null | null | null | geotrek/api/mobile/urls.py | mviadere-openig/Geotrek-admin | 7f2343db50e97bb407e66dc499ab3684e1629661 | [
"BSD-2-Clause"
] | null | null | null | geotrek/api/mobile/urls.py | mviadere-openig/Geotrek-admin | 7f2343db50e97bb407e66dc499ab3684e1629661 | [
"BSD-2-Clause"
] | null | null | null | from django.conf import settings
from django.conf.urls import url, include
from rest_framework import routers
from geotrek.api.mobile import views as api_mobile
from geotrek.api.mobile.views_sync import SyncMobileRedirect, sync_mobile_view, sync_mobile_update_json
router = routers.DefaultRouter()
if 'geotrek.flatpage... | 47.857143 | 103 | 0.768159 | from django.conf import settings
from django.conf.urls import url, include
from rest_framework import routers
from geotrek.api.mobile import views as api_mobile
from geotrek.api.mobile.views_sync import SyncMobileRedirect, sync_mobile_view, sync_mobile_update_json
router = routers.DefaultRouter()
if 'geotrek.flatpage... | true | true |
1c3c32560d8042e900c70a08e3613c7017b3a716 | 17,106 | py | Python | Tests/test_PDB_MMCIF2Dict.py | chrisbarnettster/biopython | 778a8b113b8b9213eabf3a64bdaab3ecb7d57b7b | [
"BSD-3-Clause"
] | 1 | 2021-10-17T12:42:22.000Z | 2021-10-17T12:42:22.000Z | Tests/test_PDB_MMCIF2Dict.py | chrisbarnettster/biopython | 778a8b113b8b9213eabf3a64bdaab3ecb7d57b7b | [
"BSD-3-Clause"
] | null | null | null | Tests/test_PDB_MMCIF2Dict.py | chrisbarnettster/biopython | 778a8b113b8b9213eabf3a64bdaab3ecb7d57b7b | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2017 by Francesco Gastaldello. All rights reserved.
# Revisions copyright 2017 by Peter Cock. All rights reserved.
#
# Converted by Francesco Gastaldello from an older unit test copyright 2002
# by Thomas Hamelryck.
#
# This file is part of the Biopython distribution and governed by your
# choice of the "B... | 50.910714 | 88 | 0.483281 |
import unittest
try:
import numpy
except ImportError:
from Bio import MissingPythonDependencyError
raise MissingPythonDependencyError(
"Install NumPy if you want to use Bio.PDB."
) from None
from Bio.PDB.MMCIF2Dict import MMCIF2Dict
import io
import textwrap
class MMCIF2dictTest... | true | true |
1c3c3280d2c2fbb3f01689606a67c08fd10c80e0 | 1,058 | py | Python | scripts/testInputs/complex.test.py | MalcomnM/Fox | f41e59305c1fb4c008f5e0d712e291525c2b39f2 | [
"Apache-2.0"
] | 3 | 2020-03-03T16:56:43.000Z | 2022-01-03T14:34:16.000Z | scripts/testInputs/complex.test.py | MalcomnM/Fox | f41e59305c1fb4c008f5e0d712e291525c2b39f2 | [
"Apache-2.0"
] | 5 | 2019-10-26T18:01:38.000Z | 2022-02-26T19:26:43.000Z | scripts/testInputs/complex.test.py | MalcomnM/Fox | f41e59305c1fb4c008f5e0d712e291525c2b39f2 | [
"Apache-2.0"
] | null | null | null | # # Nested data
inputs = [
[6.4, 2.8, 5.6, 2.2, 2], # ?
[5.0, 2.3, 3.3, 1.0, 1],
[4.9, 2.5, 4.5, 1.7, 2],
]
# Comprehensions
features = [x[0:-1] for x in inputs] # ?
labels = [x[-1] for x in inputs] # ?
# macros
hat = labels # ?
# print
print(features)
print(labels)
# side effects
b = [*range(1, 4)]... | 11.5 | 54 | 0.514178 | [6.4, 2.8, 5.6, 2.2, 2],
[5.0, 2.3, 3.3, 1.0, 1],
[4.9, 2.5, 4.5, 1.7, 2],
]
features = [x[0:-1] for x in inputs]
labels = [x[-1] for x in inputs]
hat = labels
print(features)
print(labels)
b = [*range(1, 4)]
print('before', b)
b.pop()
print('after', b)
b
b
def add2(a):
rv = a ... | true | true |
1c3c3327e6e14b41083d7661c8b8d877a5576e07 | 2,280 | py | Python | modifier/bootstrap.py | lenoch/tagsetbench | 98c5474197af3087a28f73b54398abec0534c7d8 | [
"MIT"
] | null | null | null | modifier/bootstrap.py | lenoch/tagsetbench | 98c5474197af3087a28f73b54398abec0534c7d8 | [
"MIT"
] | null | null | null | modifier/bootstrap.py | lenoch/tagsetbench | 98c5474197af3087a28f73b54398abec0534c7d8 | [
"MIT"
] | null | null | null | from . import Modifier
# TODO: asi by to už v pohodě šlo s obecným modifikátorem, protože konečně umím
# předávat dodatečný parametry – takže prostě "implicit/silent" a hotovo
class punctuation(Modifier):
"""
Explicit, fine-grained, “late-bound” bootstrap.
"""
def __init__(self, modifier):
... | 34.545455 | 79 | 0.52807 | from . import Modifier
class punctuation(Modifier):
def __init__(self, modifier):
modifier.params['match'] = {
'k': '\?',
'word': """[-,.():?"!;\'/]|...""",
}
super().__init__(modifier)
self.explicit = modifier.params.get('explicit', 'no').lower() in (
... | true | true |
1c3c334407e5c7b5aa6d71dce501df751deb4831 | 1,643 | py | Python | oslo-modules/oslo_messaging/_drivers/zmq_driver/zmq_names.py | esse-io/zen-common | 8ede82ab81bad53c3b947084b812c44e329f159b | [
"Apache-2.0"
] | null | null | null | oslo-modules/oslo_messaging/_drivers/zmq_driver/zmq_names.py | esse-io/zen-common | 8ede82ab81bad53c3b947084b812c44e329f159b | [
"Apache-2.0"
] | null | null | null | oslo-modules/oslo_messaging/_drivers/zmq_driver/zmq_names.py | esse-io/zen-common | 8ede82ab81bad53c3b947084b812c44e329f159b | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 30.425926 | 78 | 0.657334 |
from oslo_messaging._drivers.zmq_driver import zmq_async
zmq = zmq_async.import_zmq()
ZMQ_SOCKET_STR = {zmq.DEALER: "DEALER",
zmq.ROUTER: "ROUTER",
zmq.PUSH: "PUSH",
zmq.PULL: "PULL",
zmq.REQ: "REQ",
zmq.REP: "REP... | true | true |
1c3c3423cef8d7348d670b9e463926eb2563df13 | 87 | py | Python | tests/test_comeon.py | zen-xu/comeon | 263eaa1595d29a4cf25708aaf38080f92bc5a454 | [
"MIT"
] | null | null | null | tests/test_comeon.py | zen-xu/comeon | 263eaa1595d29a4cf25708aaf38080f92bc5a454 | [
"MIT"
] | null | null | null | tests/test_comeon.py | zen-xu/comeon | 263eaa1595d29a4cf25708aaf38080f92bc5a454 | [
"MIT"
] | null | null | null | from comeon import __version__
def test_version():
assert __version__ == "0.1.0"
| 14.5 | 33 | 0.712644 | from comeon import __version__
def test_version():
assert __version__ == "0.1.0"
| true | true |
1c3c348f4c6ea52b8a0bbfa6f38d089bee3ef57c | 7,949 | py | Python | task_set/optimizers/adam8p.py | deepneuralmachine/google-research | d2ce2cf0f5c004f8d78bfeddf6e88e88f4840231 | [
"Apache-2.0"
] | 23,901 | 2018-10-04T19:48:53.000Z | 2022-03-31T21:27:42.000Z | task_set/optimizers/adam8p.py | deepneuralmachine/google-research | d2ce2cf0f5c004f8d78bfeddf6e88e88f4840231 | [
"Apache-2.0"
] | 891 | 2018-11-10T06:16:13.000Z | 2022-03-31T10:42:34.000Z | task_set/optimizers/adam8p.py | deepneuralmachine/google-research | d2ce2cf0f5c004f8d78bfeddf6e88e88f4840231 | [
"Apache-2.0"
] | 6,047 | 2018-10-12T06:31:02.000Z | 2022-03-31T13:59:28.000Z | # coding=utf-8
# Copyright 2021 The Google Research 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 applicab... | 32.313008 | 79 | 0.670273 |
import re
from typing import Text, List, Dict, Any
import numpy as np
from task_set import registry
from task_set.optimizers import base
from task_set.optimizers import utils
import tensorflow.compat.v1 as tf
class Adam8POptimizer(base.BaseOptimizer):
def __init__(
self,
learning_rate... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.