hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f742323cba2f955aa471f37f50b54def3f818a71 | 2,233 | py | Python | src/comp_first/src/wander_sim.py | stwklu/CMPUT_412_code | 9879196d71aab0e889c91c7a7e0f0d6e120e86aa | [
"Apache-2.0"
] | null | null | null | src/comp_first/src/wander_sim.py | stwklu/CMPUT_412_code | 9879196d71aab0e889c91c7a7e0f0d6e120e86aa | [
"Apache-2.0"
] | null | null | null | src/comp_first/src/wander_sim.py | stwklu/CMPUT_412_code | 9879196d71aab0e889c91c7a7e0f0d6e120e86aa | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import rospy
from geometry_msgs.msg import Twist
from sensor_msgs.msg import Joy
from sensor_msgs.msg import LaserScan
from math import radians
import numpy as np
class BehaviorSwitch(object):
def __init__(self):
self.running = False
def callback(self, joy_msg):
if joy_m... | 26.583333 | 79 | 0.703538 |
import rospy
from geometry_msgs.msg import Twist
from sensor_msgs.msg import Joy
from sensor_msgs.msg import LaserScan
from math import radians
import numpy as np
class BehaviorSwitch(object):
def __init__(self):
self.running = False
def callback(self, joy_msg):
if joy_msg.buttons[0] == 1:
... | false | true |
f7423283e8d6adb0a506f11ddfb9c00e612ebd41 | 1,292 | py | Python | Discount_bracket_replenishment.py | Peyo-Supp/Master-Production-Planning-Algorithm | c91bf9304bcf1ad7ecdf6729ee483a6e3de45a38 | [
"Apache-2.0"
] | null | null | null | Discount_bracket_replenishment.py | Peyo-Supp/Master-Production-Planning-Algorithm | c91bf9304bcf1ad7ecdf6729ee483a6e3de45a38 | [
"Apache-2.0"
] | null | null | null | Discount_bracket_replenishment.py | Peyo-Supp/Master-Production-Planning-Algorithm | c91bf9304bcf1ad7ecdf6729ee483a6e3de45a38 | [
"Apache-2.0"
] | null | null | null | import pandas as pd
import math as m
import numpy as np
"""
algorithm that calculate the best alternative from supplier order bracket based on data provided.
"""
#input data here!
# demand_in_cases =
# order_cost =
# cost_per_case =
# bracket_cost = []
# bracket_minimum = []
# holding_rate =
EOQ0 = np.sqrt((2*deman... | 21.898305 | 127 | 0.654025 | import pandas as pd
import math as m
import numpy as np
EOQ0 = np.sqrt((2*demand_in_cases*order_cost)/(cost_per_case*holding_rate))
ATCEOQ = demand_in_cases/EOQ0*order_cost + EOQ0/2*holding_rate*cost_per_case + demand_in_cases*cost_per_case
BM = np.array(bracket_minimum)
dfBM = pd.DataFrame({'1':[BM[0]],'... | true | true |
f742334f16399d13e2548e5571fc98e6737c5f53 | 3,157 | py | Python | app/ml.py | teamcfe/AI-as-an-API | a291fc0e6ec380139599a948f2efd58923c70784 | [
"Apache-2.0"
] | 28 | 2021-10-01T13:31:43.000Z | 2022-03-31T04:54:56.000Z | app/ml.py | teamcfe/AI-as-an-API | a291fc0e6ec380139599a948f2efd58923c70784 | [
"Apache-2.0"
] | null | null | null | app/ml.py | teamcfe/AI-as-an-API | a291fc0e6ec380139599a948f2efd58923c70784 | [
"Apache-2.0"
] | 20 | 2021-10-01T22:41:20.000Z | 2022-03-22T14:05:56.000Z | import json
import numpy as np
from typing import Optional, List
from pathlib import Path
from dataclasses import dataclass # pip install dataclasses
from tensorflow.keras.models import load_model
from tensorflow.keras.preprocessing.sequence import pad_sequences
from tensorflow.keras.preprocessing.text import tokeniz... | 34.692308 | 86 | 0.657586 | import json
import numpy as np
from typing import Optional, List
from pathlib import Path
from dataclasses import dataclass
from tensorflow.keras.models import load_model
from tensorflow.keras.preprocessing.sequence import pad_sequences
from tensorflow.keras.preprocessing.text import tokenizer_from_json
from . impo... | true | true |
f74233e7b27970a034f2ae6f52f054db35117435 | 5,020 | py | Python | asclepias_broker/metadata/api.py | ChiaraBi/asclepias-broker | 793e2634591eed926000b19bd342f044b29bedcc | [
"BSD-3-Clause"
] | null | null | null | asclepias_broker/metadata/api.py | ChiaraBi/asclepias-broker | 793e2634591eed926000b19bd342f044b29bedcc | [
"BSD-3-Clause"
] | null | null | null | asclepias_broker/metadata/api.py | ChiaraBi/asclepias-broker | 793e2634591eed926000b19bd342f044b29bedcc | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (C) 2018 CERN.
#
# Asclepias Broker is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Metadata functions."""
from datetime import datetime
from typing import List
import idutils
from flask impor... | 42.542373 | 123 | 0.622908 |
from datetime import datetime
from typing import List
import idutils
from flask import current_app
from invenio_db import db
from ..core.models import Identifier, Relation, Relationship
from ..graph.api import get_group_from_id, get_or_create_groups
from ..graph.models import GroupRelationship, GroupType
from... | true | true |
f74233f0663a42e0a75a02023a9c7f25a16bc80e | 2,190 | py | Python | modules/manifest.py | MeridianPY/SIVA | e3506e61edc550bef6f246ddfcaf80db27f8a790 | [
"MIT"
] | 11 | 2019-07-09T16:07:13.000Z | 2020-06-11T16:02:37.000Z | modules/manifest.py | MeridianPY/SIVA | e3506e61edc550bef6f246ddfcaf80db27f8a790 | [
"MIT"
] | 7 | 2019-07-09T14:42:21.000Z | 2019-12-07T13:58:39.000Z | modules/manifest.py | MeridianPY/SIVA | e3506e61edc550bef6f246ddfcaf80db27f8a790 | [
"MIT"
] | 2 | 2020-12-14T10:41:38.000Z | 2020-12-14T16:31:47.000Z | import zipfile, os, sys, aiohttp, json, requests
from modules.manifest_reader import ManifestReader
class Manifest:
def __init__(self, directory, headers=None):
self.headers = headers
self.directory = directory
self.manifests = {
'en': '',
'fr': '',
'es': '',
'de': '',
'it': '',
'ja': '', ... | 30.416667 | 112 | 0.652055 | import zipfile, os, sys, aiohttp, json, requests
from modules.manifest_reader import ManifestReader
class Manifest:
def __init__(self, directory, headers=None):
self.headers = headers
self.directory = directory
self.manifests = {
'en': '',
'fr': '',
'es': '',
'de': '',
'it': '',
'ja': '', ... | true | true |
f742341ef3c3228bdff507e631be9ccfb6a20704 | 44,436 | py | Python | nemo/collections/asr/data/audio_to_text.py | dynasty-com/NeMo | 1ac828df423fbcec1b34c650b3a20266bb133dde | [
"Apache-2.0"
] | null | null | null | nemo/collections/asr/data/audio_to_text.py | dynasty-com/NeMo | 1ac828df423fbcec1b34c650b3a20266bb133dde | [
"Apache-2.0"
] | null | null | null | nemo/collections/asr/data/audio_to_text.py | dynasty-com/NeMo | 1ac828df423fbcec1b34c650b3a20266bb133dde | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 41.259053 | 124 | 0.629377 |
import io
import os
from typing import Callable, Dict, List, Optional, Union
import braceexpand
import torch
import webdataset as wd
from torch.nn import functional as F
from nemo.collections.asr.data import vocabs
from nemo.collections.asr.parts import collections, parsers
from nemo.collections.asr.part... | true | true |
f7423441cca353ef062350181a27894dee3e3c72 | 1,987 | py | Python | tests/test_format.py | jedie/python-fastjsonschema | 32476cfd4d97f92cae52d686eb471361503bf4ba | [
"BSD-3-Clause"
] | null | null | null | tests/test_format.py | jedie/python-fastjsonschema | 32476cfd4d97f92cae52d686eb471361503bf4ba | [
"BSD-3-Clause"
] | null | null | null | tests/test_format.py | jedie/python-fastjsonschema | 32476cfd4d97f92cae52d686eb471361503bf4ba | [
"BSD-3-Clause"
] | null | null | null | import datetime
import re
import pytest
from fastjsonschema import JsonSchemaValueException
exc = JsonSchemaValueException('data must be date-time', value='{data}', name='data', definition='{definition}', rule='format')
@pytest.mark.parametrize('value, expected', [
('', exc),
('bla', exc),
('2018-02-05T... | 34.258621 | 131 | 0.617514 | import datetime
import re
import pytest
from fastjsonschema import JsonSchemaValueException
exc = JsonSchemaValueException('data must be date-time', value='{data}', name='data', definition='{definition}', rule='format')
@pytest.mark.parametrize('value, expected', [
('', exc),
('bla', exc),
('2018-02-05T... | true | true |
f74234636424ab51376e43ed4319ce0c6ca918f4 | 1,050 | py | Python | UICPC/21/nwerc2020all/islandtour/submissions/accepted/per_lazy.py | MilladMuhammadi/Competitive-Programming | 9f84a2d2734a5efe0e1fde0062e51782cd5af2c6 | [
"MIT"
] | null | null | null | UICPC/21/nwerc2020all/islandtour/submissions/accepted/per_lazy.py | MilladMuhammadi/Competitive-Programming | 9f84a2d2734a5efe0e1fde0062e51782cd5af2c6 | [
"MIT"
] | null | null | null | UICPC/21/nwerc2020all/islandtour/submissions/accepted/per_lazy.py | MilladMuhammadi/Competitive-Programming | 9f84a2d2734a5efe0e1fde0062e51782cd5af2c6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
n = int(input())
d = list(map(int, input().split()))
t = [list(map(int, input().split())) for _ in range(3)]
ivals = [[[0]*n for _ in range(n)] for _ in range(3)]
for p in range(3):
for i in range(n):
curt = 0
for j in range(n):
ivals[p][i][(i+j)%n] = (curt, curt... | 26.923077 | 66 | 0.419048 |
n = int(input())
d = list(map(int, input().split()))
t = [list(map(int, input().split())) for _ in range(3)]
ivals = [[[0]*n for _ in range(n)] for _ in range(3)]
for p in range(3):
for i in range(n):
curt = 0
for j in range(n):
ivals[p][i][(i+j)%n] = (curt, curt+t[p][(i+j)%n])
... | true | true |
f74234ef28243d7ae7b6cc09f9a474e39ce16234 | 3,203 | py | Python | mla/rbm.py | 31337mbf/MLAlgorithms | 3892a9bf20dcae0b6f9fc7798f60ceaef345256a | [
"MIT"
] | 9,715 | 2016-10-22T14:37:02.000Z | 2022-03-31T10:39:18.000Z | mla/rbm.py | ghnreigns/MLAlgorithms | 3c8e16b8de3baf131395ae57edd479e59566a7c6 | [
"MIT"
] | 73 | 2016-11-13T22:51:17.000Z | 2022-01-31T08:54:52.000Z | mla/rbm.py | ghnreigns/MLAlgorithms | 3c8e16b8de3baf131395ae57edd479e59566a7c6 | [
"MIT"
] | 1,793 | 2016-11-03T21:31:48.000Z | 2022-03-29T16:59:36.000Z | # coding:utf-8
import logging
import numpy as np
from scipy.special import expit
from mla.base import BaseEstimator
from mla.utils import batch_iterator
np.random.seed(9999)
sigmoid = expit
"""
References:
A Practical Guide to Training Restricted Boltzmann Machines https://www.cs.toronto.edu/~hinton/absps/guideTR.p... | 35.988764 | 113 | 0.63222 |
import logging
import numpy as np
from scipy.special import expit
from mla.base import BaseEstimator
from mla.utils import batch_iterator
np.random.seed(9999)
sigmoid = expit
class RBM(BaseEstimator):
y_required = False
def __init__(self, n_hidden=128, learning_rate=0.1, batch_size=10, max_epochs=100):
... | true | true |
f742352c6347257443b598406a9615c272ee5b53 | 356 | py | Python | Problem85.py | Cleancode404/ProjectEuler | 2f93b256b107bfb6a395b8aa197cfeacc599b00b | [
"MIT"
] | null | null | null | Problem85.py | Cleancode404/ProjectEuler | 2f93b256b107bfb6a395b8aa197cfeacc599b00b | [
"MIT"
] | null | null | null | Problem85.py | Cleancode404/ProjectEuler | 2f93b256b107bfb6a395b8aa197cfeacc599b00b | [
"MIT"
] | null | null | null | """
Cuboid route
"""
if __name__ == '__main__':
res, m, n = 0, 0, 0
for i in range(1, int(2000000 ** 0.5)):
for j in range(i, int(2000000 ** 0.5)):
s = i * (i + 1) * j * (j + 1) // 4
if abs(res - 2000000) > abs(s - 2000000):
res, m, n = s, i, j
print("m = ", m... | 32.363636 | 55 | 0.412921 | if __name__ == '__main__':
res, m, n = 0, 0, 0
for i in range(1, int(2000000 ** 0.5)):
for j in range(i, int(2000000 ** 0.5)):
s = i * (i + 1) * j * (j + 1) // 4
if abs(res - 2000000) > abs(s - 2000000):
res, m, n = s, i, j
print("m = ", m, ", n = ", n, ", sol... | true | true |
f7423591371bb8e8589512b4a18522650a053735 | 1,560 | py | Python | calendareshop/calendareshop/migrations/0017_staticpage.py | Kaarhai/calendar-eshop | 4ba4141034fe0042f0b3eec6194efd4b5c815f66 | [
"BSD-3-Clause"
] | 1 | 2016-09-20T22:01:05.000Z | 2016-09-20T22:01:05.000Z | calendareshop/calendareshop/migrations/0017_staticpage.py | Kaarhai/calendar-eshop | 4ba4141034fe0042f0b3eec6194efd4b5c815f66 | [
"BSD-3-Clause"
] | 6 | 2016-10-08T09:57:49.000Z | 2022-03-11T23:16:41.000Z | calendareshop/calendareshop/migrations/0017_staticpage.py | Kaarhai/calendar-eshop | 4ba4141034fe0042f0b3eec6194efd4b5c815f66 | [
"BSD-3-Clause"
] | 2 | 2016-10-03T21:47:55.000Z | 2019-10-17T07:56:09.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import autoslug.fields
import ckeditor_uploader.fields
class Migration(migrations.Migration):
dependencies = [
('calendareshop', '0016_project_image_translation'),
]
operations = [
m... | 44.571429 | 143 | 0.627564 |
from __future__ import unicode_literals
from django.db import migrations, models
import autoslug.fields
import ckeditor_uploader.fields
class Migration(migrations.Migration):
dependencies = [
('calendareshop', '0016_project_image_translation'),
]
operations = [
migrations.CreateModel(
... | true | true |
f742360b3fa90ea8572b0ae14ee3037af3a5a470 | 9,969 | py | Python | split_cl.py | tomrittervg/depot_tools | ad7b2d79aab0737e285ff120c1ed0bef0ab6c0b6 | [
"BSD-3-Clause"
] | 4 | 2022-03-21T15:21:13.000Z | 2022-03-23T16:31:20.000Z | split_cl.py | tomrittervg/depot_tools | ad7b2d79aab0737e285ff120c1ed0bef0ab6c0b6 | [
"BSD-3-Clause"
] | 1 | 2022-01-11T07:21:02.000Z | 2022-01-11T07:21:02.000Z | split_cl.py | tomrittervg/depot_tools | ad7b2d79aab0737e285ff120c1ed0bef0ab6c0b6 | [
"BSD-3-Clause"
] | 4 | 2020-03-15T13:28:11.000Z | 2021-12-13T08:57:39.000Z | #!/usr/bin/env python
# Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Splits a branch into smaller branches and uploads CLs."""
from __future__ import print_function
import collections
import os
impor... | 36.119565 | 80 | 0.694653 |
from __future__ import print_function
import collections
import os
import re
import subprocess2
import sys
import tempfile
import gclient_utils
import git_footers
import scm
import git_common as git
# numbers of CLs generated by `git cl split` have caused infrastructure issues
# in the past.
CL_SPLIT_FORCE... | true | true |
f7423610704cf0a3c3106e229a3671c1aca8324c | 4,523 | py | Python | igcapi/api.py | schlerp/igcapi | 33f22f6fad0af0e4ba19beea397eb025c5dfc608 | [
"MIT"
] | null | null | null | igcapi/api.py | schlerp/igcapi | 33f22f6fad0af0e4ba19beea397eb025c5dfc608 | [
"MIT"
] | null | null | null | igcapi/api.py | schlerp/igcapi | 33f22f6fad0af0e4ba19beea397eb025c5dfc608 | [
"MIT"
] | null | null | null | import requests
import json
from urllib.parse import urljoin
class IGCAPI(object):
'''an object for intereacting with an instance of IGC via json API'''
def __init__(self, uname, passwd, host, port=9443, api_path='/ibm/iis/igc-rest/v1/'):
self.api_host = host
self.api_port = port
self... | 35.896825 | 94 | 0.529074 | import requests
import json
from urllib.parse import urljoin
class IGCAPI(object):
def __init__(self, uname, passwd, host, port=9443, api_path='/ibm/iis/igc-rest/v1/'):
self.api_host = host
self.api_port = port
self.api_path = api_path
self.api_base_url = urljoin('{}:{}'.format(ho... | true | true |
f742362e97a43745fe98b43f31eb5be1043fd12e | 8,774 | py | Python | jointSBM.py | kurtmaia/JointSBM | 516daa6249694118cca4db2a4a92e0ef7164166f | [
"Apache-2.0"
] | 7 | 2019-07-22T12:54:24.000Z | 2021-05-06T15:23:40.000Z | jointSBM.py | kurtmaia/JointSBM | 516daa6249694118cca4db2a4a92e0ef7164166f | [
"Apache-2.0"
] | null | null | null | jointSBM.py | kurtmaia/JointSBM | 516daa6249694118cca4db2a4a92e0ef7164166f | [
"Apache-2.0"
] | null | null | null | import numpy as np
import scipy as sp
from numpy.linalg import inv, cholesky
from scipy.linalg import eig
from sklearn.metrics.cluster import normalized_mutual_info_score as nmi
from sklearn.metrics.cluster import adjusted_rand_score as ari
from sklearn.metrics.cluster import contingency_matrix
from sklearn.cluster i... | 34.81746 | 226 | 0.561318 | import numpy as np
import scipy as sp
from numpy.linalg import inv, cholesky
from scipy.linalg import eig
from sklearn.metrics.cluster import normalized_mutual_info_score as nmi
from sklearn.metrics.cluster import adjusted_rand_score as ari
from sklearn.metrics.cluster import contingency_matrix
from sklearn.cluster i... | true | true |
f74237717cb2d18d66f51a5116e8ac265e1a3168 | 9,819 | py | Python | nox/tasks.py | cs01/nox | 04f768c16751ea33ad8a8a27570d0fea2b25925d | [
"Apache-2.0"
] | 1 | 2020-01-18T23:14:56.000Z | 2020-01-18T23:14:56.000Z | nox/tasks.py | cs01/nox | 04f768c16751ea33ad8a8a27570d0fea2b25925d | [
"Apache-2.0"
] | null | null | null | nox/tasks.py | cs01/nox | 04f768c16751ea33ad8a8a27570d0fea2b25925d | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Alethea Katherine Flowers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 31.983713 | 137 | 0.653834 |
import importlib
import io
import json
import os
from colorlog.escape_codes import parse_colors
import nox
from nox import _options
from nox import registry
from nox.logger import logger
from nox.manifest import Manifest
def load_nox_module(global_config):
try:
g... | true | true |
f74237b364148ed842b46034c27e88e3ec7be15a | 7,474 | py | Python | stripstream/algorithms/search/pyplanners.py | nishadg246/stripstream-ivan-nishad | 9a275ae5836ee289cd09cbe6bc0ff6fd4a381135 | [
"MIT"
] | null | null | null | stripstream/algorithms/search/pyplanners.py | nishadg246/stripstream-ivan-nishad | 9a275ae5836ee289cd09cbe6bc0ff6fd4a381135 | [
"MIT"
] | null | null | null | stripstream/algorithms/search/pyplanners.py | nishadg246/stripstream-ivan-nishad | 9a275ae5836ee289cd09cbe6bc0ff6fd4a381135 | [
"MIT"
] | null | null | null | from stripstream.pddl.logic.connectives import Not, And
from stripstream.pddl.logic.atoms import Atom
from stripstream.pddl.logic.operations import Initialize
from stripstream.algorithms.instantiation import smart_instantiate_operator
from stripstream.utils import INF
from stripstream.pddl.problem import STRIPStreamPro... | 46.135802 | 143 | 0.725582 | from stripstream.pddl.logic.connectives import Not, And
from stripstream.pddl.logic.atoms import Atom
from stripstream.pddl.logic.operations import Initialize
from stripstream.algorithms.instantiation import smart_instantiate_operator
from stripstream.utils import INF
from stripstream.pddl.problem import STRIPStreamPro... | false | true |
f74238a353bf905a6fc0a5f51b05013392db1ccd | 7,320 | py | Python | score_2021.py | DeepPSP/cpsc2021 | 165790be750421eb0e0f0fe3129d03dddc250ada | [
"MIT"
] | 5 | 2021-12-07T11:44:34.000Z | 2021-12-24T06:49:43.000Z | score_2021.py | DeepPSP/cpsc2021 | 165790be750421eb0e0f0fe3129d03dddc250ada | [
"MIT"
] | null | null | null | score_2021.py | DeepPSP/cpsc2021 | 165790be750421eb0e0f0fe3129d03dddc250ada | [
"MIT"
] | 5 | 2021-11-13T07:30:59.000Z | 2021-12-20T12:40:53.000Z | #!/usr/bin/env python3
import numpy as np
import json
import os
import sys
import scipy.io as sio
import wfdb
"""
Written by: Xingyao Wang, Chengyu Liu
School of Instrument Science and Engineering
Southeast University, China
chengyu@seu.edu.cn
"""
R = np.array([[1, -1, -0.5],... | 32.972973 | 88 | 0.543443 |
import numpy as np
import json
import os
import sys
import scipy.io as sio
import wfdb
R = np.array([[1, -1, -0.5], [-2, 1, 0], [-1, 0, 1]])
class RefInfo:
def __init__(self, sample_path):
self.sample_path = sample_path
(
self.fs,
self.len_sig,
self.beat_lo... | true | true |
f74238c61cee902f633f2809efc5fa0e3755cf9c | 821 | py | Python | snippets/admin.py | xarg/snippify | b692a941a7a46959df9aff064b7ad056d0125484 | [
"MIT"
] | 2 | 2016-08-19T06:24:02.000Z | 2021-05-11T00:08:24.000Z | snippets/admin.py | xarg/snippify | b692a941a7a46959df9aff064b7ad056d0125484 | [
"MIT"
] | 5 | 2021-05-01T15:03:07.000Z | 2021-05-01T15:03:08.000Z | snippets/admin.py | xarg/snippify | b692a941a7a46959df9aff064b7ad056d0125484 | [
"MIT"
] | null | null | null | from django.contrib import admin
from snippify.snippets.models import Snippet, SnippetComment, SnippetVersion
class SnippetAdmin(admin.ModelAdmin):
exclude = ('author',)
list_display = ('title', 'lexer', 'created_date', 'author')
list_filter = ('lexer', 'author', )
search_fields = ('title', 'body', )
... | 34.208333 | 76 | 0.713764 | from django.contrib import admin
from snippify.snippets.models import Snippet, SnippetComment, SnippetVersion
class SnippetAdmin(admin.ModelAdmin):
exclude = ('author',)
list_display = ('title', 'lexer', 'created_date', 'author')
list_filter = ('lexer', 'author', )
search_fields = ('title', 'body', )
... | true | true |
f7423a676f97ccf97a0966319e79f285599faa02 | 5,769 | py | Python | process_sentence.py | kamal-rahimi/SentenceCorrection | 19138ebbdf1073f070a1982d3991de063c0d27d7 | [
"MIT"
] | 3 | 2019-08-01T11:26:43.000Z | 2021-04-25T09:36:29.000Z | process_sentence.py | kamal-rahimi/SentenceCorrection | 19138ebbdf1073f070a1982d3991de063c0d27d7 | [
"MIT"
] | null | null | null | process_sentence.py | kamal-rahimi/SentenceCorrection | 19138ebbdf1073f070a1982d3991de063c0d27d7 | [
"MIT"
] | null | null | null | """
Estimates the likihood of an input senetnce and finds an order of words
that is most likely in the longuage model
"""
import os
import argparse
import pickle
from keras.models import load_model
from keras.preprocessing.sequence import pad_sequences
from keras import backend as k
import numpy as np
from itertool... | 40.626761 | 139 | 0.700468 |
import os
import argparse
import pickle
from keras.models import load_model
from keras.preprocessing.sequence import pad_sequences
from keras import backend as k
import numpy as np
from itertools import permutations
from nlp_tools import strip_punctuations
def analyze_sequence(model, words_id_order, max_sentence_... | true | true |
f7423ade01c4fcfa0728490698cb14266420aa09 | 6,948 | py | Python | bb/master/master.py | aukhina/infrastructure | 1ef8fde36b4890b94831bd9f240aeee5c03686dc | [
"MIT"
] | null | null | null | bb/master/master.py | aukhina/infrastructure | 1ef8fde36b4890b94831bd9f240aeee5c03686dc | [
"MIT"
] | 2 | 2019-07-26T07:28:41.000Z | 2019-08-27T14:36:41.000Z | bb/master/master.py | aukhina/infrastructure | 1ef8fde36b4890b94831bd9f240aeee5c03686dc | [
"MIT"
] | null | null | null | # Copyright (c) 2020 Intel Corporation
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, d... | 40.395349 | 97 | 0.660334 |
import sys
import pathlib
from buildbot.changes.gitpoller import GitPoller
from buildbot.plugins import schedulers, util, worker, reporters
sys.path.append(str(pathlib.Path(__file__).resolve().parents[2]))
import bb.master.config as config
import bb.utils
c = BuildmasterConfig = {}
c["workers"... | true | true |
f7423af8d9f569329234e61543b9964287d2c748 | 6,170 | py | Python | my_scripts/10_03/different_memory_access/plot.py | wjwyyjr/Gem5_task_graph | 0e233b5053d6dcd518a2ad6fddd23eaeb9c3a8ee | [
"BSD-3-Clause"
] | null | null | null | my_scripts/10_03/different_memory_access/plot.py | wjwyyjr/Gem5_task_graph | 0e233b5053d6dcd518a2ad6fddd23eaeb9c3a8ee | [
"BSD-3-Clause"
] | null | null | null | my_scripts/10_03/different_memory_access/plot.py | wjwyyjr/Gem5_task_graph | 0e233b5053d6dcd518a2ad6fddd23eaeb9c3a8ee | [
"BSD-3-Clause"
] | null | null | null | from io import SEEK_CUR
from os import name
from types import FunctionType
import matplotlib.pyplot as plt
from matplotlib.pyplot import legend, plot, xticks
## class for plot function
class PlotFunction():
"""Make Data visualization Easier !"""
def __init__(self, y_data, x_label, y_label, x_ticklabels=[], x_t... | 34.858757 | 135 | 0.555592 | from io import SEEK_CUR
from os import name
from types import FunctionType
import matplotlib.pyplot as plt
from matplotlib.pyplot import legend, plot, xticks
def __init__(self, y_data, x_label, y_label, x_ticklabels=[], x_ticks=[], title=''):
self.y_data=y_data
self.x_label=x_label
self.y_lab... | true | true |
f7423b0a48ff12789305b2ed1088ceadc6224af7 | 390 | py | Python | hw_asr/datasets/__init__.py | ADrozdova/ASR | 9a3e2f045e0a86f560665e791301e961e3ef6cad | [
"MIT"
] | null | null | null | hw_asr/datasets/__init__.py | ADrozdova/ASR | 9a3e2f045e0a86f560665e791301e961e3ef6cad | [
"MIT"
] | null | null | null | hw_asr/datasets/__init__.py | ADrozdova/ASR | 9a3e2f045e0a86f560665e791301e961e3ef6cad | [
"MIT"
] | null | null | null | from hw_asr.datasets.custom_audio_dataset import CustomAudioDataset
from hw_asr.datasets.custom_dir_audio_dataset import CustomDirAudioDataset
from hw_asr.datasets.librispeech_dataset import LibrispeechDataset
from hw_asr.datasets.lj_speech_dataset import LJSpeechDataset
__all__ = [
"LibrispeechDataset",
"Cust... | 32.5 | 74 | 0.838462 | from hw_asr.datasets.custom_audio_dataset import CustomAudioDataset
from hw_asr.datasets.custom_dir_audio_dataset import CustomDirAudioDataset
from hw_asr.datasets.librispeech_dataset import LibrispeechDataset
from hw_asr.datasets.lj_speech_dataset import LJSpeechDataset
__all__ = [
"LibrispeechDataset",
"Cust... | true | true |
f7423b32f836533f423db5213d66833c2f8ae6b5 | 6,312 | py | Python | test/functional/feature_dersig.py | kronik187/BTCGPU | a6434f058fa5ba12ce4479d5023196929223b352 | [
"MIT"
] | null | null | null | test/functional/feature_dersig.py | kronik187/BTCGPU | a6434f058fa5ba12ce4479d5023196929223b352 | [
"MIT"
] | null | null | null | test/functional/feature_dersig.py | kronik187/BTCGPU | a6434f058fa5ba12ce4479d5023196929223b352 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2015-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test BIP66 (DER SIG).
Test that the DERSIG soft-fork activates at (regtest) height 1251.
"""
from tes... | 43.232877 | 145 | 0.673796 |
from test_framework.blocktools import create_coinbase, create_block, create_transaction
from test_framework.messages import msg_block
from test_framework.mininode import mininode_lock, P2PInterface
from test_framework.script import CScript
from test_framework.test_framework import BitcoinTestFramework
from test_fr... | true | true |
f7423b6880f58658d5206e6db64f56cdb1b740ca | 310 | py | Python | tests/conftest.py | shramov/tll-sqlite | 6f604e5cd3ebf36bf9cf52ff26d7da5c34d5c501 | [
"MIT"
] | null | null | null | tests/conftest.py | shramov/tll-sqlite | 6f604e5cd3ebf36bf9cf52ff26d7da5c34d5c501 | [
"MIT"
] | null | null | null | tests/conftest.py | shramov/tll-sqlite | 6f604e5cd3ebf36bf9cf52ff26d7da5c34d5c501 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# vim: sts=4 sw=4 et
import pytest
import pathlib
import tempfile
version = tuple([int(x) for x in pytest.__version__.split('.')[:2]])
if version < (3, 9):
@pytest.fixture
def tmp_path():
with tempfile.TemporaryDirectory() as tmp:
yield pathlib.Path(tmp)
| 19.375 | 68 | 0.648387 |
import pytest
import pathlib
import tempfile
version = tuple([int(x) for x in pytest.__version__.split('.')[:2]])
if version < (3, 9):
@pytest.fixture
def tmp_path():
with tempfile.TemporaryDirectory() as tmp:
yield pathlib.Path(tmp)
| true | true |
f7423bb2328305cfd72b5fe485a4cef4fed1c217 | 2,041 | py | Python | editor/attributes/player/player_attribute_wb_acceleration.py | PeterC10/COFPES-OF-Editor-6 | 0a9c9b75fada8264634bdc968c9da209c44b29e2 | [
"MIT"
] | 1 | 2022-03-11T12:25:57.000Z | 2022-03-11T12:25:57.000Z | editor/attributes/player/player_attribute_wb_acceleration.py | PeterC10/COFPES-OF-Editor-6 | 0a9c9b75fada8264634bdc968c9da209c44b29e2 | [
"MIT"
] | null | null | null | editor/attributes/player/player_attribute_wb_acceleration.py | PeterC10/COFPES-OF-Editor-6 | 0a9c9b75fada8264634bdc968c9da209c44b29e2 | [
"MIT"
] | null | null | null | from editor.attributes.player.player_attribute import (
PlayerAttribute,
PlayerAttributeTypes,
)
from editor.attributes.player.player_attribute_wb import (
PlayerAttributeWb,
)
from editor.attributes.player.player_attribute_acceleration import (
PlayerAttributeAcceleration,
)
from editor.attributes.p... | 26.166667 | 84 | 0.693778 | from editor.attributes.player.player_attribute import (
PlayerAttribute,
PlayerAttributeTypes,
)
from editor.attributes.player.player_attribute_wb import (
PlayerAttributeWb,
)
from editor.attributes.player.player_attribute_acceleration import (
PlayerAttributeAcceleration,
)
from editor.attributes.p... | true | true |
f7423c61a1a07c353dcb2afba579932fba571fde | 5,925 | py | Python | utils/graph_funcs.py | ruihan0495/EfficientDet | f61b77343a9782d85747ced6704c35a49528934a | [
"Apache-2.0"
] | null | null | null | utils/graph_funcs.py | ruihan0495/EfficientDet | f61b77343a9782d85747ced6704c35a49528934a | [
"Apache-2.0"
] | null | null | null | utils/graph_funcs.py | ruihan0495/EfficientDet | f61b77343a9782d85747ced6704c35a49528934a | [
"Apache-2.0"
] | null | null | null | import tensorflow as tf
############################################################
# Miscellenous Graph Functions
############################################################
def trim_zeros_graph(boxes, name='trim_zeros'):
"""Often boxes are represented with matrices of shape [N, 4] and
are padded with zero... | 40.582192 | 77 | 0.623122 | import tensorflow as tf
| true | true |
f7423c870ce51c9055e65921a9615c265b5f55bb | 43,590 | py | Python | AVR_Miner.py | guddunain/duino-coin | 1bb5ce171d952ab378a04777ed9eb75eefb4721f | [
"MIT"
] | null | null | null | AVR_Miner.py | guddunain/duino-coin | 1bb5ce171d952ab378a04777ed9eb75eefb4721f | [
"MIT"
] | null | null | null | AVR_Miner.py | guddunain/duino-coin | 1bb5ce171d952ab378a04777ed9eb75eefb4721f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
##########################################
# Duino-Coin Python AVR Miner (v2.5.7)
# https://github.com/revoxhere/duino-coin
# Distributed under MIT license
# © Duino-Coin Community 2019-2021
##########################################
# Import libraries
import sys
from configparser import ConfigPa... | 35.26699 | 79 | 0.395825 |
use the Minimal-PC_Miner.')
install('requests')
try:
from colorama import Back, Fore, Style, init
except ModuleNotFoundError:
print(
now().strftime('%H:%M:%S ')
+ 'Colorama is not installed. '
+ 'Miner will try to install it. '
+ 'If it fails, please manually install ... | true | true |
f7423e8cec6aefb0730171f1547c5d6f1339e56a | 2,072 | py | Python | sdk/python/kfp/containers_tests/testdata/main.py | Strasser-Pablo/pipelines | a1d513eb412f3ffd44edf82af2fa7edb05c3b952 | [
"Apache-2.0"
] | 1 | 2021-08-23T19:09:56.000Z | 2021-08-23T19:09:56.000Z | sdk/python/kfp/containers_tests/testdata/main.py | Strasser-Pablo/pipelines | a1d513eb412f3ffd44edf82af2fa7edb05c3b952 | [
"Apache-2.0"
] | 2 | 2021-06-01T10:02:51.000Z | 2021-06-07T07:19:14.000Z | sdk/python/kfp/containers_tests/testdata/main.py | Strasser-Pablo/pipelines | a1d513eb412f3ffd44edf82af2fa7edb05c3b952 | [
"Apache-2.0"
] | 3 | 2022-01-10T13:40:24.000Z | 2022-03-21T08:46:14.000Z | # Copyright 2021 The Kubeflow Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | 38.37037 | 75 | 0.764479 |
from typing import NamedTuple
from kfp import components
from kfp.dsl import artifact
from kfp.dsl import ontology_artifacts
def test_func(
test_param: str,
test_artifact: components.InputArtifact('Dataset'),
test_output1: components.OutputArtifact('Model')
) -> NamedTuple('Outputs', [('test_... | true | true |
f7423efad2d4efa804ff2ac88fa303d0265cf384 | 48,876 | py | Python | test/test_database_size.py | greenpau/py_insightvm_sdk | bd881f26e14cb9f0f9c47927469ec992de9de8e6 | [
"Apache-2.0"
] | 2 | 2019-03-15T16:05:54.000Z | 2020-07-19T18:37:50.000Z | test/test_database_size.py | greenpau/py_insightvm_sdk | bd881f26e14cb9f0f9c47927469ec992de9de8e6 | [
"Apache-2.0"
] | 1 | 2021-03-26T04:46:12.000Z | 2021-03-26T04:51:23.000Z | test/test_database_size.py | greenpau/py_insightvm_sdk | bd881f26e14cb9f0f9c47927469ec992de9de8e6 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
InsightVM API
# Overview This guide documents the InsightVM Application Programming Interface (API) Version 3. This API supports the Representation State Transfer (REST) design pattern. Unless noted otherwise this API accepts and produces the `application/json` media type. This API uses ... | 1,192.097561 | 48,045 | 0.49022 |
from __future__ import absolute_import
import unittest
import py_insightvm_sdk
from py_insightvm_sdk.models.database_size import DatabaseSize
from py_insightvm_sdk.rest import ApiException
class TestDatabaseSize(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
... | true | true |
f7423f2002c383f6b47acc070e348326d1d67b9d | 1,734 | py | Python | parl/env/tests/continuous_wrappers_test.py | lp2333/PARL | e4bde1f5b7e69c5f8d3ee3a90a647dfe12204bd3 | [
"ECL-2.0",
"Apache-2.0"
] | 3,172 | 2018-05-22T02:02:29.000Z | 2022-03-31T09:14:56.000Z | parl/env/tests/continuous_wrappers_test.py | BKBK00/PARL | f508bc6085420431b504441c7ff129e64826603e | [
"Apache-2.0"
] | 422 | 2018-05-17T16:58:45.000Z | 2022-03-31T02:03:25.000Z | parl/env/tests/continuous_wrappers_test.py | BKBK00/PARL | f508bc6085420431b504441c7ff129e64826603e | [
"Apache-2.0"
] | 794 | 2018-05-21T18:33:19.000Z | 2022-03-30T13:38:09.000Z | # Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 31.527273 | 75 | 0.685121 |
import gym
import numpy as np
import unittest
from parl.env.continuous_wrappers import ActionMappingWrapper
class MockEnv(gym.Env):
def __init__(self, low, high):
self.action_space = gym.spaces.Box(low=low, high=high, shape=(3, ))
self._max_episode_steps = 1000
def step(self, ac... | true | true |
f7423f38267c448739df64d9da381619bf45f028 | 20,386 | py | Python | sympy/matrices/tests/test_solvers.py | utkarshdeorah/sympy | dcdf59bbc6b13ddbc329431adf72fcee294b6389 | [
"BSD-3-Clause"
] | 1 | 2020-09-09T20:40:17.000Z | 2020-09-09T20:40:17.000Z | sympy/matrices/tests/test_solvers.py | utkarshdeorah/sympy | dcdf59bbc6b13ddbc329431adf72fcee294b6389 | [
"BSD-3-Clause"
] | 14 | 2018-02-08T10:11:03.000Z | 2019-04-16T10:32:46.000Z | sympy/matrices/tests/test_solvers.py | utkarshdeorah/sympy | dcdf59bbc6b13ddbc329431adf72fcee294b6389 | [
"BSD-3-Clause"
] | 1 | 2022-02-04T13:50:29.000Z | 2022-02-04T13:50:29.000Z | from sympy.core.function import expand_mul
from sympy.core.numbers import (I, Rational)
from sympy.core.singleton import S
from sympy.core.symbol import (Symbol, symbols)
from sympy.core.sympify import sympify
from sympy.simplify.simplify import simplify
from sympy.matrices.matrices import (ShapeError, NonSquareMatrixE... | 36.081416 | 127 | 0.474247 | from sympy.core.function import expand_mul
from sympy.core.numbers import (I, Rational)
from sympy.core.singleton import S
from sympy.core.symbol import (Symbol, symbols)
from sympy.core.sympify import sympify
from sympy.simplify.simplify import simplify
from sympy.matrices.matrices import (ShapeError, NonSquareMatrixE... | true | true |
f7423f9d781c3b466983a205f925a9cff2fc68be | 13,590 | py | Python | replaceme/seeder/crawl_store.py | zcomputerwiz/replaceme-blockchain | b6dfc3ff502e0cb6b7b5fbc566c7fb9ae559757a | [
"Apache-2.0"
] | null | null | null | replaceme/seeder/crawl_store.py | zcomputerwiz/replaceme-blockchain | b6dfc3ff502e0cb6b7b5fbc566c7fb9ae559757a | [
"Apache-2.0"
] | null | null | null | replaceme/seeder/crawl_store.py | zcomputerwiz/replaceme-blockchain | b6dfc3ff502e0cb6b7b5fbc566c7fb9ae559757a | [
"Apache-2.0"
] | null | null | null | import asyncio
import dataclasses
import ipaddress
import logging
import random
import time
from typing import List, Dict
import aiosqlite
from replaceme.seeder.peer_record import PeerRecord, PeerReliability
log = logging.getLogger(__name__)
class CrawlStore:
crawl_db: aiosqlite.Connection
last_timestamp: ... | 37.645429 | 118 | 0.5844 | import asyncio
import dataclasses
import ipaddress
import logging
import random
import time
from typing import List, Dict
import aiosqlite
from replaceme.seeder.peer_record import PeerRecord, PeerReliability
log = logging.getLogger(__name__)
class CrawlStore:
crawl_db: aiosqlite.Connection
last_timestamp: ... | true | true |
f7423fc3c3838697c67f81f2239fdb387f249384 | 11,526 | py | Python | tapas/experiments/table_retriever_experiment.py | apurvak/tapas | 7884280be78d2f58ad9c125504d710ef89f49f9a | [
"Apache-2.0"
] | 816 | 2020-03-31T15:15:56.000Z | 2022-03-31T19:28:02.000Z | tapas/experiments/table_retriever_experiment.py | Fgerald/tapas | 2987658c3b65c5ab6e698d6c57823dc30d3d0f96 | [
"Apache-2.0"
] | 155 | 2020-05-02T15:45:42.000Z | 2022-03-31T08:35:23.000Z | tapas/experiments/table_retriever_experiment.py | Fgerald/tapas | 2987658c3b65c5ab6e698d6c57823dc30d3d0f96 | [
"Apache-2.0"
] | 173 | 2020-05-01T02:39:38.000Z | 2022-03-30T06:43:29.000Z | # coding=utf-8
# Copyright 2019 The Google AI Language Team Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | 35.795031 | 80 | 0.71317 |
import csv
import functools
import os
import traceback
from typing import Text, Optional
from absl import app
from absl import flags
from tapas.models import table_retriever_model
from tapas.scripts import eval_table_retriever_utils
from tapas.utils import experiment_utils
import tensorflow.compat.v1... | true | true |
f7424014c21116e17ba897dc6417dff904559584 | 3,263 | py | Python | python/paddle/fluid/tests/unittests/mkldnn/test_stack_mkldnn_op.py | zmxdream/Paddle | 04f042a5d507ad98f7f2cfc3cbc44b06d7a7f45c | [
"Apache-2.0"
] | 8 | 2016-08-15T07:02:27.000Z | 2016-08-24T09:34:00.000Z | python/paddle/fluid/tests/unittests/mkldnn/test_stack_mkldnn_op.py | zmxdream/Paddle | 04f042a5d507ad98f7f2cfc3cbc44b06d7a7f45c | [
"Apache-2.0"
] | 2 | 2019-07-26T04:06:05.000Z | 2019-07-29T04:25:24.000Z | python/paddle/fluid/tests/unittests/mkldnn/test_stack_mkldnn_op.py | zmxdream/Paddle | 04f042a5d507ad98f7f2cfc3cbc44b06d7a7f45c | [
"Apache-2.0"
] | 5 | 2021-12-10T11:20:06.000Z | 2022-02-18T05:18:12.000Z | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 28.12931 | 87 | 0.666258 |
import unittest
import numpy as np
from paddle.fluid.tests.unittests.op_test import OpTest, OpTestTool, skip_check_grad_ci
import paddle
import paddle.fluid as fluid
import paddle.fluid.core as core
@OpTestTool.skip_if_not_cpu()
class TestStack2DOneDNNOp(OpTest):
def initDefaultParameters(self):
... | true | true |
f742415541f1c06b9b53be8bb2afe74fa6525e6c | 5,702 | py | Python | ci/tools/ci_tags.py | openeuler-mirror/infrastructure | 07c3f1128eb0e4dcca1fb2f203c8fefe4e74fb87 | [
"Apache-2.0"
] | null | null | null | ci/tools/ci_tags.py | openeuler-mirror/infrastructure | 07c3f1128eb0e4dcca1fb2f203c8fefe4e74fb87 | [
"Apache-2.0"
] | 1 | 2021-03-26T03:24:54.000Z | 2021-03-26T03:24:54.000Z | ci/tools/ci_tags.py | openeuler-mirror/infrastructure | 07c3f1128eb0e4dcca1fb2f203c8fefe4e74fb87 | [
"Apache-2.0"
] | 1 | 2021-08-18T09:26:02.000Z | 2021-08-18T09:26:02.000Z | import requests
import sys
class Check():
def __init__(self, owner, repo, number, access_token):
self.owner = owner
self.repo = repo
self.number = number
self.access_token = access_token
def add_processing_tag(self):
url = 'https://gitee.com/api/v5/repos/{}/{}/pulls/{}... | 40.439716 | 114 | 0.482112 | import requests
import sys
class Check():
def __init__(self, owner, repo, number, access_token):
self.owner = owner
self.repo = repo
self.number = number
self.access_token = access_token
def add_processing_tag(self):
url = 'https://gitee.com/api/v5/repos/{}/{}/pulls/{}... | true | true |
f742416c47a2a5394fae38869c1d44c9fb005298 | 374 | py | Python | tests/test_cli.py | brain461/ar_too | ef4c3cfa9e836c4fa30e479fc4eec4d864b16175 | [
"Apache-2.0"
] | null | null | null | tests/test_cli.py | brain461/ar_too | ef4c3cfa9e836c4fa30e479fc4eec4d864b16175 | [
"Apache-2.0"
] | null | null | null | tests/test_cli.py | brain461/ar_too | ef4c3cfa9e836c4fa30e479fc4eec4d864b16175 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
test_cli
----------------------------------
Tests for `cli` module.
"""
# thirdparty libraies
import pytest
# This package
from ar_too import cli
class TestCli:
def test_cli(self, cli_runner):
result = cli_runner.invoke(cli.cli, ['--help'])
assert result.exit_code ==... | 17 | 55 | 0.585561 |
import pytest
from ar_too import cli
class TestCli:
def test_cli(self, cli_runner):
result = cli_runner.invoke(cli.cli, ['--help'])
assert result.exit_code == 0
assert result.output.startswith('Usage:')
| true | true |
f74242fb7af377eebbd576e541afda6d02620765 | 10,147 | py | Python | search/search_quality/scoring_model.py | Polas/omim | 03558b418b338f506fbf3aa72ddf15187a2005ee | [
"Apache-2.0"
] | null | null | null | search/search_quality/scoring_model.py | Polas/omim | 03558b418b338f506fbf3aa72ddf15187a2005ee | [
"Apache-2.0"
] | null | null | null | search/search_quality/scoring_model.py | Polas/omim | 03558b418b338f506fbf3aa72ddf15187a2005ee | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
from math import exp, log
from scipy.stats import pearsonr, t
from sklearn import svm
from sklearn.model_selection import GridSearchCV, KFold
from sklearn.utils import resample
import argparse
import collections
import itertools
import numpy as np
import pandas as pd
import random
import sys
M... | 30.563253 | 108 | 0.618409 |
from math import exp, log
from scipy.stats import pearsonr, t
from sklearn import svm
from sklearn.model_selection import GridSearchCV, KFold
from sklearn.utils import resample
import argparse
import collections
import itertools
import numpy as np
import pandas as pd
import random
import sys
MAX_DISTANCE_METERS = 2... | true | true |
f74246e6fe05e6777911217dfde4a1b0d5eebf66 | 326 | py | Python | .history/my_classes/FirstClassFunctions/callables_20210706005111.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | .history/my_classes/FirstClassFunctions/callables_20210706005111.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | .history/my_classes/FirstClassFunctions/callables_20210706005111.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | """ Callables
What are callables?
Any object that can be called using the () # operator always return a value -> like functions and methods -> but it goes beyond these two...
Many other objects in Python are also callable
To see if an object is callable, we can use the builtin function: callable
... | 29.636364 | 153 | 0.696319 | true | true | |
f74247352c7264de72013c5abdc0a5d31a3a92f8 | 747 | py | Python | Problems/Euler Project 28.py | vishwas-21/Project-Euler | ecc6cd843425647582488bcaaaa1815439251d56 | [
"MIT"
] | null | null | null | Problems/Euler Project 28.py | vishwas-21/Project-Euler | ecc6cd843425647582488bcaaaa1815439251d56 | [
"MIT"
] | null | null | null | Problems/Euler Project 28.py | vishwas-21/Project-Euler | ecc6cd843425647582488bcaaaa1815439251d56 | [
"MIT"
] | null | null | null | n = 1001
arr = [[0 for _ in range(n)] for _ in range(n)]
i = j = n // 2
k = 1
num = 2
arr[i][j] = 1
while i != 0 or j != n - 1:
if i == 0:
while j != n - 1:
arr[i][j + 1] = num
num += 1
j += 1
break
# Right
for l in range(k):
arr[i][j + 1] = num
... | 18.675 | 47 | 0.368139 | n = 1001
arr = [[0 for _ in range(n)] for _ in range(n)]
i = j = n // 2
k = 1
num = 2
arr[i][j] = 1
while i != 0 or j != n - 1:
if i == 0:
while j != n - 1:
arr[i][j + 1] = num
num += 1
j += 1
break
for l in range(k):
arr[i][j + 1] = num
n... | true | true |
f74247aa712d3d42489eb05bdf2cd44e8b078479 | 100,983 | py | Python | ovs/lib/setup.py | rootfs-analytics/openvstorage | 6184822340faea1d2927643330a7aaa781d92d36 | [
"Apache-2.0"
] | 1 | 2019-10-30T20:50:59.000Z | 2019-10-30T20:50:59.000Z | ovs/lib/setup.py | rootfs-analytics/openvstorage | 6184822340faea1d2927643330a7aaa781d92d36 | [
"Apache-2.0"
] | null | null | null | ovs/lib/setup.py | rootfs-analytics/openvstorage | 6184822340faea1d2927643330a7aaa781d92d36 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 CloudFounders NV
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | 46.664972 | 237 | 0.607449 |
"""
Module for SetupController
"""
import os
import re
import sys
import imp
import time
import uuid
import urllib2
import base64
import inspect
from ConfigParser import RawConfigParser
from ovs.extensions.db.arakoon.ArakoonInstaller import ArakoonInstaller
from ovs.extensions.generic.sshclient import S... | false | true |
f7424839fc39de6f483c5e3722b37f7010918131 | 1,165 | py | Python | temp/views.py | mentoriacompartilhada/helenamagaldi-v0 | d26e5b4ae887382b02c00092c2487437bc9ffb78 | [
"MIT"
] | 1 | 2021-08-19T02:38:47.000Z | 2021-08-19T02:38:47.000Z | temp/views.py | mentoriacompartilhada/helenamagaldi-v0 | d26e5b4ae887382b02c00092c2487437bc9ffb78 | [
"MIT"
] | null | null | null | temp/views.py | mentoriacompartilhada/helenamagaldi-v0 | d26e5b4ae887382b02c00092c2487437bc9ffb78 | [
"MIT"
] | null | null | null | # from django.shortcuts import render
from meuapp.models import Pessoa
from django.http import HttpResponse
from rest_framework.generics import ListAPIView, CreateAPIView, UpdateAPIView, DestroyAPIView, RetrieveAPIView
from .serializers import PessoaSerializer
def hello_world(request):
return HttpResponse('Hell... | 27.093023 | 110 | 0.799142 |
from meuapp.models import Pessoa
from django.http import HttpResponse
from rest_framework.generics import ListAPIView, CreateAPIView, UpdateAPIView, DestroyAPIView, RetrieveAPIView
from .serializers import PessoaSerializer
def hello_world(request):
return HttpResponse('Hello world')
class PessoaView(ListAPIV... | true | true |
f742485d753a189fa69f576d39b16fcb138761fd | 1,644 | py | Python | cfgov/cfgov/settings/test.py | HealthStarInformatics/cfgov-refresh | 5c38515cbeef826c09125a5cb34c1abb24a724cf | [
"CC0-1.0"
] | null | null | null | cfgov/cfgov/settings/test.py | HealthStarInformatics/cfgov-refresh | 5c38515cbeef826c09125a5cb34c1abb24a724cf | [
"CC0-1.0"
] | null | null | null | cfgov/cfgov/settings/test.py | HealthStarInformatics/cfgov-refresh | 5c38515cbeef826c09125a5cb34c1abb24a724cf | [
"CC0-1.0"
] | 1 | 2019-12-28T14:04:07.000Z | 2019-12-28T14:04:07.000Z | from .local import *
# A test database may be specified through use of the TEST_DATABASE_URL
# environment variable. If not provided, unit tests will be run against an
# in-memory SQLite database.
TEST_DATABASE_URL = os.getenv('TEST_DATABASE_URL')
if TEST_DATABASE_URL:
TEST_DATABASE = dj_database_url.parse(TEST_D... | 26.95082 | 77 | 0.704988 | from .local import *
TEST_DATABASE_URL = os.getenv('TEST_DATABASE_URL')
if TEST_DATABASE_URL:
TEST_DATABASE = dj_database_url.parse(TEST_DATABASE_URL)
else:
TEST_DATABASE = {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
'TEST': {
'NAME': ':memory:',
... | true | true |
f7424888f4867dd28e7ce7d8700e778ed3a7127c | 19,931 | py | Python | cyder/settings/base.py | jwasinger/cyder | de3e61ca47b71ac28d0a36568f250f4bc2617f22 | [
"BSD-3-Clause"
] | null | null | null | cyder/settings/base.py | jwasinger/cyder | de3e61ca47b71ac28d0a36568f250f4bc2617f22 | [
"BSD-3-Clause"
] | null | null | null | cyder/settings/base.py | jwasinger/cyder | de3e61ca47b71ac28d0a36568f250f4bc2617f22 | [
"BSD-3-Clause"
] | null | null | null | # This is Cyder's main settings file. If you need to override a setting
# locally, use cyder/settings/local.py
import glob
import itertools
import logging
import os
import socket
import sys
from django.utils.functional import lazy
from lib.path_utils import ROOT, path
##########################
# copied from funfact... | 31.486572 | 79 | 0.647986 |
# locally, use cyder/settings/local.py
import glob
import itertools
import logging
import os
import socket
import sys
from django.utils.functional import lazy
from lib.path_utils import ROOT, path
##########################
# copied from funfactory #
##########################
SLAVE_DATABASES = []
DATABASE_ROUTER... | true | true |
f74248f05d9641a4dec087e56c01e1386162dc4c | 1,528 | py | Python | PyqtProject/test.py | pection/Interactionstudent | 74291812d3a5455c805b7ccc2d76dad28e6db77f | [
"MIT"
] | null | null | null | PyqtProject/test.py | pection/Interactionstudent | 74291812d3a5455c805b7ccc2d76dad28e6db77f | [
"MIT"
] | null | null | null | PyqtProject/test.py | pection/Interactionstudent | 74291812d3a5455c805b7ccc2d76dad28e6db77f | [
"MIT"
] | 1 | 2020-11-24T18:19:02.000Z | 2020-11-24T18:19:02.000Z | from PyQt4 import QtCore, QtGui
class MainWindow(QtGui.QMainWindow):
def __init__(self, parent=None):
super(MainWindow, self).__init__(parent)
self.central_widget = QtGui.QStackedWidget()
self.setCentralWidget(self.central_widget)
login_widget = Lo... | 37.268293 | 87 | 0.607984 | from PyQt4 import QtCore, QtGui
class MainWindow(QtGui.QMainWindow):
def __init__(self, parent=None):
super(MainWindow, self).__init__(parent)
self.central_widget = QtGui.QStackedWidget()
self.setCentralWidget(self.central_widget)
login_widget = Lo... | false | true |
f742498e17163a8369ecc2560a45514362c00283 | 21,838 | py | Python | www/tests/test_generators.py | raspberrypieman/brython | 2cc23d1da6acda604d4a56b4c9d464eb7e374eda | [
"BSD-3-Clause"
] | null | null | null | www/tests/test_generators.py | raspberrypieman/brython | 2cc23d1da6acda604d4a56b4c9d464eb7e374eda | [
"BSD-3-Clause"
] | null | null | null | www/tests/test_generators.py | raspberrypieman/brython | 2cc23d1da6acda604d4a56b4c9d464eb7e374eda | [
"BSD-3-Clause"
] | null | null | null | # examples from http://linuxgazette.net/100/pramode.html
def foo():
yield 1
yield 2
g = foo()
assert next(g)==1
assert next(g)==2
def foo():
return
yield 1
assert [x for x in foo()]==[]
def foo(n):
for i in range(2):
if (n < 3):
yield 1
else:
return
... | 18.553951 | 107 | 0.515615 |
def foo():
yield 1
yield 2
g = foo()
assert next(g)==1
assert next(g)==2
def foo():
return
yield 1
assert [x for x in foo()]==[]
def foo(n):
for i in range(2):
if (n < 3):
yield 1
else:
return
yield 2
assert [x for x in foo(2)]==[1, 2, 1, 2]
ass... | true | true |
f7424a0c31152cd60e64576847316cd4b09e2640 | 173 | py | Python | Curso_Python/Secao2-Python-Basico-Logica-Programacao/24_documentacao_e_buit_in/24_documentação_e_buit_in.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao2-Python-Basico-Logica-Programacao/24_documentacao_e_buit_in/24_documentação_e_buit_in.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao2-Python-Basico-Logica-Programacao/24_documentacao_e_buit_in/24_documentação_e_buit_in.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | num1 = input('Digite um numero: ')
num2 = input('Digite outro numero: ')
try:
num1 = float(num1)
num2 = float(num2)
print(num1 + num2)
except:
print('Error') | 21.625 | 37 | 0.618497 | num1 = input('Digite um numero: ')
num2 = input('Digite outro numero: ')
try:
num1 = float(num1)
num2 = float(num2)
print(num1 + num2)
except:
print('Error') | true | true |
f7424a1eca32ad1f86ce7b52a33d3703dda74442 | 3,393 | py | Python | test/conftest.py | alimoabd2127/pystardog | fc131db119737b0f7cf0e991c5ff8184ae0cbb6d | [
"Apache-2.0"
] | null | null | null | test/conftest.py | alimoabd2127/pystardog | fc131db119737b0f7cf0e991c5ff8184ae0cbb6d | [
"Apache-2.0"
] | null | null | null | test/conftest.py | alimoabd2127/pystardog | fc131db119737b0f7cf0e991c5ff8184ae0cbb6d | [
"Apache-2.0"
] | null | null | null | import pytest
import stardog.content as content
import stardog.content_types as content_types
import os
# STARDOG_ENDPOINT = os.environ.get('STARDOG_ENDPOINT', None)
STARDOG_HOSTNAME_NODE_1 = os.environ.get("STARDOG_HOSTNAME_NODE_1", None)
STARDOG_HOSTNAME_CACHE = os.environ.get("STARDOG_HOSTNAME_CACHE", None)
STARDOG... | 30.026549 | 118 | 0.655172 | import pytest
import stardog.content as content
import stardog.content_types as content_types
import os
STARDOG_HOSTNAME_NODE_1 = os.environ.get("STARDOG_HOSTNAME_NODE_1", None)
STARDOG_HOSTNAME_CACHE = os.environ.get("STARDOG_HOSTNAME_CACHE", None)
STARDOG_HOSTNAME_STANDBY = os.environ.get("STARDOG_HOSTNAME_STANDBY"... | true | true |
f7424a716aa69fbe512f6083f8666af4778c2d75 | 1,351 | py | Python | dreamuserdb/api1/urls.py | dreamplatform/dream-userdb | 5cc448cbcc3f17fd29eb6c38aadb67dc55715f70 | [
"BSD-3-Clause"
] | null | null | null | dreamuserdb/api1/urls.py | dreamplatform/dream-userdb | 5cc448cbcc3f17fd29eb6c38aadb67dc55715f70 | [
"BSD-3-Clause"
] | null | null | null | dreamuserdb/api1/urls.py | dreamplatform/dream-userdb | 5cc448cbcc3f17fd29eb6c38aadb67dc55715f70 | [
"BSD-3-Clause"
] | null | null | null |
import logging
from django.conf.urls.defaults import *
from piston.resource import Resource as R
from piston.authentication import HttpBasicAuthentication
import handlers
l = logging.getLogger(__name__)
class Auth(HttpBasicAuthentication):
def is_authenticated(self, request):
user = super(Auth, self).is_authen... | 31.418605 | 66 | 0.635085 |
import logging
from django.conf.urls.defaults import *
from piston.resource import Resource as R
from piston.authentication import HttpBasicAuthentication
import handlers
l = logging.getLogger(__name__)
class Auth(HttpBasicAuthentication):
def is_authenticated(self, request):
user = super(Auth, self).is_authen... | true | true |
f7424a91ee2c22ceaf996065e96eda2c83e4b76e | 235 | py | Python | restart.py | GregTCLTK/Amme | 3daa5d70a036ee5843a1a65666b6fccfff2f6c78 | [
"Apache-2.0"
] | null | null | null | restart.py | GregTCLTK/Amme | 3daa5d70a036ee5843a1a65666b6fccfff2f6c78 | [
"Apache-2.0"
] | null | null | null | restart.py | GregTCLTK/Amme | 3daa5d70a036ee5843a1a65666b6fccfff2f6c78 | [
"Apache-2.0"
] | 1 | 2018-03-07T18:47:32.000Z | 2018-03-07T18:47:32.000Z | import os
import platform
import time
import sys
time.sleep(3)
if platform.system() == "Linux":
os.system("screen -L -S Amme java -jar DiscordBot.jar -restart")
else:
os.system("java -jar Amaya-1.0-SNAPSHOT.jar")
sys.exit(0) | 18.076923 | 68 | 0.697872 | import os
import platform
import time
import sys
time.sleep(3)
if platform.system() == "Linux":
os.system("screen -L -S Amme java -jar DiscordBot.jar -restart")
else:
os.system("java -jar Amaya-1.0-SNAPSHOT.jar")
sys.exit(0) | true | true |
f7424bf328b87e9014d193dcd80a846fe7eb982e | 723 | py | Python | emailer/auth.py | marcdurham/emailer | e33becfad00507984010df98091b4d9e1e423d3b | [
"MIT"
] | null | null | null | emailer/auth.py | marcdurham/emailer | e33becfad00507984010df98091b4d9e1e423d3b | [
"MIT"
] | null | null | null | emailer/auth.py | marcdurham/emailer | e33becfad00507984010df98091b4d9e1e423d3b | [
"MIT"
] | null | null | null | import google.oauth2.credentials
import google_auth_oauthlib.flow as oauth_flow
def fetch_new_creds(config):
return oauth_flow.InstalledAppFlow.from_client_config(
config,
scopes=[
'https://www.googleapis.com/auth/gmail.send',
'https://www.googleapis.com/auth/spreadsheets.readonly',
... | 27.807692 | 68 | 0.710927 | import google.oauth2.credentials
import google_auth_oauthlib.flow as oauth_flow
def fetch_new_creds(config):
return oauth_flow.InstalledAppFlow.from_client_config(
config,
scopes=[
'https://www.googleapis.com/auth/gmail.send',
'https://www.googleapis.com/auth/spreadsheets.readonly',
... | true | true |
f7424c446a4baa3b3a75eaafd42cac674e3398f8 | 1,731 | py | Python | genevieve_client/migrations/0004_auto_20160328_1526.py | madprime/Genevieve | 0aff79f60310491a72ea9655de6696068a0a816a | [
"MIT"
] | 12 | 2017-03-21T19:51:16.000Z | 2022-03-15T22:29:49.000Z | genevieve_client/migrations/0004_auto_20160328_1526.py | madprime/Genevieve | 0aff79f60310491a72ea9655de6696068a0a816a | [
"MIT"
] | 15 | 2017-03-09T19:04:37.000Z | 2021-06-10T18:01:49.000Z | genevieve_client/migrations/0004_auto_20160328_1526.py | madprime/Genevieve | 0aff79f60310491a72ea9655de6696068a0a816a | [
"MIT"
] | 2 | 2017-03-09T17:45:44.000Z | 2018-11-10T10:00:34.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-03-28 15:26
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependen... | 36.0625 | 121 | 0.608319 |
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('genevieve_client', '0003_varia... | true | true |
f7424d3934b979eb791ca5fbe63229557fe49d3e | 5,161 | py | Python | networkx/linalg/modularitymatrix.py | AaronOpfer/networkx | f04ca835c3503f04f9b3e933270575980e44205b | [
"BSD-3-Clause"
] | 1 | 2020-05-13T01:08:42.000Z | 2020-05-13T01:08:42.000Z | networkx/linalg/modularitymatrix.py | AaronOpfer/networkx | f04ca835c3503f04f9b3e933270575980e44205b | [
"BSD-3-Clause"
] | 1 | 2019-11-28T21:08:50.000Z | 2019-11-28T21:08:50.000Z | networkx/linalg/modularitymatrix.py | AaronOpfer/networkx | f04ca835c3503f04f9b3e933270575980e44205b | [
"BSD-3-Clause"
] | 1 | 2021-01-27T12:09:05.000Z | 2021-01-27T12:09:05.000Z | """Modularity matrix of graphs.
"""
# Copyright (C) 2004-2019 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
import networkx as nx
from networkx.utils import not_implemented_for
__author__ = "\n".join(['Aric... | 30.358824 | 94 | 0.61926 |
import networkx as nx
from networkx.utils import not_implemented_for
__author__ = "\n".join(['Aric Hagberg <aric.hagberg@gmail.com>',
'Pieter Swart (swart@lanl.gov)',
'Dan Schult (dschult@colgate.edu)',
'Jean-Gabriel Young (Jean.gabriel.young... | true | true |
f7424ddd58d49942b92833abce13ff4b4b8a0968 | 16,296 | py | Python | texar/data/data_decoders.py | Holmeswww/Text_Infilling | f63cd24bee5c62d7dedd8fb35c4e52aee20c39f3 | [
"Apache-2.0"
] | 25 | 2019-01-03T09:15:20.000Z | 2022-02-12T04:20:59.000Z | texar/data/data_decoders.py | Holmeswww/Text_Infilling | f63cd24bee5c62d7dedd8fb35c4e52aee20c39f3 | [
"Apache-2.0"
] | 4 | 2019-03-28T11:02:20.000Z | 2022-02-15T04:57:33.000Z | texar/data/data_decoders.py | Holmeswww/Text_Infilling | f63cd24bee5c62d7dedd8fb35c4e52aee20c39f3 | [
"Apache-2.0"
] | 9 | 2019-01-03T02:20:37.000Z | 2022-02-12T04:20:50.000Z | # -*- coding: utf-8 -*-
#
"""
Helper functions and classes for decoding text data which are used after
reading raw text data.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import numpy as np
import tensorflow a... | 36.133038 | 80 | 0.6196 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import numpy as np
import tensorflow as tf
from tensorflow.contrib.slim.python.slim.data import data_decoder
from texar.data.vocabulary import SpecialTokens
__al... | true | true |
f7424ec0c228b84cd12298e031fd278b50250e6f | 2,836 | py | Python | zuul.d/octavia/policies/healthmonitor.py | yi-cloud/octavia | b7f5cfa4c3c454925a90c24984049539228806d7 | [
"Apache-2.0"
] | null | null | null | zuul.d/octavia/policies/healthmonitor.py | yi-cloud/octavia | b7f5cfa4c3c454925a90c24984049539228806d7 | [
"Apache-2.0"
] | null | null | null | zuul.d/octavia/policies/healthmonitor.py | yi-cloud/octavia | b7f5cfa4c3c454925a90c24984049539228806d7 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Rackspace, US 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 l... | 41.101449 | 79 | 0.61354 |
from oslo_policy import policy
from octavia.common import constants
rules = [
policy.DocumentedRuleDefault(
'{rbac_obj}{action}'.format(rbac_obj=constants.RBAC_HEALTHMONITOR,
action=constants.RBAC_GET_ALL),
constants.RULE_API_READ,
... | true | true |
f7425056ae920150494264872c50f735fe327596 | 13,336 | py | Python | generate-tests.py | cta-wave/dpctf-tests | 44ada3fc46237ff0ac00d90e00d106fbd82fff60 | [
"BSD-3-Clause"
] | 1 | 2020-09-14T12:06:03.000Z | 2020-09-14T12:06:03.000Z | generate-tests.py | cta-wave/dpctf-tests | 44ada3fc46237ff0ac00d90e00d106fbd82fff60 | [
"BSD-3-Clause"
] | 76 | 2020-11-16T14:03:53.000Z | 2022-03-22T20:41:51.000Z | generate-tests.py | cta-wave/dpctf-tests | 44ada3fc46237ff0ac00d90e00d106fbd82fff60 | [
"BSD-3-Clause"
] | 1 | 2021-09-30T13:12:53.000Z | 2021-09-30T13:12:53.000Z | #!/usr/bin/python
import sys
import os
import shutil, errno
from pathlib import Path
import hashlib
import json
import urllib.request
import re
from xml.dom.minidom import parseString
from python_lib.gweis.isoduration import parse_duration
TYPE_AUDIO = "audio"
TYPE_VIDEO = "video"
if len(sys.argv) < 3:
print("Pl... | 36.140921 | 113 | 0.62485 |
import sys
import os
import shutil, errno
from pathlib import Path
import hashlib
import json
import urllib.request
import re
from xml.dom.minidom import parseString
from python_lib.gweis.isoduration import parse_duration
TYPE_AUDIO = "audio"
TYPE_VIDEO = "video"
if len(sys.argv) < 3:
print("Please provide a CS... | true | true |
f74250b4efd42ec92a7d17d91910c3d315f0731c | 2,806 | py | Python | tests/test_asyncio_transport.py | yvdlima/python-zeep | aae3def4385b0f8922e0e83b9cdcd68b2263f739 | [
"MIT"
] | 3 | 2017-04-01T16:05:52.000Z | 2019-07-26T14:32:26.000Z | tests/test_asyncio_transport.py | yvdlima/python-zeep | aae3def4385b0f8922e0e83b9cdcd68b2263f739 | [
"MIT"
] | 1 | 2020-08-24T19:21:29.000Z | 2020-08-24T19:24:40.000Z | tests/test_asyncio_transport.py | yvdlima/python-zeep | aae3def4385b0f8922e0e83b9cdcd68b2263f739 | [
"MIT"
] | 2 | 2020-11-18T09:49:46.000Z | 2021-07-08T14:02:03.000Z | import aiohttp
import pytest
from aioresponses import aioresponses
from lxml import etree
from pretend import stub
from zeep import asyncio, exceptions
from zeep.cache import InMemoryCache
@pytest.mark.requests
def test_no_cache(event_loop):
transport = asyncio.AsyncTransport(loop=event_loop)
assert transpor... | 29.229167 | 82 | 0.701711 | import aiohttp
import pytest
from aioresponses import aioresponses
from lxml import etree
from pretend import stub
from zeep import asyncio, exceptions
from zeep.cache import InMemoryCache
@pytest.mark.requests
def test_no_cache(event_loop):
transport = asyncio.AsyncTransport(loop=event_loop)
assert transpor... | true | true |
f742513ee50f4ff7001c6a3f3a6698b1e7280970 | 3,421 | py | Python | tests/gmprocess/metrics/imt/fas_arithmetic_mean_test.py | meramossepu1/groundmotion-processing | 5cc19023b94e5b5b718590ce8cd05a22a4088a67 | [
"Unlicense"
] | 54 | 2019-01-12T02:05:38.000Z | 2022-03-29T19:43:56.000Z | tests/gmprocess/metrics/imt/fas_arithmetic_mean_test.py | meramossepu1/groundmotion-processing | 5cc19023b94e5b5b718590ce8cd05a22a4088a67 | [
"Unlicense"
] | 700 | 2018-12-18T19:44:31.000Z | 2022-03-30T20:54:28.000Z | tests/gmprocess/metrics/imt/fas_arithmetic_mean_test.py | meramossepu1/groundmotion-processing | 5cc19023b94e5b5b718590ce8cd05a22a4088a67 | [
"Unlicense"
] | 41 | 2018-11-29T23:17:56.000Z | 2022-03-31T04:04:23.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# stdlib imports
import os.path
import re
# third party imports
import numpy as np
import pandas as pd
import pkg_resources
# Local imports
from gmprocess.metrics.station_summary import StationSummary
from gmprocess.core.stationstream import StationStream
from gmprocess.... | 33.539216 | 82 | 0.556855 |
import os.path
import re
import numpy as np
import pandas as pd
import pkg_resources
from gmprocess.metrics.station_summary import StationSummary
from gmprocess.core.stationstream import StationStream
from gmprocess.core.stationtrace import StationTrace
def test_fas():
ddir = os.path.join("data", "testdat... | true | true |
f7425197a782c24528f23825384d93345f77726e | 2,043 | py | Python | ros/src/twist_controller/stability_controller.py | aero5566/Final-System-Integrated | fbaecbd7e99ff4dd39a2dd27cb325a58880f7c85 | [
"MIT"
] | null | null | null | ros/src/twist_controller/stability_controller.py | aero5566/Final-System-Integrated | fbaecbd7e99ff4dd39a2dd27cb325a58880f7c85 | [
"MIT"
] | 11 | 2020-01-28T22:58:00.000Z | 2022-03-11T23:58:23.000Z | ros/src/twist_controller/stability_controller.py | winterslong/CarND-Capstone-wlong | 0cffd22256417890188bace5074f6c481e58891b | [
"MIT"
] | 2 | 2019-10-06T07:45:23.000Z | 2019-10-08T06:16:58.000Z | # import rospy
from math import atan2, pi, sqrt
from pid import PID
GAS_DENSITY = 2.858
ONE_MPH = 0.44704
class TwistController(object):
def __init__(self, max_angular_velocity, accel_limit, decel_limit):
self.max_angular_velocity = max_angular_velocity
self.accel_limit = accel_limit
self.... | 34.627119 | 111 | 0.581498 |
from math import atan2, pi, sqrt
from pid import PID
GAS_DENSITY = 2.858
ONE_MPH = 0.44704
class TwistController(object):
def __init__(self, max_angular_velocity, accel_limit, decel_limit):
self.max_angular_velocity = max_angular_velocity
self.accel_limit = accel_limit
self.decel_limit = ... | true | true |
f74252377db9d6fa8eeb07059e4b49ddfc329441 | 1,766 | py | Python | samples/snippets/quickstart/quickstart.py | glaswasser/python-vision | 706c314a86b8f35c313bb3e907ae84317dca1a0b | [
"Apache-2.0"
] | null | null | null | samples/snippets/quickstart/quickstart.py | glaswasser/python-vision | 706c314a86b8f35c313bb3e907ae84317dca1a0b | [
"Apache-2.0"
] | null | null | null | samples/snippets/quickstart/quickstart.py | glaswasser/python-vision | 706c314a86b8f35c313bb3e907ae84317dca1a0b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | 32.703704 | 163 | 0.734994 |
def run_quickstart():
import io
import os
from google.cloud import vision
client = vision.ImageAnnotatorClient()
file_name = os.path.abspath('resources/wakeupcat.jpg')
with io.open(file_name, 'rb') as image_file:
content =... | true | true |
f74252611c7f875d5199feecf3c1cd85f059c301 | 4,190 | py | Python | tenable_io/api/users.py | skrtu/Tenable.io-SDK-for-Python | fde8871ba558666609183ac8702149ecf08421b5 | [
"MIT"
] | null | null | null | tenable_io/api/users.py | skrtu/Tenable.io-SDK-for-Python | fde8871ba558666609183ac8702149ecf08421b5 | [
"MIT"
] | null | null | null | tenable_io/api/users.py | skrtu/Tenable.io-SDK-for-Python | fde8871ba558666609183ac8702149ecf08421b5 | [
"MIT"
] | 1 | 2018-07-29T02:55:16.000Z | 2018-07-29T02:55:16.000Z | from json import loads
from tenable_io.api.base import BaseApi, BaseRequest
from tenable_io.api.models import User, UserKeys, UserList
class UsersApi(BaseApi):
def get(self, user_id):
response = self._client.get('users/%(user_id)s', {'user_id': user_id})
return User.from_json(response.text)
... | 32.48062 | 103 | 0.617422 | from json import loads
from tenable_io.api.base import BaseApi, BaseRequest
from tenable_io.api.models import User, UserKeys, UserList
class UsersApi(BaseApi):
def get(self, user_id):
response = self._client.get('users/%(user_id)s', {'user_id': user_id})
return User.from_json(response.text)
... | true | true |
f74253e858e992afdc6dba948d54da6793a65c2b | 932 | py | Python | var/spack/repos/builtin/packages/xxd-standalone/package.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2,360 | 2017-11-06T08:47:01.000Z | 2022-03-31T14:45:33.000Z | var/spack/repos/builtin/packages/xxd-standalone/package.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 13,838 | 2017-11-04T07:49:45.000Z | 2022-03-31T23:38:39.000Z | var/spack/repos/builtin/packages/xxd-standalone/package.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1,793 | 2017-11-04T07:45:50.000Z | 2022-03-30T14:31:53.000Z | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
from spack import *
class XxdStandalone(MakefilePackage):
"""xxd creates a hex dump of a given file or st... | 32.137931 | 98 | 0.696352 |
import os
from spack import *
class XxdStandalone(MakefilePackage):
homepage = "https://www.vim.org/"
url = "https://github.com/vim/vim/archive/v8.2.1201.tar.gz"
maintainers = ['haampie']
build_targets = ['-C', os.path.join('src', 'xxd')]
provides('xxd')
version('8.2.1201', sha2... | true | true |
f7425426bef76593f5f9e640968179448ad18a4a | 7,620 | py | Python | oil_lang/expr_parse.py | msingle/oil | 5623c58d4558d37cd43e6274574d94a0e547f192 | [
"Apache-2.0"
] | null | null | null | oil_lang/expr_parse.py | msingle/oil | 5623c58d4558d37cd43e6274574d94a0e547f192 | [
"Apache-2.0"
] | null | null | null | oil_lang/expr_parse.py | msingle/oil | 5623c58d4558d37cd43e6274574d94a0e547f192 | [
"Apache-2.0"
] | null | null | null | """
expr_parse.py
"""
from __future__ import print_function
import sys
from _devbuild.gen.syntax_asdl import token
from _devbuild.gen.id_kind_asdl import Id, Kind
from _devbuild.gen.types_asdl import lex_mode_e
from core import meta
from core import util
#from core.util import log
from pgen2 import parse
from typin... | 29.534884 | 83 | 0.64147 | from __future__ import print_function
import sys
from _devbuild.gen.syntax_asdl import token
from _devbuild.gen.id_kind_asdl import Id, Kind
from _devbuild.gen.types_asdl import lex_mode_e
from core import meta
from core import util
from pgen2 import parse
from typing import TYPE_CHECKING, IO, Dict, Tuple
if TYPE_... | true | true |
f742548f7709d418a35ffa086a6ce4f7cf75236d | 6,820 | py | Python | acr_module/acr/preprocessing/doc2vec_adressa.py | romybu22/chameleon-smart-sampling | d0f0588ed9d38e9c133482a68e84379c21892080 | [
"MIT"
] | 1 | 2021-03-01T17:44:04.000Z | 2021-03-01T17:44:04.000Z | acr_module/acr/preprocessing/doc2vec_adressa.py | romybu22/chameleon-smart-sampling | d0f0588ed9d38e9c133482a68e84379c21892080 | [
"MIT"
] | null | null | null | acr_module/acr/preprocessing/doc2vec_adressa.py | romybu22/chameleon-smart-sampling | d0f0588ed9d38e9c133482a68e84379c21892080 | [
"MIT"
] | null | null | null | import argparse
import pandas as pd
import numpy as np
import re
import nltk
from sklearn.preprocessing import LabelEncoder
from ..utils import serialize
from .tokenization import tokenize_articles, nan_to_str, convert_tokens_to_int, get_words_freq
from gensim.models.doc2vec import Doc2Vec, TaggedDocument
from nltk.... | 39.651163 | 214 | 0.698827 | import argparse
import pandas as pd
import numpy as np
import re
import nltk
from sklearn.preprocessing import LabelEncoder
from ..utils import serialize
from .tokenization import tokenize_articles, nan_to_str, convert_tokens_to_int, get_words_freq
from gensim.models.doc2vec import Doc2Vec, TaggedDocument
from nltk.... | true | true |
f74255cf7fc2d99163290e2320d9fbec96ea0ef7 | 17,282 | py | Python | analysis/benchmark_results.py | ajrox090/fuzzbench | d4bb0122e2ed39ea59ca703fe8eb56ee61216756 | [
"Apache-2.0"
] | 4 | 2021-11-08T06:17:02.000Z | 2022-02-28T06:34:57.000Z | analysis/benchmark_results.py | ajrox090/fuzzbench | d4bb0122e2ed39ea59ca703fe8eb56ee61216756 | [
"Apache-2.0"
] | 16 | 2020-09-22T05:04:31.000Z | 2021-03-29T08:31:33.000Z | analysis/benchmark_results.py | ajrox090/fuzzbench | d4bb0122e2ed39ea59ca703fe8eb56ee61216756 | [
"Apache-2.0"
] | 4 | 2022-02-08T05:11:08.000Z | 2022-03-14T05:15:33.000Z | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 38.835955 | 80 | 0.663233 |
import os
import functools
from analysis import data_utils
from analysis import coverage_data_utils
from analysis import stat_tests
from common import benchmark_utils
class BenchmarkResults:
def __init__(self, benchmark_name, experiment_df, coverage_dict,
output_directory, plotte... | true | true |
f7425649b6f5100d136d19714cec4a6ee93a7128 | 849 | py | Python | tests/validate/test_async_run_repository_checks.py | racelandshop/integration | 424057dcad30f20ed0276aec07d28b48b2b187be | [
"MIT"
] | null | null | null | tests/validate/test_async_run_repository_checks.py | racelandshop/integration | 424057dcad30f20ed0276aec07d28b48b2b187be | [
"MIT"
] | null | null | null | tests/validate/test_async_run_repository_checks.py | racelandshop/integration | 424057dcad30f20ed0276aec07d28b48b2b187be | [
"MIT"
] | null | null | null | import pytest
from custom_components.racelandshop.share import SHARE
from custom_components.racelandshop.validate import (
async_initialize_rules,
async_run_repository_checks,
)
@pytest.mark.asyncio
async def test_async_initialize_rules(racelandshop):
await async_initialize_rules()
@pytest.mark.asynci... | 28.3 | 81 | 0.799764 | import pytest
from custom_components.racelandshop.share import SHARE
from custom_components.racelandshop.validate import (
async_initialize_rules,
async_run_repository_checks,
)
@pytest.mark.asyncio
async def test_async_initialize_rules(racelandshop):
await async_initialize_rules()
@pytest.mark.asynci... | true | true |
f742575f2c2577a74f855843f18c09e875eedb03 | 4,649 | py | Python | ui/events/ozone/evdev/capture_device_capabilities.py | zealoussnow/chromium | fd8a8914ca0183f0add65ae55f04e287543c7d4a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 575 | 2015-06-18T23:58:20.000Z | 2022-03-23T09:32:39.000Z | ui/events/ozone/evdev/capture_device_capabilities.py | zealoussnow/chromium | fd8a8914ca0183f0add65ae55f04e287543c7d4a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 113 | 2015-05-04T09:58:14.000Z | 2022-01-31T19:35:03.000Z | ui/events/ozone/evdev/capture_device_capabilities.py | zealoussnow/chromium | fd8a8914ca0183f0add65ae55f04e287543c7d4a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 52 | 2015-07-14T10:40:50.000Z | 2022-03-15T01:11:49.000Z | #!/usr/bin/env python
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Code generator DeviceCapabilities literal."""
import argparse
import ctypes
import glob
import evdev
import os
import sys
TEST_DA... | 31.62585 | 78 | 0.665735 |
import argparse
import ctypes
import glob
import evdev
import os
import sys
TEST_DATA_GROUP_SIZE = 64
def bits_to_groups(bits):
return (bits + TEST_DATA_GROUP_SIZE - 1) // TEST_DATA_GROUP_SIZE
def serialize_bitfield(bitfield, max_bit):
result = ""
group_count = bits_to_groups(max_bit)
for group i... | true | true |
f74257e01cbe43653e26d5cb07641fae4382dd36 | 453 | py | Python | submissions/abc117/d.py | m-star18/atcoder | 08e475810516602fa088f87daf1eba590b4e07cc | [
"Unlicense"
] | 1 | 2021-05-10T01:16:28.000Z | 2021-05-10T01:16:28.000Z | submissions/abc117/d.py | m-star18/atcoder | 08e475810516602fa088f87daf1eba590b4e07cc | [
"Unlicense"
] | 3 | 2021-05-11T06:14:15.000Z | 2021-06-19T08:18:36.000Z | submissions/abc117/d.py | m-star18/atcoder | 08e475810516602fa088f87daf1eba590b4e07cc | [
"Unlicense"
] | null | null | null | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)
n, k, *a = map(int, read().split())
v = 0
ans = 0
for i in range(40, -1, -1):
cnt = 0
for aa in a:
if (aa >> i) & 1:
cnt += 1
if n - cnt > c... | 21.571429 | 43 | 0.496689 | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)
n, k, *a = map(int, read().split())
v = 0
ans = 0
for i in range(40, -1, -1):
cnt = 0
for aa in a:
if (aa >> i) & 1:
cnt += 1
if n - cnt > c... | true | true |
f7425853119483c6e71a417ecdbaeeb469f18ca1 | 4,407 | py | Python | src/bytesparse/__init__.py | TexZK/bytesparse | cdb1e58e9e6a6911efd72697c1cb812bc85025c8 | [
"BSD-2-Clause"
] | null | null | null | src/bytesparse/__init__.py | TexZK/bytesparse | cdb1e58e9e6a6911efd72697c1cb812bc85025c8 | [
"BSD-2-Clause"
] | 13 | 2021-11-15T02:27:19.000Z | 2022-02-17T00:13:08.000Z | src/bytesparse/__init__.py | TexZK/bytesparse | cdb1e58e9e6a6911efd72697c1cb812bc85025c8 | [
"BSD-2-Clause"
] | null | null | null | # Copyright (c) 2020-2022, Andrea Zoppi.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions ... | 36.725 | 82 | 0.570683 |
__version__ = '0.0.4'
from .inplace import Memory
from .inplace import bytesparse
from .inplace import collapse_blocks
| true | true |
f742587dc715674022c1a125da9de67af190bf36 | 11,909 | py | Python | notebooks/__code/radial_profile/event_handler.py | mabrahamdevops/python_notebooks | 6d5e7383b60cc7fd476f6e85ab93e239c9c32330 | [
"BSD-3-Clause"
] | null | null | null | notebooks/__code/radial_profile/event_handler.py | mabrahamdevops/python_notebooks | 6d5e7383b60cc7fd476f6e85ab93e239c9c32330 | [
"BSD-3-Clause"
] | null | null | null | notebooks/__code/radial_profile/event_handler.py | mabrahamdevops/python_notebooks | 6d5e7383b60cc7fd476f6e85ab93e239c9c32330 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
import pyqtgraph as pg
from qtpy import QtGui
from __code._utilities.parent import Parent
from __code.radial_profile.display import Display
class EventHandler(Parent):
def file_index_changed(self):
file_index = self.parent.ui.slider.value()
live_image = self.parent.get_selecte... | 35.338279 | 112 | 0.585943 | import numpy as np
import pyqtgraph as pg
from qtpy import QtGui
from __code._utilities.parent import Parent
from __code.radial_profile.display import Display
class EventHandler(Parent):
def file_index_changed(self):
file_index = self.parent.ui.slider.value()
live_image = self.parent.get_selecte... | true | true |
f74258a1391fbce610504986855ee29a38b03231 | 16,258 | py | Python | nipy/neurospin/spatial_models/parcellation.py | fperez/nipy | 559f17150bd9fa8ead4fd088b330d7cf7db7aa79 | [
"BSD-3-Clause"
] | 1 | 2015-05-07T16:53:33.000Z | 2015-05-07T16:53:33.000Z | nipy/neurospin/spatial_models/parcellation.py | fperez/nipy | 559f17150bd9fa8ead4fd088b330d7cf7db7aa79 | [
"BSD-3-Clause"
] | null | null | null | nipy/neurospin/spatial_models/parcellation.py | fperez/nipy | 559f17150bd9fa8ead4fd088b330d7cf7db7aa79 | [
"BSD-3-Clause"
] | null | null | null | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#autoindent
"""
Generic Parcellation class:
Contains all the items that define a multi-subject parcellation
Author : Bertrand Thirion, 2005-2008
TODO : add a method 'global field', i.e. non-subject-speci... | 27.37037 | 81 | 0.617727 |
"""
Generic Parcellation class:
Contains all the items that define a multi-subject parcellation
Author : Bertrand Thirion, 2005-2008
TODO : add a method 'global field', i.e. non-subject-specific info
"""
import numpy as np
class Parcellation(object):
"""
This is the basic Parcellation class:
It is defined di... | false | true |
f74258f1688b8229c6b669451669fca5094715dc | 1,318 | py | Python | Excel-Refresh/ExcelRefresh.py | ajhodgson/Python | f98afeef155d489d3626fda02d0afc39502da102 | [
"MIT"
] | null | null | null | Excel-Refresh/ExcelRefresh.py | ajhodgson/Python | f98afeef155d489d3626fda02d0afc39502da102 | [
"MIT"
] | null | null | null | Excel-Refresh/ExcelRefresh.py | ajhodgson/Python | f98afeef155d489d3626fda02d0afc39502da102 | [
"MIT"
] | null | null | null | # ExcelRefresh.py
import win32com.client
import win32con
import shutil
import time
import ctypes
import os
from pathlib import Path
from pythoncom import com_error
def ExcelRefresh (filename, path):
file = filename
SourcePathName = (path + '/')
if os.path.exists(SourcePathName+file):
... | 28.042553 | 203 | 0.573596 |
import win32com.client
import win32con
import shutil
import time
import ctypes
import os
from pathlib import Path
from pythoncom import com_error
def ExcelRefresh (filename, path):
file = filename
SourcePathName = (path + '/')
if os.path.exists(SourcePathName+file):
Applicati... | false | true |
f74259843496a4f4a5b9701ef7797e24fcfbbe58 | 1,072 | py | Python | draugr/visualisation/matplotlib_utilities/styles/cyclers.py | pything/draugr | 2fda662f2fa97236e4495a6af2b8237516fa428b | [
"Apache-2.0"
] | null | null | null | draugr/visualisation/matplotlib_utilities/styles/cyclers.py | pything/draugr | 2fda662f2fa97236e4495a6af2b8237516fa428b | [
"Apache-2.0"
] | 16 | 2021-02-15T07:58:01.000Z | 2022-02-20T15:16:23.000Z | draugr/visualisation/matplotlib_utilities/styles/cyclers.py | pything/draugr | 2fda662f2fa97236e4495a6af2b8237516fa428b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = "Christian Heider Nielsen"
__doc__ = r"""
Created on 18-02-2021
"""
__all__ = [
"monochrome_hatch_cycler",
"simple_hatch_cycler",
"monochrome_line_no_marker_cycler",
"monochrome_line_cycler",
]
from matplotlib import c... | 22.808511 | 71 | 0.689366 |
__author__ = "Christian Heider Nielsen"
__doc__ = r"""
Created on 18-02-2021
"""
__all__ = [
"monochrome_hatch_cycler",
"simple_hatch_cycler",
"monochrome_line_no_marker_cycler",
"monochrome_line_cycler",
]
from matplotlib import cycler
from draugr.visualisation.matplotlib_u... | true | true |
f7425a2778150b3d0ca699fd4d0e7b23f749eff4 | 3,064 | py | Python | sdk/python/pulumi_oci/apigateway/get_api_validation.py | EladGabay/pulumi-oci | 6841e27d4a1a7e15c672306b769912efbfd3ba99 | [
"ECL-2.0",
"Apache-2.0"
] | 5 | 2021-08-17T11:14:46.000Z | 2021-12-31T02:07:03.000Z | sdk/python/pulumi_oci/apigateway/get_api_validation.py | pulumi-oci/pulumi-oci | 6841e27d4a1a7e15c672306b769912efbfd3ba99 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2021-09-06T11:21:29.000Z | 2021-09-06T11:21:29.000Z | sdk/python/pulumi_oci/apigateway/get_api_validation.py | pulumi-oci/pulumi-oci | 6841e27d4a1a7e15c672306b769912efbfd3ba99 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2021-08-24T23:31:30.000Z | 2022-01-02T19:26:54.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | 31.265306 | 142 | 0.668407 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from . import outputs
__all__ = [
'GetApiValidationResult',
'AwaitableGetApiValidationResult',
'get_api_validation',
]
@pulumi.output_type
class GetApiVali... | true | true |
f7425b52a9b64e9c276d2c700fe346b94f2c87aa | 4,632 | py | Python | examples/compose/plot_compare_reduction.py | emarkou/scikit-learn | d73822f84f2832dcc25f0ff58769f60871a78025 | [
"BSD-3-Clause"
] | 27 | 2015-01-22T22:30:09.000Z | 2022-02-15T07:33:06.000Z | examples/compose/plot_compare_reduction.py | emarkou/scikit-learn | d73822f84f2832dcc25f0ff58769f60871a78025 | [
"BSD-3-Clause"
] | 29 | 2021-03-04T02:56:48.000Z | 2021-04-06T04:06:45.000Z | examples/compose/plot_compare_reduction.py | emarkou/scikit-learn | d73822f84f2832dcc25f0ff58769f60871a78025 | [
"BSD-3-Clause"
] | 25 | 2015-07-30T13:47:25.000Z | 2021-08-03T07:48:38.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
=================================================================
Selecting dimensionality reduction with Pipeline and GridSearchCV
=================================================================
This example constructs a pipeline that does dimensionality
reduction f... | 35.906977 | 79 | 0.689983 |
import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets import load_digits
from sklearn.model_selection import GridSearchCV
from sklearn.pipeline import Pipeline
from sklearn.svm import LinearSVC
from sklearn.decomposition import PCA, NMF
from sklearn.feature_selection import SelectKBest, chi2
p... | true | true |
f7425c77f2e193ae8ca6cdc1f28da65eb219eabe | 583 | py | Python | server/async_client.py | infotraining-team/python-asyncio-2021-06-14 | 507bc4997e5038022b1844e3baa7276e81dd977e | [
"CC0-1.0"
] | null | null | null | server/async_client.py | infotraining-team/python-asyncio-2021-06-14 | 507bc4997e5038022b1844e3baa7276e81dd977e | [
"CC0-1.0"
] | null | null | null | server/async_client.py | infotraining-team/python-asyncio-2021-06-14 | 507bc4997e5038022b1844e3baa7276e81dd977e | [
"CC0-1.0"
] | 1 | 2021-06-26T08:39:01.000Z | 2021-06-26T08:39:01.000Z | import asyncio
import time
n = 0
async def monitor():
global n
while True:
await asyncio.sleep(1)
print(f"{n} req/sec")
n = 0
async def client(address, num):
global n
reader, writer = await asyncio.open_connection(*address)
while True:
writer.write(b'1000')
... | 21.592593 | 90 | 0.595197 | import asyncio
import time
n = 0
async def monitor():
global n
while True:
await asyncio.sleep(1)
print(f"{n} req/sec")
n = 0
async def client(address, num):
global n
reader, writer = await asyncio.open_connection(*address)
while True:
writer.write(b'1000')
... | true | true |
f7425d36fe0f6897968f289c5528c4b52be383e4 | 23,070 | py | Python | utils/check_repo.py | slowy07/transformers | 7223844df9738719ee335428a326cd712f506806 | [
"Apache-2.0"
] | 15 | 2021-08-10T01:10:44.000Z | 2022-01-20T15:23:49.000Z | utils/check_repo.py | 4nalog/transformers | 76cadb7943c8492ec481f4f3925e9e8793a32c9d | [
"Apache-2.0"
] | 1 | 2020-03-21T21:38:47.000Z | 2020-03-21T21:38:50.000Z | utils/check_repo.py | 4nalog/transformers | 76cadb7943c8492ec481f4f3925e9e8793a32c9d | [
"Apache-2.0"
] | 1 | 2021-04-02T20:42:10.000Z | 2021-04-02T20:42:10.000Z | # coding=utf-8
# Copyright 2020 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 40.831858 | 141 | 0.687603 |
import importlib
import inspect
import os
import re
import warnings
from pathlib import Path
from transformers import is_flax_available, is_tf_available, is_torch_available
from transformers.file_utils import ENV_VARS_TRUE_VALUES
from transformers.models.auto import get_values
PATH_TO_TRANSFORMERS =... | true | true |
f7425dfef542a002ada91530f02a4bc313261b7a | 13,083 | py | Python | hcloud/images/client.py | usmannasir/hcloud-python | 2a90551fb1c4d9d8a6aea5d8b6601a7c1360494d | [
"MIT"
] | 1 | 2019-10-23T01:00:08.000Z | 2019-10-23T01:00:08.000Z | hcloud/images/client.py | usmannasir/hcloud-python | 2a90551fb1c4d9d8a6aea5d8b6601a7c1360494d | [
"MIT"
] | null | null | null | hcloud/images/client.py | usmannasir/hcloud-python | 2a90551fb1c4d9d8a6aea5d8b6601a7c1360494d | [
"MIT"
] | 1 | 2019-06-19T17:53:10.000Z | 2019-06-19T17:53:10.000Z | # -*- coding: utf-8 -*-
from hcloud.actions.client import BoundAction
from hcloud.core.client import BoundModelBase, ClientEntityBase, GetEntityByNameMixin
from hcloud.core.domain import add_meta_to_result
from hcloud.images.domain import Image
class BoundImage(BoundModelBase):
model = Image
def __init__(se... | 48.455556 | 281 | 0.610181 |
from hcloud.actions.client import BoundAction
from hcloud.core.client import BoundModelBase, ClientEntityBase, GetEntityByNameMixin
from hcloud.core.domain import add_meta_to_result
from hcloud.images.domain import Image
class BoundImage(BoundModelBase):
model = Image
def __init__(self, client, data):
... | true | true |
f7425ef115d04e60b4ac7ffa51f3a7f52c3bd0f9 | 39,548 | py | Python | dev/Tools/AWSPythonSDK/1.5.8/docutils/utils/smartquotes.py | jeikabu/lumberyard | 07228c605ce16cbf5aaa209a94a3cb9d6c1a4115 | [
"AML"
] | 5,079 | 2015-01-01T03:39:46.000Z | 2022-03-31T07:38:22.000Z | desktop/core/ext-py/docutils-0.14/docutils/utils/smartquotes.py | zks888/hue | 93a8c370713e70b216c428caa2f75185ef809deb | [
"Apache-2.0"
] | 1,623 | 2015-01-01T08:06:24.000Z | 2022-03-30T19:48:52.000Z | desktop/core/ext-py/docutils-0.14/docutils/utils/smartquotes.py | zks888/hue | 93a8c370713e70b216c428caa2f75185ef809deb | [
"Apache-2.0"
] | 2,033 | 2015-01-04T07:18:02.000Z | 2022-03-28T19:55:47.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# :Id: $Id: smartquotes.py 8095 2017-05-30 21:04:18Z milde $
# :Copyright: © 2010 Günter Milde,
# original `SmartyPants`_: © 2003 John Gruber
# smartypants.py: © 2004, 2007 Chad Miller
# :Maintainer: docutils-develop@lists.sourceforge.net
# :Li... | 38.658847 | 126 | 0.581774 |
r"""
=========================
Smart Quotes for Docutils
=========================
Synopsis
========
"SmartyPants" is a free web publishing plug-in for Movable Type, Blosxom, and
BBEdit that easily translates plain ASCII punctuation characters into "smart"
typographic punctuation characters.
``smar... | false | true |
f7425f7f34377c2adc0023474c72890a47102ebe | 1,767 | py | Python | DP/PolicyEvaluation.py | junhyeokahn/RLBasicAlgorithm | 25e3e471336cb7855e28c0f9905e2214afdeb2e4 | [
"MIT"
] | 2 | 2019-08-21T04:56:10.000Z | 2020-09-05T19:55:32.000Z | DP/PolicyEvaluation.py | junhyeokahn/RLBasicAlgorithm | 25e3e471336cb7855e28c0f9905e2214afdeb2e4 | [
"MIT"
] | null | null | null | DP/PolicyEvaluation.py | junhyeokahn/RLBasicAlgorithm | 25e3e471336cb7855e28c0f9905e2214afdeb2e4 | [
"MIT"
] | 1 | 2020-11-08T07:31:56.000Z | 2020-11-08T07:31:56.000Z | import numpy as np
import sys
if "../" not in sys.path:
sys.path.append("../")
from lib.envs.gridworld import GridworldEnv
env = GridworldEnv()
def policy_eval(policy, env, discount_factor=1.0, theta=0.00001):
"""
Evaluate a policy given an environment and a full description of the
environment's dyn... | 29.949153 | 79 | 0.603282 | import numpy as np
import sys
if "../" not in sys.path:
sys.path.append("../")
from lib.envs.gridworld import GridworldEnv
env = GridworldEnv()
def policy_eval(policy, env, discount_factor=1.0, theta=0.00001):
V = np.zeros(env.nS)
while True:
delta=0
for s in range(env.nS):
... | true | true |
f7425fb763558cbbbafe06d31ae47cd2986b8150 | 1,759 | py | Python | venv/Scripts/rst2odt_prepstyles.py | sampaiowysk/GPTo | 592d1980f1a149961bbb1c7015bdaa9c97a75070 | [
"MIT"
] | null | null | null | venv/Scripts/rst2odt_prepstyles.py | sampaiowysk/GPTo | 592d1980f1a149961bbb1c7015bdaa9c97a75070 | [
"MIT"
] | null | null | null | venv/Scripts/rst2odt_prepstyles.py | sampaiowysk/GPTo | 592d1980f1a149961bbb1c7015bdaa9c97a75070 | [
"MIT"
] | null | null | null | #!C:\Users\DTI-GSAMPAIO\Python\Day of Data Science\GPTo\venv\Scripts\python.exe
# $Id: rst2odt_prepstyles.py 5839 2009-01-07 19:09:28Z dkuhlman $
# Author: Dave Kuhlman <dkuhlman@rexx.com>
# Copyright: This module has been placed in the public domain.
"""
Fix a word-processor-generated styles.odt for odtwriter use: D... | 25.867647 | 79 | 0.642979 |
from lxml import etree
import sys
import zipfile
from tempfile import mkstemp
import shutil
import os
NAMESPACES = {
"style": "urn:oasis:names:tc:opendocument:xmlns:style:1.0",
"fo": "urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
}
def prepstyle(filename):
zin = zipfile.ZipFi... | true | true |
f74260d61de5dfb3bc1367f0c5af7a24d8b5476e | 2,301 | py | Python | tests/test_rollardex.py | mandshaw/lethe | 05f3e8b7394c6fc6347af825366119db2c4cd3e0 | [
"MIT"
] | null | null | null | tests/test_rollardex.py | mandshaw/lethe | 05f3e8b7394c6fc6347af825366119db2c4cd3e0 | [
"MIT"
] | null | null | null | tests/test_rollardex.py | mandshaw/lethe | 05f3e8b7394c6fc6347af825366119db2c4cd3e0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_lethe
----------------------------------
Tests for `lethe` module.
"""
import sys
import shutil
import unittest
from datetime import datetime
import os
from lethe.rollardex import Person, RollarDex
fixtures_dir = os.path.join(os.path.dirname(__file__), 'fixtur... | 35.953125 | 118 | 0.660582 |
import sys
import shutil
import unittest
from datetime import datetime
import os
from lethe.rollardex import Person, RollarDex
fixtures_dir = os.path.join(os.path.dirname(__file__), 'fixtures')
class TestRollarDex(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
d... | true | true |
f7426166945ee8e0b6912de1651615ba712c8029 | 14,180 | py | Python | osmnx/utils.py | pmartincalvo/osmnx | 15eddc0672f0ec951ada1b89eb417df44d35636e | [
"MIT"
] | 2 | 2020-01-31T21:25:32.000Z | 2020-01-31T21:30:15.000Z | osmnx/utils.py | pmartincalvo/osmnx | 15eddc0672f0ec951ada1b89eb417df44d35636e | [
"MIT"
] | null | null | null | osmnx/utils.py | pmartincalvo/osmnx | 15eddc0672f0ec951ada1b89eb417df44d35636e | [
"MIT"
] | null | null | null | import sys
import os
import datetime as dt
import unicodedata
import networkx as nx
import numpy as np
import logging as lg
from . import settings
def citation():
"""
Print the OSMnx package's citation information.
Boeing, G. 2017. OSMnx: New Methods for Acquiring, Constructing, Analyzing,
and Visual... | 34.33414 | 149 | 0.661918 | import sys
import os
import datetime as dt
import unicodedata
import networkx as nx
import numpy as np
import logging as lg
from . import settings
def citation():
cite = ("To cite OSMnx, use:\n\n"
"Boeing, G. 2017. OSMnx: New Methods for Acquiring, Constructing, Analyzing, "
"and Visualiz... | true | true |
f7426175423c4c4002baea3f82c2a60f03d5ce31 | 16,574 | py | Python | usbserial4a/pl2303serial4a.py | jacklinquan/usbserial4a | b78f6ca16336dae94eeebfd930b7db2abfda4162 | [
"MIT"
] | 31 | 2019-03-28T09:02:27.000Z | 2022-03-23T16:58:17.000Z | usbserial4a/pl2303serial4a.py | jacklinquan/usbserial4a | b78f6ca16336dae94eeebfd930b7db2abfda4162 | [
"MIT"
] | 11 | 2019-06-13T05:47:47.000Z | 2022-02-07T03:20:46.000Z | usbserial4a/pl2303serial4a.py | jacklinquan/usbserial4a | b78f6ca16336dae94eeebfd930b7db2abfda4162 | [
"MIT"
] | 16 | 2019-05-05T17:20:40.000Z | 2022-02-13T01:12:44.000Z | """Android USB serial PL2303 driver.
Classes:
Pl2303Serial
"""
from struct import pack, unpack
import time
from .utilserial4a import (
SerialBase,
SerialException,
to_bytes,
PortNotOpenError,
Timeout,
)
from usb4a import usb
class Pl2303Serial(SerialBase):
"""PL2303 serial port class."""
... | 29.438721 | 87 | 0.580669 |
from struct import pack, unpack
import time
from .utilserial4a import (
SerialBase,
SerialException,
to_bytes,
PortNotOpenError,
Timeout,
)
from usb4a import usb
class Pl2303Serial(SerialBase):
DEFAULT_BAUDRATE = 9600
USB_RECIP_INTERFACE = 0x01
PROLIFIC_VENDOR_READ_REQUEST = 0... | true | true |
f742618822a66ed5be2c23765bb3359ce3d21299 | 13,130 | py | Python | homeassistant/components/media_player/pandora.py | shire210/home-assistant | 63cd8bbee6f1b74ae9c6c249ac820119a8a573d8 | [
"Apache-2.0"
] | 2 | 2017-02-25T00:27:06.000Z | 2017-02-25T03:09:30.000Z | homeassistant/components/media_player/pandora.py | shire210/home-assistant | 63cd8bbee6f1b74ae9c6c249ac820119a8a573d8 | [
"Apache-2.0"
] | 1 | 2017-03-10T22:17:06.000Z | 2017-03-10T22:17:06.000Z | homeassistant/components/media_player/pandora.py | shire210/home-assistant | 63cd8bbee6f1b74ae9c6c249ac820119a8a573d8 | [
"Apache-2.0"
] | 2 | 2018-06-03T11:14:44.000Z | 2018-11-04T18:18:12.000Z | """
Component for controlling Pandora stations through the pianobar client.
For more details about this platform, please refer to the documentation
https://home-assistant.io/components/media_player.pandora/
"""
import logging
import re
import os
import signal
from datetime import timedelta
import shutil
from homeass... | 35.582656 | 79 | 0.612338 |
import logging
import re
import os
import signal
from datetime import timedelta
import shutil
from homeassistant.const import EVENT_HOMEASSISTANT_STOP
from homeassistant.components.media_player import (
SUPPORT_NEXT_TRACK, SUPPORT_PAUSE, MEDIA_TYPE_MUSIC,
SUPPORT_TURN_OFF, SUPPORT_TURN_ON, SUPPORT_PLAY,
S... | true | true |
f74261f292bca121e0b70b754b47c49d8161b99b | 1,787 | py | Python | meiduo_mall/apps/meiduo_admin/login.py | zhengcongreal/meiduo_project- | 5899a344859a0c1455e45ed4fb699d2ace08ba18 | [
"Apache-2.0"
] | null | null | null | meiduo_mall/apps/meiduo_admin/login.py | zhengcongreal/meiduo_project- | 5899a344859a0c1455e45ed4fb699d2ace08ba18 | [
"Apache-2.0"
] | 1 | 2020-10-26T16:10:06.000Z | 2020-10-26T16:10:06.000Z | meiduo_mall/apps/meiduo_admin/login.py | zhengcongreal/meiduo_project | 5899a344859a0c1455e45ed4fb699d2ace08ba18 | [
"Apache-2.0"
] | null | null | null | from rest_framework_jwt.views import JSONWebTokenAPIView
from rest_framework_jwt.serializers import JSONWebTokenSerializer
from django.contrib.auth import authenticate
from rest_framework import serializers
from django.utils.translation import ugettext as _
from rest_framework_jwt.settings import api_settings
jwt_paylo... | 36.469388 | 70 | 0.644656 | from rest_framework_jwt.views import JSONWebTokenAPIView
from rest_framework_jwt.serializers import JSONWebTokenSerializer
from django.contrib.auth import authenticate
from rest_framework import serializers
from django.utils.translation import ugettext as _
from rest_framework_jwt.settings import api_settings
jwt_paylo... | true | true |
f742623c6bbba552f8cd52bd91bea5e26471d170 | 2,858 | py | Python | lib/spack/spack/compilers/arm.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2,360 | 2017-11-06T08:47:01.000Z | 2022-03-31T14:45:33.000Z | lib/spack/spack/compilers/arm.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 13,838 | 2017-11-04T07:49:45.000Z | 2022-03-31T23:38:39.000Z | lib/spack/spack/compilers/arm.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1,793 | 2017-11-04T07:45:50.000Z | 2022-03-30T14:31:53.000Z | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import re
import spack.compiler
class Arm(spack.compiler.Compiler):
# Subclasses use possible names of C compiler
... | 25.517857 | 92 | 0.590623 |
import re
import spack.compiler
class Arm(spack.compiler.Compiler):
cc_names = ['armclang']
cxx_names = ['armclang++']
f77_names = ['armflang']
fc_names = ['armflang']
link_paths = {'cc': 'arm/armclang',
'cxx': 'arm/armclang++',
... | true | true |
f74262fd8a2fb5486bf6a19954a4f9143ca60948 | 329 | py | Python | urls.py | focusonecc/notification | 02206291804259fb5ddcdfafaddf0bede2cf7e29 | [
"MIT"
] | null | null | null | urls.py | focusonecc/notification | 02206291804259fb5ddcdfafaddf0bede2cf7e29 | [
"MIT"
] | 4 | 2017-12-25T12:32:42.000Z | 2018-01-02T13:17:40.000Z | notification/urls.py | focusonecc/common | d61631d5b1c068422dcf40be199972ed36fa26be | [
"MIT"
] | null | null | null | # -*- encoding: utf-8 -*-
from django.conf.urls import url
from notification.views import test_ios_notification, test_android_notification
urlpatterns = [
url(r'test/ios/$', test_ios_notification, name='test-ios-notification'),
url(r'test/android/$', test_android_notification, name='test-android-notification'... | 32.9 | 88 | 0.744681 |
from django.conf.urls import url
from notification.views import test_ios_notification, test_android_notification
urlpatterns = [
url(r'test/ios/$', test_ios_notification, name='test-ios-notification'),
url(r'test/android/$', test_android_notification, name='test-android-notification'),
] | true | true |
f74263860e16997242863747d4c844db70a0c2f6 | 9,764 | py | Python | actor/fighter.py | tamamiyasita/Roguelike-Tutorial-2020 | db4d4e5369010567bc39bdd404c4f3a7998670fd | [
"MIT"
] | null | null | null | actor/fighter.py | tamamiyasita/Roguelike-Tutorial-2020 | db4d4e5369010567bc39bdd404c4f3a7998670fd | [
"MIT"
] | null | null | null | actor/fighter.py | tamamiyasita/Roguelike-Tutorial-2020 | db4d4e5369010567bc39bdd404c4f3a7998670fd | [
"MIT"
] | null | null | null | import random
from constants import *
from util import dice, stop_watch
from anime.hit_anime import hit_particle, Hit_Anime
class Fighter:
def __init__(self, hp=0, defense=0, STR=0, DEX=0, INT=0, speed=10,
evasion=0, xp_reward=0, level=1,
# 物理:オレンジ, 火:赤, 氷:白, 雷:青, 酸:黄色, 毒:紫, 精神:ピ... | 29.95092 | 132 | 0.544756 | import random
from constants import *
from util import dice, stop_watch
from anime.hit_anime import hit_particle, Hit_Anime
class Fighter:
def __init__(self, hp=0, defense=0, STR=0, DEX=0, INT=0, speed=10,
evasion=0, xp_reward=0, level=1,
resist={"physical": 1, ... | true | true |
f742640f44a63c0e2d0de5704e13205416d0d0b2 | 9,861 | py | Python | catalog/pub/utils/toscaparser/nsdmodel.py | onap/archive-vfc-nfvo-catalog | 24b92a2210c2063935d313f08e1da1e9cee45f3f | [
"Apache-2.0"
] | 1 | 2019-09-25T05:38:42.000Z | 2019-09-25T05:38:42.000Z | catalog/pub/utils/toscaparser/nsdmodel.py | onap/archive-vfc-nfvo-catalog | 24b92a2210c2063935d313f08e1da1e9cee45f3f | [
"Apache-2.0"
] | 3 | 2021-02-03T08:59:39.000Z | 2022-03-18T02:18:12.000Z | catalog/pub/utils/toscaparser/nsdmodel.py | onap/modeling-etsicatalog | b16b4579ea80bf82fa497e4934b2bb8728845b58 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 ZTE Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 44.61991 | 140 | 0.607139 |
import functools
import logging
from catalog.pub.utils.toscaparser.basemodel import BaseInfoModel
from catalog.pub.utils.toscaparser.const import SDC_SERVICE_METADATA_SECTIONS
from catalog.pub.utils.toscaparser.servicemodel import SdcServiceModel
logger = logging.getLogger(__name__)
SECTIONS = (NS_TYPE,... | true | true |
f7426558082b6e4af0d77a8cd56c0bf307360a30 | 725 | py | Python | download_model.py | grausof/AgeGenderEmotion | 12b1fe331b69a4be98f8a8de46cc1c75a07e7f40 | [
"MIT"
] | null | null | null | download_model.py | grausof/AgeGenderEmotion | 12b1fe331b69a4be98f8a8de46cc1c75a07e7f40 | [
"MIT"
] | null | null | null | download_model.py | grausof/AgeGenderEmotion | 12b1fe331b69a4be98f8a8de46cc1c75a07e7f40 | [
"MIT"
] | null | null | null | #Download pretrained model
import os
import sys
import urllib2
def main(argv):
OUTPUT_PATH="./pretrain/"
if not os.path.isdir(OUTPUT_PATH):
os.mkdir(OUTPUT_PATH)
with open(OUTPUT_PATH+'agegender_age101_squeezenet.hdf5','wb') as f:
f.write(urllib2.urlopen("http://www.abars.biz/keras/agegender_age101_squeezenet.... | 31.521739 | 96 | 0.742069 |
import os
import sys
import urllib2
def main(argv):
OUTPUT_PATH="./pretrain/"
if not os.path.isdir(OUTPUT_PATH):
os.mkdir(OUTPUT_PATH)
with open(OUTPUT_PATH+'agegender_age101_squeezenet.hdf5','wb') as f:
f.write(urllib2.urlopen("http://www.abars.biz/keras/agegender_age101_squeezenet.hdf5").read())
f.close()... | true | true |
f74266a217719639ccbbd8175d107164013f4ba3 | 1,515 | py | Python | exchange/simulated.py | jp-quant/qfengine | f71c263becb82ee5b7022c17d7983b40d5df31bb | [
"MIT"
] | 3 | 2021-01-19T10:16:19.000Z | 2022-02-13T16:33:11.000Z | exchange/simulated.py | jp-quant/qfengine | f71c263becb82ee5b7022c17d7983b40d5df31bb | [
"MIT"
] | null | null | null | exchange/simulated.py | jp-quant/qfengine | f71c263becb82ee5b7022c17d7983b40d5df31bb | [
"MIT"
] | 2 | 2021-05-11T12:01:34.000Z | 2021-08-29T04:49:25.000Z | from qfengine.exchange.exchange import Exchange
import datetime
class SimulatedExchange(Exchange):
"""
The SimulatedExchange class is used to model a live
trading venue.
It exposes methods to inform a client class intance of
when the exchange is open to determine when orders can
be executed.
... | 30.3 | 63 | 0.59736 | from qfengine.exchange.exchange import Exchange
import datetime
class SimulatedExchange(Exchange):
def __init__(self, start_dt):
self.start_dt = start_dt
self.open_dt = datetime.time(9, 30)
self.close_dt = datetime.time(16, 00)
def is_open_at_datetime(self, dt):
... | true | true |
f74266af63c025e05006ca314930ea507ba7e6c7 | 17,304 | py | Python | scripts/linters/html_linter.py | siddharthmehta02/oppia | 973f777a6c5a8c3442846bda839e63856dfddf72 | [
"Apache-2.0"
] | 3 | 2020-12-26T12:43:16.000Z | 2021-04-08T15:46:02.000Z | scripts/linters/html_linter.py | siddharthmehta02/oppia | 973f777a6c5a8c3442846bda839e63856dfddf72 | [
"Apache-2.0"
] | null | null | null | scripts/linters/html_linter.py | siddharthmehta02/oppia | 973f777a6c5a8c3442846bda839e63856dfddf72 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2020 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | 38.198675 | 80 | 0.598821 |
from __future__ import absolute_import
from __future__ import unicode_literals
import html.parser
import os
import re
import subprocess
from core import python_utils
from .. import common
from .. import concurrent_task_utils
class TagMismatchException(Exception):
pass
class CustomHTMLParser... | true | true |
f74267586f2af94468b20e150fca7dcb9abef5b1 | 1,569 | py | Python | Python3/1494-Parallel-Courses-II/soln.py | wyaadarsh/LeetCode-Solutions | 3719f5cb059eefd66b83eb8ae990652f4b7fd124 | [
"MIT"
] | 5 | 2020-07-24T17:48:59.000Z | 2020-12-21T05:56:00.000Z | Python3/1494-Parallel-Courses-II/soln.py | zhangyaqi1989/LeetCode-Solutions | 2655a1ffc8678ad1de6c24295071308a18c5dc6e | [
"MIT"
] | null | null | null | Python3/1494-Parallel-Courses-II/soln.py | zhangyaqi1989/LeetCode-Solutions | 2655a1ffc8678ad1de6c24295071308a18c5dc6e | [
"MIT"
] | 2 | 2020-07-24T17:49:01.000Z | 2020-08-31T19:57:35.000Z | # This solution may be wrong
class Solution:
def minNumberOfSemesters(self, n: int, dependencies: List[List[int]], k: int) -> int:
graph = [[] for _ in range(n)]
memo_indegrees = [0] * n
for u, v in dependencies:
u -= 1
v -= 1
memo_indegrees[v] += 1
... | 34.866667 | 107 | 0.456342 |
class Solution:
def minNumberOfSemesters(self, n: int, dependencies: List[List[int]], k: int) -> int:
graph = [[] for _ in range(n)]
memo_indegrees = [0] * n
for u, v in dependencies:
u -= 1
v -= 1
memo_indegrees[v] += 1
graph[u].append(v)
... | true | true |
f742675e002deed92636b4dad618638699a30ac2 | 5,366 | py | Python | src/cactus/preprocessor/lastzRepeatMasking/cactus_lastzRepeatMask.py | adamnovak/cactus | 8cbeb88dd3459416a8eef0ec4ef8e23622ba2b01 | [
"MIT-0"
] | null | null | null | src/cactus/preprocessor/lastzRepeatMasking/cactus_lastzRepeatMask.py | adamnovak/cactus | 8cbeb88dd3459416a8eef0ec4ef8e23622ba2b01 | [
"MIT-0"
] | null | null | null | src/cactus/preprocessor/lastzRepeatMasking/cactus_lastzRepeatMask.py | adamnovak/cactus | 8cbeb88dd3459416a8eef0ec4ef8e23622ba2b01 | [
"MIT-0"
] | null | null | null | #!/usr/bin/env python3
## USE LASTZ TO SOFTMASK REPEATS OF A GIVEN FASTA SEQUENCE FILE.
import os
from sonLib.bioio import catFiles
from cactus.shared.common import cactus_call
from cactus.shared.common import RoundedJob
class RepeatMaskOptions:
def __init__(self,
fragment=200,
minPerio... | 46.258621 | 173 | 0.632501 |
red.common import cactus_call
from cactus.shared.common import RoundedJob
class RepeatMaskOptions:
def __init__(self,
fragment=200,
minPeriod=10,
lastzOpts="",
unmaskInput=False,
unmaskOutput=False,
proportionSampled=1.0):
self.fragm... | true | true |
f742676181fdba83b973d2076831baee8e43771f | 1,258 | py | Python | setup.py | ta4tsering/pedurma | 9b45466c230f1c108c1067686aef49c6cee99e3e | [
"MIT"
] | null | null | null | setup.py | ta4tsering/pedurma | 9b45466c230f1c108c1067686aef49c6cee99e3e | [
"MIT"
] | null | null | null | setup.py | ta4tsering/pedurma | 9b45466c230f1c108c1067686aef49c6cee99e3e | [
"MIT"
] | null | null | null | import re
import setuptools
from pathlib import Path
with open("README.md", "r") as fh:
long_description = fh.read()
def get_version(prop, project):
project = Path(__file__).parent / project / "__init__.py"
result = re.search(
r'{}\s*=\s*[\'"]([^\'"]*)[\'"]'.format(prop), project.read_text()
)... | 29.952381 | 73 | 0.631161 | import re
import setuptools
from pathlib import Path
with open("README.md", "r") as fh:
long_description = fh.read()
def get_version(prop, project):
project = Path(__file__).parent / project / "__init__.py"
result = re.search(
r'{}\s*=\s*[\'"]([^\'"]*)[\'"]'.format(prop), project.read_text()
)... | true | true |
f7426767471745f7e125b74e915093a93d0700b1 | 619 | py | Python | setup.py | tonysimpson/example-snap | a5c77e3fe9882915a40546a234a8246eacfac21e | [
"MIT"
] | null | null | null | setup.py | tonysimpson/example-snap | a5c77e3fe9882915a40546a234a8246eacfac21e | [
"MIT"
] | null | null | null | setup.py | tonysimpson/example-snap | a5c77e3fe9882915a40546a234a8246eacfac21e | [
"MIT"
] | null | null | null | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="treemaker",
version="0.0.1",
author="Tony Simpson",
author_email="agjasimpson@gmail.com",
description="Prints command line trees",
long_description=long_description,
long_descripti... | 28.136364 | 54 | 0.668821 | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="treemaker",
version="0.0.1",
author="Tony Simpson",
author_email="agjasimpson@gmail.com",
description="Prints command line trees",
long_description=long_description,
long_descripti... | true | true |
f74267bc9a49eddb54e239c50dbc6759bf235367 | 1,600 | py | Python | am_driver/scripts/calculate_angle.py | vincent0628/mower | 99982d56ca3c7044f0010afbdc775b415a5ed46f | [
"MIT"
] | null | null | null | am_driver/scripts/calculate_angle.py | vincent0628/mower | 99982d56ca3c7044f0010afbdc775b415a5ed46f | [
"MIT"
] | null | null | null | am_driver/scripts/calculate_angle.py | vincent0628/mower | 99982d56ca3c7044f0010afbdc775b415a5ed46f | [
"MIT"
] | null | null | null | #! /usr/bin/env python
import rospy
from sensor_msgs.msg import NavSatFix, Imu
from tf.transformations import euler_from_quaternion
from std_msgs.msg import Float64
from geometry_msgs.msg import Point, Twist
import math
import utm
import numpy as np
x, y, theta = 0.0, 0.0, 0.0
xx, yy = [], []
def newGPS(msg):
g... | 25 | 71 | 0.604375 |
import rospy
from sensor_msgs.msg import NavSatFix, Imu
from tf.transformations import euler_from_quaternion
from std_msgs.msg import Float64
from geometry_msgs.msg import Point, Twist
import math
import utm
import numpy as np
x, y, theta = 0.0, 0.0, 0.0
xx, yy = [], []
def newGPS(msg):
global x, xx, y, yy
... | true | true |
f7426806fb5a4df40025191f9dddb097b3a7a3ef | 39,976 | py | Python | test/functional/rpc_psbt.py | MrCryptoBeast/WWW | 857e860df0aa1bc7fde2ee6f5918ff32933beeb3 | [
"MIT"
] | null | null | null | test/functional/rpc_psbt.py | MrCryptoBeast/WWW | 857e860df0aa1bc7fde2ee6f5918ff32933beeb3 | [
"MIT"
] | null | null | null | test/functional/rpc_psbt.py | MrCryptoBeast/WWW | 857e860df0aa1bc7fde2ee6f5918ff32933beeb3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2018-2020 The worldwideweb Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the Partially Signed Transaction RPCs.
"""
from decimal import Decimal
from itertools import... | 61.125382 | 584 | 0.675555 |
from decimal import Decimal
from itertools import product
from test_framework.descriptors import descsum_create
from test_framework.key import ECKey
from test_framework.test_framework import worldwidewebTestFramework
from test_framework.util import (
assert_approx,
assert_equal,
assert_greater_than,
... | true | true |
f7426a3fc7edc99817a4e8e553fd51efbad90914 | 489 | py | Python | backend/src/baserow/contrib/database/tokens/exceptions.py | cjh0613/baserow | 62871f5bf53c9d25446976031aacb706c0abe584 | [
"MIT"
] | 839 | 2020-07-20T13:29:34.000Z | 2022-03-31T21:09:16.000Z | backend/src/baserow/contrib/database/tokens/exceptions.py | jacklicn/baserow | 978d9462ededbaa96674a6653028ba19876ea273 | [
"MIT"
] | 28 | 2020-08-07T09:23:58.000Z | 2022-03-01T22:32:40.000Z | backend/src/baserow/contrib/database/tokens/exceptions.py | jacklicn/baserow | 978d9462ededbaa96674a6653028ba19876ea273 | [
"MIT"
] | 79 | 2020-08-04T01:48:01.000Z | 2022-03-27T13:30:54.000Z | class TokenDoesNotExist(Exception):
"""Raised when the requested token does not exist."""
class TokenDoesNotBelongToUser(Exception):
"""Raised when a token does not belong to a user."""
class MaximumUniqueTokenTriesError(Exception):
"""
Raised when the maximum tries has been exceeded while generatin... | 25.736842 | 86 | 0.721881 | class TokenDoesNotExist(Exception):
class TokenDoesNotBelongToUser(Exception):
class MaximumUniqueTokenTriesError(Exception):
class NoPermissionToTable(Exception):
| true | true |
f7426a43de4bc79db10650975e3ae35c1b234ea4 | 24,182 | py | Python | sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/operations/_scope_maps_operations.py | GabrielHobold/azure-sdk-for-python | 7248645bcb0d590eafdae6ffc9d25ec688a0ff68 | [
"MIT"
] | null | null | null | sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/operations/_scope_maps_operations.py | GabrielHobold/azure-sdk-for-python | 7248645bcb0d590eafdae6ffc9d25ec688a0ff68 | [
"MIT"
] | null | null | null | sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/operations/_scope_maps_operations.py | GabrielHobold/azure-sdk-for-python | 7248645bcb0d590eafdae6ffc9d25ec688a0ff68 | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 48.852525 | 188 | 0.675792 |
import uuid
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError
from msrest.polling import LROPoller, NoPolling
from msrestazure.polling.arm_polling import ARMPolling
from .. import models
class ScopeMapsOperations(object):
models = models
def __init... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.