hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 125 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
18253ccc9eb3c1fe714bc7c37f0316da52829721 | 490 | py | Python | awesomeDP/users/migrations/0004_auto_20210305_2132.py | bentaro/AwesomeDatePlanBackend | d6403e885e190c4e37eeaadca3264f9a79add6f0 | [
"Unlicense"
] | null | null | null | awesomeDP/users/migrations/0004_auto_20210305_2132.py | bentaro/AwesomeDatePlanBackend | d6403e885e190c4e37eeaadca3264f9a79add6f0 | [
"Unlicense"
] | null | null | null | awesomeDP/users/migrations/0004_auto_20210305_2132.py | bentaro/AwesomeDatePlanBackend | d6403e885e190c4e37eeaadca3264f9a79add6f0 | [
"Unlicense"
] | null | null | null | # Generated by Django 3.1.7 on 2021-03-05 21:32
from django.db import migrations, models
import uuid
| 24.5 | 145 | 0.642857 | # Generated by Django 3.1.7 on 2021-03-05 21:32
from django.db import migrations, models
import uuid
class Migration(migrations.Migration):
dependencies = [
('users', '0003_auto_20210305_2112'),
]
operations = [
migrations.AlterField(
model_name='user',
name='use... | 0 | 364 | 23 |
983e206989a9e380886c61631f06373eac9cc4ab | 6,746 | py | Python | test/interactioncomponent_test.py | jtoD5T/TinCanPython | e98b5087cb7f3a29c6a00392b327cd6241c4a354 | [
"Apache-2.0"
] | null | null | null | test/interactioncomponent_test.py | jtoD5T/TinCanPython | e98b5087cb7f3a29c6a00392b327cd6241c4a354 | [
"Apache-2.0"
] | null | null | null | test/interactioncomponent_test.py | jtoD5T/TinCanPython | e98b5087cb7f3a29c6a00392b327cd6241c4a354 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Rustici Software
#
# 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... | 39.91716 | 117 | 0.679217 | # Copyright 2014 Rustici Software
#
# 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... | 4,849 | 0 | 755 |
b0f614e2997bee7dcf3790450953577eb3e4d91c | 684 | py | Python | src/LinkedListVector.py | Dorijan-Cirkveni/AutoSolvingMatrix | 3732d0215c22b9eae450c69ba84e75aecb337b0c | [
"MIT"
] | null | null | null | src/LinkedListVector.py | Dorijan-Cirkveni/AutoSolvingMatrix | 3732d0215c22b9eae450c69ba84e75aecb337b0c | [
"MIT"
] | null | null | null | src/LinkedListVector.py | Dorijan-Cirkveni/AutoSolvingMatrix | 3732d0215c22b9eae450c69ba84e75aecb337b0c | [
"MIT"
] | null | null | null | from llist import dllist, dllistnode
from src.VectorAbstract import VectorAbstract
| 25.333333 | 52 | 0.586257 | from llist import dllist, dllistnode
from src.VectorAbstract import VectorAbstract
class LinkedListVector(VectorAbstract):
def __init__(self, content: list[(int, float)]):
self.content: dllist = dllist()
for e in content:
self.content.appendright(e)
return
def SolveWith(s... | 478 | 18 | 103 |
9806aa7a03b3d86a13db9978d266063553adc77a | 1,151 | py | Python | resources/tester.py | Pandinosaurus/mix-and-match | 8d4c9df80ef281b4112bf27d8901700dcedc798f | [
"MIT"
] | 67 | 2017-12-05T05:44:02.000Z | 2021-11-08T10:39:42.000Z | resources/tester.py | wuyx/Mix-and-Match-Tuning-for-Self-Supervised-Semantic-Segmentation. | d3161abca95a6e93f085c1ac6fa1e991da3df15d | [
"MIT"
] | 3 | 2018-01-03T07:31:24.000Z | 2019-08-07T02:45:30.000Z | resources/tester.py | wuyx/Mix-and-Match-Tuning-for-Self-Supervised-Semantic-Segmentation. | d3161abca95a6e93f085c1ac6fa1e991da3df15d | [
"MIT"
] | 25 | 2017-12-11T04:23:40.000Z | 2021-12-21T01:49:11.000Z | import caffe
| 31.108108 | 112 | 0.514335 | import caffe
class Tester(caffe.Net):
def __init__(self, net, weights, gpu=-1):
if gpu != -1:
caffe.set_mode_gpu()
caffe.set_device(gpu)
else:
caffe.set_mode_cpu()
caffe.Net.__init__(self, net, weights, caffe.TEST)
def predict(self, inputs, p... | 215 | 900 | 23 |
624b21844f83da8c355f907105e32fb400816f1f | 800 | py | Python | nltk example/word_net.py | shivendra2102/PythonProgram | e720b8686b00679d757550378a4e4f1160cf5405 | [
"MIT"
] | null | null | null | nltk example/word_net.py | shivendra2102/PythonProgram | e720b8686b00679d757550378a4e4f1160cf5405 | [
"MIT"
] | null | null | null | nltk example/word_net.py | shivendra2102/PythonProgram | e720b8686b00679d757550378a4e4f1160cf5405 | [
"MIT"
] | null | null | null | from nltk.corpus import wordnet
syns = wordnet.synsets("program")
#synsets
print(syns)
print(syns[0].lemmas()[0].name())
#definition
print(syns[0].definition())
#examples
print(syns[0].examples())
synonyms = []
antonyms = []
for syn in wordnet.synsets("good"):
for l in syn.lemmas():
#p... | 21.621622 | 58 | 0.6225 | from nltk.corpus import wordnet
syns = wordnet.synsets("program")
#synsets
print(syns)
print(syns[0].lemmas()[0].name())
#definition
print(syns[0].definition())
#examples
print(syns[0].examples())
synonyms = []
antonyms = []
for syn in wordnet.synsets("good"):
for l in syn.lemmas():
#p... | 0 | 0 | 0 |
d7674674e637252e8785b8940a237a1a18e0926b | 19,487 | py | Python | launchpad_py/charset.py | kalebolson/launchpad.py | 960bda4463e386d6fbc041d7a1eed132dab29722 | [
"CC-BY-4.0"
] | 301 | 2015-01-17T23:30:43.000Z | 2022-03-30T15:24:34.000Z | launchpad_py/charset.py | kalebolson/launchpad.py | 960bda4463e386d6fbc041d7a1eed132dab29722 | [
"CC-BY-4.0"
] | 75 | 2015-02-12T23:40:09.000Z | 2022-02-26T19:52:47.000Z | launchpad_py/charset.py | kalebolson/launchpad.py | 960bda4463e386d6fbc041d7a1eed132dab29722 | [
"CC-BY-4.0"
] | 74 | 2015-05-06T03:40:02.000Z | 2022-02-15T14:00:48.000Z |
#
# a simple 8x8 font for the Launchpad
#
CHARTAB = [ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, # Char 000 (.)
0x7E, 0x81, 0xA5, 0x81, 0xBD, 0x99, 0x81, 0x7E, # Char 001 (.)
0x7E, 0xFF, 0xDB, 0xFF, 0xC3, 0xE7, 0xFF, 0x7E, # Char 002 (.)
0x6C, 0xFE, 0xFE, 0xFE, 0x7C, 0x38, ... | 74.377863 | 75 | 0.517063 |
#
# a simple 8x8 font for the Launchpad
#
CHARTAB = [ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, # Char 000 (.)
0x7E, 0x81, 0xA5, 0x81, 0xBD, 0x99, 0x81, 0x7E, # Char 001 (.)
0x7E, 0xFF, 0xDB, 0xFF, 0xC3, 0xE7, 0xFF, 0x7E, # Char 002 (.)
0x6C, 0xFE, 0xFE, 0xFE, 0x7C, 0x38, ... | 0 | 0 | 0 |
193febce87cef7e617a7beae8002537108036a03 | 9,267 | py | Python | src/snovault/viewconfigs/searchview.py | lrowe/snovault | acfcac9b62a4d6b2ebb4a2343acadc36b449f0db | [
"MIT"
] | null | null | null | src/snovault/viewconfigs/searchview.py | lrowe/snovault | acfcac9b62a4d6b2ebb4a2343acadc36b449f0db | [
"MIT"
] | null | null | null | src/snovault/viewconfigs/searchview.py | lrowe/snovault | acfcac9b62a4d6b2ebb4a2343acadc36b449f0db | [
"MIT"
] | null | null | null | """
# Search View
Some Desc
## Inheritance
SearchView<-BaseView
### BaseView function dependencies
- _format_facets
"""
from urllib.parse import urlencode
from pyramid.httpexceptions import HTTPBadRequest # pylint: disable=import-error
from elasticsearch.helpers import scan # pylint: disable=import-error
from sno... | 36.484252 | 145 | 0.546887 | """
# Search View
Some Desc
## Inheritance
SearchView<-BaseView
### BaseView function dependencies
- _format_facets
"""
from urllib.parse import urlencode
from pyramid.httpexceptions import HTTPBadRequest # pylint: disable=import-error
from elasticsearch.helpers import scan # pylint: disable=import-error
from sno... | 448 | 0 | 26 |
4c12b14eabac8d36cbc8c811399ab7921847a561 | 49,040 | py | Python | finite_state_transducer/fst.py | svenyan/coursework_114_foundamentals_of_compling | 41b59bbf2f78e690d11819691e8c93f2719256da | [
"MIT"
] | null | null | null | finite_state_transducer/fst.py | svenyan/coursework_114_foundamentals_of_compling | 41b59bbf2f78e690d11819691e8c93f2719256da | [
"MIT"
] | null | null | null | finite_state_transducer/fst.py | svenyan/coursework_114_foundamentals_of_compling | 41b59bbf2f78e690d11819691e8c93f2719256da | [
"MIT"
] | null | null | null | # Natural Language Toolkit: Finite State Transducers
#
# Copyright (C) 2001-2011 NLTK Project
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>
# Steven Bird <sb@csse.unimelb.edu.au>
#
# URL: <http://www.nltk.org/>
# For license information, see LICENSE.TXT
"""
Finite state transducers.
A finite state ... | 40.1638 | 106 | 0.563295 | # Natural Language Toolkit: Finite State Transducers
#
# Copyright (C) 2001-2011 NLTK Project
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>
# Steven Bird <sb@csse.unimelb.edu.au>
#
# URL: <http://www.nltk.org/>
# For license information, see LICENSE.TXT
"""
Finite state transducers.
A finite state ... | 9,529 | -5 | 440 |
4519e925a0921df2101937089f64802a936e1b91 | 3,680 | py | Python | tests/unit/aws_resources/lambda_function/test_request.py | Morichan/ec2-instance-starter | f80243b389decf445c4536fd817234f4289a2cd7 | [
"MIT"
] | null | null | null | tests/unit/aws_resources/lambda_function/test_request.py | Morichan/ec2-instance-starter | f80243b389decf445c4536fd817234f4289a2cd7 | [
"MIT"
] | 13 | 2021-11-05T01:11:10.000Z | 2022-03-31T17:17:25.000Z | tests/unit/aws_resources/lambda_function/test_request.py | Morichan/ec2-instance-starter | f80243b389decf445c4536fd817234f4289a2cd7 | [
"MIT"
] | null | null | null | import json
import pytest
import src.aws_resources.lambda_function.request as lambda_request
| 37.55102 | 143 | 0.711413 | import json
import pytest
import src.aws_resources.lambda_function.request as lambda_request
class TestRequest:
@pytest.fixture()
def create_obj(self):
return lambda event: lambda_request.Request(event)
def test_return_empty_if_request_body_is_None(self, create_obj, create_apigw_event):
... | 59 | 3,926 | 23 |
7373150831de2c1a11269b280e9e1d2e1593af2e | 5,118 | py | Python | data.py | tonyache/Ricci_project | abaa164b2969f9ad5202d1cf1d313f0b159b8ad9 | [
"BSD-3-Clause"
] | null | null | null | data.py | tonyache/Ricci_project | abaa164b2969f9ad5202d1cf1d313f0b159b8ad9 | [
"BSD-3-Clause"
] | null | null | null | data.py | tonyache/Ricci_project | abaa164b2969f9ad5202d1cf1d313f0b159b8ad9 | [
"BSD-3-Clause"
] | null | null | null | """
A few examples of squared distance matrices.
All functions also return pointset if available, None otherwise.
"""
from numba import jit
import numpy as np
# import numexpr as ne
from scipy.spatial.distance import cdist
from sklearn import datasets
@jit("void(f8[:,:], f8, f8)", nopython=True, nogil=True)
def sym... | 29.929825 | 80 | 0.613521 | """
A few examples of squared distance matrices.
All functions also return pointset if available, None otherwise.
"""
from numba import jit
import numpy as np
# import numexpr as ne
from scipy.spatial.distance import cdist
from sklearn import datasets
@jit("void(f8[:,:], f8, f8)", nopython=True, nogil=True)
def sym... | 369 | 0 | 46 |
2b7ff9a96a445ab3a0814b85b89802f42ce1be47 | 966 | py | Python | Subarrays/MaxSizeSubarraySumEqualsK.py | PK-100/Competitive_Programming | d0863feaaa99462b2999e85dcf115f7a6c08bb8d | [
"MIT"
] | 70 | 2018-06-25T21:20:15.000Z | 2022-03-24T03:55:17.000Z | Hashing/MaxSizeSubarraySumEqualsK.py | An3sha/Competitive_Programming | ee7eadf51939a360d0b004d787ebabda583e92f0 | [
"MIT"
] | 4 | 2018-09-04T13:12:20.000Z | 2021-06-20T08:29:12.000Z | Hashing/MaxSizeSubarraySumEqualsK.py | An3sha/Competitive_Programming | ee7eadf51939a360d0b004d787ebabda583e92f0 | [
"MIT"
] | 24 | 2018-12-26T05:15:32.000Z | 2022-01-23T23:04:54.000Z | """
Given an array nums and a target value k, find the maximum length of a subarray that sums to k. If there isn't one, return 0 instead.
Array 1 -1 5 -2 3
Array -2 -1 2 1
"""
from collections import defaultdict as d
def maxLen(n, arr, p=0):
"""
15 -2 2 -8 1 7 10 23
15 13 15 7 8 15 25 48
max ... | 24.15 | 133 | 0.57971 | """
Given an array nums and a target value k, find the maximum length of a subarray that sums to k. If there isn't one, return 0 instead.
Array 1 -1 5 -2 3
Array -2 -1 2 1
"""
from collections import defaultdict as d
def maxLen(n, arr, p=0):
"""
15 -2 2 -8 1 7 10 23
15 13 15 7 8 15 25 48
max ... | 0 | 0 | 0 |
00e4f9034c27b845cd24250c1469a79fbbb3d9e5 | 10,839 | py | Python | ansible/lib/ansible/modules/core/network/cumulus/cl_img_install.py | kiv-box/kafka | debec1c4bc8c43776070ee447a53b55fef42bd52 | [
"Apache-2.0"
] | null | null | null | ansible/lib/ansible/modules/core/network/cumulus/cl_img_install.py | kiv-box/kafka | debec1c4bc8c43776070ee447a53b55fef42bd52 | [
"Apache-2.0"
] | null | null | null | ansible/lib/ansible/modules/core/network/cumulus/cl_img_install.py | kiv-box/kafka | debec1c4bc8c43776070ee447a53b55fef42bd52 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Cumulus Networks <ce-ceng@cumulusnetworks.com>
#
# This file is part of Ansible
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3... | 34.192429 | 86 | 0.611034 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Cumulus Networks <ce-ceng@cumulusnetworks.com>
#
# This file is part of Ansible
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3... | 6,452 | 0 | 299 |
0bddd883748e221849a7dc19194d5f1f302e2538 | 3,416 | py | Python | neutrino/datum.py | joshuavictorchen/neutrino | 378081346787a66c186be2ef64338418ebf6321f | [
"MIT"
] | 1 | 2021-11-28T03:00:31.000Z | 2021-11-28T03:00:31.000Z | neutrino/datum.py | joshuavictorchen/neutrino | 378081346787a66c186be2ef64338418ebf6321f | [
"MIT"
] | null | null | null | neutrino/datum.py | joshuavictorchen/neutrino | 378081346787a66c186be2ef64338418ebf6321f | [
"MIT"
] | null | null | null | import neutrino.config as c
import neutrino.tools as t
class Datum:
"""Custom data object that contains a DataFrame and a corresponding main key \
with which to pull specific DataFrame values.
.. note::
This class may be used to do more useful things in the future.
**Instance attrib... | 38.818182 | 133 | 0.626756 | import neutrino.config as c
import neutrino.tools as t
class Datum:
"""Custom data object that contains a DataFrame and a corresponding main key \
with which to pull specific DataFrame values.
.. note::
This class may be used to do more useful things in the future.
**Instance attrib... | 364 | 0 | 27 |
c3f172756a25af2355453aa92d08c204272a5cc1 | 2,998 | py | Python | src/modules/reportWriter/plotFig1.py | sarahyyx/paper1 | bed24d4e0162641d16eeb0c7f485d942df74a453 | [
"MIT"
] | null | null | null | src/modules/reportWriter/plotFig1.py | sarahyyx/paper1 | bed24d4e0162641d16eeb0c7f485d942df74a453 | [
"MIT"
] | 6 | 2020-01-28T22:45:43.000Z | 2022-02-10T00:09:23.000Z | src/modules/reportWriter/plotFig1.py | sarahyyx/paper1 | bed24d4e0162641d16eeb0c7f485d942df74a453 | [
"MIT"
] | null | null | null | from logs import logDecorator as lD
import jsonref, pprint
import numpy as np
import matplotlib.pyplot as plt
from psycopg2.sql import SQL, Identifier, Literal
from lib.databaseIO import pgIO
from collections import Counter
from tqdm import tqdm
from multiprocessing import Pool
from time import sleep
config = jsonr... | 28.283019 | 99 | 0.624416 | from logs import logDecorator as lD
import jsonref, pprint
import numpy as np
import matplotlib.pyplot as plt
from psycopg2.sql import SQL, Identifier, Literal
from lib.databaseIO import pgIO
from collections import Counter
from tqdm import tqdm
from multiprocessing import Pool
from time import sleep
config = jsonr... | 2,454 | 0 | 44 |
6e95386d615d05b7ff5b2fbc8319c50cbf67d2e0 | 782 | py | Python | medical_prescription/chat/views/unarchive_message_health_professional_view.py | ristovao/2017.2-Receituario-Medico | 5387eb80dfb354e948abe64f7d8bbe087fc4f136 | [
"MIT"
] | 11 | 2017-09-19T00:29:40.000Z | 2018-04-05T23:52:39.000Z | medical_prescription/chat/views/unarchive_message_health_professional_view.py | ristovao/2017.2-Receituario-Medico | 5387eb80dfb354e948abe64f7d8bbe087fc4f136 | [
"MIT"
] | 271 | 2017-09-09T00:07:28.000Z | 2017-12-07T05:00:45.000Z | medical_prescription/chat/views/unarchive_message_health_professional_view.py | ristovao/2017.2-Receituario-Medico | 5387eb80dfb354e948abe64f7d8bbe087fc4f136 | [
"MIT"
] | 26 | 2017-08-31T20:48:49.000Z | 2018-03-21T15:11:27.000Z | # Django
from django.views.generic import View
from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from django.urls import reverse_lazy
from django.http import HttpResponseRedirect
# Local Django
from user.decorators import is_health_professional
from chat.mod... | 31.28 | 84 | 0.786445 | # Django
from django.views.generic import View
from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from django.urls import reverse_lazy
from django.http import HttpResponseRedirect
# Local Django
from user.decorators import is_health_professional
from chat.mod... | 204 | 0 | 27 |
5ffb22141db2fbf7b812c0acdd04918f22a2320f | 3,813 | py | Python | code/Septor.py | mashrafsiddiq/Septor | f2d9a75d50e0fd60b6a86e493afcc1f243e4fc6d | [
"MIT"
] | null | null | null | code/Septor.py | mashrafsiddiq/Septor | f2d9a75d50e0fd60b6a86e493afcc1f243e4fc6d | [
"MIT"
] | null | null | null | code/Septor.py | mashrafsiddiq/Septor | f2d9a75d50e0fd60b6a86e493afcc1f243e4fc6d | [
"MIT"
] | null | null | null | from tensorflow.keras import backend as K
from tensorflow.keras.models import Model
from tensorflow.keras.layers import Permute, Flatten
from tensorflow.keras.layers import MaxPooling2D, MaxPooling1D
from tensorflow.keras.layers import Reshape, Dense, Input, Dropout, Activation, LSTM, Conv2D,\
... | 38.13 | 112 | 0.589038 | from tensorflow.keras import backend as K
from tensorflow.keras.models import Model
from tensorflow.keras.layers import Permute, Flatten
from tensorflow.keras.layers import MaxPooling2D, MaxPooling1D
from tensorflow.keras.layers import Reshape, Dense, Input, Dropout, Activation, LSTM, Conv2D,\
... | 3,050 | -9 | 168 |
9c43b0b9e6719d71430706648e5ba299017b6560 | 19,852 | py | Python | hacktheback/rest/account/serializers/user.py | hackthevalley/hack-the-back | a418f2d2751656fed76d0b8c95c8e2a060525e78 | [
"MIT"
] | null | null | null | hacktheback/rest/account/serializers/user.py | hackthevalley/hack-the-back | a418f2d2751656fed76d0b8c95c8e2a060525e78 | [
"MIT"
] | null | null | null | hacktheback/rest/account/serializers/user.py | hackthevalley/hack-the-back | a418f2d2751656fed76d0b8c95c8e2a060525e78 | [
"MIT"
] | null | null | null | # The MIT License (MIT)
#
# Copyright (c) 2013-2019 SUNSCRAPERS
#
# 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, ... | 32.922056 | 79 | 0.646736 | # The MIT License (MIT)
#
# Copyright (c) 2013-2019 SUNSCRAPERS
#
# 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, ... | 11,058 | 4,372 | 661 |
cb9d7b466d33a1061e292c6b5971bd72af2f58b5 | 247 | py | Python | Coursera/Week.4/Task.18.py | v1nnyb0y/Coursera.BasePython | bbfb3184dc27a4cdb16b087123890991afbc5506 | [
"MIT"
] | null | null | null | Coursera/Week.4/Task.18.py | v1nnyb0y/Coursera.BasePython | bbfb3184dc27a4cdb16b087123890991afbc5506 | [
"MIT"
] | null | null | null | Coursera/Week.4/Task.18.py | v1nnyb0y/Coursera.BasePython | bbfb3184dc27a4cdb16b087123890991afbc5506 | [
"MIT"
] | null | null | null | '''
Число сочетаний
'''
n = int(input())
k = int(input())
print(soch(n, k))
| 11.761905 | 46 | 0.42915 | '''
Число сочетаний
'''
def soch(n, k):
if (k == 0):
return 1
if (k == 1):
return n
if (n == k):
return 1
return soch(n - 1, k) + soch(n - 1, k - 1)
n = int(input())
k = int(input())
print(soch(n, k))
| 146 | 0 | 23 |
725e82604ca7f08be0d86556166895a17126c75d | 746 | py | Python | pandas/io/api.py | LauraCollard/pandas | b1c3a9031569334cafc4e8d45d35408421f7dea4 | [
"BSD-3-Clause"
] | 5 | 2019-07-26T15:22:41.000Z | 2021-09-28T09:22:17.000Z | pandas/io/api.py | LauraCollard/pandas | b1c3a9031569334cafc4e8d45d35408421f7dea4 | [
"BSD-3-Clause"
] | 16 | 2021-03-19T09:44:52.000Z | 2022-03-12T00:22:14.000Z | pandas/io/api.py | LauraCollard/pandas | b1c3a9031569334cafc4e8d45d35408421f7dea4 | [
"BSD-3-Clause"
] | 9 | 2020-02-05T10:24:12.000Z | 2020-02-10T13:08:50.000Z | """
Data IO api
"""
# flake8: noqa
from pandas.io.clipboards import read_clipboard
from pandas.io.excel import ExcelFile, ExcelWriter, read_excel
from pandas.io.feather_format import read_feather
from pandas.io.gbq import read_gbq
from pandas.io.html import read_html
from pandas.io.json import read_json
from pandas.i... | 33.909091 | 66 | 0.831099 | """
Data IO api
"""
# flake8: noqa
from pandas.io.clipboards import read_clipboard
from pandas.io.excel import ExcelFile, ExcelWriter, read_excel
from pandas.io.feather_format import read_feather
from pandas.io.gbq import read_gbq
from pandas.io.html import read_html
from pandas.io.json import read_json
from pandas.i... | 0 | 0 | 0 |
73cfe4ce742fbf6b798901c51c481e95128ca11a | 24,601 | py | Python | src/network-manager/azext_network_manager/vendored_sdks/operations/_network_management_client_operations.py | Liran-E/azure-cli-extensions | 053f5c511b58f7de16540d68d8aaa61efd232f15 | [
"MIT"
] | 1 | 2022-01-25T07:33:18.000Z | 2022-01-25T07:33:18.000Z | src/network-manager/azext_network_manager/vendored_sdks/operations/_network_management_client_operations.py | Liran-E/azure-cli-extensions | 053f5c511b58f7de16540d68d8aaa61efd232f15 | [
"MIT"
] | null | null | null | src/network-manager/azext_network_manager/vendored_sdks/operations/_network_management_client_operations.py | Liran-E/azure-cli-extensions | 053f5c511b58f7de16540d68d8aaa61efd232f15 | [
"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 ... | 44.892336 | 286 | 0.71363 | # 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 ... | 8,405 | 14,767 | 138 |
d4b26cb33e88c6e7c18f854b92d60cc3d7eb8f68 | 64,150 | py | Python | sdk/communication/azure-communication-administration/azure/communication/administration/_phonenumber/_generated/aio/operations_async/_phone_number_administration_operations_async.py | adewaleo/azure-sdk-for-python | 169457edbea5e3c5557246cfcf8bd635d528bae4 | [
"MIT"
] | 1 | 2020-03-05T18:10:35.000Z | 2020-03-05T18:10:35.000Z | sdk/communication/azure-communication-administration/azure/communication/administration/_phonenumber/_generated/aio/operations_async/_phone_number_administration_operations_async.py | adewaleo/azure-sdk-for-python | 169457edbea5e3c5557246cfcf8bd635d528bae4 | [
"MIT"
] | 2 | 2021-11-03T06:10:36.000Z | 2021-12-01T06:29:39.000Z | sdk/communication/azure-communication-administration/azure/communication/administration/_phonenumber/_generated/aio/operations_async/_phone_number_administration_operations_async.py | adewaleo/azure-sdk-for-python | 169457edbea5e3c5557246cfcf8bd635d528bae4 | [
"MIT"
] | 1 | 2021-05-19T02:55:10.000Z | 2021-05-19T02:55:10.000Z | # 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.695167 | 202 | 0.653141 | # 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 ... | 16,281 | 0 | 585 |
09037e29db25af4952db95f352bddc06083c790f | 1,309 | py | Python | utils.py | ielm/svo_extract | 4f9652734dbaf8ff5ef4ece6b462891bbf8d3e41 | [
"Apache-2.0"
] | null | null | null | utils.py | ielm/svo_extract | 4f9652734dbaf8ff5ef4ece6b462891bbf8d3e41 | [
"Apache-2.0"
] | null | null | null | utils.py | ielm/svo_extract | 4f9652734dbaf8ff5ef4ece6b462891bbf8d3e41 | [
"Apache-2.0"
] | null | null | null | import os
import pandas as pd
from collections import OrderedDict
if __name__ == '__main__':
process_persuasion_data('data/Persuasion/full_dialog.csv') | 24.240741 | 62 | 0.550802 | import os
import pandas as pd
from collections import OrderedDict
def get_all_data_files(base_dir='data'):
data_files = []
for root, _, files in os.walk(base_dir):
for file in files:
filename = [root, file]
data_files.append(filename)
return data_files
def process_persu... | 1,102 | 0 | 46 |
5de43b8ca0e7c938fafe40a03aea6a5b27119a47 | 7,902 | py | Python | rnn_train.py | Jackingotn/Projekt | 45e9705a3d1986ffaf48dfe1afb477ec2092094f | [
"Apache-2.0"
] | null | null | null | rnn_train.py | Jackingotn/Projekt | 45e9705a3d1986ffaf48dfe1afb477ec2092094f | [
"Apache-2.0"
] | null | null | null | rnn_train.py | Jackingotn/Projekt | 45e9705a3d1986ffaf48dfe1afb477ec2092094f | [
"Apache-2.0"
] | null | null | null |
import tensorflow as tf
from tensorflow.contrib import layers
from tensorflow.contrib import rnn # rnn stuff temporarily in contrib, moving back to code in TF 1.1
import os
import time
import math
import numpy as np
import my_txtutils as txt
tf.set_random_seed(0)
start = time.time()
#
SEQLEN = 50
B... | 46.482353 | 118 | 0.690838 |
import tensorflow as tf
from tensorflow.contrib import layers
from tensorflow.contrib import rnn # rnn stuff temporarily in contrib, moving back to code in TF 1.1
import os
import time
import math
import numpy as np
import my_txtutils as txt
tf.set_random_seed(0)
start = time.time()
#
SEQLEN = 50
B... | 0 | 0 | 0 |
ef9d17ff4a756a294e3fc13117f7570cac1cdf54 | 2,086 | py | Python | run.py | HuangLuGuang/PDFRecognition | ece93c3e2b51f0e6dcc68964d3b25e470086589d | [
"MIT"
] | 6 | 2020-07-30T03:27:59.000Z | 2020-07-30T05:02:33.000Z | run.py | HuangLuGuang/PDFRecognition | ece93c3e2b51f0e6dcc68964d3b25e470086589d | [
"MIT"
] | null | null | null | run.py | HuangLuGuang/PDFRecognition | ece93c3e2b51f0e6dcc68964d3b25e470086589d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# @createTime : 2020/5/20 9:34
# @author : Huanglg
# @fileName: file_change.py
# @email: luguang.huang@mabotech.com
import time
from watchdog.observers import Observer
from watchdog.events import *
import config
from parse_pdf import parse_pdf
import os
import constants
from utils.Logger ... | 29.8 | 91 | 0.643816 | # -*- coding: utf-8 -*-
# @createTime : 2020/5/20 9:34
# @author : Huanglg
# @fileName: file_change.py
# @email: luguang.huang@mabotech.com
import time
from watchdog.observers import Observer
from watchdog.events import *
import config
from parse_pdf import parse_pdf
import os
import constants
from utils.Logger ... | 1,292 | 26 | 184 |
064af3102bf8e9d94e662ec6072eb7ba73266630 | 2,811 | py | Python | rgf_grape/independent_spins/optim.py | SamBoutin/majorana-rgf-grape | 3233627125519a3cc36b1d167c00d39b54abc48d | [
"BSD-2-Clause"
] | null | null | null | rgf_grape/independent_spins/optim.py | SamBoutin/majorana-rgf-grape | 3233627125519a3cc36b1d167c00d39b54abc48d | [
"BSD-2-Clause"
] | null | null | null | rgf_grape/independent_spins/optim.py | SamBoutin/majorana-rgf-grape | 3233627125519a3cc36b1d167c00d39b54abc48d | [
"BSD-2-Clause"
] | null | null | null | """
This file is part of the rgf_grape python package.
Copyright (C) 2017-2018 S. Boutin
For details of the rgf_grape algorithm and applications see:
S. Boutin, J. Camirand Lemyre, and I. Garate, Majorana bound state engineering
via efficient real-space parameter optimization, ArXiv 1804.03170 (2018).
"""
import rgf_... | 35.1375 | 79 | 0.670224 | """
This file is part of the rgf_grape python package.
Copyright (C) 2017-2018 S. Boutin
For details of the rgf_grape algorithm and applications see:
S. Boutin, J. Camirand Lemyre, and I. Garate, Majorana bound state engineering
via efficient real-space parameter optimization, ArXiv 1804.03170 (2018).
"""
import rgf_... | 2,291 | 0 | 92 |
945fcd0c83ccf4a7ac4ae658d8620ed6abb8bd2d | 7,135 | py | Python | dot_weechat/python/urlbuf.py | benmezger/new-dotfiles | 5aa41015bd017d0e4cc39edf374ca73e8c25b8cb | [
"MIT"
] | 68 | 2016-09-28T12:51:20.000Z | 2022-02-25T15:33:16.000Z | dot_weechat/python/urlbuf.py | benmezger/new-dotfiles | 5aa41015bd017d0e4cc39edf374ca73e8c25b8cb | [
"MIT"
] | null | null | null | dot_weechat/python/urlbuf.py | benmezger/new-dotfiles | 5aa41015bd017d0e4cc39edf374ca73e8c25b8cb | [
"MIT"
] | 2 | 2016-09-28T12:51:28.000Z | 2022-01-11T10:26:44.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2011-2014 by Jani Kesänen <jani.kesanen@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option... | 37.751323 | 106 | 0.660547 | # -*- coding: utf-8 -*-
# Copyright (c) 2011-2014 by Jani Kesänen <jani.kesanen@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option... | 85 | 0 | 23 |
c21fac3df0193f2967e4b94137fb68c135baf3b8 | 1,303 | py | Python | samples/metrics/tests.py | simonsdave/tor-async-couchdb | 286b0acaca636f5e937b159d56db573973cd17a1 | [
"MIT"
] | 1 | 2019-01-27T21:07:14.000Z | 2019-01-27T21:07:14.000Z | samples/metrics/tests.py | simonsdave/tor-async-couchdb | 286b0acaca636f5e937b159d56db573973cd17a1 | [
"MIT"
] | 5 | 2015-04-22T17:52:07.000Z | 2017-05-16T01:56:45.000Z | samples/metrics/tests.py | simonsdave/tor-async-couchdb | 286b0acaca636f5e937b159d56db573973cd17a1 | [
"MIT"
] | 2 | 2015-05-04T20:19:46.000Z | 2016-05-30T09:59:59.000Z | """This file contains a series of integration tests that sanity check
a sample metrics service running on http://127.0.0.1:8445
"""
import httplib
import unittest
import requests
_base_url = 'http://service:8445/v1.0/_metrics'
| 26.06 | 82 | 0.487337 | """This file contains a series of integration tests that sanity check
a sample metrics service running on http://127.0.0.1:8445
"""
import httplib
import unittest
import requests
_base_url = 'http://service:8445/v1.0/_metrics'
class TheTestCase(unittest.TestCase):
def _keys_from_dict(self, d):
rv = {}... | 979 | 16 | 77 |
37ed19ad54af99b7080486c478a9cb6d9a5768c5 | 9,937 | py | Python | graph.py | kunrii/NodeNet | 192579807cb13fc363ea28f787da7d431b39646d | [
"MIT"
] | null | null | null | graph.py | kunrii/NodeNet | 192579807cb13fc363ea28f787da7d431b39646d | [
"MIT"
] | null | null | null | graph.py | kunrii/NodeNet | 192579807cb13fc363ea28f787da7d431b39646d | [
"MIT"
] | null | null | null | import numpy as _lib_
import node as _node_
################################################################################################
##### TRAINING FUNCTIONALITY FOR EPOCH AND ITERATION
################################################################################################
... | 28.070621 | 150 | 0.447016 | import numpy as _lib_
import node as _node_
class Graph:
def __init__(self):
self.nodes = set()
self.inputNodes = set()
self.outputNodes = set()
self.links = set()
self.learning_rate = 1e-3
#############################################################... | 7,443 | -9 | 638 |
dec59269a1884344706c2f5e0aff086f7383c173 | 4,398 | py | Python | src/boogie/testing/crawler.py | pencil-labs/django-boogie | 79b759617785ce33a24cb6013266a0810b24801c | [
"BSD-3-Clause"
] | null | null | null | src/boogie/testing/crawler.py | pencil-labs/django-boogie | 79b759617785ce33a24cb6013266a0810b24801c | [
"BSD-3-Clause"
] | null | null | null | src/boogie/testing/crawler.py | pencil-labs/django-boogie | 79b759617785ce33a24cb6013266a0810b24801c | [
"BSD-3-Clause"
] | 2 | 2021-09-16T22:11:35.000Z | 2021-09-25T12:28:27.000Z | import re
import sys
from collections import deque
from html.parser import HTMLParser
from django.test.client import Client
# Utility functions
cte = lambda x: lambda *args: x
choose = lambda cond, do, other: do if cond else other
def crawl(url="/", skip_patterns=(), skip_urls=(), errors=(), user=None, log=print):
... | 29.918367 | 84 | 0.597999 | import re
import sys
from collections import deque
from html.parser import HTMLParser
from django.test.client import Client
# Utility functions
cte = lambda x: lambda *args: x
choose = lambda cond, do, other: do if cond else other
def crawl(url="/", skip_patterns=(), skip_urls=(), errors=(), user=None, log=print):
... | 547 | 181 | 22 |
7d2d2198a7cc07ba660a2d2a67b827449b3f4b63 | 1,978 | py | Python | src/tools/bin/send_mail.py | aherbert/omero-archiving | ce52a63215ea9b75a50d35ee9690fe37ee74794a | [
"0BSD"
] | 1 | 2021-07-08T11:03:34.000Z | 2021-07-08T11:03:34.000Z | src/tools/bin/send_mail.py | aherbert/omero-archiving | ce52a63215ea9b75a50d35ee9690fe37ee74794a | [
"0BSD"
] | 1 | 2022-01-20T12:24:43.000Z | 2022-01-20T17:48:01.000Z | src/tools/bin/send_mail.py | aherbert/omero-archiving | ce52a63215ea9b75a50d35ee9690fe37ee74794a | [
"0BSD"
] | null | null | null | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted.
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANT... | 30.90625 | 80 | 0.650657 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted.
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANT... | 712 | 0 | 22 |
40f975aa76e944e36458af8eb933c3b17f5650a2 | 3,304 | py | Python | app/api/v1/views/meetups.py | MaggieKimani1/QUESTIONER-API | a92c5014c584f43dd30a6555d656b6c5ea31774d | [
"MIT"
] | null | null | null | app/api/v1/views/meetups.py | MaggieKimani1/QUESTIONER-API | a92c5014c584f43dd30a6555d656b6c5ea31774d | [
"MIT"
] | 2 | 2019-01-09T08:50:38.000Z | 2019-01-10T18:51:42.000Z | app/api/v1/views/meetups.py | MaggieKimani1/QUESTIONER-API | a92c5014c584f43dd30a6555d656b6c5ea31774d | [
"MIT"
] | 1 | 2019-02-08T15:31:42.000Z | 2019-02-08T15:31:42.000Z | from flask import Flask, request, jsonify
from flask_restful import Resource
from app.api.v1.models.meetupsmodel import all_meetups, Meetups, all_rsvps
from flask_expects_json import expects_json
from app.api.v1.utils.json_schema import meetup_schema
class AllMeetupsApi(Resource):
"""Endpoint for all meetups func... | 36.307692 | 102 | 0.587167 | from flask import Flask, request, jsonify
from flask_restful import Resource
from app.api.v1.models.meetupsmodel import all_meetups, Meetups, all_rsvps
from flask_expects_json import expects_json
from app.api.v1.utils.json_schema import meetup_schema
class AllMeetupsApi(Resource):
"""Endpoint for all meetups func... | 0 | 0 | 0 |
271ae1116dc1cee3b8f3e8915c82797545547b26 | 467 | py | Python | constclust/utils.py | ivirshup/constclust | 6b7ef2773a3332beccd1de8774b16f3727321510 | [
"MIT"
] | 10 | 2019-04-09T03:26:45.000Z | 2021-07-29T17:07:13.000Z | constclust/utils.py | ivirshup/constclust | 6b7ef2773a3332beccd1de8774b16f3727321510 | [
"MIT"
] | 4 | 2020-06-06T06:12:40.000Z | 2021-02-11T08:00:25.000Z | constclust/utils.py | ivirshup/constclust | 6b7ef2773a3332beccd1de8774b16f3727321510 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
def reverse_series_map(series):
"""Reverse a mapping"""
return pd.Series(series.index.values, index=series.values)
| 20.304348 | 62 | 0.550321 | import pandas as pd
import numpy as np
def reverse_series_map(series):
"""Reverse a mapping"""
return pd.Series(series.index.values, index=series.values)
def pairs_to_dict(pairs):
cur = next(pairs)
curfirst = cur[0]
l = [cur[1]]
d = {curfirst: l}
for cur in pairs:
if curfirst != ... | 279 | 0 | 23 |
8b3c6e301a2bfe4184eaebfe81d9e514d826c7a6 | 3,547 | py | Python | migrations/helpers/mlwh_samples_update_helper.py | JamesGlover/crawler | 877bae3b4f88690748d304b6543ccb260f43bb68 | [
"MIT"
] | null | null | null | migrations/helpers/mlwh_samples_update_helper.py | JamesGlover/crawler | 877bae3b4f88690748d304b6543ccb260f43bb68 | [
"MIT"
] | null | null | null | migrations/helpers/mlwh_samples_update_helper.py | JamesGlover/crawler | 877bae3b4f88690748d304b6543ccb260f43bb68 | [
"MIT"
] | null | null | null | import logging
import logging.config
import time
from typing import List
import pymongo
import sys
import traceback
from crawler.constants import (
COLLECTION_SAMPLES,
FIELD_CREATED_AT,
MONGO_DATETIME_FORMAT,
)
from crawler.db import (
create_mongo_client,
get_mongo_collection,
get_mongo_db,
... | 34.77451 | 112 | 0.661686 | import logging
import logging.config
import time
from typing import List
import pymongo
import sys
import traceback
from crawler.constants import (
COLLECTION_SAMPLES,
FIELD_CREATED_AT,
MONGO_DATETIME_FORMAT,
)
from crawler.db import (
create_mongo_client,
get_mongo_collection,
get_mongo_db,
... | 2,953 | 0 | 69 |
450a952469d38fab0777cdf4cf72fe4d4c3806a5 | 488 | py | Python | config.py | Kiback732/backend | 2ebae9f5a30b18eecbab32a0a312887a843be374 | [
"MIT"
] | null | null | null | config.py | Kiback732/backend | 2ebae9f5a30b18eecbab32a0a312887a843be374 | [
"MIT"
] | null | null | null | config.py | Kiback732/backend | 2ebae9f5a30b18eecbab32a0a312887a843be374 | [
"MIT"
] | null | null | null | import os
basedir = os.path.abspath(os.path.dirname(__file__))
| 34.857143 | 108 | 0.721311 | import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config(object):
DEVELOPMENT = True
DEBUG = True
SECRET_KEY = os.environ.get('SECRET_KEY') or '123456789'
SQLALCHEMY_DATABASE_URI = os.environ.get('POSTGRESQL_URL') or 'postgresql://worker:worker@localhost/app'
SQLALCHEMY_TRACK_MO... | 0 | 402 | 23 |
b986581a75d6e77342ffb7d23b1f42458660eb4b | 16,025 | py | Python | source/result/file_3_7.py | lintongtong123/JackokiePapers | 65a4be9c9b636c7c3d0c4ab24096572a737480c7 | [
"MIT"
] | null | null | null | source/result/file_3_7.py | lintongtong123/JackokiePapers | 65a4be9c9b636c7c3d0c4ab24096572a737480c7 | [
"MIT"
] | null | null | null | source/result/file_3_7.py | lintongtong123/JackokiePapers | 65a4be9c9b636c7c3d0c4ab24096572a737480c7 | [
"MIT"
] | 1 | 2019-09-24T01:32:44.000Z | 2019-09-24T01:32:44.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2018/3/11 15:23
# @Author : Jackokie Zhao
# @Site : www.jackokie.com
# @File : file_3_7.py
# @Software: PyCharm
# @contact: jackokie@gmail.com
import os
import pickle
import numpy as np
import tensorflow as tf
import matplotlib
from sklearn.manifold im... | 35.065646 | 117 | 0.641685 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2018/3/11 15:23
# @Author : Jackokie Zhao
# @Site : www.jackokie.com
# @File : file_3_7.py
# @Software: PyCharm
# @contact: jackokie@gmail.com
import os
import pickle
import numpy as np
import tensorflow as tf
import matplotlib
from sklearn.manifold im... | 4,343 | 0 | 46 |
078fe6a1cf5862634bb0c53902668f2d955de0a8 | 490 | py | Python | microtubulepkg/microtubulepkg/__init__.py | liuvictoria/sleepingbeauty | e165bea614d58ddd2c5c2a860df622241065cf47 | [
"MIT"
] | null | null | null | microtubulepkg/microtubulepkg/__init__.py | liuvictoria/sleepingbeauty | e165bea614d58ddd2c5c2a860df622241065cf47 | [
"MIT"
] | null | null | null | microtubulepkg/microtubulepkg/__init__.py | liuvictoria/sleepingbeauty | e165bea614d58ddd2c5c2a860df622241065cf47 | [
"MIT"
] | null | null | null | """Microtubule catastrophe time and concentration analyses"""
from .tidy_data import *
from .ecdfs import *
from .controls import *
from .parameter_estimates import *
from .viz_controls import *
from .viz_explore_two_arrival_story import *
from .viz_parameter_estimates import *
from .viz_explore_concentration_datse... | 24.5 | 61 | 0.795918 | """Microtubule catastrophe time and concentration analyses"""
from .tidy_data import *
from .ecdfs import *
from .controls import *
from .parameter_estimates import *
from .viz_controls import *
from .viz_explore_two_arrival_story import *
from .viz_parameter_estimates import *
from .viz_explore_concentration_datse... | 0 | 0 | 0 |
7dcf3ad17c81c5a0612aae877a9ef43ab17b3af4 | 6,611 | py | Python | scripts/chalfHLS/adderHLS_roundOFF/script.py | dicecco1/fpga_caffe | 7a191704efd7873071cfef35772d7e7bf3e3cfd6 | [
"Intel",
"BSD-2-Clause"
] | 134 | 2016-10-05T22:10:19.000Z | 2022-03-26T07:13:55.000Z | scripts/chalfHLS/adderHLS_roundOFF/script.py | honorpeter/fpga_caffe | 7a191704efd7873071cfef35772d7e7bf3e3cfd6 | [
"Intel",
"BSD-2-Clause"
] | 14 | 2016-11-20T21:16:38.000Z | 2020-04-14T04:58:32.000Z | scripts/chalfHLS/adderHLS_roundOFF/script.py | honorpeter/fpga_caffe | 7a191704efd7873071cfef35772d7e7bf3e3cfd6 | [
"Intel",
"BSD-2-Clause"
] | 58 | 2016-10-03T01:23:47.000Z | 2021-11-24T12:17:30.000Z | import subprocess
import os
from shutil import copyfile
import numpy as np
import matplotlib.pyplot as plt
import csv
import sys
report_list = []
exp_4 = []
exp_5 = []
exp_6 = []
exp_7 = []
# change range here to specify testing range for exponent and mentissa. eg. (4,8) stands for [4,8)
for exponent in range (4,8):
... | 34.432292 | 351 | 0.650885 | import subprocess
import os
from shutil import copyfile
import numpy as np
import matplotlib.pyplot as plt
import csv
import sys
class report:
def __init__(self, CLB, LUT, FF, DSP, BRAM, SRL, EXP, MEN, CP_required, CP_achieved_post_synthesis, CP_achieved_post_implementation):
self.CLB = CLB
self.LUT = LUT
self.... | 417 | -8 | 46 |
7192fa32d4f87e9d901dd91dc352b86813059ba0 | 232 | py | Python | src/builddirector.py | MrLIVB/BMSTU_CG_CP | 05bc273336e36a5f1a63595b83f9eddd5aca9900 | [
"MIT"
] | null | null | null | src/builddirector.py | MrLIVB/BMSTU_CG_CP | 05bc273336e36a5f1a63595b83f9eddd5aca9900 | [
"MIT"
] | null | null | null | src/builddirector.py | MrLIVB/BMSTU_CG_CP | 05bc273336e36a5f1a63595b83f9eddd5aca9900 | [
"MIT"
] | null | null | null | from builder import ModelBuilder
| 23.2 | 46 | 0.689655 | from builder import ModelBuilder
class BuildDirector(object):
def __init__(self, builder: ModelBuilder):
self.builder = builder
def create(self):
product = self.builder.get_product()
return product
| 116 | 7 | 76 |
4faed980386c5a54f35bc6f3fae965635f77f107 | 1,231 | py | Python | html/atom.py | adein/HTML | 089196da470f0bfbe805a0328335735c82e6a412 | [
"MIT"
] | 1 | 2016-12-31T12:59:26.000Z | 2016-12-31T12:59:26.000Z | html/atom.py | adein/HTML | 089196da470f0bfbe805a0328335735c82e6a412 | [
"MIT"
] | null | null | null | html/atom.py | adein/HTML | 089196da470f0bfbe805a0328335735c82e6a412 | [
"MIT"
] | null | null | null | """This module provides an HTML tag class."""
# Imports
class Tag(object):
"""Describes an HTML tag.
Attributes:
name: The name/type of a tag. e.g., 'table'.
attributes: A list of attribute tuples.
data: The content of the Tag.
parent: The parent of the Tag.
children:... | 27.355556 | 74 | 0.595451 | """This module provides an HTML tag class."""
# Imports
class Tag(object):
"""Describes an HTML tag.
Attributes:
name: The name/type of a tag. e.g., 'table'.
attributes: A list of attribute tuples.
data: The content of the Tag.
parent: The parent of the Tag.
children:... | 0 | 0 | 0 |
03ee1f4295bad60d9cc64a3bb9b43d54b59a41dd | 737 | py | Python | QRCodeLib/qrcodelib/quiet_zone.py | yas78/QRCodeLibPy | 7b2c489b5e38aa23619ae41bff7a31993885275b | [
"MIT"
] | null | null | null | QRCodeLib/qrcodelib/quiet_zone.py | yas78/QRCodeLibPy | 7b2c489b5e38aa23619ae41bff7a31993885275b | [
"MIT"
] | 1 | 2019-11-04T13:44:44.000Z | 2019-11-04T13:44:44.000Z | QRCodeLib/qrcodelib/quiet_zone.py | yas78/QRCodeLibPy | 7b2c489b5e38aa23619ae41bff7a31993885275b | [
"MIT"
] | null | null | null | from typing import List
from .misc.array_util import ArrayUtil
| 25.413793 | 87 | 0.621438 | from typing import List
from .misc.array_util import ArrayUtil
class QuietZone:
_WIDTH_LOWER_LIMIT = 4
_width = _WIDTH_LOWER_LIMIT
@classmethod
def get_width(cls) -> int:
return cls._width
@classmethod
def set_width(cls, value: int) -> None:
if value < cls._WIDTH_LOWER_LIMIT:... | 464 | 186 | 23 |
30f23511e6ce8b0a09a86074f75bd8ff481b6ee3 | 2,316 | py | Python | src/api/views/recipes/recipes_manage_views.py | mdcg/recipy | 42919bd4946a525648f4e3dda38ca634793a6722 | [
"MIT"
] | null | null | null | src/api/views/recipes/recipes_manage_views.py | mdcg/recipy | 42919bd4946a525648f4e3dda38ca634793a6722 | [
"MIT"
] | 10 | 2020-06-05T23:53:20.000Z | 2022-03-11T23:57:01.000Z | src/api/views/recipes/recipes_manage_views.py | mdcg/recipy | 42919bd4946a525648f4e3dda38ca634793a6722 | [
"MIT"
] | 1 | 2021-03-30T01:34:05.000Z | 2021-03-30T01:34:05.000Z | from django.core.exceptions import ObjectDoesNotExist
from rest_framework import status
from rest_framework.authentication import TokenAuthentication
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from rest_framework.views import APIView
from api.models import Recip... | 31.726027 | 74 | 0.66019 | from django.core.exceptions import ObjectDoesNotExist
from rest_framework import status
from rest_framework.authentication import TokenAuthentication
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from rest_framework.views import APIView
from api.models import Recip... | 1,530 | 289 | 46 |
7cec78baefd745634eda9cc87677292bf9bc6f45 | 879 | py | Python | look_vec.py | sanubhav77/Gaze-Estimation | d85b8f1306cefaf8b2bb2d873bf7daf8a9778dca | [
"MIT"
] | 7 | 2019-12-11T15:38:09.000Z | 2021-06-03T11:09:04.000Z | look_vec.py | sanubhav77/Gaze-Estimation | d85b8f1306cefaf8b2bb2d873bf7daf8a9778dca | [
"MIT"
] | 1 | 2020-05-04T11:38:29.000Z | 2020-05-04T11:38:29.000Z | look_vec.py | sanubhav77/Gaze-Estimation | d85b8f1306cefaf8b2bb2d873bf7daf8a9778dca | [
"MIT"
] | 5 | 2019-12-13T09:38:41.000Z | 2021-11-01T10:24:40.000Z | import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
import json
if __name__ == '__main__':
with open('sample_preds.json', 'r', encoding="utf-8") as file:
data = json.load(file)
for i in range(10):
item = data[i]
x, y, z = item['out']['look_vec'][... | 26.636364 | 100 | 0.527873 | import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
import json
if __name__ == '__main__':
with open('sample_preds.json', 'r', encoding="utf-8") as file:
data = json.load(file)
for i in range(10):
item = data[i]
x, y, z = item['out']['look_vec'][... | 0 | 0 | 0 |
b9ab721a127fa4fa529e0a401a684be23866f7dc | 8,737 | py | Python | mmdet/models/backbones/resnextDy.py | HAOCHENYE/yehc_mmdet | 491cc13c6ff769996b7a23b871b10f9a5a1c56fa | [
"Apache-2.0"
] | 1 | 2021-12-25T13:22:39.000Z | 2021-12-25T13:22:39.000Z | mmdet/models/backbones/resnextDy.py | HAOCHENYE/yehc_mmdet | 491cc13c6ff769996b7a23b871b10f9a5a1c56fa | [
"Apache-2.0"
] | null | null | null | mmdet/models/backbones/resnextDy.py | HAOCHENYE/yehc_mmdet | 491cc13c6ff769996b7a23b871b10f9a5a1c56fa | [
"Apache-2.0"
] | 1 | 2021-02-01T13:33:26.000Z | 2021-02-01T13:33:26.000Z | import math
from mmcv.cnn import build_conv_layer, build_norm_layer
from ..builder import BACKBONES
from ..utils import ResLayer
from .resnet import Bottleneck as _Bottleneck
from .resnet import ResNet
import torch
import torch.nn as nn
import torch.utils.checkpoint as cp
@BACKBONES.register_module()
class ResNeX... | 34.128906 | 89 | 0.570333 | import math
from mmcv.cnn import build_conv_layer, build_norm_layer
from ..builder import BACKBONES
from ..utils import ResLayer
from .resnet import Bottleneck as _Bottleneck
from .resnet import ResNet
import torch
import torch.nn as nn
import torch.utils.checkpoint as cp
class DyReLU(nn.Module):
def __init__(s... | 3,458 | 2,859 | 305 |
26cb716928f29c953089e0281879920c86b414a9 | 605 | py | Python | src/rooms/migrations/0020_auto_20190704_1921.py | Bounty1993/my-blog | 973ed2046fbb37489fea7caeeebcea5f88cf3fa6 | [
"MIT"
] | null | null | null | src/rooms/migrations/0020_auto_20190704_1921.py | Bounty1993/my-blog | 973ed2046fbb37489fea7caeeebcea5f88cf3fa6 | [
"MIT"
] | null | null | null | src/rooms/migrations/0020_auto_20190704_1921.py | Bounty1993/my-blog | 973ed2046fbb37489fea7caeeebcea5f88cf3fa6 | [
"MIT"
] | null | null | null | # Generated by Django 2.2 on 2019-07-04 19:21
import datetime
from django.db import migrations, models
| 23.269231 | 85 | 0.593388 | # Generated by Django 2.2 on 2019-07-04 19:21
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('rooms', '0019_auto_20190703_1840'),
]
operations = [
migrations.AddField(
model_name='room',
name='cr... | 0 | 476 | 23 |
53c1cdbf8dd9c433a8ef2a6f4c4992fd65601736 | 784 | py | Python | alphazero/othello/train.py | bhansconnect/alphazero-general | 374d8796496a4a8c8efe504f8ab93195a29a2ee5 | [
"MIT"
] | null | null | null | alphazero/othello/train.py | bhansconnect/alphazero-general | 374d8796496a4a8c8efe504f8ab93195a29a2ee5 | [
"MIT"
] | null | null | null | alphazero/othello/train.py | bhansconnect/alphazero-general | 374d8796496a4a8c8efe504f8ab93195a29a2ee5 | [
"MIT"
] | null | null | null | import pyximport; pyximport.install()
from alphazero.Coach import Coach, get_args
from alphazero.NNetWrapper import NNetWrapper as nn
from alphazero.othello.OthelloGame import OthelloGame as Game
from alphazero.othello.OthelloPlayers import GreedyOthelloPlayer
args = get_args(
run_name='othello',
cpuct=2,
... | 23.757576 | 64 | 0.730867 | import pyximport; pyximport.install()
from alphazero.Coach import Coach, get_args
from alphazero.NNetWrapper import NNetWrapper as nn
from alphazero.othello.OthelloGame import OthelloGame as Game
from alphazero.othello.OthelloPlayers import GreedyOthelloPlayer
args = get_args(
run_name='othello',
cpuct=2,
... | 0 | 0 | 0 |
56f777bd751ac8721482fe22e0fbd12a47820581 | 2,452 | py | Python | HPCnet/hpcnet_utils.py | Linxius/HPCnet | 689057cd3ec206e187fd3ac01fb3ae8ae41110ed | [
"MIT"
] | 1 | 2019-11-13T04:41:54.000Z | 2019-11-13T04:41:54.000Z | HPCnet/hpcnet_utils.py | Linxius/HPCnet | 689057cd3ec206e187fd3ac01fb3ae8ae41110ed | [
"MIT"
] | null | null | null | HPCnet/hpcnet_utils.py | Linxius/HPCnet | 689057cd3ec206e187fd3ac01fb3ae8ae41110ed | [
"MIT"
] | 2 | 2019-11-13T04:59:12.000Z | 2019-11-13T08:34:04.000Z | import torch
from torch.autograd import Variable
from torch.autograd import Function
import torch.nn as nn
from typing import Tuple
import pointnet2_cuda as pointnet2
from HPCnet.getGtFeature import get_gt_feature
from pointnet2.pointnet2_utils import ball_query, grouping_operation
| 43.017544 | 118 | 0.581974 | import torch
from torch.autograd import Variable
from torch.autograd import Function
import torch.nn as nn
from typing import Tuple
import pointnet2_cuda as pointnet2
from HPCnet.getGtFeature import get_gt_feature
from pointnet2.pointnet2_utils import ball_query, grouping_operation
class HPC_Group(nn.Module):
d... | 0 | 2,143 | 23 |
eb41e7ff73c13eb563ae66c0e6aa3bb7cbdb2e5b | 281 | py | Python | tests/__init__.py | althonos/zbox | ec2ba6e32f677e3cfd9ebb5b1a037684787be415 | [
"MIT"
] | null | null | null | tests/__init__.py | althonos/zbox | ec2ba6e32f677e3cfd9ebb5b1a037684787be415 | [
"MIT"
] | null | null | null | tests/__init__.py | althonos/zbox | ec2ba6e32f677e3cfd9ebb5b1a037684787be415 | [
"MIT"
] | null | null | null | # coding: utf-8
from __future__ import absolute_import
import os
import sys
sys.path.append(os.path.abspath(os.path.join(__file__, "..", "..")))
sys.path.append(os.path.abspath(os.path.join(__file__, "..", "..", "build", "lib")))
from . import test_file
from . import test_repo
| 23.416667 | 84 | 0.697509 | # coding: utf-8
from __future__ import absolute_import
import os
import sys
sys.path.append(os.path.abspath(os.path.join(__file__, "..", "..")))
sys.path.append(os.path.abspath(os.path.join(__file__, "..", "..", "build", "lib")))
from . import test_file
from . import test_repo
| 0 | 0 | 0 |
5857e53be2301574092ce2c4e12968f50d4adc72 | 4,793 | py | Python | tests/tools/test_initdata.py | multi-coop/catalogage-donnees | 1d70401ff6c7b01ec051460a253cb105adf65911 | [
"MIT"
] | null | null | null | tests/tools/test_initdata.py | multi-coop/catalogage-donnees | 1d70401ff6c7b01ec051460a253cb105adf65911 | [
"MIT"
] | 14 | 2022-01-25T17:56:52.000Z | 2022-01-28T17:47:59.000Z | tests/tools/test_initdata.py | multi-coop/catalogage-donnees | 1d70401ff6c7b01ec051460a253cb105adf65911 | [
"MIT"
] | null | null | null | import json
from pathlib import Path
import pytest
from pydantic import EmailStr, SecretStr
from server.application.auth.commands import DeleteUser
from server.application.auth.queries import Login
from server.application.datasets.commands import UpdateDataset
from server.application.datasets.queries import GetAllDat... | 29.95625 | 84 | 0.668266 | import json
from pathlib import Path
import pytest
from pydantic import EmailStr, SecretStr
from server.application.auth.commands import DeleteUser
from server.application.auth.queries import Login
from server.application.datasets.commands import UpdateDataset
from server.application.datasets.queries import GetAllDat... | 3,972 | 0 | 88 |
535bd7f6389b27d5b90905ffc1e366ad82ba4b0a | 1,625 | py | Python | src/gym/notebook/nn/random_search.py | Riotpiaole/RL-Ai-player | f3edffd2dda12e4bbd6b9bfed0123511bce3610a | [
"MIT"
] | 2 | 2019-01-05T17:36:41.000Z | 2019-01-05T20:13:11.000Z | src/gym/notebook/nn/random_search.py | Riotpiaole/RL-Ai-player | f3edffd2dda12e4bbd6b9bfed0123511bce3610a | [
"MIT"
] | null | null | null | src/gym/notebook/nn/random_search.py | Riotpiaole/RL-Ai-player | f3edffd2dda12e4bbd6b9bfed0123511bce3610a | [
"MIT"
] | null | null | null | import numpy as np | 31.862745 | 85 | 0.569231 | import numpy as np
class Random_Agent():
def __init__(self, shape, time_stamps = 200, forward_pass=None):
self.frames = []
self.shape = shape
# represent t value from 0 to given t
self.t = time_stamps
if forward_pass:
self.forward = forward_pass
def forward... | 1,477 | 0 | 130 |
a7907d18b3a26c0579f9f41dcda03502f76c62d0 | 284 | py | Python | frontend.py | FelipeCaue/sentiment_analysis | fa958b204a541622d2a1c86dfb1ebaf7b84ed092 | [
"MIT"
] | null | null | null | frontend.py | FelipeCaue/sentiment_analysis | fa958b204a541622d2a1c86dfb1ebaf7b84ed092 | [
"MIT"
] | null | null | null | frontend.py | FelipeCaue/sentiment_analysis | fa958b204a541622d2a1c86dfb1ebaf7b84ed092 | [
"MIT"
] | null | null | null | import streamlit as st
import requests
from utils.io_utils import load_config
config = load_config()
st.title("Sentiment Analysis")
text = st.text_input("Insert a text")
if text:
response = requests.get(config["api"]["url"], params={"text": text})
st.write(response.json()) | 23.666667 | 72 | 0.721831 | import streamlit as st
import requests
from utils.io_utils import load_config
config = load_config()
st.title("Sentiment Analysis")
text = st.text_input("Insert a text")
if text:
response = requests.get(config["api"]["url"], params={"text": text})
st.write(response.json()) | 0 | 0 | 0 |
bed0ba005f6727036f40b418c4aa5afab57c1256 | 878 | py | Python | androtoolbox/commandline/update_shared_pref.py | gregthedoe/androtoolbox | c98a11c03f388af711837849b9f86966be15685a | [
"MIT"
] | null | null | null | androtoolbox/commandline/update_shared_pref.py | gregthedoe/androtoolbox | c98a11c03f388af711837849b9f86966be15685a | [
"MIT"
] | null | null | null | androtoolbox/commandline/update_shared_pref.py | gregthedoe/androtoolbox | c98a11c03f388af711837849b9f86966be15685a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import argparse
from androtoolbox.shared_pref import SharedPref
if __name__ == '__main__':
main()
| 33.769231 | 117 | 0.750569 | #!/usr/bin/env python
import argparse
from androtoolbox.shared_pref import SharedPref
def update_shared_pref(package, pref_name, updates):
shared_pref = SharedPref.from_device(package, pref_name)
shared_pref.update(updates)
shared_pref.to_device(package, pref_name)
def main():
description = "Update... | 703 | 0 | 46 |
a65b18a173fc943249951fcd6f3507e97b21d4e7 | 71 | py | Python | build/lib/XMC/__init__.py | Stomach-ache/GLaS | 253092cce1922711e7d9c9df601f117f3ec56e0c | [
"MIT"
] | 2 | 2020-07-13T05:13:50.000Z | 2021-04-26T12:09:32.000Z | build/lib/XMC/__init__.py | Stomach-ache/GLaS | 253092cce1922711e7d9c9df601f117f3ec56e0c | [
"MIT"
] | 4 | 2020-01-10T10:54:52.000Z | 2020-01-15T10:14:15.000Z | build/lib/XMC/__init__.py | pyschedelicsid/GlasXC | eb3077d7c1aa9ca25798b4c5d5dd95ce36fe5a4e | [
"MIT"
] | 2 | 2021-01-26T07:27:16.000Z | 2021-04-28T13:38:03.000Z | from XMC import loaders
from XMC import GlasXC
from XMC import metrics
| 17.75 | 23 | 0.830986 | from XMC import loaders
from XMC import GlasXC
from XMC import metrics
| 0 | 0 | 0 |
b58b5838189cedda398e9ccafc48cdd7494177dc | 1,155 | py | Python | traverse_invoke/leaves/adapt/adapt_demo.py | danlkv/traverse-invoke | a65236c19852229ad422c707759466750e7c6139 | [
"MIT"
] | null | null | null | traverse_invoke/leaves/adapt/adapt_demo.py | danlkv/traverse-invoke | a65236c19852229ad422c707759466750e7c6139 | [
"MIT"
] | null | null | null | traverse_invoke/leaves/adapt/adapt_demo.py | danlkv/traverse-invoke | a65236c19852229ad422c707759466750e7c6139 | [
"MIT"
] | null | null | null | """
This is demonstrative implementation of how to use
`traverse invoke` for implementation of its parts
"""
from .core import entry_traverse
from .adapt import get_args, filter_dict
from traverse_invoke.leaves import kwarg
# ## ## ## ## ## This is demonstrative stuff ######
def wrap(retkey):
"""
This decorat... | 22.211538 | 54 | 0.621645 | """
This is demonstrative implementation of how to use
`traverse invoke` for implementation of its parts
"""
from .core import entry_traverse
from .adapt import get_args, filter_dict
from traverse_invoke.leaves import kwarg
# ## ## ## ## ## This is demonstrative stuff ######
def wrap(retkey):
"""
This decorat... | 469 | 0 | 94 |
d9a51dc823e5609efe44be6313bfa362177ab2c9 | 765 | py | Python | uno/parser/data_formatter.py | elbow-jason/Uno | 4ad07d7b84e5b6e3e2b2c89db69448906f24b4e4 | [
"MIT"
] | null | null | null | uno/parser/data_formatter.py | elbow-jason/Uno | 4ad07d7b84e5b6e3e2b2c89db69448906f24b4e4 | [
"MIT"
] | 3 | 2015-11-09T19:25:22.000Z | 2016-06-07T15:02:03.000Z | uno/parser/data_formatter.py | elbow-jason/Uno | 4ad07d7b84e5b6e3e2b2c89db69448906f24b4e4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
| 23.90625 | 62 | 0.546405 | # -*- coding: utf-8 -*-
class DataFormatter(object):
def __init__(self, parent_obj):
self.parent = parent_obj
self.prep_funcs = {}
def css(self, info):
info['data']['stack'] = info['stack']
return info['data']
def element(self, info):
varname = info['data']+'_'+... | 568 | 7 | 162 |
93733fd422faf9864a64ea3871e93d8416c5016c | 2,315 | py | Python | framework/denoising_ae.py | mullachv/causal_notes | 509e1f5c9f793697949a3a6f6bfc53df85e7e9f6 | [
"Apache-2.0"
] | null | null | null | framework/denoising_ae.py | mullachv/causal_notes | 509e1f5c9f793697949a3a6f6bfc53df85e7e9f6 | [
"Apache-2.0"
] | null | null | null | framework/denoising_ae.py | mullachv/causal_notes | 509e1f5c9f793697949a3a6f6bfc53df85e7e9f6 | [
"Apache-2.0"
] | null | null | null | from keras.models import Model, Input
from keras.layers import Conv2D, MaxPooling2D, UpSampling2D
input_img = Input(shape=(28, 28, 1)) #adapt this if using 'channels_first' image data format
x = Conv2D(16, (3,3), activation='relu', padding='same')(input_img)
x = MaxPooling2D((2,2), padding='same')(x)
x = Conv2D(8, (3,... | 35.615385 | 92 | 0.716631 | from keras.models import Model, Input
from keras.layers import Conv2D, MaxPooling2D, UpSampling2D
input_img = Input(shape=(28, 28, 1)) #adapt this if using 'channels_first' image data format
x = Conv2D(16, (3,3), activation='relu', padding='same')(input_img)
x = MaxPooling2D((2,2), padding='same')(x)
x = Conv2D(8, (3,... | 0 | 0 | 0 |
bbab49c0b434c15386e83c23f5d47ddeeb11552d | 2,942 | py | Python | stdlib2-src/dist-packages/reportbug/tempfiles.py | ch1huizong/Scode | c34fb9d0f9b73fe199ba370f2e3ffb30b8f70895 | [
"MIT"
] | null | null | null | stdlib2-src/dist-packages/reportbug/tempfiles.py | ch1huizong/Scode | c34fb9d0f9b73fe199ba370f2e3ffb30b8f70895 | [
"MIT"
] | null | null | null | stdlib2-src/dist-packages/reportbug/tempfiles.py | ch1huizong/Scode | c34fb9d0f9b73fe199ba370f2e3ffb30b8f70895 | [
"MIT"
] | null | null | null | #
# tempfiles module - Temporary file handling for reportbug
# Written by Chris Lawrence <lawrencc@debian.org>
# (C) 1999-2008 Chris Lawrence
# Copyright (C) 2008-2014 Sandro Tosi <morph@debian.org>
#
# This program is freely distributable per the following license:
#
## Permission to use, copy, modify, and dist... | 33.05618 | 76 | 0.683549 | #
# tempfiles module - Temporary file handling for reportbug
# Written by Chris Lawrence <lawrencc@debian.org>
# (C) 1999-2008 Chris Lawrence
# Copyright (C) 2008-2014 Sandro Tosi <morph@debian.org>
#
# This program is freely distributable per the following license:
#
## Permission to use, copy, modify, and dist... | 813 | 0 | 67 |
c1c5ff9841f79fb080b06c5b2053a7f792f463b6 | 902 | py | Python | app/tasks/scheduler.py | d3vzer0/reternal-backend | aeeb613c820759212e7aef9150738a66b2882d50 | [
"MIT"
] | 6 | 2019-01-01T23:38:12.000Z | 2021-07-27T03:43:11.000Z | app/tasks/scheduler.py | d3vzer0/reternal-backend | aeeb613c820759212e7aef9150738a66b2882d50 | [
"MIT"
] | 1 | 2020-08-02T00:21:41.000Z | 2020-08-02T00:21:41.000Z | app/tasks/scheduler.py | d3vzer0/reternal-backend | aeeb613c820759212e7aef9150738a66b2882d50 | [
"MIT"
] | 1 | 2021-07-27T03:43:24.000Z | 2021-07-27T03:43:24.000Z | from app.database.models import Tasks
from datetime import datetime, timedelta
from bson.json_util import dumps
from typing import List, Dict
import uuid
import json
async def get_task_next():
''' Calculate the next task to be executed, following the graph dependencies '''
pipeline = [ {"$unwind": { "path": "... | 53.058824 | 153 | 0.579823 | from app.database.models import Tasks
from datetime import datetime, timedelta
from bson.json_util import dumps
from typing import List, Dict
import uuid
import json
async def get_task_next():
''' Calculate the next task to be executed, following the graph dependencies '''
pipeline = [ {"$unwind": { "path": "... | 0 | 0 | 0 |
a3008a62c6eb001a110dd05b38bde4b6d5807fa7 | 1,267 | py | Python | tests/records/test_request_numberseq.py | Pineirin/invenio-requests | 7eb85365128e4189e4c81d154e8918b09aae033d | [
"MIT"
] | null | null | null | tests/records/test_request_numberseq.py | Pineirin/invenio-requests | 7eb85365128e4189e4c81d154e8918b09aae033d | [
"MIT"
] | 87 | 2021-11-08T12:58:56.000Z | 2022-03-29T08:52:48.000Z | tests/records/test_request_numberseq.py | Pineirin/invenio-requests | 7eb85365128e4189e4c81d154e8918b09aae033d | [
"MIT"
] | 10 | 2021-11-04T19:15:37.000Z | 2022-02-21T09:27:07.000Z | # -*- coding: utf-8 -*-
#
# Copyright (C) 2021 CERN.
# Copyright (C) 2021 Northwestern University.
# Copyright (C) 2021 TU Wien.
#
# Invenio-Requests is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Request number identifier model te... | 30.166667 | 77 | 0.696133 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2021 CERN.
# Copyright (C) 2021 Northwestern University.
# Copyright (C) 2021 TU Wien.
#
# Invenio-Requests is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Request number identifier model te... | 0 | 0 | 0 |
82d1d026a48ba1eda96f2974a8ae1957554f0fe9 | 350 | py | Python | tests/test__primitives.py | pvk-developer/MLBlocks | e804508faf55136040cb749a8559cc8383d885e6 | [
"MIT"
] | null | null | null | tests/test__primitives.py | pvk-developer/MLBlocks | e804508faf55136040cb749a8559cc8383d885e6 | [
"MIT"
] | null | null | null | tests/test__primitives.py | pvk-developer/MLBlocks | e804508faf55136040cb749a8559cc8383d885e6 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import os
from mock import patch
from mlblocks import primitives
@patch('mlblocks.primitives._PRIMITIVES_PATHS', new=['a', 'b'])
| 20.588235 | 68 | 0.714286 | # -*- coding: utf-8 -*-
import os
from mock import patch
from mlblocks import primitives
@patch('mlblocks.primitives._PRIMITIVES_PATHS', new=['a', 'b'])
def test_add_primitives_path():
primitives.add_primitives_path('tests')
expected_path = os.path.abspath('tests')
assert primitives._PRIMITIVES_PATHS... | 170 | 0 | 22 |
d908a6ba948a8f8c7d71e74b372e121a7335bc26 | 4,379 | py | Python | diagnosis.py | ElsevierSoftwareX/SOFTX-D-21-00183 | bef6481ea69445a773bc72ce3c9a7d5fbf82e834 | [
"MIT"
] | 1 | 2021-08-24T12:11:34.000Z | 2021-08-24T12:11:34.000Z | diagnosis.py | ElsevierSoftwareX/SOFTX-D-21-00183 | bef6481ea69445a773bc72ce3c9a7d5fbf82e834 | [
"MIT"
] | null | null | null | diagnosis.py | ElsevierSoftwareX/SOFTX-D-21-00183 | bef6481ea69445a773bc72ce3c9a7d5fbf82e834 | [
"MIT"
] | 2 | 2022-02-02T23:49:52.000Z | 2022-03-13T21:05:15.000Z | from math import isclose
import csv
import matplotlib.pyplot as plt
if __name__ == '__main__':
y = []
with open('test_loss.csv', 'r') as f:
reader = csv.reader(f)
for row in reader:
y.append(float(row[2]))
d = diagnosis()
res = d.smooth(y)
up = []
down = []
... | 33.684615 | 120 | 0.509934 | from math import isclose
import csv
import matplotlib.pyplot as plt
class diagnosis:
def __init__(self):
self.issues = []
self.epsilon_1 = 0.35
self.epsilon_2 = 0.45
self.weight = 0.6
def reset_diagnosis(self):
self.issues = []
def setting_overfitting_tollerance(s... | 487 | 3,300 | 23 |
4e23d593adaff6d57dbb246ab573b661fa7868df | 8,443 | py | Python | ngVLA/test2.py | teuben/QAC | 7ec92dcdfdeb1b71dd13bd6fd47f29b634b7a488 | [
"MIT"
] | 1 | 2019-10-12T03:31:49.000Z | 2019-10-12T03:31:49.000Z | ngVLA/test2.py | lizhangscience/QAC | cd8d7573b49d3c2cc4442c711287450f89c278ea | [
"MIT"
] | 9 | 2018-03-08T03:48:28.000Z | 2020-11-18T21:47:56.000Z | ngVLA/test2.py | lizhangscience/QAC | cd8d7573b49d3c2cc4442c711287450f89c278ea | [
"MIT"
] | 2 | 2019-01-20T15:37:15.000Z | 2019-08-15T07:58:13.000Z | """
ngVLA simulated observation of input galaxy model
feathering INT with 45 and 18 m single dish for TP
Variable Description Default value Notes
--------------------------------------------------------------------------------
model input model model0
imsize_m mod... | 37.691964 | 141 | 0.656046 | """
ngVLA simulated observation of input galaxy model
feathering INT with 45 and 18 m single dish for TP
Variable Description Default value Notes
--------------------------------------------------------------------------------
model input model model0
imsize_m mod... | 0 | 0 | 0 |
09bc86ee836da34faa68b902d27e4a63a60840a1 | 594 | py | Python | idiomfinder/validator/__init__.py | davidygs/idiom-finder-service | b8e37e5c12cdf3a7788527e601df6eff1a66a326 | [
"MIT"
] | null | null | null | idiomfinder/validator/__init__.py | davidygs/idiom-finder-service | b8e37e5c12cdf3a7788527e601df6eff1a66a326 | [
"MIT"
] | null | null | null | idiomfinder/validator/__init__.py | davidygs/idiom-finder-service | b8e37e5c12cdf3a7788527e601df6eff1a66a326 | [
"MIT"
] | null | null | null | import pkgutil
from sanic.log import logger
IDIOM_PACKAGE = 'idiomfinder.validator'
IDIOM_FILE = 'data/idioms.3w.txt'
class IdiomValidator:
"""
IdiomValidator examines a given string to see if it is a Chinese idiom. It does so by searching
against a list of known idioms.
"""
| 27 | 99 | 0.686869 | import pkgutil
from sanic.log import logger
IDIOM_PACKAGE = 'idiomfinder.validator'
IDIOM_FILE = 'data/idioms.3w.txt'
class IdiomValidator:
"""
IdiomValidator examines a given string to see if it is a Chinese idiom. It does so by searching
against a list of known idioms.
"""
def __init__(self):... | 244 | 0 | 54 |
e445f81e7dff04acf2707f6201ff7c7bf141585e | 794 | py | Python | bounties/utils.py | auggernaut/taco-bounty-slack-app | 71a61b1beb1c6583f804a859f62f6a852819860c | [
"MIT"
] | 8 | 2019-11-10T13:42:21.000Z | 2022-01-05T07:43:25.000Z | bounties/utils.py | auggernaut/taco-bounty-slack-app | 71a61b1beb1c6583f804a859f62f6a852819860c | [
"MIT"
] | null | null | null | bounties/utils.py | auggernaut/taco-bounty-slack-app | 71a61b1beb1c6583f804a859f62f6a852819860c | [
"MIT"
] | 3 | 2020-03-23T21:05:48.000Z | 2022-02-02T14:12:11.000Z | import hmac, hashlib
| 29.407407 | 105 | 0.559194 | import hmac, hashlib
def verify(request, secret):
body = request.get_data()
timestamp = request.headers['X-Slack-Request-Timestamp']
sig_basestring = 'v0:%s:%s' % (timestamp, body.decode('utf-8'))
computed_sha = hmac.new(secret, sig_basestring.encode('utf-8'), digestmod=hashlib.sha256).hexdigest()
... | 726 | 0 | 46 |
17cce6f74a3e02078b98987b0a6a3606f5137b2b | 27 | py | Python | studip_sync/ZipFileLongPaths.py | PHKA-ZIM/StudIPSync | 8bc87bfd04d58e7de9212ce72cc324d046ff73f9 | [
"Unlicense"
] | null | null | null | studip_sync/ZipFileLongPaths.py | PHKA-ZIM/StudIPSync | 8bc87bfd04d58e7de9212ce72cc324d046ff73f9 | [
"Unlicense"
] | null | null | null | studip_sync/ZipFileLongPaths.py | PHKA-ZIM/StudIPSync | 8bc87bfd04d58e7de9212ce72cc324d046ff73f9 | [
"Unlicense"
] | null | null | null | import os
import zipfile
| 5.4 | 14 | 0.777778 | import os
import zipfile
| 0 | 0 | 0 |
680cd10d14759a44885128410c90eb2cfcf513c2 | 102 | py | Python | robot/Cumulus/resources/locators_46.py | thombehrens/Cumulus | 282e623e9134ed1d20a81ea051e98657fa272e50 | [
"BSD-3-Clause"
] | null | null | null | robot/Cumulus/resources/locators_46.py | thombehrens/Cumulus | 282e623e9134ed1d20a81ea051e98657fa272e50 | [
"BSD-3-Clause"
] | null | null | null | robot/Cumulus/resources/locators_46.py | thombehrens/Cumulus | 282e623e9134ed1d20a81ea051e98657fa272e50 | [
"BSD-3-Clause"
] | null | null | null | """Locators for Summer '19"""
from locators_47 import *
npsp_lex_locators = npsp_lex_locators.copy() | 20.4 | 44 | 0.764706 | """Locators for Summer '19"""
from locators_47 import *
npsp_lex_locators = npsp_lex_locators.copy() | 0 | 0 | 0 |
a91e1b5f05f553d328086a8fa62223417904e812 | 1,993 | py | Python | app/account/tests/factories.py | rogeriopaulos/gep | e56fd0450bdb8f572e2e35cc59a74ab0f0b372e2 | [
"MIT"
] | null | null | null | app/account/tests/factories.py | rogeriopaulos/gep | e56fd0450bdb8f572e2e35cc59a74ab0f0b372e2 | [
"MIT"
] | 2 | 2021-09-02T04:22:45.000Z | 2021-09-02T04:52:26.000Z | app/account/tests/factories.py | rogeriopaulos/gep | e56fd0450bdb8f572e2e35cc59a74ab0f0b372e2 | [
"MIT"
] | 1 | 2021-09-15T02:16:38.000Z | 2021-09-15T02:16:38.000Z | from random import choice
from account.models import Cargo, Orgao, Profile
from account.utils import CARGOS, INSTITUICOES
from django.contrib.auth import get_user_model
from django.db.models.signals import post_save
from factory import DjangoModelFactory, Faker, Sequence, SubFactory, django
User = get_user_model()
... | 29.308824 | 106 | 0.696939 | from random import choice
from account.models import Cargo, Orgao, Profile
from account.utils import CARGOS, INSTITUICOES
from django.contrib.auth import get_user_model
from django.db.models.signals import post_save
from factory import DjangoModelFactory, Faker, Sequence, SubFactory, django
User = get_user_model()
... | 0 | 1,515 | 90 |
b1889e9f50f444b20ee0fad7eb0a09d800ddd5ea | 694 | py | Python | universal_computation/datasets/helpers/annotations.py | jasonjewik/universal-computation | e3ed93c970e918826395b80695bed6677d66f819 | [
"MIT"
] | null | null | null | universal_computation/datasets/helpers/annotations.py | jasonjewik/universal-computation | e3ed93c970e918826395b80695bed6677d66f819 | [
"MIT"
] | null | null | null | universal_computation/datasets/helpers/annotations.py | jasonjewik/universal-computation | e3ed93c970e918826395b80695bed6677d66f819 | [
"MIT"
] | null | null | null | import pandas as pd
import os
import pathlib
from pathlib import Path
data = 'data/2750'
df = pd.DataFrame(columns=['label', 'int_label', 'img_name'])
labels_dict = {}
counter = 0
for subdir in os.listdir(data):
labels_dict[subdir] = counter
filepath = os.path.join(data,subdir)
if os.path.isdir(filepath):... | 28.916667 | 88 | 0.675793 | import pandas as pd
import os
import pathlib
from pathlib import Path
data = 'data/2750'
df = pd.DataFrame(columns=['label', 'int_label', 'img_name'])
labels_dict = {}
counter = 0
for subdir in os.listdir(data):
labels_dict[subdir] = counter
filepath = os.path.join(data,subdir)
if os.path.isdir(filepath):... | 0 | 0 | 0 |
025f7792b212427f09460648d68263764bb88a7f | 16,551 | py | Python | src/visualise_network.py | WilsonGroupOxford/Network-Monte-Carlo | f535b4daadd3a2e64a8840eca7e75618b8e8c1ac | [
"MIT"
] | null | null | null | src/visualise_network.py | WilsonGroupOxford/Network-Monte-Carlo | f535b4daadd3a2e64a8840eca7e75618b8e8c1ac | [
"MIT"
] | null | null | null | src/visualise_network.py | WilsonGroupOxford/Network-Monte-Carlo | f535b4daadd3a2e64a8840eca7e75618b8e8c1ac | [
"MIT"
] | 1 | 2021-08-06T10:18:11.000Z | 2021-08-06T10:18:11.000Z | import numpy as np
import sys
import matplotlib.pyplot as plt
from matplotlib.patches import Polygon
from matplotlib.collections import PatchCollection
from matplotlib import cm
from matplotlib.colors import ListedColormap, LinearSegmentedColormap, Normalize
import matplotlib.pylab as pylab
main()
| 36.861915 | 104 | 0.487886 | import numpy as np
import sys
import matplotlib.pyplot as plt
from matplotlib.patches import Polygon
from matplotlib.collections import PatchCollection
from matplotlib import cm
from matplotlib.colors import ListedColormap, LinearSegmentedColormap, Normalize
import matplotlib.pylab as pylab
class Network:
def __i... | 15,862 | -7 | 392 |
23b9bd9500e0618a286de290677513c151a3c930 | 4,336 | py | Python | MMIST_handwrite.py | sabersword/CNN | 60a830d21eb95279ef05b3f70bf684a578f5f132 | [
"Apache-2.0"
] | null | null | null | MMIST_handwrite.py | sabersword/CNN | 60a830d21eb95279ef05b3f70bf684a578f5f132 | [
"Apache-2.0"
] | null | null | null | MMIST_handwrite.py | sabersword/CNN | 60a830d21eb95279ef05b3f70bf684a578f5f132 | [
"Apache-2.0"
] | null | null | null | # load MNIST data
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
# start tensorflow interactiveSession
import tensorflow as tf
sess = tf.InteractiveSession()
# weight initialization
# tf.truncated_normal(shape, mean=0.0, stddev=1.0, dtype=tf.f... | 37.059829 | 190 | 0.751153 | # load MNIST data
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
# start tensorflow interactiveSession
import tensorflow as tf
sess = tf.InteractiveSession()
# weight initialization
# tf.truncated_normal(shape, mean=0.0, stddev=1.0, dtype=tf.f... | 348 | 0 | 89 |
5e6cf9f8addc053623b9473809153c5e4924f892 | 235 | py | Python | locustfile.py | DocLabyrinth/docker-consul-experiments | 0987dc38e8594fafb2e212d01b9ab839227e3e7f | [
"MIT"
] | null | null | null | locustfile.py | DocLabyrinth/docker-consul-experiments | 0987dc38e8594fafb2e212d01b9ab839227e3e7f | [
"MIT"
] | null | null | null | locustfile.py | DocLabyrinth/docker-consul-experiments | 0987dc38e8594fafb2e212d01b9ab839227e3e7f | [
"MIT"
] | null | null | null | from locust import HttpLocust, TaskSet, task
| 18.076923 | 44 | 0.685106 | from locust import HttpLocust, TaskSet, task
class UserBehavior(TaskSet):
@task(2)
def index(self):
self.client.get("/")
class WebsiteUser(HttpLocust):
task_set = UserBehavior
min_wait=5000
max_wait=9000
| 24 | 120 | 46 |
f2f56836be5a2cbbaf62be0f039b0682e9b2a88e | 2,028 | py | Python | Leetcode/705#_Design hashset_06123901.py | Maddiezheng/MyLearningNote | aec12ad3936bbdd377500256b9cf7628c16c3dc7 | [
"MIT"
] | null | null | null | Leetcode/705#_Design hashset_06123901.py | Maddiezheng/MyLearningNote | aec12ad3936bbdd377500256b9cf7628c16c3dc7 | [
"MIT"
] | null | null | null | Leetcode/705#_Design hashset_06123901.py | Maddiezheng/MyLearningNote | aec12ad3936bbdd377500256b9cf7628c16c3dc7 | [
"MIT"
] | 1 | 2019-10-23T08:30:57.000Z | 2019-10-23T08:30:57.000Z |
# Your MyHashSet object will be instantiated and called as such:
# obj = MyHashSet()
# obj.add(key)
# obj.remove(key)
# param_3 = obj.contains(key)
| 31.2 | 101 | 0.475838 | class Node:
def __init__(self,val):
self.val = val
self.next = None
class MyHashSet:
def __init__(self,size=1000):
"""
Initialize your data structure here.
"""
self.size = size
self.hash = [None]*self.size #每一個hashset都是鏈表
def add(self... | 1,575 | 576 | 79 |
9572e49eafcacea259f02a85c2b4f743776a8719 | 3,794 | py | Python | src/processing/QC.py | jchylik/how-to-joanne | b13f916fba6e997640ac5a71ae4a57033cc59054 | [
"MIT"
] | null | null | null | src/processing/QC.py | jchylik/how-to-joanne | b13f916fba6e997640ac5a71ae4a57033cc59054 | [
"MIT"
] | null | null | null | src/processing/QC.py | jchylik/how-to-joanne | b13f916fba6e997640ac5a71ae4a57033cc59054 | [
"MIT"
] | null | null | null | # Python file to run QC over ASPEN-processed files and output "good" sondes for input to Level-3
import datetime
import glob
import os
import sys
import warnings
import numpy as np
import pandas as pd
import xarray as xr
import joanne
from joanne.Level_2 import fn_2 as f2
Platform = 'HALO'
data_dir = 'extra/Sampl... | 26.71831 | 96 | 0.66816 | # Python file to run QC over ASPEN-processed files and output "good" sondes for input to Level-3
import datetime
import glob
import os
import sys
import warnings
import numpy as np
import pandas as pd
import xarray as xr
import joanne
from joanne.Level_2 import fn_2 as f2
Platform = 'HALO'
def get_all_sondes_list(... | 1,183 | 0 | 23 |
7064bb8b8cb510c6bb101420a36a0a79c2129efd | 3,696 | py | Python | tools/scoring/score/dimensions/entity_connection_identification.py | samkenxstream/digitalbuildings | 59ca7adeccf762810349927b44bc8f2bbeafa65b | [
"Apache-2.0"
] | null | null | null | tools/scoring/score/dimensions/entity_connection_identification.py | samkenxstream/digitalbuildings | 59ca7adeccf762810349927b44bc8f2bbeafa65b | [
"Apache-2.0"
] | 1 | 2021-10-22T02:32:33.000Z | 2021-10-22T02:32:33.000Z | tools/scoring/score/dimensions/entity_connection_identification.py | josephedwardchang/digitalbuildings | cf412172fa8577392cf0447511589fbbb6792809 | [
"Apache-2.0"
] | null | null | null | # Copyright 2022 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, sof... | 38.905263 | 75 | 0.734307 | # Copyright 2022 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, sof... | 0 | 0 | 0 |
68f953894d8bcd14c406a74cbb1ca96606f070e8 | 3,765 | py | Python | auth0_login/aws/console.py | virgilwashere/auth0-login | 51e07f028ead84d4e3da799309b591efd2008893 | [
"Apache-2.0"
] | null | null | null | auth0_login/aws/console.py | virgilwashere/auth0-login | 51e07f028ead84d4e3da799309b591efd2008893 | [
"Apache-2.0"
] | 1 | 2019-07-01T09:36:58.000Z | 2019-07-01T09:36:58.000Z | auth0_login/aws/console.py | virgilwashere/auth0-login | 51e07f028ead84d4e3da799309b591efd2008893 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2019 - binx.io B.V.
#
# 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 writ... | 36.553398 | 75 | 0.634529 | #
# Copyright 2019 - binx.io B.V.
#
# 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 writ... | 0 | 0 | 0 |
b87dcffc4f261cd40f2981945e35021e2880e6dc | 3,025 | py | Python | day_09/test_stream_processor.py | anglerud/advent_of_code_2017 | eff27d43cd9eb7c60271887c80cb88f1ae50c48d | [
"MIT"
] | 3 | 2017-12-06T21:23:19.000Z | 2020-04-12T09:49:53.000Z | day_09/test_stream_processor.py | anglerud/advent_of_code_2017 | eff27d43cd9eb7c60271887c80cb88f1ae50c48d | [
"MIT"
] | null | null | null | day_09/test_stream_processor.py | anglerud/advent_of_code_2017 | eff27d43cd9eb7c60271887c80cb88f1ae50c48d | [
"MIT"
] | null | null | null | # coding: utf-8
"""
"""
import pytest
import stream_processor as sp
from stream_processor import Token as tk
TOKEN_EXAMPLES = (
(r'<', [tk.START_GARBAGE]),
(r'>', [tk.END_GARBAGE]),
(r'c', [tk.CHARACTER]),
(r'!c', [tk.ESCAPE, tk.CHARACTER]),
(r'{c', [tk.START_GROUP, tk.CHARACTER]),
(r'}', [tk... | 25 | 69 | 0.559339 | # coding: utf-8
"""
"""
import pytest
import stream_processor as sp
from stream_processor import Token as tk
TOKEN_EXAMPLES = (
(r'<', [tk.START_GARBAGE]),
(r'>', [tk.END_GARBAGE]),
(r'c', [tk.CHARACTER]),
(r'!c', [tk.ESCAPE, tk.CHARACTER]),
(r'{c', [tk.START_GROUP, tk.CHARACTER]),
(r'}', [tk... | 0 | 0 | 0 |
925734e46f7fbf08c628ce0bec76d2be3fe31539 | 1,669 | py | Python | main.py | JerryPopi/python_project | 9c4252e5c738871027a149e5e848a274a8c6b4d2 | [
"MIT"
] | null | null | null | main.py | JerryPopi/python_project | 9c4252e5c738871027a149e5e848a274a8c6b4d2 | [
"MIT"
] | null | null | null | main.py | JerryPopi/python_project | 9c4252e5c738871027a149e5e848a274a8c6b4d2 | [
"MIT"
] | null | null | null | import pygame
from pygame.locals import *
from src.classes import *
SPEED = 1
SPEED_BALL = SPEED
BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
screen_size = (800, 640)
pygame.init()
screen = pygame.display.set_mode(screen_size, pygame.RESIZABLE)
pygame.display.set_caption("Pong")
ball = Ball(20)
ball.set_pos((screen_si... | 24.188406 | 99 | 0.682445 | import pygame
from pygame.locals import *
from src.classes import *
SPEED = 1
SPEED_BALL = SPEED
BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
screen_size = (800, 640)
pygame.init()
screen = pygame.display.set_mode(screen_size, pygame.RESIZABLE)
pygame.display.set_caption("Pong")
ball = Ball(20)
ball.set_pos((screen_si... | 0 | 0 | 0 |
c9767622dc4856bb2624ffc0ce9cccd27f403b09 | 58,563 | py | Python | bpmfwfft/grids.py | jimtufts/bpmfwfft | 091d2269b122f00b9dd8a01e34303e3e946f8ea0 | [
"MIT"
] | null | null | null | bpmfwfft/grids.py | jimtufts/bpmfwfft | 091d2269b122f00b9dd8a01e34303e3e946f8ea0 | [
"MIT"
] | null | null | null | bpmfwfft/grids.py | jimtufts/bpmfwfft | 091d2269b122f00b9dd8a01e34303e3e946f8ea0 | [
"MIT"
] | null | null | null |
from __future__ import print_function
import os
import re
import concurrent.futures
import numpy as np
import netCDF4
from mdtraj.geometry import _geometry
from mdtraj.geometry.sasa import _ATOMIC_RADII
try:
from bpmfwfft import IO
try:
from bpmfwfft.util import c_is_in_grid, cdistance, c_co... | 44.131876 | 166 | 0.601728 |
from __future__ import print_function
import os
import re
import concurrent.futures
import numpy as np
import netCDF4
from mdtraj.geometry import _geometry
from mdtraj.geometry.sasa import _ATOMIC_RADII
try:
from bpmfwfft import IO
try:
from bpmfwfft.util import c_is_in_grid, cdistance, c_co... | 13,068 | 0 | 1,003 |
16fa5dd935ae5eb25fa5ea9754f26b7b15a1442a | 1,453 | py | Python | map_maker.py | bfakhri/dml_custom | 1e908b10890df11e510d72c21f3125e3069a0eac | [
"CC-BY-4.0"
] | null | null | null | map_maker.py | bfakhri/dml_custom | 1e908b10890df11e510d72c21f3125e3069a0eac | [
"CC-BY-4.0"
] | null | null | null | map_maker.py | bfakhri/dml_custom | 1e908b10890df11e510d72c21f3125e3069a0eac | [
"CC-BY-4.0"
] | null | null | null | import numpy as np
from random import shuffle
# This makes a map for use in the lau game scripts
#print(make_map(100,200,['A','F','L','S']*80))
#print([str(list(make_map()))])
m = make_map()
for i in range(m.shape[0]):
for j in range(m.shape[1]):
print(m[i,j], end='')
| 29.06 | 66 | 0.619408 | import numpy as np
from random import shuffle
# This makes a map for use in the lau game scripts
def make_map(width=10,length=20,obstacles=['F','L']*32):
num_blanks = width*length - len(obstacles)
obstacles += [' ']*num_blanks
shuffle(obstacles)
# Add goal row
goal_row = [' ']*(width-1)+['G']
... | 1,145 | 0 | 23 |
1b25f1a3b2a28fe52574e457d0a47d877e5765fc | 1,127 | py | Python | tests/test_day5.py | miguellobato84/aoc2021 | c7651c7b273b513ed9399b6bcdc212655e481e98 | [
"MIT"
] | null | null | null | tests/test_day5.py | miguellobato84/aoc2021 | c7651c7b273b513ed9399b6bcdc212655e481e98 | [
"MIT"
] | null | null | null | tests/test_day5.py | miguellobato84/aoc2021 | c7651c7b273b513ed9399b6bcdc212655e481e98 | [
"MIT"
] | null | null | null | import pytest
from aoc.day5 import ex1, ex2
import numpy as np
__author__ = "Miguel Á. Lobato"
__copyright__ = "Miguel Á. Lobato"
__license__ = "MIT"
| 28.175 | 76 | 0.604259 | import pytest
from aoc.day5 import ex1, ex2
import numpy as np
__author__ = "Miguel Á. Lobato"
__copyright__ = "Miguel Á. Lobato"
__license__ = "MIT"
def parse_input(lines):
import re
pattern = re.compile('(\d+),(\d+) -> (\d+),(\d+)')
return [[int(n) for n in m.groups()] for m in map(pattern.match, lin... | 904 | 0 | 69 |
398ad5d49d0b74c899115d1913a8e89f2090c308 | 371 | py | Python | unbfeelings/config/files.py | UnbFeelings/UnbFeelings_api | 73c725113bc89ae4754a68f958eeaae6da85876e | [
"MIT"
] | 1 | 2018-03-18T21:06:00.000Z | 2018-03-18T21:06:00.000Z | unbfeelings/config/files.py | UnbFeelings/UnbFeelings_api | 73c725113bc89ae4754a68f958eeaae6da85876e | [
"MIT"
] | 42 | 2018-04-03T17:30:52.000Z | 2021-06-10T19:44:04.000Z | unbfeelings/config/files.py | UnbFeelings/UnbFeelings_api | 73c725113bc89ae4754a68f958eeaae6da85876e | [
"MIT"
] | 2 | 2018-04-08T00:57:50.000Z | 2018-08-01T19:48:58.000Z | """
Configuration file for static and dynamic files.
https://docs.djangoproject.com/en/2.0/howto/static-files/
"""
import os
BASE_DIR = os.path.dirname(
os.path.dirname(
os.path.abspath(__file__)
)
)
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles/')
STATIC_URL = '/static/'
MEDIA_ROOT = os.path.j... | 18.55 | 57 | 0.692722 | """
Configuration file for static and dynamic files.
https://docs.djangoproject.com/en/2.0/howto/static-files/
"""
import os
BASE_DIR = os.path.dirname(
os.path.dirname(
os.path.abspath(__file__)
)
)
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles/')
STATIC_URL = '/static/'
MEDIA_ROOT = os.path.j... | 0 | 0 | 0 |
e688750bdb47d0767c3b19481e5b1f32932e84c2 | 1,242 | py | Python | src/tests/test_hierarichal_datasets.py | dailai/quick-nlp | d27ae90c0788d0899af7f45b323ca64ed0c33868 | [
"MIT"
] | null | null | null | src/tests/test_hierarichal_datasets.py | dailai/quick-nlp | d27ae90c0788d0899af7f45b323ca64ed0c33868 | [
"MIT"
] | null | null | null | src/tests/test_hierarichal_datasets.py | dailai/quick-nlp | d27ae90c0788d0899af7f45b323ca64ed0c33868 | [
"MIT"
] | null | null | null | import pandas as pd
from torchtext.data import Field
from quicknlp.data.datasets import HierarchicalDatasetFromDataFrame
| 44.357143 | 94 | 0.658615 | import pandas as pd
from torchtext.data import Field
from quicknlp.data.datasets import HierarchicalDatasetFromDataFrame
def test_tabular_dataset_from_dataframe(hierarchical_data):
path, train, valid, test = hierarchical_data
df = pd.read_csv(path / train / "data.tsv", header=None, sep="\t")
df.columns =... | 1,096 | 0 | 23 |
b7efb7456909feb1dc8e8042419cebae98bb241c | 102,264 | py | Python | scripts/ck2cti.py | wittregr/openmkm | 58efabaffb4235641c079b86fe05afe356b3620d | [
"MIT"
] | 3 | 2019-11-09T14:57:29.000Z | 2020-10-26T07:37:15.000Z | scripts/ck2cti.py | wittregr/openmkm | 58efabaffb4235641c079b86fe05afe356b3620d | [
"MIT"
] | 39 | 2019-12-09T13:55:34.000Z | 2021-11-03T00:59:53.000Z | scripts/ck2cti.py | wittregr/openmkm | 58efabaffb4235641c079b86fe05afe356b3620d | [
"MIT"
] | 8 | 2019-12-08T18:52:45.000Z | 2021-05-27T17:49:13.000Z | #!/usr/bin/env python
# encoding: utf-8
################################################################################
#
# Copyright (c) 2009-2011 by the RMG Team (rmg_dev@mit.edu)
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation f... | 42.257851 | 184 | 0.498934 | #!/usr/bin/env python
# encoding: utf-8
################################################################################
#
# Copyright (c) 2009-2011 by the RMG Team (rmg_dev@mit.edu)
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation f... | 34,260 | 46,412 | 1,434 |
b769105f9a5f6c08ad96aaa9781d3118591c7cca | 1,814 | py | Python | bioexcel_align/rungatk.py | djwhiteastro/BioExcel_Align | 7a7bd984ffc6b1141fa6cc08ac64a1b4463f25a5 | [
"Apache-2.0"
] | null | null | null | bioexcel_align/rungatk.py | djwhiteastro/BioExcel_Align | 7a7bd984ffc6b1141fa6cc08ac64a1b4463f25a5 | [
"Apache-2.0"
] | null | null | null | bioexcel_align/rungatk.py | djwhiteastro/BioExcel_Align | 7a7bd984ffc6b1141fa6cc08ac64a1b4463f25a5 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""
This script runs GATK BaseRecalibrator and/or ApplyBQSR. The script opens a
GATK process with the correct parameters.
"""
import subprocess as sp
import bioexcel_align.alignutils as au
def baserecal(jopts, threads, ref, infile, knownsites, gatkdir, sample):
'''
Create and run comman... | 27.484848 | 83 | 0.6086 | #!/usr/bin/env python
"""
This script runs GATK BaseRecalibrator and/or ApplyBQSR. The script opens a
GATK process with the correct parameters.
"""
import subprocess as sp
import bioexcel_align.alignutils as au
def baserecal(jopts, threads, ref, infile, knownsites, gatkdir, sample):
'''
Create and run comman... | 0 | 0 | 0 |
7dbdf29136875af2c08ebe386210ffce4d1ff42b | 4,560 | py | Python | Pyrado/pyrado/environments/quanser/quanser_ball_balancer.py | KhanhThiVo/SimuRLacra | fdeaf2059c2ed80ea696f018c29290510b5c4cb9 | [
"DOC",
"Zlib",
"BSD-3-Clause"
] | null | null | null | Pyrado/pyrado/environments/quanser/quanser_ball_balancer.py | KhanhThiVo/SimuRLacra | fdeaf2059c2ed80ea696f018c29290510b5c4cb9 | [
"DOC",
"Zlib",
"BSD-3-Clause"
] | null | null | null | Pyrado/pyrado/environments/quanser/quanser_ball_balancer.py | KhanhThiVo/SimuRLacra | fdeaf2059c2ed80ea696f018c29290510b5c4cb9 | [
"DOC",
"Zlib",
"BSD-3-Clause"
] | 1 | 2020-11-24T15:25:26.000Z | 2020-11-24T15:25:26.000Z | # Copyright (c) 2020, Fabio Muratore, Honda Research Institute Europe GmbH, and
# Technical University of Darmstadt.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source ... | 44.271845 | 111 | 0.686184 | # Copyright (c) 2020, Fabio Muratore, Honda Research Institute Europe GmbH, and
# Technical University of Darmstadt.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source ... | 1,433 | 0 | 81 |
7f4e6b280637749d160158c6c129ea495a7156ff | 29 | py | Python | framework/__init__.py | evankanderson/pyfun | dd32bd2e453ef86758bfccca7c1895ad38f1d5bb | [
"Apache-2.0"
] | 3 | 2019-07-23T06:11:32.000Z | 2021-04-28T17:22:14.000Z | framework/__init__.py | evankanderson/pyfun | dd32bd2e453ef86758bfccca7c1895ad38f1d5bb | [
"Apache-2.0"
] | null | null | null | framework/__init__.py | evankanderson/pyfun | dd32bd2e453ef86758bfccca7c1895ad38f1d5bb | [
"Apache-2.0"
] | 2 | 2019-01-23T10:37:12.000Z | 2019-01-24T06:57:30.000Z | from .locate import FindFunc
| 14.5 | 28 | 0.827586 | from .locate import FindFunc
| 0 | 0 | 0 |
a4c71be2050c9b3ed00718cd90f880978b367928 | 25,923 | py | Python | scripts/debruijn_graph.py | seryrzu/centroFlye | b2a4378bc254cc59bf13ae4e802dab478666e079 | [
"BSD-3-Clause"
] | 21 | 2019-09-17T00:53:52.000Z | 2022-03-02T09:27:48.000Z | scripts/debruijn_graph.py | seryrzu/centroFlye | b2a4378bc254cc59bf13ae4e802dab478666e079 | [
"BSD-3-Clause"
] | 14 | 2019-10-10T11:08:42.000Z | 2021-06-28T01:56:31.000Z | scripts/debruijn_graph.py | seryrzu/centroFlye | b2a4378bc254cc59bf13ae4e802dab478666e079 | [
"BSD-3-Clause"
] | 6 | 2019-11-07T14:41:43.000Z | 2021-07-22T23:37:39.000Z | # (c) 2019 by Authors
# This file is a part of centroFlye program.
# Released under the BSD license (see LICENSE file)
from collections import defaultdict, Counter
from itertools import groupby
import os
import subprocess
import statistics
import networkx as nx
import numpy as np
from utils.bio import read_bio_seq, ... | 39.881538 | 98 | 0.56664 | # (c) 2019 by Authors
# This file is a part of centroFlye program.
# Released under the BSD license (see LICENSE file)
from collections import defaultdict, Counter
from itertools import groupby
import os
import subprocess
import statistics
import networkx as nx
import numpy as np
from utils.bio import read_bio_seq, ... | 24,944 | -1 | 572 |
8574ac17f46876dac93bc758d672218f66c25a66 | 6,084 | py | Python | homeassistant/components/shelly/climate.py | EuleMitKeule/core | 3af54d96c7dcc3f7087d1196e6ab0db029301ee7 | [
"Apache-2.0"
] | 2 | 2020-03-22T18:20:15.000Z | 2020-04-22T22:01:48.000Z | homeassistant/components/shelly/climate.py | EuleMitKeule/core | 3af54d96c7dcc3f7087d1196e6ab0db029301ee7 | [
"Apache-2.0"
] | 61 | 2020-12-18T07:13:13.000Z | 2022-03-27T18:11:09.000Z | homeassistant/components/shelly/climate.py | EuleMitKeule/core | 3af54d96c7dcc3f7087d1196e6ab0db029301ee7 | [
"Apache-2.0"
] | 2 | 2020-06-06T21:55:32.000Z | 2022-03-06T04:18:21.000Z | """Climate support for Shelly."""
from __future__ import annotations
import asyncio
import logging
from typing import Any, Final, cast
from aioshelly.block_device import Block
import async_timeout
from homeassistant.components.climate import ClimateEntity
from homeassistant.components.climate.const import (
CURR... | 33.245902 | 87 | 0.667817 | """Climate support for Shelly."""
from __future__ import annotations
import asyncio
import logging
from typing import Any, Final, cast
from aioshelly.block_device import Block
import async_timeout
from homeassistant.components.climate import ClimateEntity
from homeassistant.components.climate.const import (
CURR... | 0 | 0 | 0 |
3133962c00a25035274d3c7589e8a552e79af460 | 9,143 | py | Python | Scripts/simulation/carry/carry_sim_posture.py | velocist/TS4CheatsInfo | b59ea7e5f4bd01d3b3bd7603843d525a9c179867 | [
"Apache-2.0"
] | null | null | null | Scripts/simulation/carry/carry_sim_posture.py | velocist/TS4CheatsInfo | b59ea7e5f4bd01d3b3bd7603843d525a9c179867 | [
"Apache-2.0"
] | null | null | null | Scripts/simulation/carry/carry_sim_posture.py | velocist/TS4CheatsInfo | b59ea7e5f4bd01d3b3bd7603843d525a9c179867 | [
"Apache-2.0"
] | null | null | null | # uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Server\carry\carry_sim_posture.py
# Compiled at: 2017-10-09 20:09:11
# Size of source mod 2**32: 12375 byte... | 60.953333 | 373 | 0.749207 | # uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Server\carry\carry_sim_posture.py
# Compiled at: 2017-10-09 20:09:11
# Size of source mod 2**32: 12375 byte... | 6,431 | 1,338 | 23 |
8c47ca86b2f51e8487cff8272e472d55aeab9bb0 | 420 | py | Python | flexible_reports/templatetags/flexible_reports_tags.py | mpasternak/django-flexible-reports | cdf62590efb2937b30e19952a67afbc3a3e1c192 | [
"MIT"
] | 2 | 2017-08-31T11:55:26.000Z | 2018-07-14T19:39:05.000Z | flexible_reports/templatetags/flexible_reports_tags.py | mpasternak/django-flexible-reports | cdf62590efb2937b30e19952a67afbc3a3e1c192 | [
"MIT"
] | 1 | 2017-08-24T07:04:46.000Z | 2017-09-23T14:39:06.000Z | flexible_reports/templatetags/flexible_reports_tags.py | mpasternak/django-flexible-reports | cdf62590efb2937b30e19952a67afbc3a3e1c192 | [
"MIT"
] | null | null | null | # -*- encoding: utf-8 -*-
from django import template
from django.template.base import Template
from ..adapters import django_tables2
register = template.Library()
@register.simple_tag(takes_context=True)
@register.simple_tag(takes_context=True)
| 23.333333 | 65 | 0.780952 | # -*- encoding: utf-8 -*-
from django import template
from django.template.base import Template
from ..adapters import django_tables2
register = template.Library()
@register.simple_tag(takes_context=True)
def flexible(context, report):
return django_tables2.as_html(report, parent_context=context)
@register.si... | 124 | 0 | 44 |
80c4cf58ac57fe835b1403d834a29cefed0319fd | 10,157 | py | Python | test/test_humbledb/test_array.py | laiyonghao/humbledb | 085991d99bd9f6ce48e33a76b52e7b08bb1da2a4 | [
"Apache-2.0"
] | 26 | 2015-01-11T01:12:15.000Z | 2022-03-26T04:09:05.000Z | test/test_humbledb/test_array.py | laiyonghao/humbledb | 085991d99bd9f6ce48e33a76b52e7b08bb1da2a4 | [
"Apache-2.0"
] | 7 | 2015-03-16T12:49:33.000Z | 2018-03-07T00:45:30.000Z | test/test_humbledb/test_array.py | laiyonghao/humbledb | 085991d99bd9f6ce48e33a76b52e7b08bb1da2a4 | [
"Apache-2.0"
] | 6 | 2015-06-05T01:55:36.000Z | 2021-06-04T16:37:39.000Z | import random
from six.moves import xrange
from humbledb import Document
from humbledb.array import Array
from test.util import (database_name, DBTest, ok_, eq_, enable_sharding,
SkipTest, raises)
def _word():
""" Return a random "word". """
return str(random.randint(1, 15000))
@... | 25.203474 | 77 | 0.5605 | import random
from six.moves import xrange
from humbledb import Document
from humbledb.array import Array
from test.util import (database_name, DBTest, ok_, eq_, enable_sharding,
SkipTest, raises)
class TestArray(Array):
config_database = database_name()
config_collection = 'arrays'
config_max_s... | 8,733 | 122 | 821 |
d12730e600dffe3a6e1ae15818ba334f43efdb0b | 344 | py | Python | tests/cases/demorgan.py | MiguelMarcelino/py2many | 9b040b2a157e265df9c053eaf3e5cd644d3e30d0 | [
"MIT"
] | 2 | 2022-02-02T11:37:53.000Z | 2022-03-30T18:19:06.000Z | tests/cases/demorgan.py | MiguelMarcelino/py2many | 9b040b2a157e265df9c053eaf3e5cd644d3e30d0 | [
"MIT"
] | 25 | 2022-02-28T21:19:11.000Z | 2022-03-23T21:26:20.000Z | tests/cases/demorgan.py | MiguelMarcelino/py2many | 9b040b2a157e265df9c053eaf3e5cd644d3e30d0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from py2many.smt import check_sat
assert demorgan(True, True)
assert demorgan(True, False)
assert demorgan(False, True)
assert demorgan(False, False)
# assert not demorgan # Should fail if uncommented
# check_sat()
print("OK")
| 22.933333 | 50 | 0.703488 | #!/usr/bin/env python3
from py2many.smt import check_sat
def demorgan(a: bool, b: bool) -> bool:
return (a and b) == (not ((not a) or (not b)))
assert demorgan(True, True)
assert demorgan(True, False)
assert demorgan(False, True)
assert demorgan(False, False)
# assert not demorgan # Should fail if uncommented
# ... | 69 | 0 | 23 |
389d08b6eecde62bc63a47fc193797090d07cd3f | 11,658 | py | Python | code_for_batchgradient_descent/venv/Lib/site-packages/matplotlib/tests/test_polar.py | Sibasish-Padhy/Algo-ScriptML | c0d80a2968ffac2c8d8e3f891144dd91da353f5a | [
"MIT"
] | 603 | 2020-12-23T13:49:32.000Z | 2022-03-31T23:38:03.000Z | code_for_batchgradient_descent/venv/Lib/site-packages/matplotlib/tests/test_polar.py | Sibasish-Padhy/Algo-ScriptML | c0d80a2968ffac2c8d8e3f891144dd91da353f5a | [
"MIT"
] | 387 | 2020-12-15T14:54:04.000Z | 2022-03-31T07:00:21.000Z | code_for_batchgradient_descent/venv/Lib/site-packages/matplotlib/tests/test_polar.py | Sibasish-Padhy/Algo-ScriptML | c0d80a2968ffac2c8d8e3f891144dd91da353f5a | [
"MIT"
] | 35 | 2021-03-26T03:12:04.000Z | 2022-03-23T10:15:10.000Z | import numpy as np
from numpy.testing import assert_allclose
import pytest
import matplotlib as mpl
from matplotlib import pyplot as plt
from matplotlib.testing.decorators import image_comparison, check_figures_equal
@image_comparison(['polar_axes'], style='default', tol=0.012)
@image_comparison(['polar_coords'], ... | 33.213675 | 79 | 0.629267 | import numpy as np
from numpy.testing import assert_allclose
import pytest
import matplotlib as mpl
from matplotlib import pyplot as plt
from matplotlib.testing.decorators import image_comparison, check_figures_equal
@image_comparison(['polar_axes'], style='default', tol=0.012)
def test_polar_annotations():
# Yo... | 9,922 | 0 | 557 |
7c561a0ad992d225c66cecdf2722872a751f090f | 12,769 | py | Python | eAndora/playerWindow.py | JeffHoogland/eandora | 1a49c562ad09bb1f06536adb51579e53a7a08c38 | [
"BSD-3-Clause"
] | 1 | 2018-11-07T06:02:56.000Z | 2018-11-07T06:02:56.000Z | eAndora/playerWindow.py | JeffHoogland/eandora | 1a49c562ad09bb1f06536adb51579e53a7a08c38 | [
"BSD-3-Clause"
] | null | null | null | eAndora/playerWindow.py | JeffHoogland/eandora | 1a49c562ad09bb1f06536adb51579e53a7a08c38 | [
"BSD-3-Clause"
] | null | null | null | import elementary
import evas
import ecore
import urllib
import time
import os
import shutil
import datetime
| 37.666667 | 145 | 0.638813 | import elementary
import evas
import ecore
import urllib
import time
import os
import shutil
import datetime
class playerWindow(elementary.Box):
def __init__( self, parent ):
#Builds an elementary tabel that displays our information
elementary.Box.__init__(self, parent.mainWindow)
#Store t... | 12,127 | 30 | 503 |
846099d36d2c5dab784d4186a7667ada50625b67 | 5,864 | py | Python | research/deep_contextual_bandits/bandits/algorithms/neuralUCB.py | pierreosselin/models | 973d8b7a70ad4d850e7726b88bb674bbd465062f | [
"Apache-2.0"
] | null | null | null | research/deep_contextual_bandits/bandits/algorithms/neuralUCB.py | pierreosselin/models | 973d8b7a70ad4d850e7726b88bb674bbd465062f | [
"Apache-2.0"
] | null | null | null | research/deep_contextual_bandits/bandits/algorithms/neuralUCB.py | pierreosselin/models | 973d8b7a70ad4d850e7726b88bb674bbd465062f | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The TensorFlow 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 applicab... | 47.674797 | 372 | 0.69236 | # Copyright 2018 The TensorFlow 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 applicab... | 0 | 0 | 0 |
bcb15239d4a6eed054b6a3ab98edf8d3fed58227 | 4,199 | py | Python | ToPCLI/Todoist.py | NAndLib/todoist-plugable-cli | 006f9d6f1ccda99c28cf3e1a7da18d93479cb44a | [
"MIT"
] | 6 | 2019-10-21T00:18:59.000Z | 2020-01-08T05:11:43.000Z | ToPCLI/Todoist.py | NAndLib/todoist-plugable-cli | 006f9d6f1ccda99c28cf3e1a7da18d93479cb44a | [
"MIT"
] | null | null | null | ToPCLI/Todoist.py | NAndLib/todoist-plugable-cli | 006f9d6f1ccda99c28cf3e1a7da18d93479cb44a | [
"MIT"
] | 2 | 2019-09-22T02:18:11.000Z | 2019-11-26T21:11:46.000Z | from config import token, cache_dir
from contextlib import contextmanager
import sys
import todoist
CODE_TO_COLORS = {
30 : 'BERRY_RED',
31 : 'RED',
32 : 'ORANGE',
33 : 'YELLOW',
34 : 'OLIVE_GREEN',
35 : 'LIME_GREEN',
36 : 'GREEN',
37 : 'MINT_GREEN',
38 : 'TEAL',
39 : 'SKY_BLUE'... | 24.846154 | 78 | 0.542034 | from config import token, cache_dir
from contextlib import contextmanager
import sys
import todoist
CODE_TO_COLORS = {
30 : 'BERRY_RED',
31 : 'RED',
32 : 'ORANGE',
33 : 'YELLOW',
34 : 'OLIVE_GREEN',
35 : 'LIME_GREEN',
36 : 'GREEN',
37 : 'MINT_GREEN',
38 : 'TEAL',
39 : 'SKY_BLUE'... | 538 | 2,544 | 23 |
54dcfc2501c7b0a5d2379bb8ce65f8bc2a512d50 | 7,326 | py | Python | CalibTracker/SiStripDCS/test/FilterTrackerOn_cfg.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | CalibTracker/SiStripDCS/test/FilterTrackerOn_cfg.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | CalibTracker/SiStripDCS/test/FilterTrackerOn_cfg.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | import FWCore.ParameterSet.Config as cms
process = cms.Process("SynchronizeDCSO2O")
process.load("FWCore.MessageService.MessageLogger_cfi")
process.maxEvents = cms.untracked.PSet(
input = cms.untracked.int32(100)
)
process.poolDBESSource = cms.ESSource("PoolDBESSource",
BlobStreamerName = cms.untracked.strin... | 68.46729 | 139 | 0.78433 | import FWCore.ParameterSet.Config as cms
process = cms.Process("SynchronizeDCSO2O")
process.load("FWCore.MessageService.MessageLogger_cfi")
process.maxEvents = cms.untracked.PSet(
input = cms.untracked.int32(100)
)
process.poolDBESSource = cms.ESSource("PoolDBESSource",
BlobStreamerName = cms.untracked.strin... | 0 | 0 | 0 |
df518506ab8552c979397708cba84b2cb4e1c55d | 4,854 | py | Python | database/crawler/crawl_plantlist.py | tttor/csipb-jamu-prj | 33b08a8a12054c8a5a7240681a28c8b233b329ba | [
"MIT"
] | 5 | 2017-03-31T03:25:09.000Z | 2021-12-17T02:28:24.000Z | database/crawler/crawl_plantlist.py | tttor/csipb-jamu-prj | 33b08a8a12054c8a5a7240681a28c8b233b329ba | [
"MIT"
] | 165 | 2016-08-11T01:59:47.000Z | 2017-10-10T06:32:12.000Z | database/crawler/crawl_plantlist.py | tttor/csipb-jamu-prj | 33b08a8a12054c8a5a7240681a28c8b233b329ba | [
"MIT"
] | 11 | 2015-06-15T04:25:59.000Z | 2021-04-18T09:39:16.000Z | # crawl_plantlist.py
import glob
import time
import json
import datetime
import yaml
from urllib2 import urlopen
from bs4 import BeautifulSoup
if __name__ == '__main__':
start_time = time.time()
main()
print("--- %s seconds ---" % (time.time() - start_time))
| 31.519481 | 121 | 0.519778 | # crawl_plantlist.py
import glob
import time
import json
import datetime
import yaml
from urllib2 import urlopen
from bs4 import BeautifulSoup
def main():
# dirpath = '/home/tor/robotics/prj/csipb-jamu-prj/dataset/plant-list'
# parseMiscPlantList(dirpath)
latin2idr = None
with open('/home/tor/robotics... | 4,513 | 0 | 69 |
41799e74f2525484085dec098d110842a9dd3c57 | 6,709 | py | Python | john_doe/names/lithuania.py | xioren/JohnDoe | 4bd16f394709cac246438c8ffd650b4b301cb2b7 | [
"MIT"
] | null | null | null | john_doe/names/lithuania.py | xioren/JohnDoe | 4bd16f394709cac246438c8ffd650b4b301cb2b7 | [
"MIT"
] | null | null | null | john_doe/names/lithuania.py | xioren/JohnDoe | 4bd16f394709cac246438c8ffd650b4b301cb2b7 | [
"MIT"
] | null | null | null | male = [
'ADOMAS',
'ALBERTAS',
'ALEKSANDRAS',
'ALFREDAS',
'ANDRIUS',
'ANTANAS',
'ARAS',
'ARNOLDAS',
'ARONAS',
'ARTŪRAS',
'AUGUSTAS',
'AUGUSTINAS',
'AURELIJUS',
'ĄŽUOLAS',
'BENAS',
'BENEDIKTAS',
'BENJAMINAS',
'BRONISLOVAS',
'BRONIUS',
'DANIE... | 16.166265 | 24 | 0.512893 | male = [
'ADOMAS',
'ALBERTAS',
'ALEKSANDRAS',
'ALFREDAS',
'ANDRIUS',
'ANTANAS',
'ARAS',
'ARNOLDAS',
'ARONAS',
'ARTŪRAS',
'AUGUSTAS',
'AUGUSTINAS',
'AURELIJUS',
'ĄŽUOLAS',
'BENAS',
'BENEDIKTAS',
'BENJAMINAS',
'BRONISLOVAS',
'BRONIUS',
'DANIE... | 0 | 0 | 0 |
fc821d98b610296c4af0290c0de3d150b92e4d33 | 1,103 | py | Python | src/der_py/clients/wiki.py | rarescosma/der-py | ac67039d530e090977683d688733591bf5f2912e | [
"MIT"
] | null | null | null | src/der_py/clients/wiki.py | rarescosma/der-py | ac67039d530e090977683d688733591bf5f2912e | [
"MIT"
] | null | null | null | src/der_py/clients/wiki.py | rarescosma/der-py | ac67039d530e090977683d688733591bf5f2912e | [
"MIT"
] | null | null | null | """Client for the Wikipedia REST API."""
from dataclasses import dataclass
from functools import lru_cache
from typing import Type
import click
import requests
from desert import schema
from marshmallow import EXCLUDE, Schema, ValidationError
API_URL: str = (
"https://{language}.wikipedia.org/api/rest_v1/page/ran... | 25.068182 | 73 | 0.679057 | """Client for the Wikipedia REST API."""
from dataclasses import dataclass
from functools import lru_cache
from typing import Type
import click
import requests
from desert import schema
from marshmallow import EXCLUDE, Schema, ValidationError
API_URL: str = (
"https://{language}.wikipedia.org/api/rest_v1/page/ran... | 60 | 0 | 22 |
41d7c419c5b8bb109b110c4abc4f774582dc34b3 | 2,358 | py | Python | cornac/models/wmf/wmf.py | carmanzhang/cornac | 215efd0ffa7b8ee1afe1ac6b5cc650ee6303ace3 | [
"Apache-2.0"
] | 597 | 2018-07-17T10:59:56.000Z | 2022-03-31T07:59:36.000Z | cornac/models/wmf/wmf.py | carmanzhang/cornac | 215efd0ffa7b8ee1afe1ac6b5cc650ee6303ace3 | [
"Apache-2.0"
] | 137 | 2018-10-12T10:52:11.000Z | 2022-03-04T15:26:49.000Z | cornac/models/wmf/wmf.py | carmanzhang/cornac | 215efd0ffa7b8ee1afe1ac6b5cc650ee6303ace3 | [
"Apache-2.0"
] | 112 | 2018-07-26T04:36:34.000Z | 2022-03-31T02:29:34.000Z | # Copyright 2018 The Cornac 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 applicable ... | 42.107143 | 104 | 0.652248 | # Copyright 2018 The Cornac 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 applicable ... | 1,581 | -9 | 77 |