hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | 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 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
23ce1b81b906961abaea12ec740c3147c1521e93 | 991 | py | Python | Two_Pointers/521.py | wilbertgeng/LintCode_exercise | e7a343b746e98ca3b4bc7b36655af7291f3150db | [
"MIT"
] | null | null | null | Two_Pointers/521.py | wilbertgeng/LintCode_exercise | e7a343b746e98ca3b4bc7b36655af7291f3150db | [
"MIT"
] | null | null | null | Two_Pointers/521.py | wilbertgeng/LintCode_exercise | e7a343b746e98ca3b4bc7b36655af7291f3150db | [
"MIT"
] | null | null | null | """521. Remove Duplicate Numbers in Array
"""
| 23.595238 | 62 | 0.435923 | """521. Remove Duplicate Numbers in Array
"""
class Solution:
"""
@param nums: an array of integers
@return: the number of unique integers
"""
def deduplication(self, nums):
# write your code here
# Practice:
if len(nums) < 2:
return len(nums)
nums.sort()
... | 0 | 0 | 0 | 923 | 0 | 0 | 0 | 0 | 22 |
df461c698a6b0a817be02743f5f910db2496a7e0 | 6,672 | py | Python | models/vrnn/vrnn_model.py | alessiabertugli/AC-VRNN | 3a204bd23a7b90c3939efc6468fa6477c31a733f | [
"Apache-2.0"
] | 23 | 2020-08-10T07:52:30.000Z | 2022-03-30T13:24:49.000Z | models/vrnn/vrnn_model.py | alessiabertugli/AC-VRNN | 3a204bd23a7b90c3939efc6468fa6477c31a733f | [
"Apache-2.0"
] | 3 | 2021-02-11T02:54:24.000Z | 2021-11-08T06:40:59.000Z | models/vrnn/vrnn_model.py | alessiabertugli/AC-VRNN | 3a204bd23a7b90c3939efc6468fa6477c31a733f | [
"Apache-2.0"
] | 2 | 2020-09-14T00:37:12.000Z | 2021-07-25T21:39:40.000Z | import torch
import torch.nn as nn
import torch.utils
| 33.69697 | 126 | 0.57509 | import torch
import torch.nn as nn
import torch.utils
import torch.utils.data
import numpy as np
from torch.autograd import Variable
class VRNN(nn.Module):
def __init__(self, x_dim, h_dim, z_dim, n_layers, writer, bias=False):
super(VRNN, self).__init__()
self.x_dim = x_dim
self.h_dim = ... | 0 | 0 | 0 | 6,516 | 0 | 0 | 0 | 13 | 89 |
01d0e70d252230b358872f58b3ca279bcd8abfcc | 3,412 | py | Python | utils.py | phystechtv/instachart | 36ddc5f88c2a534190a7ff8c1c9191e5f7b97069 | [
"Apache-2.0"
] | null | null | null | utils.py | phystechtv/instachart | 36ddc5f88c2a534190a7ff8c1c9191e5f7b97069 | [
"Apache-2.0"
] | null | null | null | utils.py | phystechtv/instachart | 36ddc5f88c2a534190a7ff8c1c9191e5f7b97069 | [
"Apache-2.0"
] | null | null | null |
# inits
# instagram api and credentials | 33.45098 | 91 | 0.6017 | from instabot import API
import dataset
import random
import time
from itertools import cycle
def sleep(seconds):
return time.sleep(random.random() * seconds)
# inits
def init_db():
with dataset.connect() as db:
db.query('''
CREATE TABLE IF NOT EXISTS instagram_users (
user_... | 0 | 0 | 0 | 0 | 0 | 3,116 | 0 | -16 | 271 |
9a76288fe7f31c4b9ab2f807b877c9a16ec3d66d | 950 | py | Python | website/__init__.py | parthmshah1302/FlaskWebTutorial | 58d1772cf01fd31264e32e1c733d7fa0968676fc | [
"MIT"
] | null | null | null | website/__init__.py | parthmshah1302/FlaskWebTutorial | 58d1772cf01fd31264e32e1c733d7fa0968676fc | [
"MIT"
] | null | null | null | website/__init__.py | parthmshah1302/FlaskWebTutorial | 58d1772cf01fd31264e32e1c733d7fa0968676fc | [
"MIT"
] | null | null | null | from flask_sqlalchemy import SQLAlchemy
db=SQLAlchemy()
DB_NAME="database.db"
| 20.652174 | 64 | 0.696842 | from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from os import path
from flask_login import LoginManager
db=SQLAlchemy()
DB_NAME="database.db"
def create_app():
app=Flask(__name__)
app.config['SECRET_KEY']='odasdangisdajiosfokeroakgsdgsda'
app.config['SQLALCHEMY_DATABASE_URI']=f'sqlite://... | 0 | 67 | 0 | 0 | 0 | 674 | 0 | 15 | 112 |
96877a8aff26bcb79a025b3d89749e60832acbe6 | 1,547 | py | Python | fridge/test_suite/core_test.py | ryanstwrt/FRIDGE | 6ab23da24cb16fb793b1a182276be2d2c5f74bb6 | [
"MIT"
] | null | null | null | fridge/test_suite/core_test.py | ryanstwrt/FRIDGE | 6ab23da24cb16fb793b1a182276be2d2c5f74bb6 | [
"MIT"
] | 4 | 2019-06-05T23:29:31.000Z | 2019-10-15T03:22:37.000Z | fridge/test_suite/core_test.py | ryanstwrt/FRIDGE | 6ab23da24cb16fb793b1a182276be2d2c5f74bb6 | [
"MIT"
] | 1 | 2019-06-05T13:14:37.000Z | 2019-06-05T13:14:37.000Z | import fridge.Core.Core as Core
import fridge.driver.global_variables as gb
global_vars = gb.GlobalVariables()
global_vars.read_input_file('Full_Core_Test')
global_vars = gb.GlobalVariables()
global_vars.read_input_file('Full_Core_Test', output_name='test', temperature=1200, void_per=0.001)
| 30.333333 | 99 | 0.712346 | import fridge.Core.Core as Core
import fridge.driver.global_variables as gb
global_vars = gb.GlobalVariables()
global_vars.read_input_file('Full_Core_Test')
def test_baseCore():
core = Core.Core()
assert core.name == ''
assert core.assemblyList == []
assert core.coreCoolant is None
assert core.re... | 0 | 0 | 0 | 0 | 0 | 1,180 | 0 | 0 | 69 |
3fbd32d3e5d9253de50ba5c20a612e81d04f7bed | 1,556 | py | Python | mhctools/netmhc_pan4.py | Amfgcp/mhctools | 3253a6913ab1861c56f4d86368afb24801a77a6c | [
"Apache-2.0"
] | null | null | null | mhctools/netmhc_pan4.py | Amfgcp/mhctools | 3253a6913ab1861c56f4d86368afb24801a77a6c | [
"Apache-2.0"
] | null | null | null | mhctools/netmhc_pan4.py | Amfgcp/mhctools | 3253a6913ab1861c56f4d86368afb24801a77a6c | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2016-2017. Mount Sinai School of Medicine
#
# 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 applicabl... | 37.047619 | 74 | 0.688303 | # Copyright (c) 2016-2017. Mount Sinai School of Medicine
#
# 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 applicabl... | 0 | 0 | 0 | 750 | 0 | 0 | 0 | 66 | 68 |
205ed105c5975d2492d29049da0d7aa9ab111b5a | 792 | py | Python | tests/transformers/test_hierarchical_encoder.py | lisovskey/bi-utils | 007573a3158dbb81cd38de97ad05b0c51a4b2661 | [
"MIT"
] | null | null | null | tests/transformers/test_hierarchical_encoder.py | lisovskey/bi-utils | 007573a3158dbb81cd38de97ad05b0c51a4b2661 | [
"MIT"
] | null | null | null | tests/transformers/test_hierarchical_encoder.py | lisovskey/bi-utils | 007573a3158dbb81cd38de97ad05b0c51a4b2661 | [
"MIT"
] | null | null | null | from .. import utils
| 36 | 91 | 0.713384 | import pytest
import numpy as np
import pandas as pd
from bi_utils import transformers
from .. import utils
@pytest.mark.parametrize('cols', [['media_source', 'campaign_id'], ['media_source'], None])
@pytest.mark.parametrize('C', [2, 10, 100])
def test_hierarchical_encoder(cols, C, data):
data = data.dropna()
... | 0 | 659 | 0 | 0 | 0 | 0 | 0 | -1 | 112 |
9c2e4cfa62320dc1839a043455bf88ee49879042 | 650 | py | Python | patterns/number pattern_triangle_24.py | ZephyrAveryl777/Python-Programs | 26de85c31af28382d406d27d54186b966a7b1bfc | [
"MIT"
] | 6 | 2020-08-13T11:49:29.000Z | 2021-03-07T05:46:17.000Z | patterns/number pattern_triangle_24.py | ZephyrAveryl777/Python-Programs | 26de85c31af28382d406d27d54186b966a7b1bfc | [
"MIT"
] | null | null | null | patterns/number pattern_triangle_24.py | ZephyrAveryl777/Python-Programs | 26de85c31af28382d406d27d54186b966a7b1bfc | [
"MIT"
] | 1 | 2021-04-24T06:12:48.000Z | 2021-04-24T06:12:48.000Z | '''
Pattern
Enter number of rows: 5
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
1 2 3 4
1 2 3
1 2
1
'''
print('Number of patterns: ')
number_rows=int(input('Enter number of rows: '))
#upper part of the pattern
for row in range(1,number_rows+1):
fo... | 21.666667 | 49 | 0.553846 | '''
Pattern
Enter number of rows: 5
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
1 2 3 4
1 2 3
1 2
1
'''
print('Number of patterns: ')
number_rows=int(input('Enter number of rows: '))
#upper part of the pattern
for row in range(1,number_rows+1):
fo... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c0993677201ef914d92970d1c0a7356e7f766c4a | 4,026 | py | Python | dataStructures/BST.py | rickylaufitness/minialgos | 0441c1e5b8479bda9f106e1a04ec8166b04b7407 | [
"MIT"
] | null | null | null | dataStructures/BST.py | rickylaufitness/minialgos | 0441c1e5b8479bda9f106e1a04ec8166b04b7407 | [
"MIT"
] | null | null | null | dataStructures/BST.py | rickylaufitness/minialgos | 0441c1e5b8479bda9f106e1a04ec8166b04b7407 | [
"MIT"
] | null | null | null | '''
Write a Binary Search Tree(BST) class. The class should have a "value" property set to be an integer, as well as "left" and "right" properties, both of which should point to either the None(null) value or to another BST. A node is said to be a BST node
if and only if it satisfies the BST property: its value is stri... | 34.410256 | 429 | 0.525335 | '''
Write a Binary Search Tree(BST) class. The class should have a "value" property set to be an integer, as well as "left" and "right" properties, both of which should point to either the None(null) value or to another BST. A node is said to be a BST node
if and only if it satisfies the BST property: its value is stri... | 0 | 0 | 0 | 2,927 | 0 | 0 | 0 | 0 | 23 |
387064f62d52338b9c8e683240b472ddd421cfac | 4,533 | py | Python | cards.py | TheoGuyard/AEIR-Card | 5c068c51ef188daf8a208bb1b48c78132cf2dba1 | [
"MIT"
] | null | null | null | cards.py | TheoGuyard/AEIR-Card | 5c068c51ef188daf8a208bb1b48c78132cf2dba1 | [
"MIT"
] | null | null | null | cards.py | TheoGuyard/AEIR-Card | 5c068c51ef188daf8a208bb1b48c78132cf2dba1 | [
"MIT"
] | null | null | null | import pathlib
from bs4 import BeautifulSoup
# Files and directories downloaded and output directory
HERE = pathlib.Path(__file__).parent.absolute()
HTML_FILE = HERE.joinpath("Impression de cartes.html")
IMG_DIR = HERE.joinpath("Impression de cartes_files")
OUTPUT_DIR = HERE.joinpath("cards")
def extract_data():
... | 30.422819 | 97 | 0.582175 | import pathlib, datetime
from bs4 import BeautifulSoup
from reportlab.pdfgen import canvas
# Files and directories downloaded and output directory
HERE = pathlib.Path(__file__).parent.absolute()
HTML_FILE = HERE.joinpath("Impression de cartes.html")
IMG_DIR = HERE.joinpath("Impression de cartes_files")
OUTPUT_DIR = H... | 0 | 0 | 0 | 573 | 0 | 1,610 | 0 | 24 | 92 |
b916b8312706fe5f0f212889cf23d83625cbc0e2 | 1,280 | py | Python | src/root/urls.py | bayuyuhartono-katadata/flask-project | 000bafa4f593474eec2171b1b1ce392d64c5c47d | [
"MIT"
] | 1 | 2019-10-28T06:53:36.000Z | 2019-10-28T06:53:36.000Z | src/root/urls.py | bayuyuhartono-katadata/flask-project | 000bafa4f593474eec2171b1b1ce392d64c5c47d | [
"MIT"
] | 1 | 2019-12-26T22:21:29.000Z | 2019-12-29T12:47:33.000Z | src/root/urls.py | bayuyuhartono-katadata/flask-project | 000bafa4f593474eec2171b1b1ce392d64c5c47d | [
"MIT"
] | 1 | 2019-11-08T02:03:13.000Z | 2019-11-08T02:03:13.000Z | import os
import yaml
app_name = __name__
directory = app_name[:app_name.rfind('.', 0, app_name.rfind('/'))]
exec(
'{0} = Blueprint("{0}", __name__)'.format(directory)
)
urls_source_path = ''
if not os.path.isfile(os.path.join(os.path.dirname(__file__), 'urls.yml')):
if not os.path.isfile(os.path.join(os.p... | 37.647059 | 188 | 0.650781 | from flask import Blueprint
from .views import *
import os, sys
import yaml
app_name = __name__
directory = app_name[:app_name.rfind('.', 0, app_name.rfind('/'))]
exec(
'{0} = Blueprint("{0}", __name__)'.format(directory)
)
urls_source_path = ''
if not os.path.isfile(os.path.join(os.path.dirname(__file__), 'ur... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 44 |
5c5cd3c9160147aca468f31d1d99f9ef33a30e54 | 4,875 | py | Python | task_bli/translation_task.py | ENSCMA2/categorical-modularity | d12601d595001e44645ba9671fd36c3579611650 | [
"CC0-1.0"
] | 2 | 2021-06-03T17:27:35.000Z | 2021-10-31T00:10:23.000Z | task_bli/translation_task.py | ENSCMA2/categorical-modularity | d12601d595001e44645ba9671fd36c3579611650 | [
"CC0-1.0"
] | null | null | null | task_bli/translation_task.py | ENSCMA2/categorical-modularity | d12601d595001e44645ba9671fd36c3579611650 | [
"CC0-1.0"
] | 1 | 2021-11-01T07:02:59.000Z | 2021-11-01T07:02:59.000Z | '''
Run bilingual lexicon induction in a given language to and from English and
get mean of mean cosine similarities as performance metric. Feel free to use
custom input vector files or our defaults. To use our defaults, make sure you
have run either translationftdatagen.py or translationmusedatagen.py first,
depending... | 42.763158 | 93 | 0.731077 | '''
Run bilingual lexicon induction in a given language to and from English and
get mean of mean cosine similarities as performance metric. Feel free to use
custom input vector files or our defaults. To use our defaults, make sure you
have run either translationftdatagen.py or translationmusedatagen.py first,
depending... | 0 | 0 | 0 | 0 | 0 | 593 | 0 | -1 | 176 |
81313651c0aa93c94044c7e64a62b7e39daae1ee | 20,844 | py | Python | src/tests/simian/mac/models/base_test.py | tristansgray/simian | fb9c43946ff7ba29be417068d6447cfc0adfe9ef | [
"Apache-2.0"
] | 326 | 2015-01-06T10:55:26.000Z | 2019-01-23T17:59:18.000Z | src/tests/simian/mac/models/base_test.py | tristansgray/simian | fb9c43946ff7ba29be417068d6447cfc0adfe9ef | [
"Apache-2.0"
] | 64 | 2015-01-06T13:24:52.000Z | 2018-10-16T18:02:37.000Z | src/tests/simian/mac/models/base_test.py | isabella232/simian | fb9c43946ff7ba29be417068d6447cfc0adfe9ef | [
"Apache-2.0"
] | 65 | 2015-01-24T11:50:41.000Z | 2018-08-16T17:47:25.000Z | #!/usr/bin/env python
#
# Copyright 2018 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | 36.062284 | 80 | 0.729323 | #!/usr/bin/env python
#
# Copyright 2018 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | 0 | 0 | 0 | 19,805 | 0 | 19 | 0 | 43 | 250 |
7ca8b2caf94eeb03ac2c8b94260968578fd01638 | 2,383 | py | Python | codice/gateway.py | pietropezzi/Elaborato-PdR | 040bd05ca985931d776a28e7412eee6cb3808930 | [
"MIT"
] | 1 | 2021-05-24T22:38:57.000Z | 2021-05-24T22:38:57.000Z | codice/gateway.py | pietropezzi/Elaborato-PdR | 040bd05ca985931d776a28e7412eee6cb3808930 | [
"MIT"
] | null | null | null | codice/gateway.py | pietropezzi/Elaborato-PdR | 040bd05ca985931d776a28e7412eee6cb3808930 | [
"MIT"
] | null | null | null | import socket
import sys
deviceAmount = 4
gateway = ("localhost", 10000)
server = ("localhost",8000)
# creazione socket UDP per i device.
deviceInterface = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
deviceInterface.bind(gateway)
# creazione sockect TPC per server.
serverInterface = socket.socket(so... | 33.097222 | 91 | 0.603021 | import socket
import sys
deviceAmount = 4
gateway = ("localhost", 10000)
server = ("localhost",8000)
# creazione socket UDP per i device.
deviceInterface = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
deviceInterface.bind(gateway)
# creazione sockect TPC per server.
serverInterface = socket.socket(so... | 2 | 0 | 0 | 0 | 0 | 1,594 | 0 | 0 | 56 |
4602ece5e15d88029694cf0ca1f6ba93b53b0c63 | 4,449 | py | Python | rssant_api/helper.py | zuzhi/rssant | 06d985845f6af3be7097e6d718afba7eeb195ec8 | [
"BSD-3-Clause"
] | 1,176 | 2019-12-24T01:51:22.000Z | 2022-03-29T06:00:25.000Z | rssant_api/helper.py | zuzhi/rssant | 06d985845f6af3be7097e6d718afba7eeb195ec8 | [
"BSD-3-Clause"
] | 33 | 2020-03-06T03:29:46.000Z | 2022-03-11T06:24:26.000Z | rssant_api/helper.py | zuzhi/rssant | 06d985845f6af3be7097e6d718afba7eeb195ec8 | [
"BSD-3-Clause"
] | 110 | 2019-12-29T05:49:24.000Z | 2022-03-28T06:44:21.000Z | import yarl
def shorten(text, width, placeholder='...'):
"""
>>> shorten('123456789', width=8)
'12345...'
>>> shorten('123456789', width=9)
'123456789'
"""
if not text:
return text
if len(text) <= width:
return text
return text[: max(0, width - len(placeholder))] + ... | 31.330986 | 72 | 0.556979 | import yarl
from collections import defaultdict
def shorten(text, width, placeholder='...'):
"""
>>> shorten('123456789', width=8)
'12345...'
>>> shorten('123456789', width=9)
'123456789'
"""
if not text:
return text
if len(text) <= width:
return text
return text[: ... | 0 | 137 | 0 | 3,036 | 0 | 0 | 0 | 14 | 45 |
ab363390a977c732ef4280eafc9e6bd1a18fc34f | 176 | py | Python | project/professor/__init__.py | zbork/exams-master | 95969100bb1bb3b696522b20312669bcfc56a30f | [
"MIT"
] | null | null | null | project/professor/__init__.py | zbork/exams-master | 95969100bb1bb3b696522b20312669bcfc56a30f | [
"MIT"
] | 27 | 2018-10-03T15:59:00.000Z | 2018-12-12T16:19:01.000Z | project/professor/__init__.py | zbork/exams-master | 95969100bb1bb3b696522b20312669bcfc56a30f | [
"MIT"
] | 1 | 2018-10-05T22:14:07.000Z | 2018-10-05T22:14:07.000Z | from flask import Blueprint
professor_blueprint = Blueprint(
'professor',
__name__,
template_folder='templates',
static_folder='static'
)
| 16 | 32 | 0.721591 | from flask import Blueprint
professor_blueprint = Blueprint(
'professor',
__name__,
template_folder='templates',
static_folder='static'
)
from . import views
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | -2 | 23 |
5fca263fbd6d913a909448693f9455453b92871e | 1,436 | py | Python | Threads/Loading_images_thread.py | teco-kit/TFL2uC | 6d304e74d11f56cfec663a324702c7195797ed70 | [
"Apache-2.0"
] | 7 | 2021-08-02T08:44:14.000Z | 2022-02-02T11:02:36.000Z | Threads/Loading_images_thread.py | teco-kit/TFL2uC | 6d304e74d11f56cfec663a324702c7195797ed70 | [
"Apache-2.0"
] | 2 | 2021-07-28T08:33:04.000Z | 2021-08-10T13:53:43.000Z | Threads/Loading_images_thread.py | teco-kit/TFL2uC | 6d304e74d11f56cfec663a324702c7195797ed70 | [
"Apache-2.0"
] | 1 | 2021-07-28T08:32:21.000Z | 2021-07-28T08:32:21.000Z | ''' Copyright [2020] Hahn-Schickard-Gesellschaft fr angewandte Forschung e.V., Daniel Konegen + Marcus Rueb
Copyright [2021] Karlsruhe Institute of Technology, Daniel Konegen
SPDX-License-Identifier: Apache-2.0
=====================================================================================================... | 29.916667 | 134 | 0.545961 | ''' Copyright [2020] Hahn-Schickard-Gesellschaft für angewandte Forschung e.V., Daniel Konegen + Marcus Rueb
Copyright [2021] Karlsruhe Institute of Technology, Daniel Konegen
SPDX-License-Identifier: Apache-2.0
====================================================================================================... | 2 | 0 | 0 | 974 | 0 | 0 | 0 | -5 | 135 |
862306f55c130f9fa7d75f629fb0128253733f41 | 761 | py | Python | env/Lib/site-packages/deap/__init__.py | richooms/healthcare_automl | 73fc27ee8f57c717dc82a7841680ba64d6b4c34b | [
"MIT"
] | 2 | 2019-11-29T13:47:15.000Z | 2020-07-08T06:25:47.000Z | env/Lib/site-packages/deap/__init__.py | richooms/healthcare_automl | 73fc27ee8f57c717dc82a7841680ba64d6b4c34b | [
"MIT"
] | 6 | 2020-03-24T17:12:34.000Z | 2022-03-08T21:09:52.000Z | env/Lib/site-packages/deap/__init__.py | richooms/healthcare_automl | 73fc27ee8f57c717dc82a7841680ba64d6b4c34b | [
"MIT"
] | 1 | 2020-04-23T09:01:13.000Z | 2020-04-23T09:01:13.000Z | # This file is part of DEAP.
#
# DEAP is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, either version 3 of
# the License, or (at your option) any later version.
#
# DEAP is distributed ... | 42.277778 | 73 | 0.721419 | # This file is part of DEAP.
#
# DEAP is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, either version 3 of
# the License, or (at your option) any later version.
#
# DEAP is distributed ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4ef1bc02c8c6191bf7f9b1b1b2090fad83b5e509 | 792 | py | Python | RL/dist_rl/plot_reward.py | javieryu/nn_distributed_training | ebbae5317efc514437374fc2f698fbcec9debab4 | [
"MIT"
] | 3 | 2021-10-14T19:53:19.000Z | 2022-02-22T01:14:44.000Z | RL/dist_rl/plot_reward.py | javieryu/nn_distributed_training | ebbae5317efc514437374fc2f698fbcec9debab4 | [
"MIT"
] | null | null | null | RL/dist_rl/plot_reward.py | javieryu/nn_distributed_training | ebbae5317efc514437374fc2f698fbcec9debab4 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
# plt.style.use("dark_background")
times1 = np.load('trained/timesteps_1.npy')
rewards1 = np.load('trained/avg_ep_rews_1.npy')
times2 = np.load('trained/timesteps_2.npy')
rewards2 = np.load('trained/avg_ep_rews_2.npy')
times3 = np.load('trained/timesteps_3.npy')
re... | 24 | 114 | 0.739899 | import numpy as np
import matplotlib.pyplot as plt
# plt.style.use("dark_background")
times1 = np.load('trained/timesteps_1.npy')
rewards1 = np.load('trained/avg_ep_rews_1.npy')
times2 = np.load('trained/timesteps_2.npy')
rewards2 = np.load('trained/avg_ep_rews_2.npy')
times3 = np.load('trained/timesteps_3.npy')
re... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9114c8e5ca22219c1d87fc441098dd3f1f9bbd15 | 10,475 | py | Python | monitoring/alarmdefs/forms.py | shurkaxaa/monasca-ui | c48050cc999e917564b5b83af19316eb9ecbfa09 | [
"Apache-2.0"
] | null | null | null | monitoring/alarmdefs/forms.py | shurkaxaa/monasca-ui | c48050cc999e917564b5b83af19316eb9ecbfa09 | [
"Apache-2.0"
] | null | null | null | monitoring/alarmdefs/forms.py | shurkaxaa/monasca-ui | c48050cc999e917564b5b83af19316eb9ecbfa09 | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 Hewlett-Packard Development Company, L.P.
# Copyright 2017 FUJITSU LIMITED
#
# 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... | 40.758755 | 101 | 0.559141 | # Copyright 2013 Hewlett-Packard Development Company, L.P.
# Copyright 2017 FUJITSU LIMITED
#
# 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... | 0 | 89 | 0 | 9,012 | 0 | 236 | 0 | 97 | 394 |
87d270d3af4311ece613ae5ff0c705182a906785 | 921 | py | Python | ffmpeg/asfdump.py | vs49688/scripts | 2c05aa7856894b69f339f134fde646daefd46d26 | [
"CC0-1.0"
] | 1 | 2020-05-28T08:46:40.000Z | 2020-05-28T08:46:40.000Z | ffmpeg/asfdump.py | vs49688/scripts | 2c05aa7856894b69f339f134fde646daefd46d26 | [
"CC0-1.0"
] | null | null | null | ffmpeg/asfdump.py | vs49688/scripts | 2c05aa7856894b69f339f134fde646daefd46d26 | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/env python3
if __name__ == '__main__':
exit(main()) | 22.463415 | 63 | 0.67861 | #!/usr/bin/env python3
import sys
import os
import struct
import collections
import json
from asfcut import ASFFileHeader, ASFChunkHeader, ASF_CF_STEREO
def read_asf(f):
rawhdr = f.read(24)
fhdr = ASFFileHeader(*struct.unpack('<IHHII8s', rawhdr))
if fhdr.magic != 0x00465341: # little "ASF\0
raise Exception('Not... | 0 | 0 | 0 | 0 | 0 | 680 | 0 | -2 | 179 |
8323d0a5a0a2a1d0c1abe8cb3f74302bb427d05b | 96 | py | Python | vimanga/api/__init__.py | Akhail/ViManga | 03ff6805a6f5157b439673f246b4756c6022cd2b | [
"MIT"
] | null | null | null | vimanga/api/__init__.py | Akhail/ViManga | 03ff6805a6f5157b439673f246b4756c6022cd2b | [
"MIT"
] | 228 | 2017-12-10T02:53:18.000Z | 2020-03-13T15:06:14.000Z | vimanga/api/__init__.py | mdbetancourt/ViManga | 03ff6805a6f5157b439673f246b4756c6022cd2b | [
"MIT"
] | 1 | 2018-10-12T01:14:32.000Z | 2018-10-12T01:14:32.000Z | """API module"""
from . import core, types, constants
__all__ = ['core', 'constants', 'types']
| 19.2 | 40 | 0.645833 | """API module"""
from . import core, types, constants
__all__ = ['core', 'constants', 'types']
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2620ae9d25b06a5713c99a9c638f0669f1a41494 | 49,460 | py | Python | billforward/apis/couponbook_api.py | billforward/bf-python | d2b812329ca3ed1fd94364d7f46f69ad74665596 | [
"Apache-2.0"
] | 2 | 2016-11-23T17:32:37.000Z | 2022-02-24T05:13:20.000Z | billforward/apis/couponbook_api.py | billforward/bf-python | d2b812329ca3ed1fd94364d7f46f69ad74665596 | [
"Apache-2.0"
] | null | null | null | billforward/apis/couponbook_api.py | billforward/bf-python | d2b812329ca3ed1fd94364d7f46f69ad74665596 | [
"Apache-2.0"
] | 1 | 2016-12-30T20:02:48.000Z | 2016-12-30T20:02:48.000Z | # coding: utf-8
"""
BillForward REST API
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
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... | 46.13806 | 208 | 0.601132 | # coding: utf-8
"""
BillForward REST API
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
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... | 0 | 0 | 0 | 48,494 | 0 | 0 | 0 | 2 | 157 |
177d03469a6f6f8ec895f044a3f590dcf4399e30 | 1,061 | py | Python | Pico_Buzzer_Music_demo_main.py | geeekpi/rpico | b01151fc3dfdd57a9997a2f35662c21d8882eff2 | [
"MIT"
] | 4 | 2021-07-12T18:27:42.000Z | 2022-01-14T21:15:11.000Z | Pico_Buzzer_Music_demo_main.py | geeekpi/rpico | b01151fc3dfdd57a9997a2f35662c21d8882eff2 | [
"MIT"
] | null | null | null | Pico_Buzzer_Music_demo_main.py | geeekpi/rpico | b01151fc3dfdd57a9997a2f35662c21d8882eff2 | [
"MIT"
] | null | null | null | from machine import Pin, PWM
import time
led1 = Pin(1, Pin.OUT)
led2 = Pin(2, Pin.OUT)
led3 = Pin(3, Pin.OUT)
led4 = Pin(4, Pin.OUT)
pwm = PWM(Pin(28))
# do re mi fa sao la si
L_tones = [262, 294, 330, 349, 392, 440, 494 ]
M_tones = [523, 587, 659, 698, 784, 880, 988 ]
H_tones = [1046, 1175, ... | 27.205128 | 96 | 0.556079 | from machine import Pin, PWM
import time
led1 = Pin(1, Pin.OUT)
led2 = Pin(2, Pin.OUT)
led3 = Pin(3, Pin.OUT)
led4 = Pin(4, Pin.OUT)
pwm = PWM(Pin(28))
# do re mi fa sao la si
L_tones = [262, 294, 330, 349, 392, 440, 494 ]
M_tones = [523, 587, 659, 698, 784, 880, 988 ]
H_tones = [1046, 1175, ... | 0 | 0 | 0 | 0 | 0 | 80 | 0 | 0 | 23 |
0e6c2fa713a8522dcbeee239f68628e7059da771 | 382 | py | Python | geograpy3/__init__.py | tomcsojn/geograpy3 | 4e27d358374f2bcba651eca7cec0b3b07eafa635 | [
"MIT"
] | null | null | null | geograpy3/__init__.py | tomcsojn/geograpy3 | 4e27d358374f2bcba651eca7cec0b3b07eafa635 | [
"MIT"
] | null | null | null | geograpy3/__init__.py | tomcsojn/geograpy3 | 4e27d358374f2bcba651eca7cec0b3b07eafa635 | [
"MIT"
] | null | null | null |
# download all the basic nltk toolkit
| 19.1 | 47 | 0.701571 | import nltk
from geograpy3.extraction import Extractor
from geograpy3.places import PlaceContext
# download all the basic nltk toolkit
def get_place_context(url = None, text = None):
e = Extractor(url = url, text = text)
e.find_entities()
pc = PlaceContext(e.places)
pc.set_countries()
pc.set_re... | 0 | 0 | 0 | 0 | 0 | 221 | 0 | 31 | 90 |
2097530f1c8f514bdf0b53a8e5934de59dcc05c0 | 1,511 | py | Python | featureshare.py | acesnik/GeneProtXML | aca3599bb5883ecb3537133547cf775aaf4d365e | [
"MIT"
] | null | null | null | featureshare.py | acesnik/GeneProtXML | aca3599bb5883ecb3537133547cf775aaf4d365e | [
"MIT"
] | null | null | null | featureshare.py | acesnik/GeneProtXML | aca3599bb5883ecb3537133547cf775aaf4d365e | [
"MIT"
] | null | null | null | # module name: featureshare
# main program: samplespecificdbgenerator
__author__ = "Anthony Cesnik & Michael Knippen"
__date__ = "$Mar 31, 2016 8:00:00 PM$"
HTML_NS = "http://uniprot.org/uniprot"
XSI_NS = "http://www.w3.org/2001/XMLSchema-instance"
NAMESPACE_MAP = {None : HTML_NS, "xsi" : XSI_NS}
UP = '{'+HTML_NS+'}'... | 32.847826 | 84 | 0.657842 | # module name: featureshare
# main program: samplespecificdbgenerator
__author__ = "Anthony Cesnik & Michael Knippen"
__date__ = "$Mar 31, 2016 8:00:00 PM$"
from lxml import etree as et
import refparse
import numpy as np
HTML_NS = "http://uniprot.org/uniprot"
XSI_NS = "http://www.w3.org/2001/XMLSchema-instance"
NAME... | 0 | 0 | 0 | 0 | 0 | 1,033 | 0 | -2 | 159 |
304da5215a3747f2a324af05ceee711f08432f85 | 1,403 | py | Python | Leetcode/SpiralMatrixII.py | tswsxk/CodeBook | 01b976418d64f5f94257ae0e2b36751afb93c105 | [
"MIT"
] | null | null | null | Leetcode/SpiralMatrixII.py | tswsxk/CodeBook | 01b976418d64f5f94257ae0e2b36751afb93c105 | [
"MIT"
] | 1 | 2019-09-24T22:04:03.000Z | 2019-09-24T22:04:03.000Z | Leetcode/SpiralMatrixII.py | tswsxk/CodeBook | 01b976418d64f5f94257ae0e2b36751afb93c105 | [
"MIT"
] | null | null | null |
if __name__ == "__main__":
sol = Solution()
sol.generateMatrix(2)
| 28.06 | 103 | 0.566643 | class Solution(object):
def generateMatrix(self, n):
"""
:type n: int
:rtype: List[List[int]]
"""
count = 1
ret = [[0 for _ in range(n)] for _ in range(n)]
upbound, downbound, leftbound, rightbound = 0, n - 1, 0, n - 1
while count <= n * n:
# right move
new_count = count +... | 0 | 0 | 0 | 1,307 | 0 | 0 | 0 | 0 | 22 |
f8b048e04a38a121c729678c781bbcf55ed9c216 | 158 | py | Python | hellopython.py | qingpan23/HelloGit | b48ee75451ccf37c9c424c8fedf09efdc63e8d17 | [
"Apache-2.0"
] | null | null | null | hellopython.py | qingpan23/HelloGit | b48ee75451ccf37c9c424c8fedf09efdc63e8d17 | [
"Apache-2.0"
] | null | null | null | hellopython.py | qingpan23/HelloGit | b48ee75451ccf37c9c424c8fedf09efdc63e8d17 | [
"Apache-2.0"
] | null | null | null |
print("hello Github")
print(":"
":"
"")
print("")
print("") | 14.363636 | 32 | 0.651899 |
print("hello Github")
print("红色文件: 代表未添加到版本控制中的文件,"
"绿色文件: 代表添加到版本控制中的文件,"
"蓝色文件: 代表已在版本控制中的文件发生了修改")
print("欢迎来到实力至上主义的教室")
print("海参呢????") | 246 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
29cd96e18007e9990a094b447d8a33064bd41f38 | 878 | py | Python | connect/accounts/migrations/0005_auto_20150605_2316.py | majacQ/connect | 7840eca6ddcb45d7c30cf4e888ae9c4ec041fb59 | [
"BSD-3-Clause"
] | 50 | 2015-06-02T16:01:43.000Z | 2020-02-20T08:49:23.000Z | connect/accounts/migrations/0005_auto_20150605_2316.py | nlhkabu/connect | 7840eca6ddcb45d7c30cf4e888ae9c4ec041fb59 | [
"BSD-3-Clause"
] | 49 | 2015-06-02T16:08:33.000Z | 2016-08-04T15:44:03.000Z | connect/accounts/migrations/0005_auto_20150605_2316.py | majacQ/connect | 7840eca6ddcb45d7c30cf4e888ae9c4ec041fb59 | [
"BSD-3-Clause"
] | 35 | 2015-06-02T16:01:52.000Z | 2021-06-13T03:34:27.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
| 33.769231 | 257 | 0.666287 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('accounts', '0004_auto_20150605_remove_first_name_last_name'),
]
operations = [
migrations.Alter... | 0 | 0 | 0 | 719 | 0 | 0 | 0 | 26 | 68 |
580a5fa31fa35052e0704a2b48e0a8f72a89713c | 2,328 | py | Python | src/AccessControl/User.py | zopefoundation/AccessControl | 99364694ca43c90b8d14d78b2aad2e9bbb3b7027 | [
"ZPL-2.1"
] | 10 | 2015-03-30T08:39:50.000Z | 2022-02-28T21:57:51.000Z | src/AccessControl/User.py | zopefoundation/AccessControl | 99364694ca43c90b8d14d78b2aad2e9bbb3b7027 | [
"ZPL-2.1"
] | 79 | 2015-06-18T20:21:46.000Z | 2022-03-29T06:33:00.000Z | src/AccessControl/User.py | zopefoundation/AccessControl | 99364694ca43c90b8d14d78b2aad2e9bbb3b7027 | [
"ZPL-2.1"
] | 14 | 2015-03-30T08:40:00.000Z | 2022-02-09T00:48:51.000Z | ##############################################################################
#
# Copyright (c) 2002 Zope Foundation and Contributors.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS I... | 42.327273 | 78 | 0.713058 | ##############################################################################
#
# Copyright (c) 2002 Zope Foundation and Contributors.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS I... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3e334b47a048453d261056d8a1d976695977bdac | 2,892 | py | Python | grokking-the-coding-interview/topological-sort/Reconstructing-a-Sequence-(hard).py | huandrew99/LeetCode | aa36b48d06100ce5f0bc64c789a906ec29409440 | [
"MIT"
] | 36 | 2021-12-23T15:44:41.000Z | 2022-03-31T04:26:26.000Z | grokking-the-coding-interview/topological-sort/Reconstructing-a-Sequence-(hard).py | wzy0766/LeetCode-1 | 3070e672c519e8af74966811b8058a9baef8c0bc | [
"MIT"
] | null | null | null | grokking-the-coding-interview/topological-sort/Reconstructing-a-Sequence-(hard).py | wzy0766/LeetCode-1 | 3070e672c519e8af74966811b8058a9baef8c0bc | [
"MIT"
] | 11 | 2022-02-26T22:41:26.000Z | 2022-03-02T07:18:41.000Z | """
LC 444
Given a sequence originalSeq and an array of sequences,
write a method to find if originalSeq can be uniquely reconstructed from the array of sequences.
Unique reconstruction means that we need to find if originalSeq is the only sequence
such that all sequences in the array are subsequences of it.
Example 1:... | 32.863636 | 96 | 0.609613 | """
LC 444
Given a sequence originalSeq and an array of sequences,
write a method to find if originalSeq can be uniquely reconstructed from the array of sequences.
Unique reconstruction means that we need to find if originalSeq is the only sequence
such that all sequences in the array are subsequences of it.
Example 1:... | 0 | 0 | 0 | 0 | 0 | 1,637 | 0 | 14 | 114 |
eef254a9f1b497fe496dca31b3ea4278e0e42966 | 590 | py | Python | server.py | TheSeeven/ip-simple-transfer | 3f5275e09feae6e3ed5da3cda3a861edea5cb516 | [
"Unlicense"
] | null | null | null | server.py | TheSeeven/ip-simple-transfer | 3f5275e09feae6e3ed5da3cda3a861edea5cb516 | [
"Unlicense"
] | null | null | null | server.py | TheSeeven/ip-simple-transfer | 3f5275e09feae6e3ed5da3cda3a861edea5cb516 | [
"Unlicense"
] | null | null | null | import socket
HOST = "79.114.19.165" # Standard loopback interface address (localhost)
PORT = 5003 # Port to listen on (non-privileged ports are > 1023)
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
# s.bind((HOST, PORT))
# s.listen()
s.connect((HOST,PORT))
# conn, addr =... | 31.052632 | 74 | 0.559322 | import socket
HOST = "79.114.19.165" # Standard loopback interface address (localhost)
PORT = 5003 # Port to listen on (non-privileged ports are > 1023)
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
# s.bind((HOST, PORT))
# s.listen()
s.connect((HOST,PORT))
# conn, addr =... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0f801d83fe461a9d7301da8294e98a7f00b004f2 | 2,325 | py | Python | stats/groups.py | psiinon/zap-mgmt-scripts | e2e57aa694df3ccfbe6e91b9d1570eb4a50bf453 | [
"Apache-2.0"
] | 13 | 2016-03-12T20:44:14.000Z | 2022-03-29T15:59:14.000Z | stats/groups.py | psiinon/zap-mgmt-scripts | e2e57aa694df3ccfbe6e91b9d1570eb4a50bf453 | [
"Apache-2.0"
] | 26 | 2017-04-05T11:48:58.000Z | 2022-03-30T09:12:53.000Z | stats/groups.py | psiinon/zap-mgmt-scripts | e2e57aa694df3ccfbe6e91b9d1570eb4a50bf453 | [
"Apache-2.0"
] | 11 | 2015-11-11T17:26:05.000Z | 2021-04-23T23:59:26.000Z | '''
Script for processing the ZAP Google Group stats
'''
| 30.194805 | 111 | 0.476129 | '''
Script for processing the ZAP Google Group stats
'''
import csv
import glob
import json
import os
import utils
def collect():
# These are collected manually
pass
def daily():
# These are processed manually
pass
def website():
files = sorted(glob.glob(utils.basedir() + 'groups/monthly/*.csv')... | 0 | 0 | 0 | 0 | 0 | 2,140 | 0 | -52 | 179 |
70dad23151f9701759ab8f8b9156958b0b2aba50 | 138 | py | Python | UCI-RegCheck/main.py | bmize14/UCI-RegCheck | 01de41c367c513a639169663d09a2dd192447ea7 | [
"MIT"
] | null | null | null | UCI-RegCheck/main.py | bmize14/UCI-RegCheck | 01de41c367c513a639169663d09a2dd192447ea7 | [
"MIT"
] | null | null | null | UCI-RegCheck/main.py | bmize14/UCI-RegCheck | 01de41c367c513a639169663d09a2dd192447ea7 | [
"MIT"
] | null | null | null | """main.py
Contains the main function to run the program.
"""
if '__name__' == '__main__':
main()
| 12.545455 | 46 | 0.608696 | """main.py
Contains the main function to run the program.
"""
def main():
print("main.py")
if '__name__' == '__main__':
main()
| 0 | 0 | 0 | 0 | 0 | 11 | 0 | 0 | 23 |
b5eedb541426236a47d7817e70041a5a90b01d3a | 3,141 | py | Python | test/functest/run_tests.py | georgepar/sdnvpn-mirror | 0224ff358ef1ee79f090a79a6e54346f945b994f | [
"Apache-2.0"
] | null | null | null | test/functest/run_tests.py | georgepar/sdnvpn-mirror | 0224ff358ef1ee79f090a79a6e54346f945b994f | [
"Apache-2.0"
] | null | null | null | test/functest/run_tests.py | georgepar/sdnvpn-mirror | 0224ff358ef1ee79f090a79a6e54346f945b994f | [
"Apache-2.0"
] | null | null | null | #!/bin/bash
#
# Copyright (c) 2015 All rights reserved
# This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
import argparse
import os
import funct... | 32.05102 | 74 | 0.575294 | #!/bin/bash
#
# Copyright (c) 2015 All rights reserved
# This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
import argparse
import importlib
impor... | 0 | 0 | 0 | 0 | 0 | 2,224 | 0 | -36 | 134 |
f43b87ddefe4fe4a4f06f2e50a0b351e8e2107b5 | 12,565 | py | Python | oracle/datadog_checks/oracle/oracle.py | zhangkeqing/integrations-core | 74d40a14c16d3e51daa8b821ba3b017ed7ececec | [
"BSD-3-Clause"
] | 2 | 2019-05-28T03:48:29.000Z | 2019-07-05T07:05:58.000Z | oracle/datadog_checks/oracle/oracle.py | zhangkeqing/integrations-core | 74d40a14c16d3e51daa8b821ba3b017ed7ececec | [
"BSD-3-Clause"
] | null | null | null | oracle/datadog_checks/oracle/oracle.py | zhangkeqing/integrations-core | 74d40a14c16d3e51daa8b821ba3b017ed7ececec | [
"BSD-3-Clause"
] | 1 | 2020-01-15T16:58:51.000Z | 2020-01-15T16:58:51.000Z | # (C) Datadog, Inc. 2018
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
EVENT_TYPE = SOURCE_TYPE_NAME = 'oracle'
| 45.035842 | 120 | 0.546598 | # (C) Datadog, Inc. 2018
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from collections import OrderedDict
from contextlib import closing
import cx_Oracle
import jaydebeapi as jdb
import jpype
from datadog_checks.checks import AgentCheck
from datadog_checks.config import is_affirma... | 0 | 0 | 0 | 12,127 | 0 | 0 | 0 | 62 | 225 |
aa638d92a63de8460f0a84730fd5fd7aca867640 | 260 | py | Python | lab1/Q2_Eucli.py | 101guptaji/Cryptography | 70e52f80f4cbb609d42bd714256ed228f994e57f | [
"MIT"
] | null | null | null | lab1/Q2_Eucli.py | 101guptaji/Cryptography | 70e52f80f4cbb609d42bd714256ed228f994e57f | [
"MIT"
] | null | null | null | lab1/Q2_Eucli.py | 101guptaji/Cryptography | 70e52f80f4cbb609d42bd714256ed228f994e57f | [
"MIT"
] | null | null | null | #euclidean algo for gcd
x=input("enter two no. for gcd")
a,b=x.split()
a=int(a)
b=int(b)
r1=r2=r=0
if(a>b):
r1=a
r2=b
elif(a<b):
r1=b
r2=a
else:
r1=a
#print(r1,r2)
while(r2>0):
q=r1//r2
r=r1-q*r2
r1=r2
r2=r
#print(r1,r2)
print("gcd of",a,b,"is ",r1)
| 11.304348 | 32 | 0.592308 | #euclidean algo for gcd
x=input("enter two no. for gcd")
a,b=x.split()
a=int(a)
b=int(b)
r1=r2=r=0
if(a>b):
r1=a
r2=b
elif(a<b):
r1=b
r2=a
else:
r1=a
#print(r1,r2)
while(r2>0):
q=r1//r2
r=r1-q*r2
r1=r2
r2=r
#print(r1,r2)
print("gcd of",a,b,"is ",r1)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
43e0e31b8b0818c087336f77be17d4ab7cb1a713 | 4,162 | py | Python | predict422/mnist_pca_random-forest.py | TJConnellyContingentMacro/northwestern | 116301f68e9ce02bc13d5496b3e4cec98154f7d6 | [
"MIT"
] | null | null | null | predict422/mnist_pca_random-forest.py | TJConnellyContingentMacro/northwestern | 116301f68e9ce02bc13d5496b3e4cec98154f7d6 | [
"MIT"
] | null | null | null | predict422/mnist_pca_random-forest.py | TJConnellyContingentMacro/northwestern | 116301f68e9ce02bc13d5496b3e4cec98154f7d6 | [
"MIT"
] | 5 | 2018-02-12T01:15:37.000Z | 2021-11-21T23:08:10.000Z | # Evaluating MNIST with Random Forest Classifiers
# Principal Component Analysis
from sklearn.datasets import fetch_mldata
from sklearn.decomposition import PCA
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import cross_val_predict, cross_val_score
from sklearn.preprocessing import S... | 25.533742 | 74 | 0.717924 | # Evaluating MNIST with Random Forest Classifiers
# Principal Component Analysis
from sklearn.datasets import fetch_mldata
from sklearn.decomposition import PCA
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import cross_val_predict, cross_val_score
from sklearn.preprocessing import S... | 0 | 0 | 0 | 0 | 0 | 663 | 0 | 0 | 22 |
1221b34e21a8e3faf77f58b35aa89d51725eb2f4 | 2,696 | py | Python | wt-app/apps/wt_managing/models.py | j2labs/wikitrans | da2ad8ec3dd91123b6c4f26b656b373183438ee1 | [
"Apache-2.0"
] | 6 | 2015-06-07T14:07:47.000Z | 2020-04-25T12:14:39.000Z | wt-app/apps/wt_managing/models.py | NickRuiz/wikitrans | c40dc599251ea5c0778abe9df7f6ce1e340dcd9e | [
"Apache-2.0"
] | null | null | null | wt-app/apps/wt_managing/models.py | NickRuiz/wikitrans | c40dc599251ea5c0778abe9df7f6ce1e340dcd9e | [
"Apache-2.0"
] | 3 | 2016-07-13T12:11:30.000Z | 2021-05-05T23:54:45.000Z | from django.conf import settings
if "notification" in settings.INSTALLED_APPS:
from notification import models as notification
else:
notification = None
PENDING = 0
IN_PROGRESS = 1
FINISHED = 2
REVIEW_STATUSES = (
(PENDING, 'Pending'),
(IN_PROGRESS, 'In Progress'),
(FINISHED, 'Finished'),
)
| 35.473684 | 91 | 0.642433 | from datetime import datetime
from django.db import models
from django.db.transaction import commit_on_success
from django.conf import settings
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
from wt_articles.models import TranslatedArticle, TranslatedSentence
if "... | 0 | 702 | 0 | 1,351 | 0 | 0 | 0 | 148 | 179 |
07bf31b44a941901846e3d96dc15f76abbd06a6a | 1,025 | py | Python | gmprocess/metrics/imc/channels.py | norfordb/groundmotion | 3f714894a34d9d37e1ac236f26b4366e25a05056 | [
"CC0-1.0"
] | 1 | 2019-08-16T16:11:23.000Z | 2019-08-16T16:11:23.000Z | gmprocess/metrics/imc/channels.py | vinceq-usgs/gmprocess | 2812dfd1803f8b2e0622c56cd8373b1c3fedb1a6 | [
"CC0-1.0"
] | null | null | null | gmprocess/metrics/imc/channels.py | vinceq-usgs/gmprocess | 2812dfd1803f8b2e0622c56cd8373b1c3fedb1a6 | [
"CC0-1.0"
] | null | null | null | # Local imports
| 35.344828 | 80 | 0.614634 | # Local imports
from gmprocess.metrics.imc.imc import IMC
class Channels(IMC):
"""Class defining steps and invalid imts, for channels."""
# making invalid IMTs a class variable because
# 1) it doesn't change with instances
# 2) information can now be retrieved without
# instantiating first
... | 0 | 0 | 0 | 943 | 0 | 0 | 0 | 20 | 45 |
f274f30cd47503434370d4cc88319461b988b3b4 | 777 | py | Python | multiply_ui/ui/clear/api.py | RaT0M/multiply-ui | ad7fffb15cc962604340b31b38d34bc470fa8448 | [
"MIT"
] | null | null | null | multiply_ui/ui/clear/api.py | RaT0M/multiply-ui | ad7fffb15cc962604340b31b38d34bc470fa8448 | [
"MIT"
] | 20 | 2019-05-21T10:33:36.000Z | 2019-12-11T08:13:29.000Z | multiply_ui/ui/clear/api.py | RaT0M/multiply-ui | ad7fffb15cc962604340b31b38d34bc470fa8448 | [
"MIT"
] | 1 | 2020-10-14T12:32:36.000Z | 2020-10-14T12:32:36.000Z |
__author__ = 'Tonio Fincke (Brockmann Consult GmbH)'
URL_BASE = "http://localhost:9090/"
CLEAR_URL = URL_BASE + "multiply/api/clear/{}"
| 25.064516 | 56 | 0.698842 | from enum import Enum
from typing import List
from ...util.callapi import call_api
__author__ = 'Tonio Fincke (Brockmann Consult GmbH)'
URL_BASE = "http://localhost:9090/"
CLEAR_URL = URL_BASE + "multiply/api/clear/{}"
class ClearanceType(Enum):
CACHE = 0
WORKING_DIRS = 1
AUXILIARY_DATA = 2
ARCHIVE... | 0 | 0 | 0 | 85 | 0 | 422 | 0 | 17 | 112 |
6cecdd26e23e54a94da0345c75d4a4465aefac92 | 44 | py | Python | config.py | jc-hiroto/discord-bot | 262a6727297b4d16913e1f85b703c464886c099e | [
"MIT"
] | null | null | null | config.py | jc-hiroto/discord-bot | 262a6727297b4d16913e1f85b703c464886c099e | [
"MIT"
] | null | null | null | config.py | jc-hiroto/discord-bot | 262a6727297b4d16913e1f85b703c464886c099e | [
"MIT"
] | null | null | null | DISCORD_BOT_TOKEN = "YOUR_DISCORD_API_TOKEN" | 44 | 44 | 0.886364 | DISCORD_BOT_TOKEN = "YOUR_DISCORD_API_TOKEN" | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2070c3a13a2caf1943be7680a615e5e9c1bfb7cc | 1,664 | py | Python | setup.py | carletes/mock-ssh-server | 11e189818ef11c89900253e7a1dfd97080fd6b45 | [
"MIT"
] | 42 | 2017-03-30T01:26:08.000Z | 2022-02-02T19:52:02.000Z | setup.py | carletes/mock-ssh-server | 11e189818ef11c89900253e7a1dfd97080fd6b45 | [
"MIT"
] | 21 | 2017-04-04T19:47:55.000Z | 2022-01-26T15:08:06.000Z | setup.py | carletes/mock-ssh-server | 11e189818ef11c89900253e7a1dfd97080fd6b45 | [
"MIT"
] | 34 | 2016-06-04T19:29:24.000Z | 2022-03-10T03:54:41.000Z |
from setuptools import find_packages, setup
setup(
name="mock-ssh-server",
version="0.9.1",
description="Mock SSH server for testing purposes",
long_description=read_long_description(),
url="https://github.com/carletes/mock-ssh-server",
author="Carlos Valiente",
author_email="carlos@pep... | 27.733333 | 71 | 0.576322 | import os
from setuptools import find_packages, setup
def read_requirements():
ret = []
fname = os.path.join(os.path.dirname(__file__), "requirements.txt")
with open(fname, "r") as f:
for line in f:
line = line.strip()
if line and not line.startswith("#"):
... | 0 | 0 | 0 | 0 | 0 | 343 | 0 | -12 | 68 |
4d7a9593c4944d90498c9fdfde10921302a78dfd | 253 | py | Python | investor_management/admin.py | BuildForSDG/Team-004-Backend | d0d0882d2d392edd8e47e07b234b0919db246773 | [
"MIT"
] | 2 | 2020-05-11T23:38:33.000Z | 2020-05-26T22:35:45.000Z | investor_management/admin.py | BuildForSDG/Team-004-Backend | d0d0882d2d392edd8e47e07b234b0919db246773 | [
"MIT"
] | 35 | 2020-05-17T14:03:26.000Z | 2021-06-10T19:20:22.000Z | investor_management/admin.py | BuildForSDG/Team-004-Backend | d0d0882d2d392edd8e47e07b234b0919db246773 | [
"MIT"
] | 3 | 2020-05-02T20:34:58.000Z | 2020-06-07T13:52:49.000Z | from django.contrib import admin
from investor_management import models
# Register your models here.
admin.site.register(models.InvestorOrganization)
admin.site.register(models.InvestorUser)
admin.site.register(models.InvestorOrgSMEProjectInvestments)
| 31.625 | 60 | 0.86166 | from django.contrib import admin
from investor_management import models
# Register your models here.
admin.site.register(models.InvestorOrganization)
admin.site.register(models.InvestorUser)
admin.site.register(models.InvestorOrgSMEProjectInvestments)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
43e0dcbd7bf10bb7539e2d6a2f8d7279e6280cdb | 854 | py | Python | test/test_info_api.py | FactomProject/factom-harmony-connect-python-client | b64f11dc0552b4c526f5b744ad07a9a7cf65d9aa | [
"MIT"
] | 12 | 2019-01-23T23:07:08.000Z | 2019-02-04T06:17:48.000Z | test/test_info_api.py | FactomProject/factom-harmony-connect-python-client | b64f11dc0552b4c526f5b744ad07a9a7cf65d9aa | [
"MIT"
] | null | null | null | test/test_info_api.py | FactomProject/factom-harmony-connect-python-client | b64f11dc0552b4c526f5b744ad07a9a7cf65d9aa | [
"MIT"
] | 1 | 2019-08-03T12:27:01.000Z | 2019-08-03T12:27:01.000Z | # coding: utf-8
"""
Harmony Connect
An easy to use API that helps you access the Factom blockchain. # noqa: E501
OpenAPI spec version: 1.0.17
Contact: harmony-support@factom.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unittest
if __nam... | 20.333333 | 81 | 0.688525 | # coding: utf-8
"""
Harmony Connect
An easy to use API that helps you access the Factom blockchain. # noqa: E501
OpenAPI spec version: 1.0.17
Contact: harmony-support@factom.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unittest
import har... | 0 | 0 | 0 | 318 | 0 | 0 | 0 | 73 | 104 |
c4e6a7986a59ea479927441e11381f17059ac51f | 5,509 | py | Python | applications/subset_isce_stack.py | rbiessel/CovSAR | 27448b98d761a4fdf4ed88a4380c91b2aaadaee1 | [
"MIT"
] | 1 | 2022-02-16T05:28:39.000Z | 2022-02-16T05:28:39.000Z | applications/subset_isce_stack.py | rbiessel/CovSAR | 27448b98d761a4fdf4ed88a4380c91b2aaadaee1 | [
"MIT"
] | null | null | null | applications/subset_isce_stack.py | rbiessel/CovSAR | 27448b98d761a4fdf4ed88a4380c91b2aaadaee1 | [
"MIT"
] | null | null | null | import isceobj.Image.IntImage as IntImage
main()
| 33.797546 | 107 | 0.601743 | from matplotlib import pyplot as plt
import rasterio
import gdal
import numpy as np
import isce
import isceobj
import isceobj.Image.IntImage as IntImage
import isceobj.Image.SlcImage as SLC
from isceobj.Image import createImage
from datetime import datetime as dt
import argparse
import glob
import os
import shutil
d... | 0 | 0 | 0 | 0 | 0 | 5,087 | 0 | -12 | 379 |
96ebaac2731c93f2342f6309718bbc98c5d209a2 | 635 | py | Python | coh-metrix_3/lsa_cos2.py | Lee-guccii/ExtensiveReading_YL_Estimation | 89e3d4aacdc6e7d812b8cedc24f37e1f173087bc | [
"MIT"
] | null | null | null | coh-metrix_3/lsa_cos2.py | Lee-guccii/ExtensiveReading_YL_Estimation | 89e3d4aacdc6e7d812b8cedc24f37e1f173087bc | [
"MIT"
] | null | null | null | coh-metrix_3/lsa_cos2.py | Lee-guccii/ExtensiveReading_YL_Estimation | 89e3d4aacdc6e7d812b8cedc24f37e1f173087bc | [
"MIT"
] | null | null | null |
result = sentence_similarity(
"The field was full of lush, green grass. The horses grazed peacefully.",
" The young children played with kites."
)
print(result) | 39.6875 | 88 | 0.804724 | from scipy import spatial
def sentence_similarity(sentence_1, sentence_2):
# 今回使うWord2Vecのモデルは300次元の特徴ベクトルで生成されているので、num_featuresも300に指定
num_features=300
sentence_1_avg_vector = avg_feature_vector(sentence_1, word2vec_model, num_features)
sentence_2_avg_vector = avg_feature_vector(sentence_2, word2vec_m... | 195 | 0 | 0 | 0 | 0 | 351 | 0 | 4 | 44 |
674263e57cb3eb602a0fb25d1f70ddbc2b6319cd | 5,557 | py | Python | tools/split_set.py | SIAAAAAA/MMT-PSM | 0835c01c5010d3337778f452e9d96416e0f8a11a | [
"MIT"
] | 41 | 2020-07-22T03:55:08.000Z | 2022-02-27T12:04:41.000Z | tools/split_set.py | SIAAAAAA/MMT-PSM | 0835c01c5010d3337778f452e9d96416e0f8a11a | [
"MIT"
] | 5 | 2020-11-08T08:47:34.000Z | 2021-07-09T03:53:42.000Z | tools/split_set.py | SIAAAAAA/MMT-PSM | 0835c01c5010d3337778f452e9d96416e0f8a11a | [
"MIT"
] | 5 | 2020-10-13T11:09:53.000Z | 2021-07-28T12:41:53.000Z | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
r"""
Basic training script for PyTorch
"""
# Set up custom environment before nearly anything else is imported
# NOTE: this should be the first import (no not reorder)
from pycocotools import mask as maskUtils
import numpy as np
def annToMask(boxl... | 30.037838 | 85 | 0.657189 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
r"""
Basic training script for PyTorch
"""
# Set up custom environment before nearly anything else is imported
# NOTE: this should be the first import (no not reorder)
from maskrcnn_benchmark.utils.env import setup_environment # noqa F401 isort:s... | 0 | 0 | 0 | 0 | 0 | 3,673 | 0 | 366 | 534 |
d5c98a376d25abfa717af3fbc93a411f9c53b13c | 1,196 | py | Python | pyraf-legacy/psftidy.py | mnicholl/photometry-sans-frustration | 0fbe1e1ebfeda0c8937dd7dabce7e458dada6c18 | [
"MIT"
] | 2 | 2019-04-14T23:52:01.000Z | 2019-11-18T23:01:26.000Z | pyraf-legacy/psftidy.py | mnicholl/photometry-sans-frustration | 0fbe1e1ebfeda0c8937dd7dabce7e458dada6c18 | [
"MIT"
] | null | null | null | pyraf-legacy/psftidy.py | mnicholl/photometry-sans-frustration | 0fbe1e1ebfeda0c8937dd7dabce7e458dada6c18 | [
"MIT"
] | null | null | null | import glob
import os
import shutil
for i in glob.glob('*.mag.*'):
shutil.copy(i,outdir)
for i in glob.glob('*.psf.*'):
shutil.copy(i,outdir)
for i in glob.glob('*.mag.*'):
os.remove(i)
for i in glob.glob('*.psf.*'):
os.remove(i)
for i in glob.glob('*.als.*'):
os.remove(i)
for i in glob.glob(... | 17.085714 | 42 | 0.598662 | import glob
import os
import shutil
for i in glob.glob('*.mag.*'):
shutil.copy(i,outdir)
for i in glob.glob('*.psf.*'):
shutil.copy(i,outdir)
for i in glob.glob('*.mag.*'):
os.remove(i)
for i in glob.glob('*.psf.*'):
os.remove(i)
for i in glob.glob('*.als.*'):
os.remove(i)
for i in glob.glob(... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
25f973e60f1b38cb91b57b67e0f23ae07632de71 | 557 | py | Python | setup.py | renou/djangoevents | 3b1898378b4d88025f8a7240d3078256e2801776 | [
"MIT"
] | null | null | null | setup.py | renou/djangoevents | 3b1898378b4d88025f8a7240d3078256e2801776 | [
"MIT"
] | null | null | null | setup.py | renou/djangoevents | 3b1898378b4d88025f8a7240d3078256e2801776 | [
"MIT"
] | null | null | null | from setuptools import setup
setup(
name='djangoevents',
version='0.9.3',
url='https://github.com/ApplauseOSS/djangoevents',
license='MIT',
description='Building blocks for building Event Sourcing Django applications.',
author='Applause',
author_email='eng@applause.com',
zip_safe=False,... | 24.217391 | 83 | 0.639138 | from setuptools import setup
setup(
name='djangoevents',
version='0.9.3',
url='https://github.com/ApplauseOSS/djangoevents',
license='MIT',
description='Building blocks for building Event Sourcing Django applications.',
author='Applause',
author_email='eng@applause.com',
zip_safe=False,... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d5e85587a48769dc5d3f9e95d6ccdfe04e9a264f | 1,552 | py | Python | util/pytorch_convNd/mainNd.py | PolarizedLightFieldMicroscopy/LFMNet2 | c9b064d7625e018ef54b8dd8a0e53801c4565397 | [
"Apache-2.0"
] | 46 | 2020-03-31T10:25:24.000Z | 2022-03-27T14:10:26.000Z | util/pytorch_convNd/mainNd.py | PolarizedLightFieldMicroscopy/LFMNet2 | c9b064d7625e018ef54b8dd8a0e53801c4565397 | [
"Apache-2.0"
] | 2 | 2020-04-19T12:49:58.000Z | 2020-10-20T14:38:02.000Z | util/pytorch_convNd/mainNd.py | PolarizedLightFieldMicroscopy/LFMNet2 | c9b064d7625e018ef54b8dd8a0e53801c4565397 | [
"Apache-2.0"
] | 7 | 2020-04-06T09:51:01.000Z | 2021-12-16T08:05:29.000Z | import torch
import torch.nn as nn
from convNd import convNd
torch.backends.cudnn.deterministic = True
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
# Define 4D tensor to test on
inChans = 1
outChans = 1
x = torch.ones(1, inChans, 5, 5, 5, 5, 5).to(device)
ks = 3
padding = 0
# Only zeros allow... | 27.714286 | 72 | 0.753866 | import torch
import torch.nn as nn
import torch.nn.functional as F
from convNd import convNd
import time
import matplotlib.pyplot as plt
torch.backends.cudnn.deterministic = True
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
# Define 4D tensor to test on
inChans = 1
outChans = 1
x = torch.ones... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 66 |
38be7a2041d8b436efeb879989d10eaf7069d885 | 1,320 | py | Python | interpretation/setup.py | squassina/seismic-deeplearning | ffb2855249e581f4900665c2616cefb019621675 | [
"MIT"
] | 270 | 2019-12-17T13:40:51.000Z | 2022-03-20T10:02:11.000Z | interpretation/setup.py | squassina/seismic-deeplearning | ffb2855249e581f4900665c2616cefb019621675 | [
"MIT"
] | 233 | 2019-12-18T17:59:36.000Z | 2021-08-03T13:43:49.000Z | interpretation/setup.py | squassina/seismic-deeplearning | ffb2855249e581f4900665c2616cefb019621675 | [
"MIT"
] | 118 | 2019-12-17T13:41:43.000Z | 2022-03-29T02:06:36.000Z | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import setuptools
with open("../README.md", "r") as f:
long_description = f.read()
with open("requirements.txt") as f:
requirements = f.read().splitlines()
setuptools.setup(
author="DeepSeismic Maintainers",
author_email="deep... | 31.428571 | 110 | 0.668182 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import setuptools
with open("../README.md", "r") as f:
long_description = f.read()
with open("requirements.txt") as f:
requirements = f.read().splitlines()
setuptools.setup(
author="DeepSeismic Maintainers",
author_email="deep... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
eb56a1cc8ddaa2f93bad050c919e02c396e5e522 | 803 | py | Python | chesstc.py | ChrisDavison/scripts | ebbe52626aac041f37a1143607dc0cc74515a198 | [
"MIT"
] | null | null | null | chesstc.py | ChrisDavison/scripts | ebbe52626aac041f37a1143607dc0cc74515a198 | [
"MIT"
] | null | null | null | chesstc.py | ChrisDavison/scripts | ebbe52626aac041f37a1143607dc0cc74515a198 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""chesstc - Calculate expected chess game time.
usage: chesstc <base> <increment>
This calculates the expected duration of a chess game (minutes:seconds) for a
given base and increment; e.g. 5+0 should take approx 10 minutes.
Assumes 40 moves, using a given base and increment. Each player wi... | 32.12 | 77 | 0.743462 | #!/usr/bin/env python3
"""chesstc - Calculate expected chess game time.
usage: chesstc <base> <increment>
This calculates the expected duration of a chess game (minutes:seconds) for a
given base and increment; e.g. 5+0 should take approx 10 minutes.
Assumes 40 moves, using a given base and increment. Each player wi... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c002ebebd6ba800e3886a30663335c763c19d3bd | 21,884 | py | Python | lib/emailqueue/models.py | hdknr/emailqueue | 05e108562f4fb612440f769973b9a3d02c11afcd | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | lib/emailqueue/models.py | hdknr/emailqueue | 05e108562f4fb612440f769973b9a3d02c11afcd | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | lib/emailqueue/models.py | hdknr/emailqueue | 05e108562f4fb612440f769973b9a3d02c11afcd | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | ''' Email Delivery Subsystem
'''
# from django.utils.encoding import force_text
# from email import Charset, message_from_string
# from email.mime.text import MIMEText
| 29.572973 | 77 | 0.613919 | ''' Email Delivery Subsystem
'''
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.timezone import now, localtime
# from django.utils.encoding import force_text
from django.utils.encoding import smart_str
from django import template
from django.core import serializer... | 0 | 2,752 | 0 | 17,959 | 0 | 0 | 0 | 169 | 814 |
7425095b44ef7f4bb27d1bd83d5b64259f3386c2 | 7,639 | py | Python | python/ember/utils.py | BangShiuh/ember | f0a70c7e01ae0dd7b5bd5ee70c8fc5d3f7207388 | [
"MIT"
] | 27 | 2016-11-22T08:29:48.000Z | 2021-12-01T12:15:39.000Z | python/ember/utils.py | minhbau/ember | f0a70c7e01ae0dd7b5bd5ee70c8fc5d3f7207388 | [
"MIT"
] | 11 | 2015-02-12T14:12:33.000Z | 2021-04-15T15:53:03.000Z | python/ember/utils.py | minhbau/ember | f0a70c7e01ae0dd7b5bd5ee70c8fc5d3f7207388 | [
"MIT"
] | 20 | 2016-05-15T04:51:36.000Z | 2022-01-26T09:07:35.000Z | import numpy as np
def load(filename):
"""
Generate an :class:`Struct` object from a saved profile.
"""
if filename.endswith('h5'):
return HDFStruct(filename)
elif filename.endswith('npz'):
return NpzStruct(filename)
def get_qdot(gas, profile, pressure=101325):
"""
Calc... | 30.434263 | 84 | 0.556225 | import numpy as np
import cantera as ct
import os
import sys
from . import _ember
import time
class Struct(object):
"""
A dictionary-like data structure where fields are accessible as both
attributes and dictionary keys::
>>> s = Struct()
>>> s['foo'] = 6
>>> s.foo
6
... | 0 | 0 | 0 | 2,027 | 0 | 65 | 0 | -35 | 202 |
8c9bf33f021493d03845c5003c7c7554c5b83c8d | 2,529 | py | Python | scqubits/tests/test_explorer.py | saipavanc/scqubits | a99ff75498110558c64e6a6e276834e5714793a5 | [
"BSD-3-Clause"
] | 108 | 2019-12-14T16:08:04.000Z | 2022-03-21T03:48:33.000Z | scqubits/tests/test_explorer.py | saipavanc/scqubits | a99ff75498110558c64e6a6e276834e5714793a5 | [
"BSD-3-Clause"
] | 62 | 2019-12-14T02:41:00.000Z | 2022-02-06T07:32:42.000Z | scqubits/tests/test_explorer.py | saipavanc/scqubits | a99ff75498110558c64e6a6e276834e5714793a5 | [
"BSD-3-Clause"
] | 46 | 2019-12-21T12:13:11.000Z | 2022-03-31T17:09:53.000Z | # test_explorer.py
# meant to be run with 'pytest'
#
# This file is part of scqubits: a Python package for superconducting qubits,
# arXiv:2107.08552 (2021). https://arxiv.org/abs/2107.08552
#
# Copyright (c) 2019 and later, Jens Koch and Peter Groszkowski
# All rights reserved.
#
# This source code is license... | 27.791209 | 82 | 0.656386 | # test_explorer.py
# meant to be run with 'pytest'
#
# This file is part of scqubits: a Python package for superconducting qubits,
# arXiv:2107.08552 (2021). https://arxiv.org/abs/2107.08552
#
# Copyright (c) 2019 and later, Jens Koch and Peter Groszkowski
# All rights reserved.
#
# This source code is license... | 0 | 0 | 0 | 0 | 0 | 1,872 | 0 | 39 | 115 |
8a467131b068bf8bba745d5fe323c2a2516e29e6 | 9,535 | py | Python | django_rest_passwordreset/views.py | ManuelRomano/django-rest-passwordreset | 121420bf564a051d4dd3214619965053927ea65b | [
"BSD-3-Clause"
] | null | null | null | django_rest_passwordreset/views.py | ManuelRomano/django-rest-passwordreset | 121420bf564a051d4dd3214619965053927ea65b | [
"BSD-3-Clause"
] | null | null | null | django_rest_passwordreset/views.py | ManuelRomano/django-rest-passwordreset | 121420bf564a051d4dd3214619965053927ea65b | [
"BSD-3-Clause"
] | null | null | null | from django.contrib.auth import get_user_model
from django.conf import settings
from django_rest_passwordreset.models import ResetPasswordToken
from django_rest_passwordreset.utils import get_client_masked_ip
User = get_user_model()
def get_password_reset_token_expiry_time(is_long_token=False):
"""
Returns t... | 37.392157 | 115 | 0.676455 | import coreapi
import time
import random
from datetime import timedelta
from django.contrib.auth import get_user_model
from django.conf import settings
from django.utils import timezone
from rest_framework import parsers, renderers, status
from rest_framework.response import Response
from rest_framework.views import A... | 0 | 0 | 0 | 7,348 | 0 | 140 | 0 | 218 | 336 |
ccae1a51e16e0a6eb3ca9f3f7c0621f9eb1342d5 | 4,063 | py | Python | reasonerAPI/python-flask-server/openapi_server/controllers/knowledge_map.py | mapleknight/molecular-data-provider | 111418ed7efab3c393c22116854fd322ff367fb9 | [
"MIT"
] | 5 | 2020-08-28T09:30:16.000Z | 2021-12-29T16:00:26.000Z | reasonerAPI/python-flask-server/openapi_server/controllers/knowledge_map.py | mapleknight/molecular-data-provider | 111418ed7efab3c393c22116854fd322ff367fb9 | [
"MIT"
] | 19 | 2021-04-26T22:19:16.000Z | 2022-03-09T21:09:55.000Z | reasonerAPI/python-flask-server/openapi_server/controllers/knowledge_map.py | mapleknight/molecular-data-provider | 111418ed7efab3c393c22116854fd322ff367fb9 | [
"MIT"
] | 8 | 2020-07-09T18:50:57.000Z | 2022-01-20T16:01:33.000Z |
definition_file = 'transformer_chains.json'
knowledge_map = KnowledgeMap()
| 33.858333 | 90 | 0.63426 | import requests
import json
from contextlib import closing
from openapi_server.models.query_graph import QueryGraph
from openapi_server.controllers.utils import translate_type
definition_file = 'transformer_chains.json'
class KnowledgeMap:
def __init__(self):
self.kmap = self.read_knowledge_map()
... | 0 | 0 | 0 | 3,161 | 0 | 573 | 0 | 66 | 181 |
5000b06fbce39967518ab37e689834dbe47fd341 | 4,027 | py | Python | solentware_misc/gui/startstop.py | RogerMarsh/solentware-misc | 3b031b26bc747193f25f7ffc9e6d24d7278ad30b | [
"BSD-3-Clause"
] | null | null | null | solentware_misc/gui/startstop.py | RogerMarsh/solentware-misc | 3b031b26bc747193f25f7ffc9e6d24d7278ad30b | [
"BSD-3-Clause"
] | null | null | null | solentware_misc/gui/startstop.py | RogerMarsh/solentware-misc | 3b031b26bc747193f25f7ffc9e6d24d7278ad30b | [
"BSD-3-Clause"
] | null | null | null | # startstop.py
# Copyright 2020 Roger Marsh
# Licence: See LICENCE (BSD licence)
"""Functions to assist application start, stop, and exception display."""
import tkinter
import tkinter.messagebox
from .exceptionhandler import GRAB_ERROR
def start_application_exception(error, appname="Application", action="start"):... | 31.460938 | 79 | 0.419171 | # startstop.py
# Copyright 2020 Roger Marsh
# Licence: See LICENCE (BSD licence)
"""Functions to assist application start, stop, and exception display."""
import tkinter
import tkinter.messagebox
from .exceptionhandler import GRAB_ERROR
def start_application_exception(error, appname="Application", action="start"):... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
24bb3e7e60b744489f664650d4e5ed25cd704059 | 1,696 | py | Python | examples/push_msg_via_bot.py | tonytony2020/WorkWechatSDK | e45f3b5a7eb26b5f0770502b66993cb9ca0bcf47 | [
"MIT"
] | 10 | 2020-04-20T01:41:27.000Z | 2021-11-07T20:22:37.000Z | examples/push_msg_via_bot.py | littlelinlin/WorkWeChatSDK | b9af3820b8c914c103d39b0f3538ab30f7c97523 | [
"MIT"
] | null | null | null | examples/push_msg_via_bot.py | littlelinlin/WorkWeChatSDK | b9af3820b8c914c103d39b0f3538ab30f7c97523 | [
"MIT"
] | 7 | 2020-04-21T06:54:39.000Z | 2020-12-08T08:03:23.000Z | import os
webhook_key = os.environ.get("WEBHOOK_KEY")
| 24.941176 | 135 | 0.65625 | import base64
import hashlib
import os
import work_wechat
webhook_key = os.environ.get("WEBHOOK_KEY")
def push_txt():
msg = "hello world"
work_wechat.WorkWeChat().webhook_send(
key=webhook_key,
text_content=msg,
)
def push_md():
msg = '''# github down
We investigating it.
**blob**... | 0 | 0 | 0 | 0 | 0 | 1,496 | 0 | -18 | 159 |
0d89d101ec54c104a6d4c6416c1af15a108b4bac | 9,228 | py | Python | polymerxtal/polymod/zmatrix.py | lengxupa/polymerxtal | 7deb455b5ef23991c183489b1f4c0d8f004d4b52 | [
"BSD-3-Clause"
] | 1 | 2020-08-13T23:52:56.000Z | 2020-08-13T23:52:56.000Z | polymerxtal/polymod/zmatrix.py | lengxupa/polymerxtal | 7deb455b5ef23991c183489b1f4c0d8f004d4b52 | [
"BSD-3-Clause"
] | 8 | 2020-08-31T01:18:33.000Z | 2021-09-17T18:20:24.000Z | polymerxtal/polymod/zmatrix.py | lengxupa/polymerxtal | 7deb455b5ef23991c183489b1f4c0d8f004d4b52 | [
"BSD-3-Clause"
] | 3 | 2020-08-26T14:58:59.000Z | 2021-03-15T09:06:24.000Z | # ============================================================================
# zmatrix.py -- ZEntry, ZMatrix structs; prototypes for functions used in
# latch module
# ----------------------------------------------------------------------------
# Author: Benjamin P. Haley, Tongtong Shen, Purdue University
# Copyright... | 38.773109 | 88 | 0.429887 | # ============================================================================
# zmatrix.py -- ZEntry, ZMatrix structs; prototypes for functions used in
# latch module
# ----------------------------------------------------------------------------
# Author: Benjamin P. Haley, Tongtong Shen, Purdue University
# Copyright... | 0 | 0 | 0 | 7,082 | 0 | 759 | 0 | 23 | 178 |
98a8e31d5d310153630eecea73489ab4d2235425 | 544 | py | Python | src/escape_rooms/escape_rooms/organizations_app/urls.py | ivelinakaraivanova/Escape_rooms | de13925ebf1062d3012c5a8ef99511573bb7968c | [
"MIT"
] | null | null | null | src/escape_rooms/escape_rooms/organizations_app/urls.py | ivelinakaraivanova/Escape_rooms | de13925ebf1062d3012c5a8ef99511573bb7968c | [
"MIT"
] | null | null | null | src/escape_rooms/escape_rooms/organizations_app/urls.py | ivelinakaraivanova/Escape_rooms | de13925ebf1062d3012c5a8ef99511573bb7968c | [
"MIT"
] | null | null | null | from django.urls import path
from escape_rooms.organizations_app.views import CompanyListView, CompanyDetailView, CompanyCreateView, EmployeeListView, EmployeeDetailView, EmployeeCreateView
urlpatterns = [
path('companies/', CompanyListView.as_view()),
path('company/<int:pk>/', CompanyDetailView.as_view()),
... | 41.846154 | 105 | 0.744485 | from django.urls import path
from escape_rooms.organizations_app.views import CompanyListView, CompanyDetailView, CompanyCreateView, \
EmployeeListView, EmployeeDetailView, EmployeeCreateView
urlpatterns = [
path('companies/', CompanyListView.as_view()),
path('company/<int:pk>/', CompanyDetailView.as_view... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 | 0 |
c8ecd00ba6fc68b8c7715f7b94dc9fa4d9dd576a | 18,100 | py | Python | train.py | johnpjust/pixel-cnn | 77a598d3f317992aa56b2b6417f44b6c0883c7eb | [
"MIT"
] | null | null | null | train.py | johnpjust/pixel-cnn | 77a598d3f317992aa56b2b6417f44b6c0883c7eb | [
"MIT"
] | null | null | null | train.py | johnpjust/pixel-cnn | 77a598d3f317992aa56b2b6417f44b6c0883c7eb | [
"MIT"
] | null | null | null | """
Trains a Pixel-CNN++ generative model on CIFAR-10 or Tiny ImageNet data.
Uses multiple GPUs, indicated by the flag --nr_gpu
Example usage:
CUDA_VISIBLE_DEVICES=0,1,2,3 python train_double_cnn.py --nr_gpu 4
"""
import os
import sys
import time
import numpy as np
import tensorflow.compat.v1 as tf
from pixel_cnn_p... | 47.135417 | 205 | 0.679503 | """
Trains a Pixel-CNN++ generative model on CIFAR-10 or Tiny ImageNet data.
Uses multiple GPUs, indicated by the flag --nr_gpu
Example usage:
CUDA_VISIBLE_DEVICES=0,1,2,3 python train_double_cnn.py --nr_gpu 4
"""
import os
import sys
import json
import argparse
import time
import numpy as np
import tensorflow.compa... | 0 | 0 | 0 | 2 | 0 | 0 | 0 | -11 | 89 |
6fc743804e5370e6f081616999a9a4e83bb04de1 | 5,704 | py | Python | goal-oriented-RL-Bot/dialog_agent_env.py | dertilo/dialogue-systems | 3530bdfae2a75360e3b09841cfff773647027d6e | [
"MIT"
] | null | null | null | goal-oriented-RL-Bot/dialog_agent_env.py | dertilo/dialogue-systems | 3530bdfae2a75360e3b09841cfff773647027d6e | [
"MIT"
] | null | null | null | goal-oriented-RL-Bot/dialog_agent_env.py | dertilo/dialogue-systems | 3530bdfae2a75360e3b09841cfff773647027d6e | [
"MIT"
] | null | null | null | import torch.nn as nn
from rulebased_agent import RuleBasedAgent
if __name__ == "__main__":
params = get_params()
file_path_dict = params["db_file_paths"]
DATABASE_FILE_PATH = file_path_dict["database"]
DICT_FILE_PATH = file_path_dict["dict"]
USER_GOALS_FILE_PATH = file_path_dict["user_goal... | 31.688889 | 88 | 0.6669 | import json
import pickle
import sys
from collections import Iterator
from typing import List, Dict, Any
import gym
import numpy as np
import torch
import torch.nn as nn
from dialogue_config import map_index_to_action, AGENT_ACTIONS
from error_model_controller import ErrorModelController
from rulebased_agent import R... | 0 | 0 | 0 | 2,443 | 644 | 1,160 | 0 | 108 | 449 |
7aadfc4dc9dece4f3eca606fb2f3873bb75396df | 104 | py | Python | exe/hooks/hook-taskgraph.py | testacc-art/invest | 8f34712f89b8245ed7a4593b833d7d7a7d5e0c6e | [
"BSD-3-Clause"
] | 6 | 2020-02-26T16:31:42.000Z | 2022-02-28T21:10:25.000Z | exe/hooks/hook-taskgraph.py | testacc-art/invest | 8f34712f89b8245ed7a4593b833d7d7a7d5e0c6e | [
"BSD-3-Clause"
] | 28 | 2020-04-09T23:39:38.000Z | 2020-04-17T00:30:47.000Z | exe/hooks/hook-taskgraph.py | emlys/invest | 5b0391fd456df5a6afd2fdfbaed542a090f58f17 | [
"BSD-3-Clause"
] | 7 | 2020-02-26T16:31:47.000Z | 2022-03-14T12:06:21.000Z | # encoding=UTF-8
from PyInstaller.utils.hooks import copy_metadata
datas = copy_metadata('taskgraph')
| 17.333333 | 49 | 0.798077 | # encoding=UTF-8
from PyInstaller.utils.hooks import copy_metadata
datas = copy_metadata('taskgraph')
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
db1a08bb0c62ea320984e642c3dbe51da14efd44 | 51,268 | py | Python | blotter/blotter.py | matthewgilbert/blotter | 067cc55bd4b55252f4d8de160703884ff01b9391 | [
"MIT"
] | 16 | 2017-06-06T10:11:02.000Z | 2022-03-28T02:24:29.000Z | blotter/blotter.py | altfund/blotter | 067cc55bd4b55252f4d8de160703884ff01b9391 | [
"MIT"
] | null | null | null | blotter/blotter.py | altfund/blotter | 067cc55bd4b55252f4d8de160703884ff01b9391 | [
"MIT"
] | 7 | 2017-06-23T15:51:35.000Z | 2020-10-18T10:00:46.000Z | from collections import namedtuple
_metadata = namedtuple('metadata', ['ccy', 'margin', 'multiplier',
'commission', 'isFX'])
| 38.927866 | 160 | 0.579835 | import pandas as pd
import numpy as np
import json
import re
from collections import namedtuple
from array import array
from . import marketdata
class _Event():
# this class manages the actions which are performed on the Holdings class
# and encapsulates all the data required for this action. The class
# ... | 0 | 3,445 | 0 | 47,478 | 0 | 0 | 0 | -22 | 201 |
b3d9b8d4418360ac2f54c3ddb8248dd13b8e7216 | 4,875 | py | Python | train.py | clarinsi/kas-biterm | 4eb6268d3dc39a7ac72bc1f9123bae1ae9bec659 | [
"Apache-2.0"
] | null | null | null | train.py | clarinsi/kas-biterm | 4eb6268d3dc39a7ac72bc1f9123bae1ae9bec659 | [
"Apache-2.0"
] | 2 | 2018-09-13T19:00:11.000Z | 2018-09-14T08:36:18.000Z | train.py | clarinsi/kas-biterm | 4eb6268d3dc39a7ac72bc1f9123bae1ae9bec659 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
import sys
import cPickle as pickle
import pycrfsuite
import random
train_size=0.8
if __name__=='__main__':
"""
emb={}
for line in open('vocabulary.vec'):
line=line.decode('utf8').strip().split(' ')
emb[line[0]]=[float(e) for e in line[1:]]
"""
instances=[]
for sentence in open(s... | 30.46875 | 80 | 0.613538 | #!/usr/bin/python
import sys
import cPickle as pickle
import pycrfsuite
import random
train_size=0.8
def ngram(token,length=3):
token='^'+token+'$'
for idx in range(len(token)-length-1):
yield token[idx:idx+length]
def extract(instance):
feats=[]
for idx,(token,msd,lemma) in enumerate(instance):
tfeat... | 0 | 0 | 0 | 0 | 343 | 1,979 | 0 | 0 | 70 |
23571fe7fb0a43f58eb88e30614eec8ffdec11f8 | 1,354 | py | Python | csob/crypto.py | druids/csob-paymentgateway | 64e5e84ad4a0239f716855e12ee70364ab4414df | [
"MIT"
] | null | null | null | csob/crypto.py | druids/csob-paymentgateway | 64e5e84ad4a0239f716855e12ee70364ab4414df | [
"MIT"
] | 3 | 2019-03-13T10:28:35.000Z | 2019-04-04T10:56:59.000Z | csob/crypto.py | druids/csob-paymentgateway | 64e5e84ad4a0239f716855e12ee70364ab4414df | [
"MIT"
] | 1 | 2019-03-11T02:32:14.000Z | 2019-03-11T02:32:14.000Z | from base64 import b64decode, b64encode
from urllib import parse
from Crypto.Hash import SHA
from Crypto.PublicKey import RSA
from Crypto.Signature import PKCS1_v1_5
def get_signature(key: str, signature_str: str) -> str:
"""
Sign a signature string with SHA-1 RSA.
Args:
key: private key in stri... | 24.178571 | 88 | 0.689808 | from base64 import b64decode, b64encode
from urllib import parse
from Crypto.Hash import SHA
from Crypto.PublicKey import RSA
from Crypto.Signature import PKCS1_v1_5
def get_signature(key: str, signature_str: str) -> str:
"""
Sign a signature string with SHA-1 RSA.
Args:
key: private key in stri... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0cb11e9353752f304aefc45de797f457fbc7de19 | 8,508 | py | Python | tbgclient/parsers/lxml.py | tbgers/tbgclient | bd0d4484086b1f966a32fc009806e28798287cad | [
"MIT"
] | 1 | 2022-02-27T01:34:11.000Z | 2022-02-27T01:34:11.000Z | tbgclient/parsers/lxml.py | tbgers/tbgclient | bd0d4484086b1f966a32fc009806e28798287cad | [
"MIT"
] | 2 | 2021-10-21T20:29:38.000Z | 2022-01-15T01:08:51.000Z | tbgclient/parsers/lxml.py | tbgers/tbgclient | bd0d4484086b1f966a32fc009806e28798287cad | [
"MIT"
] | null | null | null | import datetime, re
import warnings
from lxml import etree
def get_post(document, pid=None):
"""Get post data using lxml."""
# get the post
document = etree.HTML(document)
raw, tid, fid, user, text, time = (None,)*6 # le init
err = document.find(".//div[@id='msg']")
if err is not ... | 38.324324 | 122 | 0.513282 | import datetime, re
import warnings
from lxml import etree
def get_post(document, pid=None):
"""Get post data using lxml."""
# get the post
document = etree.HTML(document)
raw, tid, fid, user, text, time = (None,)*6 # le init
err = document.find(".//div[@id='msg']")
if err is not ... | 0 | 0 | 0 | 0 | 0 | 3,695 | 0 | 0 | 125 |
3672877e538af926b2f3a5e625c88f487a1e2479 | 267 | py | Python | 24-serverless-application-model/AWS-SAM-python-example/hello-with-apigateway/src/app.py | mateuszmidor/AwsStudy | 8257e58c10068d67871ad5cda91b95ad61602642 | [
"MIT"
] | null | null | null | 24-serverless-application-model/AWS-SAM-python-example/hello-with-apigateway/src/app.py | mateuszmidor/AwsStudy | 8257e58c10068d67871ad5cda91b95ad61602642 | [
"MIT"
] | null | null | null | 24-serverless-application-model/AWS-SAM-python-example/hello-with-apigateway/src/app.py | mateuszmidor/AwsStudy | 8257e58c10068d67871ad5cda91b95ad61602642 | [
"MIT"
] | null | null | null |
print("loading function")
| 16.6875 | 56 | 0.602996 | import json
print("loading function")
def respond(msg):
return {
"statusCode": "200",
"headers": {"Content-Type": "application/json"},
"body": json.dumps(msg),
}
def lambda_handler(event, context):
return respond("Hello SAM")
| 0 | 0 | 0 | 0 | 0 | 180 | 0 | -10 | 68 |
b21d2cc0da2a24aab9b384e4574b1007e2025294 | 5,515 | py | Python | molepy/scf/rhf.py | mubaoinam/molepy | 982feaa812d5ce6c7aa782ded875579ba911d1f6 | [
"Apache-2.0"
] | null | null | null | molepy/scf/rhf.py | mubaoinam/molepy | 982feaa812d5ce6c7aa782ded875579ba911d1f6 | [
"Apache-2.0"
] | null | null | null | molepy/scf/rhf.py | mubaoinam/molepy | 982feaa812d5ce6c7aa782ded875579ba911d1f6 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Oinam Romesh Meitei. All Rights Reserved.
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under th... | 29.650538 | 82 | 0.586401 | # Copyright 2018 Oinam Romesh Meitei. All Rights Reserved.
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under th... | 0 | 0 | 0 | 0 | 0 | 992 | 0 | 28 | 182 |
d910cb6a553c537a335cb66ce8dbef3af383d307 | 966 | py | Python | Aula 6/descubra.py | eucgabriel/Melhor-Curso-de-Python | 6c7392a9779e399a412aee331c28731d3887deca | [
"MIT"
] | null | null | null | Aula 6/descubra.py | eucgabriel/Melhor-Curso-de-Python | 6c7392a9779e399a412aee331c28731d3887deca | [
"MIT"
] | null | null | null | Aula 6/descubra.py | eucgabriel/Melhor-Curso-de-Python | 6c7392a9779e399a412aee331c28731d3887deca | [
"MIT"
] | null | null | null | x = input("Digite algo:")
print(
"""
[01]Essa varivel alfanumrica? {}
[02]Essa varivel alfabtica? {}
[03]Essa varivel faz parte da ASCII? {}
[04]Essa varivel decimal? {}
[05]Essa varivel um n de 0 a 9? {}
[06]Essa varivel um identificador que pode ser
usado como funo, ... | 29.272727 | 55 | 0.55383 | x = input("Digite algo:")
print(
"""
[01]Essa variável é alfanumérica? {}
[02]Essa variável é alfabética? {}
[03]Essa variável faz parte da ASCII? {}
[04]Essa variável é decimal? {}
[05]Essa variável é um nº de 0 a 9? {}
[06]Essa variável é um identificador que pode ser
usa... | 70 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
19de803b44e9fcb7901e6689fe85bb637e2b2b9b | 2,982 | py | Python | text2sql_data.py | JasperGuo/MeaningRepresentationBenchmark | b61e8ed68fdbd934c195fa968445540bfa897f2f | [
"MIT"
] | 9 | 2020-11-11T08:54:05.000Z | 2022-03-22T11:16:03.000Z | text2sql_data.py | JasperGuo/MeaningRepresentationBenchmark | b61e8ed68fdbd934c195fa968445540bfa897f2f | [
"MIT"
] | null | null | null | text2sql_data.py | JasperGuo/MeaningRepresentationBenchmark | b61e8ed68fdbd934c195fa968445540bfa897f2f | [
"MIT"
] | 2 | 2021-01-14T08:25:25.000Z | 2021-06-08T21:41:32.000Z | # coding=utf8
"""
Parsing data from https://github.com/jkkummerfeld/text2sql-data/tree/master/data
"""
import os
if __name__ == '__main__':
base_path = os.path.join('data', 'atis')
raw_data_path = os.path.join('data', 'atis', 'atis.json')
get_sql_data(base_path, raw_data_path)
| 42 | 121 | 0.614688 | # coding=utf8
"""
Parsing data from https://github.com/jkkummerfeld/text2sql-data/tree/master/data
"""
import os
import json
import copy
def get_sql_data(basepath, raw_data_path):
with open(raw_data_path, 'r') as f:
data = json.load(f)
question_based_train_dataset, question_based_dev_dataset, questio... | 0 | 0 | 0 | 0 | 0 | 2,641 | 0 | -20 | 67 |
735db6617689c4e7dabb86020a0f8959ffe12b08 | 1,134 | py | Python | tests/test_05_tools/test_510_byte_stream.py | jkjt/ezdxf | 2acc5611b81476ea16b98063b9f55446a9182b81 | [
"MIT"
] | 515 | 2017-01-25T05:46:52.000Z | 2022-03-29T09:52:27.000Z | tests/test_05_tools/test_510_byte_stream.py | jkjt/ezdxf | 2acc5611b81476ea16b98063b9f55446a9182b81 | [
"MIT"
] | 417 | 2017-01-25T10:01:17.000Z | 2022-03-29T09:22:04.000Z | tests/test_05_tools/test_510_byte_stream.py | jkjt/ezdxf | 2acc5611b81476ea16b98063b9f55446a9182b81 | [
"MIT"
] | 149 | 2017-02-01T15:52:02.000Z | 2022-03-17T10:33:38.000Z | # Copyright (c) 2020, Manfred Moitzi
# License: MIT License
import pytest
if __name__ == "__main__":
pytest.main([__file__])
| 21.807692 | 52 | 0.634039 | # Copyright (c) 2020, Manfred Moitzi
# License: MIT License
import pytest
import struct
from ezdxf.tools.binarydata import ByteStream
def test_init():
bs = ByteStream(b"ABCDABC\x00")
assert bs.index == 0
assert len(bs.buffer) == 8
def test_read_ps():
bs = ByteStream(b"ABCDABC\x00")
s = bs.read_... | 0 | 0 | 0 | 0 | 0 | 822 | 0 | 16 | 159 |
ce419bc527e1b664bf9bbbc81adcd30927663d4c | 2,970 | py | Python | third_party/unicode/utn11_test.py | cibu/language-resources | a6158942286112b2808460b2cdbcb03260e8879b | [
"Apache-2.0"
] | 177 | 2019-05-31T17:58:29.000Z | 2022-03-27T11:24:00.000Z | third_party/unicode/utn11_test.py | cibu/language-resources | a6158942286112b2808460b2cdbcb03260e8879b | [
"Apache-2.0"
] | 21 | 2019-05-29T09:51:11.000Z | 2021-12-08T01:54:13.000Z | third_party/unicode/utn11_test.py | cibu/language-resources | a6158942286112b2808460b2cdbcb03260e8879b | [
"Apache-2.0"
] | 57 | 2015-09-28T12:05:27.000Z | 2019-05-15T05:44:50.000Z | from __future__ import unicode_literals
import unittest
CANONICAL_PAIRS = [
('\u1010\u102D\u103A', '\u1010\u103A\u102D'),
('\u1010\u103A\u102D', '\u1010\u103A\u102D'),
('\u101B\u1031\u1037\u103E', '\u101B\u103E\u1031\u1037'),
('\u101B\u1031\u103E\u1037', '\u101B\u103E\u1031\u1037'),
('\u101B\u1037\u1031\u1... | 43.676471 | 71 | 0.686869 | from __future__ import unicode_literals
import unittest
import utn11
CANONICAL_PAIRS = [
('\u1010\u102D\u103A', '\u1010\u103A\u102D'),
('\u1010\u103A\u102D', '\u1010\u103A\u102D'),
('\u101B\u1031\u1037\u103E', '\u101B\u103E\u1031\u1037'),
('\u101B\u1031\u103E\u1037', '\u101B\u103E\u1031\u1037'),
('\u101B\... | 0 | 0 | 0 | 228 | 0 | 0 | 0 | -9 | 46 |
959d7c3b11f328393d9ee94edf03e5ccaec9ef18 | 2,153 | py | Python | FPGA Ethernet Mac.py/Font.py | yinedeng/Kryon | 4b060ff930c7877cc35405b1e5dee240f24544ff | [
"Apache-2.0"
] | 229 | 2018-07-04T03:54:37.000Z | 2022-03-29T08:10:44.000Z | FPGA Ethernet Mac.py/Font.py | ljyearnl/Kryon | 6fefc5eae0d2e13674ae73da2743103ea37199a6 | [
"Apache-2.0"
] | 1 | 2018-07-11T01:53:58.000Z | 2018-07-12T23:59:26.000Z | FPGA Ethernet Mac.py/Font.py | ljyearnl/Kryon | 6fefc5eae0d2e13674ae73da2743103ea37199a6 | [
"Apache-2.0"
] | 92 | 2018-07-31T09:10:57.000Z | 2022-03-22T01:12:21.000Z | from PIL import Image, ImageDraw, ImageFont
def (Size):
return ImageFont.truetype("msyh.ttf", Size)
def (x, y, , ):
= ([0] + x * , [1] + y * )
= ([0] + x * + , [1] + y * + )
return [, ]
ASCII = ''
for i in range(33, 128):
ASCII += chr(i)
Size = 16
FontImage = Image.new("... | 33.640625 | 103 | 0.594519 | from PIL import Image,ImageDraw,ImageFont
def 微软雅黑(Size):
return ImageFont.truetype("msyh.ttf", Size)
def consola(Size):
return ImageFont.truetype("consola.ttf", Size)
def CalibriL(Size):
return ImageFont.truetype("CalibriL.ttf", Size)
def calibri(Size):
return ImageFont.truetype("calibri.... | 138 | 0 | 0 | 0 | 0 | 196 | 0 | -2 | 96 |
e51f4411a8070abd0c304c781a0f1b62b1183e4f | 618 | py | Python | setup.py | agedroics/pyscrabble | 953d8d0021b7a7b73858c175d47e6b7634fdc2af | [
"MIT"
] | 2 | 2020-04-08T20:23:20.000Z | 2022-01-02T05:01:43.000Z | setup.py | armands3312/pyscrabble | 953d8d0021b7a7b73858c175d47e6b7634fdc2af | [
"MIT"
] | null | null | null | setup.py | armands3312/pyscrabble | 953d8d0021b7a7b73858c175d47e6b7634fdc2af | [
"MIT"
] | 1 | 2019-09-27T11:26:07.000Z | 2019-09-27T11:26:07.000Z | from setuptools import setup
setup(
name='pyscrabble',
version='1.0',
author='Armands Gedroics',
author_email='armands.gedroics@gmail.com',
url='https://github.com/armands3312/pyscrabble',
description='Multiplayer word game',
classifiers=[
'License :: OSI Approved :: MIT License',
... | 26.869565 | 53 | 0.610032 | from setuptools import setup
setup(
name='pyscrabble',
version='1.0',
author='Armands Gedroics',
author_email='armands.gedroics@gmail.com',
url='https://github.com/armands3312/pyscrabble',
description='Multiplayer word game',
classifiers=[
'License :: OSI Approved :: MIT License',
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ec8aa14a020600ba03d9828f097fee8cf535e017 | 307 | py | Python | prod/cbreaker/mail.py | smhillin/workshop | 4388230703814f7f49c1e2d0f4dbcf8d6dcd823b | [
"Apache-2.0"
] | 2,112 | 2016-11-23T19:40:27.000Z | 2022-03-29T11:11:56.000Z | prod/cbreaker/mail.py | smhillin/workshop | 4388230703814f7f49c1e2d0f4dbcf8d6dcd823b | [
"Apache-2.0"
] | 26 | 2017-06-10T03:58:06.000Z | 2021-03-29T13:32:05.000Z | prod/cbreaker/mail.py | AlexRogalskiy/workshop-1 | cd7adf91d9e461b9cf87d75f0084167514e036c8 | [
"Apache-2.0"
] | 245 | 2016-11-29T22:04:37.000Z | 2022-03-11T23:19:29.000Z | from flask import Flask
app = Flask(__name__)
if __name__ == "__main__":
app.run(host='0.0.0.0')
| 25.583333 | 75 | 0.602606 | from flask import Flask,jsonify
app = Flask(__name__)
@app.route("/")
def hello():
return jsonify([
{"from": "<bob@example.com>", "subject": "lunch at noon tomorrow"},
{"from": "<alice@example.com>", "subject": "compiler docs"}])
if __name__ == "__main__":
app.run(host='0.0.0.0')
| 0 | 174 | 0 | 0 | 0 | 0 | 0 | 8 | 23 |
116b19e8762867551fc793e4e82634cf41c8fbd6 | 855 | py | Python | Python/Python For Absolute Beginner/66 Diamond Shape Problem In Multiple Inheritance.py | omkarsutar1255/Python-Data | 169d0c54b23d9dd5a7f1aea41ab385121c3b3c63 | [
"CC-BY-3.0"
] | null | null | null | Python/Python For Absolute Beginner/66 Diamond Shape Problem In Multiple Inheritance.py | omkarsutar1255/Python-Data | 169d0c54b23d9dd5a7f1aea41ab385121c3b3c63 | [
"CC-BY-3.0"
] | null | null | null | Python/Python For Absolute Beginner/66 Diamond Shape Problem In Multiple Inheritance.py | omkarsutar1255/Python-Data | 169d0c54b23d9dd5a7f1aea41ab385121c3b3c63 | [
"CC-BY-3.0"
] | null | null | null |
a = A()
b = B()
d = D('king') # calling init method of class D()
d.met() # get first inheritance class for D that is B so called B class met function
| 24.428571 | 85 | 0.6 | class A:
def met(self):
print("method of class A")
class B(A): # If not in class B then from class A
def __init__(self):
print('sutar')
def met(self):
print("method of class B")
class C(A): # If not in class C then from class A
def __init__(self, name):
print('omka... | 0 | 0 | 0 | 606 | 0 | 0 | 0 | 0 | 91 |
07dbb0473262f3456d869d912a25c03083c178be | 44 | py | Python | app/__init__.py | muhlba91/ledpi-controller-app | 8717bd4ad285c0874047f71b7b06ad3baa962ceb | [
"MIT"
] | 1 | 2021-01-23T12:40:34.000Z | 2021-01-23T12:40:34.000Z | ledpi_controller/__init__.py | muhlba91/ledpi-controller | 5cb8bdd40b4fc26a8c9bfb7b3394b6b53e60780b | [
"MIT"
] | 3 | 2021-01-08T09:55:51.000Z | 2021-05-13T08:39:13.000Z | ledpi_controller/__init__.py | muhlba91/ledpi-controller | 5cb8bdd40b4fc26a8c9bfb7b3394b6b53e60780b | [
"MIT"
] | null | null | null | """WS2801 controller on an Raspberry Pi."""
| 22 | 43 | 0.704545 | """WS2801 controller on an Raspberry Pi."""
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
13ccd5577496bd6f7835aa85e9a3330e7c85e600 | 3,391 | py | Python | tests/test_rpyc_over_rpyc.py | pdxjohnny/rpyc | bc8f0223be8436fa77c71cda94cc6610d621a364 | [
"MIT"
] | 238 | 2020-09-02T22:26:44.000Z | 2022-03-31T17:49:55.000Z | tests/test_rpyc_over_rpyc.py | pdxjohnny/rpyc | bc8f0223be8436fa77c71cda94cc6610d621a364 | [
"MIT"
] | 87 | 2020-09-02T20:10:35.000Z | 2022-03-16T16:49:47.000Z | tests/test_rpyc_over_rpyc.py | pdxjohnny/rpyc | bc8f0223be8436fa77c71cda94cc6610d621a364 | [
"MIT"
] | 40 | 2020-09-13T19:53:51.000Z | 2022-03-21T09:17:48.000Z | import unittest
CONNECT_CONFIG = {"allow_setattr": True}
if __name__ == "__main__":
unittest.main()
| 32.295238 | 117 | 0.660277 | import rpyc
from rpyc.utils.server import ThreadedServer
import unittest
CONNECT_CONFIG = {"allow_setattr": True}
class Fee(object):
def __init__(self, msg="Fee"):
self._msg = msg
@property
def exposed_msg(self):
return self._msg
@exposed_msg.setter
def exposed_msg(self, value)... | 0 | 98 | 0 | 3,033 | 0 | 0 | 0 | 13 | 136 |
cee818b18c3ae15b835d09d234a7dcda85d6ef9e | 7,833 | py | Python | turbinia/client.py | Weeshlow/turbinia | 368e1afdef1947fac9d9c73a078a4ee413800c2d | [
"Apache-2.0"
] | 1 | 2018-06-30T06:36:38.000Z | 2018-06-30T06:36:38.000Z | turbinia/client.py | Weeshlow/turbinia | 368e1afdef1947fac9d9c73a078a4ee413800c2d | [
"Apache-2.0"
] | null | null | null | turbinia/client.py | Weeshlow/turbinia | 368e1afdef1947fac9d9c73a078a4ee413800c2d | [
"Apache-2.0"
] | 1 | 2018-06-30T06:35:18.000Z | 2018-06-30T06:35:18.000Z | # -*- coding: utf-8 -*-
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 34.20524 | 80 | 0.658496 | # -*- coding: utf-8 -*-
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 0 | 0 | 0 | 6,638 | 0 | 0 | 0 | 46 | 291 |
67dea51ed60ead0476b8232f33ccfb90c4988f30 | 494 | py | Python | Python_Basics/Tip Calculator.py | LAALA-JI/PYTHON-108 | 45a3fbd1d71fb1be4eab85aea8cf99c0d92b9159 | [
"MIT"
] | null | null | null | Python_Basics/Tip Calculator.py | LAALA-JI/PYTHON-108 | 45a3fbd1d71fb1be4eab85aea8cf99c0d92b9159 | [
"MIT"
] | null | null | null | Python_Basics/Tip Calculator.py | LAALA-JI/PYTHON-108 | 45a3fbd1d71fb1be4eab85aea8cf99c0d92b9159 | [
"MIT"
] | null | null | null | print("Welcome to tip calculator! ")
bill = float(input('What was the total bill ? '))
tip = int(input("How much tip would you like to give ? 10 , 12, 15 : "))
people = int(input('How many people would like to split the bill ? '))
tip_amount = (tip/100)* bill
total_bill = tip_amount + bill
final_amount = total_bi... | 18.296296 | 73 | 0.635628 | print("Welcome to tip calculator! ")
bill = float(input('What was the total bill ? ₹'))
tip = int(input("How much tip would you like to give ? 10 , 12, 15 : "))
people = int(input('How many people would like to split the bill ? '))
tip_amount = (tip/100)* bill
total_bill = tip_amount + bill
final_amount = total_b... | 9 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e41269322c96940f9db65539b0fb751bb8fab83a | 1,661 | py | Python | py_power_meter_monitor/iec_62056_protocol/obis_data_block.py | weltenwort/py-power-meter-monitor | cb7244c83a8985ff3417404c1d1f3ebf5df12fd9 | [
"MIT"
] | null | null | null | py_power_meter_monitor/iec_62056_protocol/obis_data_block.py | weltenwort/py-power-meter-monitor | cb7244c83a8985ff3417404c1d1f3ebf5df12fd9 | [
"MIT"
] | 64 | 2021-04-01T20:08:16.000Z | 2022-03-31T18:09:25.000Z | py_power_meter_monitor/iec_62056_protocol/obis_data_block.py | weltenwort/py-power-meter-monitor | cb7244c83a8985ff3417404c1d1f3ebf5df12fd9 | [
"MIT"
] | null | null | null | from .obis_data_set import (ObisId)
METERING_POINT_ID_OBIS_IDS: list[ObisId] = [
(1, 0, 0, 0, 0),
(1, 1, 0, 0, 0),
(1, 0, 96, 1, 0, 255),
]
| 27.229508 | 87 | 0.639976 | from dataclasses import dataclass
from ..config import ObisDataSetConfig
from .data_block import DataBlock, DataSet
from .obis_data_set import (
ObisDataSet,
ObisId,
ObisStringDataSet,
UnknownObisDataSet,
parse_obis_id_from_address,
)
METERING_POINT_ID_OBIS_IDS: list[ObisId] = [
(1, 0, 0, 0, ... | 0 | 1,263 | 0 | 0 | 0 | 0 | 0 | 153 | 90 |
11df651f2ed7a02bea165b6fdf8e02337a899ea3 | 79,162 | py | Python | nemo/completeness.py | simonsobs/nemo | ab72fa1c5ea878fcb63eaf31642b3d7bdd6ac636 | [
"BSD-3-Clause"
] | 2 | 2021-01-11T13:10:27.000Z | 2022-03-09T16:31:48.000Z | nemo/completeness.py | simonsobs/nemo | ab72fa1c5ea878fcb63eaf31642b3d7bdd6ac636 | [
"BSD-3-Clause"
] | 3 | 2020-11-11T10:44:47.000Z | 2022-01-05T07:28:58.000Z | nemo/completeness.py | simonsobs/nemo | ab72fa1c5ea878fcb63eaf31642b3d7bdd6ac636 | [
"BSD-3-Clause"
] | 1 | 2021-03-05T18:31:00.000Z | 2021-03-05T18:31:00.000Z | """
This module contains tools for calculating the completeness of cluster samples and handling area masks.
"""
import os
import numpy as np
import pylab as plt
import astropy.table as atpy
from scipy import stats
from scipy import interpolate
import nemo
from . import maps
from . import plotSettings
import colorcet... | 50.842646 | 210 | 0.604318 | """
This module contains tools for calculating the completeness of cluster samples and handling area masks.
"""
import os
import sys
import resource
import glob
import numpy as np
import pylab as plt
import astropy.table as atpy
from astLib import *
from scipy import stats
from scipy import interpolate
from scipy.in... | 9 | 0 | 0 | 25,708 | 0 | 0 | 0 | 25 | 352 |
d4a59f7b12ce60d5ba0b4113092657b91ffe0526 | 8,153 | py | Python | approximated-td0.py | avlaskin/reinforcement-learning | e98621791dfc1ff69c8776140305d66f95556c3b | [
"MIT"
] | null | null | null | approximated-td0.py | avlaskin/reinforcement-learning | e98621791dfc1ff69c8776140305d66f95556c3b | [
"MIT"
] | null | null | null | approximated-td0.py | avlaskin/reinforcement-learning | e98621791dfc1ff69c8776140305d66f95556c3b | [
"MIT"
] | null | null | null | from __future__ import print_function
if __name__ == '__main__':
##test_td0_approximation_method(itterations = 50000)
test_td0_sarsa_approximated()
| 35.294372 | 142 | 0.581381 | from __future__ import print_function
import matplotlib.pyplot as plt
import numpy as np
from enum import IntEnum
from gridWorld import StandardGrid
from gridWorld import NegativeGrid
from gridWorld import GridWorldMove
from gridWorld import RandomPolicy
from printHelpers import print_values
from printHelpers import p... | 0 | 0 | 0 | 2,476 | 0 | 4,994 | 0 | 121 | 405 |
c54873e208c3db5362e06e77e8d05dd0f16de732 | 8,399 | py | Python | discord/voice/gateway.py | Hype3808/RPD | 78ba69cf132fd0c07264a9a142866b79e94a60d5 | [
"Apache-2.0"
] | null | null | null | discord/voice/gateway.py | Hype3808/RPD | 78ba69cf132fd0c07264a9a142866b79e94a60d5 | [
"Apache-2.0"
] | null | null | null | discord/voice/gateway.py | Hype3808/RPD | 78ba69cf132fd0c07264a9a142866b79e94a60d5 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# cython: language_level=3
# Copyright (c) 2021-present VincentRPS
# 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 t... | 32.808594 | 102 | 0.575664 | # -*- coding: utf-8 -*-
# cython: language_level=3
# Copyright (c) 2021-present VincentRPS
# 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 t... | 0 | 250 | 5,805 | 986 | 0 | 0 | 0 | -28 | 158 |
9232d225dcacda95ab8d60aeff95d2e028058985 | 3,233 | py | Python | lidartools/annotations.py | leifdenby/lidartools | 529baa5cd2d489e742a1cdaf23316f94edd6b59a | [
"Apache-2.0"
] | null | null | null | lidartools/annotations.py | leifdenby/lidartools | 529baa5cd2d489e742a1cdaf23316f94edd6b59a | [
"Apache-2.0"
] | null | null | null | lidartools/annotations.py | leifdenby/lidartools | 529baa5cd2d489e742a1cdaf23316f94edd6b59a | [
"Apache-2.0"
] | null | null | null | import numpy as np
def annotate_with_sunrise_and_sunset(ax, da_time):
"""
Annotate axes `ax` x-axis with all sunset and sunrise times in the time
interval spanned by `da_time`
"""
for (t, kind) in get_sunrise_and_sunset_times_utc(
da_time.min().values, da_time.max().values
):
... | 31.086538 | 82 | 0.622023 | import numpy as np
import datetime
from matplotlib.dates import num2date, date2num
def get_sunrise_and_sunset_times_utc(t_start, t_end):
"""
Return all sunrise and sunset times between `t_start` and `t_end` at BCO as
`(time, kind)` where `time` will be a `np.datetim64` and kind is either
`"sunrise"` o... | 0 | 95 | 0 | 0 | 1,131 | 526 | 0 | 20 | 167 |
456156ac27ccf90a275d791aeab9a8d10eba5ece | 1,836 | py | Python | mycode/convert_quan_ban.py | Narcissuscyn/OCR_ICPR2018 | 9f3b9c7c47bdc0d9d8d1aae39592f43d01d38b72 | [
"MIT"
] | 2 | 2019-04-19T12:57:32.000Z | 2020-05-12T06:11:38.000Z | mycode/convert_quan_ban.py | Narcissuscyn/OCR_ICPR2018 | 9f3b9c7c47bdc0d9d8d1aae39592f43d01d38b72 | [
"MIT"
] | null | null | null | mycode/convert_quan_ban.py | Narcissuscyn/OCR_ICPR2018 | 9f3b9c7c47bdc0d9d8d1aae39592f43d01d38b72 | [
"MIT"
] | null | null | null |
line=[]
with open('./mycode/n.txt','r',encoding='utf8') as f1:
line=f1.readlines()
f=open('./mycode/n1.txt','w+',encoding='utf8')
for char in line[0]:
if is_quan_alphabet(char) or is_quan_number(char):
print(char)
else:
f.write(char)
f.close()
| 27.402985 | 194 | 0.578976 |
def strQ2B( ustring):
ss = []
for s in ustring:
rstring = ""
for uchar in s:
inside_code = ord(uchar)
if inside_code == 12288: # 全角空格直接转换
inside_code = 32
elif (inside_code >= 65281 and inside_code <= 65374): # 全角字符(除空格)根据关系转化
... | 69 | 0 | 0 | 0 | 0 | 1,374 | 0 | 0 | 161 |
e0f6a952ea7f89c0a3125989667192a4b799fb05 | 20,089 | py | Python | wagtail_meilisearch/backend.py | hactar-is/wagtail-meilisearch | 415935a5921108f63e2eeb40f6138b994da5f11f | [
"MIT"
] | 21 | 2020-04-03T09:44:44.000Z | 2022-03-23T08:10:42.000Z | wagtail_meilisearch/backend.py | hactar-is/wagtail-meilisearch | 415935a5921108f63e2eeb40f6138b994da5f11f | [
"MIT"
] | 1 | 2020-05-19T17:40:59.000Z | 2020-05-19T17:43:32.000Z | wagtail_meilisearch/backend.py | hactar-is/wagtail-meilisearch | 415935a5921108f63e2eeb40f6138b994da5f11f | [
"MIT"
] | 1 | 2020-05-19T17:36:59.000Z | 2020-05-19T17:36:59.000Z |
# stdlib
# 3rd party
try:
except ImportError:
pass
else:
USING_CACHEOPS = True
AUTOCOMPLETE_SUFFIX = '_ngrams'
FILTER_SUFFIX = '_filter'
SearchBackend = MeiliSearchBackend
| 33.481667 | 99 | 0.587635 | import sys
# stdlib
from operator import itemgetter
from functools import lru_cache
# 3rd party
import arrow
import meilisearch
from django.apps import apps
from django.db.models import Q, Case, When, Model, Manager, QuerySet
from wagtail.search.index import (
FilterField, SearchField, RelatedFields, Autocomplete... | 0 | 860 | 0 | 17,965 | 0 | 225 | 0 | 344 | 498 |
5ce8b042ec17e93d56a459011c933b98c23da1ff | 7,767 | py | Python | savu/plugins/ring_removal/remove_unresponsive_and_fluctuating_rings.py | malte-storm/Savu | 16291e8a22464c50c511af01fbc648860c1236e6 | [
"Apache-2.0"
] | 1 | 2021-04-18T09:30:54.000Z | 2021-04-18T09:30:54.000Z | savu/plugins/ring_removal/remove_unresponsive_and_fluctuating_rings.py | malte-storm/Savu | 16291e8a22464c50c511af01fbc648860c1236e6 | [
"Apache-2.0"
] | 1 | 2019-07-30T12:31:51.000Z | 2019-07-30T12:31:51.000Z | savu/plugins/ring_removal/remove_unresponsive_and_fluctuating_rings.py | malte-storm/Savu | 16291e8a22464c50c511af01fbc648860c1236e6 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Diamond Light Source Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | 42.211957 | 90 | 0.623407 | # Copyright 2014 Diamond Light Source Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | 0 | 6,578 | 0 | 0 | 0 | 0 | 0 | 169 | 222 |
5729fafbe6149bed3c7876222d92d51c484b176b | 2,942 | py | Python | gmc/test/__init__.py | kapilgarg1996/gmc | 9e35126fed662a0a2abf5d91f32b239862341d83 | [
"MIT"
] | 2 | 2017-04-28T20:05:05.000Z | 2017-05-31T16:12:54.000Z | gmc/test/__init__.py | kapilgarg1996/gmc | 9e35126fed662a0a2abf5d91f32b239862341d83 | [
"MIT"
] | 6 | 2017-04-26T10:32:15.000Z | 2017-05-30T23:51:06.000Z | gmc/test/__init__.py | kapilgarg1996/gmc | 9e35126fed662a0a2abf5d91f32b239862341d83 | [
"MIT"
] | null | null | null |
# @contextmanager
# def subTest(self, **kwargs):
# #Ugly way to provide functionality for unittest.TestCase subTest()
# for item in kwargs:
# setattr(self, item, kwargs[item])
# try:
# yield
# except Exception:
# exctype, value, tb = sys.exc_... | 29.717172 | 84 | 0.57274 | import unittest
import os
import sys
import tempfile
import shutil
import importlib
import traceback
from contextlib import contextmanager
from gmc.conf import settings, ENVIRONMENT_VARIABLE
class TestCase(unittest.TestCase):
@classmethod
def setUpClass(cls):
super(TestCase, cls).setUpClass()
... | 0 | 1,751 | 0 | 13 | 0 | 0 | 0 | -7 | 275 |
37d57ec3a45725e4b56c3fef266ede06d3781f28 | 10,435 | py | Python | src/data_shaper.py | posl/kuramoto-msr2022 | b0301e1ddfdc66e6139fd2697d3354fd917652fa | [
"MIT"
] | null | null | null | src/data_shaper.py | posl/kuramoto-msr2022 | b0301e1ddfdc66e6139fd2697d3354fd917652fa | [
"MIT"
] | 1 | 2022-01-24T05:28:33.000Z | 2022-01-24T05:28:33.000Z | src/data_shaper.py | posl/kuramoto-msr2022 | b0301e1ddfdc66e6139fd2697d3354fd917652fa | [
"MIT"
] | null | null | null | import csv
import sys
csv.field_size_limit(sys.maxsize)
if __name__ == "__main__":
main()
print("\n\n\033[32m...........all tasks done!!...........\033[0m\n")
| 48.310185 | 142 | 0.461715 | from re import T
import my_log
import os
import glob
from tqdm import tqdm
from datetime import datetime as dt
import ast
import csv
import sys
import math
csv.field_size_limit(sys.maxsize)
def main():
wd = os.getcwd()
repos = glob.glob(f"{wd}/out/out_for_issue/*")
# ファイル操作オブジェクト
in_f = my_log.mylog(f... | 228 | 0 | 0 | 0 | 0 | 9,988 | 0 | -42 | 244 |
33f0e501503c16b1a4d55bf8b8a21490284675c3 | 2,302 | py | Python | tests/swagger_generation/test_swagger_generator_hidden_api.py | sourya-deepsource/flask-rebar | 6c4a763228ab2c49585c695e4efc8e390f37e55b | [
"MIT"
] | null | null | null | tests/swagger_generation/test_swagger_generator_hidden_api.py | sourya-deepsource/flask-rebar | 6c4a763228ab2c49585c695e4efc8e390f37e55b | [
"MIT"
] | 1 | 2020-12-15T14:48:26.000Z | 2020-12-15T15:22:48.000Z | tests/swagger_generation/test_swagger_generator_hidden_api.py | sourya-deepsource/flask-rebar | 6c4a763228ab2c49585c695e4efc8e390f37e55b | [
"MIT"
] | 1 | 2020-12-15T14:43:46.000Z | 2020-12-15T14:43:46.000Z | """
Test Swagger Generation
~~~~~~~~~~~~~~~~~~~~~~~
Tests for converting a handler registry to a Swagger specification.
:copyright: Copyright 2018 PlanGrid, Inc., see AUTHORS.
:license: MIT, see LICENSE for details.
"""
| 30.693333 | 80 | 0.728497 | """
Test Swagger Generation
~~~~~~~~~~~~~~~~~~~~~~~
Tests for converting a handler registry to a Swagger specification.
:copyright: Copyright 2018 PlanGrid, Inc., see AUTHORS.
:license: MIT, see LICENSE for details.
"""
import json
import marshmallow as m
import pytest
from flask_rebar.rebar imp... | 0 | 1,214 | 0 | 0 | 0 | 148 | 0 | 361 | 335 |
d053e732c52454b01a5692e4fc206178c1df114d | 664 | py | Python | resources/PyInstaller-3.0/tests/functional/scripts/pyi_dynamic_module.py | dvt32/mypymodoro | 7d2db639ea828e4db9caa84cd6f747f542ab22d8 | [
"MIT"
] | null | null | null | resources/PyInstaller-3.0/tests/functional/scripts/pyi_dynamic_module.py | dvt32/mypymodoro | 7d2db639ea828e4db9caa84cd6f747f542ab22d8 | [
"MIT"
] | null | null | null | resources/PyInstaller-3.0/tests/functional/scripts/pyi_dynamic_module.py | dvt32/mypymodoro | 7d2db639ea828e4db9caa84cd6f747f542ab22d8 | [
"MIT"
] | null | null | null | #-----------------------------------------------------------------------------
# Copyright (c) 2005-2015, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this s... | 34.947368 | 78 | 0.564759 | #-----------------------------------------------------------------------------
# Copyright (c) 2005-2015, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this s... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c450442b806866967c972b58d47709fab910bc3b | 21,849 | py | Python | src/main.py | nihlen/bf2-auto-spectator | 21a50b39f2525bc8bdc3a25071f5bf61637dd5f2 | [
"MIT"
] | 6 | 2020-03-29T01:25:45.000Z | 2022-01-12T04:49:06.000Z | src/main.py | nihlen/bf2-auto-spectator | 21a50b39f2525bc8bdc3a25071f5bf61637dd5f2 | [
"MIT"
] | 3 | 2021-05-21T10:43:38.000Z | 2022-03-12T00:42:41.000Z | src/main.py | nihlen/bf2-auto-spectator | 21a50b39f2525bc8bdc3a25071f5bf61637dd5f2 | [
"MIT"
] | 2 | 2021-01-26T03:24:38.000Z | 2021-12-26T23:53:30.000Z | import argparse
import logging
import os
import pickle
import sys
import time
from datetime import datetime
import constants
from config import Config
from controller import Controller
from gameinstancemanager import GameInstanceManager
from helpers import is_responding_pid, find_window_by_title, taskkill_pid, init_py... | 46.586354 | 126 | 0.671839 | import argparse
import logging
import os
import pickle
import sys
import time
from datetime import datetime
import constants
from config import Config
from controller import Controller
from exceptions import *
from gameinstancemanager import GameInstanceManager
from helpers import is_responding_pid, find_window_by_tit... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 | 22 |
741b9bd7945eb923663435c33c23b0aaef897c5f | 2,031 | py | Python | roles/openshift-cluster-topology/files/openshift_config_scraper.py | zulcss/stockpile | d8a982626a4468c43b1c8b48f989dab45be9b7bb | [
"Apache-2.0"
] | 3 | 2019-09-24T13:09:23.000Z | 2020-09-25T10:27:46.000Z | roles/openshift-cluster-topology/files/openshift_config_scraper.py | zulcss/stockpile | d8a982626a4468c43b1c8b48f989dab45be9b7bb | [
"Apache-2.0"
] | 42 | 2019-09-24T13:00:57.000Z | 2021-07-16T15:56:34.000Z | roles/openshift-cluster-topology/files/openshift_config_scraper.py | zulcss/stockpile | d8a982626a4468c43b1c8b48f989dab45be9b7bb | [
"Apache-2.0"
] | 11 | 2019-11-27T20:28:07.000Z | 2021-07-15T19:36:12.000Z | #!/usr/bin/env python
import sys
import argparse
ocp_node_configmap_path = "/tmp/node-config.yaml"
ocp_webconsole_configmap_path = "/tmp/webconsole-config.yaml"
ocp_cluster_info_configmap_path = "/tmp/id"
ocp_config_dir = "/tmp"
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument... | 38.320755 | 178 | 0.692762 | #!/usr/bin/env python
import yaml
import sys
import os
import json
import argparse
ocp_node_configmap_path = "/tmp/node-config.yaml"
ocp_webconsole_configmap_path = "/tmp/webconsole-config.yaml"
ocp_cluster_info_configmap_path = "/tmp/id"
ocp_config_dir = "/tmp"
def scrape_configmap(cfg_type, namespace, configmap_pa... | 0 | 0 | 0 | 0 | 0 | 1,386 | 0 | -32 | 113 |
ffbd197e6be02456ef8d8b2dc2fe05c9dd10336b | 412 | py | Python | optimade_gateway/mappers/gateways.py | Materials-Consortia/optimade-gateway | b73efe755d53f38cb23cb90805742de7149181aa | [
"MIT"
] | 3 | 2021-04-18T19:49:51.000Z | 2022-01-29T17:50:34.000Z | optimade_gateway/mappers/gateways.py | Materials-Consortia/optimade-gateway | b73efe755d53f38cb23cb90805742de7149181aa | [
"MIT"
] | 162 | 2021-04-19T21:11:52.000Z | 2022-03-30T06:45:27.000Z | optimade_gateway/mappers/gateways.py | Materials-Consortia/optimade-gateway | b73efe755d53f38cb23cb90805742de7149181aa | [
"MIT"
] | null | null | null | """Resource mapper for
[`GatewayResource`][optimade_gateway.models.gateways.GatewayResource]."""
| 34.333333 | 87 | 0.808252 | """Resource mapper for
[`GatewayResource`][optimade_gateway.models.gateways.GatewayResource]."""
from optimade_gateway.models import GatewayResource
from optimade_gateway.mappers.base import BaseResourceMapper
class GatewaysMapper(BaseResourceMapper):
"""[`GatewayResource`][optimade_gateway.models.gateways.Gatewa... | 0 | 0 | 0 | 178 | 0 | 0 | 0 | 69 | 67 |
e0820979e84da9f42d3465fd1acfa791496499f2 | 7,662 | py | Python | Assignments/HW2/some resources/CriminisiAlG/test1.py | billgoo/Rutgers-CS534-Computer-Vision | 36b8ce54e31f78ad2d22c5e74e4257aa234c9898 | [
"MIT"
] | null | null | null | Assignments/HW2/some resources/CriminisiAlG/test1.py | billgoo/Rutgers-CS534-Computer-Vision | 36b8ce54e31f78ad2d22c5e74e4257aa234c9898 | [
"MIT"
] | null | null | null | Assignments/HW2/some resources/CriminisiAlG/test1.py | billgoo/Rutgers-CS534-Computer-Vision | 36b8ce54e31f78ad2d22c5e74e4257aa234c9898 | [
"MIT"
] | null | null | null | from __future__ import division # uncomment this if using Python 2.7
import numpy as np
from scipy import spatial
from scipy.ndimage import gaussian_filter, sobel
import matplotlib.pyplot as plt
from matplotlib import cm
from skimage import data, color, img_as_float, io
from skimage.morphology import erosion, disk
impo... | 39.494845 | 276 | 0.560298 | from __future__ import division # uncomment this if using Python 2.7
import numpy as np
from scipy import spatial
from scipy.ndimage import gaussian_filter, sobel
import matplotlib.pyplot as plt
from matplotlib import cm
from skimage import data, color, img_as_float, io
from skimage.morphology import erosion, disk
impo... | 0 | 0 | 0 | 0 | 0 | 985 | 0 | -3 | 45 |
ac838215d76288513dca36fa8e8835e475f1a649 | 8,019 | py | Python | code/play.py | hanouticelina/dice-battle | edd89cde059c8b597b39e3553f7302d0b9467dfe | [
"MIT"
] | null | null | null | code/play.py | hanouticelina/dice-battle | edd89cde059c8b597b39e3553f7302d0b9467dfe | [
"MIT"
] | null | null | null | code/play.py | hanouticelina/dice-battle | edd89cde059c8b597b39e3553f7302d0b9467dfe | [
"MIT"
] | null | null | null |
bold = '\x1b[;1m'
blue = '\x1b[34;6m'
green = '\x1b[32;6m'
red = '\x1b[31;6m'
reset = '\x1b[m'
main()
| 41.984293 | 223 | 0.435715 | import random
import numpy as np
import os
import copy
import time
import dice_battle_seq as dice_seq
import dice_battle_sim as dice_sim
import print_dice
bold = '\x1b[;1m'
blue = '\x1b[34;6m'
green = '\x1b[32;6m'
red = '\x1b[31;6m'
reset = '\x1b[m'
def main_menu():
os.system('clear')
print(bold + red + " " ... | 52 | 0 | 0 | 0 | 0 | 7,687 | 0 | -21 | 222 |